瀏覽代碼

Merge branch 'master' of http://192.168.3.207:10080/jianyu/jy-docs

TANGSHIZHE 4 年之前
父節點
當前提交
7c44811633
共有 1 個文件被更改,包括 15 次插入0 次删除
  1. 15 0
      jydocs-mobile/src/utils/globalFunctionsForApp.ts

+ 15 - 0
jydocs-mobile/src/utils/globalFunctionsForApp.ts

@@ -17,3 +17,18 @@ export function hiddenBottomBar (params = 0) {
     }
   }
 }
+
+// 分享封装
+export function shareToOthers (options: any = {}) {
+  if (inWeiXinBrowser) {
+    // 微信分享
+  } else {
+    // app分享
+    try {
+      // options.type--1微信分享,2qq分享,3朋友圈分享
+      JyObj.share(options.type, options.title, options.link)
+    } catch (error) {
+      console.log(error)
+    }
+  }
+}