zhujindu 11 月之前
父節點
當前提交
e9cc122dde
共有 2 個文件被更改,包括 15 次插入14 次删除
  1. 13 0
      src/utils/TXApiFun.js
  2. 2 14
      src/views/home/index.vue

+ 13 - 0
src/utils/TXApiFun.js

@@ -125,6 +125,19 @@ export function getTicketFun(jsApiList = ['getLocation'], configType = 'config')
             success: function (res) {
               console.log('获取签名成功');
               resolve('获取签名成功');
+              wx.onMenuShareAppMessage({
+                title: '企业微信',
+                desc: '让每个企业都有自己的微信',
+                link: 'https://work.weixin.qq.com/',
+                imgUrl:
+                  'https://res.mail.qq.com/node/ww/wwmng/style/images/index_share_logo$13c64306.png',
+                success() {
+                  // 用户确认分享后回调
+                },
+                cancel() {
+                  // 用户取消分享后回调
+                },
+              });
             },
             fail: function (res) {
               if (res.errMsg.indexOf('function not exist') > -1) {

+ 2 - 14
src/views/home/index.vue

@@ -47,6 +47,7 @@ import tabBar from '@/components/tabBar';
 import ABtarget from './ABtarget.vue';
 import { mapState } from 'vuex';
 import bottomBtn from './bottomBtn.vue';
+import { getTicketFun } from '@/utils/TXApiFun';
 export default {
   name: 'home',
   components: { tabBar, hintTabPage, ABtarget, bottomBtn },
@@ -85,20 +86,7 @@ export default {
     }
   },
   created() {
-    getTicketFun(['onMenuShareAppMessage'], 'agentConfig').then(() => {
-      this.wx.onMenuShareAppMessage({
-        title: '企业微信',
-        desc: '让每个企业都有自己的微信',
-        link: 'https://work.weixin.qq.com/',
-        imgUrl: 'https://res.mail.qq.com/node/ww/wwmng/style/images/index_share_logo$13c64306.png',
-        success() {
-          // 用户确认分享后回调
-        },
-        cancel() {
-          // 用户取消分享后回调
-        },
-      });
-    });
+    getTicketFun(['onMenuShareAppMessage'], 'agentConfig').then(() => {});
     this.getDict();
   },
   methods: {