This commit is contained in:
李志鹏
2025-10-23 17:01:13 +08:00
parent 86091b8e40
commit c1d57f2347
4 changed files with 43 additions and 25 deletions

View File

@@ -4,6 +4,9 @@
import { ref, reactive, onMounted } from 'vue'
import { useRouter } from 'vue-router'
import { uploadCustomerPhoto } from '@/api/workshop'
import { useGenerateStore } from '@/stores'
const generateStore = useGenerateStore()
const emit = defineEmits(['view-type'])
onMounted(() => {
emit('view-type', 1)
@@ -13,13 +16,12 @@
url:"",
file: null,
});
console.log(fileData)
// 上传照片
const handleUploadFace = () => {
const input = document.createElement('input')
input.type = 'file'
input.accept = 'image/*'
input.capture = 'camera'
// input.capture = 'camera'
input.click()
input.onchange = (e: any) => {
const file = e.target.files[0]
@@ -42,8 +44,7 @@
formData.append('visitRecordId', "1")
formData.append('file', fileData.file)
uploadCustomerPhoto(formData).then(res => {
console.log(res, res.photoUrl)
generateStore.updatePhotoInfo(res);
router.push({ name: 'customize' })
})
}