@@ -1,7 +1,7 @@ | |||
<template> | |||
<view style="width: 100%;height: 100vh;position: fixed;left: 0;top:0;z-index: 111111;" > | |||
<view style="width: 100%;height: 100vh;position: fixed;left: 0;top:0;z-index: 111111;"> | |||
<!-- @touchstart="handleTouchStart" @touchmove="handleTouchMove" @touchend="handleTouchEnd" --> | |||
<view class="viewfinder" > | |||
<view class="viewfinder"> | |||
<view v-if="phoneType == 1" | |||
style="display: flex;align-items: center;justify-content: flex-end;width: 100%;height: 100%;"> | |||
<image :src="fileURL + 'image/index/etc_bd_ocr_id_card_locator_back.png'" | |||
@@ -43,7 +43,8 @@ | |||
<image v-if="!showStartPhoto" @click="camera" :src="fileURL + 'image/index/etc_bd_ocr_cancel.png'" | |||
style="width: 50rpx;height: 50rpx;"></image> | |||
<view style="flex: 1;"></view> | |||
<image @click="takePhoto" :src="showStartPhoto ? fileURL + 'image/index/etc_bd_ocr_take_photo_normal.png' : fileURL + '/static/etc_bd_ocr_rotate.png'" | |||
<image @click="takePhoto" | |||
:src="showStartPhoto ? fileURL + 'image/index/etc_bd_ocr_take_photo_normal.png' : fileURL + '/static/etc_bd_ocr_rotate.png'" | |||
:style="showStartPhoto ? 'width: 140rpx;height: 140rpx;' : 'width: 80rpx;height: 80rpx;'"></image> | |||
<view style="flex: 1;"></view> | |||
<image v-if="!showStartPhoto" @click="success" :src="fileURL + 'image/index/etc_bd_ocr_confirm.png'" | |||
@@ -137,8 +138,8 @@ | |||
//成功 | |||
function success() { | |||
console.log('成功:', srcImg.value); | |||
emit('confirmReturn',{ | |||
tempImagePath : srcImg.value | |||
emit('confirmReturn', { | |||
tempImagePath: srcImg.value | |||
}) | |||
} | |||
@@ -156,14 +157,14 @@ | |||
// 相机出错时的回调 | |||
console.error('相机错误:', e.detail.errMsg); | |||
} | |||
const handleTouchStart = (event : TouchEvent) => { | |||
console.log('手柄触摸启动', '==1') | |||
startX.value = event.changedTouches[0].pageX - offsetX.value; | |||
startY.value = event.changedTouches[0].pageY - offsetY.value; | |||
dragging.value = true; | |||
}; | |||
const handleTouchMove = (event : TouchEvent) => { | |||
console.log('手柄触摸启动', '==2') | |||
if (dragging.value) { | |||
@@ -171,7 +172,7 @@ | |||
offsetY.value = event.changedTouches[0].pageY - startY.value; | |||
} | |||
}; | |||
const handleTouchEnd = () => { | |||
console.log('手柄触摸启动', '==3') | |||
dragging.value = false; | |||
@@ -180,7 +181,7 @@ | |||
<style> | |||
.viewfinder { | |||
pointer-events:none; | |||
pointer-events: none; | |||
position: absolute; | |||
top: 20%; | |||
left: 10%; | |||
@@ -191,17 +192,9 @@ | |||
border-radius: 16rpx; | |||
z-index: 2; | |||
} | |||
.container { | |||
position: relative; | |||
height: 100vh; | |||
} | |||
.content { | |||
position: absolute; | |||
top: 50%; | |||
left: 50%; | |||
transform: translate(-50%, -50%); | |||
/* 这是你要垂直居中的内容 */ | |||
} | |||
</style> |
@@ -7,18 +7,27 @@ import { request } from "@/utils/network/request.js"; | |||
import { gotoAgainUseOrderApi } from "@/utils/network/api.js"; | |||
import { stringToJson } from "@/utils/network/encryption.js"; | |||
export default function useOrderSkip() { | |||
const gotoOrderDetailsPay = (orderInfo) => { | |||
// #ifdef MP-WEIXIN | |||
// navTo(`/subpackage/orders/order-details-new?id=${orderInfo.id}&appraise=${orderInfo.appraise}`); | |||
navTo(`/subpackage/orders/order_payment?orderId=${orderInfo.orderId}&isValueCard=${orderInfo.isValueCard}`); | |||
// #endif | |||
// #ifdef MP-ALIPAY | |||
navTo(`/subpackage/orders/order_payment?orderId=${orderInfo.orderId}&isValueCard=${orderInfo.isValueCard}`); | |||
// #endif | |||
} | |||
//根据订单类型 跳转到不同的订单详情页面 | |||
const gotoOrderDetails = (orderInfo) => { | |||
console.log('输出内容=====', orderInfo) | |||
if (orderInfo.orderType === 'ISSUE') { | |||
// #ifdef MP-WEIXIN | |||
// navTo(`/subpackage/orders/order-details-new?id=${orderInfo.id}&appraise=${orderInfo.appraise}`); | |||
navTo(`/subpackage/orders/order_payment?orderId=${orderInfo.orderId}&isValueCard=${orderInfo.isValueCard}`); | |||
// #endif | |||
// #ifdef MP-ALIPAY | |||
navTo(`/subpackage/orders/order_payment?orderId=${orderInfo.orderId}&isValueCard=${orderInfo.isValueCard}`); | |||
// #endif | |||
navTo(`/subpackage/orders/order-details-new?id=${orderInfo.id}&appraise=${orderInfo.appraise}`); | |||
// // #ifdef MP-WEIXIN | |||
// navTo(`/subpackage/orders/order_payment?orderId=${orderInfo.orderId}&isValueCard=${orderInfo.isValueCard}`); | |||
// // #endif | |||
// // #ifdef MP-ALIPAY | |||
// navTo(`/subpackage/orders/order_payment?orderId=${orderInfo.orderId}&isValueCard=${orderInfo.isValueCard}`); | |||
// // #endif | |||
} else if (orderInfo.orderType == OrderTypes.同时换卡换签 || | |||
orderInfo.orderType == 'REPLACEMENT_CARD' || orderInfo.orderType == 'REPLACEMENT_SIGNATURE') { | |||
navTo(`/subpackage/orders/order-details-card-sign?id=${orderInfo.id}&orType=${orderInfo.orderType}`); | |||
@@ -70,8 +79,7 @@ export default function useOrderSkip() { | |||
//继续申请、修改资料 | |||
const gotoEditUserOrUnitInfo = (orderInfo : any) => { | |||
console.log("******************", orderInfo.orderStep); | |||
console.log("********555555555555**********", orderInfo); | |||
console.log("********555555555555**********", orderInfo.orderStep, OrderStatus["已支付/待签约"]); | |||
let url = ''; | |||
if (orderInfo.orderStep == OrderStatus.完成填写基本信息 || orderInfo.orderStep == OrderStatus.待支付3) { | |||
url = orderInfo.userType === 'PERSONAL_USER' ? '/subpackage/orders/opening-account-people' : '/subpackage/orders/opening-account-unit'; | |||
@@ -89,6 +97,8 @@ export default function useOrderSkip() { | |||
url = '/subpackage/orders/order-payment'; | |||
} else if (orderInfo.orderStep === OrderStatus["审核不通过"]) { //修改资料 | |||
url = '/subpackage/orders/changeInformation'; | |||
} else if (orderInfo.orderStep === OrderStatus["已支付/待签约"]) { //修改资料 | |||
url = '/subpackage/orders/release-products'; | |||
} | |||
console.log("url", url) | |||
navTo(`${url}?orderId=${orderInfo.orderId}&clientFee=${orderInfo.amount}&id=${orderInfo.productId}&vehiclePlateColor=${orderInfo.vehiclePlateColor}&fromOrder=true&type=${orderInfo.type}&userType=${orderInfo.userType === 'PERSONAL_USER' ? '1' : '2'}`); | |||
@@ -160,7 +170,7 @@ export default function useOrderSkip() { | |||
//查看物流 | |||
const gotoCheckLogistics = (orderInfo : any) => { | |||
navTo(`/subpackage/orders/order-detail-logistics?id=${orderInfo.id}`); | |||
navTo(`/subpackage/orders/order-detail-logistics?orderInfo=${JSON.stringify(orderInfo)}`); | |||
} | |||
@@ -185,6 +195,11 @@ export default function useOrderSkip() { | |||
//跳转到车辆信息变更界面 | |||
navTo(`/subpackage/personal-center/setting/car-information/car-change`); | |||
} | |||
//去签约 | |||
const gotoOrderSign = (orderInfo : any) => { | |||
//跳转到车辆信息变更界面 | |||
navTo(`/subpackage/orders/release-products`); | |||
} | |||
//再次使用订单 | |||
const gotoAgainUseOrder = (orderInfo : any) => { | |||
const options = { | |||
@@ -209,6 +224,6 @@ export default function useOrderSkip() { | |||
gotoConfirmReceipt, gotoCheckLogistics, gotoEvaluateOrder, gotoEvaluateProduct, gotoEvaluateSalesman, | |||
gotoActiveOrder, gotoReturnOrder, gotoExchangeOrder, gotoPay, | |||
gotoOrderDetails, gotoLogoffETC, gotoEditCarWriteInfo, | |||
gotoEditCarApplyAgain, gotoCardSignPay, gotoAgainUseOrder | |||
gotoEditCarApplyAgain, gotoCardSignPay, gotoAgainUseOrder, gotoOrderDetailsPay, gotoOrderSign | |||
} | |||
} |
@@ -1,8 +1,8 @@ | |||
<!-- 新办订单item | |||
新办订单状态:待支付、审核中、审核不通过、待发货、待收货、待激活、已完成、已取消、已结束、退货、换货--> | |||
<template> | |||
<!-- <view :class="item.orderStatus == OrderStatus.已取消 ? 'item finished' : 'item'" @click.stop="gotoOrderDetails(item)"> --> | |||
<view :class="item.orderStatus == OrderStatus.已取消 ? 'item finished' : 'item'"> | |||
<view :class="item.orderStatus == OrderStatus.已取消 ? 'item finished' : 'item'" @click.stop="gotoOrderDetails(item)"> | |||
<!-- <view :class="item.orderStatus == OrderStatus.已取消 ? 'item finished' : 'item'"> --> | |||
<view class="head"> | |||
<view class="name"> | |||
<image :src="`${$imgUrl}order/icon-star-green.png`" class="icon" mode="aspectFill"></image> | |||
@@ -55,12 +55,17 @@ | |||
</view> | |||
<view class="btns" v-if="item.orderStep == OrderStatus['完成车辆信息上传/待支付']"> | |||
<view class="btn btn-normal" @click.stop="gotoCancelOrder(item)">取消订单</view> | |||
<view class="btn btn-primary" @click.stop="gotoOrderDetails(item)">支付</view> | |||
<view class="btn btn-primary" @click.stop="gotoOrderDetailsPay(item)">支付</view> | |||
</view> | |||
<view class="btns" v-if="item.orderStep == OrderStatus.待支付2"> | |||
<!-- <view class="btn btn-normal" @click.stop="gotoEditUserOrUnitInfo(item)">修改资料</view> --> | |||
<view class="btn btn-normal" @click.stop="gotoCancelOrder(item)">取消订单</view> | |||
<view class="btn btn-primary" @click.stop="gotoOrderDetails(item)">支付</view> | |||
<view class="btn btn-primary" @click.stop="gotoOrderDetailsPay(item)">支付</view> | |||
</view> | |||
<view class="btns" v-if="item.orderStep == OrderStatus['已支付/待签约']"> | |||
<!-- <view class="btn btn-normal" @click.stop="gotoEditUserOrUnitInfo(item)">修改资料</view> --> | |||
<view class="btn btn-normal" @click.stop="gotoCancelOrder(item)">取消订单</view> | |||
<view class="btn btn-primary" @click.stop="gotoOrderSign(item)">去签约</view> | |||
</view> | |||
<!-- <view class="btns" v-if="item.orderStep == OrderStatus.待支付3"> | |||
<view class="btn btn-normal" @click.stop="gotoCancelOrder(item)">取消订单</view> | |||
@@ -186,8 +191,10 @@ | |||
gotoReturnOrder, | |||
gotoExchangeOrder, | |||
gotoPay, | |||
gotoOrderDetailsPay, | |||
gotoOrderDetails, | |||
gotoAgainUseOrder | |||
gotoAgainUseOrder, | |||
gotoOrderSign | |||
} = useOrderSkip(); | |||
//激活订单 |
@@ -283,6 +283,7 @@ | |||
}); | |||
onShow((option : any) => { | |||
state.data.opId = getItem(StorageKeys.OpenId); | |||
console.log("state.data.opId", state.data.opId) | |||
if (state.data.opId) { | |||
getUserInfo(); | |||
} |
@@ -248,7 +248,7 @@ | |||
const carNumber = (val : any) => { | |||
state.form.vehicleIdNum = val.trim(); | |||
}; | |||
const camera = () => { | |||
state.phoneType = 0 | |||
} | |||
@@ -639,7 +639,11 @@ | |||
} | |||
const xiangce = (val) => { | |||
console.log("val", val) | |||
var imageType = val; | |||
if (state.choiceIndex == 3) { | |||
var imageType = 1; | |||
} else { | |||
var imageType = 2; | |||
} | |||
state.changeColor = true; | |||
uni.chooseImage({ | |||
count: 1, //只能选取一张照片 | |||
@@ -655,85 +659,40 @@ | |||
state.isTakePhotoModeShow = false | |||
return | |||
} | |||
pathToBase64(res.tempFilePaths[0]) | |||
.then((path) => { | |||
var data = { | |||
source: "1", | |||
agencyId: "52010106004", | |||
imageType: imageType, | |||
fileName: res.tempFilePaths[0], | |||
imageBase64: path, | |||
}; | |||
const options = { | |||
type: 2, | |||
data: data, | |||
method: "POST", | |||
showLoading: true, | |||
}; | |||
request(etcCarOcrCard, options).then((res) => { | |||
const data = stringToJson(res.bizContent); | |||
if (state.choiceIndex === "1") { | |||
if (data.plate_a.length > 8) { | |||
state.form.vehicleIdNum = data.plate_a.substring(0, 8); | |||
} else { | |||
state.form.vehicleIdNum = 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; | |||
} else { | |||
state.form.approvedCount = data.apc; | |||
state.form.approvedCountShow = data.apc; | |||
state.form.maintenaceMass = data.unladen; | |||
state.form.maintenaceMassShow = data.unladen; | |||
state.form.vehicleDimensions = data.overall.replaceAll("x", "X"); | |||
let arr = data.overall.split("x"); | |||
state.outlineL = arr[0]; //外廓 长 | |||
state.outlineW = arr[1]; //外廓 宽 | |||
state.outlineH = arr[2].substring(0, arr[2].length - 2); //外廓 高 | |||
state.form.totalMass = data.gross; | |||
state.form.totalMassShow = data.gross; | |||
state.form.vehNegImgUrl = data.imageUrl; | |||
state.form.permittedWeight = data.alc ? data.alc : 0; | |||
state.form.permittedTowWeight = data.towing ? data.towing : 0; | |||
} | |||
state.isTakePhotoModeShow = false | |||
}); | |||
}) | |||
.catch((error) => { }); | |||
}, | |||
}) | |||
} | |||
const takePhoto = (val) => { | |||
console.log("拍照", val) | |||
// uni.navigateTo({ | |||
// url: `/subpackage/orders/takePhoto?phoneType=${val}` | |||
// }) | |||
state.phoneType = val; | |||
} | |||
const confirmReturn = (val) => { | |||
if (state.choiceIndex == 3) { | |||
var imageType = 1; | |||
} else { | |||
var imageType = 2; | |||
} | |||
state.changeColor = true; | |||
state.phoneType = 0 | |||
state.isTakePhotoModeShow = false | |||
var imageType = state.choiceIndex; | |||
// var imageType = state.choiceIndex; | |||
console.log("图片地址val", val.tempImagePath) | |||
pathToBase64(val.tempImagePath) | |||
.then((path) => { | |||
uni.uploadFile({ | |||
url: 'https://qtzl.etcjz.cn/minIo/upload', //仅为示例,非真实的接口地址 | |||
filePath: val.tempImagePath, | |||
name: 'file', | |||
formData: { | |||
'user': 'test', | |||
"bucket": 'default-bucket' | |||
}, | |||
success: (uploadFileRes) => { | |||
let uploadFileImage = 'http://100.64.2.113:9000' + '/default-bucket/' + JSON.parse(uploadFileRes.data).data.ossFilePath | |||
var data = { | |||
source: "1", | |||
agencyId: "52010106004", | |||
imageType: imageType, | |||
fileName: val.tempImagePath, | |||
imageBase64: path, | |||
imageUrl: uploadFileImage | |||
}; | |||
const options = { | |||
@@ -744,7 +703,7 @@ | |||
}; | |||
request(etcCarOcrCard, options).then((res) => { | |||
const data = stringToJson(res.bizContent); | |||
if (state.choiceIndex === "1") { | |||
if (state.choiceIndex === "3") { | |||
if (data.plate_a.length > 8) { | |||
state.form.vehicleIdNum = data.plate_a.substring(0, 8); | |||
} else { | |||
@@ -778,8 +737,8 @@ | |||
} | |||
state.isTakePhotoModeShow = false | |||
}); | |||
}) | |||
.catch((error) => { }); | |||
}, | |||
}) | |||
} | |||
const takePhotoMode = (index) => { | |||
console.log("index", index) |
@@ -235,7 +235,8 @@ | |||
</view> | |||
</view> | |||
<viewfinder v-if="state.phoneType" :phoneType="state.phoneType" :images="state.images" :showStartPhoto="state.showImg" @confirmReturn="confirmReturn" @camera="camera"></viewfinder> | |||
<viewfinder v-if="state.phoneType" :phoneType="state.phoneType" :images="state.images" | |||
:showStartPhoto="state.showImg" @confirmReturn="confirmReturn" @camera="camera"></viewfinder> | |||
</template> | |||
<script setup lang="ts"> | |||
@@ -351,7 +352,7 @@ | |||
const camera = () => { | |||
state.phoneType = 0 | |||
} | |||
const savaHandle = () => { | |||
if (!checkStr(state.form.userIdNum, 'card')) { | |||
msg('请输入正确身份证'); | |||
@@ -522,7 +523,7 @@ | |||
} | |||
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)) | |||
@@ -603,17 +604,14 @@ | |||
state.images = res.tempFilePaths[0] | |||
state.phoneType = state.choiceIndex | |||
state.isTakePhotoModeShow = false | |||
console.log("tempFilePaths[0].startsWith('file://')",state.showImg, res.tempFilePaths[0], res.tempFilePaths[0].startsWith('file://')) | |||
console.log("tempFilePaths[0].startsWith('file://')", res.tempFilePaths[0], res.tempFilePaths[0].startsWith('file://')) | |||
}, | |||
}) | |||
} | |||
const takePhoto = (val) => { | |||
state.showImg = true | |||
console.log("拍照", val) | |||
// uni.navigateTo({ | |||
// url: `/subpackage/orders/takePhoto?phoneType=${val}` | |||
// }) | |||
state.phoneType = val; | |||
} | |||
const confirmReturn = (val) => { | |||
@@ -621,15 +619,23 @@ | |||
state.isTakePhotoModeShow = false | |||
var imageType = state.choiceIndex; | |||
console.log("图片地址val", val.tempImagePath) | |||
pathToBase64(val.tempImagePath) | |||
.then((path) => { | |||
uni.uploadFile({ | |||
url: 'https://qtzl.etcjz.cn/minIo/upload', //仅为示例,非真实的接口地址 | |||
filePath: val.tempImagePath, | |||
name: 'file', | |||
formData: { | |||
'user': 'test', | |||
"bucket": 'default-bucket' | |||
}, | |||
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); | |||
var data = { | |||
source: "1", | |||
agencyId: "52010106004", | |||
imageType: imageType, | |||
fileName: val.tempImagePath, | |||
imageBase64: path, | |||
url: uploadFileImage | |||
}; | |||
const options = { | |||
@@ -669,8 +675,9 @@ | |||
} | |||
}); | |||
}) | |||
.catch((error) => { console.log('输出内容',error); }); | |||
} | |||
}); | |||
} | |||
const cancle = () => { | |||
state.isTakePhotoModeShow = false |
@@ -103,7 +103,8 @@ | |||
<view @click.stop="cancle">取消</view> | |||
</view> | |||
</view> | |||
<viewfinder v-if="state.phoneType" :phoneType="state.phoneType" @confirmReturn="confirmReturn"></viewfinder> | |||
<viewfinder v-if="state.phoneType" :phoneType="state.phoneType" :images="state.images" | |||
:showStartPhoto="state.showImg" @confirmReturn="confirmReturn" @camera="camera"></viewfinder> | |||
</view> | |||
</template> | |||
@@ -153,6 +154,8 @@ | |||
phoneType: 0, // 1 身份证正面 2 身份证反面 3行驶证正面 4行驶证反面 | |||
choiceIndex: 1, // 1 身份证正面 2 身份证反面 | |||
isTakePhotoModeShow: false, //选择拍照方式是否出来 | |||
images: '', | |||
showImg: true, | |||
form: { | |||
orderId: "", //订单ID | |||
//营业执照信息 | |||
@@ -400,6 +403,9 @@ | |||
state.form.posImgUrl = data.data.url; | |||
}); | |||
}; | |||
const camera = () => { | |||
state.phoneType = 0 | |||
} | |||
const cardFileImageUpdate = () => { | |||
uni.chooseImage({ | |||
count: 1, //只能选取一张照片 | |||
@@ -446,47 +452,17 @@ | |||
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://')) | |||
pathToBase64(res.tempFilePaths[0]) | |||
.then((path) => { | |||
var data = { | |||
source: "1", | |||
agencyId: "52010106004", | |||
imageType: imageType, | |||
fileName: res.tempFilePaths[0], | |||
imageBase64: path, | |||
}; | |||
const options = { | |||
type: 2, | |||
data: data, | |||
method: "POST", | |||
showLoading: true, | |||
}; | |||
request(etcOcrCard, options).then((res) => { | |||
const data = stringToJson(res.bizContent); | |||
if (state.choiceIndex === "1") { | |||
state.form.agentName = data.name; | |||
state.form.agentIdNum = data.idno; | |||
state.form.agentPosImgUrl = data.imageUrl; | |||
state.form.address = data.address; | |||
state.form.agentGender = data.gender; | |||
} else { | |||
state.form.agentIdVld = data.enddate; | |||
state.form.agentNegImgUrl = data.imageUrl; | |||
} | |||
state.isTakePhotoModeShow = false | |||
}); | |||
}) | |||
.catch((error) => { }); | |||
}, | |||
}) | |||
} | |||
const takePhoto = (val) => { | |||
console.log("拍照", val) | |||
// uni.navigateTo({ | |||
// url: `/subpackage/orders/takePhoto?phoneType=${val}` | |||
// }) | |||
state.showImg = true | |||
state.phoneType = val; | |||
} | |||
const confirmReturn = (val) => { | |||
@@ -494,14 +470,24 @@ | |||
state.isTakePhotoModeShow = false | |||
var imageType = state.choiceIndex; | |||
console.log("图片地址val", val.tempImagePath) | |||
pathToBase64(val.tempImagePath) | |||
.then((path) => { | |||
// pathToBase64(val.tempImagePath).then((path) => { | |||
uni.uploadFile({ | |||
url: 'https://qtzl.etcjz.cn/minIo/upload', //仅为示例,非真实的接口地址 | |||
filePath: val.tempImagePath, | |||
name: 'file', | |||
formData: { | |||
'user': 'test', | |||
"bucket": 'default-bucket' | |||
}, | |||
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); | |||
var data = { | |||
source: "1", | |||
agencyId: "52010106004", | |||
imageType: imageType, | |||
fileName: val.tempImagePath, | |||
imageBase64: path, | |||
url: uploadFileImage | |||
}; | |||
const options = { | |||
@@ -525,8 +511,10 @@ | |||
state.isTakePhotoModeShow = false | |||
}); | |||
}) | |||
.catch((error) => { }); | |||
}, | |||
}) | |||
// }) | |||
// .catch((error) => { }); | |||
} | |||
const cancle = () => { | |||
state.isTakePhotoModeShow = false |
@@ -30,122 +30,137 @@ | |||
<order-info-item :label="item.label" :value="item.value"></order-info-item> | |||
</view> | |||
</view> | |||
<view class="show-or-noshow as-layout-horizontal as-gravity-center" @click = "state.isShow = !state.isShow"> | |||
<view class="show-or-noshow as-layout-horizontal as-gravity-center" @click="state.isShow = !state.isShow"> | |||
<text>{{state.isShow?"收起部分订单信息":"查看全部订单信息"}}</text> | |||
<image class="arror" :src="`${$imgUrl}common/arror-${state.isShow? 'right' : 'down'}.png`"></image> | |||
</view> | |||
</view> | |||
</view> | |||
<!-- 查看更多物流信息 --> | |||
<popup-bottom ref="popup" v-model:visible="state.popupVisible" title="详细信息" radius="40" maxHeight="75%" > | |||
<view class="log-popup" v-if="state.popupVisible"> | |||
<popup-bottom ref="popup" v-model:visible="state.popupVisible" title="详细信息" radius="40" maxHeight="75%"> | |||
<view class="log-popup" v-if="state.popupVisible"> | |||
<order-logistics :options="state.logisticsAllList" :flag="2"></order-logistics> | |||
</view> | |||
</popup-bottom> | |||
</template> | |||
<script setup lang="ts"> | |||
import {reactive} from "vue"; | |||
import { reactive } from "vue"; | |||
import orderInfoItem from "./components/order-info-item"; | |||
import orderLogistics from "./components/order-logistics"; | |||
import popupBottom from "./components/popup-bottom.vue"; | |||
import { msg } from "@/utils/utils"; | |||
import { msg, getOrderTypeName, getCarTypeName, getOrderStatusName, getOrderTime } from "@/utils/utils"; | |||
import { onLoad } from "@dcloudio/uni-app"; | |||
const state = reactive({ | |||
orderInfo: "", | |||
//是否显示更多订单信息 | |||
isShow:false, | |||
isShow: false, | |||
//显示更多物流信息 | |||
popupVisible:false, | |||
popupVisible: false, | |||
//显示部分订单信息 | |||
orderShowInfo: [{ | |||
label: '新办单号:', | |||
value: '01872753475754' | |||
}, | |||
{ | |||
label: '业务类型:', | |||
value: '新办发行' | |||
}, | |||
{ | |||
label: '订单车牌:', | |||
value: '贵A01234' | |||
}, | |||
{ | |||
label: '所属类型:', | |||
value: '个人' | |||
}, | |||
{ | |||
label: '车辆类型:', | |||
value: '客车' | |||
}, | |||
{ | |||
label: '订单状态:', | |||
value: '已完成' | |||
}, | |||
label: '新办单号:', | |||
value: '' | |||
}, | |||
{ | |||
label: '业务类型:', | |||
value: '' | |||
}, | |||
{ | |||
label: '订单车牌:', | |||
value: '' | |||
}, | |||
{ | |||
label: '所属类型:', | |||
value: '' | |||
}, | |||
{ | |||
label: '车辆类型:', | |||
value: '' | |||
}, | |||
{ | |||
label: '订单状态:', | |||
value: '' | |||
}, | |||
], | |||
//隐藏部分订单信息 | |||
orderHideInfo: [{ | |||
label: '创建时间:', | |||
value: '2022-12-25 22:14:44' | |||
}, | |||
{ | |||
label: '付款时间:', | |||
value: '2022-11-25 22:14:44' | |||
}, | |||
{ | |||
label: '发货时间:', | |||
value: '2022-06-25 22:14:44' | |||
}, | |||
{ | |||
label: '业务员:', | |||
value: '张三' | |||
}, | |||
{ | |||
label: '物流单号:', | |||
value: 'YT56374359468' | |||
}, | |||
{ | |||
label: '物流公司:', | |||
value: '圆通快递' | |||
}, | |||
label: '创建时间:', | |||
value: '' | |||
}, | |||
// { | |||
// label: '付款时间:', | |||
// value: '' | |||
// }, | |||
// { | |||
// label: '发货时间:', | |||
// value: '' | |||
// }, | |||
// { | |||
// label: '业务员:', | |||
// value: '张三' | |||
// }, | |||
{ | |||
label: '物流单号:', | |||
value: '' | |||
}, | |||
{ | |||
label: '物流公司:', | |||
value: '' | |||
}, | |||
], | |||
//物流信息 | |||
logisticsList:[ | |||
{title:'已签收 02-01 10:18:09',desc:'贵州省贵阳市具体地址贵阳市具体地址贵阳市具体贵阳市具体地址 已签收 签收人:【代收点】贵阳市…',right:true}, | |||
{title:'送至 俊发城 A 区 5 栋 1021',desc:'李先生 86-178****8911'}, | |||
logisticsList: [ | |||
{ title: '已签收 02-01 10:18:09', desc: '贵州省贵阳市具体地址贵阳市具体地址贵阳市具体贵阳市具体地址 已签收 签收人:【代收点】贵阳市…', right: true }, | |||
{ title: '送至 俊发城 A 区 5 栋 1021', desc: '李先生 86-178****8911' }, | |||
], | |||
logisticsAllList:[ | |||
{title:'已签收 02-01 10:18:09',desc:'贵州省贵阳市具体地址 签收人:高先生'}, | |||
{title:'派送中 02-01 09:38',desc:'贵州省贵阳市具体地址贵阳市具体地址贵阳市 派件员:张三 手机号:15620608655'}, | |||
{title:'运输中 ',desc:'贵州省贵阳市XXXXXXX 已收入'}, | |||
{title:'01-12 16:27 ',desc:'贵州省贵阳市XXXXXXX 已出发'}, | |||
{title:'01-12 09:31 ',desc:'贵州省贵阳市XXXXXXX 已打包'}, | |||
{title:'01-12 09:12 ',desc:'贵州省贵阳市XXXXXXX 已收入'}, | |||
{title:'物流异常提醒 01-11 12:09 ',desc:'目前快递运力正在全力以赴恢复中,您目前快递运力正 在全力以赴恢复中,您目前快递运力正在全力以赴恢复 中您,敬请谅解!'}, | |||
{title:'等待揽件 ',desc:'上海市 浦江'}, | |||
logisticsAllList: [ | |||
{ title: '已签收 02-01 10:18:09', desc: '贵州省贵阳市具体地址 签收人:高先生' }, | |||
{ title: '派送中 02-01 09:38', desc: '贵州省贵阳市具体地址贵阳市具体地址贵阳市 派件员:张三 手机号:15620608655' }, | |||
{ title: '运输中 ', desc: '贵州省贵阳市XXXXXXX 已收入' }, | |||
{ title: '01-12 16:27 ', desc: '贵州省贵阳市XXXXXXX 已出发' }, | |||
{ title: '01-12 09:31 ', desc: '贵州省贵阳市XXXXXXX 已打包' }, | |||
{ title: '01-12 09:12 ', desc: '贵州省贵阳市XXXXXXX 已收入' }, | |||
{ title: '物流异常提醒 01-11 12:09 ', desc: '目前快递运力正在全力以赴恢复中,您目前快递运力正 在全力以赴恢复中,您目前快递运力正在全力以赴恢复 中您,敬请谅解!' }, | |||
{ title: '等待揽件 ', desc: '上海市 浦江' }, | |||
], | |||
}) | |||
const copyTxt = (value:string) => { | |||
uni.setClipboardData({ | |||
data:value, | |||
success:()=>{//复制成功的回调函数 | |||
msg('复制成功!'); | |||
} | |||
}); | |||
const copyTxt = (value : string) => { | |||
uni.setClipboardData({ | |||
data: value, | |||
success: () => {//复制成功的回调函数 | |||
msg('复制成功!'); | |||
} | |||
}); | |||
} | |||
} | |||
onLoad((options) => { | |||
state.orderInfo = JSON.parse(options.orderInfo); | |||
console.log("state.orderInfo", options.orderInfo) | |||
state.orderShowInfo[0].value = state.orderInfo['orderId'] | |||
state.orderShowInfo[1].value = getOrderTypeName(state.orderInfo['orderType']) | |||
state.orderShowInfo[2].value = state.orderInfo['vehiclePlate'] | |||
state.orderShowInfo[3].value = state.orderInfo['userType'] === 'UNIT_USER' ? '单位' : '个人' | |||
state.orderShowInfo[4].value = getCarTypeName(state.orderInfo["type"]) | |||
state.orderShowInfo[5].value = getOrderStatusName(state.orderInfo['orderStep']) | |||
state.orderHideInfo[0].value = getOrderTime(state.orderInfo['insertTime']) | |||
state.orderHideInfo[1].value = state.orderInfo['trackingNumber'] | |||
state.orderHideInfo[2].value = state.orderInfo['courierCompany'] | |||
}) | |||
</script> | |||
<style> | |||
page { | |||
background-color: #EEF7F7; | |||
padding-bottom:30rpx; | |||
padding-bottom: 30rpx; | |||
} | |||
</style> | |||
<style lang="scss" scoped> | |||
.log-popup{ | |||
.log-popup { | |||
margin: -8rpx 10rpx 0px; | |||
background-color: white; | |||
border-top-left-radius: 40rpx; | |||
@@ -153,6 +168,7 @@ const copyTxt = (value:string) => { | |||
padding: 50rpx 45rpx 30px; | |||
overflow: visible; | |||
} | |||
.main { | |||
margin: 30rpx; | |||
@@ -200,29 +216,34 @@ const copyTxt = (value:string) => { | |||
.order-line { | |||
padding: 28rpx 30rpx 0; | |||
} | |||
.order-box{ | |||
.order-box { | |||
height: 380rpx; | |||
overflow: hidden; | |||
} | |||
.show{ | |||
.show { | |||
height: auto; | |||
overflow: visible; | |||
} | |||
.show-or-noshow{ | |||
.show-or-noshow { | |||
font-size: 26rpx; | |||
color: #999999; | |||
text-align: center; | |||
padding: 28rpx 0 8rpx; | |||
} | |||
.arror{ | |||
.arror { | |||
width: 28rpx; | |||
height: 28rpx; | |||
padding-left: 6rpx; | |||
margin-top: 2rpx; | |||
} | |||
.logistics-layout{ | |||
.logistics-layout { | |||
margin-top: 40rpx; | |||
margin-left: 20rpx; | |||
} | |||
} | |||
</style> | |||
</style> |
@@ -385,7 +385,7 @@ | |||
<view class="btn-view" v-if="state.orderInfo.orderStatus != OrderStatus.已取消"> | |||
<!-- 信息填写未完成 --> | |||
<view class="btn-status" | |||
v-if="state.orderInfo.orderStep == OrderStatus['完成个人/单位信息上传'] || state.orderInfo.orderStep == OrderStatus.完成填写基本信息 || state.orderInfo.orderStep == OrderStatus.完成车辆信息上传"> | |||
v-if="state.orderInfo.orderStep == OrderStatus['完成个人/单位信息上传'] || state.orderInfo.orderStep == OrderStatus.完成填写基本信息 "> | |||
<view class="btn space" @click="gotoCancelOrder(state.orderInfo)">取消订单</view> | |||
<view class="btn-green" @click="gotoEditUserOrUnitInfo(state.orderInfo)">继续申请</view> | |||
</view> | |||
@@ -401,10 +401,16 @@ | |||
</view> | |||
<!-- 待支付 --> | |||
<view | |||
v-if="state.orderInfo.orderStep == OrderStatus.待支付1 || state.orderInfo.orderStep == OrderStatus.待支付2 || state.orderInfo.orderStep == OrderStatus.待支付3" | |||
v-if="state.orderInfo.orderStep == OrderStatus['完成车辆信息上传/待支付'] || state.orderInfo.orderStep == OrderStatus.待支付2 || state.orderInfo.orderStep == OrderStatus.待支付3" | |||
class="btn-status"> | |||
<view class="btn space" @click="gotoCancelOrder(state.orderInfo)">取消订单</view> | |||
<view class="btn-green width-num-1" @click="gotoPay(state.orderInfo)">支付</view> | |||
<!-- <view class="btn-green width-num-1" @click="gotoPay(state.orderInfo)">支付</view> --> | |||
<view class="btn-green width-num-1" @click="gotoOrderDetailsPay(state.orderInfo)">支付</view> | |||
</view> | |||
<!-- 待签约--> | |||
<view v-if="state.orderInfo.orderStep == OrderStatus['已支付/待签约']" class="btn-status"> | |||
<view class="btn space" @click="gotoCancelOrder(state.orderInfo)">取消订单</view> | |||
<view class="btn-green" @click="gotoOrderSign(state.orderInfo)">去签约</view> | |||
</view> | |||
<!-- 待发货 --> | |||
<view v-if="state.orderInfo.orderStep == OrderStatus.待发货" class="btn-status"> | |||
@@ -472,7 +478,7 @@ | |||
//按钮跳转业务逻辑 | |||
const { gotoEditAddress, gotoCancelOrder, gotoEditUserOrUnitInfo, | |||
gotoConfirmReceipt, gotoCheckLogistics, gotoEvaluateOrder, | |||
gotoActiveOrder, gotoReturnOrder, gotoExchangeOrder, gotoPay } = useOrderSkip(); | |||
gotoActiveOrder, gotoReturnOrder, gotoExchangeOrder, gotoPay, gotoOrderSign, gotoOrderDetailsPay } = useOrderSkip(); | |||
//获取订单详情 |
@@ -4,7 +4,7 @@ | |||
<view class="title"> 上传后请核对识别信息 </view> | |||
<view class="tip"> 如有错误请及时手动修改 </view> | |||
</view> | |||
<view class="picture-wrapper" @click="takePhotoMode('1')"> | |||
<view class="picture-wrapper" @click="takePhotoMode('3')"> | |||
<view class="bg"> | |||
<view class=""> | |||
<view class="name"> 行驶证主页 </view> | |||
@@ -19,7 +19,7 @@ | |||
<image v-else class="icon" :src="strReplace(state.form.vehPosImgUrl)"></image> | |||
</view> | |||
</view> | |||
<view class="picture-wrapper" @click="takePhotoMode('2')"> | |||
<view class="picture-wrapper" @click="takePhotoMode('4')"> | |||
<view class="bg"> | |||
<view class=""> | |||
<view class="name"> 行驶证副页 </view> | |||
@@ -114,7 +114,8 @@ | |||
<view @click.stop="cancle">取消</view> | |||
</view> | |||
</view> | |||
<viewfinderCar v-if="state.phoneType" :phoneType="state.phoneType" @confirmReturn="confirmReturn"></viewfinderCar> | |||
<viewfinder v-if="state.phoneType" :phoneType="state.phoneType" :images="state.images" | |||
:showStartPhoto="state.showImg" @confirmReturn="confirmReturn" @camera="camera"></viewfinder> | |||
</template> | |||
<script setup lang="ts"> | |||
@@ -126,7 +127,7 @@ | |||
import { | |||
pathToBase64 | |||
} from "@/utils/util/imageTool.js"; | |||
import viewfinderCar from "../../../../components/viewfinderCar.vue"; | |||
import viewfinder from "../../../../components/viewfinder.vue"; | |||
import { | |||
getItem | |||
} from "@/utils/storage.ts" | |||
@@ -240,6 +241,8 @@ | |||
phoneType: 0, // 1 身份证正面 2 身份证反面 3行驶证正面 4行驶证反面 | |||
choiceIndex: 1, // 1 身份证正面 2 身份证反面 | |||
isTakePhotoModeShow: false, //选择拍照方式是否出来 | |||
showImg: true, | |||
images: "", | |||
actionSheetShow: false, | |||
actionSheetList: [{ | |||
label: "蓝色", | |||
@@ -337,114 +340,33 @@ | |||
onLoad((option : any) => { | |||
state.form.orderId = option.orderId; | |||
}); | |||
//orc接口调用 | |||
// const cardImageOcr = (val : any) => { | |||
// var imageType = val; | |||
// uni.chooseImage({ | |||
// count: 1, //只能选取一张照片 | |||
// sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有 | |||
// sourceType: ["camera", "album"], //从相册选择 | |||
// success: function (res) { | |||
// pathToBase64(res.tempFilePaths[0]) | |||
// .then((path) => { | |||
// var data = { | |||
// source: "1", | |||
// agencyId: "52010106004", | |||
// imageType: imageType, | |||
// fileName: res.tempFilePaths[0], | |||
// imageBase64: path, | |||
// }; | |||
// const options = { | |||
// type: 2, | |||
// data: data, | |||
// method: "POST", | |||
// showLoading: true, | |||
// }; | |||
// request(etcCarOcrCard, options).then((res) => { | |||
// const data = stringToJson(res.bizContent); | |||
// console.log(data); | |||
// if (val === "1") { | |||
// state.form.vehicleId = data.plate_a; | |||
// state.form.ownerName = data.man; | |||
// state.form.vehicleType = data.vehicle; | |||
// // state.form.useCharacter = data.character; | |||
// state.form.vin = data.vin; | |||
// state.form.engineNum = data.engine; | |||
// state.form.registerDate = data.register; | |||
// state.form.issueDate = data.issue; | |||
// state.form.vehPosImgUrl = data.imageUrl; | |||
// state.form.vehicleModel = data.model; | |||
// } else { | |||
// 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; | |||
// } | |||
// }); | |||
// }) | |||
// .catch((error) => { }); | |||
// }, | |||
// }); | |||
// }; | |||
const camera = () => { | |||
state.phoneType = 0 | |||
} | |||
const xiangce = (val) => { | |||
console.log("val", val) | |||
var imageType = val; | |||
if (state.choiceIndex == 3) { | |||
var imageType = 1; | |||
} else { | |||
var imageType = 2; | |||
} | |||
uni.chooseImage({ | |||
count: 1, //只能选取一张照片 | |||
sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有 | |||
sourceType: ["album"], //从相册选择 | |||
success: function (res) { | |||
console.log("tempFilePaths[0].startsWith('file://')", res.tempFilePaths[0], res.tempFilePaths[0].startsWith('file://')) | |||
pathToBase64(res.tempFilePaths[0]) | |||
.then((path) => { | |||
var data = { | |||
source: "1", | |||
agencyId: "52010106004", | |||
imageType: imageType, | |||
fileName: res.tempFilePaths[0], | |||
imageBase64: path, | |||
}; | |||
const options = { | |||
type: 2, | |||
data: data, | |||
method: "POST", | |||
showLoading: true, | |||
}; | |||
request(etcCarOcrCard, options).then((res) => { | |||
const data = stringToJson(res.bizContent); | |||
if (state.choiceIndex === "1") { | |||
state.form.vehicleId = data.plate_a; | |||
state.form.ownerName = data.man; | |||
state.form.vehicleType = data.vehicle; | |||
// state.form.useCharacter = data.character; | |||
state.form.vin = data.vin; | |||
state.form.engineNum = data.engine; | |||
state.form.registerDate = data.register; | |||
state.form.issueDate = data.issue; | |||
state.form.vehPosImgUrl = data.imageUrl; | |||
state.form.vehicleModel = data.model; | |||
} else { | |||
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.isTakePhotoModeShow = false | |||
}); | |||
}) | |||
.catch((error) => { }); | |||
if (state.choiceIndex == 3 || state.choiceIndex == 4) { | |||
state.showImg = false | |||
state.images = res.tempFilePaths[0] | |||
state.phoneType = state.choiceIndex | |||
state.isTakePhotoModeShow = false | |||
return | |||
} | |||
}, | |||
}) | |||
} | |||
const takePhoto = (val) => { | |||
console.log("拍照", val) | |||
// uni.navigateTo({ | |||
// url: `/subpackage/orders/takePhoto?phoneType=${val}` | |||
// }) | |||
state.phoneType = val; | |||
} | |||
const confirmReturn = (val) => { | |||
@@ -452,14 +374,27 @@ | |||
state.isTakePhotoModeShow = false | |||
var imageType = state.choiceIndex; | |||
console.log("图片地址val", val.tempImagePath) | |||
pathToBase64(val.tempImagePath) | |||
.then((path) => { | |||
if (state.choiceIndex == 3) { | |||
var imageType = 1; | |||
} else { | |||
var imageType = 2; | |||
} | |||
uni.uploadFile({ | |||
url: 'https://qtzl.etcjz.cn/minIo/upload', //仅为示例,非真实的接口地址 | |||
filePath: val.tempImagePath, | |||
name: 'file', | |||
formData: { | |||
'user': 'test', | |||
"bucket": 'default-bucket' | |||
}, | |||
success: (uploadFileRes) => { | |||
let uploadFileImage = 'http://100.64.2.113:9000' + '/default-bucket/' + JSON.parse(uploadFileRes.data).data.ossFilePath | |||
var data = { | |||
source: "1", | |||
agencyId: "52010106004", | |||
imageType: imageType, | |||
fileName: val.tempImagePath, | |||
imageBase64: path, | |||
imageUrl: uploadFileImage | |||
}; | |||
const options = { | |||
@@ -470,7 +405,7 @@ | |||
}; | |||
request(etcCarOcrCard, options).then((res) => { | |||
const data = stringToJson(res.bizContent); | |||
if (state.choiceIndex === "1") { | |||
if (state.choiceIndex === "3") { | |||
state.form.vehicleId = data.plate_a; | |||
state.form.ownerName = data.man; | |||
state.form.vehicleType = data.vehicle; | |||
@@ -490,8 +425,10 @@ | |||
} | |||
state.isTakePhotoModeShow = false | |||
}); | |||
}) | |||
.catch((error) => { }); | |||
// }) | |||
// .catch((error) => { }); | |||
}, | |||
}) | |||
} | |||
const takePhotoMode = (index) => { | |||
console.log("index", index) |
@@ -83,7 +83,8 @@ | |||
<view @click.stop="cancle">取消</view> | |||
</view> | |||
</view> | |||
<viewfinder v-if="state.phoneType" :phoneType="state.phoneType" @confirmReturn="confirmReturn"></viewfinder> | |||
<viewfinder v-if="state.phoneType" :phoneType="state.phoneType" :images="state.images" | |||
:showStartPhoto="state.showImg" @confirmReturn="confirmReturn" @camera="camera"></viewfinder> | |||
</template> | |||
<script lang="ts" setup> | |||
@@ -136,6 +137,8 @@ | |||
phoneType: 0, // 1 身份证正面 2 身份证反面 3行驶证正面 4行驶证反面 | |||
choiceIndex: 1, // 1 身份证正面 2 身份证反面 | |||
isTakePhotoModeShow: false, //选择拍照方式是否出来 | |||
showImg: true, | |||
images: "", | |||
genderList: [{ | |||
value: '男', | |||
label: '男' | |||
@@ -332,6 +335,9 @@ | |||
state.isTakePhotoModeShow = true | |||
state.choiceIndex = index | |||
} | |||
const camera = () => { | |||
state.phoneType = 0 | |||
} | |||
const xiangce = (val) => { | |||
console.log("val", val) | |||
var imageType = val; | |||
@@ -340,45 +346,15 @@ | |||
sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有 | |||
sourceType: ["album"], //从相册选择 | |||
success: function (res) { | |||
console.log("tempFilePaths[0].startsWith('file://')", res.tempFilePaths[0], res.tempFilePaths[0].startsWith('file://')) | |||
pathToBase64(res.tempFilePaths[0]) | |||
.then((path) => { | |||
var data = { | |||
source: "1", | |||
agencyId: "52010106004", | |||
imageType: imageType, | |||
fileName: res.tempFilePaths[0], | |||
imageBase64: path, | |||
}; | |||
const options = { | |||
type: 2, | |||
data: data, | |||
method: "POST", | |||
showLoading: true, | |||
}; | |||
request(etcOcrCard, options).then((res) => { | |||
const data = stringToJson(res.bizContent); | |||
if (state.choiceIndex === "1") { | |||
state.form.customerName = data.name; | |||
state.form.userPosImgUrl = data.imageUrl; | |||
state.form.address = data.address; | |||
} else { | |||
state.form.customerIdVld = data.enddate; | |||
state.form.userNegImgUrl = data.imageUrl; | |||
} | |||
state.isTakePhotoModeShow = false | |||
}); | |||
}) | |||
.catch((error) => { }); | |||
state.showImg = false | |||
state.images = res.tempFilePaths[0] | |||
state.phoneType = state.choiceIndex | |||
state.isTakePhotoModeShow = false | |||
}, | |||
}) | |||
} | |||
const takePhoto = (val) => { | |||
console.log("拍照", val) | |||
// uni.navigateTo({ | |||
// url: `/subpackage/orders/takePhoto?phoneType=${val}` | |||
// }) | |||
state.phoneType = val; | |||
} | |||
const confirmReturn = (val) => { | |||
@@ -386,14 +362,23 @@ | |||
state.isTakePhotoModeShow = false | |||
var imageType = state.choiceIndex; | |||
console.log("图片地址val", val.tempImagePath) | |||
pathToBase64(val.tempImagePath) | |||
.then((path) => { | |||
uni.uploadFile({ | |||
url: 'https://qtzl.etcjz.cn/minIo/upload', //仅为示例,非真实的接口地址 | |||
filePath: val.tempImagePath, | |||
name: 'file', | |||
formData: { | |||
'user': 'test', | |||
"bucket": 'default-bucket' | |||
}, | |||
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); | |||
var data = { | |||
source: "1", | |||
agencyId: "52010106004", | |||
imageType: imageType, | |||
fileName: val.tempImagePath, | |||
imageBase64: path, | |||
url: uploadFileImage | |||
}; | |||
const options = { | |||
@@ -415,8 +400,8 @@ | |||
state.isTakePhotoModeShow = false | |||
}); | |||
}) | |||
.catch((error) => { }); | |||
}, | |||
}) | |||
} | |||
const cancle = () => { | |||
state.isTakePhotoModeShow = false |
@@ -1,6 +1,6 @@ | |||
<template> | |||
<view class="content"> | |||
<view> | |||
<view v-if="pieDataAll.length>0"> | |||
<!-- <view v-if="pieDataAll.length>0"> --> | |||
<view class="title_name">{{dealDateTime[0]}}年{{dealDateTime[1]}}月{{dealDateTime[2]}}日黔通智联ETC事业部全国发行日报表 | |||
</view> | |||
@@ -73,7 +73,7 @@ | |||
</view> | |||
</view> | |||
<!-- <view v-else>暂无数据统计信息</view> --> | |||
<view class="no" v-else>暂无数据统计信息</view> | |||
<u-select v-model="selectTypeName" :list="typeRange" @confirm="selectConfirm"></u-select> | |||
</view> | |||
</template> | |||
@@ -598,4 +598,9 @@ | |||
line-height: 32px !important; | |||
font-size: 13px !important; | |||
} | |||
.no { | |||
text-align: center; | |||
margin: 50rpx auto; | |||
} | |||
</style> |
@@ -112,7 +112,7 @@ export function pathToBase64(path) { | |||
}) | |||
return | |||
} | |||
if (typeof my === 'object' && uni.canIUse('getFileSystemManager')) { | |||
uni.getFileSystemManager().readFile({ | |||
filePath: path, | |||
@@ -129,6 +129,21 @@ export function pathToBase64(path) { | |||
reject(new Error('not support')) | |||
}) | |||
} | |||
// export function pathToBase64(path) { | |||
// return new Promise(function(resolve, reject) { | |||
// u.getFileSystemManager().readFile({ //读取本地文件内容 | |||
// filePath: tempFilePath, // 文件路径 | |||
// encoding: 'base64', // 返回格式 | |||
// success: ({ | |||
// data | |||
// }) => { | |||
// return resolve('data:image/png;base64,' + data); | |||
// } | |||
// }); | |||
// reject(new Error('not support')) | |||
// }) | |||
// } | |||
export function base64ToPath(base64) { | |||
return new Promise(function(resolve, reject) { | |||
@@ -212,19 +227,19 @@ export function base64ToPath(base64) { | |||
} | |||
if (typeof my === 'object' && uni.canIUse('getFileSystemManager')) { | |||
var filePath = uni.env.USER_DATA_PATH + '/' + fileName | |||
uni.getFileSystemManager().writeFile({ | |||
filePath: filePath, | |||
data: dataUrlToBase64(base64), | |||
encoding: 'base64', | |||
success: function() { | |||
resolve(filePath) | |||
}, | |||
fail: function(error) { | |||
reject(error) | |||
} | |||
}) | |||
return | |||
} | |||
uni.getFileSystemManager().writeFile({ | |||
filePath: filePath, | |||
data: dataUrlToBase64(base64), | |||
encoding: 'base64', | |||
success: function() { | |||
resolve(filePath) | |||
}, | |||
fail: function(error) { | |||
reject(error) | |||
} | |||
}) | |||
return | |||
} | |||
reject(new Error('not support')) | |||
}) | |||
} | |||
@@ -298,17 +313,17 @@ export function pathToBase64New(path) { | |||
} | |||
if (typeof my === 'object' && uni.canIUse('getFileSystemManager')) { | |||
uni.getFileSystemManager().readFile({ | |||
filePath: path, | |||
encoding: 'base64', | |||
success: function(res) { | |||
resolve(res.data) | |||
}, | |||
fail: function(error) { | |||
reject(error) | |||
} | |||
}) | |||
return | |||
} | |||
filePath: path, | |||
encoding: 'base64', | |||
success: function(res) { | |||
resolve(res.data) | |||
}, | |||
fail: function(error) { | |||
reject(error) | |||
} | |||
}) | |||
return | |||
} | |||
reject(new Error('not support')) | |||
}) | |||
} | |||
} |
@@ -1,7 +1,7 @@ | |||
/* 接口中常量 */ | |||
// export const URL = "192.168.100.63"; | |||
export const URL = "trial.etcjz.cn"; | |||
// export const URL = "qtzl.etcjz.cn"; | |||
// export const URL = "trial.etcjz.cn"; | |||
export const URL = "qtzl.etcjz.cn"; | |||
// export const URL = "qtzl.etcjz.cn/test"; | |||
// http://192.168.100.63:50001 | |||
/** | |||
@@ -10,8 +10,8 @@ export const URL = "trial.etcjz.cn"; | |||
export const envs = { | |||
//开发环境配置 | |||
development: { | |||
baseUrl: "https://trial.etcjz.cn", | |||
// baseUrl: "https://qtzl.etcjz.cn", | |||
// baseUrl: "https://trial.etcjz.cn", | |||
baseUrl: "https://qtzl.etcjz.cn", | |||
// baseUrl: "https://qtzl.etcjz.cn/test", | |||
// baseUrl: "http://192.168.100.158:8085", | |||
// baseUrl: "http://192.168.100.63:50001", | |||
@@ -20,8 +20,8 @@ export const envs = { | |||
production: { | |||
// baseUrl: "http://192.168.124.6:8087", | |||
// baseUrl: "http://222.85.144.89:19002", | |||
// baseUrl: "https://qtzl.etcjz.cn", | |||
baseUrl: "https://trial.etcjz.cn", | |||
baseUrl: "https://qtzl.etcjz.cn", | |||
// baseUrl: "https://trial.etcjz.cn", | |||
// baseUrl: "https://qtzl.etcjz.cn/test", | |||
// baseUrl: "http://192.168.100.158:8085", | |||
// baseUrl: "http://192.168.100.63:50001", |
@@ -63,7 +63,7 @@ export function request(code, options = {}, start = false) { | |||
let contentType = 'application/x-www-form-urlencoded' | |||
//判断baseUri是否为空 | |||
if (options.baseUrl) { | |||
if (options.baseUrl) { | |||
options.url = options.baseUrl | |||
} | |||
//根据type判断数据传输格式 | |||
@@ -80,7 +80,7 @@ export function request(code, options = {}, start = false) { | |||
'content-type': contentType, | |||
'Access-Token': getItem(StorageKeys.Token) | |||
} | |||
console.log('Token', getItem(StorageKeys.Token)) | |||
console.log('code', code, options.data) | |||
if (!start) { | |||
//判断code不为空 | |||
if (code) { |
@@ -206,6 +206,9 @@ export const getOrderStatusName = (status) => { | |||
case Number(OrderStatus["完成车辆信息上传/待支付"]): | |||
return '待支付'; | |||
break; | |||
case Number(OrderStatus["已支付/待签约"]): | |||
return '待签约'; | |||
break; | |||
default: | |||
break; | |||
} |