Преглед изворни кода

实名认证

修改样式逻辑
yangteng пре 1 недеља
родитељ
комит
7d847797e2

+ 8
- 31
components/uploadOcr.vue Прегледај датотеку

onMounted onMounted
} from "vue"; } from "vue";
import viewfinder from "./viewfinder.vue" import viewfinder from "./viewfinder.vue"
import { idCardOcr,vehicleLicenseOcr} from "@/utils/network/api.js";
import { import {
uploadFile, uploadFile,
compressImage, compressImage,
}) })
const xiangce = (val) => { const xiangce = (val) => {
console.log("val", val) console.log("val", val)
var imageType=""
state.choiceIndex=val
if(state.choiceIndex == 1 || state.choiceIndex == 2){
imageType = val;
}else{
if (state.choiceIndex == 3) {
imageType = '1';
} else {
imageType = '2';
}
}
chooseImageCompress((res) => { chooseImageCompress((res) => {
console.log("res",res,state.choiceIndex) console.log("res",res,state.choiceIndex)
state.images = res.tempFilePath ? res.tempFilePath : res.tempFilePaths[0] state.images = res.tempFilePath ? res.tempFilePath : res.tempFilePaths[0]
state.showImg = false state.showImg = false
emit('close', false) emit('close', false)
if(state.choiceIndex==1 || state.choiceIndex==2){
var issfz=idCardOcr
}else{
var issfz=vehicleLicenseOcr
}
uploadFile(state.images, imageType, issfz).then((data) => {
uploadFile(state.images, state.choiceIndex).then((data) => {
console.log("身份证上传", data) console.log("身份证上传", data)
emit('ocrResult', data)
var allData={
...data,
tempFilePath:state.images
}
emit('ocrResult', allData)
}) })
}) })
} }
const confirmReturn = (val) => { const confirmReturn = (val) => {
console.log("图片地址val", val) console.log("图片地址val", val)
state.phoneType = 0 state.phoneType = 0
if(state.choiceIndex==1 || state.choiceIndex==2){
var imageType = state.choiceIndex;
var issfz=idCardOcr
}else{
if (state.choiceIndex == 3) {
var imageType = 1;
} else {
var imageType = 2;
}
var issfz=vehicleLicenseOcr
}
uploadFile(val.tempImagePath, imageType, issfz).then((data) => {
uploadFile(val.tempImagePath, state.choiceIndex).then((data) => {
console.log("身份证上传", data) console.log("身份证上传", data)
emit('close', false) emit('close', false)
emit('ocrResult', data) emit('ocrResult', data)

+ 69
- 0
datas/credentialType.js Прегледај датотеку

} }
} }
export const credentialTypeSelect = [{
value: 101,
label: '身份证(含临时身份证)'
},
{
value: 102,
label: '护照(限外籍人士)'
},
{
value: 103,
label: '港澳居民来往内地通行证'
},
{
value: 104,
label: '台湾居民来往大陆通行证'
},
{
value: 105,
label: '军官证'
},
{
value: 106,
label: '武警警察身份证'
},
{
value: 113,
label: '澳门永久/非永久居民身份证'
},
{
value: 114,
label: '香港永久/非永久居民身份证'
},
{
value: 201,
label: '统一社会信用代码证书'
},
{
value: 202,
label: '组织机构代码证'
},
{
value: 203,
label: '营业执照'
},
{
value: 204,
label: '事业单位法人证书'
},
{
value: 205,
label: '社会团体法人登记证书'
},
{
value: 206,
label: '律师事务所执业许可证'
},
{
value: 217,
label: '公司商业登记副本(3个月内)'
},
{
value: 218,
label: '公司营业税单M8副本'
},
{
value: 219,
label: '公司营业税开业/更改M1副本'
}
];

+ 7
- 0
pages.json Прегледај датотеку

{ {
"root": "subpackage/personal-center", //个人中心 "root": "subpackage/personal-center", //个人中心
"pages": [ "pages": [
{
"path": "real-name-authentication",
"style": {
"navigationBarTitleText": "实名认证",
"enablePullDownRefresh": false
}
},
{ {
"path": "my-etc-account", "path": "my-etc-account",
"style": { "style": {

+ 1
- 1
pages/user/user.vue Прегледај датотеку

<view class="info-content"> <view class="info-content">
<view class="order box"> <view class="order box">
<view class="list_item">
<view class="list_item" @click="$util.navTo('/subpackage/personal-center/real-name-authentication', true)">
<view class="l-con"> <view class="l-con">
<image :src="`${$imgUrl}myImage/basicInformation.png`" class="equity-icon" mode="widthFix"></image> <image :src="`${$imgUrl}myImage/basicInformation.png`" class="equity-icon" mode="widthFix"></image>
<view class="txt"> <view class="txt">

+ 13
- 6
subpackage/orders/invoiceApply/invoice-header-edit.vue Прегледај датотеку

requestNew(billRaiseUpdate, options).then((res) => { requestNew(billRaiseUpdate, options).then((res) => {
const data = res; const data = res;
console.log("data", data) console.log("data", data)
uni.navigateBack({
delta: 1
})
msg("修改成功")
setTimeout(()=>{
uni.navigateBack({
delta: 1
})
},1500)
}); });
} }
const del = () => { const del = () => {
requestNew(billRaiseDelete, options).then((res) => { requestNew(billRaiseDelete, options).then((res) => {
const data = res; const data = res;
console.log("data", data) console.log("data", data)
uni.navigateBack({
delta: 1
})
msg("删除成功")
setTimeout(()=>{
uni.navigateBack({
delta: 1
})
},1500)
}); });
} }
</script> </script>

+ 8
- 0
subpackage/orders/invoiceApply/invoice-header-list.vue Прегледај датотеку

<view class="title_left"> <view class="title_left">
<image :src="`${$imgUrl}etc.png`" mode=""></image> <image :src="`${$imgUrl}etc.png`" mode=""></image>
<text class="question">{{item.buyerName}}</text> <text class="question">{{item.buyerName}}</text>
<view v-if="item.isDefault==1" class="default">默认</view>
</view> </view>
<image @click="toEdit(item)" :src="`${$imgUrl}applyCard/edit.png`" mode=""></image> <image @click="toEdit(item)" :src="`${$imgUrl}applyCard/edit.png`" mode=""></image>
</view> </view>
flex-direction: column; flex-direction: column;
margin-top: 20rpx; margin-top: 20rpx;
} }
.default{
border: 1rpx solid #01243A;
font-size: 28rpx;
border-radius: 10rpx;
padding: 2rpx 6rpx;
margin-left: 10rpx;
}
</style> </style>

+ 8
- 6
utils/network/api.js Прегледај датотеку

export const customerInfoChangeView= "/iaw/aftersale/customerInfoChange/view" //业务审核查询详情 用户信息变更 export const customerInfoChangeView= "/iaw/aftersale/customerInfoChange/view" //业务审核查询详情 用户信息变更
export const customerInfoChangeCancel= "/iaw/aftersale/customerInfoChange/cancel" //业务审核取消 用户信息变更 export const customerInfoChangeCancel= "/iaw/aftersale/customerInfoChange/cancel" //业务审核取消 用户信息变更
// ocr // ocr
// export const idCardOcr= "/iaw/ocr/idCardOcr" //身份证OCR识别
export const idCardOcr= "/iaw/txOcr/idCardOcr" //身份证OCR识别
// export const vehicleLicenseOcr= "/iaw/ocr/vehicleLicenseOcr" //车辆行驶证OCR识别
export const vehicleLicenseOcr= "/iaw/txOcr/vehicleLicenseOcr" //车辆行驶证OCR识别
// export const ocrAllQuery = '/iaw/ocr/businessLicenseOcrNew'; //8.76.BDS-OCR证照识别接口
export const ocrAllQuery = '/iaw/txOcr/businessLicenseOcr'; //8.76.BDS-OCR证照识别接口
export const idCardOcr= "/iaw/ocr/idCardOcr" //身份证OCR识别
// export const idCardOcr= "/iaw/txOcr/idCardOcr" //身份证OCR识别
export const vehicleLicenseOcr= "/iaw/ocr/vehicleLicenseOcr" //车辆行驶证OCR识别
// export const vehicleLicenseOcr= "/iaw/txOcr/vehicleLicenseOcr" //车辆行驶证OCR识别
export const ocrAllQuery = '/iaw/ocr/businessLicenseOcrNew'; //8.76.BDS-OCR证照识别接口
// export const ocrAllQuery = '/iaw/txOcr/businessLicenseOcr'; //8.76.BDS-OCR证照识别接口
export const ocrDo = '/iaw/api/ocr/do'; //OCR识别接口 1-身份证-人像面 2-身份证-国徽面 3-行驶证前页 4-行驶证背页 5-营业执照
// 公用得接口 // 公用得接口
export const commQueryCourier= "/iaw/api/afterSale/comm/queryCourier" //获取快递公司列表 export const commQueryCourier= "/iaw/api/afterSale/comm/queryCourier" //获取快递公司列表
// 收货地址管理 // 收货地址管理
export const vehicleTypeCount = "/iaw/aftersale/vehicleInformationChange/vehicleTypeCount" //车型计算 export const vehicleTypeCount = "/iaw/aftersale/vehicleInformationChange/vehicleTypeCount" //车型计算
export const logout = "/iaw/portal/logout" //退出登录 export const logout = "/iaw/portal/logout" //退出登录
export const customerQuery = "/iaw/api/customer/query" //客户列表查询 export const customerQuery = "/iaw/api/customer/query" //客户列表查询
export const realNameAuthentication = "/iaw/portal/realNameAuthentication" //实名认证

+ 60
- 39
utils/utils.ts Прегледај датотеку

import { import {
requestNew requestNew
} from "@/utils/network/request.js"; } from "@/utils/network/request.js";
import {ocrDo} from "@/utils/network/api.js";
export const msg = (title : string = "", param : any = {}) => { export const msg = (title : string = "", param : any = {}) => {
if (!title) return; if (!title) return;
uni.showToast({ uni.showToast({
n = n.toString() n = n.toString()
return n[1] ? n : `0${n}` return n[1] ? n : `0${n}`
} }
export const uploadFile = (tempImagePath, imageType, code) => {
export const uploadFile = (tempImagePath, imageType) => {
console.log("tempImagePath",tempImagePath,tempImagePath.size) console.log("tempImagePath",tempImagePath,tempImagePath.size)
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
uni.uploadFile({ uni.uploadFile({
url: 'https://qtzl.etcjz.cn/minIo/upload', //仅为示例,非真实的接口地址
url: 'https://qtzl.etcjz.cn/newDev/minIo/upload', //仅为示例,非真实的接口地址
filePath: tempImagePath, filePath: tempImagePath,
name: 'file', name: 'file',
formData: { formData: {
'user': 'test',
"bucket": 'default-bucket'
'busCode':'iaw'
}, },
success: (uploadFileRes) => { success: (uploadFileRes) => {
let uploadFileImage = 'http://100.64.2.113:9000' + '/default-bucket/' + JSON.parse(uploadFileRes.data).data.ossFilePath
console.log("111", JSON.parse(uploadFileRes.data).data.ossFilePath,JSON.parse(uploadFileRes.data));
var data={}
if (code == "/iaw/txOcr/idCardOcr") { //身份证 imageType 1 2
data = {
source: "1",
agencyId: agentId,
imageType: imageType,
fileName: tempImagePath,
url: uploadFileImage
};
} else if (code == "/iaw/txOcr/vehicleLicenseOcr") { //行驶证 imageType 1正 2反
data = {
source: "1",
agencyId: agentId,
imageType: imageType,
fileName: tempImagePath,
imageUrl: uploadFileImage
};
} else if (code == "") { //委托书 车头照 17
let uploadFileImage = envs[process.env.NODE_ENV].baseUrl + '/default-bucket/' + JSON.parse(uploadFileRes.data).data.ossFilePath
console.log("uploadFileRes",uploadFileRes,JSON.parse(uploadFileRes.data).data.ossFilePath)
// let uploadFileImage = 'http://100.64.2.113:9000' + '/default-bucket/' + JSON.parse(uploadFileRes.data).data.ossFilePath
// console.log("111", JSON.parse(uploadFileRes.data).data.ossFilePath,JSON.parse(uploadFileRes.data));
// var data={}
// if (code == "/iaw/txOcr/idCardOcr") { //身份证 imageType 1 2
// data = {
// source: "1",
// agencyId: agentId,
// imageType: imageType,
// fileName: tempImagePath,
// url: uploadFileImage
// };
// } else if (code == "/iaw/txOcr/vehicleLicenseOcr") { //行驶证 imageType 1正 2反
// data = {
// source: "1",
// agencyId: agentId,
// imageType: imageType,
// fileName: tempImagePath,
// imageUrl: uploadFileImage
// };
// } else if (code == "") { //委托书 车头照 17
// let uploadFileImage = envs[process.env.NODE_ENV].baseUrl + '/default-bucket/' + JSON.parse(uploadFileRes.data).data.ossFilePath


console.log("17", uploadFileImage)
resolve(uploadFileImage)
return;
} else if (code == '/iaw/txOcr/businessLicenseOcr') { //营业执照
data = {
type: 'business_license',
url: uploadFileImage,
agencyId: agentId,
fileName: tempImagePath,
};
console.log("91", uploadFileImage)
}
// console.log("17", uploadFileImage)
// resolve(uploadFileImage)
// return;
// } else if (code == '/iaw/txOcr/businessLicenseOcr') { //营业执照
// data = {
// type: 'business_license',
// url: uploadFileImage,
// agencyId: agentId,
// fileName: tempImagePath,
// };
// console.log("91", uploadFileImage)
// }




const options = { const options = {
type: 2, type: 2,
data: data,
data: {
type: imageType,
imagePath: JSON.parse(uploadFileRes.data).data.ossFilePath,
},
method: "POST", method: "POST",
showLoading: true, showLoading: true,
}; };
requestNew(code, options).then((res) => {
requestNew(ocrDo, options).then((res) => {
console.log("res===",res) console.log("res===",res)
const data = res; const data = res;
console.log('输出内容=====123', data) console.log('输出内容=====123', data)
}, },
}); });
} }
// 图片转base64
export const getFileBase64 = (path) => {
console.log("进来",path)
return new Promise((resolve, reject) => {
uni.getFileSystemManager().readFile({
filePath: path, //参数path:图片相对路径
encoding: 'base64',
success: (res) => {
console.log("进来1",res)
resolve(res.data);
},
fail: (err) => {
console.log(err);
}
});
});
};

Loading…
Откажи
Сачувај