洛阳学员端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

337 lines
10 KiB

10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
9 months ago
10 months ago
10 months ago
9 months ago
10 months ago
9 months ago
10 months ago
9 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
  1. <template>
  2. <view class="pageBg">
  3. <!-- <topNavbar :title="title"></topNavbar> -->
  4. <view class="pad">
  5. <view class="card">
  6. <view class="row">
  7. <view class="lab">证件类型</view>
  8. <view class="rightCon">
  9. <view class="val" @click="showType=true">
  10. <input v-model="form.typeName" placeholder="请选择" class="input1" style="pointer-events: none;" disabled/></input>
  11. </view>
  12. <view class="icon">
  13. <u-icon name="arrow-right" size="14" color="#686B73" style="margin-left: 12rpx;" ></u-icon>
  14. </view>
  15. </view>
  16. </view>
  17. <view class="row" v-if="form.value==1">
  18. <view class="lab">实名认证</view>
  19. <view class="rightCon">
  20. <view class="val" v-if="vuex_userInfo.applyStep>1" style="color: #1989FA;">已认证</view>
  21. <view class="val" v-else>待认证</view>
  22. </view>
  23. </view>
  24. <view class="" v-else>
  25. <!-- <view class="row" v-if="form.value==7">
  26. <view class="lab">国籍</view>
  27. <view class="rightCon">
  28. <view class="val">
  29. <input v-model="form.nationality" placeholder="请选择" @click="showType=true" disabled/></input>
  30. </view>
  31. <view class="icon">
  32. <u-icon name="arrow-right" size="14" color="#686B73" style="margin-left: 12rpx;" ></u-icon>
  33. </view>
  34. </view>
  35. </view> -->
  36. <view class="row">
  37. <view class="lab">证件号码</view>
  38. <view class="rightCon">
  39. <view class="val">
  40. <input v-model="form.idcard" placeholder="请输入" /></input>
  41. </view>
  42. </view>
  43. </view>
  44. <view class="row">
  45. <view class="lab">真实姓名</view>
  46. <view class="rightCon">
  47. <view class="val">
  48. <input v-model="form.name" placeholder="请输入" /></input>
  49. </view>
  50. </view>
  51. </view>
  52. <view class="row">
  53. <view class="lab">性别</view>
  54. <view class="rightCon">
  55. <u-radio-group v-model="form.sex" :labelDisabled="false">
  56. <u-radio shape="circle" label="男" name="1" :labelDisabled="false"></u-radio>
  57. <view class="" style="width: 50rpx;"></view>
  58. <u-radio shape="circle" label="女" name="2" :labelDisabled="false"></u-radio>
  59. </u-radio-group>
  60. </view>
  61. </view>
  62. <view class="row">
  63. <view class="lab">户籍地址</view>
  64. <view class="rightCon">
  65. <view class="val">
  66. <input v-model="form.address" placeholder="请输入" /></input>
  67. </view>
  68. </view>
  69. </view>
  70. </view>
  71. </view>
  72. <view class="footerBtn pad">
  73. <view class="btnBg" @click="goNext">下一步</view>
  74. </view>
  75. </view>
  76. <u-picker :show="showType" :columns="typeArr" keyName="label" @confirm="confirmType" @cancel="showType=false"></u-picker>
  77. </view>
  78. </template>
  79. <script>
  80. import { getpersonface, GetDetectInfoEnhanced, getCardType,getInitFaceVerify,GetDescribeFaceVerify } from '@/config/api.js'
  81. import { website } from '@/config/site.config.js'
  82. export default {
  83. data() {
  84. return {
  85. form: {
  86. value: 1,
  87. nationality: '中国',
  88. idcard: '',
  89. name: '',
  90. sex: '1',
  91. address: '',
  92. typeName: '身份证',
  93. },
  94. formToast: {
  95. idcard: '请输入证件号码',
  96. name: '请输入真实姓名',
  97. sex: '请选择性别',
  98. address: '请输入户籍地址',
  99. },
  100. showType: false,
  101. typeArr: [],
  102. title: '学员报名'
  103. }
  104. // 报名进度(0:待报名,1:已选驾校,2:已实名制,3:已填写报名信息,4:已签署合同,5:待支付,6:已支付)
  105. },
  106. onLoad(options) {
  107. if(options.tit) {
  108. this.title = options.tit
  109. }
  110. // this.GetDetectInfoEnhancedFn()
  111. this.getCardTypeFn()
  112. },
  113. methods: {
  114. // 获取证件类型
  115. async getCardTypeFn() {
  116. const {data: res} = await getCardType()
  117. this.typeArr = [res]
  118. await this.$store.dispatch('getUserInfo')
  119. if(this.vuex_userInfo.applyStep>1) {
  120. res.forEach(item=>{
  121. if(item.value==this.vuex_userInfo.cardType ){
  122. this.form.typeName = item.label
  123. }
  124. })
  125. }
  126. console.log(res)
  127. },
  128. confirmType(val) {
  129. let item = val.value[0]
  130. console.log(item)
  131. this.form.value = item.value
  132. this.form.typeName = item.label
  133. this.showType = false
  134. },
  135. async getpersonfaceFn() {
  136. const {data: res} = await getpersonface({MerchantId: '0NSJ2312271333064407'})
  137. let obj = JSON.parse(res)
  138. // this.link = obj.Url
  139. // this.$store.commit('updateBizToken', obj.BizToken)
  140. this.EidToken = obj.EidToken
  141. return obj.EidToken
  142. // #ifdef H5
  143. window.open(this.link, '_blank')
  144. // #endif
  145. // var regex = /\[.*?\]/;
  146. // alert(obj.BizToken)
  147. // this.GetDetectInfoEnhancedFn(obj.BizToken)
  148. // #ifdef MP-WEIXIN
  149. this.$store.commit('updateWebVeiwUrl', this.link)
  150. uni.navigateTo({
  151. url: '/pages/indexEntry/enroll/realName/webView'
  152. })
  153. // #endif
  154. console.log(obj)
  155. },
  156. async GetDetectInfoEnhancedFn(EidToken) {
  157. // let obj = {
  158. // ruleId: 2,
  159. // redirectUrl: website + '/pages/indexEntry/enroll/registInfo/registInfo',
  160. // bizToken: 'C9C2BC8E-8336-4071-84B3-8170E283E6CA',
  161. // userId: this.userId
  162. // }
  163. const res = await GetDetectInfoEnhanced({EidToken, userId: this.userId, InfoType: 1})
  164. if(res.code!=0) return
  165. let obj = JSON.parse(res.data).Text
  166. if(obj.Comparemsg!=='成功') return
  167. let userInfo = {
  168. address: obj.OcrAddress,
  169. name: obj.OcrName,
  170. idcard: obj.OcrIdCard,
  171. sex: obj.OcrGender=='女'?2:1,
  172. applyStep: 2
  173. }
  174. let info = Object.assign(this.$store.state.user.vuex_userInfo, userInfo)
  175. this.$store.commit('update_vuex_userInfo', info)
  176. console.log('请求结果来了')
  177. console.log(userInfo)
  178. console.log(this.$store.state.user.vuex_userInfo)
  179. uni.hideLoading()
  180. this.$goPage('/pages/indexEntry/enroll/registInfo/registInfo')
  181. // uni.setStorageSync(obj2)
  182. },
  183. async goNext() {
  184. // if(!this.form.value) return this.$u.toast('请选择证件类型')
  185. // this.$goPage('/pages/indexEntry/enroll/signContract/signContract?schoolId='+this.vuex_userInfo.schoolId)
  186. // return
  187. // 去签约
  188. // if(this.vuex_userInfo.applyStep==3) {
  189. // return this.$goPage('/pages/indexEntry/enroll/signContract/signContract')
  190. // }
  191. // return this.$goPage('/pages/indexEntry/enroll/registInfo/registInfo')
  192. // 去填表
  193. if(this.vuex_userInfo.applyStep==2) {
  194. if(this.title=='学员信息') {
  195. // 非平台学员
  196. return this.$goPage('/pages/indexEntry/NonPlatformStudentInfo/NonPlatformStudentInfo')
  197. }
  198. return this.$goPage('/pages/indexEntry/enroll/registInfo/registInfo')
  199. }
  200. // 去支付
  201. // if(this.vuex_userInfo.applyStep==4||this.vuex_userInfo.applyStep==5) {
  202. // return this.$goPage('/pages/indexEntry/enroll/payment/payment')
  203. // }
  204. if(this.vuex_userInfo.applyStep>1&&this.vuex_userInfo.applyStep<5) {
  205. return this.$goPage('/pages/indexEntry/enroll/registInfo/registInfo')
  206. }
  207. // 不是身份证
  208. if(this.form.value!=1) {
  209. for(let key in this.formToast) {
  210. if(!this.form[key]) {
  211. return this.$u.toast(this.formToast[key])
  212. }
  213. }
  214. this.vuex_userInfo.address = this.form.address
  215. this.vuex_userInfo.name = this.form.name
  216. this.vuex_userInfo.sex = this.form.sex
  217. this.vuex_userInfo.idcard = this.form.idcard
  218. this.vuex_userInfo.nationality = (this.form.value==7||this.form.value==2)?'外国':'中国'
  219. this.vuex_userInfo.cardType = this.form.value
  220. return this.$goPage('/pages/indexEntry/enroll/uploadAvatar/uploadAvatar')
  221. }
  222. // 去实名
  223. if(!this.vuex_userInfo.applyStep||this.vuex_userInfo.applyStep<2) {
  224. this.getInitFaceVerifyFn()
  225. }
  226. // this.$goPage('/pages/indexEntry/enroll/signContract/signContract')
  227. // this.$goPage('/pages/indexEntry/enroll/uploadAvatar/uploadAvatar')
  228. },
  229. async getInitFaceVerifyFn() {
  230. console.log('到这了吗?')
  231. const verifyPlugin = uni.requireNativePlugin('AP-FaceDetectModule');
  232. var metaInfo = verifyPlugin.getMetaInfo()
  233. const res = await getInitFaceVerify({metaInfo: metaInfo, accountId: this.vuex_userInfo.accountId})
  234. let certifyId = res.data.body.resultObject.certifyId
  235. let _this = this
  236. verifyPlugin.verify({
  237. certifyId,
  238. // extParams: {
  239. // kIdentityParamKeyIdCardFaceOnly: 'YES'
  240. // }
  241. }, function(response){
  242. console.log(response)
  243. if(response.code==1000) {
  244. GetDescribeFaceVerify({certifyId, accountId: _this.vuex_userInfo.accountId}).then((useRes)=>{
  245. console.log(useRes)
  246. let userInfo1 = JSON.parse(useRes.data.body.resultObject.materialInfo)
  247. console.log(userInfo1)
  248. if(useRes.code==0) {
  249. let materialInfo = JSON.parse(useRes.data.body.resultObject.materialInfo)
  250. let userInfo = materialInfo.ocrIdCardInfo
  251. let obj = {
  252. address: userInfo.address,
  253. name: userInfo.certName,
  254. idcard: userInfo.certNo,
  255. nationality: userInfo.nationality,
  256. cardType: '1',
  257. sex: userInfo.sex=='女'?'2': '1'
  258. }
  259. let info = Object.assign(_this.$store.state.user.vuex_userInfo, obj)
  260. _this.$store.commit('update_vuex_userInfo', info)
  261. console.log('请求结果来了')
  262. console.log(_this.$store.state.user.vuex_userInfo)
  263. _this.$goPage('/pages/indexEntry/enroll/registInfo/registInfo')
  264. }
  265. })
  266. }
  267. });
  268. },
  269. }
  270. }
  271. </script>
  272. <style>
  273. .input1::placeholder {
  274. color: red !important;
  275. }
  276. </style>
  277. <style lang="scss" scoped>
  278. .card {
  279. padding: 10rpx 46rpx 10rpx 32rpx;
  280. margin-bottom: 20rpx;
  281. .row {
  282. height: 100rpx;
  283. display: flex;
  284. align-items: center;
  285. .lab {
  286. width: 152rpx;
  287. }
  288. .rightCon {
  289. flex: 1;
  290. width: 0;
  291. display: flex;
  292. .val {
  293. flex: 1;
  294. width: 0;
  295. input {
  296. font-size: 28rpx;
  297. }
  298. }
  299. .icon {
  300. width: 30rpx;
  301. height: 30rpx;
  302. u-icon {
  303. color: #fff;
  304. }
  305. }
  306. }
  307. }
  308. }
  309. .footerBtn {
  310. position: fixed;
  311. left: 0;
  312. width: 100%;
  313. bottom: 30rpx;
  314. }
  315. .btnBg {
  316. width: 100%;
  317. height: 88rpx;
  318. text-align: center;
  319. }
  320. </style>