feat(KYC页面): 修复获取上一次注入图片的问题

This commit is contained in:
hzj 2025-11-13 12:30:14 +08:00
parent 7248e362b2
commit 5268820610

View File

@ -207,6 +207,9 @@ const count = computed(() => applyInfo.value.otherDescription.length) //字数
const tempFiles = ref([]) //
// const previewUrls = ref([]) //
const resImgUrls = ref([]) //
const lastImgUrl = computed(() => {
return resImgUrls.value.length > 0 ? resImgUrls.value[resImgUrls.value.length - 1] : null
}) //
const updateStatus = ref(false) //
@ -243,9 +246,6 @@ const callNativeImagePicker = async () => {
throw new Error('Maximum number of images reached')
}
//
const existingImagePaths = new Set(resImgUrls.value)
//
const filterDuplicateImages = (access) => {
try {
@ -261,7 +261,7 @@ const callNativeImagePicker = async () => {
console.log('检查图片数据:', file.path)
// false
if (existingImagePaths.has(file.path)) {
if (lastImgUrl.value && file.path === lastImgUrl.value) {
console.log('检测到重复图片,继续等待新图片...')
return false
}
@ -296,13 +296,7 @@ const callNativeImagePicker = async () => {
const file = result.data
console.log('接收到原生图片数据:', file.path)
if (existingImagePaths.has(file.path)) {
console.log('检测到重复图片,继续等待新图片...')
//
// resolve reject uploadImgFile
return
}
lastImgUrl.value = file.path //
//
resImgUrls.value.push(file.path)
resolve()