Vue.component('visitor-info', {
template: '
',
props: ["param"],
data: function() {
return {
imgCode: "",
text: ""
}
},
mounted: function() {
this.initValidate()
},
methods: {
// 验证
sureValue: function() {
if(!isMobilePhone(visitor.phone)) {
top.showErrorMessage("手机号码编辑错误!")
return true
}
},
handleIdcard: function(str) {
var len = str.length
if (len == 18) {
return str.substr(0, 4) + '**********' + str.substr(14, 4)
} else if (len == 15) {
return str.substr(0, 4) + '*******' + str.substr(11, 4)
}
},
initValidate: function() {
var docInfo = JSON.parse(window.localStorage.getItem('docInfo'))
var vm = this
APIService.captchaWithDoctor(docInfo.jobCode, {
}).then(function(res) {
if(res.status == 200) {
vm.imgCode = "data:image/png;base64,"+ res.data.image
vm.param.key = res.data.key
} else {
}
}).catch(function(e) {
})
},
}
})