Bläddra i källkod

Merge branch 'feature-2025-1-10-share' into jenkins-test

TIANYONG 5 månader sedan
förälder
incheckning
33f2de3caf

+ 1 - 0
src/views/questionnaire-statistics-new/detail.tsx

@@ -70,6 +70,7 @@ export default defineComponent({
         const res = await request.post(
           '/edu-app/open/meetingQuestionSetting/schoolStat',
           {
+            hideLoading: false,
             data: {
               schoolAreaId: forms.id
             }

BIN
src/views/questionnaire-statistics-new/images/wx_share_icon.png


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

@@ -237,6 +237,14 @@
     background: #fff;
     border-radius: 10px;
     padding: 0 10px;
+    position: relative;
+    .shareIcon {
+      position: absolute;
+      right: 0;
+      top: 0;
+      width: 54px;
+      height: 29px;
+    }
     .itemTile {
       display: flex;
       align-items: center;

+ 14 - 3
src/views/questionnaire-statistics-new/index.tsx

@@ -1,6 +1,6 @@
 import { defineComponent, onMounted, reactive, ref, nextTick, onUnmounted } from 'vue';
 import styles from './index.module.less';
-import { List, Popup, DatePicker, Popover, Field, Picker, } from 'vant';
+import { List, Popup, DatePicker, Popover, Field, Picker, showToast } from 'vant';
 import request from '@/helpers/request';
 import { useRoute, useRouter } from 'vue-router';
 import OEmpty from '@/components/m-empty';
@@ -14,6 +14,7 @@ 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 wxShareIcon from './images/wx_share_icon.png';
 import { drawCircle } from './drawGraph'
 import useWeChatShare from '@/hooks/useWeChatShare';
 import { browser } from '@/helpers/utils';
@@ -56,6 +57,8 @@ export default defineComponent({
     const showContact = ref(false);
     const list = ref([]);
 
+    let weChatShare: any = null;
+
     const queryArea = async () => {
       try {
         const { data } = await request.get(
@@ -161,6 +164,13 @@ export default defineComponent({
       intervalOne: null as any,
     });
 
+    // 微信分享学校
+    const wxShareItem = (event: MouseEvent, item: any) => {
+      event.stopPropagation(); // 阻止事件冒泡
+      showToast('分享学校链接');
+      weChatShare.getAppSignature()
+    }
+
     const skipDetail = (id: any) => {
       // sessionStorage.setItem('areaIdx', forms.areaIdx)
       sessionStorage.setItem('areaTenantName', forms.totalInfo.tenantName || '')
@@ -200,7 +210,7 @@ export default defineComponent({
 
     const initWxShare = () => {
       const shareTitle = (forms.totalInfo.tenantName||'') + '音乐(器乐)数字化转型问卷统计';
-      const weChatShare = useWeChatShare(
+      weChatShare = useWeChatShare(
         shareTitle,
         '科技赋能音乐(器乐)学习,在每一个孩子心中奏响美妙的乐章。',
         window.location.origin + '/classroom-app/shareImg/questionnaire-statistics-new.png'
@@ -355,10 +365,11 @@ export default defineComponent({
           <div class={styles.scList}>
             {forms.schoolList.map((item: any) => (
               <div class={styles.sItem} onClick={() => skipDetail(item.schoolAreaId)}>
+                <img class={styles.shareIcon} src={wxShareIcon} onClick={(event: MouseEvent) => wxShareItem(event, item)} />
                 <div class={styles.itemTile}>
                   <img src={schoolIcon} />
                   <p>{item.schoolName}</p>
-                  <i></i>
+                  {/* <i></i> */}
                 </div>
                 <div class={[styles.itemDesc]}><span class={styles.sRed}>{formatNumberWithComma(item.totalNum || 0)}</span> 人参与调查</div>
                 <ul class={styles.itemContent}>