Browse Source

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

skyblued 3 years ago
parent
commit
2bf31d81dd

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