Fix: 【商城小程序】结算页面直接默认使用当前可用减免金额最大的优惠券
This commit is contained in:
@@ -159,7 +159,9 @@ export default {
|
|||||||
largOne() {
|
largOne() {
|
||||||
if(this.list[this.maxIndex]) {
|
if(this.list[this.maxIndex]) {
|
||||||
this.selectCoupon(this.list[this.maxIndex].id)
|
this.selectCoupon(this.list[this.maxIndex].id)
|
||||||
|
uni.setStorageSync('couponId', this.list[this.maxIndex].id)
|
||||||
}
|
}
|
||||||
|
this.$emit('max', this.list[this.maxIndex] || {})
|
||||||
return this.list[this.maxIndex] || {}
|
return this.list[this.maxIndex] || {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -109,7 +109,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="v12-justify-between v12-align-center">
|
<view class="v12-justify-between v12-align-center">
|
||||||
<view class="v12-mr-2" @click="changeCoupons" v-if="couponList.usable.length === 0">
|
<view class="v12-mr-2" @click="changeCoupons" v-if="couponList.usable.length !== 0">
|
||||||
<text class="v12-dark-text v12-font-24" >{{ couponList.usable.length === 0 ? '无' : '去选择' }}</text>
|
<text class="v12-dark-text v12-font-24" >{{ couponList.usable.length === 0 ? '无' : '去选择' }}</text>
|
||||||
<text class="iconfont icon-jiantou v12-font-24 v12-dark-text"></text>
|
<text class="iconfont icon-jiantou v12-font-24 v12-dark-text"></text>
|
||||||
</view>
|
</view>
|
||||||
@@ -252,6 +252,7 @@
|
|||||||
:two-list="couponList"
|
:two-list="couponList"
|
||||||
@change="changeCoupons"
|
@change="changeCoupons"
|
||||||
:currentPrice="force2Decimal(orderPrice.totalPrice)"
|
:currentPrice="force2Decimal(orderPrice.totalPrice)"
|
||||||
|
@max="couponMax"
|
||||||
:show-tab="false"
|
:show-tab="false"
|
||||||
/>
|
/>
|
||||||
</u-popup>
|
</u-popup>
|
||||||
@@ -417,6 +418,10 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
isNullOrEmpty,
|
isNullOrEmpty,
|
||||||
|
couponMax(e) {
|
||||||
|
this.couponTitle = e.couponTitle
|
||||||
|
this.couponId = uni.getStorageSync('couponId') || 0
|
||||||
|
},
|
||||||
showStoreList() {
|
showStoreList() {
|
||||||
this.$store.commit("get_to", "orders");
|
this.$store.commit("get_to", "orders");
|
||||||
this.$yrouter.push({
|
this.$yrouter.push({
|
||||||
@@ -769,7 +774,7 @@ export default {
|
|||||||
},
|
},
|
||||||
// v9-2
|
// v9-2
|
||||||
changeCoupons(item) {
|
changeCoupons(item) {
|
||||||
|
if(!item) return
|
||||||
if (this.couponList.usable.length === 0) return
|
if (this.couponList.usable.length === 0) return
|
||||||
this.show = !this.show
|
this.show = !this.show
|
||||||
this.couponId = uni.getStorageSync('couponId') || 0
|
this.couponId = uni.getStorageSync('couponId') || 0
|
||||||
|
|||||||
Reference in New Issue
Block a user