tremble 3 tahun lalu
induk
melakukan
6fa612682a
1 mengubah file dengan 30 tambahan dan 1 penghapusan
  1. 30 1
      src/components/RTC/PageRtcLive.vue

+ 30 - 1
src/components/RTC/PageRtcLive.vue

@@ -545,6 +545,35 @@ const startFollow = (app) => {
       },
     ]);
 
+    if (browser.detectWeixin()) {
+      //ios的ua中无miniProgram,但都有MicroMessenger(表示是微信浏览器)
+      wx.miniProgram.getEnv((res) => {
+        if (res.miniprogram) {
+          wx.miniProgram.postMessage({
+            data: {
+              title: "【好友推薦】一起雲逛店吧~",
+              imageUrl: "https://glp-vr.cdfmembers.com/cdf/file/91dd5305525f463286f03a31abd1c154.jpg",
+              h5Url: shareLink.value,
+            },
+          });
+          //在小程序里
+        }
+      });
+    }
+
+    if (res.miniprogram) {
+      showShare.value = true;
+      wx.miniProgram.postMessage({
+        data: {
+          title: "【好友推薦】一起雲逛店吧~",
+          imageUrl: "https://glp-vr.cdfmembers.com/cdf/file/91dd5305525f463286f03a31abd1c154.jpg",
+          h5Url: shareLink.value,
+        },
+      });
+      console.log("分享url-------------", shareLink.value);
+      //在小程序里
+    }
+
     wxShare({
       title: `【好友推薦】一起雲逛店吧~`,
       desc: "【好友推薦】一起雲逛店吧~",
@@ -552,7 +581,7 @@ const startFollow = (app) => {
       imgUrl: "https://glp-vr.cdfmembers.com/cdf/file/91dd5305525f463286f03a31abd1c154.jpg",
     });
 
-    console.log('分享',shareLink.value);
+    console.log("分享", shareLink.value);
 
     let tmp = "";