身份证正面面,代码恢复

This commit is contained in:
2024-09-23 10:03:14 +08:00
parent b6d86c4517
commit 0e82be5cbe
2 changed files with 28 additions and 6432 deletions

View File

@ -16,26 +16,27 @@
<img class="startImg" src="@/assets/start.png" /> <img class="startImg" src="@/assets/start.png" />
<span>身份证正面</span> <span>身份证正面</span>
</div> </div>
<van-image @click="handlePreview" @remove="handleRemove" style="width: 54px;height: 54px;" class="camerImg" v-if="identityCardFront" :src="identityCardFront" /> <!-- <van-image @click="handlePreview" @remove="handleRemove" style="width: 54px;height: 54px;" class="camerImg" v-if="identityCardFront" :src="identityCardFront" />-->
<el-upload <!-- <el-upload-->
v-else <!-- v-else-->
:action="baseURL + '/order/uploadImage'" <!-- :action="baseURL + '/order/uploadImage'"-->
:headers='authorization' <!-- :headers='authorization'-->
accept=".png,.jpg,.jpeg,.zip,.rar,.xlsx,.xsavels,.pdf,.PDF,.doc,.docx" <!-- accept=".png,.jpg,.jpeg,.zip,.rar,.xlsx,.xsavels,.pdf,.PDF,.doc,.docx"-->
:on-success="changeHandle" <!-- :on-success="changeHandle"-->
:before-upload="checkImgType" <!-- :before-upload="checkImgType"-->
class="upload-demo" <!-- class="upload-demo"-->
:show-file-list="false" <!-- :show-file-list="false"-->
> <!-- >-->
<van-icon slot="default" name="plus" style="font-size: 54px" /> <!-- <van-icon slot="default" name="plus" style="font-size: 54px" />-->
</el-upload> <!-- </el-upload>-->
<!-- <van-uploader <van-uploader
v-model="identityCardFrontList" v-model="identityCardFrontList"
:after-read="identityCardFrontHandler" :after-read="identityCardFrontHandler"
:max-count="1" :max-count="1"
:preview-size="54" :preview-size="54"
accept="image/png, image/jpeg" :max-size="5 * 1024 * 1024"
/>--> accept="image/*"
/>
</div> </div>
<div class="lineBot"></div> <div class="lineBot"></div>
<div class="itemContent"> <div class="itemContent">
@ -48,8 +49,7 @@
:after-read="identityCardBackHandler" :after-read="identityCardBackHandler"
max-count="1" max-count="1"
:preview-size="54" :preview-size="54"
accept="image/*" accept="image "
capture="camcorder/*"
/> />
</div> </div>
<div class="lineBot"></div> <div class="lineBot"></div>
@ -152,15 +152,15 @@ import {saveDriver, uploadImage, ocrHandler} from "@/api/mine"
import TwoCommonBtn from "@/components/twoBtnCommon.vue" import TwoCommonBtn from "@/components/twoBtnCommon.vue"
import CellGroup from "@/components/cellGroup.vue" import CellGroup from "@/components/cellGroup.vue"
import {formatDate1} from "@/utils/common" import {formatDate1} from "@/utils/common"
import {ImagePreview} from "vant"; // import {ImagePreview} from "vant";
export default { export default {
name: "driverAdd", name: "driverAdd",
mixins:[myMixins], mixins:[myMixins],
data(){ data(){
return{ return{
baseURL:'', // baseURL:'',
licenseOcrInfo:'', // licenseOcrInfo:'',
id:'', id:'',
driverName:"", driverName:"",
driverPhone:"", driverPhone:"",
@ -187,11 +187,11 @@ export default {
idCardValidStartTime:'', idCardValidStartTime:'',
idCardValidEndTime:'', idCardValidEndTime:'',
// authorization:{Authorization: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJzb25nIiwiYXVkIjpbInN1cHBsaWVyLWFwcCJdLCJuYmYiOjE3MjY4MDk4MTQsInVzZXJfaW5mbyI6eyJ1c2VySWQiOjU0NjU0LCJwaG9uZSI6IjE3NjMwMDM1NjU4IiwibmFtZSI6InNvbmciLCJzdXBwbGllck5hbWUiOiLkuIrmtbfmtYvor5XkvpvlupTllYYiLCJzdXBwbGllcklkIjozMzA0MSwic3VwcGxpZXJUeXBlIjoyLCJ1c2VybmFtZSI6InNvbmciLCJ1c2VyVHlwZSI6InJlc2N1ZUFwcCIsImRldmljZUlkIjoiMTkwZTM1ZjdlMTRhYzdjMDAwNyIsImF1dGhvcml0aWVzIjpbXX0sInNjb3BlIjpbImFsbCJdLCJpc3MiOiJodHRwczovL3Npbm9hc3Npc3QuY29tIiwiZXhwIjoxNzI2ODk2MjE0LCJpYXQiOjE3MjY4MDk4MTR9.5KTAMXZf8ll6HS4Z49YJQ1HiRvHr79Q1goDAGEtsBmY'}, // authorization:{Authorization: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJzb25nIiwiYXVkIjpbInN1cHBsaWVyLWFwcCJdLCJuYmYiOjE3MjY4MDk4MTQsInVzZXJfaW5mbyI6eyJ1c2VySWQiOjU0NjU0LCJwaG9uZSI6IjE3NjMwMDM1NjU4IiwibmFtZSI6InNvbmciLCJzdXBwbGllck5hbWUiOiLkuIrmtbfmtYvor5XkvpvlupTllYYiLCJzdXBwbGllcklkIjozMzA0MSwic3VwcGxpZXJUeXBlIjoyLCJ1c2VybmFtZSI6InNvbmciLCJ1c2VyVHlwZSI6InJlc2N1ZUFwcCIsImRldmljZUlkIjoiMTkwZTM1ZjdlMTRhYzdjMDAwNyIsImF1dGhvcml0aWVzIjpbXX0sInNjb3BlIjpbImFsbCJdLCJpc3MiOiJodHRwczovL3Npbm9hc3Npc3QuY29tIiwiZXhwIjoxNzI2ODk2MjE0LCJpYXQiOjE3MjY4MDk4MTR9.5KTAMXZf8ll6HS4Z49YJQ1HiRvHr79Q1goDAGEtsBmY'},
authorization:{Authorization:''}, // authorization:{Authorization:''},
} }
}, },
mounted() { mounted() {
if (window.location.href.includes('www.sinoassist.com')) { /* if (window.location.href.includes('www.sinoassist.com')) {
this.baseURL = 'https://api.sinoassist.com' this.baseURL = 'https://api.sinoassist.com'
} else if (window.location.href.includes('ccreview.sino-assist.com')) { } else if (window.location.href.includes('ccreview.sino-assist.com')) {
this.baseURL = 'https://api.sinoassist.com' this.baseURL = 'https://api.sinoassist.com'
@ -201,7 +201,7 @@ export default {
} }
let token=localStorage.getItem('token') let token=localStorage.getItem('token')
this.authorization.Authorization=token; this.authorization.Authorization=token;*/
this.id = this.$route.params?.id; this.id = this.$route.params?.id;
this.driverName = this.$route.params?.name; this.driverName = this.$route.params?.name;
this.driverPhone = this.$route.params?.phone; this.driverPhone = this.$route.params?.phone;
@ -245,7 +245,7 @@ export default {
isUse(e){ isUse(e){
this.states=e this.states=e
}, },
checkImgType(file) { /* checkImgType(file) {
const FileExt = file.name.replace(/.+\./, ""); const FileExt = file.name.replace(/.+\./, "");
const isLt5M = file.size / 1024 / 1024 < 5; const isLt5M = file.size / 1024 / 1024 < 5;
const whiteList = ['png', 'jpeg', 'jpg']; const whiteList = ['png', 'jpeg', 'jpg'];
@ -258,7 +258,7 @@ export default {
return false return false
} }
}, },
handleRemove() { handleRemove() {
this.identityCardFront = '' this.identityCardFront = ''
}, },
handlePreview() { handlePreview() {
@ -279,9 +279,8 @@ export default {
} else { } else {
this.$toast('上传失败') this.$toast('上传失败')
} }
}, },*/
async identityCardFrontHandler(file, detail) { // 上传身份证正面照片 async identityCardFrontHandler(file) { // 上传身份证正面照片
console.log("检查文件类型",file, detail)
const formData = new FormData(); const formData = new FormData();
formData.append("file" , file.file); formData.append("file" , file.file);
let res = await uploadImage(formData) let res = await uploadImage(formData)

6403
yarn.lock

File diff suppressed because it is too large Load Diff