1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009 |
- <template>
- <view class="content">
- <view class="top-head"></view>
- <view class="container">
- <u-radio-group v-model="radiovalue" iconPlacement="row" class='radio-group'>
- <u-radio :customStyle="{marginBottom: '8px',marginRight:'4px'}" v-for="(item, index) in radiolist" :key="index"
- :label="item.name" :name="item.name" @change="radioChange">
- </u-radio>
- </u-radio-group>
- <view class="level1-title">证件信息</view>
- <view class="content1">
- <view class="title">上传驾驶证主页</view>
- <view @click="uploadImg(1)" class="picture picture1" v-if="!dataDetails.driverLicenseHomePage">
- <image class="xj-image" src="@/static/images/mine/ic_shanchuan@2x.png"></image>
- <view class="text">上传驾驶证主页</view>
- </view>
- <view v-if="dataDetails.driverLicenseHomePage" @click.stop="uploadImg(1)"
- class="preview-card-img picture">
- <view @click.stop="delCard(1)">
- <image class='del-card' src="@/static/images/common/quxiao@2x.png">
- </image>
- </view>
- <image class="" :src="dataDetails.driverLicenseHomePage" mode="aspectFit"></image>
- </view>
- <view class="title">上传驾驶证副页</view>
- <view @click="uploadImg(2)" class="picture picture2" v-if="!dataDetails.driverLicenseBackPage">
- <image class="xj-image" src="@/static/images/mine/ic_shanchuan@2x.png"></image>
- <view class="text">上传驾驶证副页</view>
- </view>
- <view v-if="dataDetails.driverLicenseBackPage" @click.stop="uploadImg(2)"
- class="preview-card-img picture">
- <view @click.stop="delCard(2)">
- <image class='del-card' src="@/static/images/common/quxiao@2x.png">
- </image>
- </view>
- <image class="" :src="dataDetails.driverLicenseBackPage" mode="aspectFit"></image>
- </view>
- <view class="flex row flex-space-between">
- <view class="left-text">驾驶证有效期</view>
- <!-- <view class="" @click="selectValidityPeriod(0)">
- {{dataDetails.driverLicenseValidityDate?dataDetails.driverLicenseValidityDate:'选择有效截止日期>'}}
- </view> -->
- <view style='font-size:12px;' class="" @click="selectValidityPeriod(0)">
- {{dataDetails.driverLicenseValidityStartDate?dataDetails.driverLicenseValidityStartDate:'起始时间'}}
- </view>
- <view>~</view>
- <view style='font-size:12px;' class="" @click="selectValidityPeriod(9)">
-
- {{dataDetails.driverLicenseValidityDate?dataDetails.driverLicenseValidityDate:'结束时间'}}
- </view>
- </view>
- <view class="flex row flex-space-between">
- <view class="left-text">准驾车型</view>
- <view class="" @click="driveType">
- {{dataDetails.quasiDrivingVehicle?dataDetails.quasiDrivingVehicle:'选择准驾车型>'}}
- </view>
- </view>
- <view class="flex row noborder">
- <view class="left-text">驾驶证发证机关</view>
- <u--input placeholder="请输入驾驶证发证机关" inputAlign='right' border="none" v-model="dataDetails.lssuingAuthority" >
- </u--input>
- </view>
- <!--
- <view class="title">上传行驶证主页</view>
- <view @click="uploadImg(3)" class="picture picture3" v-if="!dataDetails.drivingLicenseHomePage">
- <image class="xj-image" src="@/static/images/mine/ic_shanchuan@2x.png"></image>
- <view class="text">上传行驶证主页</view>
- </view>
- <view v-if="dataDetails.drivingLicenseHomePage" @click.stop="uploadImg(1)"
- class="preview-card-img picture">
- <view @click.stop="delCard(1)">
- <image class='del-card' src="@/static/images/common/quxiao@2x.png">
- </image>
- </view>
- <image class="" :src="dataDetails.drivingLicenseHomePage" mode="aspectFit"></image>
- </view>
- <view class="title">上传行驶证副页</view>
- <view @click="uploadImg(4)" class="picture picture4" v-if="!dataDetails.drivingLicenseBackPage">
- <image class="xj-image" src="@/static/images/mine/ic_shanchuan@2x.png"></image>
- <view class="text">上传行驶证副页</view>
- </view>
- <view v-if="dataDetails.drivingLicenseBackPage" @click.stop="uploadImg(1)"
- class="preview-card-img picture">
- <view @click.stop="delCard(1)">
- <image class='del-card' src="@/static/images/common/quxiao@2x.png">
- </image>
- </view>
- <image class="" :src="dataDetails.drivingLicenseBackPage" mode="aspectFit"></image>
- </view>
- <view class="flex row flex-space-between">
- <view class="left-text">行驶证档案编号</view>
- <u--input placeholder="输入行驶证档案编号" inputAlign='right' border="none" v-model="dataDetails.drivingLicenseNumber">
- </u--input>
- </view>
- <view class="flex row flex-space-between">
- <view class="left-text">行驶证有效期</view>
- <view class="" @click="selectValidityPeriod(1)">
- {{dataDetails.drivingLicenseValidityDate?dataDetails.drivingLicenseValidityDate:'选择有效截止日期>'}}
- </view>
- </view>
- <view class="" v-if="isGCar">
- <view class="title">挂车行驶证主页</view>
- <view @click="uploadImg(5)" class="picture picture5" v-if="!dataDetails.trailerLicenseHomePage">
- <image class="xj-image" src="@/static/images/mine/ic_shanchuan@2x.png"></image>
- <view class="text">上传挂车行驶证主页</view>
- </view>
- <view v-if="dataDetails.trailerLicenseHomePage" @click.stop="uploadImg(1)"
- class="preview-card-img picture">
- <view @click.stop="delCard(1)">
- <image class='del-card' src="@/static/images/common/quxiao@2x.png">
- </image>
- </view>
- <image class="" :src="dataDetails.trailerLicenseHomePage" mode="aspectFit"></image>
- </view>
- </view>
- <view v-if="isGCar">
- <view class="title">挂车行驶证副页</view>
- <view @click="uploadImg(6)" class="picture picture6" v-if="!dataDetails.trailerLicenseBackPage">
- <image class="xj-image" src="@/static/images/mine/ic_shanchuan@2x.png"></image>
- <view class="text">上传挂车行驶证副页</view>
- </view>
- <view v-if="dataDetails.trailerLicenseBackPage" @click.stop="uploadImg(1)"
- class="preview-card-img picture">
- <view @click.stop="delCard(1)">
- <image class='del-card' src="@/static/images/common/quxiao@2x.png">
- </image>
- </view>
- <image class="" :src="dataDetails.trailerLicenseBackPage" mode="aspectFit"></image>
- </view>
- </view>
- <view class="flex row">
- <view class="left-text">挂车行驶证档案编号</view>
- <u--input placeholder="输入挂车行驶证档案编号" inputAlign='right' border="none" v-model="dataDetails.trailerLicenseNumber">
- </u--input>
- </view>
- <view class="flex row flex-space-between" v-if="isGCar">
- <view class="left-text">挂车行驶证有效期</view>
- <view class="" @click="selectValidityPeriod(2)">
- {{dataDetails.trailerLicenseValidityDate?dataDetails.trailerLicenseValidityDate:'选择有效截止日期>'}}
- </view>
- </view>-->
- <view class="title">从业资格证</view>
- <view @click="uploadImg(7)" class="picture picture7" v-if="!dataDetails.qualificationCertificate">
- <image class="xj-image" src="@/static/images/mine/ic_shanchuan@2x.png"></image>
- <view class="text">上传从业资格证</view>
- </view>
- <view v-if="dataDetails.qualificationCertificate" @click.stop="uploadImg(7)"
- class="preview-card-img picture">
- <view @click.stop="delCard(7)">
- <image class='del-card' src="@/static/images/common/quxiao@2x.png">
- </image>
- </view>
- <image class="" :src="dataDetails.qualificationCertificate" mode="aspectFit"></image>
- </view>
- <view class="flex row flex-space-between">
- <view class="left-text">从业资格证有效期</view>
- <view></view>
- <view class="" @click="selectValidityPeriod(3)">
- {{dataDetails.qualificationCertificateValidityDate?dataDetails.qualificationCertificateValidityDate:'选择有效期>'}}
- </view>
- </view>
- <view class="flex row ">
- <view class="left-text">从业资格证号</view>
- <u--input maxlength='19' placeholder="请输入从业资格证号" inputAlign='right' border="none" v-model="dataDetails.qualificationCertificateNumber">
- </u--input>
- </view>
- <!--
- <view class="title">道路运输证</view>
- <view @click="uploadImg(8)" class="picture picture8" v-if="!dataDetails.operationCertificate">
- <image class="xj-image" src="@/static/images/mine/ic_shanchuan@2x.png"></image>
- <view class="text">上传道路运输证</view>
- </view>
- <view v-if="dataDetails.operationCertificate" @click.stop="uploadImg(1)"
- class="preview-card-img picture">
- <view @click.stop="delCard(1)">
- <image class='del-card' src="@/static/images/common/quxiao@2x.png">
- </image>
- </view>
- <image class="" :src="dataDetails.operationCertificate" mode="aspectFit"></image>
- </view>
- <view class="flex row">
- <view class="left-text">道路运输证号</view>
- <u--input placeholder="输入道路运输证号" inputAlign='right' border="none" v-model="dataDetails.operationCertificateNumber">
- </u--input>
- </view>
- <view class="flex row flex-space-between">
- <view class="left-text">道路运输证有效期</view>
- <view class="" @click="selectValidityPeriod(4)">
- {{dataDetails.operationCertificateValidityDate?dataDetails.operationCertificateValidityDate:'选择有效期>'}}
- </view>
- </view>
- <view v-if="isGCar">
- <view class="title">挂车道路运输证</view>
- <view @click="uploadImg(9)" class="picture picture9"
- v-if="!dataDetails.trailerOperationCertificate">
- <image class="xj-image" src="@/static/images/mine/ic_shanchuan@2x.png"></image>
- <view class="text">上传挂车道路运输证</view>
- </view>
- <view v-if="dataDetails.trailerOperationCertificate" @click.stop="uploadImg(1)"
- class="preview-card-img picture">
- <view @click.stop="delCard(1)">
- <image class='del-card' src="@/static/images/common/quxiao@2x.png">
- </image>
- </view>
- <image class="" :src="dataDetails.trailerOperationCertificate" mode="aspectFit"></image>
- </view>
- </view>
- <view class="flex row">
- <view class="left-text">挂车道路运输证号</view>
- <u--input placeholder="输入挂车道路运输证号" inputAlign='right' border="none" v-model="dataDetails.trailerOperationCertificateNumber">
- </u--input>
- </view>
- <view class="flex row flex-space-between" v-if="isGCar">
- <view class="left-text">挂车道路运输证有效期</view>
- <view class="" @click="selectValidityPeriod(5)">
- {{dataDetails.trailerOperationCertificateValidityDate?dataDetails.trailerOperationCertificateValidityDate:'选择有效期>'}}
- </view>
- </view>
-
- -->
- <view class="flex row noborder">
- <view class="left-text">通讯地址</view>
- <u--textarea v-model="dataDetails.postalAddress" border="none" placeholder="输入通讯地址" autoHeight maxlength="30"></u--textarea>
- <!-- <u--input placeholder="输入通讯地址" inputAlign='right' border="none" v-model="dataDetails.postalAddress"></u--input> -->
- </view>
- </view>
-
- <view class="flex service align-center">
- <u--image @click='consent'
- :src="consentStatus==true?'../../static/images/mine/duihao@2x.png':'../../static/images/mine/wxz.png'"
- width="12px" height="12px"></u--image>
- 我已阅读并同意
- <navigator
- url="/pages/sale/webview?can_share=false&url=https://liangxin.zthymaoyi.com/userAgreement.html"
- class="path" hover-class="navigator-hover">《服务协议》</navigator>和<navigator
- url="/pages/sale/webview?can_share=false&url=https://liangxin.zthymaoyi.com/screctAgreement.html"
- class="path" hover-class="navigator-hover">《隐私政策》</navigator>
- </view>
- <u-button type="primary" @click="btnBClick">提交</u-button>
- <u-toast ref="uToast"></u-toast>
- <u-action-sheet :actions="$helper.imgTypeList" :title="$helper.imgType" :show="isShowimgType"
- @select="imgTypeSelect" :closeOnClickOverlay="true" :closeOnClickAction="true"
- @close="isShowimgType=false">
- </u-action-sheet>
- <u-picker :show="isShowValidity" ref="uPicker" :columns="validityPeriod" @confirm="confirmValidityPeriod"
- :closeOnClickOverlay='true' @close='isShowValidity=false' @cancel='isShowValidity=false'>
- </u-picker>
- <u-picker :show="isShowDrive" ref="uPicker" :columns="driveList" @confirm="confirmDriveType"
- :closeOnClickOverlay='true' @close='isShowDrive=false' @cancel='isShowDrive=false'>
- </u-picker>
- </view>
- </view>
- </template>
- <script>
- import uploadImage from '@/components/ossutil/uploadFile.js';
- import permision from "@/js_sdk/wa-permission/permission.js"
- var _this;
- export default {
- components: {},
- data() {
- return {
- consentStatus: false,
- isGCar: true,
- ValidityPeriodType: '',
- validityPeriod: [],
- isShowValidity: false,
- isShowDrive:false,
- driveList:[["A2","B2"]],
- uploadType: '',
- isShowimgType: false,
- dataDetails: {},
- radiolist: [{
- name: '挂车司机',
- disabled: false
- },
- {
- name: '非挂车司机',
- disabled: false
- }
- ],
- // u-radio-group的v-model绑定的值如果设置为某个radio的name,就会被默认选中
- radiovalue: '挂车司机',
- };
- },
- onLoad(options) {
- _this = this;
- console.log(options)
- this.get_camera_permission()
- if(options.data){
- this.dataDetails = JSON.parse(options.data)
- this.dataDetails.driverType = 1
- }
- this.validityPeriod = this.$helper.makeValidityPeriod('kong',1980)
- this.validityPeriod1 = this.$helper.makeValidityPeriod(0,1980)
- console.log(this.validityPeriod)
- },
- methods: {
- async get_camera_permission() {
- var photol=await permision.requestAndroidPermission("android.permission.CAMERA")
- if(photol == false){
- uni.showModal({
- title: '提示',
- content: '您已经关闭相册权限,去设置',
- success: function (res) {
- if (res.confirm) {
- permision.gotoAppPermissionSetting()
- // plus.runtime.openURL("app-settings:");
- } else if (res.cancel) {
- console.log('用户点击取消');
- }
- }
- });
- }
- },
- delCard(type) {
- switch (type) {
- case 1:
- _this.dataDetails.driverLicenseHomePage = ""
- break;
- case 2:
- _this.dataDetails.driverLicenseBackPage = ""
- break;
- case 3:
- _this.dataDetails.drivingLicenseHomePage = ""
- break;
- case 4:
- _this.dataDetails.drivingLicenseBackPage = ""
- break;
- case 5:
- _this.dataDetails.trailerLicenseHomePage = ""
- break;
- case 6:
- _this.dataDetails.trailerLicenseBackPage = ""
- break;
- case 7:
- _this.dataDetails.qualificationCertificate = ""
- break;
- case 8:
- _this.dataDetails.operationCertificate = ""
- break;
- case 9:
- _this.dataDetails.trailerOperationCertificate = ""
- break;
- }
- },
- consent() {
- this.consentStatus = !this.consentStatus
- // uni.setStorage({
- // key: 'policyStorageKey',
- // data: this.consentStatus
- // });
- },
- validate(data) {},
- confirmValidityPeriod(e) {
- console.log('confirm', e)
- if(e.value[0]=='长期'){
- if (e.value[1] || e.value[2]) {
- this.$refs.uToast.show({
- type: 'error',
- message: "选择长期不允许选择月日!",
- })
- return
- }
- switch (this.ValidityPeriodType) {
- case 0:
- this.dataDetails.driverLicenseValidityStartDate = e.value[0]
- break
- case 1:
- this.dataDetails.drivingLicenseValidityDate = e.value[0]
- break
- case 2:
- this.dataDetails.trailerLicenseValidityDate = e.value[0]
- break
- case 3:
- this.dataDetails.qualificationCertificateValidityDate = e.value[0]
- break
- case 4:
- this.dataDetails.operationCertificateValidityDate = e.value[0]
- break
- case 5:
- this.dataDetails.trailerOperationCertificateValidityDate = e.value[0]
- break
- case 9:
- this.dataDetails.driverLicenseValidityDate = e.value[0]
- break
- }
- }else{
- if(e.value[0]==''){
- this.$refs.uToast.show({
- type: 'error',
- message: "年份不能为空!",
- })
- return
- }else if(e.value[1]==''){
- this.$refs.uToast.show({
- type: 'error',
- message: "月份不能为空!",
- })
- return
- }else if(e.value[2]==''){
- this.$refs.uToast.show({
- type: 'error',
- message: "日期不能为空!",
- })
- return
- }
- var date=new Date()
- var text=''
- switch (this.ValidityPeriodType) {
- case 3:
- text='从业资格证已过期!'
- break
- case 9:
- text='驾驶证已过期!'
- break
- }
- if(this.ValidityPeriodType==3||this.ValidityPeriodType==9){
- if(e.value[0]<date.getFullYear()){
- this.$refs.uToast.show({
- type: 'error',
- message: text,
- })
- return
- }
- if(e.value[0]==date.getFullYear()&&Number(e.value[1])<(date.getMonth()+1)){
- this.$refs.uToast.show({
- type: 'error',
- message: text,
- })
- return
- }
- if(e.value[0]==date.getFullYear()&&Number(e.value[1])==(date.getMonth()+1)&&Number(e.value[2])<=(date.getDate())){
- this.$refs.uToast.show({
- type: 'error',
- message: text,
- })
- return
- }
- }
- switch (this.ValidityPeriodType) {
- case 0:
- this.dataDetails.driverLicenseValidityStartDate = e.value[0] + '-' + e.value[1] + '-' + e.value[2]
- break
- case 1:
- this.dataDetails.drivingLicenseValidityDate = e.value[0] + '-' + e.value[1] + '-' + e.value[2]
- break
- case 2:
- this.dataDetails.trailerLicenseValidityDate = e.value[0] + '-' + e.value[1] + '-' + e.value[2]
- break
- case 3:
- this.dataDetails.qualificationCertificateValidityDate = e.value[0] + '-' + e.value[1] + '-' + e
- .value[2]
- break
- case 4:
- this.dataDetails.operationCertificateValidityDate = e.value[0] + '-' + e.value[1] + '-' + e.value[
- 2]
- break
- case 5:
- this.dataDetails.trailerOperationCertificateValidityDate = e.value[0] + '-' + e.value[1] + '-' + e
- .value[2]
- break
- case 9:
- this.dataDetails.driverLicenseValidityDate = e.value[0] + '-' + e.value[1] + '-' + e
- .value[2]
- break
- }
- }
- this.isShowValidity = false
- },
- selectValidityPeriod(type) {
-
- this.ValidityPeriodType = type
- this.isShowValidity = true
- },
- driveType(){
- this.isShowDrive = true
- },
- confirmDriveType(e){
- this.dataDetails.quasiDrivingVehicle = e.value[0]
- this.isShowDrive = false
- },
- // 上传图片
- imgTypeSelect(val) {
- // console.log(val)
- console.log(this.uploadType)
- // if (val.name == '相册') {
- uni.chooseImage({
- count: 1,
- // sourceType: this.$helper.chooseImage.sourceType,
- success: function(res) {
- console.log(JSON.stringify(res.tempFilePaths));
- uploadImage("images",res.tempFilePaths[0], 'appData/',
- result => {
- // 上传成功回调函数
- console.log('图片地址-----', result)
- switch (_this.uploadType) {
- case 1:
- _this.dataDetails.driverLicenseHomePage = result
- _this.$request.baseRequest('get',
- '/driverInfo/api/driverLicenseShibie', {
- image: result
- }).then(res => {
- if (res.data) {
- let date = res.data.driverEndDate.substr(0,4)+"-"+res.data.driverEndDate.substr(4,2)+"-"+res.data.driverEndDate.substr(6,2)
- _this.dataDetails.driverLicenseValidityDate = date
- if(res.data.allowCar == 'A2' || res.data.allowCar == 'B2'){
- _this.dataDetails.quasiDrivingVehicle = res.data.allowCar
- }
- _this.dataDetails.lssuingAuthority = res.data.issuingAuthority
- _this.$forceUpdate()
- }
- })
- .catch(res => {
- uni.$u.toast(res.message);
- });
- break;
- case 2:
- _this.dataDetails.driverLicenseBackPage = result
- break;
- case 3:
- _this.dataDetails.drivingLicenseHomePage = result
- break;
- case 4:
- _this.dataDetails.drivingLicenseBackPage = result
- break;
- case 5:
- _this.dataDetails.trailerLicenseHomePage = result
- break;
- case 6:
- _this.dataDetails.trailerLicenseBackPage = result
- break;
- case 7:
- _this.dataDetails.qualificationCertificate = result
- _this.$request.baseRequest('get',
- '/driverInfo/api/qualificationLicenseShibie', {
- image: result
- }).then(res => {
- if (res.data&&res.data.qualificationCertificate) {
- _this.dataDetails.qualificationCertificateValidityDate = res.data.qualificationCertificate
- // _this.dataDetails.driverLicenseValidityDate =
- // res.data.driverEndDate
- }
- if(res.data&&res.data.qualificationCertificateNum){
- _this.dataDetails.qualificationCertificateNumber = res.data.qualificationCertificateNum
- }
- _this.$forceUpdate()
- })
- .catch(res => {
- uni.$u.toast(res.message);
- });
- break;
- case 8:
- _this.dataDetails.operationCertificate = result
- break;
- case 9:
- _this.dataDetails.trailerOperationCertificate = result
- break;
- }
- _this.$forceUpdate()
- }
- )
- }
- });
- // } else {
- // }
- },
- uploadImg(type) {
- this.uploadType = type
- this.imgTypeSelect()
- // this.isShowimgType = true
- },
- validate() {
- // true 为校验不通过
- if (uni.$u.test.isEmpty(this.dataDetails.driverLicenseHomePage)) {
- this.$refs.uToast.show({
- type: 'error',
- message: "驾驶证主页不能为空!",
- })
- return true
- }
- if (uni.$u.test.isEmpty(this.dataDetails.driverLicenseHomePage)) {
- this.$refs.uToast.show({
- type: 'error',
- message: "驾驶证副页不能为空!",
- })
- return true
- }
- if (uni.$u.test.isEmpty(this.dataDetails.driverLicenseValidityDate)) {
- this.$refs.uToast.show({
- type: 'error',
- message: "驾驶证有效期不能为空!",
- })
- return true
- }
- if (uni.$u.test.isEmpty(this.dataDetails.quasiDrivingVehicle)) {
- this.$refs.uToast.show({
- type: 'error',
- message: "准驾车型不能为空!",
- })
- return true
- }
- if (uni.$u.test.isEmpty(this.dataDetails.lssuingAuthority)) {
- this.$refs.uToast.show({
- type: 'error',
- message: "驾驶证发证机关不能为空!",
- })
- return true
- }
- // if (uni.$u.test.isEmpty(this.dataDetails.drivingLicenseHomePage)) {
- // this.$refs.uToast.show({
- // type: 'error',
- // message: "行驶证主页不能为空!",
- // })
- // return true
- // }
- // if (uni.$u.test.isEmpty(this.dataDetails.drivingLicenseBackPage)) {
- // this.$refs.uToast.show({
- // type: 'error',
- // message: "行驶证副页不能为空!",
- // })
- // return true
- // }
- // if (uni.$u.test.isEmpty(this.dataDetails.drivingLicenseValidityDate)) {
- // this.$refs.uToast.show({
- // type: 'error',
- // message: "行驶证有效期不能为空!",
- // })
- // return true
- // }
- // if (uni.$u.test.isEmpty(this.dataDetails.drivingLicenseNumber)) {
- // this.$refs.uToast.show({
- // type: 'error',
- // message: "行驶证档案编号不能为空!",
- // })
- // return true
- // }
- // if(this.radiovalue=='挂车司机'){
- // if (uni.$u.test.isEmpty(this.dataDetails.trailerLicenseHomePage)) {
- // this.$refs.uToast.show({
- // type: 'error',
- // message: "挂车行驶证主页不能为空!",
- // })
- // return true
- // }
- // if (uni.$u.test.isEmpty(this.dataDetails.trailerLicenseBackPage)) {
- // this.$refs.uToast.show({
- // type: 'error',
- // message: "挂车行驶证副页不能为空!",
- // })
- // return true
- // }
- // if (uni.$u.test.isEmpty(this.dataDetails.trailerLicenseNumber)) {
- // this.$refs.uToast.show({
- // type: 'error',
- // message: "挂车行驶证档案编号不能为空!",
- // })
- // return true
- // }
- // if (uni.$u.test.isEmpty(this.dataDetails.trailerLicenseValidityDate)) {
- // this.$refs.uToast.show({
- // type: 'error',
- // message: "挂车行驶证有效期不能为空!",
- // })
- // return true
- // }
- // }
-
- // if (uni.$u.test.isEmpty(this.dataDetails.trailerLicenseBackPage)) {
- // this.$refs.uToast.show({
- // type: 'error',
- // message: "行驶证副页不能为空!",
- // })
- // return true
- // }
-
- if (uni.$u.test.isEmpty(this.dataDetails.qualificationCertificate)) {
- this.$refs.uToast.show({
- type: 'error',
- message: "从业资格证不能为空!",
- })
- return true
- }
- if (uni.$u.test.isEmpty(this.dataDetails.qualificationCertificateValidityDate)) {
- this.$refs.uToast.show({
- type: 'error',
- message: "从业资格证有效期不能为空!",
- })
- return true
- }
-
- if (uni.$u.test.isEmpty(this.dataDetails.qualificationCertificateNumber)) {
- this.$refs.uToast.show({
- type: 'error',
- message: "从业资格证号不能为空!",
- })
- return true
- }
- // if (!uni.$u.test.rangeLength(this.dataDetails.qualificationCertificateNumber,[12,19])) {
- // this.$refs.uToast.show({
- // type: 'error',
- // message: "从业资格证号输入错误!",
- // })
- // return true
- // }
- if (this.dataDetails.qualificationCertificateNumber.length!=19) {
- this.$refs.uToast.show({
- type: 'error',
- message: "从业资格证号输入错误!",
- })
- return true
- }
- // if (uni.$u.test.isEmpty(this.dataDetails.operationCertificate)) {
- // this.$refs.uToast.show({
- // type: 'error',
- // message: "道路运输证不能为空!",
- // })
- // return true
- // }
- // if (uni.$u.test.isEmpty(this.dataDetails.operationCertificateNumber)) {
- // this.$refs.uToast.show({
- // type: 'error',
- // message: "道路运输证号不能为空!",
- // })
- // return true
- // }
- // if (uni.$u.test.isEmpty(this.dataDetails.operationCertificateValidityDate)) {
- // this.$refs.uToast.show({
- // type: 'error',
- // message: "道路运输证有效期不能为空!",
- // })
- // return true
- // }
- // if(this.radiovalue=='挂车司机'){
- // if (uni.$u.test.isEmpty(this.dataDetails.trailerOperationCertificate)) {
- // this.$refs.uToast.show({
- // type: 'error',
- // message: "挂车道路运输证不能为空!",
- // })
- // return true
- // }
- // if (uni.$u.test.isEmpty(this.dataDetails.trailerOperationCertificateNumber)) {
- // this.$refs.uToast.show({
- // type: 'error',
- // message: "挂车道路运输证号不能为空!",
- // })
- // return true
- // }
- // if (uni.$u.test.isEmpty(this.dataDetails.trailerOperationCertificateValidityDate)) {
- // this.$refs.uToast.show({
- // type: 'error',
- // message: "挂车道路运输证有效期不能为空!",
- // })
- // return true
- // }
- // }
- if (uni.$u.test.isEmpty(this.dataDetails.postalAddress)) {
- this.$refs.uToast.show({
- type: 'error',
- message: "通讯地址不能为空!",
- })
- return true
- }
- return false
- },
- btnBClick() {
- // 此处用法为在js中调用,需要写uni.$u.throttle()
- uni.$u.throttle(this.submit(), 5000)
- },
- submit() {
-
- // 校验
- if (this.validate()) return
- // if(this.dataDetails.driverSex=='男'){
- // this.dataDetails.driverCall = this.dataDetails.driverCall+'先生'
- // }else{
- // this.dataDetails.driverCall = this.dataDetails.driverCall+'女士'
- // }
- if(!this.consentStatus){
- this.$refs.uToast.show({
- type: 'error',
- message: "请勾选协议!",
- })
- return
- }
- //账号传
- this.dataDetails.accountNumber = uni.getStorageSync("userInfo").phone
- uni.showLoading({
- mask: true,
- title: '加载中'
- })
- this.$request.baseRequest('post', '/driverInfo/api/addInfo', this.dataDetails).then(res => {
- if(res.code==200){
- uni.hideLoading()
- this.$refs.uToast.show({
- type: 'success',
- message: "提交成功,待平台审核!",
- complete() {
- uni.switchTab({
- url: '/pages/mine/index'
- })
- }
- })
- // uni.$u.route('/pages/mine/index');
- }else{
- uni.hideLoading()
- uni.$u.toast(res.message);
- }
- })
- .catch(res => {
- uni.hideLoading()
- uni.$u.toast(res.message);
- });
- },
- radioChange(n) {
- if (n == '挂车司机') {
- this.isGCar = true
- this.dataDetails.driverType = 1
- } else {
- this.dataDetails.driverType = 2
- this.isGCar = false
- }
- },
- //设置图片
- setImage(e) {
- console.log(e);
- //显示在页面
- //this.imagesrc = e.path;
- // if (e.dotype == 'idphoto') {
- // _this.zjzClipper(e.path);
- // } else if (e.dotype == 'watermark') {
- // _this.watermark(e.path);
- // } else {
- // _this.savePhoto(e.path);
- // }
- },
- }
- };
- </script>
- <style scoped lang="scss">
- .u-radio {
- margin-bottom: 0px !important;
- }
- .row4-img {
- width: 32rpx;
- height: 32rpx;
- }
- .preview {
- width: 100%;
- height: 100px;
- }
- .top-head {
- background: #2772FB;
- height: 80rpx;
- width: 100%;
- }
- .container {
- background: white;
- position: relative;
- top: -60rpx;
- margin: 0 20rpx;
- padding: 20rpx;
- box-sizing: border-box;
- border-radius: 10rpx;
- }
- .radio-group {
- display: flex;
- align-items: center;
-
- }
- .level1-title {
- margin: 20rpx 0;
- border-bottom: 1px solid #EEEEEE;
- padding-bottom: 30rpx;
- }
- .content1 {
- .row {
- border-bottom: 1px solid #EEEEEE;
- padding-bottom: 28rpx;
- margin-top: 26rpx;
- }
- .left-text {
- // background: red;
- width: 320rpx;
- color: #333333;
- display: flex;
- align-items: center;
- }
- .picture {
- position: relative;
- width: 100%;
- height: 440rpx;
- display: flex;
- justify-content: center;
- flex-direction: column;
- align-items: center;
- .text {
- margin-top: 20rpx;
- }
- }
- .picture1 {
- background: url(../../static/images/mine/jzz.png);
- background-size: 100% 100%;
- }
- .picture2 {
- background: url(../../static/images/mine/jzf.png);
- background-size: 100% 100%;
- }
- .picture3 {
- background: url(../../static/images/mine/xsz.png);
- background-size: 100% 100%;
- }
- .picture4 {
- background: url(../../static/images/mine/xsf.png);
- background-size: 100% 100%;
- }
- .picture5 {
- background: url(../../static/images/mine/gcxsz.png);
- background-size: 100% 100%;
- }
- .picture6 {
- background: url(../../static/images/mine/gcxsf.png);
- background-size: 100% 100%;
- }
- .picture7 {
- background: url(../../static/images/mine/cy.png);
- background-size: 100% 100%;
- }
- .picture8 {
- background: url(../../static/images/mine/cy.png);
- background-size: 100% 100%;
- }
- .picture9 {
- background: url(../../static/images/mine/cy.png);
- background-size: 100% 100%;
- }
- .xj-image {
- width: 100rpx;
- height: 100rpx;
- }
- .title {
- color: #999999;
- margin: 20rpx 0;
- }
- }
- .service {
- font-size: 24rpx;
- margin: 20rpx;
- justify-content: center;
- /deep/.u-image {
- margin: 0 20rpx;
- }
- }
- .del-card {
- position: absolute;
- top: -10rpx;
- right: -6rpx;
- width: 80rpx;
- height: 80rpx;
- z-index: 9;
- }
- .path{
- color: #2772FB;
- }
- /deep/.u-textarea{
- padding:9px 0;
- }
- /deep/.u-textarea__field{
- color:#000;
- text-align:right;
- }
- </style>
|