身份证正面面,代码恢复

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

6403
yarn.lock

File diff suppressed because it is too large Load Diff