Bläddra i källkod

'2025年7月16日14:20:44'

master
wq 1 månad sedan
förälder
incheckning
ca73097b81

+ 3
- 4
subpackage/orders/car-release.vue Visa fil

@@ -246,13 +246,13 @@
:style="{'--bgimg':`url(${$imgUrl}issuance/bg-border.png`}"></image>
</view>
</view>
<view class="picture-wrapper" @click="cardFileImageUpdate('5','my')">
<view class="picture-wrapper" @click="cardFileImageUpdate(99)">
<view class="bg">
<view class="">
<view class="name"> 委托书 </view>
<view class="value"> 上传文字清晰的委托书 </view>
<view class="tip">
<view class="tip-value"> 拍摄规范 </view>
<view class="tip-value"> 拍摄规范 </view>s
</view>
</view>
<image v-if="!state.form.proxyUrl" class="icon" :src="`${$imgUrl}issuance/weituo.png`"
@@ -680,11 +680,10 @@
uploadFile(res.tempFilePaths[0], val).then((data) => {
if (val == 1) {
state.form.vehBodyUrl = data.imageUrl;
} else if (val == 5) {
} else if (val == 99) {
state.form.proxyUrl = data.imageUrl;
} else {
state.form.roadTransportPermitPicUrl = data.imageUrl;

}
})
},

+ 1
- 1
subpackage/orders/essential-information-two.vue Visa fil

@@ -173,7 +173,7 @@
orderGoAction();
} else {
const data = res;
state.orderId = data.orderId
state.orderId = data.orderNo
console.log(data);
var vehicleId = state.data.vehiclePlate + "_" + state.data.vehiclePlateColor
console.log("state.data.vehiclePlate", state.data.vehiclePlate, state.data.vehiclePlateColor, vehicleId)

+ 1
- 1
subpackage/orders/essential-information.vue Visa fil

@@ -330,7 +330,7 @@
if (res.statusCode === 600) {
orderGoAction();
} else {
const data = res;
const data = res.orderNo;
state.orderId = data
console.log(data);
addKey = true

+ 64
- 61
utils/utils.ts Visa fil

@@ -5,7 +5,7 @@ import { agentId } from "@/utils/network/difference";
import {
requestNew
} from "@/utils/network/request.js";
import {ocrDo} from "@/utils/network/api.js";
import { ocrDo } from "@/utils/network/api.js";
export const msg = (title : string = "", param : any = {}) => {
if (!title) return;
uni.showToast({
@@ -61,19 +61,19 @@ export const navTo = (url : string = "", login : boolean = false) => {
let pages = getCurrentPages();
// 获取页面栈总页数
// this.pagesCount = pages.length;
// 如果页面栈总数大于10
console.log("pages.length",pages.length)
if(pages.length >= 10){
// 使用重定向跳转页面
uni.redirectTo({
url
})
}else{
// 如果页面栈总数小于10,则打开新页面
uni.navigateTo({
url,
});
}
// 如果页面栈总数大于10
console.log("pages.length", pages.length)
if (pages.length >= 10) {
// 使用重定向跳转页面
uni.redirectTo({
url
})
} else {
// 如果页面栈总数小于10,则打开新页面
uni.navigateTo({
url,
});
}
}
};

@@ -424,8 +424,8 @@ export const imgPathMontage = (str : string) => {
}
// 身份证号脱敏
export const desensitization = (val) => {
if(val){
return val.replace(/^\d{14}/,'**************');
if (val) {
return val.replace(/^\d{14}/, '**************');
}
}
//查看大图
@@ -518,17 +518,17 @@ function formatNumber(n : any) {
return n[1] ? n : `0${n}`
}
export const uploadFile = (tempImagePath, imageType) => {
console.log("tempImagePath",tempImagePath,tempImagePath.size)
console.log("tempImagePath", tempImagePath, tempImagePath.size)
return new Promise((resolve, reject) => {
uni.uploadFile({
url: 'https://qtzl.etcjz.cn/newDev/minIo/upload', //仅为示例,非真实的接口地址
filePath: tempImagePath,
name: 'file',
formData: {
'busCode':'iaw',
'busCode': 'iaw',
},
success: (uploadFileRes) => {
console.log("uploadFileRes",uploadFileRes,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={}
@@ -563,7 +563,10 @@ export const uploadFile = (tempImagePath, imageType) => {
// };
// console.log("91", uploadFileImage)
// }

if (imageType == 99) {
resolve({ imageUrl: JSON.parse(uploadFileRes.data).data.ossFilePath })
return
}

const options = {
type: 2,
@@ -575,14 +578,14 @@ export const uploadFile = (tempImagePath, imageType) => {
showLoading: true,
};
requestNew(ocrDo, options).then((res) => {
console.log("res===",res)
const data = {...res, imageUrl: JSON.parse(uploadFileRes.data).data.ossFilePath};
console.log("res===", res)
const data = { ...res, imageUrl: JSON.parse(uploadFileRes.data).data.ossFilePath };
console.log('输出内容=====123', data)
resolve(data)
});
},
fail:()=>{
fail: () => {
uni.showModal({
title: '提示',
content: '图片上传失败,请联系管理人员',
@@ -663,12 +666,12 @@ export const noticeUser = (callback : Function) => {
// #endif
}
// 压缩图片
export const compressImage = (tempFilePaths : any,scall, callback : Function) => {
export const compressImage = (tempFilePaths : any, scall, callback : Function) => {
uni.compressImage({
src: tempFilePaths, // 图片路径
quality: 80, // 压缩质量,范围为0 - 100,100为不压缩
success: function (res) {
console.log('压缩后的图片路径:' + res.tempFilePath,res)
console.log('压缩后的图片路径:' + res.tempFilePath, res)
callback(res)
},
fail: function (err) {
@@ -676,15 +679,15 @@ export const compressImage = (tempFilePaths : any,scall, callback : Function) =>
}
})
}
export const chooseImageCompress = ( callback : Function) => {
export const chooseImageCompress = (callback : Function) => {
uni.chooseImage({
count: 1, //只能选取一张照片
sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
sourceType: ["album"], //从相册选择
success: function (res) {
let scall=res.tempFiles[0].size/1024/1024/2
console.log("scall",scall)
console.log("res.tempFiles[0].size", res.tempFilePaths[0], res.tempFiles[0].size/1024/1024)
let scall = res.tempFiles[0].size / 1024 / 1024 / 2
console.log("scall", scall)
console.log("res.tempFiles[0].size", res.tempFilePaths[0], res.tempFiles[0].size / 1024 / 1024)
// if(scall>1){
// console.log("压缩")
// let quality=100
@@ -711,33 +714,33 @@ export const chooseImageCompress = ( callback : Function) => {
// }
// })
// }else{
callback(res)
callback(res)
// }
},
})
}
// 身份证有效期是否过期
export function compareDates(specifiedDateString) {
const newTime=specifiedDateString.substring(0,4)+"-"+specifiedDateString.substring(4,6)+"-"+specifiedDateString.substring(6,8)
console.log("newTime",newTime)
const currentDate = new Date();
const specifiedDate = new Date(newTime);
if (currentDate > specifiedDate) {
console.log("当前日期晚于指定日期")
msg("身份证过期请重新上传", {
'duration': 2000
})
return "当前日期晚于指定日期";
} else if (currentDate < specifiedDate) {
console.log("当前日期早于指定日期")
return "当前日期早于指定日期";
} else {
console.log("当前日期等于指定日期")
return "当前日期等于指定日期";
}
const newTime = specifiedDateString.substring(0, 4) + "-" + specifiedDateString.substring(4, 6) + "-" + specifiedDateString.substring(6, 8)
console.log("newTime", newTime)
const currentDate = new Date();
const specifiedDate = new Date(newTime);
if (currentDate > specifiedDate) {
console.log("当前日期晚于指定日期")
msg("身份证过期请重新上传", {
'duration': 2000
})
return "当前日期晚于指定日期";
} else if (currentDate < specifiedDate) {
console.log("当前日期早于指定日期")
return "当前日期早于指定日期";
} else {
console.log("当前日期等于指定日期")
return "当前日期等于指定日期";
}
}
// 示例使用
// const dateComparison = compareDates('2023-12-31');
// console.log(dateComparison);
@@ -745,26 +748,26 @@ export function compareDates(specifiedDateString) {
// 跳转运维小程序
export function jumpOldMini() {
uni.navigateToMiniProgram({
appId: "wx008c60533388527a",
path: `pages/main/serve/serve`,
envVersion: "release",
success(res) {
console.log('成功', res);
},
fail(res) {
console.log('失败' + res);
},
appId: "wx008c60533388527a",
path: `pages/main/serve/serve`,
envVersion: "release",
success(res) {
console.log('成功', res);
},
fail(res) {
console.log('失败' + res);
},
});
}
// 图片转base64
export const getFileBase64 = (path) => {
console.log("进来",path)
console.log("进来", path)
return new Promise((resolve, reject) => {
uni.getFileSystemManager().readFile({
filePath: path, //参数path:图片相对路径
encoding: 'base64',
success: (res) => {
console.log("进来1",res)
console.log("进来1", res)
resolve(res.data);
},
fail: (err) => {

Laddar…
Avbryt
Spara