Prechádzať zdrojové kódy

fix(goods): 修复商品图片点击预览功能

- 导入 SwiperList 类型以规范类型声明
- 新增 handleClick 函数实现图片预览功能
- 在 wd-swiper 组件上绑定点击事件触发图片预览
- 修正 manifest.json 文件末尾格式问题
zhangtao 1 týždeň pred
rodič
commit
ae26dced30
1 zmenil súbory, kde vykonal 4 pridanie a 1 odobranie
  1. 4 1
      src/subPack-xsb/goods/index.vue

+ 4 - 1
src/subPack-xsb/goods/index.vue

@@ -149,6 +149,9 @@ async function handleAddCart() {
     console.log(error)
   }
 }
+function handleClick() {
+  uni.previewImage({ urls: swiperList.value as string[] })
+}
 </script>
 
 <template>
@@ -159,7 +162,7 @@ async function handleAddCart() {
       safe-area-inset-top left-arrow fixed @click-left="router.back()"
     />
     <template v-if="goodsInfo">
-      <wd-swiper v-model:current="current" :list="swiperList" :autoplay="false" :height="375">
+      <wd-swiper v-model:current="current" :list="swiperList" :autoplay="false" :height="375" @click="handleClick">
         <template #indicator="{ current: currentIndex, total }">
           <view class="custom-indicator absolute bottom-60rpx right-20rpx px26rpx">
             {{ currentIndex + 1 }}/{{ total }}