|
@@ -120,7 +120,7 @@
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="check" v-if="batchMode">
|
|
<view class="check" v-if="batchMode">
|
|
|
- <view :class="['dot', selectedIds.includes(item.id) ? 'on' : '']">
|
|
|
|
|
|
|
+ <view :class="['dot', selectionDisabled ? 'disabled' : '', selectedIds.includes(item.id) ? 'on' : '']">
|
|
|
<u-icon v-if="selectedIds.includes(item.id)" name="checkmark" color="#fff" size="20"></u-icon>
|
|
<u-icon v-if="selectedIds.includes(item.id)" name="checkmark" color="#fff" size="20"></u-icon>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
@@ -135,8 +135,8 @@
|
|
|
<view class="primary-btn" @click="goCreate">新建菜品</view>
|
|
<view class="primary-btn" @click="goCreate">新建菜品</view>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="batch-footer" v-else>
|
|
<view class="batch-footer" v-else>
|
|
|
- <view class="all" @click="toggleAll">
|
|
|
|
|
- <view :class="['dot', isAllSelected ? 'on' : '']">
|
|
|
|
|
|
|
+ <view :class="['all', selectionDisabled ? 'disabled' : '']" @click="toggleAll">
|
|
|
|
|
+ <view :class="['dot', selectionDisabled ? 'disabled' : '', isAllSelected ? 'on' : '']">
|
|
|
<u-icon v-if="isAllSelected" name="checkmark" color="#fff" size="20"></u-icon>
|
|
<u-icon v-if="isAllSelected" name="checkmark" color="#fff" size="20"></u-icon>
|
|
|
</view>
|
|
</view>
|
|
|
全选
|
|
全选
|
|
@@ -144,7 +144,7 @@
|
|
|
<view class="batch-btns">
|
|
<view class="batch-btns">
|
|
|
<template v-if="filterStatus === '' || filterStatus === 'reviewing'">
|
|
<template v-if="filterStatus === '' || filterStatus === 'reviewing'">
|
|
|
<view class="b-btn disabled">批量删除</view>
|
|
<view class="b-btn disabled">批量删除</view>
|
|
|
- <view :class="['b-btn', selectedOffIds.length ? 'danger' : 'disabled']" @click="batchOff">批量下架</view>
|
|
|
|
|
|
|
+ <view class="b-btn disabled">批量下架</view>
|
|
|
<view class="b-btn disabled">批量上架</view>
|
|
<view class="b-btn disabled">批量上架</view>
|
|
|
</template>
|
|
</template>
|
|
|
<template v-else-if="filterStatus === 'selling' || filterStatus === 'soldout'">
|
|
<template v-else-if="filterStatus === 'selling' || filterStatus === 'soldout'">
|
|
@@ -260,10 +260,8 @@ export default {
|
|
|
const ids = list.map((i) => i.id);
|
|
const ids = list.map((i) => i.id);
|
|
|
return ids.length > 0 && ids.every((id) => this.selectedIds.includes(id));
|
|
return ids.length > 0 && ids.every((id) => this.selectedIds.includes(id));
|
|
|
},
|
|
},
|
|
|
- selectedOffIds() {
|
|
|
|
|
- return this.currentList
|
|
|
|
|
- .filter((item) => this.selectedIds.includes(item.id) && (item.status === 'selling' || item.status === 'soldout'))
|
|
|
|
|
- .map((item) => item.id);
|
|
|
|
|
|
|
+ selectionDisabled() {
|
|
|
|
|
+ return this.filterStatus === '';
|
|
|
},
|
|
},
|
|
|
bannerVisible() {
|
|
bannerVisible() {
|
|
|
return this.applyStatus !== 1;
|
|
return this.applyStatus !== 1;
|
|
@@ -354,7 +352,6 @@ export default {
|
|
|
this.reloadList();
|
|
this.reloadList();
|
|
|
},
|
|
},
|
|
|
openPicker(type) {
|
|
openPicker(type) {
|
|
|
- if (this.batchMode) return;
|
|
|
|
|
if (this.pickerShow && this.pickerType === type) {
|
|
if (this.pickerShow && this.pickerType === type) {
|
|
|
this.closePicker();
|
|
this.closePicker();
|
|
|
return;
|
|
return;
|
|
@@ -398,12 +395,13 @@ export default {
|
|
|
this.selectedIds = [];
|
|
this.selectedIds = [];
|
|
|
},
|
|
},
|
|
|
toggleSelect(item) {
|
|
toggleSelect(item) {
|
|
|
- if (!this.batchMode) return;
|
|
|
|
|
|
|
+ if (!this.batchMode || this.selectionDisabled) return;
|
|
|
const i = this.selectedIds.indexOf(item.id);
|
|
const i = this.selectedIds.indexOf(item.id);
|
|
|
if (i >= 0) this.selectedIds.splice(i, 1);
|
|
if (i >= 0) this.selectedIds.splice(i, 1);
|
|
|
else this.selectedIds.push(item.id);
|
|
else this.selectedIds.push(item.id);
|
|
|
},
|
|
},
|
|
|
toggleAll() {
|
|
toggleAll() {
|
|
|
|
|
+ if (this.selectionDisabled) return;
|
|
|
if (this.isAllSelected) this.selectedIds = [];
|
|
if (this.isAllSelected) this.selectedIds = [];
|
|
|
else this.selectedIds = this.currentList.map((i) => i.id);
|
|
else this.selectedIds = this.currentList.map((i) => i.id);
|
|
|
},
|
|
},
|
|
@@ -478,7 +476,7 @@ export default {
|
|
|
return true;
|
|
return true;
|
|
|
},
|
|
},
|
|
|
async batchOff() {
|
|
async batchOff() {
|
|
|
- const ids = this.filterStatus === '' ? this.selectedOffIds : this.selectedIds;
|
|
|
|
|
|
|
+ const ids = this.selectedIds;
|
|
|
if (!ids.length) {
|
|
if (!ids.length) {
|
|
|
uni.showToast({ title: '请先选择在售菜品', icon: 'none' });
|
|
uni.showToast({ title: '请先选择在售菜品', icon: 'none' });
|
|
|
return;
|
|
return;
|
|
@@ -677,6 +675,10 @@ export default {
|
|
|
background: #449aff;
|
|
background: #449aff;
|
|
|
border-color: #449aff;
|
|
border-color: #449aff;
|
|
|
}
|
|
}
|
|
|
|
|
+ &.disabled {
|
|
|
|
|
+ background: #f0f0f0;
|
|
|
|
|
+ border-color: #ddd;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
.thumb-wrap {
|
|
.thumb-wrap {
|
|
|
width: 160rpx;
|
|
width: 160rpx;
|
|
@@ -821,6 +823,9 @@ export default {
|
|
|
align-items: center;
|
|
align-items: center;
|
|
|
font-size: 26rpx;
|
|
font-size: 26rpx;
|
|
|
margin-right: 20rpx;
|
|
margin-right: 20rpx;
|
|
|
|
|
+ &.disabled {
|
|
|
|
|
+ color: #bbb;
|
|
|
|
|
+ }
|
|
|
.dot {
|
|
.dot {
|
|
|
width: 36rpx;
|
|
width: 36rpx;
|
|
|
height: 36rpx;
|
|
height: 36rpx;
|
|
@@ -835,6 +840,10 @@ export default {
|
|
|
background: #449aff;
|
|
background: #449aff;
|
|
|
border-color: #449aff;
|
|
border-color: #449aff;
|
|
|
}
|
|
}
|
|
|
|
|
+ &.disabled {
|
|
|
|
|
+ background: #f0f0f0;
|
|
|
|
|
+ border-color: #ddd;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
.batch-btns {
|
|
.batch-btns {
|