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

269 lines
7.6 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
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
11 months ago
1 year ago
1 year ago
11 months ago
11 months ago
1 year ago
1 year ago
11 months ago
1 year ago
1 year ago
1 year ago
1 year 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. export default {
  82. data() {
  83. return {
  84. form: {
  85. value: 1,
  86. nationality: '中国',
  87. idcard: '',
  88. name: '',
  89. sex: '1',
  90. address: '',
  91. typeName: '身份证',
  92. },
  93. formToast: {
  94. idcard: '请输入证件号码',
  95. name: '请输入真实姓名',
  96. sex: '请选择性别',
  97. address: '请输入户籍地址',
  98. },
  99. showType: false,
  100. typeArr: [],
  101. title: '学员报名'
  102. }
  103. // 报名进度(0:待报名,1:已选驾校,2:已实名制,3:已填写报名信息,4:已签署合同,5:待支付,6:已支付)
  104. },
  105. onLoad(options) {
  106. if(options.tit) {
  107. this.title = options.tit
  108. }
  109. // this.GetDetectInfoEnhancedFn()
  110. this.getCardTypeFn()
  111. },
  112. methods: {
  113. // 获取证件类型
  114. async getCardTypeFn() {
  115. const {data: res} = await getCardType()
  116. this.typeArr = [res]
  117. await this.$store.dispatch('getUserInfo')
  118. if(this.vuex_userInfo.applyStep>1) {
  119. res.forEach(item=>{
  120. if(item.value==this.vuex_userInfo.cardType ){
  121. this.form.typeName = item.label
  122. }
  123. })
  124. }
  125. console.log(res)
  126. },
  127. confirmType(val) {
  128. let item = val.value[0]
  129. console.log(item)
  130. this.form.value = item.value
  131. this.form.typeName = item.label
  132. this.showType = false
  133. },
  134. async getpersonfaceFn() {
  135. const {data: res} = await getpersonface({ ruleId: 2, RedirectUrl: website + '/pages/indexEntry/enroll/realName/realName?userId='+this.userId+'&test=123' ,userId: this.userId})
  136. let obj = JSON.parse(res)
  137. this.link = obj.Url
  138. this.$store.commit('updateBizToken', obj.BizToken)
  139. // #ifdef H5
  140. window.open(this.link, '_blank')
  141. // #endif
  142. // var regex = /\[.*?\]/;
  143. // alert(obj.BizToken)
  144. // this.GetDetectInfoEnhancedFn(obj.BizToken)
  145. // #ifdef MP-WEIXIN
  146. this.$store.commit('updateWebVeiwUrl', this.link)
  147. uni.navigateTo({
  148. url: '/pages/indexEntry/enroll/realName/webView'
  149. })
  150. // #endif
  151. console.log(obj)
  152. },
  153. async GetDetectInfoEnhancedFn(bizToken) {
  154. let obj = {
  155. ruleId: 2,
  156. redirectUrl: website + '/pages/indexEntry/enroll/registInfo/registInfo',
  157. bizToken: 'C9C2BC8E-8336-4071-84B3-8170E283E6CA',
  158. userId: this.userId
  159. }
  160. const {data: res} = await GetDetectInfoEnhanced(obj)
  161. let obj2 = JSON.parse(res)
  162. console.log(obj2)
  163. console.log('请求结果来了')
  164. console.log(obj2.Text.ErrMsg=='成功')
  165. // uni.setStorageSync(obj2)
  166. },
  167. goNext() {
  168. // return this.$goPage('/pages/indexEntry/enroll/registInfo/registInfo')
  169. // if(!this.form.value) return this.$u.toast('请选择证件类型')
  170. // this.$goPage('/pages/indexEntry/enroll/signContract/signContract?schoolId='+this.vuex_userInfo.schoolId)
  171. // return
  172. // 去签约
  173. if(this.vuex_userInfo.applyStep==3) {
  174. return this.$goPage('/pages/indexEntry/enroll/signContract/signContract')
  175. }
  176. // 去填表
  177. if(this.vuex_userInfo.applyStep==2) {
  178. if(this.title=='学员信息') {
  179. // 非平台学员
  180. return this.$goPage('/pages/indexEntry/NonPlatformStudentInfo/NonPlatformStudentInfo')
  181. }
  182. return this.$goPage('/pages/indexEntry/enroll/registInfo/registInfo')
  183. }
  184. // 去支付
  185. if(this.vuex_userInfo.applyStep==4||this.vuex_userInfo.applyStep==5) {
  186. return this.$goPage('/pages/indexEntry/enroll/payment/payment')
  187. }
  188. // 不是身份证
  189. if(this.form.value!==1) {
  190. for(let key in this.formToast) {
  191. if(!this.form[key]) {
  192. return this.$u.toast(this.formToast[key])
  193. }
  194. }
  195. this.vuex_userInfo.address = this.form.address
  196. this.vuex_userInfo.name = this.form.name
  197. this.vuex_userInfo.sex = this.form.sex
  198. this.vuex_userInfo.idcard = this.form.idcard
  199. this.vuex_userInfo.nationality = (this.form.value==7||this.form.value==2)?'外国':'中国'
  200. this.vuex_userInfo.cardType = this.form.value
  201. return this.$goPage('/pages/indexEntry/enroll/registInfo/registInfo')
  202. }
  203. // 去实名
  204. if(!this.vuex_userInfo.applyStep||this.vuex_userInfo.applyStep<2) {
  205. this.getpersonfaceFn()
  206. }
  207. // this.$goPage('/pages/indexEntry/enroll/signContract/signContract')
  208. // this.$goPage('/pages/indexEntry/enroll/uploadAvatar/uploadAvatar')
  209. }
  210. }
  211. }
  212. </script>
  213. <style>
  214. .input1::placeholder {
  215. color: red !important;
  216. }
  217. </style>
  218. <style lang="scss" scoped>
  219. .card {
  220. padding: 10rpx 46rpx 10rpx 32rpx;
  221. margin-bottom: 20rpx;
  222. .row {
  223. height: 100rpx;
  224. display: flex;
  225. align-items: center;
  226. .lab {
  227. width: 152rpx;
  228. }
  229. .rightCon {
  230. flex: 1;
  231. width: 0;
  232. display: flex;
  233. .val {
  234. flex: 1;
  235. width: 0;
  236. input {
  237. font-size: 28rpx;
  238. }
  239. }
  240. .icon {
  241. width: 30rpx;
  242. height: 30rpx;
  243. u-icon {
  244. color: #fff;
  245. }
  246. }
  247. }
  248. }
  249. }
  250. .btnBg {
  251. width: 396rpx;
  252. margin: 100rpx auto 0 auto;
  253. }
  254. </style>