This commit is contained in:
hongchao 2025-11-03 16:38:02 +08:00
commit c0f90cc4ee
2 changed files with 1468 additions and 1454 deletions

View File

@ -194,7 +194,7 @@ export default {
onBackPress(options) { onBackPress(options) {
console.log("进了-----") console.log("进了-----")
// //
if (this.showCamera){ if (this.showCamera) {
console.log('关闭相机...'); console.log('关闭相机...');
try { try {
this.stopCamera(); this.stopCamera();
@ -517,8 +517,12 @@ export default {
// //
console.log('拍照前聚焦...'); console.log('拍照前聚焦...');
console.log('开始拍照...'); console.log('开始拍照...');
CameraPreview.takePicture({width:this.screenWidth, height:this.screenHeight, quality: 50}, async (base64PictureData) => { CameraPreview.takePicture({
console.log('拍照返回数据',base64PictureData); width: this.screenWidth,
height: this.screenHeight,
quality: 50
}, async (base64PictureData) => {
console.log('拍照返回数据', base64PictureData);
await this.processImage(base64PictureData); await this.processImage(base64PictureData);
}); });
} catch (error) { } catch (error) {
@ -580,13 +584,13 @@ export default {
"Content-Type": "application/json;charset=UTF-8" "Content-Type": "application/json;charset=UTF-8"
}, },
success: async (res) => { success: async (res) => {
if (!res.data.code){ if (!res.data.code) {
res=JSON.parse(decryptWithSM4(res.data)) res = JSON.parse(decryptWithSM4(res.data))
} else { } else {
res =res.data res = res.data
} }
const {data: resData} = res const {data: resData} = res
if (resData.code===0){ if (resData.code === 0) {
if (resData.data.result) { if (resData.data.result) {
this.queryCodeParams.maCode = resData.data.result this.queryCodeParams.maCode = resData.data.result
await this.closeCamera(); await this.closeCamera();
@ -672,20 +676,20 @@ export default {
"Content-Type": "application/json;charset=UTF-8" "Content-Type": "application/json;charset=UTF-8"
}, },
success: async (res) => { success: async (res) => {
if (!res.data.code){ if (!res.data.code) {
res=JSON.parse(decryptWithSM4(res.data)) res = JSON.parse(decryptWithSM4(res.data))
} else { } else {
res =res.data res = res.data
} }
console.log("res", res); console.log("res", res);
console.log("res.data",res.data) console.log("res.data", res.data)
const {data: resData} = res const {data: resData} = res
console.log("resData",resData) console.log("resData", resData)
console.log("resData.data",resData.data) console.log("resData.data", resData.data)
console.log("resData.code",resData.code) console.log("resData.code", resData.code)
console.log("resData.data.result",resData.data.result) console.log("resData.data.result", resData.data.result)
if (resData.code===0){ if (resData.code === 0) {
if (resData.data.result) { if (resData.data.result) {
this.queryCodeParams.maCode = resData.data.result this.queryCodeParams.maCode = resData.data.result
await this.closeCamera(); await this.closeCamera();
@ -831,9 +835,18 @@ export default {
opacity: 0; opacity: 0;
transition: opacity 0.3s; transition: opacity 0.3s;
} }
.custom-toast.top { top: 0; }
.custom-toast.bottom { bottom: 0; } .custom-toast.top {
.custom-toast.show { opacity: 1; } top: 0;
}
.custom-toast.bottom {
bottom: 0;
}
.custom-toast.show {
opacity: 1;
}
.page-container { .page-container {
display: flex; display: flex;
@ -888,6 +901,7 @@ export default {
z-index: 3; z-index: 3;
pointer-events: auto; pointer-events: auto;
} }
.control-btn { .control-btn {
width: 100rpx; width: 100rpx;
height: 100rpx; height: 100rpx;