style18(KYC页): 清除无用代码和注释

This commit is contained in:
hzj 2025-11-12 20:54:49 +08:00
parent 746956b822
commit bb74490581

View File

@ -99,7 +99,7 @@
/>
<!-- 预览图片 -->
<div v-for="(imgUrl, index) in previewUrls" :key="index" style="position: relative">
<div v-for="(imgUrl, index) in resImgUrls" :key="index" style="position: relative">
<img
:src="imgUrl"
alt=""
@ -210,7 +210,7 @@ locale.value && setDocumentDirection(locale.value)
const count = computed(() => 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) {