修复大部分页面状态组件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

@@ -63,7 +63,7 @@
<view class="th p-3">领取/使用限制</view>
<view class="th p-3">领取日期</view>
<view class="th p-2">发布数量</view>
<view class="th p-2">是否开启</view>
<view class="th p-2">状态</view>
<view class="th p-1 op-cell shadow-left">操作</view>
</view>
@@ -102,9 +102,10 @@
</view>
</view>
<view class="td p-2">
<view :class="['switch-box', item.isOpen ? 'active' : '']" @click="toggleStatus(index)">
<view class="switch-dot"></view>
</view>
<StatusSwitch
:modelValue="item.isOpen"
@update:modelValue="(val : boolean) => onToggleStatus(index, val)"
/>
</view>
<!-- 操作列Sticky 固定 -->
<view class="td p-1 op-cell shadow-left">
@@ -199,6 +200,7 @@
<script setup lang="uts">
import { ref, reactive, onMounted, computed } from 'vue'
import StatusSwitch from '@/components/StatusSwitch.uvue'
import supa from '@/components/supadb/aksupainstance.uts'
interface CouponItem {
@@ -704,29 +706,6 @@ onMounted(() => {
.op-split { color: #e8eaec; margin: 0; font-size: 12px; }
.text-danger { color: #ed4014; }
/* Switch 开关 */
.switch-box {
width: 40px;
height: 20px;
background-color: #dcdfe6;
border-radius: 10px;
position: relative;
transition: all 0.3s;
cursor: pointer;
}
.switch-box.active { background-color: #19be6b; }
.switch-dot {
width: 16px;
height: 16px;
background-color: #fff;
border-radius: 8px;
position: absolute;
top: 2px;
left: 2px;
transition: all 0.3s;
}
.switch-box.active .switch-dot { transform: translateX(20px); }
/* 📱 响应式媒体查询 (Priority 策略) */
/* 平板:隐藏次要列 */
@media screen and (max-width: 1450px) {