express.js
2.34 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
import wx from '../../../../utils/wx';
import Yas from '../../../../common/yas';
import orderModel from '../../../../models/home/order';
let app = getApp();
const windowHeights = app.globalData.systemInfo.windowHeight;
const windowWidth = app.globalData.systemInfo.windowWidth;
const pixelRatio = app.globalData.systemInfo.pixelRatio;
let sc = windowWidth * pixelRatio / 750;
let listH = parseInt((windowHeights * pixelRatio) / sc - 221) - 5;
let yas;
Page({
data: {
dot1: './images/1@2x.png',
dot2: './images/2@2x.png',
listH,
logo: '',
hasOrder: false,
orderID: '',
logisticsCompany: '',
order_code: '',
list: null
},
onLoad: function(options) {
let order_code = options.order_code;
this.setData({
order_code
});
this.expressDetail();
yas = new Yas(app);
yas.pageOpenReport();
},
copyExpressNo: function() {
wx.setClipboardData({data: this.data.orderID})
.then(() => {
wx.showModal({
content: '已复制到剪贴板!',
showCancel: false,
confirmText: '确定',
});
});
},
expressDetail: function() {
let params = {
method: 'app.express.li',
uid: app.getUid(),
fromPage: 'iFP_Logistics',
order_code: this.data.order_code,
physical_channel: 1
};
orderModel.expressDetail(params)
.then(data => {
if (data && data.code === 200) {
let list = data.data.express_detail;
let hasOrder = true;
let logo = data.data.logo;
let logisticsCompany = data.data.caption;
let orderID = data.data.express_number;
this.setData({
logisticsCompany,
orderID,
logo,
list,
hasOrder
});
} else {
wx.showModal({
content: data.message,
showCancel: false,
confirmText: '确定'
});
}
});
}
});