소스 검색

【Add】优惠券增加排除范围

liuxiangxin 5 달 전
부모
커밋
009de23e03
3개의 변경된 파일465개의 추가작업 그리고 362개의 파일을 삭제
  1. 13 0
      pages/car/order.vue
  2. 1 0
      pages/coupon/index.vue
  3. 451 362
      pages/product/index.vue

+ 13 - 0
pages/car/order.vue

@@ -176,6 +176,19 @@
 										if( isScope ){
 											totalPrice = this.$decimal.add(totalPrice,this.$decimal.mul(this.cartList[j].price,this.cartList[j].buy_num));
 										}
+									// 如果排除商品
+									}else if( this.couponList[i].type_id == 3 ){
+										// 判断商品是不是在排除范围
+										var isExclude = false;
+										// 循环排除范围
+										for (let k in this.couponList[i].product_exclude) {
+											// 如果存在排除范围
+											if( this.couponList[i].product_exclude[k].product_id == this.cartList[j].product_id) isExclude = true;
+										}
+										// 不在排除内的做计算
+										if( !isExclude ){
+											totalPrice = this.$decimal.add(totalPrice,this.$decimal.mul(this.cartList[j].price,this.cartList[j].buy_num));
+										}
 									// 店铺券
 									}else{
 										// 折扣券以及满减券的话,计算价格

+ 1 - 0
pages/coupon/index.vue

@@ -32,6 +32,7 @@
 						<view class="product_scope">
 							<text class="" v-if="item.type_id == 1">限定商品可用</text>
 							<text class="" v-if="item.type_id == 2">全场可用</text>
+							<text class="" v-if="item.type_id == 3">部分商品不可用</text>
 						</view>
 						<view class="coupon_info">
 							<view class="coupon_exp">{{item.exp_time}} 到期</view>

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 451 - 362
pages/product/index.vue


이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.