瀏覽代碼

分享图片和预览图片刘海问题

skyblued 3 年之前
父節點
當前提交
2bf31d81dd
共有 2 個文件被更改,包括 14 次插入3 次删除
  1. 10 0
      src/views/shop-mall/goods-detail/index.module.less
  2. 4 3
      src/views/shop-mall/goods-detail/index.tsx

+ 10 - 0
src/views/shop-mall/goods-detail/index.module.less

@@ -268,3 +268,13 @@
     }
   }
 }
+.imagesOverlayWrap{
+  :global{
+    .van-badge__wrapper{
+      top: 40px;
+    }
+    .van-image-preview__index{
+      top: 40px;
+    }
+  }
+}

+ 4 - 3
src/views/shop-mall/goods-detail/index.tsx

@@ -137,7 +137,8 @@ export default defineComponent({
       ImagePreview({
         images: this.albumPics,
         startPosition: index,
-        closeable: true
+        closeable: true,
+        className: styles.imagesOverlayWrap
       })
     },
     onShowImg(target: any) {
@@ -197,12 +198,12 @@ export default defineComponent({
   render() {
     const product = this.product
     const selectSku = this.skuStockList.find((n: any) => n.id === this.radio)
+    const sharePic = this.product.pic + '?v=' + Date.now()
     return (
       <div class={styles.goodsDetail}>
         <ColHeader
           v-slots={{
             right: () => {
-              console.log(this.$route.query.teacher,1)
               if (state.platformType === 'TEACHER' || this.$route.query.teacher) {
                 return (
                   <div
@@ -399,7 +400,7 @@ export default defineComponent({
           >
             <div class={styles.shareWrap}>
               <div class={styles.shareLeft}>
-                <img crossorigin="anonymous" class={styles.sharePic} src={this.product.pic}></img>
+                <img crossorigin="anonymous" class={styles.sharePic} src={sharePic}></img>
               </div>
               <div class={styles.shareRight}>
                 <div class={styles.shareShopTitle}>{this.product.name}</div>