|
@@ -269,7 +269,7 @@
|
|
|
uni.hideLoading()
|
|
|
if (res.status == 200) {
|
|
|
this.couponList = res.data
|
|
|
- this.checkedCoupon = this.couponList[0]
|
|
|
+ this.checkedCoupon = this.findCouponMax()
|
|
|
// 计算合计
|
|
|
this.getFinalAmount()
|
|
|
} else {
|
|
@@ -278,7 +278,13 @@
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
-
|
|
|
+ // 查找优惠卷中优惠金额最大得
|
|
|
+ findCouponMax(){
|
|
|
+ let ret = this.couponList.sort((a,b)=>{
|
|
|
+ return b.couponAmount-a.couponAmount
|
|
|
+ })
|
|
|
+ return ret[0]
|
|
|
+ },
|
|
|
// 计算合计
|
|
|
getFinalAmount() {
|
|
|
this.amount = this.itemList[this.serverIndex].currentPrice
|