This commit is contained in:
李志鹏
2025-10-24 15:19:29 +08:00
parent 40ec2ce775
commit 114cea1a29
6 changed files with 35 additions and 26 deletions

View File

@@ -39,8 +39,8 @@
if (fileData.id) return router.push({ name: 'customize' })
if (!fileData.file) return
const formData = new FormData()
formData.append('customerId', '1')
formData.append('visitRecordId', '1')
formData.append('customerId', generateStore.customerId + '')
formData.append('visitRecordId', generateStore.visitRecordId + '')
formData.append('file', fileData.file)
uploadCustomerPhoto(formData).then((res) => {
generateStore.updatePhotoInfo(res)
@@ -48,6 +48,10 @@
router.push({ name: 'customize' })
})
}
// 处理照片加载错误
const pictureLoadError = (e: any) => {
// generateStore.updatePhotoInfo({})
}
</script>
<template>
@@ -62,7 +66,7 @@
</div>
<!-- 照片 -->
<div class="picture" v-if="fileData.url">
<img :src="fileData.url" />
<img :src="fileData.url" @error="pictureLoadError" />
</div>
<div class="btns">
<template v-if="fileData.url">