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

273 lines
7.7 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
11 months ago
1 year ago
1 year ago
11 months ago
1 year ago
11 months ago
1 year ago
11 months ago
1 year ago
1 year ago
11 months ago
11 months ago
11 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. <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: 1, 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. console.log('来这里了吗?')
  140. // #ifdef H5
  141. console.log('来这里了吗2?')
  142. window.open(this.link, '_blank')
  143. // #endif
  144. // var regex = /\[.*?\]/;
  145. // alert(obj.BizToken)
  146. // this.GetDetectInfoEnhancedFn(obj.BizToken)
  147. // #ifdef MP-WEIXIN
  148. console.log('来这里了吗3?')
  149. console.log(website+'website地址')
  150. this.$store.commit('updateWebVeiwUrl', this.link)
  151. uni.navigateTo({
  152. url: '/pages/indexEntry/enroll/realName/webView'
  153. })
  154. // #endif
  155. console.log(obj)
  156. },
  157. async GetDetectInfoEnhancedFn(bizToken) {
  158. let obj = {
  159. ruleId: 1,
  160. redirectUrl: website + '/pages/indexEntry/enroll/registInfo/registInfo',
  161. bizToken: 'C9C2BC8E-8336-4071-84B3-8170E283E6CA',
  162. userId: this.userId
  163. }
  164. const {data: res} = await GetDetectInfoEnhanced(obj)
  165. let obj2 = JSON.parse(res)
  166. console.log(obj2)
  167. console.log('请求结果来了')
  168. console.log(obj2.Text.ErrMsg=='成功')
  169. // uni.setStorageSync(obj2)
  170. },
  171. goNext() {
  172. // return this.$goPage('/pages/indexEntry/enroll/registInfo/registInfo')
  173. // if(!this.form.value) return this.$u.toast('请选择证件类型')
  174. // this.$goPage('/pages/indexEntry/enroll/signContract/signContract?schoolId='+this.vuex_userInfo.schoolId)
  175. // return
  176. // 去签约
  177. if(this.vuex_userInfo.applyStep==3) {
  178. return this.$goPage('/pages/indexEntry/enroll/signContract/signContract')
  179. }
  180. // 去填表
  181. if(this.vuex_userInfo.applyStep==2) {
  182. if(this.title=='学员信息') {
  183. // 非平台学员
  184. return this.$goPage('/pages/indexEntry/NonPlatformStudentInfo/NonPlatformStudentInfo')
  185. }
  186. return this.$goPage('/pages/indexEntry/enroll/registInfo/registInfo')
  187. }
  188. // 去支付
  189. if(this.vuex_userInfo.applyStep==4||this.vuex_userInfo.applyStep==5) {
  190. return this.$goPage('/pages/indexEntry/enroll/payment/payment')
  191. }
  192. // 不是身份证
  193. if(this.form.value!==1) {
  194. for(let key in this.formToast) {
  195. if(!this.form[key]) {
  196. return this.$u.toast(this.formToast[key])
  197. }
  198. }
  199. this.vuex_userInfo.address = this.form.address
  200. this.vuex_userInfo.name = this.form.name
  201. this.vuex_userInfo.sex = this.form.sex
  202. this.vuex_userInfo.idcard = this.form.idcard
  203. this.vuex_userInfo.nationality = (this.form.value==7||this.form.value==2)?'外国':'中国'
  204. this.vuex_userInfo.cardType = this.form.value
  205. return this.$goPage('/pages/indexEntry/enroll/registInfo/registInfo')
  206. }
  207. // 去实名
  208. if(!this.vuex_userInfo.applyStep||this.vuex_userInfo.applyStep<2) {
  209. this.getpersonfaceFn()
  210. }
  211. // this.$goPage('/pages/indexEntry/enroll/signContract/signContract')
  212. // this.$goPage('/pages/indexEntry/enroll/uploadAvatar/uploadAvatar')
  213. }
  214. }
  215. }
  216. </script>
  217. <style>
  218. .input1::placeholder {
  219. color: red !important;
  220. }
  221. </style>
  222. <style lang="scss" scoped>
  223. .card {
  224. padding: 10rpx 46rpx 10rpx 32rpx;
  225. margin-bottom: 20rpx;
  226. .row {
  227. height: 100rpx;
  228. display: flex;
  229. align-items: center;
  230. .lab {
  231. width: 152rpx;
  232. }
  233. .rightCon {
  234. flex: 1;
  235. width: 0;
  236. display: flex;
  237. .val {
  238. flex: 1;
  239. width: 0;
  240. input {
  241. font-size: 28rpx;
  242. }
  243. }
  244. .icon {
  245. width: 30rpx;
  246. height: 30rpx;
  247. u-icon {
  248. color: #fff;
  249. }
  250. }
  251. }
  252. }
  253. }
  254. .btnBg {
  255. width: 396rpx;
  256. margin: 100rpx auto 0 auto;
  257. }
  258. </style>