From 7e668cc6d5fb01e85c9eeb057a07b4db1d118587 Mon Sep 17 00:00:00 2001 From: mabo Date: Tue, 25 May 2021 14:26:48 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=A1=E7=90=86=E7=AB=AF=EF=BC=8C=E5=95=86?= =?UTF-8?q?=E5=93=81=E5=9B=9E=E6=98=BE=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/lili-dialog/goods-dialog.vue | 24 +++- manager/src/views/lili-dialog/index.vue | 9 +- .../promotion/pointsGoods/addPointsGoods.vue | 129 ++++++++---------- .../promotion/pointsGoods/pointsGoods.vue | 11 +- .../views/promotion/seckill/seckillGoods.vue | 2 +- 5 files changed, 84 insertions(+), 91 deletions(-) diff --git a/manager/src/views/lili-dialog/goods-dialog.vue b/manager/src/views/lili-dialog/goods-dialog.vue index 1f374a8d..ed8cf77a 100644 --- a/manager/src/views/lili-dialog/goods-dialog.vue +++ b/manager/src/views/lili-dialog/goods-dialog.vue @@ -45,8 +45,6 @@ export default { type: "multiple", //单选或者多选 single multiple skuList: [], // 商品sku列表 - - selectedWay: [], //选中商品集合 total: "", // 商品总数 goodsParams: { // 商品请求参数 pageNumber: 1, @@ -64,7 +62,12 @@ export default { loading: false, // 加载状态 }; }, - props: ["clearFlag"], + props: { + selectedWay: { + type: Array, + default: new Array() + } + }, watch: { category(val) { this.goodsParams.categoryPath = val[0]; @@ -74,6 +77,7 @@ export default { this.$emit("selected", this.selectedWay); }, deep: true, + immediate: true }, "goodsParams.categoryPath": { @@ -110,6 +114,11 @@ export default { res.result.records.forEach((item) => { item.selected = false; item.___type = "goods"; //设置为goods让pc wap知道标识 + this.selectedWay.forEach(e => { + if (e.id === item.id) { + item.selected = true + } + }) }); /** * 解决数据请求中,滚动栏会一直上下跳动 @@ -117,7 +126,6 @@ export default { this.total = res.result.total; this.goodsData.push(...res.result.records); - // console.log(this.goodsData); } else { this.empty = true; } @@ -193,9 +201,13 @@ export default { this.selectedWay.push(val); } else { val.selected = false; - this.selectedWay.splice(index, 1); + for (let i = 0; i - +
- +