result.js
2.72 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
(function($$) {
"use strict";
let vm
function init() {
vm = new Vue({
el: '#pageDiv',
data: {
info: {},
busiFlag: '--',
areaCode: ''
},
created: function() {
this.info = JSON.parse(sessionStorage.getItem('huaiAnAppParam'))
// this.info.campaignId = '54321'
// sessionStorage.setItem('huaiAnAppParam',JSON.stringify(this.info))
this.queryOrder()
},
methods: {
httpRequest:function(param){
let origin = "https://hhzj.lgyzpt.com"
if(origin.includes('localhost')>0 || origin=='null' || origin.includes('file:')>0 || window.origin.includes('testznzl')){
origin = 'https://testznzl.lgyzpt.com'
}
return new Promise(function(resolve, reject){
axios ({
method: 'get',
url:origin + param.url,
timeout: param.time||15000,
data:param.data,
headers: {
'Content-Type': 'application/json'
}
}).then((res) => {
resolve(res.data)
}).catch(res => {
reject(res)
})
})
},
queryOrder(){
this.httpRequest({
url: '/compass/api/common/maintenance-personnel/code?personnelCode=' + this.info.campaignId
}).then(res=>{
if(res.code == 200){
if(res.data && res.data.id){
this.areaCode = res.data.areaCode
this.busiFlag = '1'
}else{
this.busiFlag = '2'
}
}
})
},
goAdd(){
let url = 'https://hhzj.lgyzpt.com/zhiJianBusi/zjbPhone/addBusi.html'
if(window.location.origin.includes('testznzl.lgyzpt.com')){
url = "https://testznzl.lgyzpt.com/activity/zjbPhone/addBusi.html"
}
window.location.replace(url+"?source=zhijian&phone="+this.info.accNbr+"&areaCode="+this.areaCode+"&campaignId="+this.info.campaignId)
// window.location.replace(
// `${url}?source=zhijian\
// &phone=${this.info.accNbr}\
// &areaCode=${this.areaCode}\
// &campaignId=${this.info.campaignId}`
// );
},
goBack(){
history.go(-1)
}
}
})
}
init()
window.vm = vm
})(window.jQuery)
window.addEventListener('load', function () {
document.getElementById('pageDiv').style.display = 'block'; // 显示内容
});