Pārlūkot izejas kodu

feat: 分享修改

TIANYONG 2 mēneši atpakaļ
vecāks
revīzija
de827a440a

+ 15 - 0
src/views/questionnaire-statistics-new/index.tsx

@@ -15,6 +15,8 @@ import searchIcon from './images/search_icon.png';
 import searchBtn from './images/search_btn.png';
 import totalBoxBg from './images/total_box_icon.png';
 import { drawCircle } from './drawGraph'
+import useWeChatShare from '@/hooks/useWeChatShare';
+import { browser } from '@/helpers/utils';
 
 export default defineComponent({
   name: 'questionnaire-statistics-new',
@@ -167,6 +169,17 @@ export default defineComponent({
       return decimal ? `${integer}.${decimal}` : integer;
     }
 
+    const initWxShare = () => {
+      const shareTitle = (forms.totalInfo.tenantName||'') + '音乐(器乐)数字化转型问卷统计';
+      const weChatShare = useWeChatShare(
+        shareTitle,
+        '科技赋能音乐(器乐)学习,在每一个孩子心中奏响美妙的乐章。',
+        window.location.origin + '/classroom-app/shareImg/question-share.png'
+      );
+      if (browser().weixin) {
+        weChatShare.getAppSignature()
+      }
+    }
 
     onMounted(async () => {
       console.log('刷新页面')
@@ -177,6 +190,8 @@ export default defineComponent({
       forms.sortType = qsFilterParams.sortType || 'DESC'
       await queryArea();
       nextTick(() => {
+        initWxShare()
+
         let percentage = 0;
         const interval = setInterval(() => {
           if (percentage <= forms.totalInfo.supportRate) {

+ 15 - 0
src/views/questionnaire-statistics/index.tsx

@@ -14,6 +14,8 @@ import schoolIcon from './images/school_icon.png';
 import searchIcon from './images/search_icon.png';
 import searchBtn from './images/search_btn.png';
 import totalBoxBg from './images/total_box_icon.png';
+import useWeChatShare from '@/hooks/useWeChatShare';
+import { browser } from '@/helpers/utils';
 
 export default defineComponent({
   name: 'questionnaire-statistics',
@@ -167,6 +169,18 @@ export default defineComponent({
       return decimal ? `${integer}.${decimal}` : integer;
     }
 
+    const initWxShare = () => {
+      const shareTitle = (forms.totalInfo.tenantName||'') + '音乐(器乐)数字化转型问卷统计';
+      const weChatShare = useWeChatShare(
+        shareTitle,
+        '科技赋能音乐(器乐)学习,在每一个孩子心中奏响美妙的乐章。',
+        window.location.origin + '/classroom-app/shareImg/question-share.png'
+      );
+      if (browser().weixin) {
+        weChatShare.getAppSignature()
+      }
+    }
+
     onMounted(async () => {
       console.log('刷新页面')
       forms.areaIdx = sessionStorage.getItem('areaIdx') || 0;
@@ -175,6 +189,7 @@ export default defineComponent({
       forms.sortField = qsFilterParams.sortField || 'totalNum'
       forms.sortType = qsFilterParams.sortType || 'DESC'
       await queryArea();
+      initWxShare();
     });
 
     return () => (