test(KYC页): 测试图片上传方式

This commit is contained in:
hzj 2025-11-12 14:16:43 +08:00
parent b1db3c8d01
commit 8a257b3b02

View File

@ -60,14 +60,20 @@
src="/src/assets/icon/addImg.png" src="/src/assets/icon/addImg.png"
alt="" alt=""
style="display: block; width: 15vw; aspect-ratio: 1/1; object-fit: cover" style="display: block; width: 15vw; aspect-ratio: 1/1; object-fit: cover"
@click="triggerFileInput"
/> />
<input <input
ref="fileInputRef"
type="file" type="file"
accept="image/*" accept="image/*"
@change="handleFileChange" @change="handleFileChange"
style="display: none" style="
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
opacity: 0;
z-index: 2;
"
/> />
</div> </div>
@ -179,8 +185,6 @@ import { getWithdrawInfoList, addWithdrawInfo, updateWithdrawInfo } from '@/api/
const { t, locale } = useI18n() const { t, locale } = useI18n()
const router = useRouter() const router = useRouter()
const fileInputRef = ref(null)
// //
locale.value && setDocumentDirection(locale.value) locale.value && setDocumentDirection(locale.value)
@ -206,14 +210,6 @@ const checkStatus = computed(() => {
return applyInfo.value.contactNumber != '' && previewUrls.value.length > 0 return applyInfo.value.contactNumber != '' && previewUrls.value.length > 0
}) })
//
const triggerFileInput = () => {
console.log('触发文件选择')
if (fileInputRef.value) {
fileInputRef.value.click()
}
}
// () // ()
const handleFileChange = (e) => { const handleFileChange = (e) => {
console.log('=== 文件选择事件开始 ===') console.log('=== 文件选择事件开始 ===')