feat(KYC页面): 修复获取重复图片的问题
This commit is contained in:
parent
73c9473cf6
commit
626a63f311
@ -214,7 +214,6 @@ const tempFiles = ref([]) //用于提交的临时图片文件列表
|
|||||||
const resImgUrls = ref([]) //用于提交申请的图片数组
|
const resImgUrls = ref([]) //用于提交申请的图片数组
|
||||||
|
|
||||||
const updateStatus = ref(false) //是否为修改
|
const updateStatus = ref(false) //是否为修改
|
||||||
const isInAppEnvironment = ref(false)
|
|
||||||
|
|
||||||
const applyInfo = ref({
|
const applyInfo = ref({
|
||||||
id: '', //提现信息ID
|
id: '', //提现信息ID
|
||||||
@ -249,6 +248,9 @@ const callNativeImagePicker = async () => {
|
|||||||
throw new Error('Maximum number of images reached')
|
throw new Error('Maximum number of images reached')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 记录当前所有已选图片路径,用于去重判断
|
||||||
|
const existingImagePaths = new Set(resImgUrls.value)
|
||||||
|
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
try {
|
try {
|
||||||
uploadImgFile(async (access) => {
|
uploadImgFile(async (access) => {
|
||||||
@ -266,6 +268,13 @@ const callNativeImagePicker = async () => {
|
|||||||
const file = result.data
|
const file = result.data
|
||||||
console.log('接收到原生图片数据:', file.path)
|
console.log('接收到原生图片数据:', file.path)
|
||||||
|
|
||||||
|
if (existingImagePaths.has(file.path)) {
|
||||||
|
console.log('检测到重复图片,继续等待新图片...')
|
||||||
|
// 不处理重复图片,继续等待新的图片数据
|
||||||
|
// 这里不调用 resolve 或 reject,让 uploadImgFile 继续检查
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// 生成预览图
|
// 生成预览图
|
||||||
resImgUrls.value.push(file.path)
|
resImgUrls.value.push(file.path)
|
||||||
resolve()
|
resolve()
|
||||||
@ -373,7 +382,6 @@ const updateWithdrawInfoData = async () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
isInAppEnvironment.value = isInApp()
|
|
||||||
getWithdrawInfoListData() // 获取个人申请信息
|
getWithdrawInfoListData() // 获取个人申请信息
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user