index.js
2.32 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 ActivityApi from '~/api/activityApi/index'
Page({
data: {
list: [],
levelQuery: {
'PC0036':'续保惠享A套餐',
'PC0037':'续保优享B套餐',
'PC0038':'续保乐享C套餐',
'PC0039':'续保尊享D套餐',
}
},
onLoad(options) {
if (options.query) {
let _temp = JSON.parse(options.query)
this.query = {
customerPhone: _temp.p,
licenseNumber: _temp.c
}
}
this.judgePhone()
this.equityAndClaimsInfo();
},
toCreateClaims() {
const {customerInfo:{contractNo,effectiveDate,packageCode,customerName}} = this.data,{customerPhone,licenseNumber} = this.query
wx.$router.go('/packageStoreAssistant/packageAuth/pages/GHStaff/FillClaims/index', {
operation:3,
contractNo,
effectiveDate,
packageCode,
customerPhone,
licenseNumber,
customerName
})
},
equityAndClaimsInfo() {
const { customerPhone, licenseNumber } = this.query || {}
ActivityApi.equityAndClaimsInfo({ customerPhone, licenseNumber }).then(res => {
if(res.handlerTime){
res.handlerTime = new Date(res.handlerTime).format('yyyy-MM-dd hh:mm:ss')
}
res.customerPhone = customerPhone
this.setData({
customerInfo: res
}, () => {
this.equityAndClaimsList(res.accountId,customerPhone)
})
})
},
equityAndClaimsList(accountId,customerPhone) {
this.customerPhone = customerPhone
ActivityApi.equityAndClaimsList({
pageSize: 100,
pageNum: 1,
accountId,
equitySource:1,
customerPhone,
licensePlate:this.query.licenseNumber
}).then(res => {
res.list.forEach(el=>{
el.merchantCommitDate =el.merchantCommitDate?new Date(el.merchantCommitDate).format('yyyy-MM-dd hh:mm:ss'):'--'
})
this.setData({
list: res.list || []
})
wx.stopPullDownRefresh()
this.showBack = true
})
},
judgePhone() {
const phoneInfo = wx.$storage.get('system_info')
let isIphoneX = phoneInfo.model.search('iPhone X') != -1 ? true : false
this.setData({
isIphoneX
})
},
onShow(){
if(this.data.customerInfo&&this.showBack){
this.equityAndClaimsList(this.data.customerInfo.accountId,this.customerPhone)
}
},
onPullDownRefresh(){
this.equityAndClaimsInfo();
},
})