|
|
@@ -1,820 +0,0 @@ |
|
|
|
<template> |
|
|
|
<view class="content-wrap"> |
|
|
|
<view @click="tabChange(true)"> |
|
|
|
<view :class="state.isMyPeopple ? 'big' : 'nomal'"> 本人车辆 </view> |
|
|
|
<view :class="state.isMyPeopple ? 'tip' : ''"> </view> |
|
|
|
</view> |
|
|
|
<view @click="tabChange(false)" style="margin-left: 60rpx" class="" v-if="state.isEnableOther"> |
|
|
|
<view :class="state.isMyPeopple ? 'nomal' : 'big'"> 他人车辆 </view> |
|
|
|
<view :class="state.isMyPeopple ? '' : 'tip'"> </view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view v-if="state.isMyPeopple" class="content"> |
|
|
|
<view class="item-tips"> |
|
|
|
<view class="title"> 上传后请核对识别信息 </view> |
|
|
|
<view class="tip"> 如有错误请及时手动修改 </view> |
|
|
|
</view> |
|
|
|
<view class="picture-wrapper" @click="takePhotoMode('1','my')"> |
|
|
|
<view class="bg"> |
|
|
|
<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.userPosImgUrl" class="icon" :src="`${$imgUrl}applyCard/renxiang.png`"> |
|
|
|
</image> |
|
|
|
<image v-else class="icon" :src="strReplace(state.form.userPosImgUrl)"></image> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="picture-wrapper" @click="takePhotoMode('2','my')"> |
|
|
|
<view class="bg"> |
|
|
|
<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.userNegImgUrl" class="icon" :src="`${$imgUrl}applyCard/guohui.png`"> |
|
|
|
</image> |
|
|
|
<image v-else class="icon" :src="strReplace(state.form.userNegImgUrl)"></image> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="shibie-wrapper"> |
|
|
|
<view class="title"> 识别内容如下 </view> |
|
|
|
<u-form label-width="230" :model="state.form" ref="uForm"> |
|
|
|
<u-form-item label="姓名"> |
|
|
|
<u-input v-model="state.form.userName" placeholder='请输入姓名' :disabled="state.isEnableOCRData" |
|
|
|
maxlength="20" @input="replaceInput" /> |
|
|
|
</u-form-item> |
|
|
|
<u-form-item label="身份证号"> |
|
|
|
<u-input placeholder='请输入身份证' type="idcard" v-model="state.form.userIdNum" |
|
|
|
:disabled="state.isEnableOCRData" maxlength="18" /> |
|
|
|
</u-form-item> |
|
|
|
<u-form-item label="地址"> |
|
|
|
<u-input placeholder='请输入地址' height='38' type='textarea' :autoHeight='true' |
|
|
|
v-model="state.form.address" :disabled="state.isEnableOCRData" maxlength="100" /> |
|
|
|
</u-form-item> |
|
|
|
<u-form-item label="联系方式"> |
|
|
|
<u-input placeholder='请输入联系方式' type="number" v-model="state.form.tel" maxlength="11" /> |
|
|
|
</u-form-item> |
|
|
|
</u-form> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="green-tip"> |
|
|
|
如识别信息有误,请手动修改,确认无误后,点击下一步! |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="action"> |
|
|
|
<button type="default" class="button" @click="savaHandle()"> |
|
|
|
下一步 |
|
|
|
</button> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view v-else class="content"> |
|
|
|
<view class="title"> 车主信息 </view> |
|
|
|
<view class="item-tips"> |
|
|
|
<view class="title"> 上传后请核对识别信息 </view> |
|
|
|
<view class="tip"> 如有错误请及时手动修改 </view> |
|
|
|
</view> |
|
|
|
<view class="picture-wrapper" @click="takePhotoMode('1','my')"> |
|
|
|
<view class="bg"> |
|
|
|
<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.userPosImgUrl" class="icon" :src="`${$imgUrl}applyCard/renxiang.png`"> |
|
|
|
</image> |
|
|
|
<image v-else class="icon" :src="strReplace(state.form.userPosImgUrl)"></image> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="picture-wrapper" @click="takePhotoMode('2','my')"> |
|
|
|
<view class="bg"> |
|
|
|
<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.userNegImgUrl" class="icon" :src="`${$imgUrl}applyCard/guohui.png`"> |
|
|
|
</image> |
|
|
|
<image v-else class="icon" :src="strReplace(state.form.userNegImgUrl)"></image> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="shibie-wrapper"> |
|
|
|
<view class="title"> 识别内容如下 </view> |
|
|
|
<u-form label-width="200" :model="state.form" ref="uForm"> |
|
|
|
<u-form-item label="姓名"> |
|
|
|
<u-input inputAlign="right" placeholder='请输入姓名' v-model="state.form.userName" |
|
|
|
:disabled="state.isEnableOCRData" maxlength="20" /> |
|
|
|
</u-form-item> |
|
|
|
<!-- <u-form-item label="性别"> |
|
|
|
<u-input inputAlign="right" placeholder='请选择性别' v-model="state.form.gender" type="select" /> |
|
|
|
</u-form-item> --> |
|
|
|
<u-form-item label="身份证号"> |
|
|
|
<u-input inputAlign="right" placeholder='请输入身份证号' v-model="state.form.userIdNum" |
|
|
|
:disabled="state.isEnableOCRData" type="idcard" /> |
|
|
|
</u-form-item> |
|
|
|
<u-form-item label="联系方式"> |
|
|
|
<u-input inputAlign="right" placeholder='请输入联系方式' v-model="state.form.tel" maxlength="11" /> |
|
|
|
</u-form-item> |
|
|
|
</u-form> |
|
|
|
</view> |
|
|
|
<view style="margin-top: 30rpx" class="title"> 代办人信息 </view> |
|
|
|
<view class="item-tips"> |
|
|
|
<view class="title"> 上传后请核对识别信息 </view> |
|
|
|
<view class="tip"> 如有错误请及时手动修改 </view> |
|
|
|
</view> |
|
|
|
<view class="picture-wrapper" @click="takePhotoMode('1','other')"> |
|
|
|
<view class="bg"> |
|
|
|
<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.agentPosImgUrl" class="icon" :src="`${$imgUrl}applyCard/renxiang.png`"> |
|
|
|
</image> |
|
|
|
<image v-else class="icon" :src="strReplace(state.form.agentPosImgUrl)"></image> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="picture-wrapper" @click="takePhotoMode('2','other')"> |
|
|
|
<view class="bg"> |
|
|
|
<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.agentNegImgUrl" class="icon" :src="`${$imgUrl}applyCard/guohui.png`"> |
|
|
|
</image> |
|
|
|
<image v-else class="icon" :src="strReplace(state.form.agentNegImgUrl)"></image> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="picture-wrapper" @click="cardFileImageUpdate()" v-if='state.isEnableBook'> |
|
|
|
<view class="bg"> |
|
|
|
<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.proxyUrl" class="icon" :src="`${$imgUrl}applyCard/weituoshu.png`"> |
|
|
|
</image> |
|
|
|
<image v-else class="icon" :src="strReplace(state.form.proxyUrl)"></image> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="shibie-wrapper"> |
|
|
|
<view class="title"> 识别内容如下 </view> |
|
|
|
<u-form label-width="200" :model="state.form" ref="uForm"> |
|
|
|
<u-form-item label="经办人姓名"> |
|
|
|
<u-input inputAlign="right" placeholder='请输入经办人姓名' v-model="state.form.agentName" |
|
|
|
:disabled="state.isEnableOCRData" maxlength="20" /> |
|
|
|
</u-form-item> |
|
|
|
<u-form-item label="身份证号"> |
|
|
|
<u-input inputAlign="right" placeholder='请输入身份证号' v-model="state.form.agentIdNum" |
|
|
|
:disabled="state.isEnableOCRData" maxlength="18" type="idcard" /> |
|
|
|
</u-form-item> |
|
|
|
<u-form-item label="联系方式"> |
|
|
|
<u-input inputAlign="right" placeholder='请输入联系方式' v-model="state.form.agentTel" type="number" |
|
|
|
maxlength="11" /> |
|
|
|
</u-form-item> |
|
|
|
</u-form> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="green-tip"> |
|
|
|
如识别信息有误,请手动修改,确认无误后,点击下一步! |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="action"> |
|
|
|
<button type="default" class="button" @click="savaHandle()"> |
|
|
|
下一步 |
|
|
|
</button> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<u-select mode="single-column" :list="state.genderList" v-model="state.genderShow" @confirm="genderSelectConfirm"> |
|
|
|
</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 viewfinder from "../../components/viewfinder.vue" |
|
|
|
import navBgCar from "./components/nav-bg-car3"; |
|
|
|
import { |
|
|
|
reactive, |
|
|
|
ref, |
|
|
|
} from "vue"; |
|
|
|
import { |
|
|
|
msg, |
|
|
|
checkStr, |
|
|
|
strReplace, |
|
|
|
uploadFile |
|
|
|
} from "@/utils/utils"; |
|
|
|
import { |
|
|
|
onLoad, |
|
|
|
onPageScroll, |
|
|
|
} from "@dcloudio/uni-app"; |
|
|
|
import { |
|
|
|
etcUserCardInfoSubmit, |
|
|
|
fileUpload, |
|
|
|
registerFull, |
|
|
|
getUserMsg,idCardOcr,userUpload |
|
|
|
} from "@/utils/network/api.js"; |
|
|
|
|
|
|
|
import { |
|
|
|
request, requestNew |
|
|
|
} from "@/utils/network/request.js"; |
|
|
|
|
|
|
|
import { |
|
|
|
stringToJson |
|
|
|
} from "@/utils/network/encryption"; |
|
|
|
import { |
|
|
|
setItem, |
|
|
|
getItem, |
|
|
|
} from "@/utils/storage"; |
|
|
|
import { |
|
|
|
getCodeName |
|
|
|
} from "@/datas/queryKey.js"; |
|
|
|
import navBar from "@/components/nav-bar/nav-bar2.vue"; |
|
|
|
const scrollTop = ref(0) |
|
|
|
const state = reactive({ |
|
|
|
showImg: true, |
|
|
|
isMy: "",//自己办理 他人办理 |
|
|
|
phoneType: 0, // 1 身份证正面 2 身份证反面 3行驶证正面 4行驶证反面 |
|
|
|
choiceIndex: 1, // 1 身份证正面 2 身份证反面 |
|
|
|
isTakePhotoModeShow: false, //选择拍照方式是否出来 |
|
|
|
images: '', |
|
|
|
genderList: [{ |
|
|
|
value: '男', |
|
|
|
label: '男' |
|
|
|
}, |
|
|
|
{ |
|
|
|
value: '女', |
|
|
|
label: '女' |
|
|
|
} |
|
|
|
], |
|
|
|
form: { |
|
|
|
orderId: "", //订单ID |
|
|
|
userName: "", //开户人姓名 |
|
|
|
userIdType: "101", //用户证件类型 101//身份证 |
|
|
|
userIdNum: "", //用户证件号码 |
|
|
|
userPosImgUrl: "", //身份证正面 |
|
|
|
userNegImgUrl: "", //身份证反面 |
|
|
|
tel: "", //开户人手机号 |
|
|
|
address: "", //开户人地址 |
|
|
|
sceneType: "", //用户协议支撑服务场景(发行服务机构和用户签订的协议) |
|
|
|
channelId: "", //渠道id |
|
|
|
gender: "", |
|
|
|
customerIdVld: "", |
|
|
|
agentName: "", |
|
|
|
agentGender: "", |
|
|
|
agentTel: '', |
|
|
|
agentPhone: "", |
|
|
|
agentIdType: "101", |
|
|
|
agentIdNum: "", |
|
|
|
agentPosImgUrl: "", |
|
|
|
agentNegImgUrl: "", |
|
|
|
proxyUrl: "", |
|
|
|
agentAddress: "", |
|
|
|
agentIdVld: '', |
|
|
|
opId: '', |
|
|
|
orderSource: 'WECHAT', |
|
|
|
}, |
|
|
|
|
|
|
|
genderShow: false, |
|
|
|
orderId: "", |
|
|
|
vehiclePlateColor: undefined, |
|
|
|
isMyPeopple: true, |
|
|
|
isSign: '', |
|
|
|
type: 1, |
|
|
|
isEnableOther: true, //小程序是否支持他人办理 |
|
|
|
isEnableBook: true, //他人办理时是否上传委托书 |
|
|
|
isEnableInfo: true, //小程序信息带出 |
|
|
|
isEnableOCRData: true, //允许修改OCR识别出来的数据 |
|
|
|
}); |
|
|
|
const userGenderAction = () => { |
|
|
|
state.genderShow = true; |
|
|
|
}; |
|
|
|
|
|
|
|
const genderSelectConfirm = (e) => { |
|
|
|
state.form.gender = '' |
|
|
|
e.map((val, index) => { |
|
|
|
state.form.gender = val.label; |
|
|
|
}) |
|
|
|
}; |
|
|
|
|
|
|
|
const camera = () => { |
|
|
|
state.phoneType = 0 |
|
|
|
} |
|
|
|
|
|
|
|
const savaHandle = () => { |
|
|
|
if (!checkStr(state.form.userIdNum, 'card')) { |
|
|
|
msg('请输入正确身份证'); |
|
|
|
return; |
|
|
|
} |
|
|
|
if (!checkStr(state.form.tel, 'mobile')) { |
|
|
|
msg('请输入正确手机号'); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
//如果未登录||新用户 |
|
|
|
if (!getItem('openId')) { |
|
|
|
let data = { |
|
|
|
userType: "PERSONAL", |
|
|
|
idNum: state.form.userIdNum, |
|
|
|
idType: state.form.userIdType, |
|
|
|
mobile: state.form.tel, |
|
|
|
userName: state.form.userName, |
|
|
|
gender: state.form.gender == '男' ? 'MALE' : 'FEMALE', |
|
|
|
certifyChannel: "BAIDUOCR", |
|
|
|
address: state.form.address, |
|
|
|
agentIdNum: state.form.agentIdNum, |
|
|
|
agentIdType: state.form.agentIdType, |
|
|
|
agentName: state.form.agentName, |
|
|
|
department: "", |
|
|
|
userIdImgUrl: state.form.userPosImgUrl, |
|
|
|
userIdImgBase64: "", |
|
|
|
} |
|
|
|
const options = { |
|
|
|
type: 2, |
|
|
|
data: data, |
|
|
|
method: "POST", |
|
|
|
showLoading: true, |
|
|
|
}; |
|
|
|
requestNew(registerFull, options).then((res) => { |
|
|
|
let result = res; |
|
|
|
if (result.accessToken && result.openId) { |
|
|
|
setItem('token', result.accessToken) |
|
|
|
setItem('openId', result.openId) |
|
|
|
|
|
|
|
state.form.opId = result.openId; |
|
|
|
let data = state.form; |
|
|
|
const options = { |
|
|
|
type: 2, |
|
|
|
data: data, |
|
|
|
method: "POST", |
|
|
|
showLoading: true, |
|
|
|
}; |
|
|
|
requestNew(userUpload, options).then((res) => { |
|
|
|
console.log(res); |
|
|
|
uni.redirectTo({ |
|
|
|
url: `/subpackage/orders/car-release?orderId=${state.orderId}&vehiclePlateColor=${state.vehiclePlateColor}&type=${state.type}&isSign=${state.isSign}`, |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
} else { |
|
|
|
// 已经登录 |
|
|
|
let data = state.form; |
|
|
|
const options = { |
|
|
|
type: 2, |
|
|
|
data: data, |
|
|
|
method: "POST", |
|
|
|
showLoading: true, |
|
|
|
}; |
|
|
|
requestNew(userUpload, options).then((res) => { |
|
|
|
console.log(res); |
|
|
|
uni.redirectTo({ |
|
|
|
url: `/subpackage/orders/car-release?orderId=${state.orderId}&vehiclePlateColor=${state.vehiclePlateColor}&type=${state.type}&isSign=${state.isSign}`, |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
}; |
|
|
|
const cardFileImageUpdate = () => { |
|
|
|
uni.chooseImage({ |
|
|
|
count: 1, //只能选取一张照片 |
|
|
|
sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有 |
|
|
|
sourceType: ["camera", "album"], //从相册选择 |
|
|
|
success: function (res) { |
|
|
|
uploadFile(res.tempFilePaths[0], "", "").then((data) => { |
|
|
|
state.form.proxyUrl = data; |
|
|
|
}) |
|
|
|
}, |
|
|
|
}); |
|
|
|
}; |
|
|
|
|
|
|
|
//tab切换 |
|
|
|
const tabChange = (val : any) => { |
|
|
|
state.isTakePhotoModeShow = false |
|
|
|
if (val) { |
|
|
|
state.isMyPeopple = true; |
|
|
|
} else { |
|
|
|
state.isMyPeopple = false; |
|
|
|
} |
|
|
|
state.form = { |
|
|
|
orderId: state.orderId, //订单ID |
|
|
|
userName: "", //开户人姓名 |
|
|
|
userIdType: "101", //用户证件类型 101//身份证 |
|
|
|
userIdNum: "", //用户证件号码 |
|
|
|
userPosImgUrl: "", //身份证正面 |
|
|
|
userNegImgUrl: "", //身份证反面 |
|
|
|
tel: "", //开户人手机号 |
|
|
|
address: "", //开户人地址 |
|
|
|
sceneType: "", //用户协议支撑服务场景(发行服务机构和用户签订的协议) |
|
|
|
channelId: "", //渠道id |
|
|
|
gender: "", |
|
|
|
customerIdVld: "", |
|
|
|
agentName: "", |
|
|
|
agentGender: "", |
|
|
|
agentTel: '', |
|
|
|
agentPhone: "", |
|
|
|
agentIdType: "101", |
|
|
|
agentIdNum: "", |
|
|
|
agentPosImgUrl: "", |
|
|
|
agentNegImgUrl: "", |
|
|
|
proxyUrl: "", |
|
|
|
agentAddress: "", |
|
|
|
agentIdVld: '', |
|
|
|
}; |
|
|
|
}; |
|
|
|
onLoad((option : any) => { |
|
|
|
state.form.orderId = option.orderId; |
|
|
|
state.orderId = option.orderId; |
|
|
|
state.vehiclePlateColor = option.vehiclePlateColor; |
|
|
|
state.form.opId = getItem('openId') ? getItem('openId') : ''; |
|
|
|
state.isSign = option.isSign; |
|
|
|
state.type = option.type; |
|
|
|
//state.fromOrder = option.fromOrder //是否来自订单-修改资料 |
|
|
|
getGlobalParam(); //全局配置数据 |
|
|
|
console.log("option", option) |
|
|
|
}); |
|
|
|
|
|
|
|
//监听页面滚动 |
|
|
|
onPageScroll((e) => { |
|
|
|
scrollTop.value = e.scrollTop; |
|
|
|
}); |
|
|
|
const replaceInput = (event) => { |
|
|
|
console.log("event", event) |
|
|
|
const screeningStr = /[^\u4E00-\u9FA5]/g; //想禁止什么类型,在这里替换正则就可以了 |
|
|
|
if (screeningStr.test(event)) { |
|
|
|
setTimeout(() => { |
|
|
|
state.form.userName = event.replace(screeningStr, ''); |
|
|
|
}, 100) |
|
|
|
} else { |
|
|
|
setTimeout(() => { |
|
|
|
state.form.userName = event; |
|
|
|
}, 100) |
|
|
|
} |
|
|
|
console.log("event.replace(screeningStr, '')", event.replace(screeningStr, ''), event, state.form.userName) |
|
|
|
} |
|
|
|
|
|
|
|
const getGlobalParam = () => { |
|
|
|
const data = getItem('globalParam') |
|
|
|
console.log("全局配置数据", getCodeName('IS_ENABLE', data.miniSupportOther), getCodeName('IS_ENABLE', data.otherUploadProxy), getCodeName('IS_ENABLE', data.miniInfoShow), getCodeName('IS_ENABLE', data.changeOCRData)) |
|
|
|
// 小程序是否支持他人办理 |
|
|
|
if (getCodeName('IS_ENABLE', data.miniSupportOther) == '启用') { |
|
|
|
state.isEnableOther = true; |
|
|
|
} else { |
|
|
|
state.isEnableOther = false; |
|
|
|
} |
|
|
|
// 他人办理时是否上传委托书 |
|
|
|
if (getCodeName('IS_ENABLE', data.otherUploadProxy) == '启用') { |
|
|
|
state.isEnableBook = true; |
|
|
|
} else { |
|
|
|
state.isEnableBook = false; |
|
|
|
} |
|
|
|
// 小程序信息带出 |
|
|
|
if (getCodeName('IS_ENABLE', data.miniInfoShow) == '启用') { |
|
|
|
state.isEnableInfo = true; |
|
|
|
uni.showModal({ |
|
|
|
// title: '提示', |
|
|
|
content: '是否允许带出用户信息', |
|
|
|
success: function (res) { |
|
|
|
if (res.confirm) { |
|
|
|
console.log('用户点击确定'); |
|
|
|
queryUserMsg() //通过opneId查询用户信息 |
|
|
|
} else if (res.cancel) { |
|
|
|
console.log('用户点击取消'); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
} else { |
|
|
|
state.isEnableInfo = false; |
|
|
|
} |
|
|
|
// 允许修改OCR识别出来的数据 |
|
|
|
if (getCodeName('IS_ENABLE', data.changeOCRData) == '启用') { |
|
|
|
state.isEnableOCRData = false; |
|
|
|
} else { |
|
|
|
state.isEnableOCRData = true; |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
// 通过opneId查询用户信息 |
|
|
|
const queryUserMsg = () => { |
|
|
|
const options = { |
|
|
|
type: 2, |
|
|
|
data: { |
|
|
|
"openId": getItem('openId') |
|
|
|
}, |
|
|
|
method: "POST", |
|
|
|
showLoading: true, |
|
|
|
}; |
|
|
|
request(getUserMsg, options).then((res) => { |
|
|
|
console.log("通过opneId查询用户信息", stringToJson(res.bizContent)) |
|
|
|
const data = stringToJson(res.bizContent); |
|
|
|
state.form.userPosImgUrl = data.customerPosImgUrl; |
|
|
|
state.form.userNegImgUrl = data.customerNegImgUrl; |
|
|
|
state.form.userName = data.customerName; |
|
|
|
state.form.userIdNum = data.customerIdNum; |
|
|
|
state.form.address = data.customerAddress; |
|
|
|
state.form.tel = data.customerTel; |
|
|
|
}) |
|
|
|
} |
|
|
|
const takePhotoMode = (index, isMy) => { |
|
|
|
console.log("index", index, isMy) |
|
|
|
state.isTakePhotoModeShow = true |
|
|
|
state.choiceIndex = index |
|
|
|
state.isMy = isMy |
|
|
|
} |
|
|
|
const xiangce = (val) => { |
|
|
|
console.log("val", val) |
|
|
|
var imageType = val; |
|
|
|
uni.chooseImage({ |
|
|
|
count: 1, //只能选取一张照片 |
|
|
|
sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有 |
|
|
|
sourceType: ["album"], //从相册选择 |
|
|
|
success: function (res) { |
|
|
|
state.showImg = false |
|
|
|
state.images = res.tempFilePaths[0] |
|
|
|
state.phoneType = state.choiceIndex |
|
|
|
state.isTakePhotoModeShow = false |
|
|
|
console.log("tempFilePaths[0].startsWith('file://')", res.tempFilePaths[0], res.tempFilePaths[0].startsWith('file://')) |
|
|
|
|
|
|
|
}, |
|
|
|
}) |
|
|
|
} |
|
|
|
const takePhoto = (val) => { |
|
|
|
state.showImg = true |
|
|
|
console.log("拍照", val) |
|
|
|
state.phoneType = val; |
|
|
|
} |
|
|
|
const confirmReturn = (val) => { |
|
|
|
state.phoneType = 0 |
|
|
|
state.isTakePhotoModeShow = false |
|
|
|
var imageType = state.choiceIndex; |
|
|
|
console.log("图片地址val", val.tempImagePath) |
|
|
|
uploadFile(val.tempImagePath, imageType, idCardOcr).then((data) => { |
|
|
|
console.log("身份证上传", data) |
|
|
|
if (state.isMy == "my") { |
|
|
|
if (state.choiceIndex == "1") { |
|
|
|
state.form.userName = data.name; |
|
|
|
state.form.gender = data.gender; |
|
|
|
state.form.userIdNum = data.idno; |
|
|
|
state.form.userPosImgUrl = data.imageUrl; |
|
|
|
state.form.address = data.address; |
|
|
|
} else { |
|
|
|
state.form.customerIdVld = data.enddate; |
|
|
|
state.form.userNegImgUrl = data.imageUrl; |
|
|
|
} |
|
|
|
state.isTakePhotoModeShow = false |
|
|
|
} else { |
|
|
|
if (state.choiceIndex == "1") { |
|
|
|
state.form.agentName = data.name; |
|
|
|
state.form.agentGender = data.gender; |
|
|
|
state.form.agentIdNum = data.idno; |
|
|
|
state.form.agentPosImgUrl = data.imageUrl; |
|
|
|
state.form.agentAddress = data.address; |
|
|
|
} else { |
|
|
|
console.log("state.isMy", state.isMy, state.choiceIndex, state.choiceIndex == "1", data) |
|
|
|
state.form.agentIdVld = data.enddate; |
|
|
|
state.form.agentNegImgUrl = data.imageUrl; |
|
|
|
} |
|
|
|
state.isTakePhotoModeShow = false |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
const cancle = () => { |
|
|
|
state.isTakePhotoModeShow = false |
|
|
|
} |
|
|
|
</script> |
|
|
|
|
|
|
|
<style lang="scss" scoped> |
|
|
|
.title { |
|
|
|
font-size: 35rpx; |
|
|
|
font-family: Microsoft YaHei; |
|
|
|
font-weight: 400; |
|
|
|
color: #000000; |
|
|
|
line-height: 80rpx; |
|
|
|
margin-bottom: 10rpx; |
|
|
|
} |
|
|
|
|
|
|
|
.content-wrap { |
|
|
|
position: relative; |
|
|
|
margin-top: -50rpx; |
|
|
|
padding: 0rpx 30rpx; |
|
|
|
display: flex; |
|
|
|
|
|
|
|
.big { |
|
|
|
font-size: 30rpx; |
|
|
|
font-family: Microsoft YaHei; |
|
|
|
font-weight: 400; |
|
|
|
color: #333333; |
|
|
|
line-height: 24rpx; |
|
|
|
} |
|
|
|
|
|
|
|
.nomal { |
|
|
|
font-size: 26rpx; |
|
|
|
font-family: Microsoft YaHei; |
|
|
|
font-weight: 400; |
|
|
|
color: #666666; |
|
|
|
line-height: 24rpx; |
|
|
|
} |
|
|
|
|
|
|
|
.tip { |
|
|
|
margin-top: -5px; |
|
|
|
width: 117rpx; |
|
|
|
height: 16rpx; |
|
|
|
background: #00b38b; |
|
|
|
opacity: 0.3; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.content { |
|
|
|
padding: 50rpx 30rpx 50rpx 30rpx; |
|
|
|
|
|
|
|
.action { |
|
|
|
padding-left: 20rpx; |
|
|
|
padding-right: 20rpx; |
|
|
|
padding-bottom: 30rpx; |
|
|
|
|
|
|
|
.button { |
|
|
|
height: 80rpx; |
|
|
|
background: linear-gradient(-90deg, #43a1e0 0%, #13e7c1 100%); |
|
|
|
border-radius: 40rpx; |
|
|
|
font-size: 32rpx; |
|
|
|
font-weight: 400; |
|
|
|
color: #ffffff; |
|
|
|
line-height: 80rpx; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.item-tips { |
|
|
|
.title { |
|
|
|
font-size: 30rpx; |
|
|
|
font-family: Microsoft YaHei; |
|
|
|
font-weight: 400; |
|
|
|
color: #000000; |
|
|
|
line-height: 24rpx; |
|
|
|
} |
|
|
|
|
|
|
|
.tip { |
|
|
|
margin-top: 16rpx; |
|
|
|
font-size: 24rpx; |
|
|
|
font-family: Microsoft YaHei; |
|
|
|
font-weight: 400; |
|
|
|
color: #999999; |
|
|
|
line-height: 24rpx; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.picture-wrapper { |
|
|
|
margin-top: 40rpx; |
|
|
|
|
|
|
|
.bg { |
|
|
|
background: #ffffff; |
|
|
|
box-shadow: 0rpx 4rpx 13rpx 3rpx rgba(223, 223, 223, 0.8); |
|
|
|
border-radius: 20rpx; |
|
|
|
padding: 40rpx; |
|
|
|
display: flex; |
|
|
|
// align-items: center; |
|
|
|
justify-content: space-between; |
|
|
|
|
|
|
|
.name { |
|
|
|
font-size: 34rpx; |
|
|
|
font-family: Microsoft YaHei; |
|
|
|
font-weight: 400; |
|
|
|
color: #000000; |
|
|
|
line-height: 34rpx; |
|
|
|
} |
|
|
|
|
|
|
|
.value { |
|
|
|
margin-top: 20rpx; |
|
|
|
font-size: 24rpx; |
|
|
|
font-family: Microsoft YaHei; |
|
|
|
font-weight: 400; |
|
|
|
color: #999999; |
|
|
|
line-height: 24rpx; |
|
|
|
} |
|
|
|
|
|
|
|
.tip { |
|
|
|
margin-top: 20rpx; |
|
|
|
text-align: center; |
|
|
|
width: 110rpx; |
|
|
|
height: 40rpx; |
|
|
|
background: rgba(33, 190, 177, 0.2); |
|
|
|
border-radius: 6rpx; |
|
|
|
|
|
|
|
.tip-value { |
|
|
|
font-size: 20rpx; |
|
|
|
font-family: Microsoft YaHei; |
|
|
|
font-weight: 400; |
|
|
|
color: #0a8f8a; |
|
|
|
line-height: 40rpx; |
|
|
|
opacity: 1; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.icon { |
|
|
|
width: 294rpx; |
|
|
|
height: 188rpx; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.shibie-wrapper { |
|
|
|
margin-top: 60rpx; |
|
|
|
|
|
|
|
.title { |
|
|
|
font-size: 30rpx; |
|
|
|
font-family: Microsoft YaHei; |
|
|
|
font-weight: 400; |
|
|
|
color: #000000; |
|
|
|
line-height: 30rpx; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.buchong-wrapper { |
|
|
|
margin-top: 60rpx; |
|
|
|
|
|
|
|
.title { |
|
|
|
font-size: 30rpx; |
|
|
|
font-family: Microsoft YaHei; |
|
|
|
font-weight: 400; |
|
|
|
color: #000000; |
|
|
|
line-height: 30rpx; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.green-tip { |
|
|
|
margin-top: 50rpx; |
|
|
|
font-size: 24rpx; |
|
|
|
font-family: Microsoft YaHei; |
|
|
|
font-weight: 400; |
|
|
|
color: #00b38b; |
|
|
|
line-height: 24rpx; |
|
|
|
margin-bottom: 60rpx; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.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; |
|
|
|
} |
|
|
|
|
|
|
|
.choice-takePhoto-wrap { |
|
|
|
width: 100%; |
|
|
|
height: 100vh; |
|
|
|
background-color: rgba(127, 127, 127, 0.2); |
|
|
|
position: fixed; |
|
|
|
left: 0; |
|
|
|
top: 0; |
|
|
|
z-index: 11111; |
|
|
|
} |
|
|
|
</style> |