|
@@ -141,6 +141,33 @@
|
141
|
141
|
<div>预约费用</div>
|
142
|
142
|
<div>¥{{reservationPrice}}</div>
|
143
|
143
|
</div>
|
|
144
|
+ <!-- 次卡 -->
|
|
145
|
+ <div class="cost-coupon-list">
|
|
146
|
+ <div class="coupon"
|
|
147
|
+ @click="isCard = true">
|
|
148
|
+ <div class="coupon-tips">
|
|
149
|
+ <div class="coupon-icon"><img src="https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/icon/slices/couponIcon.png"
|
|
150
|
+ alt=""></div>
|
|
151
|
+ <div class="coupon-title">次卡</div>
|
|
152
|
+ <div class="coupon-tip"
|
|
153
|
+ v-if="order_data.coupon_list&&order_data.coupon_list.length>0">已选择次卡</div>
|
|
154
|
+ </div>
|
|
155
|
+ <div class="on-icon">></div>
|
|
156
|
+ </div>
|
|
157
|
+
|
|
158
|
+ <div v-if="1==1">
|
|
159
|
+ <div>
|
|
160
|
+ <div class="coupon-ps"
|
|
161
|
+ v-for="item,index in isSelectCardList"
|
|
162
|
+ :key="index">
|
|
163
|
+ <div>{{item.name}}</div>
|
|
164
|
+ <div class="cou-price">-¥{{item.price}}</div>
|
|
165
|
+ </div>
|
|
166
|
+ </div>
|
|
167
|
+ </div>
|
|
168
|
+ </div>
|
|
169
|
+
|
|
170
|
+ <!-- 优惠券 -->
|
144
|
171
|
<div class="cost-coupon-list">
|
145
|
172
|
<div class="coupon"
|
146
|
173
|
@click="onCoupon">
|
|
@@ -154,15 +181,6 @@
|
154
|
181
|
<div class="on-icon">></div>
|
155
|
182
|
</div>
|
156
|
183
|
|
157
|
|
- <!-- <div v-if="order_data.coupon_list&&order_data.coupon_list.length>0">
|
158
|
|
- <div class="coupon-ps"
|
159
|
|
- v-for="item,index in order_data.coupon_list"
|
160
|
|
- :key="index">
|
161
|
|
- <div>{{item.coupon_name}}</div>
|
162
|
|
- <div class="cou-price">-¥{{price}}</div>
|
163
|
|
- </div>
|
164
|
|
- </div> -->
|
165
|
|
-
|
166
|
184
|
<div v-if="1==1">
|
167
|
185
|
<div>
|
168
|
186
|
<div class="coupon-ps"
|
|
@@ -197,6 +215,28 @@
|
197
|
215
|
<div class="payment"
|
198
|
216
|
@click="determine">{{isChange?'确定订单':'立即支付'}}</div>
|
199
|
217
|
</div>
|
|
218
|
+ <!-- 次卡 -->
|
|
219
|
+ <mine-pupop :show="isCard">
|
|
220
|
+ <div class="coupon-block"
|
|
221
|
+ style="background: #F7F8FA;">
|
|
222
|
+ <div class="delete-pupop"
|
|
223
|
+ @click="isCard=false"><img src="https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/icon/slices/delete.png"
|
|
224
|
+ alt=""></div>
|
|
225
|
+ <div class="coupon-pupop-title">选择次卡</div>
|
|
226
|
+ <div class="card-content">
|
|
227
|
+ <div class="card-info"
|
|
228
|
+ v-for="item,index in cardList"
|
|
229
|
+ :key="index"
|
|
230
|
+ @click="isSelectCard(item,index)">
|
|
231
|
+ <div class="frequency"> <span style="color: #FF3007FF;font-size: 18px;">{{item.used_num}}</span>/{{item.total_num}}</div>
|
|
232
|
+ <div class="card-title">{{item.name}}</div>
|
|
233
|
+ <div class="card-choice-icon"><img :src="item.isSelect?select:unSelect"></div>
|
|
234
|
+ </div>
|
|
235
|
+ </div>
|
|
236
|
+ <div class="coupon-confirm"
|
|
237
|
+ @click="isCardAdd">确认</div>
|
|
238
|
+ </div>
|
|
239
|
+ </mine-pupop>
|
200
|
240
|
<!-- 选择优惠券 -->
|
201
|
241
|
<mine-pupop :show="isCoupun">
|
202
|
242
|
<div class="coupon-block">
|
|
@@ -275,8 +315,12 @@
|
275
|
315
|
:label="item.name"
|
276
|
316
|
:value="item.id">
|
277
|
317
|
<span style="float: left">{{ item.name }}</span>
|
278
|
|
- <span v-if="item.recommend==1"
|
279
|
|
- style="float: right;color: #fa7d22ff;font-size: 13px;background: #ffefeb;border-radius: 4px;border: 1px solid #fa7d22;height: 18px;padding: 2px 6px;">推荐</span>
|
|
318
|
+ <span>
|
|
319
|
+ <span v-if="item.recommend==1"
|
|
320
|
+ style="float: right;color: #fa7d22ff;font-size: 13px;margin:0 5px; background: #ffefeb;border-radius: 4px;border: 1px solid #fa7d22;height: 18px;padding: 2px 6px;">推荐</span>
|
|
321
|
+ <span v-if="item.card==1"
|
|
322
|
+ style="float: right;color: #fa7d22ff;font-size: 13px;margin: 0 5px; background: #ffefeb;border-radius: 4px;border: 1px solid #fa7d22;height: 18px;padding: 2px 6px;">次卡</span>
|
|
323
|
+ </span>
|
280
|
324
|
</el-option>
|
281
|
325
|
</el-select>
|
282
|
326
|
</div>
|
|
@@ -294,8 +338,12 @@
|
294
|
338
|
style=" display: flex;justify-content: space-between ;align-items: center;line-height: inherit; padding: 0 12px;"
|
295
|
339
|
:value="item.id">
|
296
|
340
|
<span style="float: left">{{ item.name |ellipsis(14) }}</span>
|
297
|
|
- <span v-if="item.recommend==1"
|
298
|
|
- style="float: right;color: #fa7d22ff;font-size: 13px;background: #ffefeb;border-radius: 4px;border: 1px solid #fa7d22;height: 18px;padding: 2px 6px;">推荐</span>
|
|
341
|
+ <span>
|
|
342
|
+ <span v-if="item.recommend==1"
|
|
343
|
+ style="float: right;color: #fa7d22ff;font-size: 13px; margin:0 5px ; background: #ffefeb;border-radius: 4px;border: 1px solid #fa7d22;height: 18px;padding: 2px 6px;">推荐</span>
|
|
344
|
+ <span v-if="item.card==1"
|
|
345
|
+ style="float: right;color: #fa7d22ff;font-size: 13px; margin:0 5px ; background: #ffefeb;border-radius: 4px;border: 1px solid #fa7d22;height: 18px;padding: 2px 6px;">次卡</span>
|
|
346
|
+ </span>
|
299
|
347
|
</el-option>
|
300
|
348
|
</el-select>
|
301
|
349
|
</div>
|
|
@@ -478,6 +526,7 @@ export default {
|
478
|
526
|
//执行方案
|
479
|
527
|
programmeList: [],
|
480
|
528
|
order_data: {},//门店
|
|
529
|
+ isSelectCardList: [],
|
481
|
530
|
//项目分类列表
|
482
|
531
|
classifyList: [],
|
483
|
532
|
//项目列表
|
|
@@ -497,6 +546,8 @@ export default {
|
497
|
546
|
isEdit: false,
|
498
|
547
|
//优惠券列表
|
499
|
548
|
couponList: [],
|
|
549
|
+ card_data: [],//已选择的列表
|
|
550
|
+ cardList: [],//次卡列表
|
500
|
551
|
//已选择的优惠券
|
501
|
552
|
selectCouponList: [],
|
502
|
553
|
//已选择优惠券的id(同一个id只能选择一张优惠券)
|
|
@@ -551,6 +602,7 @@ export default {
|
551
|
602
|
programmeIndex: '',
|
552
|
603
|
remarks: '',
|
553
|
604
|
isCoupun: false,//是否展示优惠券弹窗
|
|
605
|
+ isCard: false,//是否展示次卡弹窗
|
554
|
606
|
isOver: false,//优惠券注释
|
555
|
607
|
isProject: false,//是否展示选择项目弹窗
|
556
|
608
|
isTs: false,//是否展示选择时间弹窗
|
|
@@ -575,6 +627,7 @@ export default {
|
575
|
627
|
discount: 0,//折扣类型
|
576
|
628
|
device_name: '',//支付成功后的设备
|
577
|
629
|
room: '',//设备房间
|
|
630
|
+ user_id: '',
|
578
|
631
|
// showRuleText: 10086,
|
579
|
632
|
|
580
|
633
|
};
|
|
@@ -605,9 +658,14 @@ export default {
|
605
|
658
|
console.log(_problem, '_problem');
|
606
|
659
|
})
|
607
|
660
|
this.lableList = _problem
|
|
661
|
+ this.getProjectClassify()
|
608
|
662
|
this.randomColor();
|
609
|
663
|
this.remarks = res.data.remark
|
610
|
664
|
this.programmeList = res.data.scheme_list
|
|
665
|
+ res.data.order_data.project_list.forEach(e => {
|
|
666
|
+ e["isCard"] = false
|
|
667
|
+ e["isCoupon"] = false
|
|
668
|
+ })
|
611
|
669
|
this.order_data = res.data.order_data
|
612
|
670
|
if (this.order_data.coupon_list.length > 0) {
|
613
|
671
|
this.isSelectCoup = this.order_data.coupon_list
|
|
@@ -629,13 +687,101 @@ export default {
|
629
|
687
|
this.calculationPrice()
|
630
|
688
|
})
|
631
|
689
|
},
|
|
690
|
+ onCard () {
|
|
691
|
+ api.getOrderCard({ id: this.id }).then(res => {
|
|
692
|
+ if (res.code == 200) {
|
|
693
|
+ res.data.list.forEach(item => {
|
|
694
|
+ item["isSelect"] = false
|
|
695
|
+ })
|
|
696
|
+ this.cardList = res.data.list
|
|
697
|
+
|
|
698
|
+ }
|
|
699
|
+ })
|
|
700
|
+ },
|
|
701
|
+ isSelectCard (item, index) {
|
|
702
|
+ let isSelect = false
|
|
703
|
+ let isRepeat = false
|
|
704
|
+ this.cardList.forEach(res => {
|
|
705
|
+ if (res.isSelect && item.id != res.id && item.name == res.name) {
|
|
706
|
+ isRepeat = true
|
|
707
|
+ }
|
|
708
|
+ })
|
|
709
|
+ if (isRepeat) {
|
|
710
|
+ this.$message.error("不能选择相同的次卡");
|
|
711
|
+ return
|
|
712
|
+ }
|
|
713
|
+ this.isSelectCoup.forEach(e => {
|
|
714
|
+ if (item.project_ids.indexOf(e.projectids) > -1) {
|
|
715
|
+ isSelect = true
|
|
716
|
+ }
|
|
717
|
+ })
|
|
718
|
+ if (isSelect) {
|
|
719
|
+ this.$message.error("该项目已选择优惠券");
|
|
720
|
+ return
|
|
721
|
+ }
|
|
722
|
+ console.log(item);
|
|
723
|
+ this.cardList[index].isSelect = !this.cardList[index].isSelect
|
|
724
|
+ },
|
|
725
|
+ //确定选择的次卡
|
|
726
|
+ isCardAdd () {
|
|
727
|
+ let isSelectCardList = []
|
|
728
|
+ let project_list = this.order_data.project_list
|
|
729
|
+ let card_data = []
|
|
730
|
+ let price =this.order_data.price
|
|
731
|
+ console.log(price,'price');
|
|
732
|
+ if (this.isSelectCoup.length > 0) {
|
|
733
|
+ this.isSelectCoup.forEach(res => {
|
|
734
|
+ this.order_data.project_list.forEach(item => {
|
|
735
|
+ if (res.projectids == item.id) {
|
|
736
|
+ price = price - item.price
|
|
737
|
+ }
|
|
738
|
+ })
|
|
739
|
+ })
|
|
740
|
+ }
|
|
741
|
+ project_list.forEach(res => {
|
|
742
|
+ this.cardList.forEach(e => {
|
|
743
|
+ if (e.isSelect && e.project_ids.indexOf(res.id) > -1) {
|
|
744
|
+ price = price - res.price
|
|
745
|
+ price = price.toFixed(2)
|
|
746
|
+ isSelectCardList.push(res)
|
|
747
|
+ }
|
|
748
|
+ })
|
|
749
|
+ })
|
|
750
|
+ isSelectCardList.forEach(e => {
|
|
751
|
+ this.cardList.forEach(res => {
|
|
752
|
+ let card_data_info = {}
|
|
753
|
+ if (res.isSelect, res.project_ids.indexOf(e.id) > -1) {
|
|
754
|
+ card_data_info = {
|
|
755
|
+ id: e.id,
|
|
756
|
+ card_id: res.id
|
|
757
|
+ }
|
|
758
|
+ card_data.push(card_data_info)
|
|
759
|
+ }
|
|
760
|
+ })
|
|
761
|
+ })
|
|
762
|
+ if (isSelectCardList.length==0&&this.isSelectCoup.length==0) {
|
|
763
|
+ price = price- this.order_data.discountPrice
|
|
764
|
+ }
|
|
765
|
+
|
|
766
|
+ this.card_data = card_data
|
|
767
|
+ if (price < 0) {
|
|
768
|
+ price = 0
|
|
769
|
+ }
|
|
770
|
+ // if (this.isSelectCoup.length > 0) {
|
|
771
|
+ this.showMoney = price
|
|
772
|
+ // } else {
|
|
773
|
+ // this.discountPrice = price
|
|
774
|
+ // }
|
|
775
|
+ this.isSelectCardList = isSelectCardList
|
|
776
|
+ this.isCard = false
|
|
777
|
+ },
|
632
|
778
|
getProjectClassify () {
|
633
|
|
- api.projectClassify().then(res => {
|
|
779
|
+ api.projectClassify({ user_id: this.userInfo.user_id }).then(res => {
|
634
|
780
|
this.classifyList = res.data.list
|
635
|
781
|
})
|
636
|
782
|
},
|
637
|
783
|
getProjectList (e) {
|
638
|
|
- api.getProjectList({ id: e }).then(res => {
|
|
784
|
+ api.getProjectList({ id: e, user_id: this.userInfo.user_id }).then(res => {
|
639
|
785
|
this.projectList = res.data.list
|
640
|
786
|
})
|
641
|
787
|
},
|
|
@@ -668,14 +814,9 @@ export default {
|
668
|
814
|
console.log(item, 'item========');
|
669
|
815
|
this.order_data.project_list.forEach((res, index) => {
|
670
|
816
|
if (item.id == res.id) {
|
671
|
|
- this.order_data.project_list.splice(index, 1)
|
672
|
817
|
this.reservationPrice = 0
|
673
|
818
|
this.confirmOrder("delete")
|
674
|
819
|
this.isSelectCoup = []
|
675
|
|
- this.$message({
|
676
|
|
- message: '删除成功',
|
677
|
|
- type: 'success'
|
678
|
|
- });
|
679
|
820
|
}
|
680
|
821
|
})
|
681
|
822
|
},
|
|
@@ -786,7 +927,7 @@ export default {
|
786
|
927
|
}
|
787
|
928
|
this.tsTableList = tsTableList
|
788
|
929
|
},
|
789
|
|
- confirmOrder () {
|
|
930
|
+ confirmOrder (type) {
|
790
|
931
|
let order_data = []
|
791
|
932
|
this.order_data.project_list.forEach(item => {
|
792
|
933
|
let order_data_info = {}
|
|
@@ -815,6 +956,13 @@ export default {
|
815
|
956
|
this.getOrderInfo()
|
816
|
957
|
this.isTs = false
|
817
|
958
|
this.isChange = false
|
|
959
|
+ if (type&&type=='delete') {
|
|
960
|
+ this.order_data.project_list.splice(index, 1)
|
|
961
|
+ this.$message({
|
|
962
|
+ message: '删除成功',
|
|
963
|
+ type: 'success'
|
|
964
|
+ });
|
|
965
|
+ }
|
818
|
966
|
}
|
819
|
967
|
})
|
820
|
968
|
},
|
|
@@ -931,6 +1079,7 @@ export default {
|
931
|
1079
|
return res.isSelect == true
|
932
|
1080
|
})
|
933
|
1081
|
// 卡券,项目券数据包, id:订单项目ID, coupon_id:优惠券ID, 如:[{ "id": 1220, coupon_id: 199 }]isSelectCoup
|
|
1082
|
+ this.discount = this.card_data.length>0?0:this.discount
|
934
|
1083
|
let params = {
|
935
|
1084
|
id: this.id,
|
936
|
1085
|
pay_way: payWayList[0].pay_way,
|
|
@@ -955,6 +1104,10 @@ export default {
|
955
|
1104
|
})
|
956
|
1105
|
}
|
957
|
1106
|
params['coupon_data'] = coupon_data.length > 0 ? JSON.stringify(coupon_data) : null
|
|
1107
|
+ if (this.card_data.length > 0) {
|
|
1108
|
+ params['card_data'] = JSON.stringify(this.card_data)
|
|
1109
|
+ }
|
|
1110
|
+ console.log(params, '=====');
|
958
|
1111
|
api.orderPay(params).then(res => {
|
959
|
1112
|
if (res.code == 200) {
|
960
|
1113
|
this.choicePayType = false
|
|
@@ -975,7 +1128,6 @@ export default {
|
975
|
1128
|
correctLevel: QRCode.CorrectLevel.L//容错率,L/M/H
|
976
|
1129
|
})
|
977
|
1130
|
})
|
978
|
|
-
|
979
|
1131
|
}
|
980
|
1132
|
}
|
981
|
1133
|
})
|
|
@@ -1011,12 +1163,31 @@ export default {
|
1011
|
1163
|
* 点击使用按钮、勾选按钮
|
1012
|
1164
|
*/
|
1013
|
1165
|
selectPupop: function (item, index) {
|
1014
|
|
-
|
|
1166
|
+ this.card_data.forEach(res => {
|
|
1167
|
+ if (item.project_ids.indexOf(res.id) > -1) {
|
|
1168
|
+ item.project_ids.forEach((e, i) => {
|
|
1169
|
+ if (res.id == e) {
|
|
1170
|
+ item.project_ids.splice(i, 1)
|
|
1171
|
+ }
|
|
1172
|
+ })
|
|
1173
|
+ }
|
|
1174
|
+ })
|
|
1175
|
+ let isReturn = false
|
|
1176
|
+ this.isSelectCardList.forEach(value => {
|
|
1177
|
+ if (item.project_ids.indexOf(value.id) > -1) {
|
|
1178
|
+ isReturn = true
|
|
1179
|
+ }
|
|
1180
|
+ })
|
|
1181
|
+ if (isReturn || (item.type != 4 && this.card_data.length != 0)) {
|
|
1182
|
+ this.$message.error('该项目已选择次卡');
|
|
1183
|
+ return
|
|
1184
|
+ }
|
1015
|
1185
|
let CouPonIndex = this.couponList
|
1016
|
1186
|
let selectIndex = index
|
1017
|
1187
|
let curreValue = !CouPonIndex[selectIndex].isSelect
|
1018
|
1188
|
let project_list = this.order_data.project_list //这里是项目列表
|
1019
|
1189
|
|
|
1190
|
+
|
1020
|
1191
|
// 判断是否是不相同的项目券
|
1021
|
1192
|
if (this.couponList[selectIndex].type != 4) {
|
1022
|
1193
|
for (let i = 0; i < CouPonIndex.length; i++) {
|
|
@@ -1146,7 +1317,15 @@ export default {
|
1146
|
1317
|
// 计算总额
|
1147
|
1318
|
calculateMoney () {
|
1148
|
1319
|
let that = this
|
1149
|
|
- let money = Number(this.order_data.original_price)
|
|
1320
|
+ let _price = 0
|
|
1321
|
+ if (this.isSelectCardList.length > 0) {
|
|
1322
|
+ this.isSelectCardList.forEach(res => {
|
|
1323
|
+ _price = _price + Number(res.price)
|
|
1324
|
+ })
|
|
1325
|
+ }
|
|
1326
|
+ console.log(this.order_data.original_price,_price,'_price_price');
|
|
1327
|
+ let money = this.isSelectCardList.length > 0 ? this.order_data.original_price - _price : Number(this.order_data.original_price)
|
|
1328
|
+ console.log(money,'========');
|
1150
|
1329
|
let isSelectCoup = this.isSelectCoup
|
1151
|
1330
|
let project_list = this.order_data.project_list //这里是项目列表
|
1152
|
1331
|
|
|
@@ -1241,10 +1420,14 @@ export default {
|
1241
|
1420
|
|
1242
|
1421
|
created () {
|
1243
|
1422
|
let id = this.$route.query.id
|
|
1423
|
+ // let user_id = this.$route.query.user_id
|
1244
|
1424
|
if (id) {
|
1245
|
1425
|
this.id = id
|
1246
|
1426
|
}
|
1247
|
|
- this.getProjectClassify()
|
|
1427
|
+ // if (user_id) {
|
|
1428
|
+ // this.user_id = user_id
|
|
1429
|
+ // }
|
|
1430
|
+ this.onCard()
|
1248
|
1431
|
|
1249
|
1432
|
this.getOrderDiscount()
|
1250
|
1433
|
|
|
@@ -2264,5 +2447,49 @@ export default {
|
2264
|
2447
|
transform: translateX(-50%);
|
2265
|
2448
|
}
|
2266
|
2449
|
}
|
|
2450
|
+ .card-content {
|
|
2451
|
+ margin-top: 24px;
|
|
2452
|
+ height: 230px;
|
|
2453
|
+ padding: 0 15px;
|
|
2454
|
+ overflow: scroll;
|
|
2455
|
+ display: flex;
|
|
2456
|
+ justify-content: space-between;
|
|
2457
|
+ flex-wrap: wrap;
|
|
2458
|
+ .card-info {
|
|
2459
|
+ position: relative;
|
|
2460
|
+ margin-bottom: 10px;
|
|
2461
|
+ width: 225px;
|
|
2462
|
+ height: 70px;
|
|
2463
|
+ background: url("https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/bg.png")
|
|
2464
|
+ no-repeat;
|
|
2465
|
+ background-size: 100% 100%;
|
|
2466
|
+ padding: 12px 13px 0 22px;
|
|
2467
|
+ .frequency {
|
|
2468
|
+ text-align: end;
|
|
2469
|
+ font-size: 14px;
|
|
2470
|
+ font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
|
2471
|
+ font-weight: 400;
|
|
2472
|
+ color: #666666ff;
|
|
2473
|
+ }
|
|
2474
|
+ .card-title {
|
|
2475
|
+ font-size: 16px;
|
|
2476
|
+ font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
|
2477
|
+ font-weight: 400;
|
|
2478
|
+ color: #333333;
|
|
2479
|
+ line-height: 24px;
|
|
2480
|
+ }
|
|
2481
|
+ .card-choice-icon {
|
|
2482
|
+ width: 24px;
|
|
2483
|
+ height: 24px;
|
|
2484
|
+ position: absolute;
|
|
2485
|
+ right: 13px;
|
|
2486
|
+ bottom: 8px;
|
|
2487
|
+ img {
|
|
2488
|
+ width: 100%;
|
|
2489
|
+ height: 100%;
|
|
2490
|
+ }
|
|
2491
|
+ }
|
|
2492
|
+ }
|
|
2493
|
+ }
|
2267
|
2494
|
}
|
2268
|
2495
|
</style>
|