diff --git a/packages/mobile/src/views/Material/MaterialDetails.vue b/packages/mobile/src/views/Material/MaterialDetails.vue index 1467d9b..6f45127 100644 --- a/packages/mobile/src/views/Material/MaterialDetails.vue +++ b/packages/mobile/src/views/Material/MaterialDetails.vue @@ -13,15 +13,24 @@ style="font-size: 18px; font-weight: bold; line-height: inherit" > - - - - - - + + + + + + + - - + + + @@ -32,7 +41,7 @@ import "vant/es/toast/style"; import "vant/es/popup/style"; import { ref, onMounted, toRaw, reactive } from "vue"; import { useRouter, useRoute } from "vue-router"; -import { showToast, showLoadingToast } from "vant"; +import { showToast, showLoadingToast, showImagePreview } from "vant"; import { request } from "../../../../shared/utils/request"; const router = useRouter(); @@ -41,6 +50,7 @@ const route = useRoute(); const yhzDetail = ref({}); const wzData = ref([]); const wzDetailData = ref({}); // 物资详情数据 +const photos = ref([]); // 物资图片数据 onMounted(() => { const data = JSON.parse(decodeURIComponent(route.params.data)); @@ -59,6 +69,7 @@ const getwzDetail = async () => { }); if (res.code && res.code === "00000") { wzDetailData.value = res.data.material; + photos.value = res.data.photos; } else { throw new Error(res.message); } @@ -77,6 +88,14 @@ const onClickLeft = () => { params: { data: encodeURIComponent(JSON.stringify(yhzDetail.value)) }, }); }; + +const showImage = (photos) => { + const photosArr = photos.map((item) => item.photoUrl); + showImagePreview({ + images: photosArr, + closeable: true, + }); +};