|
@@ -143,25 +143,34 @@
|
143
|
143
|
</div> -->
|
144
|
144
|
|
145
|
145
|
<div v-if="1==1">
|
|
146
|
+ <div>
|
|
147
|
+ <div class="coupon-ps"
|
|
148
|
+ v-for="item,index in isSelectCoup"
|
|
149
|
+ :key="index">
|
|
150
|
+ <div>{{item.coupon_name}}</div>
|
|
151
|
+ <div class="cou-price"
|
|
152
|
+ v-if="item.type==4?true:false">抵扣{{item.projectName}}</div>
|
|
153
|
+ <div class="cou-price"
|
|
154
|
+ v-if="item.type==3?true:false">抵扣全部项目(除升级包)</div>
|
|
155
|
+ <div class="cou-price"
|
|
156
|
+ v-if="item.type==2?true:false">¥{{item.price}}</div>
|
|
157
|
+ <div class="cou-price"
|
|
158
|
+ v-if="item.type==1?true:false">¥{{item.price}}</div>
|
|
159
|
+ <!-- <div class="cou-price">-¥{{price}}</div> -->
|
|
160
|
+ </div>
|
|
161
|
+ </div>
|
146
|
162
|
<div class="coupon-ps"
|
147
|
|
- v-for="item,index in isSelectCoup"
|
148
|
|
- :key="index">
|
149
|
|
- <div>{{item.coupon_name}}</div>
|
150
|
|
- <div class="cou-price"
|
151
|
|
- v-if="item.type==4?true:false">抵扣{{item.projectName}}</div>
|
152
|
|
- <div class="cou-price"
|
153
|
|
- v-if="item.type==3?true:false">抵扣全部项目(除升级包)</div>
|
|
163
|
+ v-if="discount!=0">
|
|
164
|
+ <div></div>
|
|
165
|
+ <div v-if="discount!=20"
|
|
166
|
+ class="cou-price"> {{discount==100?'仪器免费体验':'新人5折优惠'}}</div>
|
154
|
167
|
<div class="cou-price"
|
155
|
|
- v-if="item.type==2?true:false">¥{{item.price}}</div>
|
156
|
|
- <div class="cou-price"
|
157
|
|
- v-if="item.type==1?true:false">¥{{item.price}}</div>
|
158
|
|
- <!-- <div class="cou-price">-¥{{price}}</div> -->
|
|
168
|
+ v-else-if=" isSelectCoup.length&&(order_data.project_list.length - isSelectCoup.length)>=3">{{'任意三个项目8折'}}</div>
|
159
|
169
|
</div>
|
160
|
170
|
</div>
|
161
|
|
-
|
162
|
171
|
</div>
|
163
|
172
|
<div class="over-price">
|
164
|
|
- 合计: <span class="price-num"><span class="min-size">¥</span>{{showMoney}}<span class="min-size"></span></span>
|
|
173
|
+ 合计: <span class="price-num"><span class="min-size">¥</span>{{isSelectCoup.length>0?showMoney:discountPrice}}<span class="min-size"></span></span>
|
165
|
174
|
</div>
|
166
|
175
|
</div>
|
167
|
176
|
<div class="payment"
|
|
@@ -339,7 +348,7 @@
|
339
|
348
|
@click="choicePayType=false"><img src="https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/icon/slices/delete.png"
|
340
|
349
|
alt=""></div>
|
341
|
350
|
<div class="pay-title">选择支付方式</div>
|
342
|
|
- <div class="pay-price">¥<span>{{showMoney}}</span></div>
|
|
351
|
+ <div class="pay-price">¥<span>{{isSelectCoup.length>0?showMoney:discountPrice}}</span></div>
|
343
|
352
|
<div class="pay-list">
|
344
|
353
|
<div class="pay-info"
|
345
|
354
|
v-for="item,index in payList"
|
|
@@ -369,7 +378,7 @@
|
369
|
378
|
alt=""></div>
|
370
|
379
|
<div v-if="isPayCode">
|
371
|
380
|
<div class="pay-title">请扫码支付</div>
|
372
|
|
- <div class="pay-price">¥<span>{{showMoney}}</span></div>
|
|
381
|
+ <div class="pay-price">¥<span>{{isSelectCoup.length>0?showMoney:discountPrice}}</span></div>
|
373
|
382
|
<div class="banner">
|
374
|
383
|
<div id="qrCode"
|
375
|
384
|
class="qrCode"
|
|
@@ -478,6 +487,8 @@ export default {
|
478
|
487
|
isSelectCoup: [], // 选择的优惠券
|
479
|
488
|
// 下面是支付的数据
|
480
|
489
|
showMoney: 0, // 价值总额
|
|
490
|
+ discountPrice: 0,//活动后金额
|
|
491
|
+ discount: 0,//折扣类型
|
481
|
492
|
// showRuleText: 10086,
|
482
|
493
|
|
483
|
494
|
};
|
|
@@ -500,6 +511,19 @@ export default {
|
500
|
511
|
this.order_data = res.data.order_data
|
501
|
512
|
this.showMoney = res.data.order_data.price
|
502
|
513
|
this.poreList = res.data.detail_list
|
|
514
|
+ this.order_data['discountPrice'] = 0
|
|
515
|
+ //折扣类型,0.无折扣,20.任意三个项目8折,50.新人五折活动,100.仪器免费使用权益
|
|
516
|
+ this.order_data.project_list.forEach(item => {
|
|
517
|
+ if (this.discount == 20) {
|
|
518
|
+ this.order_data.discountPrice += Number(item.price) * 0.8
|
|
519
|
+ } else if (this.discount == 50) {
|
|
520
|
+ this.order_data.discountPrice += Number(item.price) * 0.5
|
|
521
|
+ } else if (this.discount == 0) {
|
|
522
|
+ this.order_data.discountPrice = this.showMoney
|
|
523
|
+ }
|
|
524
|
+ })
|
|
525
|
+ console.log(Number(this.order_data.discountPrice).toFixed(2), 'this.order_data.discountPrice.toFixed(2)');
|
|
526
|
+ this.discountPrice = Number(this.order_data.discountPrice).toFixed(2)
|
503
|
527
|
this.calculationPrice()
|
504
|
528
|
})
|
505
|
529
|
},
|
|
@@ -626,7 +650,7 @@ export default {
|
626
|
650
|
let tsTableList = []
|
627
|
651
|
for (let i = 0; i < 7; i++) {
|
628
|
652
|
//显示周一
|
629
|
|
- let ShowTime = nowTime + (i + 1) * oneDayTime;
|
|
653
|
+ let ShowTime = nowTime + (i) * oneDayTime;
|
630
|
654
|
//初始化日期时间
|
631
|
655
|
let myDate = new Date(ShowTime);
|
632
|
656
|
let year = myDate.getFullYear();
|
|
@@ -728,7 +752,8 @@ export default {
|
728
|
752
|
// 卡券,项目券数据包, id:订单项目ID, coupon_id:优惠券ID, 如:[{ "id": 1220, coupon_id: 199 }]isSelectCoup
|
729
|
753
|
let params = {
|
730
|
754
|
id: this.id,
|
731
|
|
- pay_way: payWayList[0].pay_way
|
|
755
|
+ pay_way: payWayList[0].pay_way,
|
|
756
|
+ discount: this.discount
|
732
|
757
|
}
|
733
|
758
|
|
734
|
759
|
let coupon_data = []
|
|
@@ -894,7 +919,6 @@ export default {
|
894
|
919
|
let productDiscount = this.couponList // 卡券列表
|
895
|
920
|
console.log(this.couponList, 'this.couponList');
|
896
|
921
|
(productDiscount)
|
897
|
|
- // debugger
|
898
|
922
|
if (isSelectCoup.length > 0 && isSelectCoup[0].type && isSelectCoup[0].type == 4) {
|
899
|
923
|
for (let i = 0; i < isSelectCoup.length; i++) { // 首先遍历卡券
|
900
|
924
|
if (!isSelectCoup[i].projectids) { // 如果卡券没绑定项目
|
|
@@ -957,6 +981,12 @@ export default {
|
957
|
981
|
}
|
958
|
982
|
}
|
959
|
983
|
this.showMoney = money.toFixed(2)
|
|
984
|
+ if (this.order_data.project_list.length - this.isSelectCoup.length >= 3) {
|
|
985
|
+ console.log(money, 'money');
|
|
986
|
+ money = (money * 0.8).toFixed(2)
|
|
987
|
+ console.log(money, 'money');
|
|
988
|
+
|
|
989
|
+ }
|
960
|
990
|
} else if (isSelectCoup[0].type == 3) {
|
961
|
991
|
for (let i = 0; i < project_list.length; i++) {
|
962
|
992
|
money = money - Number(project_list[i].price)
|
|
@@ -965,10 +995,8 @@ export default {
|
965
|
995
|
} else {
|
966
|
996
|
money = money - Number(isSelectCoup[0].price)
|
967
|
997
|
}
|
968
|
|
-
|
969
|
|
- this.showMoney = money.toFixed(2)
|
970
|
|
-
|
971
|
|
-
|
|
998
|
+ console.log(this.showMoney, 'showMoney', money);
|
|
999
|
+ this.showMoney = money
|
972
|
1000
|
},
|
973
|
1001
|
|
974
|
1002
|
|
|
@@ -1005,10 +1033,13 @@ export default {
|
1005
|
1033
|
this.$set(this.programmeList[index], 'onSelect', true)
|
1006
|
1034
|
}
|
1007
|
1035
|
},
|
1008
|
|
- onSubmit () {
|
1009
|
|
-
|
1010
|
|
- },
|
1011
|
|
- submitFrequency () { },
|
|
1036
|
+ //获取订单折扣类型
|
|
1037
|
+ getOrderDiscount () {
|
|
1038
|
+ api.getOrderDiscount({ id: this.id }).then(res => {
|
|
1039
|
+ this.discount = res.data.discount
|
|
1040
|
+ this.getOrderInfo()
|
|
1041
|
+ })
|
|
1042
|
+ }
|
1012
|
1043
|
},
|
1013
|
1044
|
|
1014
|
1045
|
created () {
|
|
@@ -1016,8 +1047,10 @@ export default {
|
1016
|
1047
|
if (id) {
|
1017
|
1048
|
this.id = id
|
1018
|
1049
|
}
|
1019
|
|
- this.getOrderInfo()
|
|
1050
|
+
|
1020
|
1051
|
this.getProjectList()
|
|
1052
|
+ this.getOrderDiscount()
|
|
1053
|
+
|
1021
|
1054
|
},
|
1022
|
1055
|
|
1023
|
1056
|
mounted () {
|