12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- import {
- wx_rlxf,
- dev_baseUrl_wxrlxf,
- pro_baseUrl_wxrlxf,
- request_wxrlxf
- } from '@/utils/request.js'
- import {
- formatTime
- } from '@/utils/util/util.js'
- let app = getApp();
- /*** 自助通行_云上贵州_2021/08/23 ***/
- //进入人脸识别--人脸下发
- const intoFace_wxrlxf = (name, idcard) => {
- console.log(name, idcard)
- return new Promise((reslove, reject) => {
- let taskId =
- `01-${formatTime(Date.now(), 'YYYYMMDDHHNNSS')}${(parseInt((Math.random()*9+1)*10000))}`
- // taskId = '00-98765411111111121'
- wx.setStorageSync('wx_dateCode', taskId);
- wx.navigateToMiniProgram({
- appId: 'wx331fa6d546331cc0',
- path: 'pages/index/index?idNumber=' + idcard + '&name=' + name +
- '¬ify=' + (wx_rlxf ? pro_baseUrl_wxrlxf : dev_baseUrl_wxrlxf) +
- '/api/next/doConfirmFaceNotify&unit=易行巡逻打卡&token=73b81e3eb2ff11eb877300163e0a5d80&taskId=' +
- taskId,
- envVersion: 'release',
- success(res) {
- // app.globalData.faceCheckTit = 'res:' + res
- reslove(true)
- },
- fail(err) {
- // app.globalData.faceCheckTit = 'error:' + err
- reject(err)
- wx.showToast({
- title: '您取消了实名认证',
- icon: 'none'
- })
- }
- })
- })
- .catch(err => {
- console.log(err);
- })
- .finally(() => {})
- }
- //验证人脸信息--人脸下发
- const getFace_wxrlxf = (api, method, data) => {
- wx.showLoading({
- title: '验证中...',
- })
- return request_wxrlxf({
- url: api,
- data: data,
- method: method,
- type: 'application/json'
- }).then((suc) => {
- // app.globalData.faceCheckTit = 'suc:' + JSON.stringify(suc) + 'data:' + JSON
- // .stringify(data)
- return suc
- }).catch((err) => {
- // app.globalData.faceCheckTit = 'error:' + JSON.stringify(err) + 'data:' + JSON
- // .stringify(data)
- wx.showToast({
- title: err,
- icon: 'none'
- })
- }).finally(() => {
- wx.removeStorage({
- key: 'wx_dateCode',
- })
- wx.hideLoading()
- })
- }
- export {
- intoFace_wxrlxf,
- getFace_wxrlxf
- };
|