333
This commit is contained in:
@@ -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' })
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user