ソースを参照

commit -m 优惠券

zhengjinyi 3 年 前
コミット
9c086cad9c
1 ファイル変更5 行追加5 行削除
  1. 5 5
      components/cm-module/cart-components/index.vue

+ 5 - 5
components/cm-module/cart-components/index.vue

@@ -496,11 +496,11 @@
 			ischeck(item,pro){//为未选中的时候改变为true,反之为true
 				pro.productsChecked = !pro.productsChecked;
 				if(pro.productsChecked) {
-					if(!this.submitIds.includes(pro.productID*1)){
-						this.submitIds.push(pro.productID);
+					if(!this.submitIds.includes(pro.productId*1)){
+						this.submitIds.push(pro.productId);
 					}
 				} else {
-					var lent = this.submitIds.indexOf(pro.productID*1);
+					var lent = this.submitIds.indexOf(pro.productId*1);
 					if(lent >=0 ){
 						this.submitIds.splice(lent, 1);
 					}
@@ -703,8 +703,8 @@
 					let eligibleCoupons = this.calculationCoupon()
 					if(eligibleCoupons.length>0){
 						this.eligibleCoupons.splice(0,this.eligibleCoupons.length);
-						this.eligibleCoupons.push(eligibleCoupons[0])
-						this.couponPrice = this.eligibleCoupons.sort((a,b)=> b.couponAmount - a.couponAmount)[0].couponAmount
+						this.eligibleCoupons = eligibleCoupons.sort((a,b)=> b.couponAmount - a.couponAmount)
+						this.couponPrice = this.eligibleCoupons[0].couponAmount
 					}else{
 						this.couponPrice = 0
 					}