claimsNoteDetail.js
4.42 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
import { equityApi } from "../../../api/api"
Page({
data: {
statusList: [
{
name: '待受理',
activeName: '已受理',
active: false,
left: false,
right: false,
status: 0
},
{
name: '待定损',
activeName: '已定损',
active: false,
left: false,
right: false,
status: 1
},
{
name: '待服务',
activeName: '已服务',
active: false,
left: false,
right: false,
status: 2
},
{
name: '待确认',
activeName: '已确认',
active: false,
left: false,
right: false,
status: 3
},
],
currentStatus: 0,
detailInfo: {},
status: ['待受理', '待定损', '待服务', '待确认', '已确认']
},
onShow(){
if(this.data.detailInfo.writeOffCode){
this.getDetail(this.data.detailInfo.writeOffCode)
}
},
onLoad(options) {
this.judgePhone()
if (options && options.hxcode) {
this.getDetail(options.hxcode)
}
},
toSignPage() {
const { detailInfo } = this.data
let para = {
vin: detailInfo.vin,
serviceItemsList:detailInfo.serviceItemsList,
vehicleBrandName:detailInfo.vehicleBrandName,
vehicleSeriesName:detailInfo.vehicleSeriesName,
vehicleShapeName:detailInfo.vehicleShapeName,
merchantName:detailInfo.merchantName,
writeOffCode:detailInfo.writeOffCode,
fromDetail: 1,
}
let temp = encodeURIComponent(JSON.stringify(para))
wx.navigateTo({
url: '/packageEquity/pages/signature/signature?carInfo='+temp,
});
},
// 获取详情
getDetail(writeOffCode) {
let strList = []
wx.$util.showLoading('加载中...')
equityApi.claimsDetail({ writeOffCode }).then(res => {
wx.hideLoading();
if (res) {
res.customerStatus = Number(res.customerStatus) || 0
this.handlerStatus(res.customerStatus)
if(res.serviceItemsList&&res.serviceItemsList.length){
res.serviceItemsList.forEach(el=>{
strList.push(el.serviceItemName)
})
}
res.serviceString = strList.join(' ')
let temp = []
res.attachmentList.forEach(el=>{
if(el.firstClassifyName=="现场照片"){
temp.push(el)
}
})
res.attachmentList = temp
}
this.setData({
detailInfo: res,
})
})
},
// 处理状态展示 案件状态, 0:待受理, 1:待定损 2:待服务 3:待确认 4:已确认
handlerStatus(status) {
let { statusList } = this.data
if (status == 1) {
statusList[0].active = true
statusList[0].right = true
statusList[1].left = true
} else if (status == 2) {
statusList[0].active = true
statusList[0].right = true
statusList[1].active = true
statusList[1].left = true
statusList[1].right = true
statusList[2].left = true
} else if (status == 3) {
statusList[0].active = true
statusList[0].right = true
statusList[1].active = true
statusList[1].left = true
statusList[1].right = true
statusList[2].active = true
statusList[2].left = true
statusList[2].right = true
statusList[3].left = true
} else if (status == 4) {
statusList[0].active = true
statusList[0].right = true
statusList[1].active = true
statusList[1].left = true
statusList[1].right = true
statusList[2].active = true
statusList[2].left = true
statusList[2].right = true
statusList[3].active = true
statusList[3].left = true
}
this.setData({
statusList,
currentStatus: status
})
},
// 复制核销码
setCopyData() {
wx.$util.setCopyData(`${this.data.detailInfo.writeOffCode}`, () => {
wx.$util.showToast('复制成功')
})
},
callPhone(e) {
const { phone } = e.currentTarget.dataset
if (!phone) return
wx.$util.phoneCall(phone)
},
// 判断ios设备
judgePhone() {
const phoneInfo = wx.$util.getStorageSync('srcm_shopmall_system_info')
let isIphoneX = phoneInfo.model.search('iPhone X') != -1 ? true : false
this.setData({
isIphoneX
})
},
toPreview(e) {
const { item } = e.currentTarget.dataset
wx.previewImage({
current: item, // 当前显示图片的 http 链接
urls: [item] // 需要预览的图片 http 链接列表
})
},
})