|
|
@ -83,6 +83,7 @@ |
|
|
|
<script> |
|
|
|
import { getpersonface, GetDetectInfoEnhanced, getCardType } from '@/config/api.js' |
|
|
|
import { website } from '@/config/site.config.js' |
|
|
|
import { startEid } from '@/mp_ecard_sdk/main'; |
|
|
|
export default { |
|
|
|
data() { |
|
|
|
return { |
|
|
@ -138,10 +139,12 @@ |
|
|
|
this.showType = false |
|
|
|
}, |
|
|
|
async getpersonfaceFn() { |
|
|
|
const {data: res} = await getpersonface({ ruleId: 2, RedirectUrl: website + '/pages/indexEntry/enroll/realName/realName?userId='+this.userId+'&test=123' ,userId: this.userId}) |
|
|
|
const {data: res} = await getpersonface({MerchantId: '0NSJ2312271333064407'}) |
|
|
|
let obj = JSON.parse(res) |
|
|
|
this.link = obj.Url |
|
|
|
this.$store.commit('updateBizToken', obj.BizToken) |
|
|
|
// this.link = obj.Url |
|
|
|
// this.$store.commit('updateBizToken', obj.BizToken) |
|
|
|
this.EidToken = obj.EidToken |
|
|
|
return obj.EidToken |
|
|
|
// #ifdef H5 |
|
|
|
window.open(this.link, '_blank') |
|
|
|
|
|
|
@ -159,21 +162,20 @@ |
|
|
|
|
|
|
|
console.log(obj) |
|
|
|
}, |
|
|
|
async GetDetectInfoEnhancedFn(bizToken) { |
|
|
|
let obj = { |
|
|
|
ruleId: 2, |
|
|
|
redirectUrl: website + '/pages/indexEntry/enroll/registInfo/registInfo', |
|
|
|
bizToken: 'C9C2BC8E-8336-4071-84B3-8170E283E6CA', |
|
|
|
userId: this.userId |
|
|
|
} |
|
|
|
const {data: res} = await GetDetectInfoEnhanced(obj) |
|
|
|
async GetDetectInfoEnhancedFn(EidToken) { |
|
|
|
// let obj = { |
|
|
|
// ruleId: 2, |
|
|
|
// redirectUrl: website + '/pages/indexEntry/enroll/registInfo/registInfo', |
|
|
|
// bizToken: 'C9C2BC8E-8336-4071-84B3-8170E283E6CA', |
|
|
|
// userId: this.userId |
|
|
|
// } |
|
|
|
const {data: res} = await GetDetectInfoEnhanced({EidToken, userId: this.userId, InfoType: 1}) |
|
|
|
let obj2 = JSON.parse(res) |
|
|
|
console.log(obj2) |
|
|
|
console.log('请求结果来了') |
|
|
|
console.log(obj2.Text.ErrMsg=='成功') |
|
|
|
console.log(obj2) |
|
|
|
// uni.setStorageSync(obj2) |
|
|
|
}, |
|
|
|
goNext() { |
|
|
|
async goNext() { |
|
|
|
// return this.$goPage('/pages/indexEntry/enroll/registInfo/registInfo') |
|
|
|
// if(!this.form.value) return this.$u.toast('请选择证件类型') |
|
|
|
// this.$goPage('/pages/indexEntry/enroll/signContract/signContract?schoolId='+this.vuex_userInfo.schoolId) |
|
|
@ -213,12 +215,31 @@ |
|
|
|
} |
|
|
|
// 去实名 |
|
|
|
if(!this.vuex_userInfo.applyStep||this.vuex_userInfo.applyStep<2) { |
|
|
|
this.getpersonfaceFn() |
|
|
|
const EidToken = await this.getpersonfaceFn() |
|
|
|
console.log(EidToken) |
|
|
|
this.goSDK(EidToken) |
|
|
|
} |
|
|
|
|
|
|
|
// this.$goPage('/pages/indexEntry/enroll/signContract/signContract') |
|
|
|
// this.$goPage('/pages/indexEntry/enroll/uploadAvatar/uploadAvatar') |
|
|
|
} |
|
|
|
}, |
|
|
|
// 示例方法 |
|
|
|
goSDK(token) { |
|
|
|
let _this = this |
|
|
|
startEid({ |
|
|
|
data: { |
|
|
|
token, |
|
|
|
}, |
|
|
|
verifyDoneCallback(res) { |
|
|
|
const { token, verifyDone } = res; |
|
|
|
console.log('收到核身完成的res:', res); |
|
|
|
console.log('核身的token是:', token); |
|
|
|
_this.GetDetectInfoEnhancedFn(token) |
|
|
|
console.log('是否完成核身:', verifyDone); |
|
|
|
}, |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|