bindingCard({healthCode, openId}).then(res => {
if (res.code === 200) {
const {name, idCard} = res.data
getWxConfigParams({type: 'healthCard'}).then(res => {
if (res.code === 200) {
let configContent = res.data
wx.config({
beta: true,
debug: true,
appId: configContent.appId,
timestamp: configContent.timestamp,
nonceStr: configContent.nonceStr,
signature: configContent.signature,
jsApiList: ['requestWxFacePictureVerify']
});
wx.ready(function () {
wx.invoke('requestWxFacePictureVerify', {
'request_verify_pre_info': "{\"name\": \"" + name + "\", \"id_card_number\": \"" + idCard + "\"}",
'check_alive_type': 2,
'appid': configContent.appId
}, function (res) {
console.log('结果1', JSON.stringify(res))
if (res.err_code == 0) {
var verify_identifier = res.verify_result;
} else {
var ret = res.err_msg;
ret += " err_code: " + res.err_code;
alert(ret);
}
});
})
wx.error(function (res) {
Toast.fail('微信js-sdk 配置失败:' + JSON.stringify(res))
console.log('结果1', JSON.stringify(res))
})
}
})
}
})