Fix(商品详情):[#1930优惠券换行问题
This commit is contained in:
@@ -59,6 +59,9 @@
|
||||
font-size: 24rpx;
|
||||
text-align: right;
|
||||
}
|
||||
.value2 {
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.red {
|
||||
color: #FF564A;
|
||||
|
||||
@@ -154,19 +154,20 @@
|
||||
|
||||
<!-- v6服务项目开始 -->
|
||||
<view class="service-section goods-section" v-if="storeInfo && storeInfo.isTickets!=1">
|
||||
<view class="cell flex jc-between ai-center" @click="changeCoupons()" v-if="couponList['usable'].length>0">
|
||||
<view>
|
||||
<template v-for="(item, index) in couponList.usable">
|
||||
<text
|
||||
v-if="index < 2"
|
||||
:key="index"
|
||||
class="coupon-label tc"
|
||||
>
|
||||
{{ item.couponTitle }}
|
||||
</text>
|
||||
</template>
|
||||
<view
|
||||
v-if="couponListLimit2ToShow.length > 0"
|
||||
class="cell flex jc-between ai-center"
|
||||
@click="changeCoupons()"
|
||||
>
|
||||
<view
|
||||
v-for="(item, index) in couponListLimit2ToShow"
|
||||
:key="index"
|
||||
class="coupon-label tc"
|
||||
>
|
||||
{{ item.couponTitle }}
|
||||
</view>
|
||||
<view class="value">优惠详情
|
||||
<view class="value value2">
|
||||
优惠详情
|
||||
<uni-icons type="right" size="13" color="#707070"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
@@ -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] : []
|
||||
|
||||
Reference in New Issue
Block a user