Ver Fonte

修改

修改
lex há 2 anos atrás
pai
commit
3c666d1b38

+ 11 - 0
public/project/initiation.html

@@ -339,6 +339,7 @@
           checkPhone: true,
           showPopup: false,
           code: '',
+          canSignUp: true,
         }
       },
       async mounted() {
@@ -382,6 +383,12 @@
           var orchestraDetail = await axios.get('/api-student/open/orchestra/detail/' + this.orchestraId)
           if (orchestraDetail.data.code === 200 && orchestraDetail.data.data) {
             this.orchestraName = orchestraDetail.data.data.name || ''
+
+            if (!orchestraDetail.data.data.canSignUp) {
+              vant.showToast('学校已关闭')
+              this.canSignUp = orchestraDetail.data.data.canSignUp
+              return
+            }
           }
         } catch {
           vant.showDialog({
@@ -472,6 +479,10 @@
           }
         },
         async onSubmit() {
+          if (!this.canSignUp) {
+            vant.showToast('学校已关闭')
+            return
+          }
           this.btnLoading = true
           try {
             var stu = this.stu

+ 11 - 1
public/project/preRegister.html

@@ -355,7 +355,8 @@
           btnLoading: false,
           checkPhone: true,
           showPopup: false,
-          code: ''
+          code: '',
+          canSignUp: true
         }
       },
       async mounted() {
@@ -399,6 +400,11 @@
           var orchestraDetail = await axios.get('/api-student/open/orchestra/detail/' + this.orchestraId)
           if (orchestraDetail.data.code === 200) {
             this.orchestraName = orchestraDetail.data.data.name || ''
+            if (!orchestraDetail.data.data.canSignUp) {
+              vant.showToast('学校已关闭')
+              this.canSignUp = orchestraDetail.data.data.canSignUp
+              return
+            }
           }
 
           var subjects = await axios.post('/api-student/open/orchestraSubjectConfig/pageByOrchestraId', {
@@ -527,6 +533,10 @@
           }
         },
         async onSubmit() {
+          if (!this.canSignUp) {
+            vant.showToast('学校已关闭')
+            return
+          }
           this.btnLoading = true
           try {
             var stu = this.stu

+ 1 - 1
src/student/music-group/pre-apply/component/apply.tsx

@@ -165,7 +165,7 @@ export default defineComponent({
           }
         })
         setTimeout(() => {
-          showToast('报名成功')
+          // showToast('报名成功')
           emit('next', 'payment')
         }, 100)
       } catch {

+ 5 - 4
src/views/unit-test/index.tsx

@@ -41,11 +41,12 @@ export default defineComponent({
       selectUnitExam: {} as any
     })
 
-    const getList = async () => {
+    const getList = async (status = false) => {
       try {
         if (form.isClick) return
         form.isClick = true
         const res = await request.post('/api-student/studentUnitExamination/queryPageByStudent', {
+          hideLoading: status,
           data: {
             ...form.params
           }
@@ -70,13 +71,13 @@ export default defineComponent({
       }
     }
 
-    const onSearch = () => {
+    const onSearch = (status = false) => {
       form.params.page = 1
       form.list = []
       form.listState.dataShow = true // 判断是否有数据
       form.listState.loading = false
       form.listState.finished = false
-      getList()
+      getList(status)
     }
 
     // 开始测验
@@ -182,7 +183,7 @@ export default defineComponent({
         {form.listState.dataShow ? (
           <OFullRefresh
             v-model:modelValue={form.listState.refreshing}
-            onRefresh={onSearch}
+            onRefresh={() => onSearch(true)}
             style={{
               minHeight: `calc(100vh - ${form.listState.height}px)`
             }}

+ 9 - 0
src/views/unit-test/model/play-question/index.tsx

@@ -115,6 +115,15 @@ export default defineComponent({
                   answerExtra: ''
                 }
               ])
+
+              // 置空,存的缓存
+              promisefiyPostMessage({
+                api: 'setCache',
+                content: {
+                  key: 'h5-orchestra-unit',
+                  value: ''
+                }
+              })
             }
 
             // 关闭页面监听

+ 1 - 1
src/views/unit-test/practice-mode/index.tsx

@@ -128,7 +128,7 @@ export default defineComponent({
         })
 
         const { data } = await request.post(
-          '/api-school/studentUnitExamination/submitTrainingAnswer',
+          '/api-student/studentUnitExamination/submitTrainingAnswer',
           {
             data: result
           }

+ 24 - 21
src/views/unit-test/unit-create/uni-last.tsx

@@ -36,44 +36,47 @@ export default defineComponent({
       uniDetail: {} as any
     })
     const showTip = ref(false)
-    const getList = async () => {
-      data.loading = true
-      try {
-        const res: any = await request.post(
-          state.platformApi + '/courseSchedule/queryUnitExamination',
-          {
-            requestType: 'form',
-            data: {
-              lessonCoursewareId: route.query.lessonCoursewareId,
-              classGroupId: forms.value.classGroupId
-            }
-          }
-        )
-        //      classGroupId: forms.value.classGroupId
-        data.list = res.data || []
-      } catch (error) {}
+    // const getList = async () => {
+    //   data.loading = true
+    //   try {
+    //     const res: any = await request.post(
+    //       state.platformApi + '/courseSchedule/queryUnitExamination',
+    //       {
+    //         requestType: 'form',
+    //         data: {
+    //           lessonCoursewareId: route.query.lessonCoursewareId,
+    //           classGroupId: forms.value.classGroupId
+    //         }
+    //       }
+    //     )
+    //     //      classGroupId: forms.value.classGroupId
+    //     data.list = res.data || []
+    //   } catch (error) {}
 
-      data.loading = false
-    }
+    //   data.loading = false
+    // }
 
     const getClassDetail = async () => {
       try {
-        const res = await request.get(
+        const { data } = await request.get(
           state.platformApi + `/classGroup/detail/${forms.value.classGroupId}`
         )
-        forms.value.preStudentNum = res.data.preStudentNum
+        forms.value.preStudentNum = data.preStudentNum || 0
+        forms.value.orchestraName = data.orchestraName
+        forms.value.classGroupName = data.name
       } catch (e) {
         console.log(e)
       }
     }
     onMounted(() => {
       forms.value = { ...JSON.parse(sessionStorage.getItem('unit-create') || '{}') } as any
+      console.log(forms.value)
       if (!forms.value.classGroupId) {
         showToast('请选择班级')
         return
       }
       getClassDetail()
-      getList()
+      // getList()
       getStudentUni()
     })
     const getStudentUni = async () => {