洛阳学员端
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.

304 lines
8.9 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
8 months ago
10 months ago
8 months ago
10 months ago
8 months ago
10 months ago
8 months ago
10 months ago
8 months ago
10 months ago
8 months ago
10 months ago
8 months ago
10 months ago
9 months ago
6 months ago
9 months ago
8 months ago
9 months ago
8 months ago
9 months ago
8 months ago
8 months ago
9 months ago
8 months ago
9 months ago
8 months ago
8 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.getCardTypeFn()
  111. const version = plus.os.version;
  112. console.log('iOS系统版本号:', version);
  113. },
  114. methods: {
  115. // 获取证件类型
  116. async getCardTypeFn() {
  117. const {data: res} = await getCardType()
  118. this.typeArr = [res]
  119. await this.$store.dispatch('getUserInfo')
  120. if(this.vuex_userInfo.applyStep>1) {
  121. res.forEach(item=>{
  122. if(item.value==this.vuex_userInfo.cardType ){
  123. this.form.typeName = item.label
  124. }
  125. })
  126. }
  127. console.log(res)
  128. },
  129. confirmType(val) {
  130. let item = val.value[0]
  131. console.log(item)
  132. this.form.value = item.value
  133. this.form.typeName = item.label
  134. this.showType = false
  135. },
  136. async goNext() {
  137. // if(!this.form.value) return this.$u.toast('请选择证件类型')
  138. // this.$goPage('/pages/indexEntry/enroll/signContract/signContract?schoolId='+this.vuex_userInfo.schoolId)
  139. // return
  140. // 去签约
  141. // if(this.vuex_userInfo.applyStep==3) {
  142. // return this.$goPage('/pages/indexEntry/enroll/signContract/signContract')
  143. // }
  144. // return this.$goPage('/pages/indexEntry/enroll/registInfo/registInfo')
  145. // 去填表
  146. // if(this.vuex_userInfo.applyStep==2) {
  147. // return this.$goPage('/pages/indexEntry/enroll/registInfo/registInfo')
  148. // }
  149. // 去支付
  150. // if(this.vuex_userInfo.applyStep==4||this.vuex_userInfo.applyStep==5) {
  151. // return this.$goPage('/pages/indexEntry/enroll/payment/payment')
  152. // }
  153. // 去实名
  154. if(!this.vuex_userInfo.applyStep||this.vuex_userInfo.applyStep<2) {
  155. // 不是身份证
  156. if(this.form.value!=1) {
  157. for(let key in this.formToast) {
  158. if(!this.form[key]) {
  159. return this.$u.toast(this.formToast[key])
  160. }
  161. }
  162. this.vuex_userInfo.address = this.form.address
  163. this.vuex_userInfo.name = this.form.name
  164. this.vuex_userInfo.sex = this.form.sex
  165. this.vuex_userInfo.idcard = this.form.idcard
  166. this.vuex_userInfo.nationality = (this.form.value==7||this.form.value==2)?'外国':'中国'
  167. this.vuex_userInfo.cardType = this.form.value
  168. return this.$goPage('/pages/indexEntry/enroll/uploadAvatar/uploadAvatar')
  169. }else {
  170. this.getInitFaceVerifyFn()
  171. }
  172. }
  173. // 去填表
  174. if(this.vuex_userInfo.applyStep>1&&this.vuex_userInfo.applyStep<5) {
  175. return this.$goPage('/pages/indexEntry/enroll/registInfo/registInfo')
  176. }
  177. // this.$goPage('/pages/indexEntry/enroll/signContract/signContract')
  178. // this.$goPage('/pages/indexEntry/enroll/uploadAvatar/uploadAvatar')
  179. },
  180. async getInitFaceVerifyFn() {
  181. const verifyPlugin = uni.requireNativePlugin('Ocr-FaceDetectModule');
  182. var metaInfo = verifyPlugin.getMetaInfo()
  183. let p = uni.getSystemInfoSync().platform;
  184. if (p === "ios") {
  185. console.log(metaInfo)
  186. metaInfo = JSON.stringify(metaInfo);
  187. }
  188. console.log('metaInfo')
  189. console.log(JSON.parse(metaInfo))
  190. const res = await getInitFaceVerify({metaInfo, accountId: this.vuex_userInfo.accountId})
  191. let certifyId = res.data.body.resultObject.certifyId
  192. console.log(certifyId)
  193. // return
  194. console.log(res)
  195. let _this = this
  196. verifyPlugin.verify({
  197. certifyId,
  198. }, function(response){
  199. console.log(response)
  200. if(response.retCode==1000) {
  201. uni.showLoading({
  202. title: '正在加载中……'
  203. })
  204. GetDescribeFaceVerify({certifyId, accountId: _this.vuex_userInfo.accountId}).then((useRes)=>{
  205. console.log(useRes)
  206. let userInfo1 = JSON.parse(useRes.data.body.resultObject.materialInfo)
  207. console.log(userInfo1)
  208. if(useRes.code==0) {
  209. let materialInfo = JSON.parse(useRes.data.body.resultObject.materialInfo)
  210. let userInfo = materialInfo.ocrIdCardInfo
  211. let obj = {
  212. address: userInfo.address,
  213. name: userInfo.certName,
  214. idcard: userInfo.certNo,
  215. nationality: userInfo.nationality,
  216. cardType: '1',
  217. sex: userInfo.sex=='女'?'2': '1'
  218. }
  219. let info = Object.assign(_this.$store.state.user.vuex_userInfo, obj)
  220. _this.$store.commit('update_vuex_userInfo', info)
  221. console.log('请求结果来了')
  222. console.log(_this.$store.state.user.vuex_userInfo)
  223. _this.$goPage('/pages/indexEntry/enroll/registInfo/registInfo')
  224. uni.hideLoading()
  225. }
  226. })
  227. setTimeout(()=>{
  228. uni.hideLoading()
  229. },6000)
  230. }else if(response.code==2006) {
  231. _this.$u.toast('认证失败!请确定是本人后再重试')
  232. }else {
  233. _this.$u.toast('认证失败!')
  234. }
  235. });
  236. },
  237. }
  238. }
  239. </script>
  240. <style>
  241. .input1::placeholder {
  242. color: red !important;
  243. }
  244. </style>
  245. <style lang="scss" scoped>
  246. .card {
  247. padding: 10rpx 46rpx 10rpx 32rpx;
  248. margin-bottom: 20rpx;
  249. .row {
  250. height: 100rpx;
  251. display: flex;
  252. align-items: center;
  253. .lab {
  254. width: 152rpx;
  255. }
  256. .rightCon {
  257. flex: 1;
  258. width: 0;
  259. display: flex;
  260. .val {
  261. flex: 1;
  262. width: 0;
  263. input {
  264. font-size: 28rpx;
  265. }
  266. }
  267. .icon {
  268. width: 30rpx;
  269. height: 30rpx;
  270. u-icon {
  271. color: #fff;
  272. }
  273. }
  274. }
  275. }
  276. }
  277. .footerBtn {
  278. position: fixed;
  279. left: 0;
  280. width: 100%;
  281. bottom: 30rpx;
  282. }
  283. .btnBg {
  284. width: 100%;
  285. height: 88rpx;
  286. text-align: center;
  287. }
  288. </style>