|
@@ -108,7 +108,8 @@
|
108
|
108
|
class="add-project"
|
109
|
109
|
@click="addProject">添加</div>
|
110
|
110
|
</div>
|
111
|
|
- <div class="project-list">
|
|
111
|
+ <div class="project-list"
|
|
112
|
+ :style="isChange?'height:250px':''">
|
112
|
113
|
<div class="project-info"
|
113
|
114
|
v-for="(item,index) in order_data.project_list"
|
114
|
115
|
:key="index">
|
|
@@ -146,7 +147,7 @@
|
146
|
147
|
<div class="coupon-tips">
|
147
|
148
|
<div class="coupon-icon"><img src="https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/icon/slices/couponIcon.png"
|
148
|
149
|
alt=""></div>
|
149
|
|
- <div class="coupon-title">优惠卷</div>
|
|
150
|
+ <div class="coupon-title">优惠券</div>
|
150
|
151
|
<div class="coupon-tip"
|
151
|
152
|
v-if="order_data.coupon_list&&order_data.coupon_list.length>0">已选推荐优惠</div>
|
152
|
153
|
</div>
|
|
@@ -227,8 +228,8 @@
|
227
|
228
|
class="discount-over">全免</div>
|
228
|
229
|
<div v-else
|
229
|
230
|
class="discount">
|
230
|
|
- <div class="price-num"><span class="size">¥</span>{{item.price}}</div>
|
231
|
|
- <div class="price-tips">{{item.full_price}}</div>
|
|
231
|
+ <div class="coupon-price-num"><span class="size">¥</span>{{Number(item.price)}}</div>
|
|
232
|
+ <!-- <div class="price-tips">{{item.full_price}}</div> -->
|
232
|
233
|
</div>
|
233
|
234
|
<div class="coupon-tip">
|
234
|
235
|
<div class="tips-title">{{item.coupon_name | ellipsis(14)}}</div>
|
|
@@ -260,10 +261,12 @@
|
260
|
261
|
@click="isProject=false"><img src="https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/icon/slices/delete.png"
|
261
|
262
|
alt=""></div>
|
262
|
263
|
<div class="project-pupop-title">选择项目</div>
|
263
|
|
- <div class="project-select">
|
|
264
|
+ <div class="project-select"
|
|
265
|
+ v-if="!isEditProject">
|
264
|
266
|
<el-select v-model="classifyInfo"
|
265
|
267
|
placeholder="请选择分类"
|
266
|
268
|
style="width: 295px;"
|
|
269
|
+ :disabled="isEdit?true:false"
|
267
|
270
|
@change="getClassify"
|
268
|
271
|
size="mini">
|
269
|
272
|
<el-option v-for="item in classifyList"
|
|
@@ -277,11 +280,12 @@
|
277
|
280
|
</el-option>
|
278
|
281
|
</el-select>
|
279
|
282
|
</div>
|
280
|
|
- <div class="project-select">
|
|
283
|
+ <div class="project-select"
|
|
284
|
+ v-if="!isEditProject">
|
281
|
285
|
<el-select v-model="projectInfo"
|
282
|
286
|
placeholder="请选择项目"
|
283
|
287
|
style="width: 295px;"
|
284
|
|
- :disabled="classifyInfo.length==0?true:false"
|
|
288
|
+ :disabled="isEdit||classifyInfo.length==0?true:false"
|
285
|
289
|
@change="getProducts"
|
286
|
290
|
size="mini">
|
287
|
291
|
<el-option v-for="item in projectList"
|
|
@@ -490,6 +494,7 @@ export default {
|
490
|
494
|
//皮肤状态列表
|
491
|
495
|
poreList: [
|
492
|
496
|
],
|
|
497
|
+ isEdit: false,
|
493
|
498
|
//优惠券列表
|
494
|
499
|
couponList: [],
|
495
|
500
|
//已选择的优惠券
|
|
@@ -604,6 +609,9 @@ export default {
|
604
|
609
|
this.remarks = res.data.remark
|
605
|
610
|
this.programmeList = res.data.scheme_list
|
606
|
611
|
this.order_data = res.data.order_data
|
|
612
|
+ if (this.order_data.coupon_list.length > 0) {
|
|
613
|
+ this.isSelectCoup = this.order_data.coupon_list
|
|
614
|
+ }
|
607
|
615
|
this.showMoney = res.data.order_data.price
|
608
|
616
|
this.poreList = res.data.detail_list
|
609
|
617
|
this.order_data['discountPrice'] = 0
|
|
@@ -639,24 +647,31 @@ export default {
|
639
|
647
|
getProducts (e) {
|
640
|
648
|
api.getProducts({ id: e }).then(res => {
|
641
|
649
|
this.productsList = res.data.list
|
642
|
|
- this.productsList.forEach(item => {
|
643
|
|
- if (this.productsInfo == item.id) {
|
644
|
|
- this.lastProjectPrice = Number(item.price)
|
645
|
|
- }
|
646
|
|
- })
|
|
650
|
+ if (this.productsList.length > 0) {
|
|
651
|
+ this.productsList.forEach(item => {
|
|
652
|
+ if (this.productsInfo == item.id) {
|
|
653
|
+ this.lastProjectPrice = Number(item.price) || ''
|
|
654
|
+ }
|
|
655
|
+ })
|
|
656
|
+ }
|
647
|
657
|
})
|
648
|
658
|
},
|
649
|
659
|
eidt (item) {
|
650
|
|
- this.projectInfo = item.id
|
651
|
|
- this.productsInfo = item.product_ids == '' ? '' : Number(item.product_ids)
|
|
660
|
+ console.log(item, '============');
|
|
661
|
+ this.projectInfo = Number(item.id)
|
|
662
|
+ // this.productsInfo = item.product_ids == '' ? '' : Number(item.product_ids)
|
652
|
663
|
this.getProducts(item.id)
|
653
|
664
|
this.isEditProject = true
|
654
|
665
|
this.isProject = true
|
655
|
666
|
},
|
656
|
667
|
deleteProject (item) {
|
|
668
|
+ console.log(item, 'item========');
|
657
|
669
|
this.order_data.project_list.forEach((res, index) => {
|
658
|
670
|
if (item.id == res.id) {
|
659
|
671
|
this.order_data.project_list.splice(index, 1)
|
|
672
|
+ this.reservationPrice = 0
|
|
673
|
+ this.confirmOrder("delete")
|
|
674
|
+ this.isSelectCoup = []
|
660
|
675
|
this.$message({
|
661
|
676
|
message: '删除成功',
|
662
|
677
|
type: 'success'
|
|
@@ -675,8 +690,8 @@ export default {
|
675
|
690
|
orderUpdate () {
|
676
|
691
|
// 编辑
|
677
|
692
|
if (this.isEditProject) {
|
|
693
|
+ this.isEdit = true
|
678
|
694
|
if (this.productsInfo != '') {
|
679
|
|
-
|
680
|
695
|
this.order_data.project_list.forEach(e => {
|
681
|
696
|
if (this.projectInfo == e.id) {
|
682
|
697
|
this.productsList.forEach(item => {
|
|
@@ -690,6 +705,7 @@ export default {
|
690
|
705
|
console.log(Number(e.price), Number(item.price), 'Number(e.price) + Number(item.price)');
|
691
|
706
|
e.price = Number(e.price) + Number(item.price)
|
692
|
707
|
this.isProject = false
|
|
708
|
+ this.isEdit = false
|
693
|
709
|
this.isEditProject = false
|
694
|
710
|
this.calculationPrice()
|
695
|
711
|
}
|
|
@@ -698,6 +714,7 @@ export default {
|
698
|
714
|
})
|
699
|
715
|
} else {
|
700
|
716
|
this.isProject = false
|
|
717
|
+ this.isEdit = false
|
701
|
718
|
return
|
702
|
719
|
}
|
703
|
720
|
} else {
|
|
@@ -769,38 +786,42 @@ export default {
|
769
|
786
|
}
|
770
|
787
|
this.tsTableList = tsTableList
|
771
|
788
|
},
|
|
789
|
+ confirmOrder () {
|
|
790
|
+ let order_data = []
|
|
791
|
+ this.order_data.project_list.forEach(item => {
|
|
792
|
+ let order_data_info = {}
|
|
793
|
+ order_data_info['id'] = item.id
|
|
794
|
+ if (item.product_ids != "") {
|
|
795
|
+ order_data_info['product_id'] = item.product_ids
|
|
796
|
+ }
|
|
797
|
+ order_data.push(order_data_info)
|
|
798
|
+ })
|
|
799
|
+ let params = {
|
|
800
|
+ id: this.id,
|
|
801
|
+ order_data: JSON.stringify(order_data),
|
|
802
|
+ // order_day: this.tsTableList[this.tsTableIndex].order_day,
|
|
803
|
+ // order_time: this.timeIndexText
|
|
804
|
+ }
|
|
805
|
+ this.$loading({
|
|
806
|
+ lock: true,
|
|
807
|
+ text: '加载中',
|
|
808
|
+ spinner: 'el-icon-loading',
|
|
809
|
+ background: 'rgba(0, 0, 0, 0.7)'
|
|
810
|
+ })
|
|
811
|
+ api.setOrderUpdate(params).then(res => {
|
|
812
|
+ this.$loading().close()
|
|
813
|
+ if (res.code == 200) {
|
|
814
|
+ this.reservationPrice = 0
|
|
815
|
+ this.getOrderInfo()
|
|
816
|
+ this.isTs = false
|
|
817
|
+ this.isChange = false
|
|
818
|
+ }
|
|
819
|
+ })
|
|
820
|
+ },
|
772
|
821
|
//确定订单&支付
|
773
|
822
|
determine () {
|
774
|
823
|
if (this.isChange) {
|
775
|
|
- let order_data = []
|
776
|
|
- this.order_data.project_list.forEach(item => {
|
777
|
|
- let order_data_info = {}
|
778
|
|
- order_data_info['id'] = item.id
|
779
|
|
- if (item.product_ids != "") {
|
780
|
|
- order_data_info['product_id'] = item.product_ids
|
781
|
|
- }
|
782
|
|
- order_data.push(order_data_info)
|
783
|
|
- })
|
784
|
|
- let params = {
|
785
|
|
- id: this.id,
|
786
|
|
- order_data: JSON.stringify(order_data),
|
787
|
|
- // order_day: this.tsTableList[this.tsTableIndex].order_day,
|
788
|
|
- // order_time: this.timeIndexText
|
789
|
|
- }
|
790
|
|
- this.$loading({
|
791
|
|
- lock: true,
|
792
|
|
- text: '加载中',
|
793
|
|
- spinner: 'el-icon-loading',
|
794
|
|
- background: 'rgba(0, 0, 0, 0.7)'
|
795
|
|
- })
|
796
|
|
- api.setOrderUpdate(params).then(res => {
|
797
|
|
- this.$loading().close()
|
798
|
|
- if (res.code == 200) {
|
799
|
|
- this.getOrderInfo()
|
800
|
|
- this.isTs = false
|
801
|
|
- this.isChange = false
|
802
|
|
- }
|
803
|
|
- })
|
|
824
|
+ this.confirmOrder()
|
804
|
825
|
// this.getWeekDate()
|
805
|
826
|
// this.getOrderTime()
|
806
|
827
|
// this.order_time = ''
|
|
@@ -867,6 +888,10 @@ export default {
|
867
|
888
|
//获取订单优惠券
|
868
|
889
|
|
869
|
890
|
onCoupon () {
|
|
891
|
+ if (this.order_data.coupon_list && this.order_data.coupon_list.length > 0) {
|
|
892
|
+ this.$message.error('该订单已选择优惠券,不可更改');
|
|
893
|
+ return
|
|
894
|
+ }
|
870
|
895
|
if (this.couponList.length > 0) {
|
871
|
896
|
this.isCoupun = true
|
872
|
897
|
return
|
|
@@ -934,6 +959,9 @@ export default {
|
934
|
959
|
if (res.code == 200) {
|
935
|
960
|
this.choicePayType = false
|
936
|
961
|
this.PayStatus = true
|
|
962
|
+ this.payStatusInterval = setInterval(e => {
|
|
963
|
+ this.payStatus()
|
|
964
|
+ }, 1000)
|
937
|
965
|
if (res.data.pay_status == 1) {
|
938
|
966
|
this.isPayCode = false
|
939
|
967
|
} else {
|
|
@@ -947,14 +975,17 @@ export default {
|
947
|
975
|
correctLevel: QRCode.CorrectLevel.L//容错率,L/M/H
|
948
|
976
|
})
|
949
|
977
|
})
|
950
|
|
- this.payStatusInterval = setInterval(e => {
|
951
|
|
- this.payStatus()
|
952
|
|
- }, 1000)
|
|
978
|
+
|
953
|
979
|
}
|
954
|
980
|
}
|
955
|
981
|
})
|
956
|
982
|
},
|
957
|
983
|
changePayStatus () {
|
|
984
|
+ if (this.isPayCode) {
|
|
985
|
+ this.reservationPrice = 0
|
|
986
|
+ this.getProjectClassify()
|
|
987
|
+ this.getOrderDiscount()
|
|
988
|
+ }
|
958
|
989
|
this.PayStatus = false
|
959
|
990
|
if (this.payStatusInterval) { //如果定时器在运行则关闭
|
960
|
991
|
clearInterval(this.payStatusInterval)
|
|
@@ -976,25 +1007,6 @@ export default {
|
976
|
1007
|
return arr2.every(val => arr1.includes(val));
|
977
|
1008
|
},
|
978
|
1009
|
//选中优惠券
|
979
|
|
- // selectPupop (item, index) {
|
980
|
|
- // this.couponList[index].Select = !this.couponList[index].Select
|
981
|
|
- // this.selectCouponList = this.couponList.filter(res => {
|
982
|
|
- // return res.Select == true
|
983
|
|
- // })
|
984
|
|
- // this.selectCouponList.forEach(res => {
|
985
|
|
- // })
|
986
|
|
-
|
987
|
|
- // },
|
988
|
|
-
|
989
|
|
-
|
990
|
|
- // 不可以用的不显示,如果同时有项目劵、抵扣劵、满减劵,只能用一种类型,其他劵不显示
|
991
|
|
- // 1、针对单个项目,项目劵可以多选
|
992
|
|
- // 2、抵扣劵、满减劵针对的是整个订单,当用户已使用了单个项目劵时,抵扣劵、满减劵就不能使用
|
993
|
|
- // 3、优惠劵可以给多个项目抵扣,
|
994
|
|
- // 4、默认抵扣金额最高的
|
995
|
|
- // 5、优惠劵排序,到期时间倒叙
|
996
|
|
-
|
997
|
|
-
|
998
|
1010
|
/**
|
999
|
1011
|
* 点击使用按钮、勾选按钮
|
1000
|
1012
|
*/
|
|
@@ -1046,7 +1058,6 @@ export default {
|
1046
|
1058
|
let orderDetails1 = this.order_data
|
1047
|
1059
|
orderDetails1.project_list = project_list
|
1048
|
1060
|
|
1049
|
|
-
|
1050
|
1061
|
this.order_data = orderDetails1
|
1051
|
1062
|
this.couponList = CouPonIndex
|
1052
|
1063
|
this.coupSelectType = this.couponList[selectIndex].type
|
|
@@ -1076,6 +1087,7 @@ export default {
|
1076
|
1087
|
let that = this
|
1077
|
1088
|
let project_list = this.order_data.project_list //这里是项目列表
|
1078
|
1089
|
let isSelectCoup = this.isSelectCoup //这里选择了的卡券列表
|
|
1090
|
+ console.log(this.isSelectCoup, 'this.isSelectCoup');
|
1079
|
1091
|
let selectProjectList = [] // 适合的卡券列表
|
1080
|
1092
|
// let CouPonIndex = this.CouPonIndex // 卡券选择的Id\
|
1081
|
1093
|
let productDiscount = this.couponList // 卡券列表
|
|
@@ -1103,9 +1115,15 @@ export default {
|
1103
|
1115
|
} else {
|
1104
|
1116
|
for (let k = 0; k < productDiscount.length; k++) {
|
1105
|
1117
|
if (productDiscount[k].id == isSelectCoup[i].id) {
|
|
1118
|
+ console.log(productDiscount[k].id, 'productDiscount[k].id', productDiscount[k]);
|
1106
|
1119
|
// isSelectCoup.
|
1107
|
1120
|
productDiscount[k].isSelect = false
|
1108
|
1121
|
// isSelectCoup.splice(isSelectCoup.length-1,1);
|
|
1122
|
+ this.isSelectCoup.forEach((items, index) => {
|
|
1123
|
+ if (items.id == productDiscount[k].id) {
|
|
1124
|
+ this.isSelectCoup.splice(index, 1)
|
|
1125
|
+ }
|
|
1126
|
+ })
|
1109
|
1127
|
this.$message.error('没有适合的项目!');
|
1110
|
1128
|
}
|
1111
|
1129
|
}
|
|
@@ -1117,6 +1135,8 @@ export default {
|
1117
|
1135
|
orderDetails1.project_list = project_list
|
1118
|
1136
|
this.couponList = productDiscount
|
1119
|
1137
|
this.isSelectCoup = isSelectCoup
|
|
1138
|
+ console.log(this.isSelectCoup, 'this.isSelectCoup2222');
|
|
1139
|
+
|
1120
|
1140
|
this.order_data = orderDetails1
|
1121
|
1141
|
}
|
1122
|
1142
|
|
|
@@ -1126,7 +1146,7 @@ export default {
|
1126
|
1146
|
// 计算总额
|
1127
|
1147
|
calculateMoney () {
|
1128
|
1148
|
let that = this
|
1129
|
|
- let money = Number(this.order_data.price)
|
|
1149
|
+ let money = Number(this.order_data.original_price)
|
1130
|
1150
|
let isSelectCoup = this.isSelectCoup
|
1131
|
1151
|
let project_list = this.order_data.project_list //这里是项目列表
|
1132
|
1152
|
|
|
@@ -1143,6 +1163,7 @@ export default {
|
1143
|
1163
|
}
|
1144
|
1164
|
}
|
1145
|
1165
|
this.showMoney = money.toFixed(2)
|
|
1166
|
+ console.log(this.showMoney, 'this.showMoney');
|
1146
|
1167
|
if (this.order_data.project_list.length - this.isSelectCoup.length >= 3) {
|
1147
|
1168
|
console.log(money, 'money');
|
1148
|
1169
|
money = (money * 0.8).toFixed(2)
|
|
@@ -1158,7 +1179,7 @@ export default {
|
1158
|
1179
|
money = money - Number(isSelectCoup[0].price)
|
1159
|
1180
|
}
|
1160
|
1181
|
console.log(this.showMoney, 'showMoney', money);
|
1161
|
|
- this.showMoney = money
|
|
1182
|
+ this.showMoney = money < 0 ? 0 : money
|
1162
|
1183
|
},
|
1163
|
1184
|
|
1164
|
1185
|
|
|
@@ -1619,6 +1640,7 @@ export default {
|
1619
|
1640
|
}
|
1620
|
1641
|
}
|
1621
|
1642
|
.cost {
|
|
1643
|
+ height: 120px;
|
1622
|
1644
|
overflow: scroll;
|
1623
|
1645
|
background: #ffffff;
|
1624
|
1646
|
border-radius: 8px;
|
|
@@ -1801,7 +1823,6 @@ export default {
|
1801
|
1823
|
}
|
1802
|
1824
|
.top {
|
1803
|
1825
|
display: flex;
|
1804
|
|
- justify-content: space-between;
|
1805
|
1826
|
align-items: end;
|
1806
|
1827
|
padding-bottom: 10px;
|
1807
|
1828
|
// border-bottom: 1px dashed #ffdfb6;
|
|
@@ -1813,12 +1834,12 @@ export default {
|
1813
|
1834
|
line-height: 30px;
|
1814
|
1835
|
}
|
1815
|
1836
|
.discount {
|
1816
|
|
- .price-num {
|
1817
|
|
- font-size: 28px;
|
|
1837
|
+ .coupon-price-num {
|
|
1838
|
+ width: 53px;
|
|
1839
|
+ font-size: 16px;
|
1818
|
1840
|
font-family: PingFangSC-Medium, PingFang SC;
|
1819
|
1841
|
font-weight: 500;
|
1820
|
1842
|
color: #ff3007;
|
1821
|
|
- line-height: 40px;
|
1822
|
1843
|
.size {
|
1823
|
1844
|
font-size: 14px;
|
1824
|
1845
|
line-height: 20px;
|
|
@@ -1833,7 +1854,7 @@ export default {
|
1833
|
1854
|
}
|
1834
|
1855
|
}
|
1835
|
1856
|
.discount-over {
|
1836
|
|
- width: 50px;
|
|
1857
|
+ width: 53px;
|
1837
|
1858
|
font-size: 22px;
|
1838
|
1859
|
font-family: PingFangSC-Medium, PingFang SC;
|
1839
|
1860
|
font-weight: 500;
|
|
@@ -1841,8 +1862,9 @@ export default {
|
1841
|
1862
|
line-height: 30px;
|
1842
|
1863
|
}
|
1843
|
1864
|
.coupon-tip {
|
|
1865
|
+ flex: 1;
|
1844
|
1866
|
.tips-title {
|
1845
|
|
- width: 126px;
|
|
1867
|
+ // width: 126px;
|
1846
|
1868
|
font-size: 14px;
|
1847
|
1869
|
font-family: PingFangSC-Medium, PingFang SC;
|
1848
|
1870
|
font-weight: 500;
|