123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718 |
- <template>
-
- <view 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')">
- <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')">
- <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 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('3')">
- <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.vehPosImgUrl" class="icon" :src="`${$imgUrl}applyCard/car-zhu.png`">
- </image>
- <image v-else class="icon" :src="strReplace(state.form.vehPosImgUrl)"></image>
- </view>
- </view>
- <view class="picture-wrapper" @click="takePhotoMode('4')">
- <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.vehNegImgUrl" class="icon" :src="`${$imgUrl}applyCard/car-fu.png`">
- </image>
- <image v-else class="icon" :src="strReplace(state.form.vehNegImgUrl)"></image>
- </view>
- </view>
- <view class="picture-wrapper" @click="cardFileImageUpdate(1)">
- <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.FormData.peopleVehicleImgUrl" class="icon" :src="`${$imgUrl}applyCard/chetou.png`">
- </image>
- <image v-else class="icon" :src="strReplace(state.FormData.peopleVehicleImgUrl)"></image>
- </view>
- </view>
- <view class="picture-wrapper" @click="cardFileImageUpdate(2)">
- <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.FormData.commitmentUrl" class="icon" :src="`${$imgUrl}applyCard/weituoshu.png`">
- </image>
- <image v-else class="icon" :src="strReplace(state.FormData.commitmentUrl)"></image>
- </view>
- </view>
- <view class="picture-wrapper" @click="cardFileImageUpdate(3)">
- <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.FormData.proxyUrl" class="icon" :src="`${$imgUrl}applyCard/weituoshu.png`">
- </image>
- <image v-else class="icon" :src="strReplace(state.FormData.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 v-model="state.form.vehicleId" @input="getVehiclePlate" />
- </u-form-item>
- <u-form-item label="车牌颜色">
- <u-input v-model="state.form.caridCorlor" type="select" @click="show1 = true" />
- </u-form-item>
- </u-form>
- </view>
-
- <view class="green-tip">
- 如识别信息有误,请手动修改,确认无误后,点击下一步!
- </view>
-
- <view class="action">
- <button type="default" class="button" @click="savaHandle()">
- 下一步
- </button>
- </view>
- <!-- 选择车牌颜色 -->
- <u-select v-model="show1" :list="state.actionSheetList" @confirm="selectConfirm"></u-select>
- </view>
- <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 selectCar from "./select-car.vue";
- import {
- reactive,
- ref
- } from "vue";
- import {
- onLoad
- } from "@dcloudio/uni-app";
- import {
- etcOcrCard,
- etcCarOcrCard,
- } from "@/utils/network/api.js";
- import {
- getItem
- } from "@/utils/storage.ts"
- import viewfinder from "@/components/viewfinder.vue"
- import {
- navTo, strReplace, uploadFile
- } from "@/utils/utils";
- // ########
- const show1 = ref(false)
- const state = reactive({
- showImg: true,
- isMy: "",//自己办理 他人办理
- phoneType: 0, // 1 身份证正面 2 身份证反面 3行驶证正面 4行驶证反面
- choiceIndex: 1, // 1 身份证正面 2 身份证反面
- isTakePhotoModeShow: false, //选择拍照方式是否出来
- images: '',
- ocrData: {
- name: "",
- gender: "",
- idno: "",
- address: "",
- begindate: "",
- enddate: "",
- tel: "",
- tmerValidity: "",
- },
- form: {
- caridCorlor: "", //车牌颜色
- userName: "", //开户人姓名
- userIdNum: "", //用户证件号码
- userPosImgUrl: "", //身份证正面
- userNegImgUrl: "", //身份证反面
- address: "", //开户人地址
- gender: "",
- tmerValidity: "",
- man: "", //所有人
- character: "", //使用性质
- register: "", //注册日期
- vehBodyUrl: '', //人车合照
- customerId: "", //用户编号
- vehicleId: "", //车牌编号
- issueDate: "", //发证日期
- vehPosImgUrl: "", //行驶证正面
- vehNegImgUrl: "", //行驶证证反面
- type: "0", //0,客车 1.货车
- useUserType: 0, //车辆用户类型
- useUserTypeName: "普通车",
- vehicleSign: 2, //前/后装标识
- vin: "", //车辆识别代号
- engineNum: "", //发动机号码
- vehicleType: "", //车辆类型
- vehicleModel: "", //行驶证品牌型号
- approvedCount: undefined, //核定人数
- totalMass: undefined, //总质量
- maintenaceMass: undefined, //整备质量
- permittedWeight: "", //核定载质量
- vehicleDimensions: "", //车辆尺寸
- permittedTowWeight: "", //准牵引总质量
- axleCount: "", //车轴数
- ownerName: "", //车主姓名
- ownerIdType: "", //车主证件类型
- ownerIdNum: "", //车主证件号码
- ownPosImgUrl: "", //车主证件正面图片
- ownNegImgUrl: "", //车主证件反面图片
- agreementId: "", //签约编号
- channelId: "5201018892300000001",
- proxyUrl: "", //委托书
- },
- orderId: "",
- isMyPeopple: true,
- actionSheetList: [{
- label: "蓝色",
- value: '0',
- }, {
- label: "黄色",
- value: 1,
- },
- {
- label: "黑色",
- value: 2,
- },
- {
- label: "白色",
- value: 3,
- },
- {
- label: "渐变绿色",
- value: 4,
- },
- {
- label: "黄绿双拼色",
- value: 5,
- },
- {
- label: "蓝白渐变色",
- value: 6,
- },
- {
- label: "未确定",
- value: 9,
- },
- {
- label: "绿色",
- value: 11,
- },
- {
- label: "红色",
- value: 12,
- },
- ],
- FormData: {
- vehiclePlate: '',
- vehiclePlatecolor: '',
- openid: getItem('openId'),
- idcardFrontImgUrl: '',
- idcardBacktImgUrl: '',
- vehPosImgUrl: '',
- vehNegImgUrl: '',
- peopleVehicleImgUrl: '',
- commitmentUrl: '',
- mobile: '',
- code: '',
- proxyUrl: "", //委托书
- }
- });
- const getVehiclePlate = (e) => {
- console.log("车牌号", e)
- state.FormData.vehiclePlate = e
- };
- const savaHandle = () => {
- if (state.FormData.idcardFrontImgUrl && state.FormData.idcardBacktImgUrl) {
- if (state.FormData.vehPosImgUrl && state.FormData.vehNegImgUrl) {
- if (state.FormData.peopleVehicleImgUrl) {
- if (state.FormData.vehiclePlate && state.FormData.vehiclePlatecolor.toString()) {
- state.FormData.vehiclePlatecolor = Number(state.FormData.vehiclePlatecolor)
- let data = JSON.stringify(state.FormData)
- navTo(`/subpackage/after-sale/rescind-carId/verification?fromData=${data}`);
- } else {
- uni.showToast({
- title: "请填写车牌号和车牌颜色",
- icon: "none"
- })
- }
- } else {
- uni.showToast({
- title: "请上传人车合影",
- icon: "none"
- })
- }
- } else {
- uni.showToast({
- title: "请上传行驶证正反图片",
- icon: "none"
- })
- }
- } else {
- uni.showToast({
- title: "请上传身份证正反图片",
- icon: "none"
- })
- }
- console.log(JSON.stringify(state.FormData));
- };
-
- const selectConfirm = (item : any) => {
- console.log(item);
- state.FormData.vehiclePlatecolor = item[0].value
- state.form.caridCorlor = item[0].label
- };
-
- 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.FormData.peopleVehicleImgUrl = data;
- } else if (val == 2) {
- state.FormData.commitmentUrl = data;
- } else if (val == 3) {
- state.FormData.proxyUrl = data;
- }
- })
- },
- });
- };
-
-
- onLoad((option : any) => {
- state.form.orderId = option.orderId;
- state.orderId = option.orderId;
- });
-
-
- 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 = 1;
-
- if (state.choiceIndex == 1) {
- imageType = 1
- var isEtcOcrCard = etcOcrCard
- } else if (state.choiceIndex == 2) {
- imageType = 2
- var isEtcOcrCard = etcOcrCard
- } else if (state.choiceIndex == 3) {
- imageType = 1
- var isEtcOcrCard = etcCarOcrCard
- } else if (state.choiceIndex == 4) {
- imageType = 2
- var isEtcOcrCard = etcCarOcrCard
- } else
-
- console.log("图片地址val", val.tempImagePath)
- uploadFile(val.tempImagePath, imageType, isEtcOcrCard).then((data) => {
- console.log("身份证上传", data)
- 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;
-
- state.FormData.idcardFrontImgUrl = data.imageUrl
- } else if (state.choiceIndex === "2") {
- state.form.tmerValidity = data.begindate + "-" + data.enddate;
- state.form.userNegImgUrl = data.imageUrl;
-
- state.FormData.idcardBacktImgUrl = data.imageUrl
- } else if (state.choiceIndex === "3") {
- state.form.vehicleId = data.plate_a;
- state.form.man = data.man;
- state.form.vehicleType = data.vehicle;
- state.form.character = data.character;
- state.form.vin = data.vin;
- state.form.engineNum = data.engine;
- state.form.register = data.register;
- state.form.issueDate = data.issue;
- state.form.vehPosImgUrl = data.imageUrl;
- state.form.vehicleModel = data.model;
-
- state.FormData.vehiclePlate = data.plate_a
- state.FormData.vehPosImgUrl = data.imageUrl
-
- } else if (state.choiceIndex === "4") {
- state.form.approvedCount = parseFloat(data.apc);
- state.form.maintenaceMass = parseFloat(data.unladen);
- state.form.vehicleDimensions = data.overall;
- state.form.totalMass = parseFloat(data.gross);
- state.form.vehNegImgUrl = data.imageUrl;
-
- state.FormData.vehNegImgUrl = data.imageUrl
- }
- state.isTakePhotoModeShow = false
- })
- }
- const takePhotoMode = (index) => {
- console.log("index", index)
- state.isTakePhotoModeShow = true
- state.choiceIndex = index
- }
- const cancle = () => {
- state.isTakePhotoModeShow = false
- }
- const camera = () => {
- state.phoneType = 0
- }
- </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: 0rpx 30rpx 50rpx 30rpx;
-
- .item {
- padding: 20rpx;
- display: flex;
- justify-content: space-between;
- align-items: center;
- height: 130rpx;
- background: #ffffff;
- box-shadow: 0rpx 2rpx 6rpx 0rpx rgba(223, 223, 223, 0.8);
- border-radius: 20rpx;
- margin-bottom: 30rpx;
-
- .iten-left {
- display: flex;
- align-items: center;
-
- image {
- width: 150rpx;
- height: 90rpx;
- }
-
- text {
- margin-left: 20rpx;
- font-size: 32rpx;
- font-family: Noto Sans S Chinese;
- font-weight: 400;
- color: #333333;
- }
- }
-
- .choose-item {
- width: 44rpx;
- height: 44rpx;
- background: #ffffff;
- border: 2rpx solid #00b38b;
- border-radius: 50%;
- margin-right: 20rpx;
- display: flex;
- justify-content: center;
- align-items: center;
- box-sizing: content-box;
- }
-
- .active {
- width: 34rpx;
- height: 34rpx;
- background: #00b38b;
- border-radius: 50%;
- }
- }
-
- .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;
- }
-
- ::v-deep .u-form-item {
- border-bottom: 1rpx solid #DCDCDC;
- padding: 10rpx 0;
- }
- }
-
- .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>
|