学员端小程序
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.

290 lines
8.2 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
10 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
10 months ago
1 year ago
10 months ago
1 year ago
1 year ago
11 months ago
1 year ago
1 year ago
11 months ago
11 months ago
1 year ago
10 months ago
1 year ago
10 months ago
1 year ago
10 months ago
10 months ago
1 year ago
10 months ago
1 year ago
1 year ago
  1. <template>
  2. <view class="pageBgImg">
  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="" v-if="form.value!=1">
  18. <!-- <view class="row" v-if="form.value==7">
  19. <view class="lab">国籍</view>
  20. <view class="rightCon">
  21. <view class="val">
  22. <input v-model="form.nationality" placeholder="请选择" @click="showType=true" disabled/></input>
  23. </view>
  24. <view class="icon">
  25. <u-icon name="arrow-right" size="14" color="#686B73" style="margin-left: 12rpx;" ></u-icon>
  26. </view>
  27. </view>
  28. </view> -->
  29. <view class="row">
  30. <view class="lab">证件号码</view>
  31. <view class="rightCon">
  32. <view class="val">
  33. <input v-model="form.idcard" placeholder="请输入" /></input>
  34. </view>
  35. </view>
  36. </view>
  37. <view class="row">
  38. <view class="lab">真实姓名</view>
  39. <view class="rightCon">
  40. <view class="val">
  41. <input v-model="form.name" placeholder="请输入" /></input>
  42. </view>
  43. </view>
  44. </view>
  45. <view class="row">
  46. <view class="lab">性别</view>
  47. <view class="rightCon">
  48. <u-radio-group v-model="form.sex">
  49. <u-radio shape="circle" label="男" name="1"></u-radio>
  50. <u-radio shape="circle" label="女" name="2" style="margin-left: 54rpx;"></u-radio>
  51. </u-radio-group>
  52. </view>
  53. </view>
  54. <view class="row">
  55. <view class="lab">户籍地址</view>
  56. <view class="rightCon">
  57. <view class="val">
  58. <input v-model="form.address" placeholder="请输入" /></input>
  59. </view>
  60. </view>
  61. </view>
  62. </view>
  63. </view>
  64. <view class="card">
  65. <view class="row">
  66. <view class="lab">实名认证</view>
  67. <view class="rightCon">
  68. <view class="val" v-if="vuex_userInfo.applyStep>1" style="color: #1989FA;">已认证</view>
  69. <view class="val" v-else>待认证</view>
  70. </view>
  71. </view>
  72. </view>
  73. <view class="btnBg" @click="goNext">下一步</view>
  74. </view>
  75. <u-picker :show="showType" :columns="typeArr" keyName="label" @confirm="confirmType" @cancel="showType=false"></u-picker>
  76. </view>
  77. </template>
  78. <script>
  79. import { getpersonface, GetDetectInfoEnhanced, getCardType } from '@/config/api.js'
  80. import { website } from '@/config/site.config.js'
  81. import { startEid } from '@/mp_ecard_sdk/main';
  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 {data: res} = await GetDetectInfoEnhanced({EidToken, userId: this.userId, InfoType: 1})
  164. let obj2 = JSON.parse(res)
  165. console.log('请求结果来了')
  166. console.log(obj2)
  167. // uni.setStorageSync(obj2)
  168. },
  169. async goNext() {
  170. // return this.$goPage('/pages/indexEntry/enroll/registInfo/registInfo')
  171. // if(!this.form.value) return this.$u.toast('请选择证件类型')
  172. // this.$goPage('/pages/indexEntry/enroll/signContract/signContract?schoolId='+this.vuex_userInfo.schoolId)
  173. // return
  174. // 去签约
  175. if(this.vuex_userInfo.applyStep==3) {
  176. return this.$goPage('/pages/indexEntry/enroll/signContract/signContract')
  177. }
  178. // 去填表
  179. if(this.vuex_userInfo.applyStep==2) {
  180. if(this.title=='学员信息') {
  181. // 非平台学员
  182. return this.$goPage('/pages/indexEntry/NonPlatformStudentInfo/NonPlatformStudentInfo')
  183. }
  184. return this.$goPage('/pages/indexEntry/enroll/registInfo/registInfo')
  185. }
  186. // 去支付
  187. if(this.vuex_userInfo.applyStep==4||this.vuex_userInfo.applyStep==5) {
  188. return this.$goPage('/pages/indexEntry/enroll/payment/payment')
  189. }
  190. // 不是身份证
  191. if(this.form.value!==1) {
  192. for(let key in this.formToast) {
  193. if(!this.form[key]) {
  194. return this.$u.toast(this.formToast[key])
  195. }
  196. }
  197. this.vuex_userInfo.address = this.form.address
  198. this.vuex_userInfo.name = this.form.name
  199. this.vuex_userInfo.sex = this.form.sex
  200. this.vuex_userInfo.idcard = this.form.idcard
  201. this.vuex_userInfo.nationality = (this.form.value==7||this.form.value==2)?'外国':'中国'
  202. this.vuex_userInfo.cardType = this.form.value
  203. return this.$goPage('/pages/indexEntry/enroll/registInfo/registInfo?realNameNo=1')
  204. }
  205. // 去实名
  206. if(!this.vuex_userInfo.applyStep||this.vuex_userInfo.applyStep<2) {
  207. const EidToken = await this.getpersonfaceFn()
  208. console.log(EidToken)
  209. this.goSDK(EidToken)
  210. }
  211. // this.$goPage('/pages/indexEntry/enroll/signContract/signContract')
  212. // this.$goPage('/pages/indexEntry/enroll/uploadAvatar/uploadAvatar')
  213. },
  214. // 示例方法
  215. goSDK(token) {
  216. let _this = this
  217. startEid({
  218. data: {
  219. token,
  220. },
  221. verifyDoneCallback(res) {
  222. const { token, verifyDone } = res;
  223. console.log('收到核身完成的res:', res);
  224. console.log('核身的token是:', token);
  225. _this.GetDetectInfoEnhancedFn(token)
  226. console.log('是否完成核身:', verifyDone);
  227. },
  228. });
  229. },
  230. }
  231. }
  232. </script>
  233. <style>
  234. .input1::placeholder {
  235. color: red !important;
  236. }
  237. </style>
  238. <style lang="scss" scoped>
  239. .card {
  240. padding: 10rpx 46rpx 10rpx 32rpx;
  241. margin-bottom: 20rpx;
  242. .row {
  243. height: 100rpx;
  244. display: flex;
  245. align-items: center;
  246. .lab {
  247. width: 152rpx;
  248. }
  249. .rightCon {
  250. flex: 1;
  251. width: 0;
  252. display: flex;
  253. .val {
  254. flex: 1;
  255. width: 0;
  256. input {
  257. font-size: 28rpx;
  258. }
  259. }
  260. .icon {
  261. width: 30rpx;
  262. height: 30rpx;
  263. u-icon {
  264. color: #fff;
  265. }
  266. }
  267. }
  268. }
  269. }
  270. .btnBg {
  271. width: 396rpx;
  272. margin: 100rpx auto 0 auto;
  273. }
  274. </style>