Browse Source

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

zhujindu 11 months ago
parent
commit
0b8135406c
2 changed files with 16 additions and 1 deletions
  1. 14 1
      src/utils/TXApiFun.js
  2. 2 0
      src/views/home/index.vue

+ 14 - 1
src/utils/TXApiFun.js

@@ -110,7 +110,7 @@ export function getTicketFun(jsApiList = ['getLocation'], configType = 'config')
             timestamp: qiyeData.timestamp, // 必填,生成签名的时间戳
             timestamp: qiyeData.timestamp, // 必填,生成签名的时间戳
             nonceStr: qiyeData.nonceStr, // 必填,生成签名的随机串
             nonceStr: qiyeData.nonceStr, // 必填,生成签名的随机串
             signature: qiyeData.signature, // 必填,签名,见 附录-JS-SDK使用权限签名算法
             signature: qiyeData.signature, // 必填,签名,见 附录-JS-SDK使用权限签名算法
-            jsApiList: ['ready', 'onMenuShareAppMessage', ...jsApiList], // 必填,需要使用的JS接口列表,凡是要调用的接口都需要传进来
+            jsApiList: ['ready', ...jsApiList], // 必填,需要使用的JS接口列表,凡是要调用的接口都需要传进来
           });
           });
           console.log('获取签名成功');
           console.log('获取签名成功');
           resolve('获取签名成功');
           resolve('获取签名成功');
@@ -125,6 +125,19 @@ export function getTicketFun(jsApiList = ['getLocation'], configType = 'config')
             success: function (res) {
             success: function (res) {
               console.log('获取签名成功');
               console.log('获取签名成功');
               resolve('获取签名成功');
               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) {
             fail: function (res) {
               if (res.errMsg.indexOf('function not exist') > -1) {
               if (res.errMsg.indexOf('function not exist') > -1) {

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

@@ -36,6 +36,7 @@ import tabBar from '@/components/tabBar';
 import ABtarget from './ABtarget.vue';
 import ABtarget from './ABtarget.vue';
 import { mapState } from 'vuex';
 import { mapState } from 'vuex';
 import bottomBtn from './bottomBtn.vue';
 import bottomBtn from './bottomBtn.vue';
+import { getTicketFun } from '@/utils/TXApiFun';
 export default {
 export default {
   name: 'home',
   name: 'home',
   components: { tabBar, hintTabPage, ABtarget, bottomBtn },
   components: { tabBar, hintTabPage, ABtarget, bottomBtn },
@@ -75,6 +76,7 @@ export default {
     }
     }
   },
   },
   created() {
   created() {
+    getTicketFun(['onMenuShareAppMessage'], 'agentConfig').then(() => {});
     this.getDict();
     this.getDict();
   },
   },
   mounted() {},
   mounted() {},