Przeglądaj źródła

Merge branch 'feature-2025-1-10' into online

TIANYONG 5 miesięcy temu
rodzic
commit
831eb409da

+ 7 - 2
src/components/m-search/index.tsx

@@ -45,7 +45,7 @@ export default defineComponent({
       default: 'default'
     }
   },
-  emits: ['search', 'focus', 'blur'],
+  emits: ['search', 'focus', 'blur', 'searchUpdate'],
   setup(props, { slots, emit, expose }) {
     const forms = reactive({
       search: props.modelValue || '',
@@ -85,7 +85,12 @@ export default defineComponent({
         }}
         onFocus={() => emit('focus')}
         onBlur={() => emit('blur', forms.search)}
-        onSearch={() => emit('search', forms.search)}>
+        onSearch={() => emit('search', forms.search)}
+        onUpdate:modelValue={(val: any) => {
+          // 输入框内容变化时触发
+          // console.log('搜索内容变化',val)
+          emit('searchUpdate', val);
+        }}>
         {{
           left: () => slots.left && slots.left(),
           'left-icon': () => (

+ 20 - 0
src/views/fill-questionnaire/index.module.less

@@ -5,8 +5,20 @@
   padding-top: 40%;
   overflow: hidden;
   position: relative;
+  :global {
+    .cityPopBox {
+      .van-picker-column__item--selected {
+        color: #333 !important;
+        font-weight: normal;
+      }
+      .van-picker__loading {
+        top: 40%;
+      }
+    }
+  }
 }
 
+
 .formBox {
   background: #FFFFFF;
   border-radius: 16px;
@@ -181,4 +193,12 @@
 }
 .countDown {
   color: rgb(28, 172, 241, 0.6);
+}
+
+.columnsContent {
+  :global {
+    .highLight {
+      color: #1CACF1;
+    }
+  }
 }

+ 23 - 4
src/views/fill-questionnaire/index.tsx

@@ -200,6 +200,7 @@ export default defineComponent({
       id: null as any,
       code: null as any,
       areaPopupIndex: null as any,
+      customSearchText: '' as any,
     })
 
     onMounted(async () => {
@@ -459,7 +460,14 @@ export default defineComponent({
         getSchoolAreaList()
       }
     }
-
+    // 高亮显示匹配的文字
+    const highlightText = (text: string) => {
+      if (!forms.customSearchText) return text;
+      const regex = new RegExp(`(${forms.customSearchText})`, 'gi'); // 创建正则匹配用户输入
+      const customText = text.replace(regex, '<span class="highLight">$1</span>'); // 将匹配部分包裹在 <span> 中
+      // console.log(customText,999)
+      return customText
+    }
     const getSchoolAreaList = async (name?: string) => {
       forms.schoolLoading = true;
       try {
@@ -472,6 +480,7 @@ export default defineComponent({
             regionCode: forms.districtCode
           }
         });
+        forms.customSearchText = name || ''
         forms.schoolAreaList = data;
       } catch {
         //
@@ -659,7 +668,11 @@ export default defineComponent({
             </div>
           </div>
           <div class={styles.formItem}>
-            <p>6. 您是否愿意学生参加数字化转型<span>(注:以学生及家长自愿参加为原则。如愿意参加,家长需自行为学生准备好“器乐数字Ai”应用软件,市面上均有提供,大约300多元一年,学校不涉及任何收费行为。如不参加,学生按原有方式进行器乐课程学习)</span></p>
+            {
+              route.query.meetingType === 'primarySchoolNo' || route.query.meetingType === 'juniorSchoolNo' ? 
+              <p>6. 您是否愿意学生参加数字化转型<span>(注:以学生及家长自愿参加为原则。如愿意参加,家长需自行为学生准备好乐器和“器乐数字Ai”应用软件两项学习工具,市面上均有提供,大约300多元一年。学校不涉及任何收费行为。如不参加,学生按原有方式进行音乐课学习。)</span></p> : 
+              <p>6. 您是否愿意学生参加数字化转型<span>(注:以学生及家长自愿参加为原则。如愿意参加,家长需自行为学生准备好“器乐数字Ai”应用软件,市面上均有提供,大约300多元一年,学校不涉及任何收费行为。如不参加,学生按原有方式进行器乐课程学习。)</span></p>
+            }
             <div class={styles.selectItem}>
               {
                 forms.willingList.map(item =>
@@ -823,7 +836,7 @@ export default defineComponent({
           {forms.schoolPopupShow && (
             <div>
               <Picker
-
+                class="cityPopBox"
                 showToolbar
                 v-model={forms.schoolPopupIndex}
                 columns={forms.schoolAreaList}
@@ -855,9 +868,15 @@ export default defineComponent({
                         onSearch={(val: any) => {
                           getSchoolAreaList(val);
                         }}
+                        onSearchUpdate={(val: any) => {
+                          getSchoolAreaList(val);
+                        }}                        
                       />
                     </div>
-                  )
+                  ),
+                  option: (item: any, index: number) => (
+                    <div class={styles.columnsContent} v-html={highlightText(item.name)} key={index}></div>
+                  ),                  
                 }}
               </Picker>
             </div>

+ 5 - 2
src/views/intention-questionnaire/index.tsx

@@ -36,8 +36,12 @@ import useWeChatShare from '@/hooks/useWeChatShare';
 export default defineComponent({
   name: 'intention-questionnaire',
   setup() {
+    const route = useRoute();
+    const shareTitle = route.query.type === 'primarySchoolNo' ? '(小学)关于开展音乐(器乐)课堂数字化转型的调查问卷' : 
+    route.query.type === 'juniorSchoolNo' ? '(初中)关于开展音乐(器乐)课堂数字化转型的调查问卷' : 
+    '关于开展音乐(器乐)课堂数字化转型的调查问卷'
     const weChatShare = useWeChatShare(
-      '关于开展音乐(器乐)课堂数字化转型的调查问卷',
+      shareTitle,
       '科学的教育改变世界,科技的力量让音乐传播更远,让孩子奏响心中的乐章',
       window.location.origin + '/classroom-app/shareImg/question-share.png'
     );
@@ -46,7 +50,6 @@ export default defineComponent({
     const pageTimer = useInterval(1000, { controls: true });
     pageTimer.pause();
     const router = useRouter();
-    const route = useRoute();
     const forms = reactive({
       loading: true,
       code: null as any,