From 57a8c5a59dedfefe6b10bf0dbdf2e411de6bc36a Mon Sep 17 00:00:00 2001 From: lifizer <913626195@qq.com> Date: Wed, 17 Jul 2024 23:09:58 +0800 Subject: [PATCH] =?UTF-8?q?Fix(=E5=95=86=E5=93=81=E8=AF=A6=E6=83=85):[#193?= =?UTF-8?q?0=E4=BC=98=E6=83=A0=E5=88=B8=E6=8D=A2=E8=A1=8C=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/css/goods.less | 3 +++ pages/shop/GoodsCon/index.vue | 46 ++++++++++++++++++++++++----------- 2 files changed, 35 insertions(+), 14 deletions(-) diff --git a/assets/css/goods.less b/assets/css/goods.less index 7bcaab5..c86741e 100644 --- a/assets/css/goods.less +++ b/assets/css/goods.less @@ -59,6 +59,9 @@ font-size: 24rpx; text-align: right; } + .value2 { + width: auto; + } .red { color: #FF564A; diff --git a/pages/shop/GoodsCon/index.vue b/pages/shop/GoodsCon/index.vue index 74cf7c1..789d704 100644 --- a/pages/shop/GoodsCon/index.vue +++ b/pages/shop/GoodsCon/index.vue @@ -154,19 +154,20 @@ - - - + + + {{ item.couponTitle }} - 优惠详情 + + 优惠详情 @@ -507,8 +508,9 @@ export default { show: false, uniqueId: null, isFavorite: false, - pageKeyId: '' - }; + pageKeyId: '', + couponListLimit2ToShow: [] + } }, computed: mapGetters(["isLogin", "location", "userInfo"]), onShareAppMessage() { @@ -917,6 +919,22 @@ export default { // data.couponList['unusable']?.map(item => item.status = 2) this.$set(this, 'couponList', data.couponList) + const usableList = data.couponList.usable + if (usableList.length > 0) { + const tempType = {} + const tempTypeArr = [] + usableList.map(usableItem => { + if (!tempType[usableItem.type + '']) { + tempType[usableItem.type + ''] = 1 + tempTypeArr.push(usableItem) + } + }) + if (tempTypeArr.length >= 2) { + this.couponListLimit2ToShow = [tempTypeArr[0], tempTypeArr[1]] + } else { + this.couponListLimit2ToShow = [tempTypeArr[0]] + } + } this.$set(this, 'replyCount', data.replyCount) this.$set(this, 'replyChance', data.replyChance) this.reply = data.reply ? [data.reply] : []