diff --git a/common/js/utils.js b/common/js/utils.js index 367591e..b9bc604 100644 --- a/common/js/utils.js +++ b/common/js/utils.js @@ -21,6 +21,7 @@ const install = (Vue, vm) => { } // 价格计算 const priceTo = (price = 0) => { + if(!price) return 0 // return (price / 100).toFixed(2) return (parseInt(price * 100) / 100 / 100).toFixed(2) diff --git a/config/api.js b/config/api.js index fd354f1..81ef934 100644 --- a/config/api.js +++ b/config/api.js @@ -34,6 +34,8 @@ export const getSchoolListComment = (params) => http.get('business/school/getLis export const getListCoachComment = (params) => http.get('business/school/getListCoach', {params: params}) // 驾校详情 export const getSchoolDetail = (params) => http.get('business/school/getSchool', {params: params}) +// 驾校班型 +export const schoolClass = (params) => http.get('business/school-class/page', {params: params}) // 教练列表分页 export const coachPage = (params) => http.get('business/coach/page', {params: params}) // 公益视频 @@ -78,6 +80,10 @@ export const areaTree = () => http.get('system/area/tree', ) export const licenseType = () => http.get('system/dict/licenseType', ) // 区域 export const nachangList = () => http.get('system/area/nachangList', ) +// 线上提交学员报名信息 +export const applyOnline = (data) => http.post('app/student-record/applyOnline', data) +// 人脸核身---获取BizToken +export const getpersonface = (params) => http.get('app/student-record/getpersonface', {params}) diff --git a/config/new_file.js b/config/new_file.js deleted file mode 100644 index e69de29..0000000 diff --git a/manifest.json b/manifest.json index e015b22..7bf55f6 100644 --- a/manifest.json +++ b/manifest.json @@ -59,7 +59,7 @@ "quickapp" : {}, /* 小程序特有相关 */ "mp-weixin" : { - "appid" : "wx2d71605af3b620e6", + "appid" : "wx1f7125112b74db52", "setting" : { "urlCheck" : true, "es6" : true, diff --git a/pages/indexEntry/enroll/enroll.vue b/pages/indexEntry/enroll/enroll.vue index 6a7676f..e3c3e27 100644 --- a/pages/indexEntry/enroll/enroll.vue +++ b/pages/indexEntry/enroll/enroll.vue @@ -2,7 +2,7 @@ - + {{link}} 证件类型 @@ -44,14 +44,17 @@ - 下一步 + 下一步 + + + + \ No newline at end of file diff --git a/pages/indexEntry/enroll/registInfo/comp/comfigPopup.vue b/pages/indexEntry/enroll/registInfo/comp/comfigPopup.vue index a8dce69..61f27af 100644 --- a/pages/indexEntry/enroll/registInfo/comp/comfigPopup.vue +++ b/pages/indexEntry/enroll/registInfo/comp/comfigPopup.vue @@ -3,31 +3,31 @@ 再次确认报名信息 选择驾校 - xxx + {{ info.school}} 选择车型 - xxx + {{info.trainType}} 选择班型 - xxx + {{info.classModel}} 选择教练 - xxx + {{info.coach}} 业务类型 - xxx + {{ info.businessType?'增领':'初领'}} 是否异地转入 - xxx + 暂时没对接 合计 - xxx + {{ $u.utils.priceTo(form.totalAmount) }} 支付形式 diff --git a/pages/indexEntry/enroll/registInfo/registInfo.vue b/pages/indexEntry/enroll/registInfo/registInfo.vue index a311850..64cc219 100644 --- a/pages/indexEntry/enroll/registInfo/registInfo.vue +++ b/pages/indexEntry/enroll/registInfo/registInfo.vue @@ -73,7 +73,7 @@ 业务类型 - - - 是否异地转入 - - - - - - - - - - + 原驾驶证号 @@ -123,7 +102,7 @@ - + @@ -146,6 +125,27 @@ + + + 是否异地转入 + + + + + + + + + 来源城市 @@ -165,7 +165,7 @@ - + @@ -193,15 +193,7 @@ 学费 - ¥100 - - - - - 合计 - - - ¥100 + ¥{{ $u.utils.priceTo(form.totalAmount) }} @@ -251,7 +243,7 @@ 确认 - + @@ -259,7 +251,7 @@ - + @@ -270,7 +262,7 @@ - + @@ -282,7 +274,7 @@ import comfigPopup from './comp/comfigPopup' import searchSchool from './comp/searchSchool' import oldDrive from './comp/oldDrive' - import { areaTree } from '@/config/api.js' + import { areaTree, applyOnline, schoolClass } from '@/config/api.js' export default { components: { comfigPopup, searchSchool, oldDrive }, data() { @@ -295,18 +287,7 @@ showOldDriveModel: false, showSubjectPass: false, showSubjectTreat: false, - columnsClassModel: [ - [ - { - label: '普通班型', - id: 1 - }, - { - label: 'vip班型', - id: 2 - } - ] - ], + columnsClassModel: [],//班型 columnsSubject: [ [ {label: '科目一', id: 1}, @@ -320,26 +301,41 @@ classModel: '', car: '', coach: '', + cardType: 1, + idcard: '431027199009012316', + nationality: '中国', + businessType: '',//业务类型 certificateCodeShow: '原驾驶证号xxx', - firstLicenceTime: '', - oldDriveModel: '', + driveLicence: '',//原驾驶证号 给后端的 + firstDriveDate: '',//原驾驶证初领日期 + sex: 2, + phone: '18267412456', + applyType: 1, + name: '大乔', + oldTrainType: '',//原准驾车型 subjectPass: '', subjectTreat: '', - radiovalue2: 1, - radiovalue1: 1, + photoPath: '123.png', + address: '湖南省,郴州市', + totalAmount: 0 + }, showSchool: false, - radiolist1: [ {name: '初领', id: 1}, {name: '增驾', id: 2}], + radiolist1: [ {name: '初领', id: 0}, {name: '增驾', id: 1}],//0:初领,1:增驾, radiolist2: [ {name: '是', id: 1}, {name: '否', id: 2}], radiolist3: [ {name: '全款', id: 1}, {name: '预付款', id: 2}], cityArr: [], - cityArr2: [[]] + cityArr2: [], + cityArr3: [] } }, onLoad() { + this.form.accountId = this.userId + this.form.userId = this.userId uni.$on('upDateCoachItem',(item)=>{ console.log(item) this.form.coach = item.name + this.form.coachId = item.id }) this.areaTreeFn() let schoolClass = this.$store.state.school.schoolClass @@ -359,14 +355,29 @@ this.form.schoolId = schoolCoach.schoolId // this.form.car = schoolClass.carType } + if(this.form.schoolId) { + this.schoolClassFn() + } }, methods: { + async schoolClassFn() { + const {data: res} = await schoolClass({pageNo: 1,pageSize: 100, schoolId: this.form.schoolId}) + this.columnsClassModel = [res.list] + console.log(this.columnsClassModel) + }, cityShowFn() { this.showCity = true + this.$nextTick(()=>{ + let picker = this.$refs.uPicker + picker.setColumnValues(1, this.cityArr2[0]) + picker.setColumnValues(2, this.cityArr3[0][0]) + }) + // picker = this.$refs.uPicker }, changeHandler(e) { const { + indexs, columnIndex, value, values, // values为当前变化列的数组内容 @@ -378,7 +389,18 @@ if (columnIndex === 0) { // picker为选择器this实例,变化第二列对应的选项 picker.setColumnValues(1, this.cityArr2[index]) + picker.setColumnValues(2, this.cityArr3[index][0]) + } + if (columnIndex === 1) { + let index3 = indexs[0] + // picker为选择器this实例,变化第二列对应的选项 + picker.setColumnValues(2, (this.cityArr3[index3])[index]) } + console.log(indexs[0]) + // console.log(this.cityArr3[index3]) + // console.log(value) + // console.log(values) + // console.log(columnIndex) }, // 回调参数为包含columnIndex、value、values confirmCity(e) { @@ -387,17 +409,49 @@ }, // 获取地区 async areaTreeFn() { + // this.cityArr2.push(this.traverse(item.children)) const {data: res} = await areaTree() this.cityArr = res.map(item=>{ let obj = { id: item.id, name: item.name } - this.cityArr2[0].push(this.traverse(item.children)) return obj }) - console.log(this.cityArr) - console.log(this.cityArr2) + + this.cityArr2 = res.map(item2=>{ + let arr2 = item2.children + return arr2.map(val=>{ + let obj = { + id: val.id, + name: val.name + } + return obj + }) + }) + + this.cityArr3 = res.map(item2=>{ + let arr2 = item2.children + return arr2.map(val=>{ + return val.children.map(val3=>{ + let obj = { + id: val3.id, + name: val3.name + } + return obj + }) + }) + }) + // for(let i=0; i