orderDetails.js
3.83 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
// packageConversionPlus/pages/orderDetails/orderDetails.js
import util from '../../../utils/util.js'
import api from '../../restapi.js'
import filter from '../../../utils/filter'
Page(filter.identityFilter({
/**
* 页面的初始数据
*/
data: {
// 订单状态 1 待跟进, 2 不升级, 3 待支付,4 已支付,6 已评价 , 9 已撤销
orderStatus:{
1:{
text:'待跟进',
color:'#999'
},
2:{
text:'不升级',
color:'#EF4342'
},
3:{
text:'待支付',
color:'#FF9834'
},
4:{
text:'已支付',
color:'#07C160'
},
6:{
text:'已评价',
color:'#05BAA0'
},
9:{
text:'已撤销',
color:'#999'
}
},
orderObj: [
{
label: '支付方式:',
key: 'payType',
enum: {
'2': '门店收款',
'3': 'POS机',
'0': '不升级',
}
},
{
label: '订单总额:',
key: 'totalPrice',
color: '#FF6601'
},
{
label: '订单编号(交易单号):',
key: 'outTradeNo'
},
{
label: '工单时间:',
key: 'successDate'
},
],
customerInfoObj: [{
label: '客户姓名:',
key: 'customerName'
},
{
label: '手机号:',
key: 'customerPhone',
btnName: '拨打电话',
callBack: 'phoneCall',
},
{
label: '车架号:',
key: 'standNo',
},
{
label: '客户来源:',
key: 'merchantName'
},
{
label: '销售顾问:',
key: 'employeeName'
},
{
label: '备注:',
key: 'remark',
},
]
},
previewImage(e) {
let {
url
} = e.currentTarget.dataset
wx.previewImage({
urls: [url],
current: url
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.log(options)
util.showLoading('加载中...')
api.getDetailByOrderCode(options, res => {
console.log(res)
let {
returnCode,
data
} = res
if(returnCode == 0 && data){
data.time = new Date(data.installUpgradeTime).format('yyyy-MM-dd hh:mm:ss')
if(data.payOrder && data.payOrder.successDate ) data.payOrder.successDate = new Date(data.payOrder.successDate).format('yyyy-MM-dd hh:mm:ss')
if (data.profitAllocatinList && data.profitAllocatinList.length > 0) {
let shopProfitMoney = 0
data.profitAllocatinList.map(i => {
shopProfitMoney += i.shopProfitMoney
})
data.shopProfitMoney = `${shopProfitMoney}元`
}
let orderDetails = {
...data.comment,
...data.payOrder,
...data.customer,
...data
}
this.setData({
orderDetails
})
util.hideLoading()
}else{
util.hideLoading()
util.showToast('系统异常')
}
})
},
phoneCall(e) {
let {
value
} = e.currentTarget.dataset
wx.makePhoneCall({
phoneNumber: value
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
onLogin(){},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
}))