From 03a9794dfa8cf5f953a8ea0e81d55a5804d28863 Mon Sep 17 00:00:00 2001 From: bb_pan Date: Thu, 19 Jun 2025 18:11:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/back/backCode.vue | 2 +- src/pages/my/signature.vue | 154 ++++++++++++++++++------------------ 2 files changed, 78 insertions(+), 78 deletions(-) diff --git a/src/pages/back/backCode.vue b/src/pages/back/backCode.vue index f7a947c..786beaf 100644 --- a/src/pages/back/backCode.vue +++ b/src/pages/back/backCode.vue @@ -303,7 +303,7 @@ const submitCode = () => { console.log(taskInfo.value) if (maId.value == '') { uni.showToast({ title: '请先添加退料设备编码!', icon: 'none' }) - } else if(apDetection.value == '不合格') { + } else if(apDetection.value == '不合格' && !bmFileInfos.value) { uni.showToast({ title: '请上传附件!', icon: 'none' }) } else { // console.log(typeList.value) diff --git a/src/pages/my/signature.vue b/src/pages/my/signature.vue index 7e0a06e..a1d8c8f 100644 --- a/src/pages/my/signature.vue +++ b/src/pages/my/signature.vue @@ -128,32 +128,32 @@ const preview = () => { // 拍照/上传 const handlePhoto = () => { console.log('拍照/上传') - // uni.chooseImage({ - // count: 1, - // sizeType: ['compressed'], - // sourceType: ['album', 'camera'], - // success: (res) => { - // console.log('🚀 ~ handlePhoto ~ res.tempFilePaths[0]:', res) - // // imgPath.value = res.tempFilePaths[0] - // // isRotate.value = false - // signType.value = 1 - // uploadImg(res.tempFilePaths[0]) - // }, - // }) - uni.showActionSheet({ - itemList: ['拍照', '从相册选择'], + uni.chooseImage({ + count: 1, + sizeType: ['compressed'], + sourceType: ['album', 'camera'], success: (res) => { - if (res.tapIndex === 0) { - getCamera() - } else if (res.tapIndex === 1) { - // 从相册选择 - getPhoto() - } - }, - fail: (err) => { - console.error('操作菜单选择失败:', err) + console.log('🚀 ~ handlePhoto ~ res.tempFilePaths[0]:', res) + // imgPath.value = res.tempFilePaths[0] + // isRotate.value = false + signType.value = 1 + uploadImg(res.tempFilePaths[0]) }, }) + // uni.showActionSheet({ + // itemList: ['拍照', '从相册选择'], + // success: (res) => { + // if (res.tapIndex === 0) { + // getCamera() + // } else if (res.tapIndex === 1) { + // // 从相册选择 + // getPhoto() + // } + // }, + // fail: (err) => { + // console.error('操作菜单选择失败:', err) + // }, + // }) } // 拍照 const getCamera = () => { @@ -177,61 +177,61 @@ const onCameraError = (message) => { } const onCameraSuccess = (file) => { // const file1 = "data:image/jpeg;base64," + file; - const file1 = file - uni.showToast({ title: file, icon: 'none', duration: 20000 }) - uni.showModal({ - title: '是否上传图片', - content: file, - }) - let params = { - image: file1, - jiju_type: '', - auth_lic: - 'xIWDlaDVdijcBB4mjhGCPYk5Kvk8tHZJbUn+vW+ih15+MYx98e/PXyBmKL5gFcWMPznLgDA15QuSAnZQSLddwdy9HkZgtuQDEEZZ351Eyb1eiDUccUnyoSGIrNimbx5TooBNNPYqU4qJeFrPJXAqjBHzRrxoBxuR2CEGKQPgHC4=', - } - console.log('🚀 ~ onCameraSuccess ~ params:', params) - - // try { - // const signUrl = params - // if (opts.isLease) { - // const params = { - // id: opts.id, - // leaseSignUrl: signUrl, - // leaseSignType: signType.value, - // } - // console.log('🚀 ~ success: ~ params:', params) - // updateLeaseApplyInfoSign(params).then((res) => { - // console.log('🚀 ~ uploadImg-领料 ~ res:', res) - // uni.navigateBack() - // }) - // } else if (opts.isBack) { - // const params = { - // id: opts.id, - // backSignUrl: signUrl, - // backSignType: signType.value, - // } - // console.log('🚀 ~ success: ~ params:', params) - // updateSignById(params).then((res) => { - // console.log('🚀 ~ uploadImg-退料 ~ res:', res) - // uni.navigateBack() - // }) - // } else { - // const params = { - // signUrl: signUrl, - // signType: signType.value, - // } - // updateSign(params).then((res) => { - // console.log('🚀 ~ uploadImg-个人中心 ~ res:', res) - // getSignData() - // }) - // } - // } catch (error) { - // console.log('🚀 ~ uploadImg ~ error:', error) - // uni.showToast({ - // title: '上传失败', - // icon: 'none', - // }) + // const file1 = file + // uni.showToast({ title: file, icon: 'none', duration: 20000 }) + // uni.showModal({ + // title: '是否上传图片', + // content: file, + // }) + // let params = { + // image: file1, + // jiju_type: '', + // auth_lic: + // 'xIWDlaDVdijcBB4mjhGCPYk5Kvk8tHZJbUn+vW+ih15+MYx98e/PXyBmKL5gFcWMPznLgDA15QuSAnZQSLddwdy9HkZgtuQDEEZZ351Eyb1eiDUccUnyoSGIrNimbx5TooBNNPYqU4qJeFrPJXAqjBHzRrxoBxuR2CEGKQPgHC4=', // } + // console.log('🚀 ~ onCameraSuccess ~ params:', params) + + try { + const signUrl = file + if (opts.isLease) { + const params = { + id: opts.id, + leaseSignUrl: signUrl, + leaseSignType: signType.value, + } + console.log('🚀 ~ success: ~ params:', params) + updateLeaseApplyInfoSign(params).then((res) => { + console.log('🚀 ~ uploadImg-领料 ~ res:', res) + uni.navigateBack() + }) + } else if (opts.isBack) { + const params = { + id: opts.id, + backSignUrl: signUrl, + backSignType: signType.value, + } + console.log('🚀 ~ success: ~ params:', params) + updateSignById(params).then((res) => { + console.log('🚀 ~ uploadImg-退料 ~ res:', res) + uni.navigateBack() + }) + } else { + const params = { + signUrl: signUrl, + signType: signType.value, + } + updateSign(params).then((res) => { + console.log('🚀 ~ uploadImg-个人中心 ~ res:', res) + getSignData() + }) + } + } catch (error) { + console.log('🚀 ~ uploadImg ~ error:', error) + uni.showToast({ + title: '上传失败', + icon: 'none', + }) + } } // 上传 const uploadImg2 = async (base64Data) => {