浏览代码

商品微信分享显示

skyblued 3 年之前
父节点
当前提交
7d94ef292a
共有 2 个文件被更改,包括 30 次插入1 次删除
  1. 13 0
      src/teacher/share-page/share-mall/index.module.less
  2. 17 1
      src/teacher/share-page/share-mall/index.tsx

+ 13 - 0
src/teacher/share-page/share-mall/index.module.less

@@ -251,3 +251,16 @@
     margin-left: 5px;
   }
 }
+.wxpopup {
+  width: 100%;
+  height: 100vh;
+  position: fixed;
+  top: 0;
+  left: 0;
+  background: rgba(0, 0, 0, 0.5);
+  z-index: 9999;
+  img {
+    width: 88%;
+    margin: 0 6%;
+  }
+}

+ 17 - 1
src/teacher/share-page/share-mall/index.tsx

@@ -22,6 +22,7 @@ import ColSticky from '@/components/col-sticky'
 import { shareCall } from '../share'
 import { state } from '@/state'
 import qs from 'query-string'
+import { getAssetsHomeFile } from '../share-video'
 
 export default defineComponent({
   name: 'goods-detail',
@@ -34,7 +35,8 @@ export default defineComponent({
       radio: 0,
       skuStockList: [] as any[],
       detailMobileHtml: '',
-      loading: false
+      loading: false,
+      wxStatus: false
     }
   },
   computed: {
@@ -187,6 +189,10 @@ export default defineComponent({
 
     //打开APP
     onDetail() {
+      if (browser().weixin) {
+        this.wxStatus = true
+        return
+      }
       const { origin } = location
       const query = this.$route.query
       let str =
@@ -325,6 +331,16 @@ export default defineComponent({
             </Button>
           </div>
         </ColSticky>
+        {this.wxStatus && (
+          <div
+            class={styles.wxpopup}
+            onClick={() => {
+              this.wxStatus = false
+            }}
+          >
+            <img src={getAssetsHomeFile('wx_bg.png')} alt="" />
+          </div>
+        )}
       </div>
     )
   }