Sfoglia il codice sorgente

Merge branch 'master' into jenkins

lex 2 anni fa
parent
commit
df77534cbe

+ 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

BIN
src/student/member-center/images/icon-question.png


BIN
src/student/member-center/images/member_bg1.png


+ 29 - 0
src/student/member-center/index.module.less

@@ -29,6 +29,12 @@
       }
     }
   }
+  .beforMemberContainer {
+    padding-bottom: 12px !important;
+    .memberImgs {
+      margin-top: 8px;
+    }
+  }
   .level {
     width: 18px;
     height: 16px;
@@ -39,6 +45,29 @@
     width: auto;
     border-radius: 10px;
     padding: 20px 12px 30px;
+
+    &.purchaseMember {
+      background: url('./images/member_bg1.png') no-repeat center #ffce9a;
+      background-size: cover;
+      .userInfo {
+        color: #7a5420;
+      }
+
+      .beforeQuestion {
+        display: flex;
+        align-items: center;
+        font-size: 14px;
+        color: #7a5420;
+        line-height: 20px;
+        .iconQeustion {
+          font-size: 18px;
+          margin-right: 4px;
+        }
+        span {
+          color: #eb8000;
+        }
+      }
+    }
     .userImgSection {
       padding: 2px;
       border: 1px solid #feecd2;

+ 120 - 79
src/student/member-center/index.tsx

@@ -15,6 +15,8 @@ import OHeader from '@/components/o-header'
 import member1 from './images/member-1.png'
 import member2 from './images/member-2.png'
 import member3 from './images/member-3.png'
+import iconQuestion from './images/icon-question.png'
+import ODialog from '@/components/o-dialog'
 
 export const getAssetsHomeFile = (fileName: string) => {
   const path = `./images/${fileName}`
@@ -29,7 +31,8 @@ export default defineComponent({
     return {
       functionList: [] as any,
       selectMember: {} as any,
-      users: {} as any
+      users: {} as any,
+      memberStatus: false
     }
   },
   computed: {
@@ -51,40 +54,40 @@ export default defineComponent({
     try {
       const userInfo = await request.get('/api-student/student/member')
       this.users = userInfo.data || {}
-      this.functionList = [
-        {
-          title: '五线谱<br />跟播',
-          icon: getAssetsHomeFile(`1.png`)
-        },
-        {
-          title: '演奏指法<br />跟播',
-          icon: getAssetsHomeFile(`2.png`)
-        },
-        {
-          title: '原声/伴奏<br />切换',
-          icon: getAssetsHomeFile(`3.png`)
-        },
-        {
-          title: '播放速度<br />调整',
-          icon: getAssetsHomeFile(`4.png`)
-        },
-        {
-          title: '五线谱选段<br />播放',
-          icon: getAssetsHomeFile(`5.png`)
-        },
-        {
-          title: '智能评测',
-          icon: getAssetsHomeFile(`6.png`)
-        },
-        {
-          title: '评测报告',
-          icon: getAssetsHomeFile(`7.png`)
-        },
-        {
-          title: '评测音视频<br />云储存',
-          icon: getAssetsHomeFile(`8.png`)
-        }
-      ]
+      // this.functionList = [
+      //   {
+      //     title: '五线谱<br />跟播',
+      //     icon: getAssetsHomeFile(`1.png`)
+      //   },
+      //   {
+      //     title: '演奏指法<br />跟播',
+      //     icon: getAssetsHomeFile(`2.png`)
+      //   },
+      //   {
+      //     title: '原声/伴奏<br />切换',
+      //     icon: getAssetsHomeFile(`3.png`)
+      //   },
+      //   {
+      //     title: '播放速度<br />调整',
+      //     icon: getAssetsHomeFile(`4.png`)
+      //   },
+      //   {
+      //     title: '五线谱选段<br />播放',
+      //     icon: getAssetsHomeFile(`5.png`)
+      //   },
+      //   {
+      //     title: '智能评测',
+      //     icon: getAssetsHomeFile(`6.png`)
+      //   },
+      //   {
+      //     title: '评测报告',
+      //     icon: getAssetsHomeFile(`7.png`)
+      //   },
+      //   {
+      //     title: '评测音视频<br />云储存',
+      //     icon: getAssetsHomeFile(`8.png`)
+      //   }
+      // ]
 
       const { data } = await request.post(`/api-student/cityFeeSetting/member`)
       this.selectMember = data
@@ -188,7 +191,10 @@ export default defineComponent({
         <OHeader background="#ffe5cc" border={false} />
         <div class={styles.member_container}>
           <Cell
-            class={styles.userMember}
+            class={[
+              styles.userMember,
+              this.users.purchaseMemberRecord ? styles.purchaseMember : ''
+            ]}
             labelClass={styles.timeRemaining}
             center
             v-slots={{
@@ -217,13 +223,26 @@ export default defineComponent({
               ),
               label: () => (
                 <div class={styles.member_time}>
-                  {this.userInfo.isVip ? (
-                    <div>
-                      会员权益有效期剩余
-                      <span class={styles.remaining}>{this.userInfo.membershipDays}</span>天
-                    </div>
+                  {!this.users.purchaseMemberRecord ? (
+                    <>
+                      {this.userInfo.isVip ? (
+                        <div>
+                          会员权益有效期剩余
+                          <span class={styles.remaining}>{this.userInfo.membershipDays}</span>天
+                        </div>
+                      ) : (
+                        <div>亲,您还不是会员哟</div>
+                      )}
+                    </>
                   ) : (
-                    <div>亲,您还不是会员哟</div>
+                    <div class={styles.beforeQuestion}>
+                      <Icon
+                        name={iconQuestion}
+                        class={styles.iconQeustion}
+                        onClick={() => (this.memberStatus = true)}
+                      />
+                      您有<span>待激活</span>团练宝
+                    </div>
                   )}
                 </div>
               )
@@ -231,29 +250,38 @@ export default defineComponent({
           ></Cell>
         </div>
 
-        <div class={styles.memberContainer}>
+        <div
+          class={[
+            styles.memberContainer,
+            this.users.purchaseMemberRecord ? styles.beforMemberContainer : ''
+          ]}
+        >
           <div class={styles.memberItem}>
             <div class={styles.title}>
               会员<span>VIP</span>
             </div>
 
-            <div class={styles['system-list']}>
-              <div class={[styles['system-item'], styles.active]}>
-                <p class={[styles.title, 'van-hairline--bottom']}>
-                  半年会员
-                  <span>(6个月)</span>
-                </p>
-                <div class={styles.priceGroup}>
-                  <p class={styles.price}>
-                    <span>¥</span>
-                    {moneyFormat(this.selectMember.salePrice)}
+            {!this.users.purchaseMemberRecord ? (
+              <div class={styles['system-list']}>
+                <div class={[styles['system-item'], styles.active]}>
+                  <p class={[styles.title, 'van-hairline--bottom']}>
+                    半年会员
+                    <span>(6个月)</span>
                   </p>
-                  <del class={styles.originalPrice}>
-                    ¥{moneyFormat(this.selectMember.originalPrice)}
-                  </del>
+                  <div class={styles.priceGroup}>
+                    <p class={styles.price}>
+                      <span>¥</span>
+                      {moneyFormat(this.selectMember.salePrice)}
+                    </p>
+                    <del class={styles.originalPrice}>
+                      ¥{moneyFormat(this.selectMember.originalPrice)}
+                    </del>
+                  </div>
                 </div>
               </div>
-            </div>
+            ) : (
+              ''
+            )}
           </div>
           <div class={styles.memberImgs}>
             <img src={member1} />
@@ -280,30 +308,43 @@ export default defineComponent({
             </div>
           </div> */}
         </div>
-        <div class={styles.btnGroup}>
-          <div class={styles.priceSection}>
-            支付金额:
-            <div class={styles.price}>
-              <span class={styles.priceUnit}>¥</span>
-              <span class={styles.priceNum}>
-                {moneyFormat(this.calcSalePrice(this.selectMember) || 0)}
-              </span>
-            </div>
-            {this.selectMember?.discount == 1 && (
-              <div class={[styles.discountItem, styles.discountBuy]}>
-                <img src={iconDiscount} />
+        {!this.users.purchaseMemberRecord ? (
+          <div class={styles.btnGroup}>
+            <div class={styles.priceSection}>
+              支付金额:
+              <div class={styles.price}>
+                <span class={styles.priceUnit}>¥</span>
+                <span class={styles.priceNum}>
+                  {moneyFormat(this.calcSalePrice(this.selectMember) || 0)}
+                </span>
               </div>
-            )}
+              {this.selectMember?.discount == 1 && (
+                <div class={[styles.discountItem, styles.discountBuy]}>
+                  <img src={iconDiscount} />
+                </div>
+              )}
+            </div>
+            <Button
+              color="linear-gradient(220deg, #DFA164 0%, #FAC87E 100%)"
+              round
+              class={styles.btn}
+              onClick={this.onSubmit}
+            >
+              {this.userInfo.isVip ? '立即续费' : '立即开通'}
+            </Button>
           </div>
-          <Button
-            color="linear-gradient(220deg, #DFA164 0%, #FAC87E 100%)"
-            round
-            class={styles.btn}
-            onClick={this.onSubmit}
-          >
-            {this.userInfo.isVip ? '立即续费' : '立即开通'}
-          </Button>
-        </div>
+        ) : (
+          ''
+        )}
+        {/*  */}
+
+        <ODialog
+          v-model:show={this.memberStatus}
+          title="待激活团练宝"
+          message="为了避免团练宝会员时长浪费,报名乐团时购买的团练宝会员将在乐团首次训练结束后激活,具体训练时间请咨询乐团管理老师。"
+          messageAlign="left"
+          confirmButtonText="我知道了"
+        />
       </div>
     )
   }

+ 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
           }

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

@@ -20,13 +20,13 @@ import styles from './uni-last.module.less'
 import { useRoute, useRouter } from 'vue-router'
 import NewspaperItem from './modals/newspaper-item'
 import questIcon from '@/school/images/quest-icon.png'
-import { browser } from '@/helpers/utils'
+// import { browser } from '@/helpers/utils'
 export default defineComponent({
   name: 'uni-test',
   setup() {
     const route = useRoute()
     const router = useRouter()
-    const browserInfo = browser()
+    // const browserInfo = browser()
     const activeName = ref('one')
     // const catchList = store
     const forms = ref({} as any)
@@ -36,44 +36,54 @@ 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
+      const query = route.query
+      if (query.classGroupId) {
+        forms.value.classGroupId = query.classGroupId
+      }
+      if (query.testId) {
+        forms.value.testId = query.testId
+      }
+      console.log(forms.value)
       if (!forms.value.classGroupId) {
         showToast('请选择班级')
         return
       }
       getClassDetail()
-      getList()
+      // getList()
       getStudentUni()
     })
     const getStudentUni = async () => {
@@ -100,7 +110,7 @@ export default defineComponent({
         return
       }
       try {
-        const res = await request.post(
+        await request.post(
           state.platformApi + `/classGroupUnitExamination/publishUnitExamination`,
           {
             data: {