瀏覽代碼

更新判断

lex 2 年之前
父節點
當前提交
09dad58299

二進制
src/student/member-center/images/icon-question.png


二進制
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>
     )
   }

+ 10 - 3
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)
@@ -70,6 +70,13 @@ export default defineComponent({
     }
     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('请选择班级')
@@ -103,7 +110,7 @@ export default defineComponent({
         return
       }
       try {
-        const res = await request.post(
+        await request.post(
           state.platformApi + `/classGroupUnitExamination/publishUnitExamination`,
           {
             data: {