123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224 |
- <template>
- <view class="page">
- <view class="banner mb-3">
- <image src="/static/image/car-insure/carban.png" mode=""></image>
- </view>
- <view class="carinfo">
- <view class="title dis a-c j-s mb-3">
- <text>车辆信息</text>
- <view class="rounded dis a-c j-c">
- <view class="left dis a-c j-c" :class="insuranceType==1? 'active':''" @click="insuranceType=1">
- <text>车牌号</text>
- </view>
- <view class="center"></view>
- <view class="right dis a-c j-c" :class="insuranceType==2? 'active':''" @click="insuranceType=2">
- <text>行驶证</text>
- </view>
- </view>
- </view>
- <view class="carinput" v-show="insuranceType==1">
- <view class="top dis a-c j-s mb-3">
- <text>车牌号码</text>
- <u-switch v-model="checked" active-color="#0052FF" inactive-color="#eee" size='30'
- @change="switchChange"></u-switch>
- </view>
- <view class="btn dis a-c j-s">
- <view class="so-plate-word dis a-c j-c" data-index="0" :class="currentInputIndex==0?'actives':''"
- @tap="inputSwitch">
- <text>{{LicenseInputValue[0]}}</text>
- </view>
- <view class="so-plate-word dis a-c j-c" data-index="1" :class="currentInputIndex==1?'actives':''"
- @tap="inputSwitch">
- <text>{{LicenseInputValue[1]}}</text>
- </view>
- <view class="so-plate-dot"></view>
- <view class="so-plate-word dis a-c j-c" data-index="2" :class="currentInputIndex==2?'actives':''"
- @tap="inputSwitch">
- <text>{{LicenseInputValue[2]}}</text>
- </view>
- <view class="so-plate-word dis a-c j-c" data-index="3" :class="currentInputIndex==3?'actives':''"
- @tap="inputSwitch">
- <text>{{LicenseInputValue[3]}}</text>
- </view>
- <view class="so-plate-word dis a-c j-c" data-index="4" :class="currentInputIndex==4?'actives':''"
- @tap="inputSwitch">
- <text>{{LicenseInputValue[4]}}</text>
- </view>
- <view class="so-plate-word dis a-c j-c" data-index="5" :class="currentInputIndex==5?'actives':''"
- @tap="inputSwitch">
- <text>{{LicenseInputValue[5]}}</text>
- </view>
- <view class="so-plate-word dis a-c j-c" data-index="6" :class="currentInputIndex==6?'actives':''"
- @tap="inputSwitch">
- <text>{{LicenseInputValue[6]}}</text>
- </view>
- <view class="so-plate-word dis a-c j-c" data-index="7" :class="currentInputIndex==7?'newactives':''"
- @tap="inputSwitch">
- <text v-if="LicenseInputValue[7]">{{LicenseInputValue[7]}}</text>
- <view v-else class="newEnergy dis f-c a-c j-c">
- <image src="/static/image/car-insure/leaf.png" mode="">
- </image>
- <text>新能源</text>
- </view>
- </view>
- </view>
- </view>
- <view v-show="insuranceType==2" class="OCRcar">
- <view class="title dis j-s a-c">
- <view class="dis a-c">
- <text>行驶证识别</text>
- <view class="switch-container ml-2" @tap="toggleSwitch" v-if="carbackImg">
- <view class="switch-track">
- <view class="switch-thumb dis a-c j-c" :class="{ thumbactive: !isActive }"></view>
- <view class="switch-thumb1 dis a-c j-c" :class="{ thumbactive1: isActive }">主</view>
- <view class="switch-thumb2 dis a-c j-c" :class="{ thumbactive1: !isActive }">副</view>
- </view>
- </view>
- </view>
- <text @click="carSwitching=!carSwitching">{{carSwitching?'手动输入':'拍照识别'}}</text>
- </view>
- <view v-show="carSwitching" class="ocr mt-2">
- <image v-if="!carfrontImg" @tap="ocrIdentify" src="/static/image/car-insure/carbg.png" mode=""
- style="width: 100%;height: 198px;">
- </image>
- <template v-else>
- <view v-if=" carfrontImg" class="movable-view dis f-c a-c">
- <movable-area>
- <movable-view direction="all" :out-of-bounds="true" :scale="true" :damping="30"
- :friction="10">
- <image v-if="isActive" :src="carfrontImg" mode="widthFix"
- :style="{width:'100%',height:'100%',transform:`rotate(-${cardeg}deg)`}">
- </image>
- <image v-else :src="carbackImg" mode="widthFix"
- :style="{width:'100%',height:'100%',transform:`rotate(-${cardeg}deg)`}">
- </image>
- </movable-view>
- </movable-area>
- <view class="operate-img dis j-s a-c">
- <view class="dis a-c" @tap="rotatefront('cardeg')">
- <image src="/static/image/car-insure/rotate1.png" mode=""></image>
- 左转
- </view>
- <view class="dis a-c" @tap="ocrIdentify('carInfo')">
- <image src="/static/image/car-insure/upload.png" mode=""></image>
- 上传
- </view>
- <view class="dis a-c" @tap="rotateback('cardeg')">
- <image src="/static/image/car-insure/rotate2.png" mode=""></image>
- 右转
- </view>
- </view>
- </view>
- <view class="">
- <uni-forms :rules="carRules" :value="carInfo" ref="carForm" validate-trigger="bind"
- err-show-type="toast" label-width="100" style="padding: 0 15px;">
- <uni-forms-item label="车牌号: ">
- <input class="uni-input-input textColor" placeholder="输入车牌号"
- v-model="carInfo.licenseNo" placeholder-style="font-size:28upx"
- @input="upperCaseType('licenseNo')" />
- </uni-forms-item>
- <uni-forms-item name="frameNo" required label="车辆识别码:">
- <view class="d-flex a-center" style="height: 100%;">
- <input class="uni-input-input flex-1 textColor" placeholder="请输入车辆识别码"
- v-model="carInfo.frameNo" maxlength="17" placeholder-style="font-size:28upx"
- @input="upperCaseType('frameNo')" />
- <image src="/static/image/car-insure/search.png" mode=""
- style="width: 20px;height: 20px;" @tap="toChooseVin(carInfo.frameNo)">
- </image>
- </view>
- </uni-forms-item>
- <uni-forms-item name="modelcname" required label="品牌型号: ">
- <view class="d-flex a-center textColor" style="height: 100%;">
- <input class="uni-input-input flex-1 textColor" placeholder="请输入品牌型号"
- v-model="carInfo.modelcname"
- @blur="binddata('modelcname', $event.detail.value,'carForm')"
- placeholder-style="font-size:28upx" @input="upperCaseType('modelcname')" />
- <image src="/static/image/car-insure/search.png" mode=""
- style="width: 20px;height: 20px;"
- @tap="toChooseVehicleType(carInfo.modelcname)">
- </image>
- </view>
- </uni-forms-item>
- <uni-forms-item name="engineNo" required label="发动机号: ">
- <input class="uni-input-input textColor" placeholder="请输入发动机号"
- v-model="carInfo.engineNo"
- @blur="binddata('engineNo', $event.detail.value,'carForm')"
- placeholder-style="font-size:28upx" @input="upperCaseType('engineNo')" />
- </uni-forms-item>
- <uni-forms-item required label="注册日期" name="registerDate">
- <u-input type="select" :custom-style="{textAlign:'right'}"
- :select-open="registerDateShow" v-model="carInfo.registerDate"
- placeholder="请选择注册日期" @click="registerDateShow = true"
- placeholder-style="color:#808080"></u-input>
- <u-picker v-model="registerDateShow" mode="time" :params="params"
- :end-year="endYear" :end-month="endMonth"
- @confirm="e=> Dateconfirm(e,'carInfo','registerDate')"></u-picker>
- </uni-forms-item>
- <uni-forms-item required label="发证日期" name="issueDate">
- <u-input type="select" :custom-style="{textAlign:'right'}"
- :select-open="issueDateShow" v-model="carInfo.issueDate" placeholder="请选择发证日期"
- @click="issueDateShow = true" placeholder-style="color:#808080"></u-input>
- <u-picker v-model="issueDateShow" mode="time" :params="params"
- @confirm="e=> Dateconfirm(e,'carInfo','issueDate')"></u-picker>
- </uni-forms-item>
- <uni-forms-item label="整备质量: " required name="completeKerbMass">
- <input class="uni-input-input textColor" placeholder="请输入整备质量"
- v-model="carInfo.completeKerbMass" placeholder-style="font-size:28upx" />
- </uni-forms-item>
- <uni-forms-item label="核定载质量: ">
- <input class="uni-input-input textColor" placeholder="请输入核定载质量"
- v-model="carInfo.limitLoad" placeholder-style="font-size:28upx" />
- </uni-forms-item>
- <uni-forms-item label="使用性质: " required name="carnature">
- <u-input v-model="carInfo1.carnature" type="select" :select-open="carnatureShow"
- @click="carnatureShow = true" :custom-style="{textAlign:'right'}"
- placeholder-style="color:#808080" placeholder="请选择使用性质" />
- <u-select mode="single-column" :list="natureOfVehicleUseoptions"
- v-model="carnatureShow" label-name="dictTag" value-name="dictValue"
- @confirm="dictionaryConfirm($event,'carnature')"></u-select>
- </uni-forms-item>
- <uni-forms-item label="能源种类: " required name="energyType">
- <u-input v-model="carInfo1.energyType" type="select" :select-open="energyTypeShow"
- @click="energyTypeShow = true" :custom-style="{textAlign:'right'}"
- placeholder-style="color:#808080" placeholder="请选择能源种类" />
- <u-select mode="single-column" :list="energyTypeoptions" v-model="energyTypeShow"
- label-name="dictTag" value-name="dictValue"
- @confirm="dictionaryConfirm($event,'energyType')"></u-select>
- </uni-forms-item>
- <uni-forms-item label="车辆用途: " required name="vehicleUse">
- <u-input v-model="carInfo1.vehicleUse" type="select" :select-open="vehicleUseShow"
- @click="vehicleUseShow = true" :custom-style="{textAlign:'right'}"
- placeholder-style="color:#808080" placeholder="请选择车辆用途" />
- <u-select v-if="carInfo.carnature=='01'" mode="single-column"
- :list="businessVehicleUseoptions" v-model="vehicleUseShow" label-name="dictTag"
- value-name="dictValue"
- @confirm="dictionaryConfirm($event,'vehicleUse')"></u-select>
- <u-select v-else mode="single-column" :list="outOfBusinessVehicleUseoptions"
- v-model="vehicleUseShow" label-name="dictTag" value-name="dictValue"
- @confirm="dictionaryConfirm($event,'vehicleUse')"></u-select>
- </uni-forms-item>
- <uni-forms-item label="车辆类型: " required name="cartype">
- <u-input v-model="carInfo1.cartype" type="select" :select-open="cartypeShow"
- @click="cartypeShow = true" :custom-style="{textAlign:'right'}"
- placeholder-style="color:#808080" placeholder="请选择车辆类型" />
- <u-select mode="single-column" :searchShow="true"
- :list="trafficManagementVehicleTypeoptions" v-model="cartypeShow"
- label-name="dictTag" value-name="dictValue"
- @confirm="dictionaryConfirm($event,'cartype')"></u-select>
- </uni-forms-item>
- <uni-forms-item label="车辆种类: " required name="cimodelclass">
- <u-input v-model="carInfo1.cimodelclass" type="select"
- :select-open="cimodelclassShow" @click="cimodelclassShow = true"
- :custom-style="{textAlign:'right'}" placeholder-style="color:#808080"
- placeholder="请选择车辆种类" />
- <u-select mode="single-column" :list="vehicleTypeoptions" v-model="cimodelclassShow"
- label-name="dictTag" value-name="dictValue"
- @confirm="dictionaryConfirm($event,'cimodelclass')"></u-select>
- </uni-forms-item>
- <uni-forms-item label="年款: ">
- <input class="uni-input-input textColor" placeholder="请输入年款"
- v-model="carInfo.caryear" placeholder-style="font-size:28upx" />
- </uni-forms-item>
- <uni-forms-item label="座位数: ">
- <input class="uni-input-input textColor" placeholder="请输入座位数"
- v-model="carInfo.seatCount" maxlength="1" placeholder-style="font-size:28upx" />
- </uni-forms-item>
- <uni-forms-item label="排量: ">
- <input class="uni-input-input textColor" placeholder="请输入排量"
- v-model="carInfo.enginedesc" placeholder-style="font-size:28upx" />
- </uni-forms-item>
- <uni-forms-item label="功率: ">
- <input class="uni-input-input textColor" placeholder="请输入功率"
- v-model="carInfo.powerScale" placeholder-style="font-size:28upx" />
- </uni-forms-item>
- <uni-forms-item label="新车购置价: " required name="purchasePrice">
- <input class="uni-input-input textColor" placeholder="请输入新车购置价"
- v-model="carInfo.purchasePrice" placeholder-style="font-size:28upx"
- @blur="binddata('purchasePrice', $event.detail.value,'carForm')"
- @input="upperCaseType('purchasePrice')" />
- </uni-forms-item>
- <uni-forms-item label="是否过户: ">
- <view class="d-flex j-end a-c" style="height:100%">
- <u-switch v-model="carInfo.transferFlag" active-color="#0052FF " size="30"
- @change="transferFlagchange"></u-switch>
- </view>
- </uni-forms-item>
- <uni-forms-item v-if="carInfo.transferFlag" required label="转移登记日期" name="transferDate">
- <u-input type="select" :select-open="transferDateShow"
- :custom-style="{textAlign:'right'}" v-model="carInfo.transferDate"
- placeholder="请选择过户日期" @click="transferDateShow = true"
- placeholder-style="color:#808080"></u-input>
- <u-picker v-model="transferDateShow" mode="time" :params="params"
- :end-year="endYear" :end-month="endMonth"
- @confirm="e=> Dateconfirm(e,'carInfo','transferDate')"></u-picker>
- </uni-forms-item>
- </uni-forms>
- </view>
- </template>
- </view>
- <view v-show="!carSwitching" class="content mt-2">
- <uni-forms :rules="carRules" :value="carInfo" ref="carForm" validate-trigger="bind"
- style="padding: 0 15px;" err-show-type="toast" label-width="100">
- <uni-forms-item label="车牌号: ">
- <input class="uni-input-input textColor" placeholder="输入车牌号" v-model="carInfo.licenseNo"
- placeholder-style="font-size:28upx" @input="upperCaseType('licenseNo')" />
- </uni-forms-item>
- <uni-forms-item name="frameNo" required label="车辆识别码:">
- <view class="d-flex a-center" style="height: 100%;">
- <input class="uni-input-input flex-1 textColor" placeholder="请输入车辆识别码"
- v-model="carInfo.frameNo" maxlength="17" placeholder-style="font-size:28upx"
- @input="upperCaseType('frameNo')" />
- <image src="/static/image/car-insure/search.png" mode=""
- style="width: 20px;height: 20px;" @tap="toChooseVin(carInfo.frameNo)">
- </image>
- </view>
- </uni-forms-item>
- <uni-forms-item name="modelcname" required label="品牌型号: ">
- <view class="d-flex a-center textColor" style="height: 100%;">
- <input class="uni-input-input flex-1 textColor" placeholder="请输入品牌型号"
- v-model="carInfo.modelcname"
- @blur="binddata('modelcname', $event.detail.value,'carForm')"
- placeholder-style="font-size:28upx" @input="upperCaseType('modelcname')" />
- <image src="/static/image/car-insure/search.png" mode=""
- style="width: 20px;height: 20px;" @tap="toChooseVehicleType(carInfo.modelcname)">
- </image>
- </view>
- </uni-forms-item>
- <uni-forms-item name="engineNo" required label="发动机号: ">
- <input class="uni-input-input textColor" placeholder="请输入发动机号" v-model="carInfo.engineNo"
- @blur="binddata('engineNo', $event.detail.value,'carForm')"
- placeholder-style="font-size:28upx" @input="upperCaseType('engineNo')" />
- </uni-forms-item>
- <uni-forms-item required label="注册日期" name="registerDate">
- <u-input type="select" :custom-style="{textAlign:'right'}" :select-open="registerDateShow"
- v-model="carInfo.registerDate" placeholder="请选择注册日期" @click="registerDateShow = true"
- placeholder-style="color:#808080"></u-input>
- <u-picker v-model="registerDateShow" mode="time" :params="params" :end-year="endYear"
- :end-month="endMonth" @confirm="e=> Dateconfirm(e,'carInfo','registerDate')"></u-picker>
- </uni-forms-item>
- <uni-forms-item required label="发证日期" name="issueDate">
- <u-input type="select" :custom-style="{textAlign:'right'}" :select-open="issueDateShow"
- v-model="carInfo.issueDate" placeholder="请选择发证日期" @click="issueDateShow = true"
- placeholder-style="color:#808080"></u-input>
- <u-picker v-model="issueDateShow" mode="time" :params="params"
- @confirm="e=> Dateconfirm(e,'carInfo','issueDate')"></u-picker>
- </uni-forms-item>
- <uni-forms-item label="整备质量: " required name="completeKerbMass">
- <input class="uni-input-input textColor" placeholder="请输入整备质量"
- v-model="carInfo.completeKerbMass" placeholder-style="font-size:28upx" />
- </uni-forms-item>
- <uni-forms-item label="核定载质量: ">
- <input class="uni-input-input textColor" placeholder="请输入核定载质量" v-model="carInfo.limitLoad"
- placeholder-style="font-size:28upx" />
- </uni-forms-item>
- <uni-forms-item label="使用性质: " required name="carnature">
- <u-input v-model="carInfo1.carnature" type="select" :select-open="carnatureShow"
- @click="carnatureShow = true" :custom-style="{textAlign:'right'}"
- placeholder-style="color:#808080" placeholder="请选择使用性质" />
- <u-select mode="single-column" :list="natureOfVehicleUseoptions" v-model="carnatureShow"
- label-name="dictTag" value-name="dictValue"
- @confirm="dictionaryConfirm($event,'carnature')"></u-select>
- </uni-forms-item>
- <uni-forms-item label="能源种类: " required name="energyType">
- <u-input v-model="carInfo1.energyType" type="select" :select-open="energyTypeShow"
- @click="energyTypeShow = true" :custom-style="{textAlign:'right'}"
- placeholder-style="color:#808080" placeholder="请选择能源种类" />
- <u-select mode="single-column" :list="energyTypeoptions" v-model="energyTypeShow"
- label-name="dictTag" value-name="dictValue"
- @confirm="dictionaryConfirm($event,'energyType')"></u-select>
- </uni-forms-item>
- <uni-forms-item label="车辆用途: " required name="vehicleUse">
- <u-input v-model="carInfo1.vehicleUse" type="select" :select-open="vehicleUseShow"
- @click="vehicleUseShow = true" :custom-style="{textAlign:'right'}"
- placeholder-style="color:#808080" placeholder="请选择车辆用途" />
- <u-select v-if="carInfo.carnature=='01'" mode="single-column"
- :list="businessVehicleUseoptions" v-model="vehicleUseShow" label-name="dictTag"
- value-name="dictValue" @confirm="dictionaryConfirm($event,'vehicleUse')"></u-select>
- <u-select v-else mode="single-column" :list="outOfBusinessVehicleUseoptions"
- v-model="vehicleUseShow" label-name="dictTag" value-name="dictValue"
- @confirm="dictionaryConfirm($event,'vehicleUse')"></u-select>
- </uni-forms-item>
- <uni-forms-item label="车辆类型: " required name="cartype">
- <u-input v-model="carInfo1.cartype" type="select" :select-open="cartypeShow"
- @click="cartypeShow = true" :custom-style="{textAlign:'right'}"
- placeholder-style="color:#808080" placeholder="请选择车辆类型" />
- <u-select mode="single-column" :searchShow="true"
- :list="trafficManagementVehicleTypeoptions" v-model="cartypeShow" label-name="dictTag"
- value-name="dictValue" @confirm="dictionaryConfirm($event,'cartype')"></u-select>
- </uni-forms-item>
- <uni-forms-item label="车辆种类: " required name="cimodelclass">
- <u-input v-model="carInfo1.cimodelclass" type="select" :select-open="cimodelclassShow"
- @click="cimodelclassShow = true" :custom-style="{textAlign:'right'}"
- placeholder-style="color:#808080" placeholder="请选择车辆种类" />
- <u-select mode="single-column" :list="vehicleTypeoptions" v-model="cimodelclassShow"
- label-name="dictTag" value-name="dictValue"
- @confirm="dictionaryConfirm($event,'cimodelclass')"></u-select>
- </uni-forms-item>
- <uni-forms-item label="年款: ">
- <input class="uni-input-input textColor" placeholder="请输入年款" v-model="carInfo.caryear"
- placeholder-style="font-size:28upx" />
- </uni-forms-item>
- <uni-forms-item label="座位数: ">
- <input class="uni-input-input textColor" maxlength="1" placeholder="请输入座位数"
- v-model="carInfo.seatCount" placeholder-style="font-size:28upx" />
- </uni-forms-item>
- <uni-forms-item label="排量: ">
- <input class="uni-input-input textColor" placeholder="请输入排量" v-model="carInfo.enginedesc"
- placeholder-style="font-size:28upx" />
- </uni-forms-item>
- <uni-forms-item label="功率: ">
- <input class="uni-input-input textColor" placeholder="请输入功率" v-model="carInfo.powerScale"
- placeholder-style="font-size:28upx" />
- </uni-forms-item>
- <uni-forms-item label="新车购置价: " required name="purchasePrice">
- <input class="uni-input-input textColor" placeholder="请输入新车购置价"
- v-model="carInfo.purchasePrice" placeholder-style="font-size:28upx"
- @blur="binddata('purchasePrice', $event.detail.value,'carForm')"
- @input="upperCaseType('purchasePrice')" />
- </uni-forms-item>
- <!-- <uni-forms-item label="是否过户: ">
- <view class="d-flex j-end a-c" style="height:100%">
- <u-switch v-model="carInfo.transferFlag" active-color="#0052FF " size="30"
- @change="transferFlagchange"></u-switch>
- </view>
- </uni-forms-item>
- <uni-forms-item v-if="carInfo.transferFlag" required label="转移登记日期" name="transferDate">
- <u-input type="select" :select-open="transferDateShow" v-model="carInfo.transferDate"
- placeholder="请选择过户日期" @click="transferDateShow = true"
- :custom-style="{textAlign:'right'}" placeholder-style="color:#808080"></u-input>
- <u-picker v-model="transferDateShow" mode="time" :params="params" :end-year="endYear"
- :end-month="endMonth" @confirm="e=> Dateconfirm(e,'carInfo','transferDate')"></u-picker>
- </uni-forms-item> -->
- </uni-forms>
- </view>
- </view>
- </view>
- <view class="fixed dis a-c j-c">
- <u-button type="warning" class="fiexdbtn" shape="circle" @click="toNext">立即投保</u-button>
- </view>
- <OCRComponent :showModal='OCRShow' @closePopup="closePopup" :tabslist="tabslist" @tabschange="OCRtabschange"
- :tabsCurrent="tabsCurrent" :checkType='checkType' @carCallback="carCallback">
- </OCRComponent>
- <u-keyboard ref="uKeyboard" mode="car" :keyboardType="keyboardType" v-model="keyboardShow"
- @change="keyboardchange" @backspace="backspacesss" @confirm="backsconfirm"></u-keyboard>
- <u-toast ref="uToast" />
- </view>
- </template>
- <script>
- import OCRComponent from '@/components/modules/carInsure/OCRComponent/OCRComponent.vue'; //引用图片信息检查插件
- var dateTime = new Date();
- let Year = dateTime.getFullYear();
- let Month = Number(dateTime.getMonth() + 1);
- export default {
- components: {
- OCRComponent,
- },
- data() {
- return {
- isActive: true,
- vehicleType: false, //车型查询调用标识
- keyboardType: false, //键盘中/英切换标识
- endYear: Year,
- endMonth: Month,
- params: {
- year: true, //年
- month: true, //月
- day: true, //日
- hour: false, //时
- minute: false, //分
- second: false, //秒
- },
- carRules: {
- frameNo: {
- rules: [{
- required: true,
- errorMessage: '请输入车辆识别码',
- }, {
- pattern: /^([0-9A-Z]){17}$/,
- errorMessage: '请输入正确的车辆识别码',
- }]
- },
- modelcname: {
- rules: [{
- required: true,
- errorMessage: '请输入品牌型号',
- }, ]
- },
- engineNo: {
- rules: [{
- required: true,
- errorMessage: '请输入发动机号',
- }, ]
- },
- purchasePrice: {
- rules: [{
- required: true,
- errorMessage: '请输入新车购置价',
- }, {
- validateField: function(rule, value, data, callback) {
- if (value == 0) {
- callback('新车购置价不能为零')
- }
- return true
- }
- }]
- },
- completeKerbMass: {
- rules: [{
- required: true,
- errorMessage: '请输入整备质量',
- }, ]
- },
- carnature: {
- rules: [{
- required: true,
- errorMessage: '使用性质必选',
- }, ]
- },
- vehicleUse: {
- rules: [{
- required: true,
- errorMessage: '车辆用途必选',
- }, ]
- },
- registerDate: {
- rules: [{
- required: true,
- errorMessage: '请选择注册日期',
- }, {
- pattern: /^\d{4}-\d{2}-\d{2}$/,
- errorMessage: '注册日期格式错误',
- }]
- },
- issueDate: {
- rules: [{
- required: true,
- errorMessage: '请选择发证日期',
- }, {
- pattern: /^\d{4}-\d{2}-\d{2}$/,
- errorMessage: '发证日期日期格式错误',
- }]
- }
- },
- //影像信息
- carSwitching: true, //true识别 false录入
- keyboardShow: false,
- insuranceType: 2,
- checked: true,
- LicenseInputValue: ['晋', 'A', '', '', '', '', '', ''],
- currentInputIndex: 0,
- carInfoPositiveList: [], //车辆
- //车辆信息
- carInfo: {
- licenseNo: "", //车牌号
- brandName: "", //车辆品牌型号
- vinNo: "", //车架号
- engineNo: "", //发动机号
- modelCode: "", //车型编码
- seatCount: "0", //核定载客量 核定载人数
- purchasePrice: "", //新车购置价最低,行业实际价值,协商价值
- carBrand: "", //车型品牌
- ciCarName: "", //行业车型名称
- ciModelCode: "", //行业车型编码
- completeKerbMass: "", //整备质量
- exhaustScale: "", //排量
- factory: "", //工厂名称
- factoryid: "", //工厂编码
- frameNo: "", //车架号
- licenseTypeCode: "02", //号牌种类
- vehicleclass: "", //车辆类型
- familyName: "", //车型
- modelcname: "", //车型名称
- powertypecode: "", //燃料类型编码
- vehicleweight: "", //总质量
- limitLoad: "", //核定载质量
- caryear: "0", //年款
- cimodelclass: "A0", //车辆种类客车A0 货车H0
- cartype: "K33", //车辆类型
- powertype: "汽油", //燃料类型
- energyType: "0", //能源种类
- enginedesc: "", //排量
- powerScale: "", //功率
- registerDate: "", //注册日期
- issueDate: "", //发证日期
- transferFlag: false, //过户标志
- transferFlagBi: false, //商业过户标志
- transferDate: "", //过户日期
- loanStatus: 0, //贷款标志
- firstBeneMan: "", //第一受益人
- noLicenseFlag: false, //是否新车
- carnature: "02", //使用性质 家庭自用8A 非营业企业8B 非营业党政机关,事业团体8C 非营业货车8D
- property: "1", //所属性质 1个人 2企业 3个人
- outOfInsurance: false, //脱保
- usedCar: false, //二手车
- vehicleUse: "05" //车辆用途
- },
- carInfo1: {
- carnature: "非营业",
- energyType: "燃油",
- vehicleUse: "家庭自用",
- cartype: "轿车",
- cimodelclass: "客车",
- },
- registerDateShow: false, //注册日期
- issueDateShow: false, //发证日期
- transferDateShow: false, //转移登记日期
- carnatureShow: false, //使用性质
- energyTypeShow: false, //能源种类
- vehicleUseShow: false, //车辆用途
- cartypeShow: false, //车辆类型
- cimodelclassShow: false, //车辆种类
- /* 数据字典 */
- natureOfVehicleUseoptions: [],
- vehicleTypeoptions: [],
- trafficManagementVehicleTypeoptions: [],
- energyTypeoptions: [],
- businessVehicleUseoptions: [],
- outOfBusinessVehicleUseoptions: [],
- /* 数据字典 */
- tabslist: [{
- name: '行驶证识别'
- }, ],
- OCRShow: false,
- tabsCurrent: 0,
- checkType: "carInfo", //组件类型
- carfrontImg: null, //展示图片
- carbackImg: null, //展示图片
- cardeg: 0, //旋转角度
- word: "word",
- }
- },
- async onLoad() {
- this.getDicType("businessVehicleUse"); //车辆用途(营业)
- this.getDicType("outOfBusinessVehicleUse"); //车辆用途(非营业)
- this.getDicType("natureOfVehicleUse"); //车辆性质
- this.getDicType("vehicleType"); //车辆种类
- this.getDicType("trafficManagementVehicleType"); //车辆类型
- this.getDicType("energyType"); //能源种类
- if (this.checked) {
- this.LicenseInputValue.forEach((val, index) => {
- if (index < 7) {
- this.$set(this.LicenseInputValue, index, "*");
- }
- })
- let valueList = this.LicenseInputValue;
- const str = valueList.join("")
- this.carInfo.licenseNo = str;
- } else {
- this.LicenseInputValue.forEach((val, index) => {
- this.$set(this.LicenseInputValue, index, "");
- })
- this.carInfo.licenseNo = "";
- }
- },
- watch: {
- currentInputIndex(newVal) {
- switch (newVal) {
- case 0:
- this.keyboardType = false;
- break;
- default:
- this.keyboardType = true;
- }
- },
- "carInfo.energyType": {
- handler(val) {
- if (val) {
- this.carInfo1.energyType = this.dictionaryMatching(this.energyTypeoptions,
- this
- .carInfo
- .energyType);
- }
- },
- deep: true
- },
- "carInfo.cartype": {
- handler(val) {
- if (val) {
- this.carInfo1.cartype = this.dictionaryMatching(this.trafficManagementVehicleTypeoptions,
- this
- .carInfo
- .cartype);
- }
- },
- deep: true
- },
- "carInfo.vehicleUse": {
- handler(val) {
- if (val) {
- this.carInfo1.vehicleUse = this.carInfo.carnature == '02' ? this.dictionaryMatching(this
- .outOfBusinessVehicleUseoptions,
- this
- .carInfo
- .vehicleUse) : "";
- }
- },
- deep: true
- },
- },
- methods: {
- toggleSwitch() {
- this.isActive = !this.isActive;
- },
- rotatefront(int) {
- this[int] = this[int] == 270 ? 0 : this[int] + 90;
- },
- rotateback(int) {
- this[int] = this[int] == 0 ? 270 : this[int] - 90;
- },
- dictionaryConfirm(e, name) {
- if (name == 'carnature') {
- this.carInfo1['vehicleUse'] = "";
- this.carInfo['vehicleUse'] = "";
- }
- this.carInfo[name] = e[0].value;
- this.carInfo1[name] = e[0].label;
- },
- async getDicType(type) {
- let res = await this.$http.get('/sysDict/dictDetails/' + type);
- if (res.code == 200) {
- this[type + 'options'] = res.data.ddList;
- // if (type == "trafficManagementVehicleType") {
- // this.carInfo1.cartype = this.dictionaryMatching(this.trafficManagementVehicleTypeoptions, this
- // .carInfo
- // .cartype)
- // this.carInfo1.cimodelclass = this.dictionaryMatching(this.vehicleTypeoptions,
- // this
- // .carInfo
- // .cimodelclass)
- // }
- }
- },
- //字典name匹配
- dictionaryMatching(list, value) {
- let obj = list.find(val => val.dictValue == value);
- return obj.dictTag;
- },
- //OC识别返回信息
- carCallback(obj) {
- this.carfrontImg = obj.frontImg;
- this.carbackImg = obj.backImg;
- this.carInfoPositiveList = obj.ImgList;
- Object.assign(this.carInfo, obj.Info);
- this.carInfo1.cimodelclass = this.dictionaryMatching(this.vehicleTypeoptions,
- this
- .carInfo
- .cimodelclass)
- this.OCRShow = false;
- },
- upperCaseType(type) {
- this.carInfo[type] = this.carInfo[type].toUpperCase();
- if (type == 'frameNo') {
- this.carInfo.vinNo = this.carInfo.frameNo.trim();
- }
- },
- //
- transferFlagchange(status) {
- if (status) {
- this.carInfo.transferDate = this.carInfo.issueDate;
- } else {
- this.carInfo.transferDate = ""
- }
- },
- Dateconfirm(e, obj, param) {
- this[obj][param] = e.year + '-' + e.month + '-' + e.day;
- },
- //下一步
- toNext() {
- switch (this.insuranceType) {
- case 1:
- if (!this.carInfo.licenseNo && !this.islicense(this.carInfo.licenseNo)) {
- return uni.showToast({
- icon: "none",
- title: '请填写正确的车牌号码',
- duration: 1500
- });
- }
- this.navigate({
- url: "/pages/carInsure2/Information?licenseNo=" + encodeURIComponent(this.carInfo
- .licenseNo)
- }, "navigateTo", true)
- break;
- case 2:
- if (!this.carInfo.licenseNo && !this.carfrontImg) {
- return uni.showToast({
- icon: "none",
- title: '请上传资料或录入信息后再投保',
- duration: 1500
- });
- }
- this.$refs.carForm.submit().then(res => {
- if (this.vehicleType) {
- console.log(this
- .carInfo);
- this.navigate({
- url: '/pages/carInsure2/Information',
- success: (res) => {
- res.eventChannel.emit(
- "acceptData", {
- carInfo: this
- .carInfo,
- carInfoPositiveList: this
- .carInfoPositiveList, //车辆
- })
- }
- }, "navigateTo", true);
- } else {
- this.$refs.uToast.show({
- title: '检测到未精准校验车型,即将跳转到车型界面选择,请等待。。。',
- type: 'warning',
- icon: false,
- })
- setTimeout(() => {
- this.navigate({
- url: '/pages/carInsure2/carType?frameNo=' +
- encodeURIComponent(this.carInfo.frameNo) +
- '&vehicleType=true'
- }, "navigateTo", true);
- }, 2000)
- }
- })
- break;
- default:
- break;
- }
- },
- switchChange(value) {
- if (value) {
- this.LicenseInputValue.forEach((val, index) => {
- if (index < 7) {
- this.$set(this.LicenseInputValue, index, "*");
- }
- })
- let valueList = this.LicenseInputValue;
- const str = valueList.join("")
- this.carInfo.licenseNo = str;
- } else {
- this.LicenseInputValue.forEach((val, index) => {
- this.$set(this.LicenseInputValue, index, "");
- })
- this.carInfo.licenseNo = "";
- }
- },
- // 通过车架号获取车型
- async toChooseVin(cctype) {
- this.vehicleType = true;
- if (cctype == '' || cctype == null) {
- return uni.showToast({
- icon: 'none',
- title: '请输入车架号',
- duration: 1500
- });
- } else {
- if (!this.isFrameno(cctype.trim())) {
- return uni.showToast({
- title: '请输入正确的车辆识别码',
- icon: "none"
- });
- }
- this.navigate({
- url: '/pages/carInsure2/carType?frameNo=' + encodeURIComponent(cctype)
- }, "navigateTo", true);
- }
- },
- //跳转选择车辆类型页面
- toChooseVehicleType(cctype) {
- if (cctype == '' || cctype == null) {
- uni.showToast({
- icon: 'none',
- title: '请输入车型名称',
- duration: 1500
- });
- } else {
- let cctypeName = cctype.replace(/[^u4e00-u9fa5|,]+/ig, '')
- this.navigate({
- url: '/pages/carInsure2/carType?modelName=' + encodeURIComponent(cctypeName)
- }, "navigateTo", true);
- }
- },
- //验证车牌号
- islicense(val) {
- let mPattern = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-Z0-9]{4,5}[A-Z0-9挂学警港澳]{1}$/;
- return mPattern.test(val);
- },
- //验证车架号
- isFrameno(str) {
- let mPattern = /^([0-9A-Z]){17}$/;
- return mPattern.test(str);
- },
- //OCR识别
- ocrIdentify() {
- this.OCRShow = !this.OCRShow;
- },
- closePopup() {
- this.OCRShow = false;
- },
- OCRtabschange(e) {
- this.tabsCurrent = e;
- },
- keyboardchange(val) {
- this.$set(this.LicenseInputValue, this.currentInputIndex, val);
- if (this.currentInputIndex < 7) {
- this.currentInputIndex++;
- }
- },
- backsconfirm() {
- let valueList = this.LicenseInputValue;
- const str = valueList.join("")
- this.carInfo.licenseNo = str;
- },
- //键盘退格键
- backspacesss() {
- this.$set(this.LicenseInputValue, this.currentInputIndex, '')
- if (this.currentInputIndex != 0) this.currentInputIndex--
- },
- inputSwitch(e) {
- const {
- index
- } = e.currentTarget.dataset;
- this.currentInputIndex = parseInt(index);
- this.keyboardShow = true;
- console.log(this.currentInputIndex);
- },
- }
- }
- </script>
- <style lang="scss" scoped>
- .uni-forms-item .uni-input-input {
- text-align: end;
- }
- ::v-deep .uni-forms-item {
- border-bottom: 1px solid #f2f2f2;
- }
- ::v-deep .uni-forms-item:last-child {
- border: none;
- }
- page {
- height: 100vh;
- background: #F8FAFE;
- }
- .page {
- padding: 16px 16px 50px 16px;
- }
- .banner {
- width: 100%;
- height: 202px;
- image {
- width: 100%;
- height: 100%;
- }
- }
- .carinfo {
- width: 100%;
- height: auto;
- >.title {
- padding: 10px;
- border-bottom: 1px solid #f2f2f2;
- >text {
- font-weight: bold;
- font-size: 15px;
- }
- .rounded {
- width: 120px;
- height: 28px;
- background: #0052FF;
- border-radius: 15px;
- padding: 1px;
- box-sizing: border-box;
- position: relative;
- .left {
- width: 50%;
- height: 100%;
- background-color: white;
- border-top-left-radius: 15px;
- border-bottom-left-radius: 15px;
- font-size: 24rpx;
- color: #0052FF;
- }
- .right {
- width: 50%;
- height: 100%;
- background-color: #fff;
- border-top-right-radius: 15px;
- border-bottom-right-radius: 15px;
- font-size: 24rpx;
- color: #0052FF;
- }
- .center {
- width: 8px;
- height: 100%;
- background-color: white;
- position: absolute;
- border-left: 1px solid #0052FF;
- border-right: 1px solid #0052FF;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%) skewX(-10deg);
- }
- .active {
- background-color: #0052FF;
- color: #fff;
- }
- }
- }
- .carinput {
- width: 100%;
- height: auto;
- background: #FFFFFF;
- box-shadow: 0px 4px 10px 0px #DAE3F4;
- border-radius: 12px;
- padding: 10px;
- .top {
- font-weight: bold;
- font-size: 15px;
- }
- .so-plate-word {
- width: 40px;
- height: 40px;
- background-color: #f8f8fa;
- border-radius: 5px;
- margin: 0 4px;
- box-sizing: border-box;
- text {
- font-size: 18px;
- font-weight: bold;
- }
- .newEnergy {
- image {
- width: 12px;
- height: 12px;
- }
- text {
- font-size: 16rpx;
- color: #0eb78e;
- }
- }
- }
- .so-plate-dot {
- width: 15upx;
- height: 15upx;
- background: #ccc;
- border-radius: 50%;
- margin: 0 5upx
- }
- .actives {
- border: 1px solid #0052FF;
- background-color: rgba(0, 82, 255, 0.1);
- }
- .newactives {
- border: 1px solid #0eb78e;
- background-color: rgba(14, 183, 142, 0.1);
- }
- }
- .OCRcar {
- width: 100%;
- height: auto;
- .title {
- color: #FF5600;
- text:nth-child(1) {
- font-size: 15px;
- font-weight: bold;
- color: #232832;
- }
- }
- .ocr {
- width: 100%;
- height: auto;
- background-color: white;
- box-shadow: 0px 4px 10px 0px #DAE3F4;
- border-radius: 12px;
- .content {
- padding: 0 15px;
- }
- .movable-view {
- .operate-img {
- width: 90%;
- height: 38px;
- background-color: #F9F9F9;
- border-radius: 8px;
- padding: 10px 25px;
- margin-top: 10px;
- >view:nth-child(2) {
- background-color: rgba(0, 82, 255, 0.06);
- border-radius: 4px 4px 4px 4px;
- border: 1px solid #0052FF;
- color: #0052FF;
- padding: 3px 5px;
- }
- >view {
- font-size: 14px;
- }
- image {
- width: 22px;
- height: 22px;
- margin-right: 5px;
- }
- }
- }
- }
- .content {
- width: 100%;
- height: auto;
- background-color: white;
- box-shadow: 0px 4px 10px 0px #DAE3F4;
- border-radius: 12px;
- .input-align-right {
- padding: 20px;
- }
- }
- }
- }
- .fixed {
- width: 100%;
- height: 80px;
- padding: 10px;
- position: fixed;
- bottom: 0;
- left: 0;
- right: 0;
- background: white;
- z-index: 9;
- border-top: 1px solid #f2f2f2;
- .fiexdbtn {
- width: 50%;
- background: linear-gradient(to bottom, #FFF9F5, #FCD4C0, #F8A67D);
- color: #FF5600;
- font-weight: bold;
- font-size: 18px;
- border: 1px solid #F8A67D;
- }
- }
- movable-area {
- height: 220px;
- width: 100%;
- border-top-left-radius: 12px;
- border-top-right-radius: 12px;
- background-color: #D8D8D8;
- overflow: hidden;
- }
- movable-view {
- display: flex;
- align-items: center;
- justify-content: center;
- height: 100%;
- width: 100%;
- }
- .switch-container {
- width: 60px;
- height: 30px;
- background-color: #E6EEFF;
- border-radius: 15px;
- position: relative;
- cursor: pointer;
- }
- .switch-track {
- width: 100%;
- height: 100%;
- background-color: #E6EEFF;
- border-radius: 4px;
- position: relative;
- transition: background-color 0.3s ease;
- }
- .switch-thumb {
- width: 26px;
- height: 26px;
- background-color: #0052FF;
- border-radius: 4px;
- position: absolute;
- top: 2px;
- left: 2px;
- transition: transform 0.3s ease;
- font-size: 13px;
- color: #fff;
- }
- .switch-thumb1 {
- width: 26px;
- height: 26px;
- position: absolute;
- top: 2px;
- left: 2px;
- font-size: 13px;
- color: rgba(0, 82, 255, 0.8);
- }
- .switch-thumb2 {
- width: 26px;
- height: 26px;
- position: absolute;
- top: 2px;
- right: 2px;
- font-size: 13px;
- color: rgba(0, 82, 255, 0.8);
- }
- .thumbactive {
- background-color: #0052FF;
- transform: translateX(30px);
- }
- .thumbactive1 {
- color: #fff;
- }
- </style>
|