Przeglądaj źródła

feat: 分享修改

TIANYONG 5 miesięcy temu
rodzic
commit
4a593c300e

+ 1 - 1
src/views/questionnaire-statistics-new/index.module.less

@@ -201,7 +201,7 @@
     font-size: 12px;
     color: #333333;
     padding: 0 8px;
-    margin-right: 5px;
+    margin-right: 6px;
     box-sizing: content-box;
     >span {
       word-break: keep-all;

+ 11 - 5
src/views/questionnaire-statistics-new/index.tsx

@@ -57,8 +57,6 @@ export default defineComponent({
     const showContact = ref(false);
     const list = ref([]);
 
-    let weChatShare: any = null;
-
     const queryArea = async () => {
       try {
         const { data } = await request.get(
@@ -166,9 +164,17 @@ export default defineComponent({
 
     // 微信分享学校
     const wxShareItem = (event: MouseEvent, item: any) => {
-      event.stopPropagation(); // 阻止事件冒泡
       showToast('分享学校链接');
-      weChatShare.getAppSignature()
+      const shareTitle = '测试';
+      const weChatShare = useWeChatShare(
+        shareTitle,
+        '科技赋能音乐(器乐)学习,在每一个孩子心中奏响美妙的乐章。',
+        window.location.origin + '/classroom-app/shareImg/questionnaire-statistics-new.png'
+      );
+      if (browser().weixin) {
+        weChatShare.getAppSignature()
+      }
+      event.stopPropagation(); // 阻止事件冒泡
     }
 
     const skipDetail = (id: any) => {
@@ -210,7 +216,7 @@ export default defineComponent({
 
     const initWxShare = () => {
       const shareTitle = (forms.totalInfo.tenantName||'') + '音乐(器乐)数字化转型问卷统计';
-      weChatShare = useWeChatShare(
+      const weChatShare = useWeChatShare(
         shareTitle,
         '科技赋能音乐(器乐)学习,在每一个孩子心中奏响美妙的乐章。',
         window.location.origin + '/classroom-app/shareImg/questionnaire-statistics-new.png'