From 6d54fb64df667c0c396fc7d74aeed9e096d95f95 Mon Sep 17 00:00:00 2001 From: 陶杰 <1378534974@qq.com> Date: 星期三, 11 九月 2024 10:36:50 +0800 Subject: [PATCH] Merge branch 'v2' of ssh://47.96.225.205:29418/hmy_farmer-main into v2 --- sub_pages/customer/coupon/good-self.vue | 16 +++++++++------- 1 files changed, 9 insertions(+), 7 deletions(-) diff --git a/sub_pages/customer/coupon/good-self.vue b/sub_pages/customer/coupon/good-self.vue index 547ac56..161a778 100644 --- a/sub_pages/customer/coupon/good-self.vue +++ b/sub_pages/customer/coupon/good-self.vue @@ -16,6 +16,8 @@ <view class="info flex1"> <view class="title"> {{item.name||''}} + <radio :checked="isIngood(item)" @click.stop="updateSelectGood(item)" v-if="source==='shopping'" class="select-coupon"></radio> + </view> <view class="time word-e"> {{item.description||''}} @@ -23,9 +25,9 @@ <view class="button" @click="getPointGood(item)" v-if="source!=='shopping'"> 查看详情 </view> - <view class="button" @click="updateSelectGood(item)" v-if="source=='shopping'"> + <!-- <view class="button" @click="updateSelectGood(item)" v-if="source=='shopping'"> {{isIngood(item)?'移除':'添加'}} - </view> + </view> --> </view> </view> <!-- <view class="tip"> @@ -104,7 +106,7 @@ methods: { isIngood(item) { for (var tmp of this.cache_goods) { - if (tmp.id == item.id) { + if (tmp.goodsId == item.goodsId) { return true } } @@ -114,7 +116,7 @@ async updateSelectGood(item) { var has = false for (var tmp of this.cache_goods) { - if (tmp.id == item.id) { + if (tmp.goodsId == item.goodsId) { has = true break } @@ -125,7 +127,7 @@ //移除 var arr = [] for (var tmp of this.cache_goods) { - if (tmp.id == item.id) {} else { + if (tmp.goodsId == item.goodsId) {} else { arr.push(tmp) } } @@ -136,7 +138,7 @@ } arr.push(item) } - await this.$store.dispatch('cache_coupon_select', arr) + await this.$store.dispatch('cache_goods_select', arr) this.$forceUpdate() }, @@ -147,7 +149,7 @@ }, getPointGood(item) { uni.navigateTo({ - url: `/sub_pages/customer/coupon/good-detail?id=${item.id}` + url: `/sub_pages/customer/coupon/good-detail?id=${item.goodsId}` }) }, toGoodAll() { -- Gitblit v1.9.3