From ba6fe53d97201c2cf577a1fb0906c819ea3cae33 Mon Sep 17 00:00:00 2001 From: xuxueyang <xuxy@fengyuntec.com> Date: 星期二, 30 七月 2024 00:05:20 +0800 Subject: [PATCH] 1 --- sub_pages/customer/shopping/shopping.vue | 19 +++++++++++++------ 1 files changed, 13 insertions(+), 6 deletions(-) diff --git a/sub_pages/customer/shopping/shopping.vue b/sub_pages/customer/shopping/shopping.vue index 20252e0..3ff5488 100644 --- a/sub_pages/customer/shopping/shopping.vue +++ b/sub_pages/customer/shopping/shopping.vue @@ -30,9 +30,9 @@ <image class="img img100 m-r-6 br-4" :src="dto.url||dto.cover"></image> <view class="flex1"> <view class="title"><span class="m-r-5" - style="display: inline-block;">{{item.categoryStr||''}}</span><span - v-if="item.levelStr" class="m-r-5" - style="display: inline-block;">{{ item.levelStr || '' }}</span>{{ dto.name || '-' }} + style="display: inline-block;">{{dto.categoryStr||''}}</span><span + v-if="dto.levelStr" class="m-r-5" + style="display: inline-block;">{{ dto.levelStr || '' }}</span>{{ dto.name || '-' }} </view> <view class="price"> {{ dto.price || '-' }}元/扎 @@ -174,8 +174,8 @@ this.ids.splice(this.ids.indexOf(item.id), 1) } for (var i = 0; i < this.list.length; i++) { - if (this.list[i].id === item.supplierId) { - this.list[i].splice(i, 1) + if (this.list[i].supplierId === item.supplierId) { + // this.list[i].flowerList.splice(i, 1) if (this.list[i].flowerList.length === 1) { if (this.ids.indexOf('supplier@' + this.list[i].supplierId) >= 0) { this.ids.splice(this.ids.indexOf('supplier@' + this.list[i].supplierId), 1) @@ -186,16 +186,18 @@ //只需要清楚这个元素 var k = -1 for (var j = 0; j < this.list[i].flowerList.length; j++) { - if (this.list[i][j].id === item.id) { + if (this.list[i].flowerList[j].id === item.id) { k = j; break } } this.list[i].flowerList.splice(k, 1) } + this.$forceUpdate() break } } + console.log('this.list',this.list) } }, @@ -270,6 +272,11 @@ this.$message.hideLoading() if (code === 0) { dto.num += addnum + if (dto.num < 1) { + //id删除清空,并且 + await this.clickSwipeButton(dto) + // await this.init() + } } }, async init() { -- Gitblit v1.9.3