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] : []