From bb74490581fded3f1dce6ccea0a99c03aa263248 Mon Sep 17 00:00:00 2001 From: hzj <1304805162@qq.com> Date: Wed, 12 Nov 2025 20:54:49 +0800 Subject: [PATCH] =?UTF-8?q?style18(KYC=E9=A1=B5):=20=E6=B8=85=E9=99=A4?= =?UTF-8?q?=E6=97=A0=E7=94=A8=E4=BB=A3=E7=A0=81=E5=92=8C=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/Wallet/CashOut/KYC.vue | 80 +++----------------------------- 1 file changed, 7 insertions(+), 73 deletions(-) diff --git a/src/views/Wallet/CashOut/KYC.vue b/src/views/Wallet/CashOut/KYC.vue index 35730dd..bc0332e 100644 --- a/src/views/Wallet/CashOut/KYC.vue +++ b/src/views/Wallet/CashOut/KYC.vue @@ -99,7 +99,7 @@ /> -
+
applyInfo.value.otherDescription.length) //字数 const tempFiles = ref([]) //用于提交的临时图片文件列表 -const previewUrls = ref([]) //预览图片数组 +// const previewUrls = ref([]) //预览图片数组 const resImgUrls = ref([]) //用于提交申请的图片数组 const updateStatus = ref(false) //是否为修改 @@ -227,7 +227,7 @@ const applyInfo = ref({ // 是否全填 const checkStatus = computed(() => { - return applyInfo.value.contactNumber != '' && previewUrls.value.length > 0 + return applyInfo.value.contactNumber != '' && resImgUrls.value.length > 0 }) // 点击图片选择按钮 @@ -245,7 +245,7 @@ const callNativeImagePicker = async () => { console.log('调用原生图片选择器') // 最多3张图片 - if (previewUrls.value.length >= 3) { + if (resImgUrls.value.length >= 3) { throw new Error('Maximum number of images reached') } @@ -267,8 +267,7 @@ const callNativeImagePicker = async () => { console.log('接收到原生图片数据:', file.path) // 生成预览图 - previewUrls.value.push(file.path) - tempFiles.value.push(file.path) + resImgUrls.value.push(file.path) showSuccess(t('image_selected_success')) resolve() @@ -280,82 +279,19 @@ const callNativeImagePicker = async () => { } } catch (error) { console.error('处理原生图片选择结果失败:', error) - // showError(t('file_processing_failed')) reject(error) } }) } catch (error) { console.error('调用原生图片选择器失败:', error) - // showError(t('native_image_picker_failed')) reject(error) } }) } -//点击文件选择按钮 -const onFileInputClick = () => { - console.log('=== 点击文件选择按钮 ===') -} - -// 处理文件选择(每次选一张) -const handleFileChange = (e) => { - console.log('=== 文件选择事件结束 ===') - try { - // 详细记录文件选择状态 - if (!e.target.files || e.target.files.length === 0) { - console.warn('No files selected or unsupported environment') - // 可以添加用户提示 - console.log( - '触发条件: !e.target=', - !e.target, - ', !e.target.files=', - !e.target.files, - ', e.target.files.length === 0=', - e.target.files?.length === 0 - ) - - return - } - - // 最多3张图片 - if (previewUrls.value.length < 3) { - const fileList = e.target.files // 获取第一个文件对象 - - // 检查是否有文件 - if (!fileList || fileList.length === 0) { - console.error('未选择文件') - return - } - - // 提取第一个文件并验证 - const file = fileList[0] - if (!file.type || !file.type.startsWith('image/')) { - console.error(`不支持的文件类型: ${file.type || '未知'}`) - showError(t('unsupported_file_type')) - return - } - - // 3. 通过验证后的操作(示例) - console.log('文件名:', file.name) // defaultAvatar.png - console.log('文件类型:', file.type) // image/png - console.log('文件大小:', (file.size / 1024).toFixed(2), 'KB') - - // 生成预览图 - previewUrls.value.push(URL.createObjectURL(file)) - //临时文件列表,用于上传 - tempFiles.value.push(file) - } else { - showWarning(t('max_images_warning')) - } - } catch (error) { - console.error('File selection error:', error) - } -} - +// 取消图片选择 const handleCancel = (index) => { - previewUrls.value.splice(index, 1) tempFiles.value.splice(index, 1) - resImgUrls.value.splice(index, 1) } // 上传图片 @@ -374,12 +310,11 @@ const uploadImgUrl = async () => { } // 提交申请 -const Submit = async () => { +const Submit = () => { // 检查是否漏填 console.log('checkStatus.value:', checkStatus.value) if (checkStatus.value) { - await uploadImgUrl() applyInfo.value.passportFrontUrl = JSON.stringify(resImgUrls.value) if (updateStatus.value) { console.log('更新信息:', applyInfo.value) @@ -404,7 +339,6 @@ const getWithdrawInfoListData = async () => { updateStatus.value = true applyInfo.value = resWithdrawInfoList.body[0] let imgList = JSON.parse(resWithdrawInfoList.body[0].passportFrontUrl) - previewUrls.value = imgList.map((item) => item) resImgUrls.value = imgList.map((item) => item) } } catch (error) {