test(KYC页): 测试图片上传方式
This commit is contained in:
parent
085a761fa3
commit
4c47db87cd
@ -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) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user