工行这里学车报名流程h5
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.

563 lines
16 KiB

1 year ago
  1. <template>
  2. <view class="main">
  3. <u-form :model="form" ref="uForm" :label-width="'auto'">
  4. <u-form-item label="驾校名称" >
  5. <view class="tar">
  6. {{currentSchool.schoolName}}
  7. </view>
  8. </u-form-item>
  9. <u-form-item label="学驾车型" prop="classModel" required >
  10. <view @click="showDriveModels=true" class="select_row" >
  11. <u-input v-model="form.classModel" input-align="right" placeholder="请选择" disabled @click="showDriveModels=true" />
  12. <u-icon name="arrow-right" size="28" color="#686B73" style="margin-left: 12rpx;" ></u-icon>
  13. </view>
  14. </u-form-item>
  15. <u-form-item label="班型" prop="classModel" required >
  16. <view @click="showDriveModels=true" class="select_row" >
  17. <u-input v-model="form.trainingClassLable" input-align="right" placeholder="请选择" disabled @click="showDriveModels=true" />
  18. <u-icon name="arrow-right" size="28" color="#686B73" style="margin-left: 12rpx;" ></u-icon>
  19. </view>
  20. </u-form-item>
  21. <view class="line"></view>
  22. <u-form-item label="业务类型" required prop="businessTypeName" >
  23. <view class="tag_row">
  24. <view class="tag" v-for="(item, index) in businessTypeArr" :key="index" @click="form.businessType=item.id" :class="{active: item.id==form.businessType}">{{item.name}}</view>
  25. </view>
  26. </u-form-item>
  27. <!-- <view :class="{line: !form.businessType}"></view> -->
  28. <view class="" v-if="form.businessType==1">
  29. <!-- <u-form-item label="原驾驶证号" required >
  30. <u-input v-model="form.certificateCodeShow" disabled input-align="right" placeholder="" disabled/>
  31. </u-form-item> -->
  32. <u-form-item label="驾驶证初领日期" required >
  33. <view @click="showFirstLicenceTime=true" class="select_row">
  34. <u-input v-model="form.firstLicenceTime" disabled input-align="right" placeholder="请选择" @click="showFirstLicenceTime=true"/>
  35. <u-icon name="arrow-right" size="28" color="#686B73" style="margin-left: 12rpx;"></u-icon>
  36. </view>
  37. </u-form-item>
  38. <u-form-item label="原准驾车型" required>
  39. <view @click="showOldDriveModel=true" class="select_row">
  40. <u-input v-model="form.oldDriveModel" disabled input-align="right" placeholder="请选择" @click="showOldDriveModel=true"/>
  41. <u-icon name="arrow-right" size="28" color="#686B73" style="margin-left: 12rpx;"></u-icon>
  42. </view>
  43. </u-form-item>
  44. <view class="line"></view>
  45. </view>
  46. <view :class="{line: !form.businessType}"></view>
  47. <u-form-item label="异地转入" required prop="businessTypeName" >
  48. <view class="tag_row" @click="transfer=!transfer">
  49. <view class="tag" :class="{active: transfer}"></view>
  50. <view class="tag" :class="{active: !transfer}"></view>
  51. </view>
  52. </u-form-item>
  53. <view class="" v-if="transfer">
  54. <u-form-item label="转出城市" prop="coachName" >
  55. <view @click="showDriveModels=true" class="select_row" >
  56. <u-input v-model="form.value" input-align="right" placeholder="请选择" disabled @click="showDriveModels=true" />
  57. <u-icon name="arrow-right" size="28" color="#686B73" style="margin-left: 12rpx;" ></u-icon>
  58. </view>
  59. </u-form-item>
  60. <u-form-item label="已学科目" prop="coachName" >
  61. <view @click="showDriveModels=true" class="select_row" >
  62. <u-input v-model="form.value" input-align="right" placeholder="请选择" disabled @click="showDriveModels=true" />
  63. <u-icon name="arrow-right" size="28" color="#686B73" style="margin-left: 12rpx;" ></u-icon>
  64. </view>
  65. </u-form-item>
  66. </view>
  67. <view class="h2">
  68. 学员信息 <text>请准确填写学员真实信息</text>
  69. </view>
  70. <u-form-item label="头 像" >
  71. <view @click="chooseImages" class="select_row" >
  72. <view class="avatar">
  73. <image :src="form.avatar" mode=""></image>
  74. </view>
  75. <u-icon name="arrow-right" size="28" color="#686B73" style="margin-left: 12rpx;" ></u-icon>
  76. </view>
  77. </u-form-item>
  78. <u-form-item label="姓 名" >
  79. <u-input placeholder="请填写" input-align="right"></u-input>
  80. </u-form-item>
  81. <u-form-item label="性 别" >
  82. <view @click="showDriveModels=true" class="select_row" >
  83. <u-input v-model="form.classModel" input-align="right" placeholder="请选择" disabled @click="showDriveModels=true" />
  84. <u-icon name="arrow-right" size="28" color="#686B73" style="margin-left: 12rpx;" ></u-icon>
  85. </view>
  86. </u-form-item>
  87. <u-form-item label="国 籍" prop="coachName" >
  88. <view class="tar">中国</view>
  89. </u-form-item>
  90. <u-form-item label="证件类型" prop="coachName" >
  91. <view class="tar">身份证</view>
  92. </u-form-item>
  93. <u-form-item label="证件号码" prop="coachName" >
  94. <view class="tar">
  95. <u-input placeholder="请输入证件号码" input-align="right"></u-input>
  96. </view>
  97. </u-form-item>
  98. <view class="idcardBox">
  99. <view class="idcard">
  100. <image src="@/static/images/idcardA.png" mode="widthFix"></image>
  101. </view>
  102. <view class="idcard">
  103. <image src="@/static/images/idcardB.png" mode="widthFix"></image>
  104. </view>
  105. </view>
  106. <view class="line"></view>
  107. <view class="remark">
  108. <view class="h3">备注</view>
  109. <view class="remarkInput">
  110. <u-input v-model="form.value" type="textarea" :border="false" :auto-height="true" :height="176"/>
  111. </view>
  112. </view>
  113. </u-form>
  114. <view class="footBox">
  115. <view class="leftCon">
  116. <view class="row1">
  117. <view class="lab">总额</view>
  118. <view class="redPrice">
  119. <text></text>266.00
  120. </view>
  121. <view class="oldPrice">300.00</view>
  122. </view>
  123. <view class="redTxt">享9.5已减271元</view>
  124. </view>
  125. <view class="rightBtn" @click="$goPage('/pages/application/payment')">下一步</view>
  126. </view>
  127. <!-- 车型 -->
  128. <u-picker mode="selector" v-model="showDriveModels" :range="selectorDriveModels" @confirm="confirmDriveModels"></u-picker>
  129. <!-- 班型 -->
  130. <u-picker mode="selector" v-model="showTrainingClasss" :range="selectorTrainingClasss" range-key="className" @confirm="confirmTrainingClasss"></u-picker>
  131. <!-- 原驾驶证初领日期 -->
  132. <u-picker mode="time" v-model="showFirstLicenceTime" @confirm="confirmFirstLicenceTime" :params="paramsPicker"></u-picker>
  133. <!-- 原驾驶证学驾车型 -->
  134. <u-popup v-model="showOldDriveModel" mode="bottom">
  135. <view class="carBox">
  136. <view class="carh1">学驾车型</view>
  137. <view v-for="(item,index) in carTypeArr" :key="index" class="carLi">
  138. <view class="carType">{{item.lab}}</view>
  139. <view class="carName_row">
  140. <view class="carName" v-for="(item2,index2) in item.arr" :key="index2" @click="pickerCarClick(item2)" :class="{active: pickerCarArr.indexOf(item2) > -1}">{{item2}}</view>
  141. </view>
  142. </view>
  143. <view class="payBtn_row">
  144. <view class="payBtn border" @click="pickerCar()">重置</view>
  145. <view class="payBtn" @click="pickerCar(1)">完成</view>
  146. </view>
  147. </view>
  148. </u-popup>
  149. </view>
  150. </template>
  151. <script>
  152. import indexApi from '@/api/index.js'
  153. import {mapState} from 'vuex'
  154. import { APP_API, APP_HOST } from '@/site.config.js';
  155. const _url = APP_HOST + APP_API + '/util/manage/uploadFile.do';
  156. export default {
  157. computed: {
  158. ...mapState(['currentSchool','classChooseItem']),
  159. // 该函数内部运行的返回值大致为:{num: () => this.$store.state.num, school: () => this.$store.state.school}
  160. },
  161. data() {
  162. return {
  163. transfer: false,
  164. showDriveModels: false,
  165. showTrainingClasss: false,
  166. showFirstLicenceTime: false,
  167. showOldDriveModel: false,
  168. form: {
  169. classModel: '',
  170. trainingClassLable: '',
  171. businessType: 0,
  172. firstLicenceTime: '',
  173. avatar: [],//上传头像
  174. },
  175. info: {},
  176. selectorTrainingClasss: [],//班型数据
  177. selectorDriveModels: [],//车型数据
  178. businessTypeArr: [
  179. {name: '初领', id: 0},
  180. {name: '增领', id: 1}
  181. ],
  182. carTypeArr: [
  183. {lab: '小车',arr: ['C1','C2','C3']},
  184. {lab: '货车',arr: ['A2','B2',]},
  185. {lab: '客车',arr: ['A1','B3','B1']},
  186. {lab: '摩托车',arr: ['D','E','F']},
  187. {lab: '其它',arr: ['C4','C5','C6']},
  188. ],
  189. pickerCarArr: [],
  190. paramsPicker: {
  191. year: true,
  192. month: true,
  193. day: true,
  194. },
  195. }
  196. },
  197. onLoad() {
  198. // totalPrice trainingClassId
  199. this.createTrainingApplySimpleFn()
  200. this.form.classModel = this.classChooseItem.className
  201. this.form.trainingClassLable = this.classChooseItem.classModel
  202. },
  203. methods: {
  204. // 选择原驾驶证学驾车型
  205. pickerCarClick(item) {
  206. let index = this.pickerCarArr.indexOf(item)
  207. if(index>-1) {
  208. this.pickerCarArr.splice(index, 1);
  209. }else {
  210. this.pickerCarArr.push(item)
  211. }
  212. },
  213. // 选择原驾驶证学驾车型 点击重置或确定
  214. pickerCar(num) {
  215. if(num==1) {
  216. if(!this.pickerCarArr.length) return this.$u.toast('请选择学驾车型')
  217. this.form.oldDriveModel = this.pickerCarArr.join('')
  218. this.showOldDriveModel = false
  219. }else {
  220. this.pickerCarArr = []
  221. this.form.oldDriveModel = ''
  222. }
  223. },
  224. // 选择原驾驶证初领日期
  225. confirmFirstLicenceTime(val) {
  226. let str = val.year+'-'+val.month+'-'+val.day
  227. this.form.firstLicenceTime = str
  228. console.log(val)
  229. },
  230. // 选择车型
  231. async confirmDriveModels(i) {
  232. let index = i[0]
  233. this.form.classModel = this.selectorDriveModels[index]
  234. this.form.trainingClassLable = ''
  235. await this.queryTrainingClasssFn()
  236. this.showTrainingClasss = true
  237. },
  238. // 选择班型
  239. confirmTrainingClasss(i) {
  240. let index = i[0]
  241. let item = this.selectorTrainingClasss[index]
  242. this.form.trainingClassId = item.trainingClassId
  243. this.form.trainingClassLable = item.className
  244. this.totalPrice = item.totalPrice
  245. },
  246. // 获取班型
  247. async queryTrainingClasssFn() {
  248. if(!this.info.trainingSchoolId) return
  249. let obj = {pageSize: 20,pageIndex: 1,trainingSchoolId: this.info.trainingSchoolId,}
  250. if(this.form.classModel) obj.classModel = this.form.classModel
  251. const [nulls, res] = await indexApi.querySimpleTrainingClasssByModel(obj)
  252. this.selectorTrainingClasss = res.data
  253. console.log('获取班型')
  254. console.log(res)
  255. },
  256. // 获取学驾车型
  257. async queryDriveModelsFn() {
  258. if(!this.info.trainingSchoolId) return
  259. const [nulls, res] = await indexApi.queryDriveModels({trainingSchoolId: this.info.trainingSchoolId})
  260. this.selectorDriveModels = res.data
  261. console.log('学驾车型')
  262. console.log(res)
  263. },
  264. // 查询状态
  265. async getTrainingApplyDetailsFn() {
  266. console.log(this.trainingApplyId)
  267. const [nulls, res] = await indexApi.getTrainingApplyDetails({trainingApplyId: this.trainingApplyId})
  268. this.info = res.data
  269. console.log('整体状态控制***************')
  270. console.log(res)
  271. console.log(nulls)
  272. if(this.info.checkStatus==1) this.stepIcon = 1 //按顺序:体检,面签,1为完成,0-未完成
  273. if(this.info.applyStatus==1) this.currentIndex = this.stepIcon = 3//0-预报名,1-已报名,2-已支付,3-已学完
  274. if(this.info.applyStatus==1&&this.info.contractStatus<2) this.showSignPopup = true
  275. if(this.info.contractStatus==2) this.currentIndex = 5
  276. if(this.info.contractStatus==2&&this.info.applyStatus==1) {
  277. if(!this.info.trainingOrderId) {
  278. this.createOrder()
  279. }else {
  280. uni.redirectTo({
  281. url: '/pages/learnDriveStep/payMoney/payMoney?trainingOrderId='+ this.info.trainingOrderId + '&trainingApplyId='+ this.trainingApplyId
  282. })
  283. }
  284. }
  285. },
  286. // 第一步先报名
  287. async createTrainingApplySimpleFn() {
  288. let trainingSchoolId = this.$store.state.currentSchool.trainingSchoolId
  289. let trainingClassId = this.$store.state.classChooseItem.trainingClassId
  290. const [nulls, res] = await indexApi.createTrainingApplySimple({trainingSchoolId, trainingClassId})
  291. if(res.code==0) {
  292. this.trainingOrderId = res.data
  293. }else if(res.code==502) {
  294. // 已经报名过这个学校了 存在未支付订单
  295. this.$u.toast(res.message)
  296. }
  297. },
  298. //选择图片
  299. chooseImages(type) {
  300. uni.chooseImage({
  301. count: 1, //允许选择的数量
  302. sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
  303. sourceType: ['album', 'camera'], //从相册选择
  304. success: res => {
  305. // console.log(res)
  306. uni.showLoading({
  307. title: '图片上传中...'
  308. });
  309. this.uploadImgApi(res.tempFilePaths[0])
  310. }
  311. })
  312. },
  313. uploadImgApi(filePath) {
  314. console.log(filePath)
  315. let _this = this
  316. // 上传图片到服务器
  317. uni.uploadFile({
  318. url: _url,//接口
  319. filePath: filePath,//要上传的图片的本地路径
  320. name: 'file',
  321. formData: {
  322. fileType: 1,
  323. fileSuffix: "png"
  324. },
  325. header: {
  326. token: uni.getStorageSync("Authorization") || '',
  327. },
  328. success(res) {
  329. console.log(res)
  330. console.log('上传成功')
  331. let res2 = JSON.parse(res.data)
  332. console.log(res2)
  333. if(res2.code==0) {
  334. _this.form.avatar = res2.data
  335. }
  336. uni.hideLoading();
  337. },
  338. complete: ()=> {}
  339. })
  340. },
  341. }
  342. }
  343. </script>
  344. <style lang="scss" scoped>
  345. .main {
  346. width: 100%;
  347. padding: 0 32rpx 100rpx 32rpx;
  348. background: #fff;
  349. }
  350. .payBtn_row {
  351. width: 100%;
  352. padding: 20rpx 46rpx;
  353. display: flex;
  354. justify-content: space-between;
  355. border-top: 1px solid #ededed;
  356. .payBtn {
  357. width: 48%;
  358. line-height: 96rpx;
  359. color: #fff;
  360. height: 96rpx;
  361. background: linear-gradient(180deg, #3593FB 0%, #53D3E5 100%);
  362. border-radius: 49rpx;
  363. text-align: center;
  364. &.border {
  365. border: 2rpx solid rgba(53, 147, 251, 1);
  366. color: #1989FA;
  367. background: #fff;
  368. }
  369. }
  370. }
  371. .select_row {
  372. display: flex;justify-content: flex-end;width: 100%;
  373. }
  374. .avatar {
  375. width: 96rpx;
  376. height: 96rpx;
  377. border-radius: 50%;
  378. overflow: hidden;
  379. }
  380. .idcardBox {
  381. display: flex;
  382. padding: 42rpx 0 28rpx 0;
  383. .idcard {
  384. flex: 1;
  385. padding: 0 10rpx;
  386. }
  387. }
  388. .h2 {
  389. width: 100vw;
  390. margin-left: -32rpx;
  391. height: 96rpx;
  392. background: #F6F7F8;
  393. font-weight: 600;
  394. color: #333333;
  395. line-height: 96rpx;
  396. padding: 0 32rpx;
  397. text {
  398. font-size: 28rpx;
  399. color: #686B73;
  400. padding: 0 0 0 8rpx;
  401. }
  402. }
  403. .line {
  404. height: 20rpx;
  405. width: 100vw;
  406. background-color: #f7f7f7;
  407. margin: -1px 0 0 -32rpx;
  408. }
  409. .tar {
  410. text-align: right;
  411. width: 100%;
  412. }
  413. .tag_row {
  414. display: flex;
  415. width: 100%;
  416. justify-content: flex-end;
  417. // padding-top: 15rpx;
  418. .tag {
  419. width: 88rpx;
  420. height: 56rpx;
  421. background: #F6F7F8;
  422. border-radius: 28rpx;
  423. font-size: 28rpx;
  424. color: #686B73;
  425. margin-left: 12rpx;
  426. text-align: center;
  427. line-height: 56rpx;
  428. &.active {
  429. background: #EDF8FE;
  430. border: 1rpx solid #3593FB;
  431. color: #1989FA;
  432. }
  433. }
  434. }
  435. .remark{
  436. padding-bottom: 80rpx;
  437. .remarkInput {
  438. width: 100%;
  439. padding: 12rpx 32rpx;
  440. border-radius: 8rpx;
  441. background: #F6F7F8;
  442. }
  443. .h3 {
  444. height: 108rpx;
  445. line-height: 108rpx;
  446. font-size: 32rpx;
  447. color: #333;
  448. }
  449. }
  450. .footBox {
  451. position: fixed;
  452. bottom: 0;
  453. left: 0;
  454. width: 100vw;
  455. height: 128rpx;
  456. background: #FFFFFF;
  457. box-shadow: inset 0px 1px 0px 0px #E8E9EC;
  458. padding: 0 32rpx;
  459. display: flex;
  460. justify-content: space-between;
  461. align-items: center;
  462. .leftCon {
  463. flex: 1;
  464. width: 0;
  465. .row1 {
  466. display: flex;
  467. align-items: center;
  468. font-size: 28rpx;
  469. .lab {
  470. color: #333;
  471. }
  472. .redPrice {
  473. color: #E63633;
  474. text {
  475. font-size: 28rpx;
  476. }
  477. font-size: 40rpx;
  478. }
  479. .oldPrice {
  480. color: #686B73;
  481. text-decoration: line-through;
  482. margin-right: 10rpx;
  483. }
  484. }
  485. .redTxt {
  486. color: #E63633;
  487. // margin-top: 8rpx;
  488. font-size: 28rpx;
  489. }
  490. }
  491. .rightBtn {
  492. width: 216rpx;
  493. height: 96rpx;
  494. background: linear-gradient(180deg, #3593FB 0%, #53D3E5 100%);
  495. border-radius: 50rpx;
  496. font-size: 36rpx;
  497. color: #fff;
  498. text-align: center;
  499. line-height: 96rpx;
  500. }
  501. }
  502. .carBox {
  503. width: 100%;
  504. .carh1 {
  505. font-size: 26rpx;
  506. font-weight: 700;
  507. text-align: center;
  508. padding: 30rpx 0 0 0;
  509. }
  510. .carLi {
  511. width: 100%;
  512. margin-bottom: 30rpx;
  513. padding: 0 32rpx;
  514. }
  515. .carType {
  516. font-size: 26rpx;
  517. font-weight: 500;
  518. line-height: 40rpx;
  519. padding: 28rpx 12rpx 12rpx 0;
  520. }
  521. .carName_row {
  522. display: flex;
  523. .carName {
  524. margin-right: 40rpx;
  525. width: 88rpx;
  526. height: 56rpx;
  527. background: #F6F7F8;
  528. border-radius: 28rpx;
  529. line-height: 56rpx;
  530. text-align: center;
  531. color: #686B73;
  532. &.active {
  533. background: #ECF7FE;
  534. border: 1px solid #3593FB;
  535. color: #1989FA;
  536. }
  537. }
  538. }
  539. }
  540. </style>