123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890 |
- <template>
- <view class="bg">
- <view class="title_wrap"><text class="title">变更基本信息</text></view>
- <u-form label-width="230" :model="state.form" ref="uForm" :label-style='labelStyle'>
- <u-form-item label="车牌号码" :left-icon='`${$imgUrl}issuance/point-form.png`' :left-icon-style='leftIcon'
- borderBottom>
- <u-input v-model="state.form.vehiclePlate" input-align='right' disabled/>
- </u-form-item>
- <u-form-item label="车牌颜色" :left-icon='`${$imgUrl}issuance/point-form.png`' :left-icon-style='leftIcon'
- borderBottom>
- <view class="showworld">{{getCodeName('VEHICLE_COLOR_TYPE',state.form.vehiclePlateColor)}}</view>
- </u-form-item>
- <view class="picture-wrapper" @click="takePhotoMode('3')">
- <view class="bg1">
- <view class="">
- <view class="name"> 新车牌行驶证主页 </view>
- <view class="value"> 上传行驶证的主页 </view>
- <view class="tip">
- <view class="tip-value"> 拍摄规范 </view>
- </view>
- </view>
- <image v-if="!state.form.vehPosImgUrl" class="icon" :src="`${$imgUrl}issuance/xz.png`"
- :style="{'--bgimg':`url(${$imgUrl}issuance/bg-border.png)`}">
- </image>
- <image v-else class="icon" :src="strReplace(state.form.vehPosImgUrl)"
- :style="{'--bgimg':`url(${$imgUrl}issuance/bg-border.png)`}"></image>
- </view>
- </view>
- <view class="picture-wrapper" @click="takePhotoMode('4')">
- <view class="bg1">
- <view class="">
- <view class="name"> 新车牌行驶证副页 </view>
- <view class="value"> 上传行驶证的副页 </view>
- <view class="tip">
- <view class="tip-value"> 拍摄规范 </view>
- </view>
- </view>
- <image v-if="!state.form.vehNegImgUrl" class="icon" :src="`${$imgUrl}issuance/xf.png`"
- :style="{'--bgimg':`url(${$imgUrl}issuance/bg-border.png)`}">
- </image>
- <image v-else class="icon" :src="strReplace(state.form.vehNegImgUrl)"
- :style="{'--bgimg':`url(${$imgUrl}issuance/bg-border.png)`}"></image>
- </view>
- </view>
-
- </u-form>
- </view>
- <view class="bg">
- <view class="title_wrap"><text class="title">以下信息选择性修改/填写</text></view>
- <u-form label-width="230" :model="state.form" ref="uForm" :label-style='labelStyle'>
- <u-form-item label="变更车主姓名" :left-icon='`${$imgUrl}issuance/point-form.png`' :left-icon-style='leftIcon'
- borderBottom>
- <u-input v-model="state.form.ownerName" input-align='right'/>
- </u-form-item>
- <u-form-item label="变更车辆类型" :left-icon='`${$imgUrl}issuance/point-form.png`' :left-icon-style='leftIcon'
- borderBottom>
- <u-input v-model="state.form.vehicleType" input-align='right'/>
- </u-form-item>
- <u-form-item label="变更证件类型" :left-icon='`${$imgUrl}issuance/point-form.png`' :left-icon-style='leftIcon'
- borderBottom>
- <u-input v-model="state.form.ownerIdTypeStr" type="select" @click="show1 = true" input-align='right'/>
- </u-form-item>
- <u-form-item label="变更证件号码" :left-icon='`${$imgUrl}issuance/point-form.png`' :left-icon-style='leftIcon'
- borderBottom>
- <u-input v-model="state.form.ownerIdNum" input-align='right'/>
- </u-form-item>
- <u-form-item label="变更地址" :left-icon='`${$imgUrl}issuance/point-form.png`' :left-icon-style='leftIcon'
- borderBottom>
- <u-input v-model="state.form.ownerAddress" input-align='right'/>
- </u-form-item>
- <u-form-item label="总质量(kg)" :left-icon='`${$imgUrl}issuance/point-form.png`' :left-icon-style='leftIcon'>
- <u-input inputAlign="right" placeholder="请输入总质量" v-model="state.form.totalMass"
- />
- </u-form-item>
- <u-form-item label="整备质量(kg)" :left-icon='`${$imgUrl}issuance/point-form.png`' :left-icon-style='leftIcon'>
- <u-input inputAlign="right" placeholder="请输入整备质量" v-model="state.form.maintenanceMass"
- maxlength="7" />
- </u-form-item>
- <u-form-item label="准牵引总质量(kg)" :left-icon='`${$imgUrl}issuance/point-form.png`' :left-icon-style='leftIcon' v-if="state.form.permittedTowWeight">
- <u-input inputAlign="right" placeholder="请输入牵引质量" v-model="state.form.permittedTowWeight"/>
- </u-form-item>
- <u-form-item label="变更车轴数(轴)" :left-icon='`${$imgUrl}issuance/point-form.png`' :left-icon-style='leftIcon'>
- <u-input inputAlign="right" placeholder="请输入车轴数" v-model="state.form.axleCount"/>
- </u-form-item>
- <u-form-item label="外廓尺寸(mm)" :left-icon='`${$imgUrl}issuance/point-form.png`' :left-icon-style='leftIcon'>
- <u-input inputAlign="right" placeholder="请输入外廓尺寸" v-model="state.form.outsideDimensions" />
- </u-form-item>
- <u-form-item label="核定载人数(人)" :left-icon='`${$imgUrl}issuance/point-form.png`' :left-icon-style='leftIcon'>
- <u-input inputAlign="right" placeholder="请输入核定载人数" v-model="state.form.approvedCount"
- maxlength="3" />
- </u-form-item>
- <u-form-item label="发动机号" :left-icon='`${$imgUrl}issuance/point-form.png`' :left-icon-style='leftIcon'>
- <u-input inputAlign="right" placeholder="请输入发动机号码" v-model="state.form.engineNum"
- maxlength="20" />
- </u-form-item>
- <u-form-item label="车辆识别号" :left-icon='`${$imgUrl}issuance/point-form.png`' :left-icon-style='leftIcon'>
- <u-input inputAlign="right" placeholder="请输入车辆识别号" v-model="state.form.vin"
- maxlength="20" />
- </u-form-item>
- <u-form-item label="是否牵引车" :left-icon='`${$imgUrl}issuance/point-form.png`' :left-icon-style='leftIcon' v-if="state.form.vanType!=1">
- <radio-group @change="radioChangeqyc">
- <view class="right-show">
- <label style="margin-right: 60rpx;" class="uni-list-cell uni-list-cell-pd "
- v-for="(item, index) in state.itemsqyc" :key="item.value">
- <radio :value="item.value" :checked="index === state.form.isTractor" />{{item.name}}
- </label>
- </view>
- </radio-group>
- </u-form-item>
- <view class="picture-wrapper" @click="cardFileImageUpdate(1)" v-if="state.form.vanType!=1">
- <view class="bg1">
- <view class="">
- <view class="name"> 车头照 </view>
- <view class="value"> 变更车头照 </view>
- <view class="tip">
- <view class="tip-value"> 拍摄规范 </view>
- </view>
- </view>
- <image v-if="!state.form.vehFrontUrl" class="icon" :src="`${$imgUrl}issuance/chetou.png`"
- :style="{'--bgimg':`url(${$imgUrl}issuance/bg-border.png)`}">
- </image>
- <image v-else class="icon" :src="strReplace(state.form.vehFrontUrl)"
- :style="{'--bgimg':`url(${$imgUrl}issuance/bg-border.png)`}"></image>
- </view>
- </view>
- <view class="picture-wrapper" @click="cardFileImageUpdate(2)" v-if="state.form.vanType!=1">
- <view class="bg1">
- <view class="">
- <view class="name"> 车身照 </view>
- <view class="value"> 变更车身45°照 </view>
- <view class="tip">
- <view class="tip-value"> 拍摄规范 </view>
- </view>
- </view>
- <image v-if="!state.form.vehBodyUrl" class="icon" :src="`${$imgUrl}issuance/chetou45.png`"
- :style="{'--bgimg':`url(${$imgUrl}issuance/bg-border.png)`}">
- </image>
- <image v-else class="icon" :src="strReplace(state.form.vehBodyUrl)"
- :style="{'--bgimg':`url(${$imgUrl}issuance/bg-border.png)`}"></image>
- </view>
- </view>
- <view class="picture-wrapper" @click="cardFileImageUpdate(3)" v-if="state.form.isTractor==1">
- <view class="bg1">
- <view class="">
- <view class="name"> 道路运输许可证 </view>
- <view class="value"> 上传道路运输许可证 </view>
- <view class="tip">
- <view class="tip-value"> 拍摄规范 </view>
- </view>
- </view>
- <image v-if="!state.form.roadTransportPermitPicUrl" class="icon" :src="`${$imgUrl}issuance/dlysxkz.png`"
- :style="{'--bgimg':`url(${$imgUrl}issuance/bg-border.png)`}">
- </image>
- <image v-else class="icon" :src="strReplace(state.form.roadTransportPermitPicUrl)"
- :style="{'--bgimg':`url(${$imgUrl}issuance/bg-border.png)`}"></image>
- </view>
- </view>
- <u-form-item label="车辆用户类型" :left-icon='`${$imgUrl}issuance/point-form.png`' :left-icon-style='leftIcon'
- borderBottom>
- <u-input v-model="state.form.vehicleCustomerTypeName" type="select" @click="show2 = true" input-align='right'/>
- </u-form-item>
- </u-form>
-
- </view>
-
- <view class="bg">
- <u-form label-width="230" :model="state.form" ref="uForm" :label-style='labelStyle'>
- <u-form-item label="手机号码" :left-icon='`${$imgUrl}issuance/point-form.png`' :left-icon-style='leftIcon'
- borderBottom>
- <u-input v-model="state.form.ownerTel" input-align='right' disabled/>
- </u-form-item>
- <u-form-item label="验证码" :left-icon='`${$imgUrl}issuance/point-form.png`' :left-icon-style='leftIcon'
- borderBottom>
- <view style="display: flex;align-items: center;flex-shrink: 0;">
- <u-input v-model="state.code" input-align='right' maxlength="6"/>
- <text @click="getCode" v-if="waitTime==0" class="search">获取验证码</text>
- <text class="search" v-else>{{waitTime}}后重试</text>
- </view>
- </u-form-item>
- </u-form>
- </view>
- <view class="action">
- <button type="default" class="ui-btn" @click="savaHandle()">
- 提交
- </button>
- </view>
- <!-- 选择证件类型 -->
- <u-select v-model="show1" :list="state.ownerIdTypeRange" @confirm="changeOwnerIdType"></u-select>
- <!-- 车辆用户类型 -->
- <u-select v-model="show2" :list="state.vehicleCustomerTypeRange" @confirm="vehicleCustomerTypeType"></u-select>
- <view class="choice-takePhoto-wrap" v-if="state.isTakePhotoModeShow" @click="cancle">
- <view class="choice-takePhoto">
- <view @click.stop="takePhoto(state.choiceIndex)" style="border-radius: 20rpx 20rpx 0 0;">拍照</view>
- <view @click.stop="xiangce(state.choiceIndex)">从手机相册选择</view>
- <view @click.stop="cancle">取消</view>
- </view>
- </view>
- <viewfinder v-if="state.phoneType" :phoneType="state.phoneType" :images="state.images" :showStartPhoto="state.showImg"
- @confirmReturn="confirmReturn" @camera="camera"></viewfinder>
- </template>
-
- <script setup lang="ts">
- import { navTo,uploadFile,strReplace,msg,checkStr,chooseImageCompress} from "@/utils/utils";
- import { reactive,ref } from "vue";
- import carNumberInput from "@/components/car-number-input/car-number-input.vue";
- import { onLoad } from "@dcloudio/uni-app";
- import { getItem } from "@/utils/storage.ts"
- import {sendMessage,vehicleLicenseOcr,vehicleInformationChange,messageValid,vehicleInfoChangeApply} from "@/utils/network/api.js";
- import {requestNew} from "@/utils/network/request.js";
- import {
- getCodeName
- } from "@/datas/queryKey.js";
- import viewfinder from "../../../components/viewfinder.vue"
- import {
- calculateVehicleType
- } from "@/datas/publicRequest";
- const labelStyle = {
- color: "#004576",
- fontSize: "28rpx",
- }
- const leftIcon = {
- height: '100%',
- width: '8rpx',
- display: 'flex',
- 'align-items': 'center',
- 'margin-right': '4rpx',
- }
- const show1 = ref(false)
- const show2 = ref(false)
- const state = reactive({
- form: {
-
- vehiclePlate: "",
- vehiclePlateColor: "",
- vehiclePlateColorStr:"",//车牌颜色中文
-
-
- vehPosImgUrl:"",
- vehNegImgUrl:"",
-
- isVehiclePlateChange:"",//是否车牌变更 否_0,是_1
- ownerName:"",//车主姓名
- ownerAddress:"",
- vehicleType:"",
- totalMass:"",
- maintenanceMass:"",
- axleCount:"",
- outsideDimensions:"",
- approvedCount:"",
- engineNum:"",
- vin:"",
- ownerIdTypeStr:"",
- ownerIdType:"",
- ownerIdNum:"",
- isTractor:0,//是否牵引车 否_0,是_1
- cardId:"",
- obuId:"",
- isMyselfHandle:1,//本人办理_1,代理人办理_2
- ownerTel:"",
- ownerNegImgUrl:"",//经办人身份证反面URL
- ownerPosImgUrl:"",//经办人身份证正面URL
- ownerLetterOfAuthorizationImgUrl:"",//开户人授权书URL
- unitAuthorizationLetterImgUrl:"",//单位授权书URL
- vehFrontUrl:"",//车头照图片地址
- vehBodyUrl:"",//车身45度照图片地址
- roadTransportPermitPicUrl:"",//道路运输许可证图片地址(牵引车才提供)
- vehicleCustomerType: "", //车辆用户类型
- vehicleCustomerTypeName: "",
- vanType:1,//客货类型,1-客车 2-货车 3-作业车
- vehicleTypeNew:1,//收费车型(按新输入的值计算)[变更车辆类型]
- vehPosImgOcrId:"",//行驶证正面orcId
- vehNegImgOcrId:"",//行驶证反面orcId
- userType:1,//1个人 2单位
- permittedTowWeight:"",//准牵引总质量
- useCharacter:"",//车辆使用性质
- },
- ownerIdTypeRange: [],
- isTakePhotoModeShow: false, //选择拍照方式是否出来
- choiceIndex: 1, // 1 身份证正面 2 身份证反面
- ownerInfo:false,//非本人 个人 车主信息true ==== 本人 个人 false
- phoneType: 0, // 1 身份证正面 2 身份证反面 3行驶证正面 4行驶证反面
- images: '',
- showImg: true,
- vehicleId:"",
- code:"",
- items: [{
- value: 1,
- name: '是',
- checked: 'true'
- },
- {
- value: 2,
- name: '否',
- }],
- itemsqyc: [{
- value: 0,
- name: '否',
- checked: 'true'
- },
- {
- value: 1,
- name: '是',
- }],
- vehicleCustomerTypeRange:[]
- })
- onLoad((option : any) => {
- state.form.isVehiclePlateChange=option.isVehiclePlateChange
- state.form.vehiclePlate=option.vehicleId.split("_")[0]
- state.form.vehiclePlateColor=option.vehicleId.split("_")[1]
- state.vehicleId=option.vehicleId
- state.form.cardId=option.cardId
- state.form.obuId=option.obuId
-
- let type = getItem('key')['CERTIFICATE_TYPE'];
- for (var k = 0; k < type.length; k++) {
- let obj = {};
- obj['value'] = type[k]['code']
- obj['label'] = type[k]['name']
- state.ownerIdTypeRange.push(obj)
- }
- getCarDetails()
- console.log("state.ownerIdTypeRange",state.ownerIdTypeRange,option)
- });
- const getCarDetails = () => {
- const options = {
- type: 2,
- data: {
- vehicleId:state.vehicleId
- },
- method: "POST",
- showLoading: true,
- };
- //调用方式
- requestNew(vehicleInformationChange, options)
- .then((res) => {
- console.log('车辆信息', res)
-
- state.form.ownerName=res.info.ownerName
- state.form.ownerAddress=res.info.ownerAddress
- state.form.vehicleType=res.info.vehicleType
- // 判断客货类型
- judgeVanType()
- state.form.totalMass=res.info.totalMass
- state.form.maintenanceMass=res.info.maintenanceMass
- state.form.axleCount=res.info.axleCount
- state.form.outsideDimensions=res.info.vehicleDimensions.slice(0,-2)
- state.form.approvedCount=res.info.approvedCount
- state.form.engineNum=res.info.engineNum
- state.form.vin=res.info.vin
- state.form.vehicleCustomerType=res.info.vehicleCustomerType
- state.form.ownerTel=res.info.customerInfo.customerTel
- state.form.userType=res.userType
-
- // 计算收费车型
- calculateVehicleType(state.form.approvedCount,state.form.axleCount,state.form.outsideDimensions,state.form.totalMass,state.form.vanType, function (res) {
- state.form.vehicleTypeNew=res
- });
- // 判断车辆用户类型
- judgeUseUserType()
- })
- .catch((err) => {
- console.log(err);
- });
- }
- // 判断客货类型
- const judgeVanType=()=>{
- if(state.form.vehicleType.indexOf('客车') || state.form.vehicleType.indexOf('轿车')){
- state.form.vanType=1
- state.form.isTractor = 0
- }else if(state.form.vehicleType.indexOf('牵引车') || state.form.vehicleType.indexOf('货车') || state.form.vehicleType.indexOf('挂车')){
- state.form.vanType=2
- state.form.isTractor = 1;
- }else{
- state.form.vanType=3
- }
- }
- // 判断车辆用户类型
- const judgeUseUserType=()=>{
- if(state.form.vanType==1){
- state.vehicleCustomerTypeRange=[
- {
- 'value':0,
- 'label':"普通车"
- }
- ]
- state.form.vehicleCustomerType = "0"
- state.form.vehicleCustomerTypeName = "普通车"
- }else{
- state.vehicleCustomerTypeRange=[
- {
- 'value':0,
- 'label':"普通车"
- },
- {
- 'label': "道路运输证经营范围仅有“货物专用运输(集装箱) ”的牵引车办理J类型集装箱",
- 'value': 24,
- },
- {
- 'label': "道路运输证经营范围不含“货物专用运输(集装箱)”的牵引车",
- 'value': 27,
- },
- {
- 'label': '道路运输证经营范围除“货物专用运输 (集装 箱)"外,还有“普通货运”等其他项目的牵引车办理J2类型集装箱',
- 'value': 28,
- }
-
- ]
- }
- }
- const checkCodeRequest = () => {
- if(!state.code){
- msg("请输入验证码");
- return;
- }
- const options = {
- type: 2,
- data: {
- mobile: state.form.ownerTel,
- code: state.code
- },
- method: "POST",
- showLoading: true,
- };
- return new Promise(async (resolve, reject) => {
- const res = await requestNew(messageValid, options);
- const data = res;
- resolve(data);
- }).catch((error) => {
- reject(error);
- });
-
- }
- //车牌号输入
- const carNumber = (val : any) => {
- state.form.vehiclePlate = val.trim();
- };
- const savaHandle = () => {
- if(!state.form.vehPosImgUrl){
- msg("请上传行驶证主页");
- return;
- }
- if(!state.form.vehNegImgUrl){
- msg("请上传行驶证副页");
- return;
- }
- if(!state.form.ownerName){
- msg("请输入变更车主姓名");
- return;
- }
- if(!state.form.vehicleType){
- msg("请输入变更车辆类型");
- return;
- }
- if(!state.form.ownerIdTypeStr){
- msg("请选择变更证件类型");
- return;
- }
- if(!checkStr(state.form.ownerIdNum, "card")){
- msg("请输入正确变更证件号码");
- return;
- }
- if(!state.form.ownerAddress){
- msg("请输入变更地址");
- return;
- }
- if(!state.form.totalMass){
- msg("请输入总质量");
- return;
- }
- if(!state.form.maintenanceMass){
- msg("请输入整备质量");
- return;
- }
- if(!state.form.axleCount){
- msg("请输入车轴数");
- return;
- }
- if(!state.form.outsideDimensions){
- msg("请输入外廓尺寸");
- return;
- }
- if(!state.form.approvedCount){
- msg("请输入核定载人数");
- return;
- }
- if(!state.form.engineNum){
- msg("请输入发动机号码");
- return;
- }
- if(!state.form.vin){
- msg("请输入车辆识别号");
- return;
- }
- if(!state.form.vehFrontUrl){
- msg("请上传车头照");
- return;
- }
- if(!state.form.vehBodyUrl){
- msg("请上传车身照");
- return;
- }
- if(state.form.isTractor==1){
- if(!state.form.roadTransportPermitPicUrl){
- msg("请上传道路运输许可证");
- return;
- }
- }
- if(state.form.vehicleCustomerType==null){
- msg("请选择车辆用户类型");
- return;
- }
-
- // 测完放开
- checkCodeRequest().then((val : any) => {
- const options = {
- type: 2,
- data: {
- ...state.form
- },
- method: "POST",
- showLoading: true,
- };
- //调用方式
- requestNew(vehicleInfoChangeApply, options)
- .then((res) => {
- console.log("res",res)
- msg(res.msg)
- setTimeout(() => {
- uni.navigateBack({
- delta: 2
- })
- }, 2000)
- })
- .catch((err) => {
- console.log(err);
- });
-
- })
- }
- const changeOwnerIdType = (item) => {
- state.form.ownerIdType = item[0].value
- state.form.ownerIdTypeStr = item[0].label
- console.log(item)
- }
- const vehicleCustomerTypeType = (item) => {
- state.form.vehicleCustomerType = item[0].value
- state.form.vehicleCustomerTypeName = item[0].label
- console.log(item)
- }
-
- const takePhotoMode = (index) => {
- console.log("index", index)
- state.isTakePhotoModeShow = true
- state.choiceIndex = index
- }
- // val 1 车头照 2 车身照 3道路运输许可证
- const cardFileImageUpdate = (val) => {
- uni.chooseImage({
- count: 1, //只能选取一张照片
- sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
- sourceType: ["camera", "album"], //从相册选择
- success: function (res) {
- uploadFile(res.tempFilePaths[0], "", "").then((data) => {
- if (val == 1) {
- state.form.vehFrontUrl = data;
- } else if(val == 2) {
- state.form.vehBodyUrl = data;
- }else if(val == 3) {
- state.form.roadTransportPermitPicUrl = data;
- }
- })
- },
- });
- };
- let waitTime = ref(0)
- //倒计时函数
- const codeInterval = () => {
- waitTime.value = 60
- let timer = setInterval(() => {
- if (waitTime.value == 1) {
- clearInterval(timer)
- }
- waitTime.value -= 1
- }, 1000)
- }
- const getCode = () => {
- console.log(123);
- if (checkStr(state.form.ownerTel, "mobile")) {
- sendCodeApi()
- codeInterval()
- } else {
- uni.showToast({
- title: '请输入正确的手机号',
- icon: 'none'
- });
- }
-
- }
- // 发送验证码
- const sendCodeApi = () => {
- //参数说明
- let options = {
- type: 2, //type: 2,JSON格式提交数据(默认表单形式提交)
- data: {
- mobile: state.form.ownerTel
- }, //请求参数
- method: "POST", //提交方式(默认POST)
- showLoading: true, //是否显示加载中(默认显示)
- };
-
- //调用方式
- requestNew(sendMessage, options)
- .then((res) => {
- let data = res
- console.log(data, "#################");
- if (data.info == "成功") {
- msg("发送成功")
- console.log('######################CCCCCCCCCCCCCCCCC');
- }
- })
- .catch((err) => {
- console.log(err);
- });
- }
- const cancle = () => {
- state.isTakePhotoModeShow = false
- }
- const takePhoto = (val) => {
- console.log("拍照", val)
- state.phoneType = val;
- state.showImg = true;
- }
- const xiangce = (val) => {
- console.log("val", val)
- if (state.choiceIndex == 3) {
- var imageType = 1;
- } else {
- var imageType = 2;
- }
- chooseImageCompress((res) => {
- state.images = res.tempFilePath ? res.tempFilePath : res.tempFilePaths[0]
- state.showImg = false
- state.phoneType = state.choiceIndex
- state.isTakePhotoModeShow = false
- console.log("res==",res,state.choiceIndex,state.images)
- })
- }
- const confirmReturn = (val) => {
- console.log("进来了")
- if (state.choiceIndex == 3) {
- var imageType = 1;
- } else {
- var imageType = 2;
- }
- state.phoneType = 0
- state.isTakePhotoModeShow = false
- uploadFile(val.tempImagePath, imageType, vehicleLicenseOcr).then((data) => {
- console.log('输出内容=====================', state.choiceIndex)
- if (state.choiceIndex == 3) {
- state.form.ownerName = data.man;
- state.form.ownerAddress = data.address;
- state.form.vehicleType = data.vehicle;
- state.form.vin = data.vin;
- state.form.engineNum = data.engine;
- state.form.vehPosImgUrl = data.imageUrl;
- state.form.vehPosImgOcrId = data.ocrResultId;
- state.form.useCharacter = data.character;
- // 判断客货类型
- judgeVanType()
- } else {
- state.form.approvedCount = data.apc.slice(0,-1);
- state.form.maintenanceMass = data.unladen.slice(0,-2);
- let overall=data.overall.replaceAll("x", "X")
- state.form.outsideDimensions = overall.slice(0,-2);
- state.form.totalMass = data.gross ? data.gross.slice(0,-2) : 0;
- state.form.vehNegImgUrl = data.imageUrl;
- state.form.vehNegImgOcrId = data.ocrResultId;
- state.form.permittedTowWeight=data.towing.slice(0,-2)
- // 计算收费车型
- calculateVehicleType(state.form.approvedCount,state.form.axleCount,state.form.outsideDimensions,state.form.totalMass,state.form.vanType, function (res) {
- state.form.vehicleTypeNew=res
- });
- // 判断车辆用户类型
- judgeUseUserType()
-
- console.log('=====================', state.form.vehNegImgUrl, state)
- }
-
- state.isTakePhotoModeShow = false
- })
- console.log("图片地址val", val.tempImagePath)
- }
- const camera = () => {
- state.phoneType = 0
- }
- const radioChange = (evt) => {
- console.log("evt.detail.value", evt.detail.value)
- for (let i = 0; i < state.items.length; i++) {
- if (state.items[i].value == evt.detail.value) {
- state.form.isMyselfHandle = i+1;
- break;
- }
- }
- console.log("state.form.isMyselfHandle", state.form.isMyselfHandle)
- }
- const radioChangeqyc = (evt) => {
- console.log("evt.detail.value", evt.detail.value)
- for (let i = 0; i < state.itemsqyc.length; i++) {
- if (state.itemsqyc[i].value == evt.detail.value) {
- state.form.isTractor = state.itemsqyc[i].value;
- break;
- }
- }
- console.log("state.form.isTractor", state.form.isTractor)
- }
-
- </script>
-
- <style lang="scss" scoped>
- .bg {
- background-color: white;
- width: 90%;
- margin: 0 auto;
- margin-top: 20rpx;
- border-radius: 12px;
- border: 1px solid #FFFFFF;
- padding: 30rpx 20rpx;
- overflow: hidden;
- box-sizing: border-box;
-
- .title_wrap {
- display: flex;
- font-weight: 400;
- justify-content: space-between;
- .title {
- font-size: 30rpx;
- color: #01243A;
- }
- }
-
- .des {
- font-weight: 400;
- font-size: 28rpx;
- color: #01243A;
- line-height: 56rpx;
- margin-top: 10rpx;
- text-indent: 1rem;
- }
- }
-
- .action {
- position: absolute;
- left: 0;
- height: 160rpx;
- background-color: #fff;
- border-radius: 30rpx 30rpx 0 0;
- width: 100vw;
- display: flex;
- align-items: center;
- justify-content: center;
- flex-direction: column;
- margin-top: 20rpx;
- }
- .card{
- display: flex;
- align-items: center;
- image{
- width: 120rpx;
- height: 120rpx;
- margin-right: 20rpx;
- }
- .details view:first-child{
- margin-bottom: 10rpx;
- }
- }
- .picture-wrapper {
- margin-top: 30rpx;
-
- .bg1 {
- background: #F5F9FB;
- border-radius: 10rpx;
- padding: 40rpx 30rpx;
- display: flex;
- justify-content: space-between;
-
- .name {
- padding-top: 30rpx;
- font-size: 32rpx;
- font-family: SourceHanSansSC, SourceHanSansSC;
- font-weight: 500;
- color: #111;
- line-height: 34rpx;
- }
-
- .value {
- margin-top: 20rpx;
- font-size: 22rpx;
- font-family: SourceHanSansSC, SourceHanSansSC;
- font-weight: 400;
- color: #999999;
- line-height: 24rpx;
- }
-
- .tip {
- margin-top: 20rpx;
- text-align: center;
- width: 100rpx;
- height: 30rpx;
- border-radius: 6rpx;
- border: 1rpx solid #CCB375;
-
- .tip-value {
- font-size: 20rpx;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #CCB375;
- line-height: 30rpx;
- opacity: 1;
- }
- }
- }
-
- .icon {
- width: 304rpx;
- height: 190rpx;
- background-image: var(--bgimg);
- background-size: 100% 100%;
- background-repeat: no-repeat;
- }
- }
- .search{
- background: #F8F4E7;
- border-radius: 10rpx;
- border: 1px solid #CCB375;
- font-size: 24rpx;
- color: #CCB375;
- padding: 0rpx 14rpx;
- flex-shrink: 0;
- height: 60rpx;
- line-height: 60rpx;
- margin-left: 20rpx;
- }
- .showworld{
- display: flex;
- justify-content: flex-end;
- }
- .choice-takePhoto-wrap {
- width: 100%;
- height: 100vh;
- background-color: rgba(127, 127, 127, 0.2);
- position: fixed;
- left: 0;
- top: 0;
- z-index: 11111;
- .choice-takePhoto {
- position: absolute;
- bottom: 0;
- background-color: white;
- width: 100%;
- border-radius: 20rpx 20rpx 0 0;
- }
-
- .choice-takePhoto>view:first-child {
- text-align: center;
- height: 80rpx;
- line-height: 80rpx;
- border-bottom: 1rpx solid rgba(127, 127, 127, 0.3);
- background-color: white;
- }
-
- .choice-takePhoto>view:last-child {
- text-align: center;
- height: 80rpx;
- line-height: 80rpx;
- border-top: 6rpx solid rgba(127, 127, 127, 0.1);
- background-color: white;
- }
-
- .choice-takePhoto>view {
- text-align: center;
- height: 80rpx;
- line-height: 80rpx;
- background-color: white;
- }
- }
- .right-show{
- display: flex;
- justify-content: flex-end;
- }
- </style>
|