diff --git a/src/apis/home.ts b/src/apis/home.ts index 53d1336..d6aca4c 100644 --- a/src/apis/home.ts +++ b/src/apis/home.ts @@ -14,5 +14,5 @@ export const trayOut = (): Promise => http.post('tray/out') export const photoList = (params: System.Page): Promise => http.get('/photo/list', { params }) export const takePhoto = (params?: { lightIntensity: number | null }): Promise => http.post('/photo/take', params) export const savePhoto = (params: any): Promise => http.post('/photo/save', params) -export const getPhoto = (id: number): Promise => http.get(`/photo/id=${id}`) +export const getPhoto = (id: number): Promise => http.get(`/photo/${id}`) export const delPhoto = (ids: string): Promise => http.delete(`/photo/${ids}`) diff --git a/src/components/home/EditPhoto/index.vue b/src/components/home/EditPhoto/index.vue index 99343f3..ecef2b7 100644 --- a/src/components/home/EditPhoto/index.vue +++ b/src/components/home/EditPhoto/index.vue @@ -2,6 +2,7 @@ import { getPhoto, savePhoto } from 'apis/home' import { getOreList } from 'apis/ore' import { FtMessage } from 'libs/message' +import { ImageViewer as TImageViewer } from 'tdesign-mobile-vue' import { onMounted, ref } from 'vue' const props = defineProps({ @@ -71,6 +72,16 @@ const mousedownHandle = async (e: Event) => { } const activeTube = ref(Array.from({ length: 16 }).fill(false)) + +const previewVisible = ref(false) +const photos = ref([]) +const previewHandle = () => { + if (!form.value.url) { + return + } + photos.value = [form.value.url] + previewVisible.value = true +}