result.js
2.29 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
(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 = window.location.origin
if(origin.includes('localhost')>0 || origin=='null' || origin.includes('file:')>0){
origin = 'https://testznzl.lgyzpt.com'
}
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(){
window.location.replace("https://testznzl.lgyzpt.com/activity/zjbPhone/addBusi.html?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'; // 显示内容
});