claimsNote.js
2.58 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
import { equityApi } from '~/api/api'
Page({
data: {
showPage: false,
noteList: [],
isCanFresh: false,
status: {
32: '待受理',
40: '已失效',
33: '待定损',
35: '待定损', // 定损不通过展示为待定损
34: '待服务', // 定损通过展示为待服务
23: '已服务'
},
track_event_code: 'claimsNote_page'
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
wx.$api.showLoading('加载中...')
if(options&&options.formPage=='apply'){
wx.navigateTo({
url: '/packageShopmall/packageEquity/pages/claimsNoteDetail/claimsNoteDetail?writeOffCode='+options.writeOffCode,
});
this.setData({isCanFresh:true,contractNo:options.contractNo})
return
}
this.getList(options.contractNo)
},
onShow(){
let {isCanFresh,contractNo} = this.data
if(isCanFresh){
this.getList(contractNo)
}
},
toDetail(e){
const {item} = e.currentTarget.dataset
this.data.isCanFresh = true
wx.navigateTo({
url: `/packageShopmall/packageEquity/pages/claimsNoteDetail/claimsNoteDetail?writeOffCode=${item.writeOffCode}`,
});
},
// 获取列表
getList(contractNo){
wx.$api.hideLoading()
equityApi.claimsList({contractNo}).then(res=>{
wx.hideLoading();
if(res&&res.length){
let tempArr = []
res.forEach(el=>{
// 32:待受理,40:已失效,33:待定损 34:定损通过 35:定损不通过 23:待核赔" 状态是其余值时,统一展示为已服务
if (![32, 40, 33, 34, 35, 23].includes(el.status)) el.status = 23
el.attachmentList?.forEach(ele=>{
if(ele.firstClassifyName=='现场照片'){
tempArr = ele.attachments
el.images = tempArr
}
})
let strlist = []
el.serviceItemsList?.forEach(k=>{
strlist.push(k.serviceItemName)
})
el.serviceItemsListStr = strlist.join(' ')
})
}
this.setData({
noteList: res || [],
showPage: res.length?false:true,
contractNo
})
})
},
toPreview(e) {
const { item } = e.currentTarget.dataset
wx.previewImage({
current: item, // 当前显示图片的 http 链接
urls: [item] // 需要预览的图片 http 链接列表
})
},
// 打开地图
openMap(e) {
const target = e.currentTarget.dataset.item
wx.openLocation({
latitude: parseFloat(target.merchantLat),
longitude: parseFloat(target.merchantLng),
address: target.merchantAddress
})
}
})