| | |
| | | <u-form-item prop="carNo" label="车牌号" labelWidth="20%" borderBottom v-if="radiovalue1 == '司机'" required> |
| | | <u--input v-model="registerFormModel.carNo" placeholder="请输入内容" clearable></u--input> |
| | | </u-form-item> |
| | | <u-form-item prop="carImg" label="车辆照片" labelWidth="20%" borderBottom v-if="radiovalue1 == '司机'" required> |
| | | <u-form-item prop="carImg" label="车辆照片" labelWidth="20%" borderBottom v-if="radiovalue1 == '司机'" required @click="beforeRead"> |
| | | <u-upload |
| | | :fileList="fileList1" |
| | | deletable |
| | |
| | | mode="widthFix" style="width: 250px;height: 150px;"></image> --> |
| | | </u-upload> |
| | | </u-form-item> |
| | | <u-form-item prop="drivingImg" label="行驶证" labelWidth="20%" borderBottom v-if="radiovalue1 == '司机'" required> |
| | | <u-form-item prop="drivingImg" label="行驶证" labelWidth="20%" borderBottom v-if="radiovalue1 == '司机'" required @click="beforeRead"> |
| | | <u-upload |
| | | :fileList="fileList2" |
| | | deletable |
| | |
| | | <script> |
| | | import { apiRegister } from '@/api/publicInterface.js'; |
| | | import { BaseUrl } from '@/api/publicInterface.js'; |
| | | import { mapMutations } from 'vuex'; |
| | | export default { |
| | | // onLoad: function() { |
| | | // // 查看是否授权 |
| | |
| | | message: '请填写姓名', |
| | | trigger: ['blur', 'change'] |
| | | }, |
| | | idCard: { |
| | | type: 'string', |
| | | required: true, |
| | | message: '请输入身份证号', |
| | | trigger: ['blur', 'change'] |
| | | }, |
| | | idCard: [ |
| | | { |
| | | type: 'string', |
| | | required: true, |
| | | message: '请输入身份证号', |
| | | trigger: ['blur', 'change'] |
| | | }, |
| | | { |
| | | pattern: /^([1-6][1-9]|50)\d{4}(18|19|20)\d{2}((0[1-9])|10|11|12)(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/, |
| | | message: '身份证号格式不正确' |
| | | } |
| | | ], |
| | | phone: [ |
| | | { |
| | | required: true, |
| | | message: '此为必填字段', |
| | | message: '此项为必填项', |
| | | // blur和change事件触发检验 |
| | | trigger: ['blur', 'change'] |
| | | }, |
| | |
| | | min: 11, |
| | | max: 11, |
| | | message: '请输入合法手机号' |
| | | }, |
| | | { |
| | | validator: (rule, value, callback) => { |
| | | return uni.$u.test.mobile(value); |
| | | }, |
| | | message: '手机号码不正确', |
| | | trigger: ['change', 'blur'] |
| | | } |
| | | ], |
| | | password: [ |
| | |
| | | } |
| | | }, |
| | | methods: { |
| | | ...mapMutations(['changeisUploadimg']), |
| | | registerClick() { |
| | | if (this.registerFormModel.password == this.registerFormModel.confirmPassword) { |
| | | this.$refs.regesterFormRef |
| | |
| | | uni.redirectTo({ url: '/pages/login/login' }); |
| | | }, 1000); |
| | | } else { |
| | | this.$u.toast(res.data.data ? res.data.data : '添加失败'); |
| | | this.$u.toast(res.msg ? res.msg : '添加失败'); |
| | | } |
| | | }) |
| | | .catch(err => { |
| | |
| | | }) |
| | | .catch(err => { |
| | | console.log('err', err); |
| | | uni.$u.toast('请规范输入内容'); |
| | | this.$u.toast('请规范输入内容'); |
| | | }); |
| | | } else { |
| | | this.$u.toast('两次密码不一致'); |
| | |
| | | } |
| | | }, |
| | | // 上传图片方法 |
| | | beforeRead() { |
| | | this.changeisUploadimg(true); |
| | | }, |
| | | // 删除图片 |
| | | deletePic(event) { |
| | | this.changeisUploadimg(true); |
| | | this[`fileList${event.name}`].splice(event.index, 1); |
| | | }, |
| | | // 新增图片 |