Browse Source

Merge branch 'feature_20250108_分享' into uat(dev)

zhujindu 11 months ago
parent
commit
8fb2d9287e
2 changed files with 17 additions and 4 deletions
  1. 2 2
      src/utils/TXApiFun.js
  2. 15 2
      src/views/home/index.vue

+ 2 - 2
src/utils/TXApiFun.js

@@ -123,8 +123,6 @@ export function getTicketFun(jsApiList = ['getLocation'], configType = 'config')
             signature: qiyeData.signature, // 必填,签名,见附录-JS-SDK使用权限签名算法
             jsApiList: [...jsApiList], //必填,传入需要使用的接口名称
             success: function (res) {
-              console.log('获取签名成功');
-              resolve('获取签名成功');
               wx.onMenuShareAppMessage({
                 title: '企业微信',
                 desc: '让每个企业都有自己的微信',
@@ -138,6 +136,8 @@ export function getTicketFun(jsApiList = ['getLocation'], configType = 'config')
                   // 用户取消分享后回调
                 },
               });
+              console.log('获取签名成功');
+              resolve('获取签名成功');
             },
             fail: function (res) {
               if (res.errMsg.indexOf('function not exist') > -1) {

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

@@ -76,7 +76,7 @@ export default {
     }
   },
   created() {
-    getTicketFun(['onMenuShareAppMessage']).then(() => {
+    getTicketFun(['onMenuShareAppMessage']).then((res) => {
       this.wx.ready(() => {
         this.wx.onMenuShareAppMessage({
           title: '企业微信',
@@ -93,7 +93,20 @@ export default {
         });
       });
     });
-    getTicketFun(['onMenuShareAppMessage'], 'agentConfig').then(() => {});
+    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() {
+          // 用户取消分享后回调
+        },
+      });
+    });
     this.getDict();
   },
   mounted() {},