constructionOrderDetail.js
24.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
// tabWorkOrder/pages/orderDetail/orderDetail.js
import api from "../../api.js";
import order_mixins, { data } from "../order_mixins.js";
import { getPositionList } from "~/store/index";
import { checkDailyReport } from "~/store/ModalToQueueControl";
const IMG_URL =
"https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/";
const app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
IMG_URL,
...order_mixins.data,
selectType: 1,
selectTypeOrder: 1,
qrFlag: true,
qrHeight: 107,
isYqdSuper: app.globalData.isYqdSuper,
isStaff: app.globalData.isStaff,
customerService: "",
defaultCustomerService:
"https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/kf.png",
// defaultCustomerService: 'https://img01.glsx.com.cn/group1/M00/21/01/wKgFHWKEkeSAZRltAAED5CfS91o118.png',
failCustomerService: "../images/kfrefresh.png",
showTip: false,
warrantyCardVisible: true,
showRatingPopup: false,
showRatingCard: true, // 显示评价卡片
isMake: true,
warrantyEditObj: {}
},
RatingPopupSetting() {
this.setData({
showRatingPopup: !this.data.showRatingPopup,
});
},
jumpUserPortrait() {
wx.$router.go("tabDate.userPortrait", this.data.orderInfo);
},
selectTypeOrder(e) {
let { type } = e.currentTarget.dataset;
console.log(e, e.currentTarget.dataset, type);
this.setData({
selectTypeOrder: type,
});
},
blur(e) {
console.log(e)
let { value } = e.detail
// let { shortcutList } = this.data
value = value.substring(0, 50)
// if (!value) {
// shortcutList.map(i => (i.active = false))
// }
this.setData({
['warrantyEditObj.warrantyPrice']: value,
// shortcutList,
focus: false
})
},
// 确定是否要显示
showWarranty(e) {
let { item } = e.currentTarget.dataset;
this.setData({
warrantyEditObj: item,
focus: true
})
wx.$modal(
this,
{
show: true,
title: '',
tabTitleShow: false,
success: (res) => {
let { orderCode } = this.data
api.modifyWarrantyPrice({ ...this.data.warrantyEditObj }).then((result) => {
wx.$util.showToast('更新成功')
this.getOrderDetail(orderCode);
}).catch((err) => {
});
// 跳转新增订单页面 并带特定参数
// let { selectType } = this.data;
// if (selectType == 1) {
// wx.$router.go("tabWorkOrder.createOrder", {
// scene,
// ...item,
// });
// } else {
// wx.$router.go("tabWorkOrder.defeatOrder", {
// scene,
// ...item,
// });
// }
},
error: () => { },
},
"#modal4"
);
},
// 确定是否要显示
showSelectTypeOrder({ scene = "", item = {} }) {
let { orderInfo } = this.data;
orderInfo.orderSource = 4;
// delete orderInfo.orderCode
// 去除掉错误订单对应的关联码
// delete orderInfo.associateOrderCode
// 1031车膜下单版本 再次下单去掉商品信息 需重新选择
let deleteList = [
"orderCode",
"associateOrderCode",
"packageGoodsList",
"merchantDistributionList",
"expenseCategoryList",
"profitAllocatinList",
"clientSignatureDTOList",
"customerPhotos",
"rating",
"sellerName",
"sellerUserId",
"sellerMerchantName",
"sellerMerchantId",
"subOrderList",
"technicianList",
"merchantExpenseDistributionList",
];
for (var i = 0; i < deleteList.length; i++) {
// console.log(arr[i])
orderInfo[deleteList[i]] && delete orderInfo[deleteList[i]];
}
orderInfo.againOrder = true;
wx.$modal(
this,
{
show: true,
title: "请选择录单入口",
tabTitleShow: false,
success: (res) => {
// 跳转新增订单页面 并带特定参数
let { orderInfo, selectTypeOrder } = this.data;
console.log(item, "showSelectType");
if (orderInfo?.selectPayType == 0) { // 解决战败进新建工单导致查询战败商品的问题
orderInfo.selectPayType = 2
}
if (selectTypeOrder == 1) {
wx.$router.go("tabWorkOrder.createOrder", {
scene,
...orderInfo,
});
} else {
wx.$router.go("tabWorkOrder.defeatOrder", {
scene,
...orderInfo,
});
}
},
error: () => { },
},
"#modal3"
);
},
// 跳转正确订单
redirectOrder() {
let { orderInfo } = this.data;
let _this = this;
wx.$util.showLoading("加载中...");
api
.getOrderDetail({
orderCode: orderInfo.associatedOrderCode,
})
.then((result) => {
// 根据不同状态和施工标志做对应跳转
let { code, data: item } = result;
if (code == 0) {
item.oldOrderCode = orderInfo.associatedOrderCode;
let name =
item.status == 3
? "confirmOrder"
: item.status == 1
? "createOrder"
: "orderDetail";
if (item.constructionFlag == "Y" && item.status != 10) {
wx.$router.go("constructionOrderDetail", item);
} else {
// console.log(item)
// 解决错单能切换支付方式的问题
// wx.$router.go(name, { ...item, associateOrderType: true })
wx.$router.go(name, { ...item });
}
}
})
.catch((err) => {
console.log(err);
});
// wx.$router.redirectTo('constructionOrderDetail', { orderCode: orderInfo.associatedOrderCode })
},
targetOperate() {
let { showTip } = this.data;
this.setData({
showTip: !showTip,
});
},
selectType(e) {
let { type } = e.currentTarget.dataset;
console.log(e, e.currentTarget.dataset, type);
this.setData({
selectType: type,
});
},
// 确定是否要显示
async targetError() {
// 校验是否填写昨日日报
let staffCheck = await checkDailyReport();
if (staffCheck) return false;
wx.$modal(this, {
show: true,
title: "工单标记",
tabTitleShow: false,
success: (res) => {
this.showErrorType();
},
error: () => { },
});
},
// 确定是否要显示
showErrorType() {
wx.$modal(
this,
{
show: true,
title: "请选择录单入口",
tabTitleShow: false,
success: (res) => {
// 跳转新增订单页面 并带特定参数
let { orderInfo, selectType } = this.data;
if (selectType == 1) {
orderInfo.associateOrderCode = orderInfo.orderCode;
delete orderInfo.orderCode;
if (orderInfo.technicianList) {
delete orderInfo.technicianList;
}
orderInfo.selectPayType = 2;
let urlName = "createOrder";
wx.$router.redirectTo(urlName, orderInfo);
} else {
// 无需补录
api
.noNeedSupplementOrder({ oldOrderCode: orderInfo.orderCode })
.then((res) => {
console.log(res);
if (res.code == 0) {
wx.$util.refreshPageData();
wx.$router.go("pages.index");
this.setData({
modalShow: false,
});
wx.$modal(this, { show: false }, "#modal2");
} else {
wx.$util.showToast(res.message);
}
})
.catch((err) => {
console.log(err);
});
}
},
error: () => { },
},
"#modal2"
);
},
// 选择技师确认
changeArtificer(e) {
let value = e?.detail || {};
let { orderInfo } = this.data;
orderInfo?.subOrderList?.forEach((val) => {
if (val.subOrderCode == value?.subOrderCode) {
val.technicianName = value.technicianName;
val.technicianUuid = value.technicianUuid;
val.technicianId = value.technicianId;
}
});
let params = {
orderCode: orderInfo?.orderCode,
subOrderCode: value?.subOrderCode,
technicianName: value?.technicianName,
technicianUuid: value?.technicianUuid,
technicianId: value?.technicianId,
};
api.updateTechnicianInfo(params).then((res) => {
let { code, message } = res;
if (code == 0) {
this.setData({
artificerSelectPopup: false,
artificerSelectObj: value,
orderInfo,
});
} else {
wx.$util.showToast(message);
}
});
},
// 选择技师
selectArtificer(e) {
// 已施工完成不可操作
return;
let { item } = e.currentTarget.dataset;
this.setData({
artificerSelectPopup: true,
artificerSelectObj: item,
});
},
jumpUpdate() {
let { orderInfo } = this.data;
wx.$router.go("updateOrderInfo", orderInfo);
},
async againOrder() {
// 校验是否填写昨日日报
let staffCheck = await checkDailyReport();
if (staffCheck) return false;
// 新增订单
this.showSelectTypeOrder(4);
},
showAgain() {
this.setData({
showPopup: true,
});
},
setCopyData(e) {
let { content } = e.currentTarget.dataset;
console.log(e, "e");
wx.$util.setCopyData(`${content}`);
},
makePhoneCall(e) {
let { data } = e.currentTarget.dataset;
wx.makePhoneCall({
phoneNumber: data,
});
},
onRoute(options) {
// wx.$router.go("pages.index");
console.log(options);
if (options.orderCode) {
this.setData({
orderCode: options.orderCode,
});
this.getOrderDetail(options.orderCode);
// this.getGrass(options.orderCode)
}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.log(options);
// debugger
if (options.orderCode) {
this.getOrderDetail(options.orderCode);
}
let userInfo = wx.$util.getUserInfo();
let o = wx.$util.getStorageSync("dj_boutique_user_info");
this.checkPhoneShow(app.globalData.YQorderSetting?.yqPhoneConfig);
this.setData({
userInfo: o,
isYqdSuper: app.globalData.isYqdSuper,
isStaff: app.globalData.isStaff,
isMake: !(userInfo?.isSuper || userInfo?.loginRole == 3 || userInfo.loginRole == 5),
});
},
checkPhoneShow(config) {
console.log("config", config);
// 有就屏蔽手机号的显示
if (config) {
let { customerObj } = this.data;
delete customerObj[2];
this.setData({
customerObj,
});
}
},
async getOrderDetail(orderCode) {
let _this = this;
const positionTypeList = (await getPositionList()) || [];
wx.$util.showLoading("加载中...");
api
.getPackageGoodsDetail({
orderCode,
})
.then((res) => {
let { code, message, data } = res;
if (code == 0) {
wx.$util.hideLoading();
let couponName = data.customerCoupon
? data.customerCoupon.couponName
: "";
let total_price = 0;
let warrantyCardList = [];
data.subOrderList = data.subOrderList.filter(
(item) => item.merchantGoodsId
);
for (var i = 0; i < data?.subOrderList?.length; i++) {
let e = data?.subOrderList[i];
total_price += e.totalPrice;
e.price = Number(
wx.$util.decimal(Number(e.totalPrice / e.number), 2)
).toFixed(2);
e.positionStr =
positionTypeList.filter(
(v) => v.positionValue == e.upgradeGoodsPosition
)[0]?.positionName || "";
if (
(e.upgradeWarrantyPeriod || e.upgradeWarrantyPeriod > 0) &&
data.selectPayType != 0
) {
warrantyCardList.push({
warrantyPeriod: e.upgradeWarrantyPeriod,
goodsName: e.upgradeGoodsAlias || e.upgradeGoodsName,
cardCode: e.cardCode,
warrantyPrice: e.warrantyPrice
});
}
}
data?.packageGoodsList &&
data.packageGoodsList.forEach((item) => {
item.packageGoodsOrderList.forEach((g) => {
g.price = g.totalPrice
? Number(g.totalPrice) / Number(g.number)
: g.upgradePrice;
});
item.goodsList = item.packageGoodsOrderList;
item.price = item.goodsList.reduce((prev, cur) => {
return prev + Number(cur.totalPrice) / Number(cur.number);
}, 0);
item.count = item.goodsList.length ? item.goodsList[0].number : 1;
let total = item.price * item.count;
item.totalPrice = wx.$util.decimal(total, 2);
item.packageGoodsOrderList.forEach((g) => {
g.positionStr =
positionTypeList.filter(
(v) => v.positionValue == g.upgradeGoodsPosition
)[0]?.positionName || "";
});
total_price += item.totalPrice;
});
data = {
...data.customer,
...data.payOrder,
...data,
packageGoodsList: data.packageGoodsList,
couponName,
total_price:
data.selectPayType == 0
? 0
: Number(wx.$util.decimal(total_price, 2)).toFixed(2),
};
if (data.customerCoupon) {
data.customerCoupon.customerCouponCode =
data.customerCoupon.customerCouponCode.split("-")[0];
}
if (data.orderTime)
data.time = new Date(data.orderTime).format("yyyy-MM-dd hh:mm:ss");
if (data.customer && data.customer.carSeriesName) {
data.carType = `${data.customer.carBrand || ""}-${data.customer.carChildsBrandName || ""
}-${data.customer.carSeriesName || ""}`;
}
// 处理订单是否显示 操作按钮 支付方式为pos和微信 并且订单状态是 4和6
// data.failureFlag != 'Y'
data.canOperate =
[1, 3, 4].includes(data.selectPayType) &&
[4, 6].includes(data.status);
const orderInfo = data;
console.log(orderInfo);
const clientSignatureDTOList =
orderInfo.clientSignatureDTOList?.[0] || [];
console.log(clientSignatureDTOList);
const showRatingCard =
[6, 4, 2].includes(orderInfo.status) &&
orderInfo.selectPayType != 0 &&
!clientSignatureDTOList.electronicSignature;
this.setData({
orderInfo: { ...clientSignatureDTOList, ...data },
flag: true,
warrantyCardList,
showRatingCard,
});
this.setQrBoxHeight();
// 超时关闭的不显示客服码和
data.status != 10 && this.getWorkWechatLiveQRCode();
// 已评价的就不再显示评价码 战败也不显示
data.status != 6 && data.selectPayType != 0 && this.getQrCode(data);
// 条形码
warrantyCardList.length && this.getBarCode();
this.getServiceBaseInfo(data.merchantId);
// if (data.status == 6) return
// 校验是否显示二级流量方
if (data.subShopMerchantName) {
let { customerObj } = this.data;
if (
customerObj.findIndex(
(val) => val?.key && val.key == "subShopMerchantName"
) < 0
) {
customerObj[customerObj.length - 2] = {
label: "二级流量方",
key: "subShopMerchantName",
};
}
this.setData({
customerObj,
});
}
// 门店是否配置技师
// if (data?.technicianConfigDTOList?.length > 0) {
// this.isArtificer(data)
// }
// 获取园区店技师配置数据 wx.$util.getStorageSync('dj_boutique_user_info')?.merchantId
api
.getQYTechnicianList({
yqMerchantId: wx.$util.getStorageSync("dj_boutique_user_info")
?.merchantId,
})
.then((respone) => {
if (respone?.code == 0) {
if (respone?.data.length > 0) this.isArtificer(respone.data);
}
});
} else {
wx.showModal({
title: "温馨提示",
content: message,
showCancel: false,
confirmText: "刷新",
confirmColor: "#347BFF",
success(res) {
if (res.confirm) {
_this.getOrderDetail(orderCode);
}
},
});
}
});
},
async getPackageGoodsDetail(orderCode) {
try {
let params = {
orderCode,
};
let { total_price } = this.data.orderInfo;
const positionTypeList = (await getPositionList()) || [];
api.getPackageGoodsDetail(params).then((res) => {
res.data.packageGoodsList.forEach((item) => {
item.packageGoodsOrderList.forEach((g) => {
g.price = g.totalPrice
? Number(g.totalPrice) / Number(g.number)
: g.upgradePrice;
});
item.goodsList = item.packageGoodsOrderList;
item.price = item.goodsList.reduce((prev, cur) => {
return prev + Number(cur.totalPrice) / Number(cur.number);
}, 0);
item.count = item.goodsList.length ? item.goodsList[0].number : 1;
let total = item.price * item.count;
item.totalPrice = wx.$util.decimal(total, 2);
item.packageGoodsOrderList.forEach((g) => {
g.positionStr =
positionTypeList.filter(
(v) => v.positionValue == g.upgradeGoodsPosition
)[0]?.positionName || "";
});
total_price = Number(total_price) + Number(item.totalPrice);
});
if (res.code == 0) {
this.setData({
packageGoodsList: res.data.packageGoodsList,
"orderInfo.total_price": Number(
wx.$util.decimal(total_price, 2)
).toFixed(2),
});
}
});
} catch (err) { }
},
isArtificer(data) {
let { customerObj, orderInfo } = this.data;
orderInfo.isOpenArtificer = true;
orderInfo.technicianList = data || []; // 技师数据
// if (customerObj.findIndex(val => val?.key && val.key == 'technicianName') < 0) {
// customerObj[customerObj.length] = {
// label: '选择技师:',
// key: 'technicianName'
// }
// }
this.setData({
artificerList: data,
customerObj,
orderInfo,
});
},
getBarCode() {
// warrantyCardList
let that = this;
let { warrantyCardList } = this.data;
warrantyCardList.forEach((element, index) => {
setTimeout(() => {
// console.log(data.now())
api
.createBarCode({ content: element.cardCode })
.then((result) => {
// console.log(index)
// console.log(element.cardCode)
// console.log(result)
let { code, data } = result;
// 待优化 应该都有之后再一次性更新
// warrantyCardList[index].barCodeUrl = 'http://qcimg01.glsx.com.cn:7060/group1/M00/02/96/wKgD3mNXkD-ALMu3AAABmn9Id4c794.png'
if (code == 0) {
warrantyCardList[index].barCodeUrl = data;
}
that.setData({
warrantyCardList,
});
})
.catch((err) => { });
}, 500 * index);
});
},
getServiceBaseInfo(merchantId) {
api.getServiceBaseInfo({ merchantId }).then((result) => {
console.log(result, "result");
let { data, code } = result;
console.log(data);
if (data.cardCodeFlag && data.cardCodeFlag == 1) {
this.setData({
warrantyCardVisible: false,
});
}
});
},
setQrBoxHeight() {
const { orderInfo } = this.data;
let statusList = [2, 4, 6];
if (statusList.includes(orderInfo.status) && orderInfo.selectPayType != 0) {
wx.$util.getViewInfo("#qr-view", () => {
this.setData({
// qrHeight: height,
qrFlag: true,
});
});
}
},
showQrBox() {
this.setData({
qrFlag: !this.data.qrFlag,
});
},
getQrCode() {
// console.log('getQrcode')
let data = this.data.orderInfo;
let appId = "wx06d1198e751435d1";
let path =
"packagePersonal/pages/boutiquePages/boutiqueInstall/boutiqueInstall";
let scene = `orderCode=${data.orderCode}&merchantId=${data.merchantId}`;
// B端小程序调用接口生成领券码时,传参userId用uuid,类型由int变string
api
.createWeappQrcode({
qrcodeType: "QR_WXA_UNLIMIT",
appId,
channelType: 1,
path,
scene,
})
.then((qr) => {
if (qr.data) {
this.setData({
qr: qr.data,
});
}
this.setData({
qrFlag: true,
});
});
},
keepGoing(type) {
let { orderInfo } = this.data;
orderInfo.orderSource = type;
// delete orderInfo.orderCode
// 去除掉错误订单对应的关联码
// delete orderInfo.associateOrderCode
// 1031车膜下单版本 再次下单去掉商品信息 需重新选择
let deleteList = [
"orderCode",
"associateOrderCode",
"packageGoodsList",
"merchantDistributionList",
"expenseCategoryList",
"profitAllocatinList",
"clientSignatureDTOList",
"customerPhotos",
"rating",
"sellerName",
"sellerUserId",
"sellerMerchantName",
"sellerMerchantId",
"subOrderList",
"technicianList",
"merchantExpenseDistributionList",
];
for (var i = 0; i < deleteList.length; i++) {
// console.log(arr[i])
orderInfo[deleteList[i]] && delete orderInfo[deleteList[i]];
}
orderInfo.againOrder = true;
// console.log(orderInfo);
// return
wx.$router.redirectTo("createOrder", orderInfo);
// merchantDistributionList,expenseCategoryList,profitAllocatinList
},
// previewImage(e) {
// let { url } = e.currentTarget.dataset
// console.log(url)
// if (url.includes('http')) {
// wx.previewImage({
// urls: [url],
// current: url
// })
// } else {
// this.getWorkWechatLiveQRCode()
// }
// },
// imageLoad(params) {
// console.log('load', this.data.imgSrc)
// // this.setdata({})
// },
// imageError(params) {
// console.log('error', this.data.imgSrc)
// },
getWorkWechatLiveQRCode() {
this.setData({
customerService: "",
});
// setTimeout(() => {
let { failCustomerService, defaultCustomerService } = this.data;
let {
orderCode,
customerPhone: phoneNumber,
selectPayType,
} = this.data.orderInfo;
// console.log(orderCode, phoneNumber, selectPayType)
// 订单状态 1-升级订单 2-战败订单
let orderType = selectPayType == 0 ? 2 : 1;
api
.getWorkWechatLiveQRCode({ orderCode, phoneNumber, orderType })
.then((result) => {
let { code, data: url, message } = result;
console.log(url);
if (code == 0 && url) {
this.setData({
customerService: url,
});
} else {
// console.log(defaultCustomerService)
this.setData({
customerService: defaultCustomerService,
});
}
// else {
// wx.$util.showToast(message)
// }
})
.catch((err) => {
// console.log(err)
this.setData({
customerService: failCustomerService,
});
});
// }, 3000)
},
previewImage(e) {
let { url, index } = e.currentTarget.dataset;
let urlList = url.map((v) => {
return v.payVoucher;
});
wx.previewImage({
urls: urlList,
current: urlList[index],
});
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () { },
/**
* 生命周期函数--监听页面显示
*/
onShow: function (options) {
console.log(this.data);
let code = this.data.orderCode || "";
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () { },
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () { },
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () { },
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () { },
});