修复大部分页面状态组件2

This commit is contained in:
2026-03-09 16:12:51 +08:00
parent 05049e728e
commit 80acd0fd2e
5 changed files with 26 additions and 191 deletions

View File

@@ -50,7 +50,7 @@
<text class="col-80 center">抽奖次数</text>
<text class="col-80 center">中奖次数</text>
<text class="col-80 center">活动状态</text>
<text class="col-80 center">开启状态</text>
<text class="col-80 center">状态</text>
<text class="col-180">活动时间</text>
<text class="col-120 center">操作</text>
</view>
@@ -68,9 +68,7 @@
<text class="status-text">{{ item.statusText }}</text>
</view>
<view class="col-80 center">
<view class="switch-box" :class="item.isOpen ? 'active' : ''" @click="toggleStatus(item)">
<view class="switch-dot"></view>
</view>
<StatusSwitch v-model="item.isOpen" />
</view>
<view class="col-180">
<view class="time-range">
@@ -106,7 +104,12 @@
</template>
<script uts>
import StatusSwitch from '@/components/StatusSwitch.uvue'
export default {
components: {
StatusSwitch
},
data() {
return {
searchQuery: '',
@@ -204,10 +207,6 @@ export default {
},
handleSearch() {
uni.showToast({ title: '搜索', icon: 'none' })
},
toggleStatus(item : any) {
item.isOpen = !item.isOpen
uni.showToast({ title: '状态已变更', icon: 'none' })
}
}
}
@@ -334,33 +333,6 @@ export default {
.id-text { font-size: 13px; color: #808695; }
.status-text { font-size: 13px; color: #515a6e; }
/* 开关组件 */
.switch-box {
width: 40px;
height: 20px;
background-color: #ccc;
border-radius: 10px;
position: relative;
transition: background-color 0.3s;
cursor: pointer;
}
.switch-box.active {
background-color: #2d8cf0;
}
.switch-dot {
width: 16px;
height: 16px;
background-color: #fff;
border-radius: 50%;
position: absolute;
top: 2px;
left: 2px;
transition: transform 0.3s;
}
.switch-box.active .switch-dot {
transform: translateX(20px);
}
.time-range {
display: flex;
flex-direction: column;