From 8840efb29d8818afcfd2176914bcf4811d9c60fe Mon Sep 17 00:00:00 2001 From: 陶杰 <1378534974@qq.com> Date: 星期三, 11 九月 2024 15:38:31 +0800 Subject: [PATCH] 1.粉丝数数据量统计 2.点赞设置为0 --- sub_pages/supplier/flower-manage/flower-manage.vue | 149 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 144 insertions(+), 5 deletions(-) diff --git a/sub_pages/supplier/flower-manage/flower-manage.vue b/sub_pages/supplier/flower-manage/flower-manage.vue index 6d2ce88..701e9f1 100644 --- a/sub_pages/supplier/flower-manage/flower-manage.vue +++ b/sub_pages/supplier/flower-manage/flower-manage.vue @@ -7,17 +7,27 @@ <view @click.stop="clickButton('inpass')" class="button button-search-inpass" style="flex:5"></view> <view @click.stop="clickButton('delete')" class="button button-search-delete" style="margin-top: -1rpx;"> </view> - </view> + + <view class="recycle-button" v-if="type==='delete'"> + <view class="buttons" > + <view v-if="type === 'delete'" class="button t-red" @click.stop="deleteSelected()">删除</view> + <view v-if="type === 'delete'" class="button" @click.stop="recoverSelected()">恢复</view> + </view> + </view> + <view class="p15" style="min-height: calc(100vh - 500rpx);"> <no-data v-if="!list||list.length==0" style="width: 100%;"></no-data> + <view v-for="(item,index) in list" :key="index" class="m-b-24 flow-manage-list"> + <!-- <view v-if="type === 'delete'"><checkbox class="checkbox" :value="item.id" v-model="selectedFlowers" /> </view> + --> + <view class="flow-manage-list-item-radio" v-if="type === 'delete'"><radio :checked="isSelected(item.id)" @click="changeItem(item)"></radio></view> <view class="flow-manage-list-item"> <view class="flex m-r-6"> - <view class="img flower-img m-r-6"> + <view class="img flower-img m-r-6"> <image class="flower-img img100 " :src="item.cover" :class="[!item.stock?'component-stock-zero':'']" @click="previewImg(item.cover)"> - </image> <view class="status" :class="[!item.stock?'zero':'']" v-if="item.statusStr"> {{ item.statusStr}} @@ -27,6 +37,8 @@ <view class="flex1"> <view class=" flex"> <view class="title">{{item.name}}<span class="level">{{item.levelStr}}</span></view> + <view class="m-l-a m-r-0" ><span class="label">排名</span><span class="value">{{item.typeRank || '-'}}</span></view> + <view class="m-l-a m-r-0"> {{item.categoryStr || '-'}} </view> @@ -77,7 +89,7 @@ <view class="button" @click.stop="openValue(item,'stock')">库存</view> <view class="button" @click.stop="toDetailAdd(item)">复制</view> - <view class="button t-red" @click.stop="buttonDelete(item)">删除</view> + <view v-if="type !== 'delete' && (item.status==='OFF' || item.status==='FORCE_OFF') " class="button t-red" @click.stop="buttonDelete(item)">删除</view> </view> </view> @@ -133,6 +145,8 @@ currentInputDto: {}, currentInputKey: '', inputplaceholder: '', + selectedFlowers: [], // 存储选中的花的 ID + ids: [], } }, onShow() { @@ -304,6 +318,78 @@ }) } }, + // 删除选中的花卉 + async deleteSelected() { + if (this.selectedFlowers.length === 0) { + this.$message.showToast('请选择要删除的商品'); + return; + } + + // 确认框 + await this.$message.confirm('确定删除此商品吗') + + var dto = { + ids: this.selectedFlowers, + } + + this.$message.showLoading() + this.$http.request('post', '/api/supplier/flower/list/delete/batch' , { + data: dto + }).then(res => { + if (res.code == 0) { + this.$message.showToast('操作成功') + this.refreshList() + + } + }).finally(() => { + this.$message.hideLoading() + }) + + + }, + async recoverSelected() { + if (this.selectedFlowers.length === 0) { + this.$message.showToast('请选择恢复的商品'); + return; + } + + // 确认框 + await this.$message.confirm('确定恢复此商品吗') + + var dto = { + ids: this.selectedFlowers, + } + + this.$message.showLoading() + this.$http.request('post', '/api/supplier/flower/list/restore/batch' , { + data: dto + }).then(res => { + if (res.code == 0) { + this.$message.showToast('操作成功') + this.refreshList() + } + }).finally(() => { + this.$message.hideLoading() + }) + + + }, + changeItem(item) { + const id = item.id; + // 判断selectedFlowers里面是否有item.id, 如果有则去掉,没有就加入 + if (this.selectedFlowers.includes(id)) { + // 移除选中的ID + this.selectedFlowers = this.selectedFlowers.filter(flowerId => flowerId !== id); + } else { + // 添加选中的ID + this.selectedFlowers.push(id); + } + }, + isSelected(id) { + // 检查ID是否在selectedFlowers中 + return this.selectedFlowers.includes(id); + } + } } </script> @@ -317,6 +403,12 @@ // padding: 20rpx 30rpx; padding: 22rpx 22rpx 20rpx 22rpx; background-color: #fff; + display: flex; + + .flow-manage-list-item-radio{ + width: 50rpx; + height: 50rpx; + } .flow-manage-list-item { .title { @@ -332,6 +424,25 @@ line-height: 40rpx; margin-left: 20rpx; } + } + .label { + + font-weight: 400; + font-size: 24rpx; + color: #666666; + text-align: left; + // padding-left: 10rpx; + // padding-right: 10rpx; + } + + .label::after { + content: ": " + } + + .value { + font-weight: 400; + font-size: 24rpx; + color: #666666; } .buttons { @@ -413,7 +524,7 @@ } } } - + .top-buttons { display: flex; padding: 22rpx 42rpx; @@ -468,5 +579,33 @@ } } + + .recycle-button{ + + + + min-height: 50rpx; + background-color: #fff; + + .buttons { + display: flex; + justify-content: flex-end; + background-color: #fff; + padding: 22rpx 42rpx; + + .button { + margin: 0 auto; + width: 98rpx; + line-height: 48rpx; + border-radius: 24rpx; + border: 2rpx solid #CECECE; + text-align: center; + font-size: 24rpx; + color: #666666; + line-height: 34rpx; + } + } + } + } </style> \ No newline at end of file -- Gitblit v1.9.3