Browse Source

实名认证

master
unknown 7 months ago
parent
commit
f256bc4b72
  1. 3
      config/api.js
  2. 48
      pages/indexEntry/enroll/enroll.vue
  3. 2
      pages/indexEntry/enroll/registInfo/registInfo.vue
  4. 29
      pages/tabbar/learnCar/index.vue

3
config/api.js

@ -182,6 +182,9 @@ export const recommendSchoolList = (params={}) => http.get('business/school/reco
export const getBycoachId = (params={}) => http.get('business/appcomplain/getBycoachId', {params})
// 人脸核身---获取certifyId
export const getInitFaceVerify = (data) => http.post('app/student-record/getInitFaceVerify', data)
// 人脸核身---核身结果
export const GetDescribeFaceVerify = (params={}) => http.get('app/student-record/GetDescribeFaceVerify', {params})

48
pages/indexEntry/enroll/enroll.vue

@ -82,7 +82,7 @@
</template>
<script>
import { getpersonface, GetDetectInfoEnhanced, getCardType } from '@/config/api.js'
import { getpersonface, GetDetectInfoEnhanced, getCardType,getInitFaceVerify,GetDescribeFaceVerify } from '@/config/api.js'
import { website } from '@/config/site.config.js'
export default {
data() {
@ -231,18 +231,58 @@
}
//
if(!this.vuex_userInfo.applyStep||this.vuex_userInfo.applyStep<2) {
const EidToken = await this.getpersonfaceFn()
console.log(EidToken)
this.getInitFaceVerifyFn()
}
// this.$goPage('/pages/indexEntry/enroll/signContract/signContract')
// this.$goPage('/pages/indexEntry/enroll/uploadAvatar/uploadAvatar')
},
async getInitFaceVerifyFn() {
console.log('到这了吗?')
const verifyPlugin = uni.requireNativePlugin('AP-FaceDetectModule');
var metaInfo = verifyPlugin.getMetaInfo()
const res = await getInitFaceVerify({metaInfo: metaInfo, accountId: this.vuex_userInfo.accountId})
let certifyId = res.data.body.resultObject.certifyId
let _this = this
verifyPlugin.verify({
certifyId,
// extParams: {
// kIdentityParamKeyIdCardFaceOnly: 'YES'
// }
}, function(response){
console.log(response)
if(response.code==1000) {
GetDescribeFaceVerify({certifyId, accountId: _this.vuex_userInfo.accountId}).then((useRes)=>{
console.log(useRes)
let userInfo1 = JSON.parse(useRes.data.body.resultObject.materialInfo)
console.log(userInfo1)
if(useRes.code==0) {
let materialInfo = JSON.parse(useRes.data.body.resultObject.materialInfo)
let userInfo = materialInfo.ocrIdCardInfo
let obj = {
address: userInfo.address,
name: userInfo.certName,
idcard: userInfo.certNo,
nationality: userInfo.nationality,
cardType: '1',
sex: userInfo.sex=='女'?'2': '1'
}
let info = Object.assign(_this.$store.state.user.vuex_userInfo, obj)
_this.$store.commit('update_vuex_userInfo', info)
console.log('请求结果来了')
console.log(_this.$store.state.user.vuex_userInfo)
_this.$goPage('/pages/indexEntry/enroll/registInfo/registInfo')
}
})
}
});
},
}
}
</script>
<style>
.input1::placeholder {
color: red !important;

2
pages/indexEntry/enroll/registInfo/registInfo.vue

@ -349,8 +349,8 @@
this.form.phone = this.vuex_userInfo.phone
this.form.nationality = this.vuex_userInfo.nationality || '中国'
this.form.cardType = this.vuex_userInfo.cardType || '1'
if(this.vuex_userInfo.photoPath&&this.form.cardType=='1') this.form.photoPath = this.vuex_userInfo.photoPath
this.form.sex = this.vuex_userInfo.sex
if(this.vuex_userInfo.photoPath&&this.form.cardType!='1') this.form.photoPath = this.vuex_userInfo.photoPath
},
//
async schoolClassFn() {

29
pages/tabbar/learnCar/index.vue

@ -2,8 +2,8 @@
<view class="pageBgImg pad">
<view class="status_bar"></view>
<view class="" style="height: 100rpx;"></view>
<!-- <u-button @click="requestSingleFreshLocationFn">单次定位</u-button> -->
<u-button @click="getInitFaceVerifyFn">人脸核身</u-button>
<u-button @click="requestSingleFreshLocationFn">单次定位1</u-button>
<!-- <u-button @click="getInitFaceVerifyFn">人脸核身</u-button> -->
<topInfo :carType="curObject.name" @changeSubject="changeSubject"></topInfo>
<subject1 v-if="curObject.id==1"></subject1>
<subject2 v-if="curObject.id==2"></subject2>
@ -18,8 +18,8 @@
import subject2 from './comp/subject2.vue'
import subject3 from './comp/subject3.vue'
import subject4 from './comp/subject4.vue'
// import { requestSingleFreshLocation } from '@/common/js/qqLatLng.js'
import { getInitFaceVerify } from '@/config/api.js'
import { requestSingleFreshLocation } from '@/common/js/qqLatLng.js'
import { getInitFaceVerify, GetDescribeFaceVerify } from '@/config/api.js'
export default {
components: { topInfo, subject1, subject2,subject3,subject4 },
data() {
@ -38,7 +38,7 @@
},
onShow() {
this.getInitFaceVerifyFn()
// this.getInitFaceVerifyFn()
},
methods: {
//
@ -46,21 +46,22 @@
console.log(val)
this.curObject = val
},
async getInitFaceVerifyFn() {
const verifyPlugin = uni.requireNativePlugin('AP-FaceDetectModule');
var metaInfo = verifyPlugin.getMetaInfo()
console.log(metaInfo)
const res = await getInitFaceVerify({metaInfo: metaInfo})
console.log('人脸token')
console.log(res)
},
async requestSingleFreshLocationFn() {
let lanLng = await requestSingleFreshLocation()
if(lanLng.sourceProvider=='fake') {
if(lanLng.location.sourceProvider=='fake') {
this.$u.toast('不能执行该操作,禁止使用虚拟定位')
}
console.log(lanLng)
console.log('lanlng')
uni.getLocation({
type: 'wgs84',
success: function (res) {
console.log('当前位置的经度:' + res.longitude);
console.log('当前位置的纬度:' + res.latitude);
}
});
}
}
}

Loading…
Cancel
Save