|
@@ -12,7 +12,8 @@
|
12
|
12
|
</div>
|
13
|
13
|
</div>
|
14
|
14
|
<div class="user-record">
|
15
|
|
- <div class="fraction">
|
|
15
|
+ <div class="fraction"
|
|
16
|
+ @click="isPore=true">
|
16
|
17
|
<div class="title">肌肤得分</div>
|
17
|
18
|
<div class="num">{{userInfo.score}}分</div>
|
18
|
19
|
</div>
|
|
@@ -82,7 +83,7 @@
|
82
|
83
|
</div>
|
83
|
84
|
<div class="project">
|
84
|
85
|
<div class="project-title">
|
85
|
|
- <div>共<span>{{order_data.project_list.length}}个</span>项目</div>
|
|
86
|
+ <div>共<span>{{order_data.project_list?order_data.project_list.length:0}}个</span>项目</div>
|
86
|
87
|
<div class="add-project"
|
87
|
88
|
@click="addProject">添加</div>
|
88
|
89
|
</div>
|
|
@@ -116,25 +117,51 @@
|
116
|
117
|
v-if="!isChange">
|
117
|
118
|
<div class="cost-title">
|
118
|
119
|
<div>预约费用</div>
|
119
|
|
- <div>¥399</div>
|
|
120
|
+ <div>¥{{reservationPrice}}</div>
|
120
|
121
|
</div>
|
121
|
122
|
<div class="cost-coupon-list">
|
122
|
|
- <div class="coupon">
|
|
123
|
+ <div class="coupon"
|
|
124
|
+ @click="onCoupon">
|
123
|
125
|
<div class="coupon-tips">
|
124
|
126
|
<div class="coupon-icon"><img src="https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/icon/slices/couponIcon.png"
|
125
|
127
|
alt=""></div>
|
126
|
128
|
<div class="coupon-title">优惠卷</div>
|
127
|
|
- <div class="coupon-tip">已选推荐优惠</div>
|
|
129
|
+ <div class="coupon-tip"
|
|
130
|
+ v-if="order_data.coupon_list&&order_data.coupon_list.length>0">已选推荐优惠</div>
|
128
|
131
|
</div>
|
129
|
132
|
<div class="on-icon">></div>
|
130
|
133
|
</div>
|
131
|
|
- <div class="coupon-ps">
|
132
|
|
- <div>【敏感维稳】多元修护加乘维稳</div>
|
133
|
|
- <div class="cou-price">-¥100</div>
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+ <!-- <div v-if="order_data.coupon_list&&order_data.coupon_list.length>0">
|
|
137
|
+ <div class="coupon-ps"
|
|
138
|
+ v-for="item,index in order_data.coupon_list"
|
|
139
|
+ :key="index">
|
|
140
|
+ <div>{{item.coupon_name}}</div>
|
|
141
|
+ <div class="cou-price">-¥{{price}}</div>
|
|
142
|
+ </div>
|
|
143
|
+ </div> -->
|
|
144
|
+
|
|
145
|
+ <div v-if="1==1">
|
|
146
|
+ <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" v-if="item.type==4?true:false">抵扣{{item.projectName}}</div>
|
|
151
|
+ <div class="cou-price" v-if="item.type==3?true:false">抵扣全部项目(除升级包)</div>
|
|
152
|
+ <div class="cou-price" v-if="item.type==2?true:false">¥{{item.price}}</div>
|
|
153
|
+ <div class="cou-price" v-if="item.type==1?true:false">¥{{item.price}}</div>
|
|
154
|
+ <!-- <div class="cou-price">-¥{{price}}</div> -->
|
|
155
|
+ </div>
|
134
|
156
|
</div>
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
|
135
|
162
|
</div>
|
136
|
163
|
<div class="over-price">
|
137
|
|
- 合计: <span class="price-num"><span class="min-size">¥</span>399<span class="min-size">.00</span></span>
|
|
164
|
+ 合计: <span class="price-num"><span class="min-size">¥</span>{{showMoney}}<span class="min-size"></span></span>
|
138
|
165
|
</div>
|
139
|
166
|
</div>
|
140
|
167
|
<div class="payment"
|
|
@@ -147,35 +174,43 @@
|
147
|
174
|
@click="isCoupun=false"><img src="https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/icon/slices/delete.png"
|
148
|
175
|
alt=""></div>
|
149
|
176
|
<div class="coupon-pupop-title">选择优惠券</div>
|
150
|
|
- <div class="coupon-lists">
|
151
|
|
- <div class="coupon-info">
|
|
177
|
+ <ul class="coupon-lists">
|
|
178
|
+ <li class="coupon-info"
|
|
179
|
+ v-for="item,index in couponList"
|
|
180
|
+ :key="index">
|
|
181
|
+ <!-- 1: '抵扣券',
|
|
182
|
+ 2: '满减券',
|
|
183
|
+ 3: '全额减免券',
|
|
184
|
+ 4: '项目卡券' -->
|
|
185
|
+ <div class="coupon-tips-text">{{item.type==1?'抵扣券':item.type==2?'满减券':item.type==3?'全额减免券':'项目卡券'}}</div>
|
152
|
186
|
<div class="top">
|
153
|
|
- <div v-if="false"
|
154
|
|
- class="all-free">全免</div>
|
|
187
|
+ <div v-if="item.type==3"
|
|
188
|
+ class="discount-over">全免</div>
|
155
|
189
|
<div v-else
|
156
|
190
|
class="discount">
|
157
|
|
- <div class="price-num"><span class="size">¥</span>10<span class="size">.00</span></div>
|
158
|
|
- <div class="price-tips">满100元可用</div>
|
|
191
|
+ <div class="price-num"><span class="size">¥</span>{{item.price}}</div>
|
|
192
|
+ <div class="price-tips">{{item.full_price}}</div>
|
159
|
193
|
</div>
|
160
|
194
|
<div class="coupon-tip">
|
161
|
|
- <div class="tips-title">仅限指定商品使用</div>
|
162
|
|
- <div class="tips-ts">有效期至2022.02.07</div>
|
|
195
|
+ <div class="tips-title">{{item.coupon_name}}</div>
|
|
196
|
+ <div class="tips-ts">有效期至{{item.ex_time}}</div>
|
163
|
197
|
</div>
|
164
|
|
- <div class="choice-icon"><img :src="select"></div>
|
|
198
|
+ <div class="choice-icon"
|
|
199
|
+ @click="selectPupop(item,index)"><img :src="item.isSelect?select:unSelect"></div>
|
165
|
200
|
</div>
|
166
|
201
|
<div class="bottom">
|
167
|
|
- <div class="coupon-notes">
|
|
202
|
+ <div class="coupon-notes"
|
|
203
|
+ @click="isOver=!isOver">
|
168
|
204
|
<div class="notes-text min-size">
|
169
|
|
- <span v-if="!isOver">{{'优惠卷仅限试用项目优惠卷仅限试用项目优惠卷仅限项目优惠卷仅限试用项目优惠卷仅限试用项目优惠卷仅限项目优惠卷仅限试用项目优惠卷仅限试用项目优惠卷仅限项目' |ellipsis(20)}}</span>
|
170
|
|
- <span v-else>优惠卷仅限试用项目优惠卷仅限试用项目优惠卷仅限项目优惠卷仅限试用项目优惠卷仅限试用项目优惠卷仅限项目优惠卷仅限试用项目优惠卷仅限试用项目优惠卷仅限项目</span>
|
|
205
|
+ <span v-if="!isOver">{{item.coupon_desc |ellipsis(20)}}</span>
|
|
206
|
+ <span v-else>{{item.coupon_desc}}</span>
|
171
|
207
|
</div>
|
172
|
|
- <div class="notes-icon"
|
173
|
|
- @click="isOver=!isOver"><img src="https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/icon/coupon/openNotes.png"
|
|
208
|
+ <div class="notes-icon"><img :src="isOver?open:unOpen"
|
174
|
209
|
alt=""></div>
|
175
|
210
|
</div>
|
176
|
211
|
</div>
|
177
|
|
- </div>
|
178
|
|
- </div>
|
|
212
|
+ </li>
|
|
213
|
+ </ul>
|
179
|
214
|
</div>
|
180
|
215
|
</mine-pupop>
|
181
|
216
|
<!-- 选择项目 -->
|
|
@@ -225,19 +260,45 @@
|
225
|
260
|
<div class="ts-content">
|
226
|
261
|
<ul class="ts-table">
|
227
|
262
|
<li v-for="item,index in tsTableList"
|
228
|
|
- :key="index">
|
|
263
|
+ :key="index"
|
|
264
|
+ @click="changetsTable(index)"
|
|
265
|
+ :class="tsTableIndex==index?'ts-table-active':''">
|
229
|
266
|
<div>{{item.text}}</div>
|
230
|
267
|
<div>{{item.ts}}</div>
|
231
|
268
|
</li>
|
232
|
269
|
</ul>
|
233
|
|
- <ul class="ts-boty">
|
234
|
|
- <li v-for="item,index in tsBodyList"
|
235
|
|
- :key="index">
|
236
|
|
- <div>{{item.ts}}</div>
|
237
|
|
- </li>
|
238
|
|
- </ul>
|
|
270
|
+ <div v-if="tsBodyList.day">
|
|
271
|
+ <div class="time-slot">
|
|
272
|
+ <div class="day"
|
|
273
|
+ @click="changeActive(1)"
|
|
274
|
+ :style="active==1?'color: #333333;font-weight: 600;':''">{{ tsBodyList.day.name}}</div>
|
|
275
|
+ <div class="night"
|
|
276
|
+ @click="changeActive(0)"
|
|
277
|
+ :style="active==0?'color: #333333;font-weight: 600;':''">{{tsBodyList.night.name}}</div>
|
|
278
|
+ </div>
|
|
279
|
+ <ul class="ts-boty"
|
|
280
|
+ v-if="active==1">
|
|
281
|
+ <li v-for="item,index in tsBodyList.day.list"
|
|
282
|
+ :key="index">
|
|
283
|
+ <div :style="item.status==0?'color: #D3D3D3;':''"
|
|
284
|
+ @click="selectTime(item)"
|
|
285
|
+ :class="timeIndexText==item.order_time?'time-active':''">{{item.order_time}}</div>
|
|
286
|
+ </li>
|
|
287
|
+ </ul>
|
|
288
|
+ <ul class="ts-boty"
|
|
289
|
+ v-else>
|
|
290
|
+ <li v-for="item,index in tsBodyList.night.list"
|
|
291
|
+ :key="index">
|
|
292
|
+ <div :style="item.status==0?'color: #D3D3D3;':''"
|
|
293
|
+ @click="selectTime(item)"
|
|
294
|
+ :class="timeIndexText==item.order_time?'time-active':''">{{item.order_time}}</div>
|
|
295
|
+ </li>
|
|
296
|
+ </ul>
|
|
297
|
+ </div>
|
239
|
298
|
</div>
|
240
|
|
- <div class="ts-button">确认</div>
|
|
299
|
+ <el-button class="ts-button"
|
|
300
|
+ :style="this.timeIndexText.length == 0?'background: rgb(211, 211, 211);':''"
|
|
301
|
+ @click="comfigTs">确认</el-button>
|
241
|
302
|
</div>
|
242
|
303
|
</mine-pupop>
|
243
|
304
|
<!-- 皮肤状态 -->
|
|
@@ -253,17 +314,18 @@
|
253
|
314
|
:key="index">
|
254
|
315
|
<div class="pore-top">
|
255
|
316
|
<div class="pore-title">
|
256
|
|
- <div>RGB毛孔:</div>
|
257
|
|
- <div class="pore-medium">粗大毛孔个数{{item.medium}}</div>
|
|
317
|
+ <div>{{item.name}}</div>
|
|
318
|
+ <div class="pore-medium"
|
|
319
|
+ v-if="item.main_item">{{item.main_item.name}}{{item.main_item.num}}</div>
|
258
|
320
|
</div>
|
259
|
321
|
<div class="pore-over">
|
260
|
|
- <div class="min-size">粗大毛孔个数:{{item.medium}}个</div>
|
261
|
|
- <div class="min-size">中等毛孔个数:{{item.small}}个</div>
|
262
|
|
- <div class="min-size">细小毛孔个数:{{item.mini}}个</div>
|
|
322
|
+ <div class="min-size"
|
|
323
|
+ v-for="value,index in item.items"
|
|
324
|
+ :key="index">{{value.name}}{{value.num}}个</div>
|
263
|
325
|
</div>
|
264
|
326
|
</div>
|
265
|
327
|
<div class="pore-bottom min-size">
|
266
|
|
- {{'皮肤状态一般,污物阻塞导致,油脂分泌旺盛,皮肤状态一般,污物阻塞导致,油脂分泌旺盛皮肤状态一般,污物阻塞导致,油脂分泌旺盛,皮肤状态一般,污物阻塞导致,油脂分泌旺盛油脂分泌旺盛油脂分泌旺盛旺…' |ellipsis(85)}}
|
|
328
|
+ {{item.suggest | ellipsis(85)}}
|
267
|
329
|
</div>
|
268
|
330
|
</li>
|
269
|
331
|
</ul>
|
|
@@ -281,6 +343,8 @@ export default {
|
281
|
343
|
components: { minePupop },
|
282
|
344
|
data () {
|
283
|
345
|
return {
|
|
346
|
+ open: 'https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/icon/coupon/openNotes.png',
|
|
347
|
+ unOpen: 'https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/icon/coupon/upDate.png',
|
284
|
348
|
select: 'https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/icon/coupon/select.png',
|
285
|
349
|
unSelect: 'https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/icon/coupon/unSelect.png',
|
286
|
350
|
userInfo: {
|
|
@@ -295,75 +359,12 @@ export default {
|
295
|
359
|
//升级包列表
|
296
|
360
|
productsList: [],
|
297
|
361
|
//时间列表(头部)
|
298
|
|
- tsTableList: [
|
299
|
|
- {
|
300
|
|
- text: '今天',
|
301
|
|
- ts: '10-27',
|
302
|
|
- },
|
303
|
|
- {
|
304
|
|
- text: '今天',
|
305
|
|
- ts: '10-27',
|
306
|
|
- },
|
307
|
|
- {
|
308
|
|
- text: '今天',
|
309
|
|
- ts: '10-27',
|
310
|
|
- },
|
311
|
|
- {
|
312
|
|
- text: '今天',
|
313
|
|
- ts: '10-27',
|
314
|
|
- },
|
315
|
|
- {
|
316
|
|
- text: '今天',
|
317
|
|
- ts: '10-27',
|
318
|
|
- },
|
319
|
|
- {
|
320
|
|
- text: '今天',
|
321
|
|
- ts: '10-27',
|
322
|
|
- },
|
323
|
|
- {
|
324
|
|
- text: '今天',
|
325
|
|
- ts: '10-27',
|
326
|
|
- },
|
327
|
|
- ],
|
|
362
|
+ tsTableList: [],
|
|
363
|
+ tsTableIndex: 0,
|
|
364
|
+ active: 1,
|
328
|
365
|
//时间列表(body)
|
329
|
|
- tsBodyList: [
|
330
|
|
- {
|
331
|
|
- id: 0,
|
332
|
|
- ts: '10:00'
|
333
|
|
- },
|
334
|
|
- {
|
335
|
|
- id: 0,
|
336
|
|
- ts: '10:00'
|
337
|
|
- },
|
338
|
|
- {
|
339
|
|
- id: 0,
|
340
|
|
- ts: '10:00'
|
341
|
|
- },
|
342
|
|
- {
|
343
|
|
- id: 0,
|
344
|
|
- ts: '10:00'
|
345
|
|
- },
|
346
|
|
- {
|
347
|
|
- id: 0,
|
348
|
|
- ts: '10:00'
|
349
|
|
- },
|
350
|
|
- {
|
351
|
|
- id: 0,
|
352
|
|
- ts: '10:00'
|
353
|
|
- },
|
354
|
|
- {
|
355
|
|
- id: 0,
|
356
|
|
- ts: '10:00'
|
357
|
|
- },
|
358
|
|
- {
|
359
|
|
- id: 0,
|
360
|
|
- ts: '10:00'
|
361
|
|
- },
|
362
|
|
- {
|
363
|
|
- id: 0,
|
364
|
|
- ts: '10:00'
|
365
|
|
- },
|
366
|
|
- ],
|
|
366
|
+ tsBodyList: {
|
|
367
|
+ },
|
367
|
368
|
//皮肤状态列表
|
368
|
369
|
poreList: [
|
369
|
370
|
{
|
|
@@ -382,15 +383,17 @@ export default {
|
382
|
383
|
mini: 242
|
383
|
384
|
}
|
384
|
385
|
],
|
385
|
|
-
|
386
|
|
- couponList: [
|
387
|
|
- {
|
388
|
|
-
|
389
|
|
- }
|
390
|
|
- ],
|
|
386
|
+ //优惠券列表
|
|
387
|
+ couponList: [],
|
|
388
|
+ //已选择的优惠券
|
|
389
|
+ selectCouponList: [],
|
|
390
|
+ //已选择优惠券的id(同一个id只能选择一张优惠券)
|
|
391
|
+ selectCouponListId: [],
|
391
|
392
|
timesInfo: '',
|
|
393
|
+ reservationPrice: 0,//预约费用
|
392
|
394
|
projectInfo: '',
|
393
|
395
|
productsInfo: '',
|
|
396
|
+ timeIndexText: "",//当前选择的时间
|
394
|
397
|
weekInfo: '',
|
395
|
398
|
programmeIndex: '',
|
396
|
399
|
remarks: '',
|
|
@@ -402,6 +405,20 @@ export default {
|
402
|
405
|
id: 0,//订单id
|
403
|
406
|
isChange: false,//项目是否有改变
|
404
|
407
|
isEditProject: false,//是否编辑项目
|
|
408
|
+ page: 1,
|
|
409
|
+ limit: 200,
|
|
410
|
+
|
|
411
|
+
|
|
412
|
+
|
|
413
|
+
|
|
414
|
+ needSelect: false,
|
|
415
|
+ coupSelectType: '',
|
|
416
|
+ productDiscount: '',
|
|
417
|
+ isSelectCoup: [], // 选择的优惠券
|
|
418
|
+ // 下面是支付的数据
|
|
419
|
+ showMoney: 0, // 价值总额
|
|
420
|
+ // showRuleText: 10086,
|
|
421
|
+
|
405
|
422
|
};
|
406
|
423
|
},
|
407
|
424
|
computed: {
|
|
@@ -417,6 +434,9 @@ export default {
|
417
|
434
|
this.remarks = res.data.remark
|
418
|
435
|
this.programmeList = res.data.scheme_list
|
419
|
436
|
this.order_data = res.data.order_data
|
|
437
|
+ this.showMoney=res.data.order_data.price
|
|
438
|
+ this.poreList = res.data.detail_list
|
|
439
|
+ this.calculationPrice()
|
420
|
440
|
})
|
421
|
441
|
},
|
422
|
442
|
getProjectList () {
|
|
@@ -470,6 +490,7 @@ export default {
|
470
|
490
|
e.price = Number(e.price) + Number(item.price)
|
471
|
491
|
this.isProject = false
|
472
|
492
|
this.isEditProject = false
|
|
493
|
+ this.calculationPrice()
|
473
|
494
|
}
|
474
|
495
|
})
|
475
|
496
|
}
|
|
@@ -521,14 +542,335 @@ export default {
|
521
|
542
|
this.order_data.project_list.push(projectInfo)
|
522
|
543
|
this.isChange = true
|
523
|
544
|
this.isProject = false
|
|
545
|
+ this.calculationPrice()
|
524
|
546
|
}
|
525
|
547
|
},
|
|
548
|
+ //获取最近七天的时间
|
|
549
|
+ getWeekDate () {
|
|
550
|
+ //获取系统当前时间
|
|
551
|
+ let now = new Date();
|
|
552
|
+ let nowTime = now.getTime();
|
|
553
|
+ let oneDayTime = 24 * 60 * 60 * 1000;
|
|
554
|
+ let tsTableList = []
|
|
555
|
+ for (let i = 0; i < 7; i++) {
|
|
556
|
+ //显示周一
|
|
557
|
+ let ShowTime = nowTime + (i + 1) * oneDayTime;
|
|
558
|
+ //初始化日期时间
|
|
559
|
+ let myDate = new Date(ShowTime);
|
|
560
|
+ let year = myDate.getFullYear();
|
|
561
|
+ let month = myDate.getMonth() + 1;
|
|
562
|
+ let date = myDate.getDate();
|
|
563
|
+ console.log(year + "-" + month + "-" + date)
|
|
564
|
+ let str = "周" + "日一二三四五六".charAt(myDate.getDay());
|
|
565
|
+ let tsTableInfo = {}
|
|
566
|
+ tsTableInfo['text'] = i == 0 ? '今天' : i == 1 ? '明天' : str
|
|
567
|
+ tsTableInfo['ts'] = month + "-" + date
|
|
568
|
+ tsTableInfo['order_day'] = year + "-" + month + "-" + date
|
|
569
|
+ tsTableList.push(tsTableInfo)
|
|
570
|
+ console.log(str)
|
|
571
|
+ }
|
|
572
|
+ this.tsTableList = tsTableList
|
|
573
|
+ },
|
526
|
574
|
//确定订单&支付
|
527
|
|
- determine () {
|
528
|
|
- if (condition) {
|
529
|
|
-
|
|
575
|
+ determine () {
|
|
576
|
+ if (this.isChange) {
|
|
577
|
+ this.getWeekDate()
|
|
578
|
+ this.getOrderTime()
|
|
579
|
+ this.order_time = ''
|
|
580
|
+ this.tsTableIndex = 0
|
|
581
|
+ this.isTs = true
|
|
582
|
+ } else {
|
|
583
|
+ debugger
|
530
|
584
|
}
|
531
|
585
|
},
|
|
586
|
+ //确定时间选择
|
|
587
|
+ comfigTs () {
|
|
588
|
+ if (this.timeIndexText.length == 0) return
|
|
589
|
+ let order_data = [], order_data_info = {}
|
|
590
|
+ this.order_data.project_list.forEach(item => {
|
|
591
|
+ order_data_info['id'] = item.id
|
|
592
|
+ if (item.product_ids != "") {
|
|
593
|
+ order_data_info['product_id'] = item.product_ids
|
|
594
|
+ }
|
|
595
|
+ order_data.push(order_data_info)
|
|
596
|
+ })
|
|
597
|
+ let params = {
|
|
598
|
+ id: this.id,
|
|
599
|
+ order_data: JSON.stringify(order_data),
|
|
600
|
+ order_day: this.tsTableList[this.tsTableIndex].order_day,
|
|
601
|
+ order_time: this.timeIndexText
|
|
602
|
+ }
|
|
603
|
+ api.setOrderUpdate(params).then(res => {
|
|
604
|
+ if (res.code == 200) {
|
|
605
|
+ this.getOrderInfo()
|
|
606
|
+ this.isTs = false
|
|
607
|
+ this.isChange = false
|
|
608
|
+ }
|
|
609
|
+ })
|
|
610
|
+ },
|
|
611
|
+ //计算预约费用
|
|
612
|
+ calculationPrice () {
|
|
613
|
+ this.order_data.project_list.forEach(res => {
|
|
614
|
+ this.reservationPrice += Number(res.price)
|
|
615
|
+ })
|
|
616
|
+ },
|
|
617
|
+ //获取订单优惠券
|
|
618
|
+ onCoupon () {
|
|
619
|
+
|
|
620
|
+ if(this.couponList.length>0){
|
|
621
|
+ this.isCoupun = true
|
|
622
|
+ return
|
|
623
|
+ }
|
|
624
|
+
|
|
625
|
+ let params = {
|
|
626
|
+ id: this.id,
|
|
627
|
+ page: this.page,
|
|
628
|
+ limit: this.limit
|
|
629
|
+ }
|
|
630
|
+ api.getOrderCoupon(params).then(res => {
|
|
631
|
+ this.couponList = [...this.couponList, ...res.data.list]
|
|
632
|
+ this.couponList.forEach(item => {
|
|
633
|
+ this.$set(item, 'isSelect', false)
|
|
634
|
+ })
|
|
635
|
+ this.page++
|
|
636
|
+ if (this.couponList.length < res.data.total) {
|
|
637
|
+ this.onCoupon()
|
|
638
|
+ }
|
|
639
|
+ })
|
|
640
|
+ console.log(this.couponList)
|
|
641
|
+ this.isCoupun = true
|
|
642
|
+ },
|
|
643
|
+
|
|
644
|
+
|
|
645
|
+ //数组包含关系
|
|
646
|
+ includes (arr1, arr2) {
|
|
647
|
+ return arr2.every(val => arr1.includes(val));
|
|
648
|
+ },
|
|
649
|
+ //选中优惠券
|
|
650
|
+ // selectPupop (item, index) {
|
|
651
|
+ // this.couponList[index].Select = !this.couponList[index].Select
|
|
652
|
+ // this.selectCouponList = this.couponList.filter(res => {
|
|
653
|
+ // return res.Select == true
|
|
654
|
+ // })
|
|
655
|
+ // this.selectCouponList.forEach(res => {
|
|
656
|
+ // })
|
|
657
|
+
|
|
658
|
+ // },
|
|
659
|
+
|
|
660
|
+
|
|
661
|
+// 不可以用的不显示,如果同时有项目劵、抵扣劵、满减劵,只能用一种类型,其他劵不显示
|
|
662
|
+// 1、针对单个项目,项目劵可以多选
|
|
663
|
+// 2、抵扣劵、满减劵针对的是整个订单,当用户已使用了单个项目劵时,抵扣劵、满减劵就不能使用
|
|
664
|
+// 3、优惠劵可以给多个项目抵扣,
|
|
665
|
+// 4、默认抵扣金额最高的
|
|
666
|
+// 5、优惠劵排序,到期时间倒叙
|
|
667
|
+
|
|
668
|
+
|
|
669
|
+/**
|
|
670
|
+ * 点击使用按钮、勾选按钮
|
|
671
|
+ */
|
|
672
|
+ selectPupop: function (item, index) {
|
|
673
|
+
|
|
674
|
+
|
|
675
|
+ let CouPonIndex = this.couponList
|
|
676
|
+
|
|
677
|
+ let selectIndex = index
|
|
678
|
+ let curreValue = !CouPonIndex[selectIndex].isSelect
|
|
679
|
+ let project_list = this.order_data.project_list //这里是项目列表
|
|
680
|
+
|
|
681
|
+ // 判断是否是不相同的项目券
|
|
682
|
+ if (this.couponList[selectIndex].type != 4) {
|
|
683
|
+ for (let i = 0; i < CouPonIndex.length; i++) {
|
|
684
|
+ CouPonIndex[i].isSelect = false
|
|
685
|
+ }
|
|
686
|
+ for (let i = 0; i < project_list.length; i++) {
|
|
687
|
+ project_list[i].cardId = ''
|
|
688
|
+ }
|
|
689
|
+
|
|
690
|
+ } else if (this.coupSelectType != 4) {
|
|
691
|
+ for (let i = 0; i < CouPonIndex.length; i++) {
|
|
692
|
+ CouPonIndex[i].isSelect = false
|
|
693
|
+ }
|
|
694
|
+ for (let i = 0; i < project_list.length; i++) {
|
|
695
|
+ project_list[i].cardId = ''
|
|
696
|
+ }
|
|
697
|
+ } else {
|
|
698
|
+ let numberSelect = 0
|
|
699
|
+ for (let i = 0; i < CouPonIndex.length; i++) {
|
|
700
|
+ if (CouPonIndex[i].isSelect) {
|
|
701
|
+ numberSelect = numberSelect + 1
|
|
702
|
+ }
|
|
703
|
+ }
|
|
704
|
+ console.log('numberSelect')
|
|
705
|
+ console.log(numberSelect)
|
|
706
|
+ if (numberSelect == this.order_data.project_list.length && curreValue) {
|
|
707
|
+ this.$message.error('最多选择' + this.order_data.project_list.length + '项目券!');
|
|
708
|
+ return
|
|
709
|
+ }
|
|
710
|
+ }
|
|
711
|
+ // 判断是否是取消选择项目券
|
|
712
|
+ CouPonIndex[selectIndex].isSelect = curreValue
|
|
713
|
+ if (!curreValue) {
|
|
714
|
+ for (let j = 0; j < project_list.length; j++) {
|
|
715
|
+ if (project_list[j].cardId && project_list[j].cardId == this.couponList[selectIndex].id) { // 如果是取消选择,那么也要取消绑定项目的id
|
|
716
|
+ project_list[j].cardId = ''
|
|
717
|
+ }
|
|
718
|
+ }
|
|
719
|
+ CouPonIndex[selectIndex].projectids = ''
|
|
720
|
+ }
|
|
721
|
+ let orderDetails1 = this.order_data
|
|
722
|
+ orderDetails1.project_list = project_list
|
|
723
|
+
|
|
724
|
+
|
|
725
|
+ this.order_data=orderDetails1
|
|
726
|
+ this.couponList=CouPonIndex
|
|
727
|
+ this.coupSelectType=this.couponList[selectIndex].type
|
|
728
|
+
|
|
729
|
+ console.log(this.order_data)
|
|
730
|
+ console.log(this.couponList)
|
|
731
|
+
|
|
732
|
+ this.selectCoup()
|
|
733
|
+
|
|
734
|
+ },
|
|
735
|
+
|
|
736
|
+// 选择项目进行绑定
|
|
737
|
+ selectCoup() {
|
|
738
|
+ let that = this
|
|
739
|
+ let isSelectCoups = []
|
|
740
|
+ for (let i = 0; i < this.couponList.length; i++) {
|
|
741
|
+ if (this.couponList[i].isSelect) {
|
|
742
|
+ let selectCoup = that.couponList[i]
|
|
743
|
+ isSelectCoups.push(selectCoup)
|
|
744
|
+ }
|
|
745
|
+ }
|
|
746
|
+ this.isSelectCoup=isSelectCoups
|
|
747
|
+ console.log(this.isSelectCoup)
|
|
748
|
+
|
|
749
|
+ // 抵扣顺序按照项目金额计算
|
|
750
|
+ that.theMoneyBest()
|
|
751
|
+ },
|
|
752
|
+
|
|
753
|
+ // 抵扣顺序按照项目金额计算
|
|
754
|
+ // 卡券,项目券数据包,id:订单项目ID,coupon_id:优惠券ID,如:[{"id":1220,coupon_id:199}]
|
|
755
|
+ theMoneyBest() {
|
|
756
|
+ let that = this
|
|
757
|
+ let project_list = this.order_data.project_list //这里是项目列表
|
|
758
|
+ let isSelectCoup = this.isSelectCoup //这里选择了的卡券列表
|
|
759
|
+ let selectProjectList = [] // 适合的卡券列表
|
|
760
|
+ // let CouPonIndex = this.CouPonIndex // 卡券选择的Id
|
|
761
|
+ let productDiscount = this.couponList // 卡券列表
|
|
762
|
+ console.log(productDiscount)
|
|
763
|
+ // debugger
|
|
764
|
+ if (isSelectCoup[0].type == 4) {
|
|
765
|
+ for (let i = 0; i < isSelectCoup.length; i++) { // 首先遍历卡券
|
|
766
|
+ if (!isSelectCoup[i].projectids) { // 如果卡券没绑定项目
|
|
767
|
+ console.log('没绑定过!')
|
|
768
|
+
|
|
769
|
+ let selectIndexMoney = 0 // 初始值
|
|
770
|
+ let selectIndex = 111 // 初始金额
|
|
771
|
+ for (let j = 0; j < project_list.length; j++) { // 遍历项目
|
|
772
|
+ if (isSelectCoup[i].project_ids.indexOf(project_list[j].id) != -1 && !project_list[j].cardId) { // 如果卡券能够使用这个项目并且这个项目没有被绑定过
|
|
773
|
+ console.log('project_list[j].price')
|
|
774
|
+ console.log(project_list[j].price)
|
|
775
|
+ console.log(selectIndexMoney)
|
|
776
|
+ console.log(project_list[j].price > selectIndexMoney)
|
|
777
|
+ if (project_list[j].price * 1 > selectIndexMoney * 1) {
|
|
778
|
+ selectIndex = j
|
|
779
|
+ selectIndexMoney = project_list[j].price
|
|
780
|
+ console.log('--' + selectIndexMoney)
|
|
781
|
+ }
|
|
782
|
+ // selectProjectList.push(project_list[i])
|
|
783
|
+ }
|
|
784
|
+ }
|
|
785
|
+ if (selectIndex != 111) {
|
|
786
|
+ console.log('走了这里走了这里')
|
|
787
|
+ isSelectCoup[i].projectids = project_list[selectIndex].id
|
|
788
|
+ isSelectCoup[i].projectName = project_list[selectIndex].name
|
|
789
|
+ project_list[selectIndex].cardId = isSelectCoup[i].id
|
|
790
|
+ } else {
|
|
791
|
+ for (let k = 0; k < productDiscount.length; k++) {
|
|
792
|
+ if (productDiscount[k].id == isSelectCoup[i].id) {
|
|
793
|
+ // isSelectCoup.
|
|
794
|
+ productDiscount[k].isSelect = false
|
|
795
|
+ // isSelectCoup.splice(isSelectCoup.length-1,1);
|
|
796
|
+ this.$message.error('没有适合的项目!');
|
|
797
|
+ }
|
|
798
|
+ }
|
|
799
|
+ }
|
|
800
|
+
|
|
801
|
+ }
|
|
802
|
+ }
|
|
803
|
+ let orderDetails1 = this.order_data
|
|
804
|
+ orderDetails1.project_list = project_list
|
|
805
|
+ this.couponList= productDiscount
|
|
806
|
+ this.isSelectCoup= isSelectCoup
|
|
807
|
+ this.order_data= orderDetails1
|
|
808
|
+ }
|
|
809
|
+
|
|
810
|
+ this.calculateMoney() //计算总额
|
|
811
|
+ },
|
|
812
|
+
|
|
813
|
+ // 计算总额
|
|
814
|
+ calculateMoney() {
|
|
815
|
+ let that = this
|
|
816
|
+ let money = this.order_data.price
|
|
817
|
+ let isSelectCoup = this.isSelectCoup
|
|
818
|
+ let project_list = this.order_data.project_list //这里是项目列表
|
|
819
|
+
|
|
820
|
+ if (isSelectCoup.length == 0) {
|
|
821
|
+ this.showMoney=money.toFixed(2)
|
|
822
|
+ return
|
|
823
|
+ }
|
|
824
|
+
|
|
825
|
+ // 如果是项目
|
|
826
|
+ if (isSelectCoup[0].type == 4) {
|
|
827
|
+ for (let i = 0; i < project_list.length; i++) {
|
|
828
|
+ if (project_list[i].cardId) {
|
|
829
|
+ money = money - project_list[i].price
|
|
830
|
+ }
|
|
831
|
+ }
|
|
832
|
+ this.showMoney=money.toFixed(2)
|
|
833
|
+ } else if (isSelectCoup[0].type == 3) {
|
|
834
|
+ for (let i = 0; i < project_list.length; i++) {
|
|
835
|
+ money = money - project_list[i].price
|
|
836
|
+ }
|
|
837
|
+
|
|
838
|
+ } else {
|
|
839
|
+ money = money - isSelectCoup[0].price
|
|
840
|
+ }
|
|
841
|
+
|
|
842
|
+ this.showMoney=money.toFixed(2)
|
|
843
|
+
|
|
844
|
+
|
|
845
|
+ },
|
|
846
|
+
|
|
847
|
+
|
|
848
|
+ changeActive (e) {
|
|
849
|
+ this.active = e
|
|
850
|
+ },
|
|
851
|
+ selectTime (item) {
|
|
852
|
+ if (item.status == 0) return
|
|
853
|
+ this.timeIndexText = item.order_time
|
|
854
|
+ },
|
|
855
|
+ changetsTable (index) {
|
|
856
|
+ this.tsTableIndex = index
|
|
857
|
+ this.getOrderTime()
|
|
858
|
+ },
|
|
859
|
+ getOrderTime () {
|
|
860
|
+ let ids = '', idsList = []
|
|
861
|
+ this.order_data.project_list.forEach(res => {
|
|
862
|
+ idsList.push(res.id)
|
|
863
|
+ })
|
|
864
|
+ ids = idsList.toString()
|
|
865
|
+ let params = {
|
|
866
|
+ ids: ids,
|
|
867
|
+ order_day: this.tsTableList[this.tsTableIndex].order_day
|
|
868
|
+ }
|
|
869
|
+ api.getOrderTime(params).then(res => {
|
|
870
|
+ this.tsBodyList = res.data
|
|
871
|
+ })
|
|
872
|
+ },
|
|
873
|
+
|
532
|
874
|
onOperation (index) {
|
533
|
875
|
if (this.programmeList[index].onSelect) {
|
534
|
876
|
this.$set(this.programmeList[index], 'onSelect', !this.programmeList[index].onSelect)
|
|
@@ -1006,10 +1348,27 @@ export default {
|
1006
|
1348
|
overflow: scroll;
|
1007
|
1349
|
.coupon-info {
|
1008
|
1350
|
width: 345px;
|
|
1351
|
+ margin-bottom: 20px;
|
1009
|
1352
|
padding: 20px 14px 10px 14px;
|
1010
|
1353
|
position: relative;
|
1011
|
1354
|
background: #fff4e6;
|
1012
|
1355
|
border-radius: 12px;
|
|
1356
|
+ .coupon-tips-text {
|
|
1357
|
+ position: absolute;
|
|
1358
|
+ left: 0;
|
|
1359
|
+ top: 0;
|
|
1360
|
+ padding: 0 8px;
|
|
1361
|
+ height: 18px;
|
|
1362
|
+ background: #875617;
|
|
1363
|
+ border-radius: 12px 0px 12px 0px;
|
|
1364
|
+ font-size: 12px;
|
|
1365
|
+ font-family: PingFangSC-Medium, PingFang SC;
|
|
1366
|
+ font-weight: 500;
|
|
1367
|
+ color: #ffffff;
|
|
1368
|
+ line-height: 18px;
|
|
1369
|
+ zoom: 0.83;
|
|
1370
|
+ text-align: center;
|
|
1371
|
+ }
|
1013
|
1372
|
.top {
|
1014
|
1373
|
display: flex;
|
1015
|
1374
|
justify-content: space-between;
|
|
@@ -1043,6 +1402,13 @@ export default {
|
1043
|
1402
|
line-height: 17px;
|
1044
|
1403
|
}
|
1045
|
1404
|
}
|
|
1405
|
+ .discount-over {
|
|
1406
|
+ font-size: 22px;
|
|
1407
|
+ font-family: PingFangSC-Medium, PingFang SC;
|
|
1408
|
+ font-weight: 500;
|
|
1409
|
+ color: #ff3007;
|
|
1410
|
+ line-height: 30px;
|
|
1411
|
+ }
|
1046
|
1412
|
.coupon-tip {
|
1047
|
1413
|
.tips-title {
|
1048
|
1414
|
font-size: 16px;
|
|
@@ -1143,7 +1509,7 @@ export default {
|
1143
|
1509
|
}
|
1144
|
1510
|
.ts-block {
|
1145
|
1511
|
width: 540px;
|
1146
|
|
- height: 400px;
|
|
1512
|
+ height: 420px;
|
1147
|
1513
|
background: #ffffff;
|
1148
|
1514
|
border-radius: 8px;
|
1149
|
1515
|
position: relative;
|
|
@@ -1178,15 +1544,32 @@ export default {
|
1178
|
1544
|
li {
|
1179
|
1545
|
text-align: center;
|
1180
|
1546
|
}
|
|
1547
|
+ .ts-table-active {
|
|
1548
|
+ color: #fa7d22;
|
|
1549
|
+ border-bottom: 4px solid #fa4622;
|
|
1550
|
+ }
|
|
1551
|
+ }
|
|
1552
|
+
|
|
1553
|
+ .time-slot {
|
|
1554
|
+ margin-top: 20px;
|
|
1555
|
+ display: flex;
|
|
1556
|
+ justify-content: space-between;
|
|
1557
|
+ font-size: 16px;
|
|
1558
|
+ font-family: PingFangSC-Regular, PingFang SC;
|
|
1559
|
+ font-weight: 400;
|
|
1560
|
+ color: #999999;
|
|
1561
|
+ line-height: 22px;
|
1181
|
1562
|
}
|
1182
|
1563
|
.ts-boty {
|
1183
|
1564
|
margin-top: 10px;
|
|
1565
|
+ margin-left: -19px;
|
1184
|
1566
|
display: flex;
|
1185
|
|
- justify-content: space-between;
|
|
1567
|
+ justify-content: unset;
|
1186
|
1568
|
flex-wrap: wrap;
|
1187
|
1569
|
li {
|
1188
|
1570
|
margin-top: 10px;
|
1189
|
1571
|
width: 68px;
|
|
1572
|
+ margin-left: 19px;
|
1190
|
1573
|
height: 30px;
|
1191
|
1574
|
line-height: 30px;
|
1192
|
1575
|
text-align: center;
|
|
@@ -1197,11 +1580,18 @@ export default {
|
1197
|
1580
|
font-weight: 400;
|
1198
|
1581
|
color: #333333;
|
1199
|
1582
|
}
|
|
1583
|
+ .time-active {
|
|
1584
|
+ background: #fff0e6;
|
|
1585
|
+ border: 1px solid #fa7d22;
|
|
1586
|
+ font-weight: 500;
|
|
1587
|
+ color: #fa7d22;
|
|
1588
|
+ }
|
1200
|
1589
|
}
|
1201
|
1590
|
}
|
1202
|
1591
|
.ts-button {
|
1203
|
1592
|
position: absolute;
|
1204
|
1593
|
bottom: 42px;
|
|
1594
|
+ padding: 0;
|
1205
|
1595
|
left: 50%;
|
1206
|
1596
|
transform: translateX(-50%);
|
1207
|
1597
|
width: 176px;
|