diff --git a/common/http.api.js b/common/http.api.js index fd4fe31..af99423 100644 --- a/common/http.api.js +++ b/common/http.api.js @@ -12,6 +12,8 @@ const StoreDetailUrl = 'mp-api/hhrsStore/detail' const RightsListUrl = 'mp-api/hhrsRights/list' const RightsDetailUrl = 'mp-api/hhrsRights/detail' const EligibilityUrl = 'mp-api/hhrsRights/eligibility' +// xuchao: 认证前中奖预检(未中奖拦截人脸核验,省认证费) +const WinnerCheckUrl = 'mp-api/hhrsRights/checkWinner' const AppointmentListUrl = 'mp-api/hhrsRights/appointment/list' const CheckListUrl = 'mp-api/hhrsRights/check/list' // 实名人脸认证(阿里云) @@ -45,6 +47,8 @@ const install = (Vue, vm) => { const getRightsDetail = (params = {}) => vm.$u.post(RightsDetailUrl, params) // xuchao: 注意 identityNo 会触发后端“被动认证”回写,仅在认证流程中传 const getEligibility = (params = {}) => vm.$u.post(EligibilityUrl, params) + // xuchao: 发起人脸前查证件号是否在中奖名单,返回 data.isWinner + const checkWinner = (params = {}) => vm.$u.post(WinnerCheckUrl, params) const getAppointmentList = (params = {}) => vm.$u.post(AppointmentListUrl, params) const getCheckList = (params = {}) => vm.$u.post(CheckListUrl, params) const doAppoint = (params = {}) => vm.$u.post(AppointUrl, params) @@ -72,6 +76,7 @@ const install = (Vue, vm) => { getRightsList, getRightsDetail, getEligibility, + checkWinner, getAppointmentList, getCheckList, doAppoint, diff --git a/pages/rights/rights.vue b/pages/rights/rights.vue index 2aeb3cc..bc0d7df 100644 --- a/pages/rights/rights.vue +++ b/pages/rights/rights.vue @@ -446,6 +446,35 @@ }) return } + // xuchao: 认证前预检——证件号不在中奖名单就不发起人脸核验,避免白花实名认证费用 + this.$u.api.checkWinner({ + identityNo: (this.form.idNumber || '').trim() + }).then(res => { + if (res.errcode !== 0 || !res.data) { + uni.showToast({ + title: res.errmsg || '查询中奖状态失败,请重试', + icon: 'none' + }) + return + } + if (!res.data.isWinner) { + uni.showModal({ + title: '提示', + content: '您暂未中奖,请中奖后再进入认证', + showCancel: false + }) + return + } + this.startFaceVerify() + }).catch(() => { + // xuchao: 预检查询异常一律不放行进人脸,网络恢复后可重试 + uni.showToast({ + title: '查询中奖状态失败,请重试', + icon: 'none' + }) + }) + }, + startFaceVerify() { uni.setStorageSync('authName', this.form.realName) uni.setStorageSync('authIdNo', this.form.idNumber) // xuchao: 标记已发起认证流程,取消后停留在认证页,不自动恢复