瀏覽代碼

style: 样式优化

TIANYONG 1 年之前
父節點
當前提交
549a299197

二進制
src/views/download/images/student-center.png


+ 5 - 2
src/views/download/index.module.less

@@ -15,8 +15,7 @@
 
 .buttonGroup {
   text-align: center;
-  margin-top: 35px;
-  margin-bottom: 35px;
+  margin: 15px 0;
 }
 
 .btn {
@@ -41,4 +40,8 @@
     width: 88%;
     margin: 0 6%;
   }
+}
+
+.downImg {
+  width: 275px;
 }

+ 1 - 1
src/views/download/index.tsx

@@ -61,7 +61,7 @@ export default defineComponent({
     });
     return () => (
       <div class={[styles.downloadContainer]}>
-        <Image src={student} />
+        <Image class={styles.downImg} src={student} />
 
         <div class={styles.buttonGroup}>
           <Button

+ 15 - 9
src/views/student-register/register-new/index.module.less

@@ -75,15 +75,6 @@
     }
   }
 
-  .codeText {
-    color: #FFCF7C;
-    font-size: 14px;
-    font-weight: 600;
-
-    &.codeTextDisabled {
-      color: #ccc;
-    }
-  }
 }
 
 .submitBtn {
@@ -205,4 +196,19 @@
   background: #FFF8EB;
   border-radius: 8px;
   padding: 4px 10px;
+}
+
+.codeText {
+  color: #1189FF;
+  font-size: 14px;
+
+  // &.codeTextDisabled {
+  //   color: #ccc;
+  // }
+}
+.countDown {
+  min-width: 80px;
+  text-align: center;
+  font-size: 14px;
+  color: #A0D0FF;
 }

+ 67 - 12
src/views/student-register/register-new/index.tsx

@@ -107,7 +107,8 @@ export default defineComponent({
         currentClass: '',
         gender: 1,
         registerType: '', // 报名类型
-        giftVipDay: 0 // 赠送会员天数
+        giftVipDay: 0, // 赠送会员天数
+        clientType: 'TEACHER'
       },
       grant_type: 'password',
       loginType: 'SMS',
@@ -129,6 +130,55 @@ export default defineComponent({
       }
       forms.imgCodeStatus = true;
     };
+    const getUserInfos = async () => {
+      if (
+        studentInfo.password.length !== 6 ||
+        !checkPhone(studentInfo.username)
+      ) {
+        return;
+      }
+      try {
+        // 15907120131;
+        const { data } = await request.get(
+          `/edu-app/open/student/studentInfo?mobile=${studentInfo.username}&code=${studentInfo.password}&type=REGISTER`
+        );
+        if (data) {
+          if (!studentInfo.extra.nickname) {
+            studentInfo.extra.nickname = data.nickname;
+          }
+
+          if (!studentInfo.extra.currentGradeNum) {
+            studentInfo.extra.currentGradeNum = data.currentGradeNum;
+          }
+
+          if (!studentInfo.extra.currentClass) {
+            studentInfo.extra.currentClass = data.currentClass;
+          }
+          // if (!studentInfo.extra.gender) {
+          studentInfo.extra.gender =
+            studentInfo.extra.gender !== data.gender
+              ? data.gender
+              : studentInfo.extra.gender;
+
+          // studentInfo.username = data.nickname;
+
+          classList.forEach((i: any) => {
+            if (i.value === data.currentClass) {
+              forms.currentClassText = i.text;
+            }
+          });
+
+          const tempGrade: any = gradeList.value[0] || [];
+          tempGrade?.forEach((i: any) => {
+            if (i.value === data.currentGradeNum) {
+              forms.gradeNumText = i.text;
+            }
+          });
+        }
+      } catch {
+        //
+      }
+    };
 
     const validatePhone = computed(() => {
       return checkPhone(studentInfo.username) ? true : false;
@@ -223,7 +273,7 @@ export default defineComponent({
             forms.showButton = false;
           }
         } else {
-          forms.showTips = true;
+          // forms.showTips = true;
         }
       } catch {}
     };
@@ -249,7 +299,7 @@ export default defineComponent({
         <img class={styles.headBg} src={registerBgIcon} />
         <Form labelAlign="top" class={styles.registerForm}>
         <Field
-            clearable
+            clearable={false}
             label="联系方式"
             placeholder="请输入手机号码"
             type="tel"
@@ -269,14 +319,14 @@ export default defineComponent({
               )
             }}
           </Field> 
-          <div class={['van-hairline--bottom', styles.fieldTipsGroup]}>
+          <div class={[styles.fieldTipsGroup]}>
               <div class={[styles.fieldTips]}>
                 手机号是音乐数字课堂的唯一登录账户
               </div>
           </div>            
           <Field
             center
-            clearable
+            clearable={false}
             label="验证码"
             placeholder="请输入验证码"
             autocomplete="off"
@@ -284,7 +334,10 @@ export default defineComponent({
             v-model={studentInfo.password}
             required
             input-align="right"
-            maxlength={6}>
+            maxlength={6}
+            onUpdate:modelValue={(val: any) => {
+              getUserInfos();
+            }}>
             {{
               button: () =>
                 forms.countDownStatus ? (
@@ -300,15 +353,16 @@ export default defineComponent({
                   <CountDown
                     ref={(el: any) => (countDownRef.value = el)}
                     auto-start={false}
+                    class={styles.countDown}
                     time={forms.countDownTime}
                     onFinish={onFinished}
-                    format="ss秒"
+                    format="ss秒后重试"
                   />
                 )
             }}
           </Field>                 
           <Field
-            clearable
+            clearable={false}
             label="学生姓名"
             placeholder="请输入学生姓名"
             autocomplete="off"
@@ -318,7 +372,7 @@ export default defineComponent({
             input-align="right"
           />
           <Field
-            clearable
+            clearable={false}
             label="学生性别"
             placeholder="请选择性别"
             autocomplete="off"
@@ -363,7 +417,7 @@ export default defineComponent({
             }}
           </Field>
           <Field
-            clearable
+            clearable={false}
             label="所在年级"
             placeholder="请选择年级"
             isLink
@@ -375,7 +429,7 @@ export default defineComponent({
             input-align="right"
           />
           <Field
-            clearable
+            clearable={false}
             label="所在班级"
             placeholder="请选择班级"
             isLink
@@ -387,11 +441,12 @@ export default defineComponent({
             input-align="right"
           />
           {
-            (studentInfo.extra.registerType === 'GIFT_VIP_DAY' && forms.giftVipDay && Number(forms.giftVipDay) > 0) &&
+            (studentInfo.extra.registerType === 'GIFT_VIP_DAY' && forms.giftVipDay && Number(forms.giftVipDay) > 0) ?
             <div class={styles.giftTips}>
               <img src={vipGiftIcon} />
               <span>注册成功即可获得乐器AI学练工具<i>{forms.giftVipDay}</i>天有效期</span>
             </div>
+            : null
           }
 
         </Form>