logisticsDetails.js
2.11 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
import { API_HOST, SERVICE_HOST } from '../../libs/config';
import { GET, POST } from '../../libs/request';
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;
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) {
// console.log(options);
//获取应用实例
let order_code = options.order_code;
this.setData({
order_code,
});
this.getLogisticInfo();
},
copyTapped: function(){
wx.setClipboardData({
data: this.data.orderID,
success: function (res) {
wx.showModal({
content: '已复制到剪贴板!',
showCancel: false,
confirmText: "ok",
success: function (res) {
}
})
},
})
},
getLogisticInfo: function () {
let that = this;
let param = {
method: 'app.express.li',
uid: app.getUid(),
fromPage: 'iFP_Logistics',
order_code: this.data.order_code,
physical_channel: 1,
};
GET(API_HOST, param)
.then(function (data) {
// console.log(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;
// console.log(list);
that.setData({
logisticsCompany,
orderID,
logo,
list,
hasOrder,
});
} else {
wx.showModal({
content: data.message,
showCancel: false,
confirmText: "确定",
});
}
})
.catch(function (error) {
});
},
})