story#7189,回程车小程序司机端-迁移认证

This commit is contained in:
2025-09-09 16:39:28 +08:00
parent 781ef75913
commit 36db96808a
5 changed files with 95 additions and 62 deletions

View File

@ -7,23 +7,22 @@
<van-radio name="0"></van-radio>
<van-radio name="1"></van-radio>
</van-radio-group>
<!-- <radio-group @change="radioChange" class="flexWrap">
<label class="flexWrap labelWrap" v-for="(item, index) in options" :key="item.value">
<div class="flexWrap center"><radio :value="item.value" :checked="index == inSure" />{{item.name}}</div>
</label>
</radio-group>-->
</div>
<div class="photoWrap" v-if="inSure == 1">
<template v-if="urlList.length>0">
<div v-for="(item,index) in urlList" :key="index" @click="chooseHandler('urlList',index)">
<img class="photo_item" mode="widthFix" :src="item.replace(/http:\/\//g, 'https://')" />
</div>
</template>
<div v-if="urlList.length < 3" @click="chooseHandler('urlList')" class="tipWrap">
<img class="photo_item" mode="widthFix" src="@/assets/authentication/carInfo_icon5.png" />
<img class="camera" v-if="showFun()" src="@/assets/authentication/camera.png" />
<span class="picNum">({{urlList.length}}/3)</span>
</div>
<div class="photoWrap" v-if="form.isInsure == 1">
<van-uploader :after-read="(file) => afterRead(file,'urlList')" class="customUploadMul" max-count="3" :disabled="!showFun()">
<template v-if="urlList.length > 0">
<div v-for="(item, index) in urlList" :key="'uploaded-' + index" class="uploaded-item">
<img class="photo_item" mode="widthFix" :src="item.replace(/http:\/\//g, 'https://')" />
</div>
</template>
<template v-if="urlList.length < 3">
<div class="tipWrap">
<img class="photo_item" mode="widthFix" src="@/assets/authentication/carInfo_icon5.png"/>
<img class="camera" v-if="showFun()" src="@/assets/authentication/camera.png" />
<span class="picNum">({{ urlList.length }}/3)</span>
</div>
</template>
</van-uploader>
</div>
</template>
<template v-else>
@ -32,31 +31,32 @@
<span>{{title}}</span>
</div>
<div class="photo_img flex flex_between">
<div @click="chooseHandler('leftImg')">
<template v-if="form.leftImg">
<img class="photo_item" mode="widthFix" :src="form.leftImg.replace(/http:\/\//g, 'https://')" />
</template>
<template v-else>
<img class="photo_item" mode="widthFix" :src="leftUrl.replace(/http:\/\//g, 'https://')" />
<img class="camera" v-if="showFun()" src="@/assets/authentication/camera.png" />
</template>
<div></div>
</div>
<div v-if="rightUrl" @click="chooseHandler('rightImg')">
<van-uploader v-if="leftUrl" :after-read="(file) => afterRead(file,'leftImg')" class="customUpload" :disabled="!showFun()">
<template v-if="form.leftImg">
<img class="photo_item" mode="widthFix" :src="form.leftImg.replace(/http:\/\//g, 'https://')" />
</template>
<template v-else>
<img class="photo_item" mode="widthFix" :src="leftUrl" />
<img class="camera" v-if="showFun()" src="@/assets/authentication/camera.png" />
</template>
</van-uploader>
<van-uploader v-if="rightUrl" :after-read="(file) => afterRead(file,'rightImg')" class="customUpload" :disabled="!showFun()">
<template v-if="form.rightImg">
<img class="photo_item" mode="widthFix" :src="form.rightImg.replace(/http:\/\//g, 'https://')" />
</template>
<template v-else>
<img class="photo_item" mode="widthFix" :src="rightUrl.replace(/http:\/\//g, 'https://')" />
<img class="photo_item" mode="widthFix" :src="rightUrl" />
<img class="camera" v-if="showFun()" src="@/assets/authentication/camera.png" />
</template>
</div>
</van-uploader>
</div>
</template>
</div>
</template>
<script>
import {uploadImage} from "@/api/mine";
let baseUrl=''
if (window.location.href.includes('www.sinoassist.com')) {
baseUrl = 'https://www.sinoassist.com'
@ -92,22 +92,37 @@ export default {
leftImg: '',
rightImg: '',
urlList:[],
isInsure:-1,
isInsure:1,
},
options:[{value:0,name:'否'},{value:1,name:'是'}],
}
},
mounted() {
activated() {
console.log("inSure",this.inSure)
},
mounted() {
},
methods: {
radioChange(e){
// this.form.isInsure=e?.detail?.value
async afterRead(file,type,index){
const formData = new FormData();
formData.append("file" , file.file);
let res = await uploadImage(formData)
if (type=='urlList' && (index==0 || index)){
this.$set( this.form.urlList,index,res.data)
}else if(type=='urlList'){
this.form[type].push(res.data)
}else{
this.form[type] = res.data
}
this.$emit(type, this.form[type])
},
radioChange(val){
this.$emit('insureHandle',val)
if(this.form.isInsure==0){
this.form.urlList=[]
this.$emit('urlList', this.form.urlList)
}
this.$emit('insureHandle',e?.detail?.value)
},
showFun() {
if( localStorage.getItem('infoVerify') == 8 || localStorage.getItem('infoVerify') == 12 ) {
@ -194,6 +209,23 @@ export default {
<style lang="scss" scoped>
@import "@/styles/common.scss";
.customUpload{
width: calc(50% - 3px);
::v-deep .van-uploader__input-wrapper{
width: 100% !important;
}
}
.customUploadMul{
width: 100%;
::v-deep .van-uploader__input-wrapper{
width: 100% !important;
display: flex;
flex-wrap: wrap;
}
.uploaded-item,.tipWrap{
width: calc(50% - 3px);
}
}
.photo_wrap {
padding: 20px 12px 22px 17px;
background: #FFFFFF;
@ -247,7 +279,7 @@ export default {
margin-right: 4px;
}
div {
width: calc(50% - 3px);
//width: calc(50% - 3px);
position: relative;
.photo_item {
width: 100%;