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

This commit is contained in:
hzj 2025-11-12 14:59:00 +08:00
parent 085a761fa3
commit 4c47db87cd

View File

@ -64,6 +64,7 @@
<input <input
type="file" type="file"
accept="image/*" accept="image/*"
@click="onFileInputClick"
@change="handleFileChange" @change="handleFileChange"
style=" style="
position: absolute; position: absolute;
@ -71,7 +72,8 @@
left: 0; left: 0;
width: 100%; width: 100%;
height: 100%; height: 100%;
background-color: #3dff54; opacity: 0;
cursor: pointer;
" "
/> />
</div> </div>
@ -81,6 +83,8 @@
alt="" alt=""
style="display: block; width: 5vw; aspect-ratio: 1/1; object-fit: cover" style="display: block; width: 5vw; aspect-ratio: 1/1; object-fit: cover"
/> />
<!-- 预览图片 -->
<div v-for="(imgUrl, index) in previewUrls" :key="index" style="position: relative"> <div v-for="(imgUrl, index) in previewUrls" :key="index" style="position: relative">
<img <img
:src="imgUrl" :src="imgUrl"
@ -209,10 +213,15 @@ const checkStatus = computed(() => {
return applyInfo.value.contactNumber != '' && previewUrls.value.length > 0 return applyInfo.value.contactNumber != '' && previewUrls.value.length > 0
}) })
//
const onFileInputClick = (event) => {
console.log('=== 点击文件选择按钮 ===')
showInfo('Please select a file')
}
// () // ()
const handleFileChange = (e) => { const handleFileChange = (e) => {
console.log('=== 文件选择事件开始 ===') console.log('=== 文件选择事件结束 ===')
try { try {
// //
if (!e.target.files || e.target.files.length === 0) { if (!e.target.files || e.target.files.length === 0) {