瀏覽代碼

Merge branch 'iteration-20240723' into jenkins-test

lex 1 年之前
父節點
當前提交
12425c8445
共有 48 個文件被更改,包括 3649 次插入39 次删除
  1. 1 1
      src/helpers/request.ts
  2. 21 0
      src/router/router-root.ts
  3. 14 0
      src/router/routes-common.ts
  4. 二進制
      src/views/activation-code/activation-register/images/banner-bg.png
  5. 218 0
      src/views/activation-code/activation-register/index.module.less
  6. 1412 0
      src/views/activation-code/activation-register/index.tsx
  7. 二進制
      src/views/activation-code/images/icon-arrow-active.png
  8. 二進制
      src/views/activation-code/images/icon-arrow.png
  9. 二進制
      src/views/activation-code/images/icon-book.png
  10. 二進制
      src/views/activation-code/images/icon-icon.png
  11. 二進制
      src/views/activation-code/images/icon-key.png
  12. 二進制
      src/views/activation-code/images/item-bg.png
  13. 二進制
      src/views/activation-code/images/num1.png
  14. 二進制
      src/views/activation-code/images/num2.png
  15. 二進制
      src/views/activation-code/images/num3.png
  16. 二進制
      src/views/activation-code/images/num4.png
  17. 二進制
      src/views/activation-code/images/title2.png
  18. 二進制
      src/views/activation-code/images/woring-bg.png
  19. 二進制
      src/views/activation-code/images/woring-title.png
  20. 355 0
      src/views/activation-code/index.module.less
  21. 200 0
      src/views/activation-code/index.tsx
  22. 250 0
      src/views/activation-code/instrument-registration/detail.module.less
  23. 387 0
      src/views/activation-code/instrument-registration/detail.tsx
  24. 二進制
      src/views/activation-code/instrument-registration/images/banner.png
  25. 二進制
      src/views/activation-code/instrument-registration/images/banner1.png
  26. 二進制
      src/views/activation-code/instrument-registration/images/icon-phone.png
  27. 二進制
      src/views/activation-code/instrument-registration/images/login-error.png
  28. 二進制
      src/views/activation-code/instrument-registration/images/login-success.png
  29. 二進制
      src/views/activation-code/instrument-registration/images/top_bg.png
  30. 105 0
      src/views/activation-code/instrument-registration/index.module.less
  31. 129 0
      src/views/activation-code/instrument-registration/index.tsx
  32. 二進制
      src/views/activation-code/modal/code-dialog/images/brid1.png
  33. 二進制
      src/views/activation-code/modal/code-dialog/images/brid2.png
  34. 二進制
      src/views/activation-code/modal/code-dialog/images/brid3.png
  35. 二進制
      src/views/activation-code/modal/code-dialog/images/brid4.png
  36. 二進制
      src/views/activation-code/modal/code-dialog/images/title1.png
  37. 二進制
      src/views/activation-code/modal/code-dialog/images/title2.png
  38. 二進制
      src/views/activation-code/modal/code-dialog/images/title3.png
  39. 二進制
      src/views/activation-code/modal/code-dialog/images/title4.png
  40. 二進制
      src/views/activation-code/modal/code-dialog/images/title5.png
  41. 84 0
      src/views/activation-code/modal/code-dialog/index.module.less
  42. 103 0
      src/views/activation-code/modal/code-dialog/index.tsx
  43. 202 0
      src/views/activation-code/record.tsx
  44. 10 2
      src/views/school-register/index.module.less
  45. 119 20
      src/views/school-register/index.tsx
  46. 二進制
      src/views/student-register/images/new/icon-dengji.png
  47. 13 1
      src/views/student-register/modal/select-student/index.module.less
  48. 26 15
      src/views/student-register/modal/select-student/index.tsx

+ 1 - 1
src/helpers/request.ts

@@ -85,7 +85,7 @@ request.interceptors.response.use(
     }
     const data = await res.clone().json();
     // 999 为特殊code码
-    const otherCode = [999, 5435, 5436, 5437, 5439];
+    const otherCode = [999, 5435, 5436, 5437, 5439, 5442, 5443, 5408, 5427];
     if (
       data.code !== 200 &&
       data.errCode !== 0 &&

+ 21 - 0
src/router/router-root.ts

@@ -252,6 +252,27 @@ export default [
     }
   },
   {
+    path: '/activationRegistration',
+    component: () => import('@/views/activation-code/instrument-registration'),
+    meta: {
+      title: '乐器登记'
+    }
+  },
+  {
+    path: '/activationRegistrationDetail',
+    component: () => import('@/views/activation-code/instrument-registration/detail'),
+    meta: {
+      title: '乐器登记'
+    }
+  },
+  {
+    path: '/activationRegister',
+    component: () => import('@/views/activation-code/activation-register/index'),
+    meta: {
+      title: '音乐数字课堂激活'
+    }
+  },
+  {
     path: '/:pathMatch(.*)*',
     component: () => import('@/views/404'),
     meta: {

+ 14 - 0
src/router/routes-common.ts

@@ -228,6 +228,20 @@ export default [
         meta: {
           title: '曲谱列表'
         }
+      },
+      {
+        path: '/activationCode',
+        component: () => import('@/views/activation-code'),
+        meta: {
+          title: '互通码'
+        }
+      },
+      {
+        path: '/activationRecord',
+        component: () => import('@/views/activation-code/record'),
+        meta: {
+          title: '激活记录'
+        }
       }
     ]
   },

二進制
src/views/activation-code/activation-register/images/banner-bg.png


+ 218 - 0
src/views/activation-code/activation-register/index.module.less

@@ -0,0 +1,218 @@
+.student-register {
+  min-height: 100vh;
+  // background: #FFF4E2;
+  background: linear-gradient(180deg, #C9EDFD 0%, #CCF0FF 100%);
+  overflow: hidden;
+  position: relative;
+
+  --k-font-primary: #007AFE;
+
+  .studentRegisterContainer {
+    padding-top: 155px;
+    background: url('./images/banner-bg.png') no-repeat top center;
+    background-size: contain;
+  }
+
+
+  :global {
+    .van-picker__loading {
+      top: calc(var(--van-picker-toolbar-height) + 20px + var(--van-search-input-height)) !important;
+    }
+  }
+}
+
+.paymentContainer {
+  font-size: 14px;
+  padding: 12px 25px calc(12px + env(safe-area-inset-bottom)) 25px;
+  background: #FFFFFF;
+  box-shadow: 0px -1px 0px 0px #F2F2F2, inset 0px 1px 3px 0px #FFFFFF;
+  border-radius: 18px 18px 0px 0px;
+
+  :global {
+    .van-button {
+      height: 40px;
+      line-height: 40px;
+      background: linear-gradient(135deg, #31C7FF 0%, #007AFE 100%);
+      font-size: 16px;
+      color: #fff;
+      font-weight: 500;
+      border: 0;
+    }
+  }
+
+}
+
+.studentSection {
+  margin: 0 14px 12px;
+  padding: 0;
+  // background: linear-gradient(180deg, rgba(219, 246, 253) 0%, rgba(255, 255, 255) 3%);
+  background: linear-gradient(180deg, #DBF6FD 0%, #FFFFFF 4%, #FFFFFF 100%);
+  border-radius: 16px;
+  border: 2px solid #FFFFFF;
+
+}
+
+.registerForm {
+  border-radius: 18px;
+  // margin: 0 12px;
+  overflow: hidden;
+
+  .selectStudentGroup {
+    margin-left: 10px;
+    font-size: 14px;
+    color: #1189FF;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+
+    &.selectStudentGroupChecked {
+      span::after {
+        transform: rotate(180deg);
+      }
+    }
+
+    span {
+      display: flex;
+      align-items: center;
+      justify-content: center;
+
+      &::after {
+        display: inline-block;
+        content: '';
+        width: 9px;
+        height: 5px;
+        margin-left: 4px;
+        background: url('../../student-register/images/new/icon-n-6.png') no-repeat center;
+        background-size: contain;
+      }
+    }
+  }
+
+  :global {
+    .van-cell {
+      background-color: transparent;
+    }
+  }
+
+  :global {
+    .van-cell {
+      padding: 14px 18px;
+    }
+
+
+    .van-field__label {
+      font-size: 16px;
+      color: #666666;
+      line-height: 22px;
+      display: flex;
+      align-items: center;
+    }
+
+    .van-field__control {
+      font-size: 16px;
+      color: #131415;
+    }
+  }
+
+  .codeText {
+    color: #1189FF;
+    font-size: 14px;
+
+    // &.codeTextDisabled {
+    //   color: #ccc;
+    // }
+  }
+
+}
+
+.radioSection {
+  position: relative;
+  min-width: 32px;
+  justify-content: center;
+  // padding-left: 19px;
+  // padding-right: 19px;
+  padding: 5px 19px;
+  font-size: 14px;
+  font-weight: 500;
+  border-radius: 6px;
+}
+
+.radioItem {
+  position: absolute;
+  top: 0;
+  left: 0;
+  right: 0;
+  bottom: 0;
+  opacity: 0;
+}
+
+.radioSection+.radioSection {
+  margin-left: 12px;
+}
+
+
+.selectStudentPopup {
+  :global {
+    .van-popup__close-icon {
+      color: #767C7F;
+    }
+  }
+}
+
+
+.studentInfo {
+  :global {
+    .van-cell {
+      padding: 10px 0;
+
+      &:first-child {
+        padding-top: 0;
+      }
+
+      &:last-child {
+        padding-bottom: 0;
+      }
+    }
+
+    .van-cell__title {
+      flex: 1 auto;
+      font-size: 14px;
+      color: #666666;
+      line-height: 20px;
+
+      span {
+        color: #666666 !important;
+      }
+    }
+
+    .van-cell__value {
+      font-size: 14px;
+      color: #131415;
+      flex: 1 auto;
+      line-height: 20px;
+
+      span {
+        color: #131415 !important;
+      }
+    }
+  }
+
+
+}
+
+.studentBtnGroup {
+  display: flex;
+  align-items: center;
+  padding-top: 20px;
+  padding-bottom: 5px;
+
+  :global {
+    .van-button {
+      flex: 1;
+
+      &+.van-button {
+        margin-left: 15px;
+      }
+    }
+  }
+}

+ 1412 - 0
src/views/activation-code/activation-register/index.tsx

@@ -0,0 +1,1412 @@
+import {
+  Image,
+  Cell,
+  Tag,
+  Button,
+  Popup,
+  showToast,
+  Form,
+  Field,
+  CountDown,
+  RadioGroup,
+  Radio,
+  Picker,
+  closeToast,
+  Popover,
+  Area,
+  CellGroup,
+  showConfirmDialog
+} from 'vant';
+import {
+  computed,
+  defineComponent,
+  nextTick,
+  onMounted,
+  onUnmounted,
+  reactive,
+  ref
+} from 'vue';
+import qs from 'query-string';
+import {
+  state as baseState,
+  goWechatAuth,
+  setLogin,
+  setLoginInit
+} from '@/state';
+import styles from './index.module.less';
+import MSticky from '@/components/m-sticky';
+// import MVideo from '@/components/m-video';
+import { useRoute, useRouter } from 'vue-router';
+import { useStudentRegisterStore } from '@/store/modules/student-register-store';
+import request from '@/helpers/request';
+import { browser, checkPhone, getUrlCode, moneyFormat } from '@/helpers/utils';
+import deepClone from '@/helpers/deep-clone';
+import OWxTip from '@/components/m-wx-tip';
+import MDialog from '@/components/m-dialog';
+// import f1 from './images/new/f-1.png';
+// import f2 from './images/new/f-2.png';
+// import f3 from './images/new/f-3.png';
+// import iconTip2 from './images/new/icon-tip2.png';
+// import functionBg from './images/new/function-bg.png';
+// import tuangou from './images/new/tuangou.png';
+// import icon3 from './images/new/icon-3.png';
+// import icon5 from './images/new/icon-5.png';
+// import icon10 from './images/new/icon-10.png';
+// import icon6 from './images/new/icon-6.png';
+// import giftTip from './images/new/icon-9.png';
+// import iconGift from './images/new/icon-gift.png';
+// import vipGiftTIps from './images/new/vip_gift_tips.png';
+import dayjs from 'dayjs';
+// import MMessageTip from '@/components/m-message-tip';
+import { CurrentTime, useCountDown } from '@vant/use';
+
+import MImgCode from '@/components/m-img-code';
+import { useInterval, useIntervalFn } from '@vueuse/core';
+import MMessageTip from '@/components/m-message-tip';
+import SelectStudent from '@/views/student-register/modal/select-student';
+import { api_sysAreaQueryAllProvince } from '@/views/school-register/api';
+import CodeDialog from '../modal/code-dialog';
+import MSearch from '@/components/m-search';
+
+const classList: any = [];
+for (let i = 1; i <= 40; i++) {
+  classList.push({ text: i + '班', value: i });
+}
+
+const GRADE_ENUM = {
+  '1': '一年级',
+  '2': '二年级',
+  '3': '三年级',
+  '4': '四年级',
+  '5': '五年级',
+  '6': '六年级',
+  '7': '七年级',
+  '8': '八年级',
+  '9': '九年级'
+} as any;
+const getGradeList = (gradeYear?: string, instrumentCode?: string) => {
+  let tempList: any = [];
+  const five = [
+    { text: '一年级', value: 1, instrumentCode },
+    { text: '二年级', value: 2, instrumentCode },
+    { text: '三年级', value: 3, instrumentCode },
+    { text: '四年级', value: 4, instrumentCode },
+    { text: '五年级', value: 5, instrumentCode }
+  ];
+  const one = [{ text: '六年级', value: 6, instrumentCode }];
+  const three = [
+    { text: '七年级', value: 7, instrumentCode },
+    { text: '八年级', value: 8, instrumentCode },
+    { text: '九年级', value: 9, instrumentCode }
+  ];
+  if (gradeYear === 'FIVE_YEAR_SYSTEM') {
+    tempList.push(...[...five]);
+  } else if (gradeYear === 'SIX_YEAR_SYSTEM') {
+    tempList.push(...[...five, ...one]);
+  } else if (gradeYear === 'THREE_YEAR_SYSTEM') {
+    tempList.push(...[...three]);
+  } else if (gradeYear === 'FORE_YEAR_SYSTEM') {
+    tempList.push(...[...one, ...three]);
+  } else {
+    tempList.push(...[...five, ...one, ...three]);
+  }
+  return tempList;
+};
+
+export default defineComponent({
+  name: 'activation-register',
+  setup() {
+    const route = useRoute();
+    const studentRegisterStore = useStudentRegisterStore();
+    const router = useRouter();
+    // 初始化学校编号
+    // studentRegisterStore.setShoolId(route.query.sId as any);
+    const countDownRef = ref();
+    const forms = reactive({
+      schoolId: null as any,
+      schoolAreaId: null, // 学校区域编号
+      activationCode: null as any, // 互通码
+      paymentType: '', // 支付类型
+      paymentChannel: '',
+      multi_user_limit: 1, // 限制注册学生数量
+      // popupShow: false,
+      registerDetails: {} as any,
+      details: [] as any[],
+      // schoolType: '', // 学校类型
+      gradeYear: '', // 学制
+      schoolInstrumentSetType: null as any,
+      // bugGoods: false, // 是否购买AI
+
+      isRegister: 'create' as 'create' | 'update' | '', // 是否注册学生
+      isDisabled: false,
+      isTipRegister: false, // 是否显示名字不一致 - 默认显示
+      isChangeSchool: false, // 是否切换学校
+
+      schoolStatus: false,
+      schoolPopupShow: false,
+      schoolLoading: false,
+      schoolPopupIndex: [] as any,
+      schoolAreaList: [] as any,
+      provinceCode: null,
+      cityCode: null,
+      regionCode: null,
+
+      showResultPopup: false,
+      reslutPopupType: '' as any,
+      resultPopupContent: '',
+      registerType: '', // 报名类型
+      detailVip: {} as any,
+      giftVipDay: 0, // 赠送天数
+      submitLoading: false,
+      // showMore: true,
+      showTips: false,
+      showButton: false,
+      showMessage: '请使用微信扫描二维码',
+      countDownStatus: true,
+      countDownTime: 1000 * 120, // 倒计时时间
+      // modelValue: false, // 是否选中协议
+      imgCodeStatus: false,
+      gradeNumText: '',
+      currentClassText: '',
+
+      schoolName: '',
+      areaName: '',
+
+      gradeStatus: false,
+      classStatus: false,
+      loading: false,
+
+      showConfirmPopup: false, // 二次确认用户信息
+      showPicker: false,
+      areaList: [] as any,
+      tipStatus: true,
+      dialogConfirmStatus: false,
+      contract_sign: false, // 是否实名认证
+      countDownTimePay: 60 * 1000,
+      dialogConfig: {} as any,
+      showSelectStudent: false, // 选择学生
+      studentList: [], // 手机号关联学生列表
+      studentItem: {} as any, // 选择的学生
+      joinType: 'digitalize' as 'digitalize' | 'tradition',
+      gradeList: [] as any,
+      classList: [] as any,
+      saveUserId: null as any,
+      saveId: null as any,
+      openId: null as any,
+      code: null as any,
+      registerExpireTime: null as any, // 结束时间
+      instrumentCode: null as any, // 乐器编码
+      activeOverTime: 0, // 活动结束时间
+      activeOverStatus: true, // 活动是否结束 默认已结束
+      gradePopupShow: false,
+      gradePopupIndex: [] as any, // 年级下拉索引
+      classPopupShow: false,
+      classPopupIndex: [] as any // 班级下拉索引
+    });
+
+    const otherParams = reactive({
+      showOtherSchool: false,
+      showCloseButton: true, // 是否显示关闭按钮
+      showOtherMessage: '',
+      /**  limit 超限制,change 更换学生,nickname 名称不一致 member 会员购买, payment 支付方式 */
+      otherType: '' as 'limit' | 'change' | 'nickname' | 'member' | 'payment',
+      showCancelButton: true,
+      cancelButtonColor: '',
+      cancelButtonText: '取消',
+      showConfirmButton: true,
+      confirmButtonColor: '',
+      confirmButtonText: '确定',
+      messageAlign: 'left' as 'center' | 'left' | 'right'
+    });
+
+    const state = reactive({
+      showQrcode: false,
+      qrCodeUrl: '',
+      pay_channel: '',
+      orderInfo: {} as any, // 订单信息
+      authShow: false,
+      orderNo: null as any,
+      config: {} as any,
+      paymentStatus: false,
+      orderTimer: null as any
+    });
+
+    /*
+      新用户:
+      autoRegister: true
+      loginType: 'SMS'
+
+      已存在用户:
+      autoRegister: false
+      loginType: 'TOKEN'
+      password: xxx
+    */
+
+    const studentInfo = reactive({
+      autoRegister: true,
+      multiUser: true, // 是否为多用户
+      client_id: 'cooleshow-student',
+      client_secret: 'cooleshow-student',
+      extra: {
+        nickname: '',
+        currentGradeNum: '' as any,
+        currentClass: '' as any,
+        gender: 1 as any,
+        registerType: null as any, // 报名类型
+        giftVipDay: 0 // 赠送会员天数
+      },
+      grant_type: 'password',
+      loginType: 'SMS',
+      password: '',
+      username: ''
+    });
+    // 页面定时
+    const pageTimer = useInterval(1000, { controls: true });
+    pageTimer.pause();
+
+    const overCountDown = useCountDown({
+      time: forms.activeOverTime,
+      onFinish() {
+        forms.activeOverStatus = true;
+        if (forms.submitLoading) return;
+        applyOver();
+      }
+    });
+    /** 报名结束提示 */
+    const applyOver = () => {
+      forms.showTips = true;
+      // forms.showMessage = '团购时间已截止,感谢您的参与';
+      forms.showMessage =
+        '<p style="color: #F44541">报名已截止,感谢您的参与</p>';
+      forms.showButton = false;
+    };
+
+    const onCodeSend = () => {
+      forms.countDownStatus = false;
+      nextTick(() => {
+        countDownRef.value.start();
+      });
+    };
+
+    const onSendCode = () => {
+      // 发送验证码
+      if (!checkPhone(studentInfo.username)) {
+        return showToast('请输入正确的手机号码');
+      }
+      forms.imgCodeStatus = true;
+    };
+
+    const validatePhone = computed(() => {
+      return checkPhone(studentInfo.username) ? true : false;
+    });
+
+    const onFinished = () => {
+      forms.countDownStatus = true;
+      countDownRef.value.reset();
+    };
+
+    // 格式化提示状态
+    const changeTipStatus = (register: boolean, school: boolean) => {
+      forms.isTipRegister = register;
+      forms.isChangeSchool = school;
+    };
+
+    const checkForm = (status = true) => {
+      if (!checkPhone(studentInfo.username)) {
+        status && showToast('请输入正确的手机号码');
+        return true;
+      } else if (!studentInfo.password) {
+        status && showToast('请输入验证码');
+        return true;
+      } else if (!studentInfo.extra.nickname) {
+        status && showToast('请输入学生姓名');
+        return true;
+      } else if (![0, 1].includes(studentInfo.extra.gender)) {
+        status && showToast('请选择性别');
+        return true;
+      } else if (!studentInfo.extra.currentGradeNum) {
+        status && showToast('请选择所在年级');
+        return true;
+      } else if (!studentInfo.extra.currentClass) {
+        status && showToast('请选择所在班级');
+        return true;
+      } else if (!forms.activationCode) {
+        status && showToast('请输入互通码');
+        return true;
+      }
+      return false;
+    };
+
+    //
+    const checkSubmit = () => {
+      const { extra } = studentInfo;
+      if (
+        forms.studentItem.nickname !== extra.nickname &&
+        forms.isTipRegister
+      ) {
+        otherParams.showOtherMessage =
+          '学生姓名与上次提交信息不一致,请确认修改学生信息或创建新的学生账号';
+        otherParams.showOtherSchool = true;
+        otherParams.showCancelButton = true;
+        otherParams.showCloseButton = true;
+        otherParams.cancelButtonColor =
+          'linear-gradient( 224deg, #3FE1E6 0%, #00CDD4 100%)';
+        otherParams.cancelButtonText = '新建学生';
+        otherParams.confirmButtonColor =
+          'linear-gradient( 305deg, #40C8FF 0%, #3192FF 100%)';
+        otherParams.confirmButtonText = '修改信息';
+        otherParams.otherType = 'nickname';
+        otherParams.messageAlign = 'left';
+        return true;
+      }
+
+      // 判断新建学员是否上限了
+      if (
+        forms.isRegister === 'create' &&
+        forms.studentList.length >= forms.multi_user_limit
+      ) {
+        otherParams.showOtherMessage = `同一手机号最多创建${forms.multi_user_limit}个学生`;
+        otherParams.showOtherSchool = true;
+        otherParams.showCancelButton = false;
+        otherParams.showCloseButton = true;
+        otherParams.confirmButtonColor =
+          'linear-gradient( 305deg, #40C8FF 0%, #3192FF 100%)';
+        otherParams.confirmButtonText = '我知道了';
+        otherParams.otherType = 'limit';
+        otherParams.messageAlign = 'center';
+        return true;
+      }
+
+      return false;
+    };
+
+    /**
+     * 登记成功之后购买
+     */
+    const onSubmit = async () => {
+      forms.submitLoading = true;
+      try {
+        if (checkForm() || checkSubmit()) {
+          forms.submitLoading = false;
+          return;
+        }
+        const { extra, loginType, autoRegister, password, multiUser, ...res } =
+          studentInfo;
+        /*
+          新用户:
+          autoRegister: true
+          loginType: 'SMS'
+
+          已存在用户:
+          autoRegister: false
+          loginType: 'TOKEN'
+          password: xxx
+        */
+        let tLoginType = loginType,
+          tAutoRegister = autoRegister,
+          tPassword = password,
+          tMultiUser = multiUser;
+        if (forms.isRegister === 'update') {
+          tLoginType = 'TOKEN';
+          tAutoRegister = false;
+          tPassword = forms.studentItem.token;
+          tMultiUser = false;
+        }
+        const result = await request.post('/edu-app/userlogin', {
+          requestType: 'form',
+          data: {
+            loginType: tLoginType,
+            autoRegister: tAutoRegister,
+            password: tPassword,
+            multiUser: tMultiUser,
+            ...res,
+            extra: JSON.stringify({
+              ...extra,
+              // giftVipDay:
+              //   forms.detailVip.membershipDays || 0 + forms.giftVipDay || 0,
+              schoolId: forms.schoolId
+            })
+          }
+        });
+
+        if (result.code !== 200) {
+          if (result.code === 5436) {
+            forms.showTips = true;
+            forms.showMessage = '二维码已经失效,详情请咨询学校老师';
+            forms.showButton = false;
+          } else if (result.code === 5435) {
+            forms.showTips = true;
+            forms.showMessage = result.message;
+            forms.showButton = true;
+          }
+          // else if (result.code === 5437) {
+          //   forms.showTips = true;
+          //   forms.showMessage =
+          //     '<p style="color: #F44541">报名已截止,感谢您的参与</p>'; //result.message;
+          //   forms.showButton = false;
+          // }
+        } else {
+          studentRegisterStore.setToken(
+            result.data.token_type + ' ' + result.data.access_token
+          );
+          setLoginInit();
+
+          // let joinType = 'NOT_REGISTER';
+          // if (forms.joinType === 'digitalize') {
+          //   joinType = 'SELECT_INSTRUMENT';
+          // }
+          // if (forms.joinType === 'tradition') {
+          //   joinType = 'NOT_BUY_INSTRUMENT';
+          // }
+
+          // 获取用户信息
+          const res = await request.get('/edu-app/user/getUserInfo', {
+            requestType: 'form'
+          });
+          setLogin(res.data);
+
+          // await onRegisterSubmit();
+
+          await updateStudentInfo();
+        }
+      } catch {
+        // 重置信息 - 如果是新建则不提示
+        changeTipStatus(forms.isRegister === 'create' ? false : true, false);
+      } finally {
+        forms.submitLoading = false;
+      }
+    };
+
+    const updateStudentInfo = async () => {
+      try {
+        const { extra, username } = studentInfo;
+        const registerResult = await request.post('/edu-app/student/register', {
+          data: {
+            clientType: 'STUDENT',
+            ...extra,
+            activationCode: forms.activationCode,
+            schoolId: forms.schoolId,
+            schoolAreaId: forms.schoolAreaId,
+            // giftVipFlag: forms.registerDetails.giftVipFlag || false,
+            // giftVipDay: forms.giftVipDay || 0,
+            schoolVerify: false,
+            // firstVipDay: forms.detailVip.membershipDays || 0,
+            mobile: username,
+            newRegUser: forms.isRegister === 'create' ? true : false
+          }
+        });
+
+        if (registerResult.code !== 200) {
+          if (registerResult.code === 5436) {
+            forms.showTips = true;
+            forms.showMessage = '二维码已经失效,详情请咨询学校老师';
+            forms.showButton = false;
+          } else if (registerResult.code === 5435) {
+            forms.showTips = true;
+            forms.showMessage = registerResult.message;
+            forms.showButton = true;
+          } else if (registerResult.code === 5437) {
+            forms.showTips = true;
+            forms.showMessage =
+              '<p style="color: #F44541">报名已截止,感谢您的参与</p>'; //result.message;
+            forms.showButton = false;
+          } else if (registerResult.code === 5442) {
+            forms.showResultPopup = true;
+            forms.reslutPopupType = 'EXPIRED';
+            forms.resultPopupContent = registerResult.message;
+          } else if (registerResult.code === 5443) {
+            forms.showResultPopup = true;
+            forms.reslutPopupType = 'CANCELLED';
+            forms.resultPopupContent = registerResult.message;
+          }
+          return false;
+        } else {
+          forms.showResultPopup = true;
+          forms.reslutPopupType = 'ACTIVATING';
+          return true;
+        }
+      } catch {}
+    };
+
+    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`
+        );
+        forms.studentList = data || [];
+
+        if (forms.studentList.length > 0) {
+          const firstStudent: any = forms.studentList[0];
+          forms.studentItem = firstStudent;
+          studentInfo.extra.nickname = firstStudent.nickname;
+
+          const tempArea = [] as any;
+          if (firstStudent.provinceName) {
+            tempArea.push(firstStudent.provinceName);
+            forms.provinceCode = firstStudent.provinceCode;
+          }
+          if (firstStudent.cityName) {
+            tempArea.push(firstStudent.cityName);
+            forms.cityCode = firstStudent.cityCode;
+          }
+          if (firstStudent.regionName) {
+            tempArea.push(firstStudent.regionName);
+            forms.regionCode = firstStudent.regionCode;
+          }
+          forms.areaName = tempArea.join(' ');
+          forms.schoolName = firstStudent.schoolName;
+          forms.schoolId = firstStudent.schoolId;
+          forms.schoolAreaId = firstStudent.schoolAreaId;
+
+          const tempGrade: any = forms.gradeList || [];
+          tempGrade?.forEach((i: any) => {
+            if (i.value === firstStudent.currentGradeNum) {
+              forms.instrumentCode = i.instrumentCode;
+              forms.gradeNumText = i.text;
+              studentInfo.extra.currentGradeNum = firstStudent.currentGradeNum;
+              if (forms.schoolInstrumentSetType === 'CLASS') {
+                forms.classList = i.classList;
+              }
+            }
+          });
+          forms.classList.forEach((i: any) => {
+            if (i.value === firstStudent.currentClass) {
+              forms.currentClassText = i.text;
+              studentInfo.extra.currentClass = firstStudent.currentClass;
+            }
+          });
+          studentInfo.extra.gender = firstStudent.gender;
+
+          forms.isRegister = 'update';
+          changeTipStatus(true, false);
+        } else {
+          forms.isRegister = 'create';
+          changeTipStatus(false, false);
+          forms.studentItem = [];
+        }
+      } catch {
+        //
+      }
+    };
+
+    /** 手机号变更时清空验证码信息,用户信息 */
+    const phoneChangeEmptyInfo = () => {
+      studentInfo.password = '';
+      studentInfo.extra.nickname = '';
+      studentInfo.extra.currentGradeNum = '';
+      studentInfo.extra.currentClass = '';
+      studentInfo.extra.gender = 1;
+      forms.areaName = '';
+      forms.schoolName = '';
+      forms.currentClassText = '';
+      forms.gradeNumText = '';
+      forms.studentList = []; // 手机号关联学生列表
+      forms.studentItem = {}; // 选择的学生
+      forms.isRegister = 'create'; // 是否注册学生
+      forms.isTipRegister = false; // 是否显示名字不一致 - 默认显示
+      forms.isChangeSchool = false; // 是否切换学校
+    };
+
+    const formateArea = (area: any[]) => {
+      const province_list: { [_: string]: string } = {};
+      const city_list: { [_: string]: string } = {};
+      const county_list: { [_: string]: string } = {};
+      area.forEach((item: any) => {
+        province_list[item.code] = item.name;
+      });
+      area.forEach((item: any) => {
+        item.areas?.forEach((city: any) => {
+          city_list[city.code] = city.name;
+        });
+      });
+      area.forEach((item: any) => {
+        item.areas?.forEach((city: any) => {
+          city.areas?.forEach((county: any) => {
+            county_list[county.code] = county.name;
+          });
+        });
+      });
+      return {
+        province_list,
+        city_list,
+        county_list
+      };
+    };
+    const getAreaList = () => {
+      api_sysAreaQueryAllProvince().then(res => {
+        if (res?.code === 200) {
+          forms.areaList = formateArea(res.data);
+        }
+      });
+    };
+
+    const getSchoolAreaList = async (name?: string) => {
+      forms.schoolLoading = true;
+      try {
+        const { data } = await request.post('/edu-app/open/schoolArea/list', {
+          data: {
+            name,
+            testFlag: true,
+            provinceCode: forms.provinceCode,
+            cityCode: forms.cityCode,
+            regionCode: forms.regionCode
+          }
+        });
+        forms.schoolAreaList = data;
+      } catch {
+        //
+      }
+      forms.schoolLoading = false;
+    };
+
+    // 格式化互通码
+    const maskMiddleDigits = (str: string) => {
+      if (!str) {
+        return '';
+      }
+      let numPart = str.match(/\d+/); // 提取数字部分
+      if (numPart) {
+        let start = str.indexOf(numPart[0]); // 数字部分的起始索引
+        let end = start + numPart[0].length; // 数字部分的结束索引
+        let maskedStr =
+          str.substring(0, start) +
+          '*'.repeat(numPart[0].length) +
+          str.substring(end);
+        return maskedStr;
+      }
+      return str;
+    };
+
+    onMounted(async () => {
+      try {
+        const code: any = route.query.code;
+        if (code) {
+          forms.activationCode = window.atob(code);
+        }
+      } catch {
+        //
+      }
+
+      getAreaList();
+      try {
+        // 获取支付类型
+        const { data } = await request.get(
+          '/edu-app/open/paramConfig/queryByParamNameList',
+          {
+            requestType: 'form',
+            params: {
+              paramNames: 'multi_user_limit'
+            }
+          }
+        );
+        if (data && Array.isArray(data)) {
+          data.forEach((item: any) => {
+            if (item.paramName === 'multi_user_limit') {
+              forms.multi_user_limit = item.paramValue
+                ? Number(item.paramValue)
+                : 1;
+            }
+          });
+        }
+      } catch {}
+
+      forms.gradeList = getGradeList();
+      forms.classList = classList;
+    });
+    return () => (
+      <div class={styles['student-register']}>
+        <div class={styles.studentRegisterContainer}>
+          <div class={[styles.studentSection]}>
+            <Form labelAlign="left" class={styles.registerForm}>
+              <Field
+                clearable={false}
+                label="联系方式"
+                placeholder="请输入手机号码"
+                type="tel"
+                required
+                autocomplete="off"
+                inputAlign="right"
+                v-model={studentInfo.username}
+                maxlength={11}
+                onUpdate:modelValue={() => {
+                  phoneChangeEmptyInfo();
+                }}></Field>
+
+              <Field
+                center
+                clearable={false}
+                required
+                inputAlign="right"
+                label="验证码"
+                placeholder="请输入验证码"
+                autocomplete="off"
+                type="number"
+                v-model={studentInfo.password}
+                maxlength={6}
+                onUpdate:modelValue={(val: any) => {
+                  getUserInfos();
+                }}>
+                {{
+                  button: () =>
+                    forms.countDownStatus ? (
+                      <span
+                        class={[
+                          styles.codeText,
+                          !validatePhone.value ? styles.codeTextDisabled : ''
+                        ]}
+                        onClick={onSendCode}>
+                        获取验证码
+                      </span>
+                    ) : (
+                      <CountDown
+                        ref={(el: any) => (countDownRef.value = el)}
+                        auto-start={false}
+                        class={styles.countDown}
+                        time={forms.countDownTime}
+                        onFinish={onFinished}
+                        format="ss秒后重试"
+                      />
+                    )
+                }}
+              </Field>
+
+              <Field
+                clearable={false}
+                required
+                inputAlign="right"
+                label="学生姓名"
+                placeholder="请输入学生姓名"
+                autocomplete="off"
+                maxlength={14}
+                v-model={studentInfo.extra.nickname}>
+                {{
+                  extra: () =>
+                    forms.studentList.length > 1 && (
+                      <div
+                        class={[
+                          styles.selectStudentGroup,
+                          forms.showSelectStudent &&
+                            styles.selectStudentGroupChecked
+                        ]}
+                        onClick={() => (forms.showSelectStudent = true)}>
+                        <span>
+                          {forms.studentItem.userId ? '切换' : '新增'}
+                        </span>
+                      </div>
+                    )
+                }}
+              </Field>
+              <Field
+                clearable={false}
+                required
+                inputAlign="right"
+                label="学生性别"
+                placeholder="请选择性别"
+                autocomplete="off">
+                {{
+                  input: () => (
+                    <RadioGroup
+                      checked-color="linear-gradient( 135deg, #31C7FF 0%, #007AFE 100%)"
+                      v-model={studentInfo.extra.gender}
+                      direction="horizontal">
+                      <Tag
+                        size="large"
+                        type="primary"
+                        color={
+                          !(studentInfo.extra.gender === 1)
+                            ? '#F5F6FA'
+                            : 'linear-gradient( 135deg, #31C7FF 0%, #007AFE 100%)'
+                        }
+                        textColor={
+                          !(studentInfo.extra.gender === 1) ? '#626264' : '#fff'
+                        }
+                        class={styles.radioSection}>
+                        <Radio class={styles.radioItem} name={1}></Radio>男
+                      </Tag>
+                      <Tag
+                        size="large"
+                        type="primary"
+                        color={
+                          !(studentInfo.extra.gender === 0)
+                            ? '#F5F6FA'
+                            : 'linear-gradient( 135deg, #31C7FF 0%, #007AFE 100%)'
+                        }
+                        textColor={
+                          !(studentInfo.extra.gender === 0) ? '#626264' : '#fff'
+                        }
+                        class={styles.radioSection}>
+                        <Radio class={styles.radioItem} name={0}></Radio>女
+                      </Tag>
+                    </RadioGroup>
+                  )
+                }}
+              </Field>
+
+              <Field
+                clearable={false}
+                required
+                inputAlign="right"
+                label="所在地区"
+                placeholder="请选择地区"
+                isLink={forms.isRegister !== 'update'}
+                readonly
+                clickable={false}
+                modelValue={forms.areaName}
+                onClick={() => {
+                  if (forms.isRegister !== 'update') forms.showPicker = true;
+                  // forms.gradePopupIndex = [studentInfo.extra.currentGradeNum];
+                }}
+              />
+
+              <Field
+                clearable={false}
+                required
+                inputAlign="right"
+                label="互通学校"
+                placeholder="请选择学校"
+                isLink={forms.isRegister !== 'update'}
+                readonly
+                clickable={false}
+                modelValue={forms.schoolName}
+                onClick={() => {
+                  if (forms.isRegister === 'update') return;
+
+                  if (!forms.areaName) {
+                    showToast('请选择地区');
+                    return;
+                  }
+
+                  forms.schoolStatus = true;
+                  if (forms.schoolAreaId) {
+                    forms.schoolPopupIndex = [forms.schoolAreaId];
+                  }
+                  // forms.gradeStatus = true;
+                  // forms.gradePopupIndex = [studentInfo.extra.currentGradeNum];
+                }}
+              />
+
+              <Field
+                clearable={false}
+                required
+                inputAlign="right"
+                label="所在年级"
+                placeholder="请选择年级"
+                isLink={forms.isRegister !== 'update'}
+                readonly
+                clickable={false}
+                modelValue={forms.gradeNumText}
+                onClick={() => {
+                  if (forms.isRegister !== 'update') {
+                    forms.gradePopupIndex = [studentInfo.extra.currentGradeNum];
+                    forms.gradeStatus = true;
+                  }
+                }}
+              />
+              <Field
+                clearable={false}
+                required
+                inputAlign="right"
+                label="所在班级"
+                placeholder="请选择班级"
+                isLink={forms.isRegister !== 'update'}
+                readonly
+                clickable={false}
+                modelValue={forms.currentClassText}
+                onClick={() => {
+                  if (forms.isRegister == 'update') {
+                    return;
+                  }
+                  if (
+                    forms.schoolInstrumentSetType === 'CLASS' &&
+                    forms.classList.length <= 0
+                  ) {
+                    showToast('请先选择年级');
+                    return;
+                  }
+                  forms.classPopupIndex = [studentInfo.extra.currentClass];
+                  forms.classStatus = true;
+                }}
+              />
+
+              {/* maskMiddleDigits */}
+              {route.query.code ? (
+                <Field
+                  clearable={false}
+                  required
+                  inputAlign="right"
+                  label="互通码"
+                  readonly={route.query.code ? true : false}
+                  modelValue={maskMiddleDigits(forms.activationCode)}
+                />
+              ) : (
+                <Field
+                  clearable={false}
+                  required
+                  inputAlign="right"
+                  label="互通码"
+                  placeholder="请输入互通码"
+                  autocomplete="off"
+                  v-model={forms.activationCode}
+                />
+              )}
+            </Form>
+          </div>
+
+          <MSticky position="bottom">
+            <div class={styles.paymentContainer}>
+              <Button
+                onClick={() => {
+                  // onSubmit();
+                  if (checkForm() || checkSubmit()) {
+                    forms.submitLoading = false;
+                    return;
+                  }
+                  forms.showConfirmPopup = true;
+                }}
+                round
+                block
+                disabled={forms.submitLoading}
+                loading={forms.submitLoading}>
+                提交
+              </Button>
+            </div>
+          </MSticky>
+        </div>
+
+        {forms.imgCodeStatus ? (
+          <MImgCode
+            v-model:value={forms.imgCodeStatus}
+            phone={studentInfo.username}
+            type="REGISTER"
+            onClose={() => {
+              forms.imgCodeStatus = false;
+            }}
+            onSendCode={onCodeSend}
+          />
+        ) : null}
+
+        {/* 互通学校 */}
+        <Popup
+          v-model:show={forms.schoolStatus}
+          position="bottom"
+          round
+          safeAreaInsetBottom
+          lazyRender={false}
+          class={'popupBottomSearch'}
+          onOpen={() => {
+            forms.schoolPopupShow = true;
+          }}
+          onClosed={() => {
+            forms.schoolPopupShow = false;
+          }}>
+          {forms.schoolPopupShow && (
+            <div>
+              <Picker
+                showToolbar
+                v-model={forms.schoolPopupIndex}
+                columns={forms.schoolAreaList}
+                loading={forms.schoolLoading}
+                columnsFieldNames={{
+                  text: 'name',
+                  value: 'id'
+                }}
+                onCancel={() => (forms.schoolStatus = false)}
+                onConfirm={(val: any) => {
+                  const selectedOption = val.selectedOptions[0];
+                  forms.schoolId = null;
+                  forms.schoolAreaId = selectedOption.id;
+                  forms.schoolName = selectedOption.name;
+                  forms.schoolStatus = false;
+                }}>
+                {{
+                  'columns-top': (
+                    <MSearch
+                      placeholder="请输入学校名称"
+                      onSearch={(val: any) => {
+                        getSchoolAreaList(val);
+                      }}
+                    />
+                  )
+                }}
+              </Picker>
+            </div>
+          )}
+        </Popup>
+
+        {/* 年级 */}
+        <Popup
+          v-model:show={forms.gradeStatus}
+          position="bottom"
+          round
+          safeAreaInsetBottom
+          lazyRender={false}
+          class={'popupBottomSearch'}
+          onOpen={() => {
+            forms.gradePopupShow = true;
+          }}
+          onClosed={() => {
+            forms.gradePopupShow = false;
+          }}>
+          {forms.gradePopupShow && (
+            <Picker
+              showToolbar
+              v-model={forms.gradePopupIndex}
+              columns={forms.gradeList}
+              onCancel={() => (forms.gradeStatus = false)}
+              onConfirm={(val: any) => {
+                const selectedOption = val.selectedOptions[0];
+                studentInfo.extra.currentGradeNum = selectedOption.value;
+                forms.gradeNumText = selectedOption.text;
+                forms.gradeStatus = false;
+                if (
+                  ['SCHOOL', 'GRADE'].includes(forms.schoolInstrumentSetType)
+                ) {
+                  forms.instrumentCode = selectedOption.instrumentCode;
+                }
+
+                if (forms.schoolInstrumentSetType === 'CLASS') {
+                  forms.classList = selectedOption.classList;
+                }
+                if (
+                  ['CLASS', 'GRADE'].includes(forms.schoolInstrumentSetType)
+                ) {
+                  forms.currentClassText = '';
+                  studentInfo.extra.currentClass = '';
+                }
+              }}
+            />
+          )}
+        </Popup>
+        {/* 班级 */}
+        <Popup
+          v-model:show={forms.classStatus}
+          position="bottom"
+          round
+          class={'popupBottomSearch'}
+          onOpen={() => {
+            forms.classPopupShow = true;
+          }}
+          onClosed={() => {
+            forms.classPopupShow = false;
+          }}>
+          {forms.classPopupShow && (
+            <Picker
+              showToolbar
+              v-model={forms.classPopupIndex}
+              columns={forms.classList}
+              onCancel={() => (forms.classStatus = false)}
+              onConfirm={(val: any) => {
+                const selectedOption = val.selectedOptions[0];
+                studentInfo.extra.currentClass = selectedOption.value;
+                forms.currentClassText = selectedOption.text;
+                forms.classStatus = false;
+                if (['CLASS'].includes(forms.schoolInstrumentSetType)) {
+                  forms.instrumentCode = selectedOption.instrumentCode;
+                }
+              }}
+            />
+          )}
+        </Popup>
+
+        {/* 是否在微信中打开 */}
+        <OWxTip
+          show={forms.showTips}
+          message={forms.showMessage}
+          showButton={forms.showButton}
+          buttonText="刷新"
+          onConfirm={() => window.location.reload()}
+        />
+
+        <MMessageTip
+          show={otherParams.showOtherSchool}
+          // showCloseButton={otherParams.showCloseButton}
+          messageAlign={otherParams.messageAlign}
+          message={otherParams.showOtherMessage}
+          showCancelButton={otherParams.showCancelButton}
+          cancelButtonColor={otherParams.cancelButtonColor}
+          cancelButtonText={otherParams.cancelButtonText}
+          confirmButtonColor={otherParams.confirmButtonColor}
+          confirmButtonText={otherParams.confirmButtonText}
+          onClose={() => (otherParams.showOtherSchool = false)}
+          onCancel={async () => {
+            otherParams.showOtherSchool = false;
+            if (otherParams.otherType === 'nickname') {
+              forms.isRegister = 'create'; // 新建
+              changeTipStatus(false, false);
+              onSubmit();
+            } else if (otherParams.otherType === 'member') {
+              const updateStatus = await updateStudentInfo();
+              if (!updateStatus) return;
+              //取消支付,判断是否有结束时间,是否已经结束
+              if (forms.registerExpireTime && forms.activeOverStatus) {
+                applyOver();
+              }
+            } else if (otherParams.otherType === 'payment') {
+              forms.joinType = 'tradition';
+            }
+          }}
+          onConfirm={async () => {
+            otherParams.showOtherSchool = false;
+            // 名字
+            if (otherParams.otherType === 'nickname') {
+              forms.isRegister = 'update'; // 修改
+              changeTipStatus(false, false);
+              // 直接注册
+              onSubmit();
+            } else if (otherParams.otherType === 'change') {
+              // 学校更换
+              forms.isChangeSchool = true;
+              // 直接注册
+              onSubmit();
+            } else if (otherParams.otherType === 'limit') {
+              // 人数超限制
+              changeTipStatus(
+                forms.isRegister === 'create' && !forms.studentItem.userId
+                  ? false
+                  : true,
+                false
+              );
+            } else if (otherParams.otherType === 'member') {
+              // await paymentContinue();
+            }
+          }}
+        />
+
+        <Popup
+          v-model:show={forms.showSelectStudent}
+          round
+          position="bottom"
+          safeAreaInsetBottom
+          closeable>
+          <SelectStudent
+            studentItem={forms.studentItem}
+            list={forms.studentList}
+            onClose={() => (forms.showSelectStudent = false)}
+            onConfirm={(val: any) => {
+              if (val.userId) {
+                forms.studentItem = val;
+                const firstStudent = val;
+                studentInfo.extra.nickname = firstStudent.nickname;
+                const tempGrade: any = forms.gradeList || [];
+
+                const tempArea = [] as any;
+                if (firstStudent.provinceName) {
+                  tempArea.push(firstStudent.provinceName);
+                  forms.provinceCode = firstStudent.provinceCode;
+                }
+                if (firstStudent.cityName) {
+                  tempArea.push(firstStudent.cityName);
+                  forms.cityCode = firstStudent.cityCode;
+                }
+                if (firstStudent.regionName) {
+                  tempArea.push(firstStudent.regionName);
+                  forms.regionCode = firstStudent.regionCode;
+                }
+                forms.areaName = tempArea.join(' ');
+
+                forms.schoolName = firstStudent.schoolName;
+                forms.schoolId = firstStudent.schoolId;
+                forms.schoolAreaId = firstStudent.schoolAreaId;
+
+                studentInfo.extra.currentGradeNum = null;
+                forms.gradeNumText = '';
+                forms.instrumentCode = '';
+
+                tempGrade?.forEach((i: any) => {
+                  if (i.value === firstStudent.currentGradeNum) {
+                    forms.instrumentCode = i.instrumentCode;
+                    forms.gradeNumText = i.text;
+                    studentInfo.extra.currentGradeNum =
+                      firstStudent.currentGradeNum;
+                    if (forms.schoolInstrumentSetType === 'CLASS') {
+                      forms.classList = i.classList;
+                    }
+                  }
+                });
+
+                studentInfo.extra.currentClass = null;
+                forms.currentClassText = '';
+
+                forms.classList.forEach((i: any) => {
+                  if (i.value === firstStudent.currentClass) {
+                    forms.currentClassText = i.text;
+                    studentInfo.extra.currentClass = firstStudent.currentClass;
+                  }
+                });
+                studentInfo.extra.gender = firstStudent.gender;
+                forms.isRegister = 'update';
+                changeTipStatus(true, false);
+
+                forms.showSelectStudent = false;
+              } else {
+                // 判断新建学员是否上限了
+                if (forms.studentList.length >= forms.multi_user_limit) {
+                  otherParams.showOtherMessage = `同一手机号最多创建${forms.multi_user_limit}个学生`;
+                  otherParams.showOtherSchool = true;
+                  otherParams.showCancelButton = false;
+                  otherParams.showCloseButton = true;
+                  otherParams.confirmButtonColor =
+                    'linear-gradient( 305deg, #40C8FF 0%, #3192FF 100%)';
+                  otherParams.confirmButtonText = '我知道了';
+                  otherParams.otherType = 'limit';
+                  otherParams.messageAlign = 'center';
+                  return true;
+                } else {
+                  forms.studentItem = val;
+                  forms.isRegister = 'create';
+                  changeTipStatus(false, false);
+                  studentInfo.extra.nickname = '';
+                  studentInfo.extra.currentGradeNum = '';
+                  studentInfo.extra.currentClass = '';
+                  studentInfo.extra.gender = 1;
+                  forms.currentClassText = '';
+                  forms.gradeNumText = '';
+                  forms.showSelectStudent = false;
+                }
+              }
+            }}
+          />
+        </Popup>
+
+        <Popup
+          v-model:show={forms.showPicker}
+          position="bottom"
+          round
+          class={'popupBottomSearch'}>
+          <Area
+            areaList={forms.areaList}
+            onCancel={() => (forms.showPicker = false)}
+            onConfirm={({ selectedOptions }) => {
+              forms.provinceCode = selectedOptions[0].value;
+              forms.cityCode = selectedOptions[1].value;
+              forms.regionCode = selectedOptions[2].value;
+              // data.cityName = selectedOptions
+              //   .map((item: any) => item.text)
+              //   .join(' ');
+              forms.areaName = selectedOptions
+                .map((item: any) => item.text)
+                .join(' ');
+
+              forms.showPicker = false;
+              forms.schoolAreaId = null;
+              forms.schoolName = '';
+
+              getSchoolAreaList();
+            }}
+          />
+        </Popup>
+
+        <Popup
+          show={forms.showConfirmPopup}
+          style={{
+            background: 'transparent',
+            overflow: 'visible !important'
+          }}>
+          <CodeDialog type="INFO" showButton={false}>
+            <div class={styles.studentInfo}>
+              <Cell
+                border={false}
+                title="学生姓名"
+                value={studentInfo.username}></Cell>
+              <Cell
+                border={false}
+                title="学生性别"
+                value={studentInfo.extra.gender === 1 ? '男' : '女'}></Cell>
+              <Cell
+                border={false}
+                title="所在地区"
+                value={forms.areaName}></Cell>
+              <Cell
+                border={false}
+                title="互通学校"
+                value={forms.schoolName}></Cell>
+              <Cell
+                border={false}
+                title="所在年级"
+                value={forms.gradeNumText}></Cell>
+              <Cell
+                border={false}
+                title="所在班级"
+                value={forms.currentClassText}></Cell>
+              {!route.query.code && (
+                <Cell
+                  border={false}
+                  title="互通码"
+                  value={forms.activationCode}></Cell>
+              )}
+            </div>
+            <div class={styles.studentBtnGroup}>
+              <Button
+                round
+                block
+                onClick={() => (forms.showConfirmPopup = false)}>
+                取消
+              </Button>
+              <Button
+                round
+                block
+                disabled={forms.submitLoading}
+                loading={forms.submitLoading}
+                color="linear-gradient( 305deg, #3192FF 0%, #40C8FF 100%)"
+                onClick={() => {
+                  forms.showConfirmPopup = false;
+                  onSubmit();
+                }}>
+                提交
+              </Button>
+            </div>
+          </CodeDialog>
+        </Popup>
+
+        <Popup
+          show={forms.showResultPopup}
+          style={{
+            background: 'transparent',
+            overflow: 'visible !important'
+          }}>
+          <CodeDialog
+            type={forms.reslutPopupType}
+            btnText={
+              forms.reslutPopupType === 'ACTIVATING'
+                ? '立即下载激活'
+                : '我知道了'
+            }
+            onConfirm={() => {
+              //
+              if (forms.reslutPopupType === 'ACTIVATING') {
+                router.push('/download');
+              } else {
+                forms.showResultPopup = false;
+              }
+            }}>
+            {forms.reslutPopupType === 'ACTIVATING' && (
+              <p>
+                请下载
+                <span style={{ color: '#2B85FF' }}>【音乐数字课堂App】</span>
+                ,使用手机号激活,实现音乐课堂互通互联
+              </p>
+            )}
+
+            {forms.reslutPopupType === 'CANCELLED' && (
+              <p style={{ textAlign: 'center', paddingTop: '5px' }}>
+                {forms.resultPopupContent}
+              </p>
+            )}
+            {forms.reslutPopupType === 'EXPIRED' && (
+              <p style={{ textAlign: 'center', paddingTop: '5px' }}>
+                {forms.resultPopupContent}
+              </p>
+            )}
+          </CodeDialog>
+        </Popup>
+      </div>
+    );
+  }
+});

二進制
src/views/activation-code/images/icon-arrow-active.png


二進制
src/views/activation-code/images/icon-arrow.png


二進制
src/views/activation-code/images/icon-book.png


二進制
src/views/activation-code/images/icon-icon.png


二進制
src/views/activation-code/images/icon-key.png


二進制
src/views/activation-code/images/item-bg.png


二進制
src/views/activation-code/images/num1.png


二進制
src/views/activation-code/images/num2.png


二進制
src/views/activation-code/images/num3.png


二進制
src/views/activation-code/images/num4.png


二進制
src/views/activation-code/images/title2.png


二進制
src/views/activation-code/images/woring-bg.png


二進制
src/views/activation-code/images/woring-title.png


+ 355 - 0
src/views/activation-code/index.module.less

@@ -0,0 +1,355 @@
+.hotMusicMore {
+  min-height: 100vh;
+  background: url('./images/woring-bg.png') no-repeat top center;
+  background-size: contain;
+
+  :global {
+    .van-search {
+      padding: 0;
+      border-radius: 50px;
+    }
+
+    .van-sticky--fixed {
+      background: url('./images/woring-bg.png') no-repeat top center;
+      background-size: 100%;
+    }
+
+    .van-calendar__confirm {
+      --van-calendar-confirm-button-height: 40px;
+      --van-button-normal-padding: 18px;
+    }
+  }
+}
+
+.woringHeader {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  height: var(--van-nav-bar-height);
+
+  .leftArrow {
+    padding: 0 var(--k-padding-md);
+  }
+
+  .title,
+  .title2 {
+    position: relative;
+    z-index: 1;
+
+    i {
+      width: 60px;
+      height: 18px;
+      display: inline-block;
+      background: url('./images/woring-title.png') no-repeat center;
+      background-size: contain;
+    }
+
+    &::after {
+      content: ' ';
+      display: inline-block;
+      position: absolute;
+      left: 0;
+      bottom: -2px;
+      width: 48px;
+      height: 6px;
+      background: linear-gradient(270deg, rgba(119, 255, 239, 0.59) 0%, #42CDFF 100%);
+      opacity: 0.5;
+      z-index: -1;
+    }
+  }
+
+  .title2 {
+    i {
+      width: 79px;
+      height: 20px;
+      background: url('./images/title2.png') no-repeat center;
+      background-size: contain;
+    }
+  }
+
+  .recordBtn {
+    background: #FFFFFF;
+    border-radius: 50px;
+    border: 1px solid #1CACF1;
+    font-size: 14px;
+    color: #0E71BC;
+    line-height: 20px;
+    padding: 4px 7px;
+    display: flex;
+    align-items: center;
+    margin-right: 14px;
+    cursor: pointer;
+
+    .iconBook {
+      display: inline-block;
+      width: 14px;
+      height: 14px;
+      background: url('./images/icon-book.png') no-repeat center;
+      background-size: contain;
+      margin-right: 3px;
+    }
+  }
+}
+
+.activationContainer {
+  min-height: calc(100vh - var(--header-height) - 90px);
+  margin-top: 90px;
+  // overflow: hidden;
+  position: relative;
+
+  &.recordContainer {
+    min-height: auto;
+  }
+
+  .iconBrid {
+    position: absolute;
+    right: 16px;
+    top: -105px;
+    display: inline-block;
+    width: 168px;
+    height: 135px;
+    background: url('./images/icon-icon.png') no-repeat center;
+    background-size: contain;
+  }
+}
+
+.section {
+  border-radius: 20px 20px 0px 0px;
+  padding: 13px;
+  background: #F8F9FC;
+  position: relative;
+  z-index: 1;
+}
+
+.activationContent {
+
+  background: #FFFFFF;
+  border-radius: 20px;
+  // margin: 13px;
+  overflow: hidden;
+}
+
+.inputGroup {
+  position: relative;
+  padding: 26px 12px;
+  border-bottom: 1px dashed #EBEBEB;
+
+  &::before,
+  &::after {
+    position: absolute;
+    bottom: 0;
+    content: '';
+    width: 16px;
+    height: 16px;
+    border: 8px solid #fff;
+    background-color: #F8F9FC;
+    border-radius: 50%;
+  }
+
+  &::before {
+    left: -16px;
+    bottom: -16px;
+  }
+
+  &::after {
+    right: -16px;
+    bottom: -16px;
+  }
+
+  .input {
+    background: #F2F2F2;
+    border-radius: 29px;
+    --van-cell-line-height: 24px;
+    --van-field-icon-size: 24px;
+    --van-padding-base: 10px;
+    padding: 8px
+  }
+
+  .btnGroup {
+    margin: 22px 34px 0;
+  }
+}
+
+.tipCotnent {
+  padding: 21px 6px 16px 12px;
+
+  h2 {
+    display: flex;
+    align-items: center;
+    font-weight: 600;
+    font-size: 14px;
+    color: #666666;
+    line-height: 20px;
+    padding-bottom: 12px;
+
+    &::before {
+      display: inline-block;
+      content: '';
+      margin-right: 8px;
+      width: 4px;
+      height: 14px;
+      background: linear-gradient(135deg, #31C7FF 0%, #007AFE 100%);
+      border-radius: 3px;
+    }
+  }
+
+  .tips {
+    font-size: 12px;
+    color: #666666;
+    line-height: 28px;
+
+    p {
+      display: flex;
+      align-items: center;
+    }
+
+    .num {
+      display: inline-block;
+      width: 14px;
+      height: 14px;
+      margin-right: 5px;
+      flex-shrink: 0;
+    }
+
+    .num1 {
+      background: url('./images/num1.png') no-repeat center;
+      background-size: contain;
+    }
+
+    .num2 {
+      background: url('./images/num2.png') no-repeat center;
+      background-size: contain;
+    }
+
+    .num3 {
+      background: url('./images/num3.png') no-repeat center;
+      background-size: contain;
+    }
+
+    .num4 {
+      background: url('./images/num4.png') no-repeat center;
+      background-size: contain;
+    }
+  }
+}
+
+
+.prodSection {
+  padding-top: 16px;
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+
+  .title {
+    font-weight: 500;
+    font-size: 16px;
+    color: #131415;
+    line-height: 22px;
+    display: flex;
+    align-items: center;
+
+    &::before {
+      display: inline-block;
+      content: '';
+      margin-right: 8px;
+      width: 4px;
+      height: 14px;
+      background: #1BA5FF;
+      border-radius: 2px 3px 3px 2px;
+    }
+  }
+
+  .times {
+    font-size: 14px;
+    color: #333333;
+    line-height: 20px;
+    display: flex;
+    align-items: center;
+
+    &::after {
+      content: '';
+      margin-left: 4px;
+      display: inline-block;
+      width: 9px;
+      height: 5px;
+      background: url('./images/icon-arrow.png') no-repeat center;
+      background-size: contain;
+    }
+
+    &.active {
+      color: #1CACF1;
+
+      &::after {
+        background: url('./images/icon-arrow-active.png') no-repeat center;
+        background-size: contain;
+      }
+    }
+  }
+}
+
+.sectionList {
+  height: calc(100vh - var(--header-height));
+  overflow-x: hidden;
+  overflow-y: auto;
+  background: #F8F9FC;
+  padding: 0 13px;
+}
+
+.sectionItem {
+  margin: 8px 0;
+  background: url('./images/item-bg.png') no-repeat top center;
+  background-size: cover;
+  min-height: 141px;
+
+  .itemTitle {
+    font-weight: 600;
+    font-size: 14px;
+    color: #333333;
+    line-height: 20px;
+    padding-top: 6px;
+    padding-right: 14px;
+    text-align: right;
+
+    .text {
+      position: relative;
+      z-index: 10;
+      display: inline-block;
+
+      &::after {
+        content: '';
+        position: absolute;
+        bottom: 1px;
+        left: 0;
+        right: 0;
+        z-index: -1;
+        display: inline-block;
+        width: 100%;
+        height: 6px;
+        background: linear-gradient(270deg, #CCF1FA 0%, #8CDDFC 100%);
+      }
+    }
+
+
+  }
+
+  .itemCode {
+    font-weight: 500;
+    font-size: 20px;
+    color: #1CACF1;
+    line-height: 28px;
+    padding-top: 24px;
+    padding-left: 12px;
+  }
+
+  .itemTime {
+    padding-top: 30px;
+    padding-left: 12px;
+    font-size: 14px;
+    color: #777777;
+    line-height: 20px;
+
+    span {
+      color: #333333;
+    }
+  }
+}

+ 200 - 0
src/views/activation-code/index.tsx

@@ -0,0 +1,200 @@
+import { browser } from '@/helpers/utils';
+import { defineComponent, reactive } from 'vue';
+import styles from './index.module.less';
+import MSticky from '@/components/m-sticky';
+import MHeader from '@/components/m-header';
+import { postMessage } from '@/helpers/native-message';
+import { useRouter } from 'vue-router';
+import { Button, Field, Popup, showToast } from 'vant';
+import iconKey from './images/icon-key.png';
+import CodeDialog from './modal/code-dialog';
+import request from '@/helpers/request';
+import dayjs from 'dayjs';
+
+const vipGiftPeriodType = {
+  DAY: '天',
+  MONTH: '月',
+  YEAR: '年'
+} as any;
+
+export default defineComponent({
+  name: 'activationCode',
+  setup() {
+    const router = useRouter();
+    const state = reactive({
+      showPopup: false,
+      reslutPopupType: '',
+      resultPopupContent: '',
+      loading: false,
+      activeCodeRecordCode: null as any,
+      successInfo: {} as any
+    });
+
+    const onSubmit = async () => {
+      if (!state.activeCodeRecordCode) {
+        showToast('请输入互通码');
+        return;
+      }
+      state.loading = true;
+      try {
+        const res = await request.post(
+          '/edu-app/activationCodeRecord/useActiveCode',
+          {
+            data: {
+              activeCodeRecordCode: state.activeCodeRecordCode
+            }
+          }
+        );
+        if (res.code !== 200) {
+          if (res.code === 5442) {
+            state.showPopup = true;
+            state.reslutPopupType = 'EXPIRED';
+            state.resultPopupContent = res.message;
+          } else if (res.code === 5443) {
+            state.showPopup = true;
+            state.reslutPopupType = 'CANCELLED';
+            state.resultPopupContent = res.message;
+          }
+        } else {
+          state.showPopup = true;
+          state.reslutPopupType = 'ACTIVATED';
+          state.successInfo = res.data;
+        }
+      } catch {}
+      state.loading = false;
+    };
+    return () => (
+      <div
+        class={[
+          styles.hotMusicMore,
+          browser().isTablet ? styles.hotMusicMoreTablet : ''
+        ]}>
+        <MSticky position="top">
+          <MHeader border={false} background={'transparent'}>
+            {{
+              content: () => (
+                <div class={styles.woringHeader}>
+                  <div>
+                    <i
+                      onClick={() => {
+                        if (browser().isApp) {
+                          postMessage({
+                            api: 'goBack'
+                          });
+                        } else {
+                          router.back();
+                        }
+                      }}
+                      class={[
+                        'van-badge__wrapper van-icon van-icon-arrow-left van-nav-bar__arrow',
+                        styles.leftArrow
+                      ]}></i>
+                    <span class={styles.title}>
+                      <i></i>
+                    </span>
+                  </div>
+                  <div
+                    class={styles.recordBtn}
+                    onClick={() => {
+                      router.push('/activationRecord');
+                    }}>
+                    <i class={styles.iconBook}></i>
+                    激活记录
+                  </div>
+                </div>
+              )
+            }}
+          </MHeader>
+        </MSticky>
+
+        <div class={styles.activationContainer}>
+          <i class={styles.iconBrid}></i>
+          <div class={styles.section}>
+            <div class={styles.activationContent}>
+              <div class={styles.inputGroup}>
+                <Field
+                  class={styles.input}
+                  leftIcon={iconKey}
+                  v-model={state.activeCodeRecordCode}
+                  placeholder="请输入您的互通码"
+                />
+
+                <div class={styles.btnGroup}>
+                  <Button
+                    round
+                    block
+                    loading={state.loading}
+                    disabled={state.loading}
+                    onClick={() => {
+                      onSubmit();
+                    }}
+                    color="linear-gradient( 135deg, #31C7FF 0%, #007AFE 100%)">
+                    激活
+                  </Button>
+                </div>
+              </div>
+              <div class={styles.tipCotnent}>
+                <h2>互通码使用须知:</h2>
+                <div class={styles.tips}>
+                  <p>
+                    <i class={[styles.num, styles.num1]}></i>
+                    互通码只可使用一次,不能重复使用;
+                  </p>
+                  <p>
+                    <i class={[styles.num, styles.num2]}></i>
+                    为确保安全,请勿将互通码泄露,以免造成不必要的损失;
+                  </p>
+                  <p>
+                    <i class={[styles.num, styles.num3]}></i>
+                    互通码请尽快激活使用,避免互通码过期;
+                  </p>
+                  <p>
+                    <i class={[styles.num, styles.num4]}></i>
+                    互通码内容已实际购买页面内容为准。
+                  </p>
+                </div>
+              </div>
+            </div>
+          </div>
+        </div>
+
+        <Popup
+          show={state.showPopup}
+          style={{
+            background: 'transparent',
+            overflow: 'visible !important'
+          }}>
+          <CodeDialog
+            type={state.reslutPopupType as any}
+            onConfirm={() => {
+              state.showPopup = false;
+            }}>
+            {state.reslutPopupType === 'ACTIVATED' && (
+              <p>
+                您已成功激活{state.successInfo?.times}
+                {vipGiftPeriodType[state.successInfo?.type]}
+                乐器AI学练工具,有效期
+                <span style={{ color: '#2B85FF' }}>
+                  {dayjs(state.successInfo.membershipEndTime).format(
+                    'YYYY-MM-DD'
+                  )}
+                </span>
+              </p>
+            )}
+
+            {state.reslutPopupType === 'CANCELLED' && (
+              <p style={{ textAlign: 'center', paddingTop: '5px' }}>
+                {state.resultPopupContent}
+              </p>
+            )}
+            {state.reslutPopupType === 'EXPIRED' && (
+              <p style={{ textAlign: 'center', paddingTop: '5px' }}>
+                {state.resultPopupContent}
+              </p>
+            )}
+          </CodeDialog>
+        </Popup>
+      </div>
+    );
+  }
+});

+ 250 - 0
src/views/activation-code/instrument-registration/detail.module.less

@@ -0,0 +1,250 @@
+.student-register {
+  min-height: 100vh;
+  // background: #FFF4E2;
+  background: linear-gradient(180deg, #C9EDFD 0%, #CCF0FF 100%);
+  overflow: hidden;
+  position: relative;
+
+  --k-font-primary: #007AFE;
+
+  .studentRegisterContainer {
+    padding-top: 180px;
+    background: url('./images/banner1.png') no-repeat top center;
+    background-size: contain;
+  }
+}
+
+.paymentContainer {
+  font-size: 14px;
+  padding: 12px 25px calc(12px + env(safe-area-inset-bottom)) 25px;
+  background: #FFFFFF;
+  box-shadow: 0px -1px 0px 0px #F2F2F2, inset 0px 1px 3px 0px #FFFFFF;
+  border-radius: 18px 18px 0px 0px;
+
+  :global {
+    .van-button {
+      height: 40px;
+      line-height: 40px;
+      background: linear-gradient(135deg, #31C7FF 0%, #007AFE 100%);
+      font-size: 16px;
+      color: #fff;
+      font-weight: 500;
+      border: 0;
+    }
+  }
+
+}
+
+.studentSection {
+  margin: 0 14px 12px;
+  padding: 0;
+  background: linear-gradient(180deg, rgba(219, 246, 253) 0%, rgba(255, 255, 255) 30%);
+  border-radius: 16px;
+  border: 2px solid #FFFFFF;
+
+}
+
+.registerForm {
+  border-radius: 18px;
+  // margin: 0 12px;
+  overflow: hidden;
+
+  .selectStudentGroup {
+    margin-left: 10px;
+    font-size: 14px;
+    color: #1189FF;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+
+    // &.selectStudentGroupChecked {
+    //   span::after {
+    //     transform: rotate(180deg);
+    //   }
+    // }
+
+    span {
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      background: rgba(17, 137, 255, 0.08);
+      border-radius: 20px;
+      border: 1px solid rgba(17, 137, 255, 0.6);
+      padding: 0px 8px;
+
+      // &::after {
+      //   display: inline-block;
+      //   content: '';
+      //   width: 9px;
+      //   height: 5px;
+      //   margin-left: 4px;
+      //   background: url('../../student-register/images/new/icon-n-6.png') no-repeat center;
+      //   background-size: contain;
+      // }
+    }
+  }
+
+  :global {
+    .van-cell {
+      background-color: transparent;
+    }
+  }
+
+  :global {
+    .van-cell {
+      padding: 14px 18px;
+    }
+
+
+    .van-field__label {
+      font-size: 16px;
+      color: #666666;
+      line-height: 22px;
+      display: flex;
+      align-items: center;
+    }
+
+    .van-field__control {
+      font-size: 16px;
+      color: #131415;
+    }
+  }
+
+  .codeText {
+    color: #1189FF;
+    font-size: 14px;
+
+    // &.codeTextDisabled {
+    //   color: #ccc;
+    // }
+  }
+
+}
+
+.radioSection {
+  position: relative;
+  min-width: 32px;
+  justify-content: center;
+  // padding-left: 19px;
+  // padding-right: 19px;
+  padding: 5px 19px;
+  font-size: 14px;
+  font-weight: 500;
+  border-radius: 6px;
+}
+
+.radioItem {
+  position: absolute;
+  top: 0;
+  left: 0;
+  right: 0;
+  bottom: 0;
+  opacity: 0;
+}
+
+.radioSection+.radioSection {
+  margin-left: 12px;
+}
+
+
+.selectStudentPopup {
+  :global {
+    .van-popup__close-icon {
+      color: #767C7F;
+    }
+  }
+}
+
+
+.studentInfo {
+  :global {
+    .van-cell {
+      padding: 10px 0;
+
+      &:first-child {
+        padding-top: 0;
+      }
+
+      &:last-child {
+        padding-bottom: 0;
+      }
+    }
+
+    .van-cell__title {
+
+      font-size: 14px;
+      color: #666666;
+      line-height: 20px;
+
+      span {
+        color: #666666 !important;
+      }
+    }
+
+    .van-cell__value {
+      font-size: 14px;
+      color: #131415;
+      flex: 1 auto;
+      line-height: 20px;
+
+      span {
+        color: #131415 !important;
+      }
+    }
+  }
+
+
+}
+
+.studentBtnGroup {
+  display: flex;
+  align-items: center;
+  padding-top: 20px;
+  padding-bottom: 5px;
+
+  :global {
+    .van-button {
+      flex: 1;
+
+      &+.van-button {
+        margin-left: 15px;
+      }
+    }
+  }
+}
+
+.popupContainer {
+  width: 295px;
+
+  border-radius: 20px;
+  padding: 13px 20px 20px;
+  background: url('./images/top_bg.png') no-repeat top;
+  background-size: contain;
+  background-color: #FFFFFF;
+
+  .title {
+    width: 215px;
+    height: 65px;
+    display: block;
+    margin: 0 auto;
+  }
+
+  .content {
+    font-weight: 400;
+    font-size: 15px;
+    color: #666666;
+    line-height: 23px;
+    padding: 10px 0 20px;
+
+    span {
+      font-weight: 600;
+      color: #2B85FF;
+    }
+  }
+
+  .pBtnGroup {
+    padding: 0 50px;
+
+
+  }
+}

+ 387 - 0
src/views/activation-code/instrument-registration/detail.tsx

@@ -0,0 +1,387 @@
+import {
+  Image,
+  Cell,
+  Tag,
+  Button,
+  Popup,
+  showToast,
+  Form,
+  Field,
+  CountDown,
+  RadioGroup,
+  Radio,
+  Picker,
+  closeToast,
+  Popover,
+  Area,
+  CellGroup,
+  showConfirmDialog
+} from 'vant';
+import {
+  computed,
+  defineComponent,
+  nextTick,
+  onMounted,
+  onUnmounted,
+  reactive,
+  ref
+} from 'vue';
+import styles from './detail.module.less';
+import MSticky from '@/components/m-sticky';
+// import MVideo from '@/components/m-video';
+import { useRoute, useRouter } from 'vue-router';
+import request from '@/helpers/request';
+import loginSuccess from './images/login-success.png';
+
+import SelectStudent from '@/views/student-register/modal/select-student';
+
+const classList: any = [];
+for (let i = 1; i <= 40; i++) {
+  classList.push({ text: i + '班', value: i });
+}
+
+const GRADE_ENUM = {
+  '1': '一年级',
+  '2': '二年级',
+  '3': '三年级',
+  '4': '四年级',
+  '5': '五年级',
+  '6': '六年级',
+  '7': '七年级',
+  '8': '八年级',
+  '9': '九年级'
+} as any;
+const getGradeList = (gradeYear?: string, instrumentCode?: string) => {
+  let tempList: any = [];
+  const five = [
+    { text: '一年级', value: 1, instrumentCode },
+    { text: '二年级', value: 2, instrumentCode },
+    { text: '三年级', value: 3, instrumentCode },
+    { text: '四年级', value: 4, instrumentCode },
+    { text: '五年级', value: 5, instrumentCode }
+  ];
+  const one = [{ text: '六年级', value: 6, instrumentCode }];
+  const three = [
+    { text: '七年级', value: 7, instrumentCode },
+    { text: '八年级', value: 8, instrumentCode },
+    { text: '九年级', value: 9, instrumentCode }
+  ];
+  if (gradeYear === 'FIVE_YEAR_SYSTEM') {
+    tempList.push(...[...five]);
+  } else if (gradeYear === 'SIX_YEAR_SYSTEM') {
+    tempList.push(...[...five, ...one]);
+  } else if (gradeYear === 'THREE_YEAR_SYSTEM') {
+    tempList.push(...[...three]);
+  } else if (gradeYear === 'FORE_YEAR_SYSTEM') {
+    tempList.push(...[...one, ...three]);
+  } else {
+    tempList.push(...[...five, ...one, ...three]);
+  }
+  return tempList;
+};
+
+export default defineComponent({
+  name: 'activation-register',
+  setup() {
+    const route = useRoute();
+    const forms = reactive({
+      activationCodeRecordId: route.query.activationCodeRecordId,
+      statusShow: false,
+      schoolId: null as any,
+      schoolAreaId: null, // 学校区域编号
+      activationCode: route.query.code as any, // 互通码
+      paymentType: '', // 支付类型
+      paymentChannel: '',
+      multi_user_limit: 1, // 限制注册学生数量
+      // popupShow: false,
+      registerDetails: {} as any,
+      details: [] as any[],
+      // schoolType: '', // 学校类型
+      gradeYear: '', // 学制
+      schoolInstrumentSetType: null as any,
+      submitLoading: false,
+      showSelectStudent: false, // 选择学生
+      studentList: [], // 手机号关联学生列表
+      studentItem: {} as any, // 选择的学生
+
+      registerAllFlag: false // 是否全部登记
+    });
+
+    const studentInfo = reactive({
+      nickname: '',
+      areaName: '',
+      schoolName: '',
+      currentGradeNum: '' as any,
+      gender: 1 as any,
+      registerType: null as any // 报名类型
+    });
+
+    const btnText = computed(() => {
+      if (forms.registerAllFlag) {
+        return '该账号学生已全部登记';
+      }
+      if (forms.studentItem?.registerFlag) {
+        return '该学生已登记';
+      }
+      return '登记';
+    });
+
+    const getDetail = async () => {
+      try {
+        const { data } = await request.post(
+          '/edu-app/open/instrumentRegister/getStudentActivationRecord',
+          {
+            requestType: 'form',
+            data: {
+              mobile: route.query.mobile
+            }
+          }
+        );
+
+        const result = data || [];
+        result.forEach((item: any) => {
+          item.userId = item.activationCodeRecordId;
+        });
+        forms.studentList = result;
+
+        let count = 0;
+        forms.studentList.forEach((item: any) => {
+          if (!item.registerFlag && !forms.studentItem?.userId) {
+            forms.studentItem = item;
+          }
+          if (item.registerFlag) {
+            count++;
+          }
+        });
+        if (forms.studentList.length === count) {
+          forms.registerAllFlag = true;
+          forms.studentItem = forms.studentList[0];
+        }
+        formatData(forms.studentItem);
+      } catch {
+        //
+      }
+    };
+
+    const formatData = (item: any) => {
+      studentInfo.nickname = item.nickname;
+      studentInfo.gender = item.gender;
+      const tempArea = [] as any;
+      if (item.provinceName) {
+        tempArea.push(item.provinceName);
+      }
+      if (item.cityName) {
+        tempArea.push(item.cityName);
+      }
+      if (item.regionName) {
+        tempArea.push(item.regionName);
+      }
+      studentInfo.areaName = tempArea.join(' ');
+
+      studentInfo.schoolName = item.schoolName;
+      studentInfo.currentGradeNum =
+        item.currentGradeNum + '年级' + item.currentClass + '班';
+    };
+
+    const onSubmit = async () => {
+      forms.submitLoading = true;
+      try {
+        const { data } = await request.post(
+          '/edu-app/open/instrumentRegister/instrumentUseRegister',
+          {
+            requestType: 'form',
+            data: {
+              activationCodeRecordId: forms.studentItem.activationCodeRecordId
+            }
+          }
+        );
+
+        forms.statusShow = true;
+      } catch {}
+      forms.submitLoading = false;
+    };
+
+    onMounted(() => {
+      getDetail();
+    });
+    return () => (
+      <div class={styles['student-register']}>
+        <div class={styles.studentRegisterContainer}>
+          <div class={[styles.studentSection]}>
+            <Form labelAlign="left" class={styles.registerForm}>
+              <Field
+                clearable={false}
+                required
+                inputAlign="right"
+                label="学生姓名"
+                placeholder="请输入学生姓名"
+                autocomplete="off"
+                readonly
+                maxlength={14}
+                v-model={studentInfo.nickname}>
+                {{
+                  extra: () =>
+                    forms.studentList.length > 1 && (
+                      <div
+                        class={[styles.selectStudentGroup]}
+                        onClick={() => (forms.showSelectStudent = true)}>
+                        <span>切换学生</span>
+                      </div>
+                    )
+                }}
+              </Field>
+              <Field
+                clearable={false}
+                required
+                inputAlign="right"
+                label="学生性别"
+                placeholder="请选择性别"
+                autocomplete="off">
+                {{
+                  input: () => (
+                    <RadioGroup
+                      checked-color="linear-gradient( 135deg, #31C7FF 0%, #007AFE 100%)"
+                      v-model={studentInfo.gender}
+                      direction="horizontal"
+                      disabled>
+                      <Tag
+                        size="large"
+                        type="primary"
+                        color={
+                          !(studentInfo.gender === 1)
+                            ? '#F5F6FA'
+                            : 'linear-gradient( 135deg, #31C7FF 0%, #007AFE 100%)'
+                        }
+                        textColor={
+                          !(studentInfo.gender === 1) ? '#626264' : '#fff'
+                        }
+                        class={styles.radioSection}>
+                        <Radio class={styles.radioItem} name={1}></Radio>男
+                      </Tag>
+                      <Tag
+                        size="large"
+                        type="primary"
+                        color={
+                          !(studentInfo.gender === 0)
+                            ? '#F5F6FA'
+                            : 'linear-gradient( 135deg, #31C7FF 0%, #007AFE 100%)'
+                        }
+                        textColor={
+                          !(studentInfo.gender === 0) ? '#626264' : '#fff'
+                        }
+                        class={styles.radioSection}>
+                        <Radio class={styles.radioItem} name={0}></Radio>女
+                      </Tag>
+                    </RadioGroup>
+                  )
+                }}
+              </Field>
+              <Field
+                clearable={false}
+                required
+                inputAlign="right"
+                label="所在地区"
+                placeholder="请选择地区"
+                readonly
+                clickable={false}
+                modelValue={studentInfo.areaName}
+              />
+              <Field
+                clearable={false}
+                required
+                inputAlign="right"
+                label="互通学校"
+                placeholder="请选择互通学校"
+                readonly
+                clickable={false}
+                modelValue={studentInfo.schoolName}
+              />
+              <Field
+                clearable={false}
+                required
+                inputAlign="right"
+                label="所在班级"
+                placeholder="请选择班级"
+                readonly
+                clickable={false}
+                modelValue={studentInfo.currentGradeNum}
+              />
+            </Form>
+          </div>
+
+          <MSticky position="bottom">
+            <div class={styles.paymentContainer}>
+              <Button
+                onClick={() => {
+                  onSubmit();
+                }}
+                round
+                block
+                disabled={
+                  forms.submitLoading ||
+                  forms.registerAllFlag ||
+                  forms.studentItem.registerFlag
+                }
+                loading={forms.submitLoading}>
+                {btnText.value}
+              </Button>
+            </div>
+          </MSticky>
+        </div>
+
+        <Popup
+          v-model:show={forms.showSelectStudent}
+          round
+          position="bottom"
+          safeAreaInsetBottom
+          closeable>
+          <SelectStudent
+            showAdd={false}
+            studentItem={forms.studentItem}
+            list={forms.studentList}
+            onClose={() => (forms.showSelectStudent = false)}
+            onConfirm={(val: any) => {
+              console.log(val, 'val');
+              formatData(val);
+              forms.studentItem = val;
+            }}
+          />
+        </Popup>
+
+        <Popup
+          show={forms.statusShow}
+          style={{
+            background: 'transparent',
+            overflow: 'visible !important'
+          }}>
+          <div class={styles.popupContainer}>
+            <img class={styles.title} src={loginSuccess} />
+
+            <div class={styles.content}>
+              <span>{forms.studentItem.nickname}</span>
+              已登记成功,乐器将在开课时发至学生
+            </div>
+            <div class={styles.pBtnGroup}>
+              <Button
+                round
+                block
+                onClick={() => {
+                  forms.statusShow = false;
+                  forms.studentItem.registerFlag = true;
+
+                  forms.studentList.forEach((item: any) => {
+                    if (item.userId === forms.studentItem?.userId) {
+                      item.registerFlag = true;
+                    }
+                  });
+                }}
+                color="linear-gradient( 305deg, #007AFE 0%, #31C7FF 100%)">
+                我知道了
+              </Button>
+            </div>
+          </div>
+        </Popup>
+      </div>
+    );
+  }
+});

二進制
src/views/activation-code/instrument-registration/images/banner.png


二進制
src/views/activation-code/instrument-registration/images/banner1.png


二進制
src/views/activation-code/instrument-registration/images/icon-phone.png


二進制
src/views/activation-code/instrument-registration/images/login-error.png


二進制
src/views/activation-code/instrument-registration/images/login-success.png


二進制
src/views/activation-code/instrument-registration/images/top_bg.png


+ 105 - 0
src/views/activation-code/instrument-registration/index.module.less

@@ -0,0 +1,105 @@
+.registrationContainer {
+  min-height: 100vh;
+  background: linear-gradient(180deg, #C9EDFD 0%, #CCF0FF 100%);
+
+  .registration {
+    min-height: 100vh;
+    background: url('./images/banner.png') no-repeat top;
+    background-size: contain;
+    overflow: hidden;
+  }
+
+
+  .inputGroup {
+    margin-top: 379px;
+    position: relative;
+    padding: 0 18px;
+
+
+    .input {
+      background: rgba(242, 242, 242, .56);
+      border-radius: 29px;
+      --van-cell-line-height: 24px;
+      --van-field-icon-size: 24px;
+      --van-padding-base: 10px;
+      padding: 8px;
+      font-size: 14px;
+      color: #AAAAAA;
+
+      input::placeholder {
+        color: #AAAAAA;
+      }
+
+      :global {
+        .van-field__control {
+          font-size: 14px;
+          // color: #AAAAAA;
+        }
+      }
+    }
+
+    .btnGroup {
+      margin: 30px 73px 0;
+      --van-button-default-height: 52px;
+
+      .progress {
+        margin-top: 18px;
+        margin-left: 34px;
+        margin-right: 34px;
+      }
+
+      :global {
+        .van-button--disabled::before {
+          opacity: 0;
+        }
+
+        .van-button__text {
+          p {
+            font-weight: 500;
+            font-size: 16px;
+            color: #FFFFFF;
+            line-height: 22px;
+          }
+
+          span {
+            font-weight: 400;
+            font-size: 12px;
+            color: rgba(255, 255, 255, 0.8);
+            line-height: 17px;
+          }
+        }
+      }
+    }
+  }
+}
+
+.popupContainer {
+  width: 295px;
+
+  border-radius: 20px;
+  padding: 13px 20px 20px;
+  background: url('./images/top_bg.png') no-repeat top;
+  background-size: contain;
+  background-color: #FFFFFF;
+
+  .title {
+    width: 215px;
+    height: 65px;
+    display: block;
+    margin: 0 auto;
+  }
+
+  .content {
+    font-weight: 400;
+    font-size: 15px;
+    color: #666666;
+    line-height: 23px;
+    padding: 10px 0 20px
+  }
+
+  .pBtnGroup {
+    padding: 0 50px;
+
+
+  }
+}

+ 129 - 0
src/views/activation-code/instrument-registration/index.tsx

@@ -0,0 +1,129 @@
+import { defineComponent, reactive } from 'vue';
+import styles from './index.module.less';
+import { Button, Field, Popup, Progress, showToast } from 'vant';
+import iconKey from './images/icon-phone.png';
+import loginError from './images/login-error.png';
+import request from '@/helpers/request';
+import { useRouter } from 'vue-router';
+
+export default defineComponent({
+  name: 'instrument-registration',
+  setup() {
+    const router = useRouter();
+    const state = reactive({
+      progressRate: 0,
+      statusShow: false,
+      mobile: '',
+      loading: false
+    });
+    const onSubmit = async () => {
+      if (!state.mobile) {
+        showToast('请输入手机号');
+        return;
+      }
+      state.loading = true;
+      try {
+        const res = await request.post(
+          '/edu-app/open/instrumentRegister/getStudentActivationRecord',
+          {
+            requestType: 'form',
+            data: {
+              mobile: state.mobile
+            }
+          }
+        );
+
+        animation(res);
+      } catch {
+        //
+        state.loading = false;
+      }
+    };
+
+    const animation = (item: any) => {
+      const timer = setInterval(() => {
+        if (state.progressRate >= 100) {
+          clearInterval(timer);
+          if (item.code !== 200) {
+            state.statusShow = true;
+            state.progressRate = 0;
+          } else {
+            router.push({
+              path: '/activationRegistrationDetail',
+              query: {
+                mobile: state.mobile
+              }
+            });
+          }
+          state.loading = false;
+        } else {
+          state.progressRate += 4;
+        }
+      }, 80);
+    };
+
+    return () => (
+      <div class={styles.registrationContainer}>
+        <div class={styles.registration}>
+          <div class={styles.inputGroup}>
+            <Field
+              class={styles.input}
+              leftIcon={iconKey}
+              v-model={state.mobile}
+              autocomplete="off"
+              maxlength={11}
+              type="tel"
+              placeholder="请输入【音乐数字课堂】激活成功时的手机号"
+            />
+
+            <div class={styles.btnGroup}>
+              <Button
+                block
+                round
+                disabled={state.loading}
+                onClick={onSubmit}
+                color="linear-gradient( 305deg, #007AFE 0%, #31C7FF 100%)">
+                <p>{state.loading ? '正在进行核验' : '互通核验'}</p>
+                <span>
+                  {state.loading ? '请稍后······' : '多子女需多次核验'}
+                </span>
+              </Button>
+              {state.loading && (
+                <Progress
+                  showPivot={false}
+                  strokeWidth={4}
+                  v-model:percentage={state.progressRate}
+                  class={styles.progress}
+                />
+              )}
+            </div>
+          </div>
+        </div>
+
+        <Popup
+          show={state.statusShow}
+          style={{
+            background: 'transparent',
+            overflow: 'visible !important'
+          }}>
+          <div class={styles.popupContainer}>
+            <img class={styles.title} src={loginError} />
+
+            <div class={styles.content}>
+              请输入【音乐数字课堂】激活成功时的手机号
+            </div>
+            <div class={styles.pBtnGroup}>
+              <Button
+                round
+                block
+                onClick={() => (state.statusShow = false)}
+                color="linear-gradient( 305deg, #3192FF 0%, #40C8FF 100%)">
+                我知道了
+              </Button>
+            </div>
+          </div>
+        </Popup>
+      </div>
+    );
+  }
+});

二進制
src/views/activation-code/modal/code-dialog/images/brid1.png


二進制
src/views/activation-code/modal/code-dialog/images/brid2.png


二進制
src/views/activation-code/modal/code-dialog/images/brid3.png


二進制
src/views/activation-code/modal/code-dialog/images/brid4.png


二進制
src/views/activation-code/modal/code-dialog/images/title1.png


二進制
src/views/activation-code/modal/code-dialog/images/title2.png


二進制
src/views/activation-code/modal/code-dialog/images/title3.png


二進制
src/views/activation-code/modal/code-dialog/images/title4.png


二進制
src/views/activation-code/modal/code-dialog/images/title5.png


+ 84 - 0
src/views/activation-code/modal/code-dialog/index.module.less

@@ -0,0 +1,84 @@
+.codeDialog {
+  width: 305px;
+  background: linear-gradient(89deg, #D0EFF7 0%, #D9F9DC 100%);
+  position: relative;
+  border-radius: 12px;
+}
+
+.header {
+  position: absolute;
+  left: 0;
+  right: 0;
+  top: 0;
+
+  .leftTitle {
+    position: absolute;
+    top: 16px;
+    left: 16px;
+
+    img {
+      height: 29px;
+      width: auto;
+    }
+
+    &.info {
+      img {
+        height: 26px;
+      }
+    }
+  }
+
+  .rightTitle {
+    position: absolute;
+    right: 0;
+    top: -23px;
+    width: 133px;
+    height: 118px;
+
+    img {
+      width: inherit;
+      height: inherit;
+    }
+  }
+}
+
+.body {
+  position: relative;
+  z-index: 10;
+  padding: 61px 6px 6px;
+}
+
+.container {
+  border-radius: 12px;
+  border: 1px solid #FFFFFF;
+}
+
+.section {
+  background: #FFFFFF;
+  border-radius: 12px;
+  margin: 4px;
+  padding: 15px;
+
+  .content {
+    font-size: 15px;
+    color: #666666;
+    line-height: 23px;
+
+    span {
+      // color: #2B85FF;
+    }
+  }
+
+  .btnGroup {
+    padding: 20px 55px 0;
+
+    :global {
+      .van-button {
+        padding: 0;
+        font-weight: 400;
+        font-size: 16px;
+        color: #FFFFFF;
+      }
+    }
+  }
+}

+ 103 - 0
src/views/activation-code/modal/code-dialog/index.tsx

@@ -0,0 +1,103 @@
+import { PropType, computed, defineComponent } from 'vue';
+import styles from './index.module.less';
+import { Button } from 'vant';
+import { emit } from 'process';
+
+export const getAssetsHomeFile = (fileName: string) => {
+  const path = `./images/${fileName}`;
+  const modules: any = import.meta.globEager('./images/*');
+  return modules[path].default;
+};
+
+export default defineComponent({
+  name: 'code-dialog',
+  props: {
+    showButton: {
+      type: Boolean,
+      default: true
+    },
+    btnText: {
+      type: String,
+      default: '我知道了'
+    },
+    type: {
+      // ACTIVATED: '已激活',
+      // INACTIVATED: '未激活',
+      // EXPIRED: '已失效',
+      // ACTIVATING: '激活中',
+      // CANCELLED: '已作废',
+      type: String as PropType<
+        'ACTIVATED' | 'EXPIRED' | 'CANCELLED' | 'INFO' | 'ACTIVATING'
+      >,
+      default: 'ACTIVATED'
+    }
+  },
+  emits: ['confirm'],
+  setup(props, { emit, slots }) {
+    const headerImgs = computed(() => {
+      console.log(props.type, 'props.type');
+      let title = getAssetsHomeFile('title1.png');
+      let icon = getAssetsHomeFile('brid1.png');
+      if (props.type === 'ACTIVATED') {
+        title = getAssetsHomeFile('title4.png');
+        icon = getAssetsHomeFile('brid1.png');
+      } else if (props.type === 'ACTIVATING') {
+        title = getAssetsHomeFile('title2.png');
+        icon = getAssetsHomeFile('brid1.png');
+      } else if (props.type === 'EXPIRED') {
+        title = getAssetsHomeFile('title1.png');
+        icon = getAssetsHomeFile('brid4.png');
+      } else if (props.type === 'CANCELLED') {
+        title = getAssetsHomeFile('title5.png');
+        icon = getAssetsHomeFile('brid3.png');
+      } else if (props.type === 'INFO') {
+        title = getAssetsHomeFile('title3.png');
+        icon = getAssetsHomeFile('brid2.png');
+      }
+      return {
+        title,
+        icon
+      };
+    });
+    return () => (
+      <div class={styles.codeDialog}>
+        <div class={styles.header}>
+          <div
+            class={[
+              styles.leftTitle,
+              props.type === 'INFO' ? styles.info : ''
+            ]}>
+            <img src={headerImgs.value.title} />
+          </div>
+          <div class={styles.rightTitle}>
+            <img src={headerImgs.value.icon} />
+          </div>
+        </div>
+
+        <div class={styles.body}>
+          <div class={styles.container}>
+            <div class={styles.section}>
+              <div class={styles.content}>
+                {/* 您已成功激活一年乐器AI学练工具,有效期至<span>121212</span> */}
+                {slots.default ? slots.default() : null}
+              </div>
+              {props.showButton && (
+                <div class={styles.btnGroup}>
+                  <Button
+                    block
+                    round
+                    color="linear-gradient( 305deg, #40C8FF 0%, #3192FF 100%)"
+                    onClick={() => {
+                      emit('confirm');
+                    }}>
+                    {props.btnText}
+                  </Button>
+                </div>
+              )}
+            </div>
+          </div>
+        </div>
+      </div>
+    );
+  }
+});

+ 202 - 0
src/views/activation-code/record.tsx

@@ -0,0 +1,202 @@
+import { browser } from '@/helpers/utils';
+import { defineComponent, onMounted, reactive } from 'vue';
+import styles from './index.module.less';
+import MSticky from '@/components/m-sticky';
+import MHeader from '@/components/m-header';
+import { useRouter } from 'vue-router';
+import { postMessage } from '@/helpers/native-message';
+import MSearch from '@/components/m-search';
+import { Calendar, List } from 'vant';
+import dayjs from 'dayjs';
+import isBetween from 'dayjs/plugin/isBetween';
+import request from '@/helpers/request';
+import MEmpty from '@/components/m-empty';
+dayjs.extend(isBetween);
+
+const vipGiftPeriodType = {
+  DAY: '天',
+  MONTH: '月',
+  YEAR: '年'
+} as any;
+
+export default defineComponent({
+  name: 'activationCode',
+  setup() {
+    const router = useRouter();
+    const state = reactive({
+      showPopoverTime: false,
+      background: 'transparent',
+      loading: false,
+      finished: false,
+      list: [] as any
+    });
+
+    const forms = reactive({
+      page: 1,
+      rows: 20,
+      code: null as any,
+      activateStartTime: dayjs().subtract(1, 'months').format('YYYY-MM-DD'),
+      activateEndTime: dayjs().format('YYYY-MM-DD')
+    });
+
+    const getList = async () => {
+      state.loading = true;
+      try {
+        const params = {
+          ...forms
+        };
+
+        if (forms.activateEndTime && forms.activateStartTime) {
+          params.activateEndTime = forms.activateEndTime + ' 23:59:59';
+          params.activateStartTime = forms.activateStartTime + ' 00:00:00';
+        }
+        const res = await request.post('/edu-app/activationCodeRecord/page', {
+          data: params
+        });
+        if (res.code === 200 && Array.isArray(res?.data?.rows)) {
+          state.list = [...state.list, ...res.data.rows];
+          state.finished = !res.data.next;
+          forms.page = res.data.current + 1;
+          // state.listState.dataShow = state.list.length > 0;
+        } else {
+          state.finished = true;
+        }
+      } catch (error) {
+        // console.log('🚀 ~ error:', error);
+        state.finished = true;
+      }
+      state.loading = false;
+    };
+
+    onMounted(() => {
+      getList();
+    });
+    return () => (
+      <div
+        class={[
+          styles.hotMusicMore,
+          browser().isTablet ? styles.hotMusicMoreTablet : ''
+        ]}>
+        <MSticky position="top">
+          <MHeader border={false} background={'transparent'}>
+            {{
+              content: () => (
+                <div class={styles.woringHeader}>
+                  <div>
+                    <i
+                      onClick={() => {
+                        if (browser().isApp) {
+                          postMessage({
+                            api: 'goBack'
+                          });
+                        } else {
+                          router.back();
+                        }
+                      }}
+                      class={[
+                        'van-badge__wrapper van-icon van-icon-arrow-left van-nav-bar__arrow',
+                        styles.leftArrow
+                      ]}></i>
+                    <span class={styles.title2}>
+                      <i></i>
+                    </span>
+                  </div>
+                </div>
+              )
+            }}
+          </MHeader>
+          <div class={[styles.activationContainer, styles.recordContainer]}>
+            <i class={styles.iconBrid}></i>
+            <div class={styles.section}>
+              <MSearch
+                inputBackground="white"
+                shape="round"
+                placeholder="请输入互通码"
+                onSearch={(val: any) => {
+                  forms.code = val;
+                  forms.page = 1;
+                  state.list = [];
+                  state.finished = false;
+                  getList();
+                }}
+              />
+
+              <div class={styles.prodSection}>
+                <div class={styles.title}>周期选择</div>
+                <div
+                  class={[
+                    styles.times,
+                    state.showPopoverTime ? styles.active : ''
+                  ]}
+                  onClick={() => {
+                    state.showPopoverTime = true;
+                  }}>
+                  {dayjs(forms.activateStartTime).format('YYYY-MM-DD')}至
+                  {forms.activateEndTime}
+                </div>
+              </div>
+            </div>
+          </div>
+        </MSticky>
+
+        <div class={styles.sectionList}>
+          <List
+            loading={state.loading}
+            finished={state.finished}
+            finishedText=" "
+            onLoad={getList}
+            immediateCheck={false}>
+            {state.list.length > 0 &&
+              state.list.map((item: any) => (
+                <div class={styles.sectionItem}>
+                  <div class={styles.itemTitle}>
+                    <div class={styles.text}>
+                      乐器AI学练工具{item.times}
+                      {vipGiftPeriodType[item.type]}
+                    </div>
+                  </div>
+                  <div class={styles.itemCode}>{item.code}</div>
+                  <div class={styles.itemTime}>
+                    激活时间:
+                    <span>{dayjs(item.activateTime).format('YYYY-MM-DD')}</span>
+                  </div>
+                </div>
+              ))}
+          </List>
+
+          {!state.loading && state.list.length === 0 && (
+            <div style={{ height: '100%' }}>
+              <MEmpty description="暂无激活记录~" />
+            </div>
+          )}
+        </div>
+
+        <Calendar
+          v-model:show={state.showPopoverTime}
+          firstDayOfWeek={1}
+          safeAreaInsetBottom
+          type="range"
+          title="周期选择"
+          minDate={new Date('2023-02-27')}
+          defaultDate={[
+            dayjs(forms.activateStartTime).toDate(),
+            dayjs(forms.activateEndTime).toDate()
+          ]}
+          style={{
+            height: '70%'
+          }}
+          onConfirm={(item: any) => {
+            forms.activateStartTime = dayjs(item[0]).format('YYYY-MM-DD');
+            forms.activateEndTime = dayjs(item[1]).format('YYYY-MM-DD');
+            state.showPopoverTime = false;
+
+            forms.page = 1;
+            state.list = [];
+            state.finished = false;
+            getList();
+          }}
+        />
+      </div>
+    );
+  }
+});

+ 10 - 2
src/views/school-register/index.module.less

@@ -17,6 +17,12 @@
     height: 26Px;
     margin: 8px auto 0;
   }
+
+  :global {
+    .van-picker__loading {
+      top: calc(var(--van-picker-toolbar-height) + 15px + var(--van-search-input-height)) !important;
+    }
+  }
 }
 
 .title {
@@ -210,11 +216,13 @@
     }
   }
 }
+
 .sendBtn {
   width: 100Px;
 }
-.sendBtn:global(.van-button--disabled){
-  &::before{
+
+.sendBtn:global(.van-button--disabled) {
+  &::before {
     left: -5%;
     top: -15%;
     width: 110%;

+ 119 - 20
src/views/school-register/index.tsx

@@ -1,7 +1,16 @@
 import { defineComponent, onMounted, reactive, ref } from 'vue';
 import styles from './index.module.less';
 import MHeader from '@/components/m-header';
-import { Area, Button, CellGroup, Field, Form, Popup, showToast } from 'vant';
+import {
+  Area,
+  Button,
+  CellGroup,
+  Field,
+  Form,
+  Picker,
+  Popup,
+  showToast
+} from 'vant';
 import icon_school from './images/icon_school.png';
 import icon_person from './images/icon_person.png';
 import icon_submit from './images/icon_submit.png';
@@ -17,6 +26,8 @@ import {
 import { useRoute } from 'vue-router';
 import MImgCode from '@/components/m-img-code';
 import { browser } from '@/helpers/utils';
+import request from '@/helpers/request';
+import MSearch from '@/components/m-search';
 
 export default defineComponent({
   name: 'SchoolRegister',
@@ -49,6 +60,7 @@ export default defineComponent({
     };
     const forms = reactive({
       id: '',
+      schoolAreaId: null as any,
       name: '', // 学校名称
       regionCode: '', // 所属区域
       cityCode: '', // 所属城市
@@ -79,6 +91,13 @@ export default defineComponent({
 
       inputFouce: 0
     });
+    const state = reactive({
+      schoolLoading: false,
+      schoolPopupIndex: [] as any,
+      schoolAreaList: [] as any,
+      schoolStatus: false,
+      schoolPopupShow: false
+    });
     const formateArea = (area: any[]) => {
       const province_list: { [_: string]: string } = {};
       const city_list: { [_: string]: string } = {};
@@ -136,6 +155,24 @@ export default defineComponent({
       }, 1000);
     };
     const formRef = ref();
+    const getSchoolAreaList = async (name?: string) => {
+      state.schoolLoading = true;
+      try {
+        const { data } = await request.post('/edu-app/open/schoolArea/list', {
+          data: {
+            name,
+            testFlag: true,
+            provinceCode: forms.provinceCode,
+            cityCode: forms.cityCode,
+            regionCode: forms.regionCode
+          }
+        });
+        state.schoolAreaList = data;
+      } catch {
+        //
+      }
+      state.schoolLoading = false;
+    };
     const handleSubmit = () => {
       forms.name = forms.name.trim();
       formRef.value
@@ -181,6 +218,27 @@ export default defineComponent({
               <Form ref={formRef}>
                 <CellGroup class={styles.group}>
                   <img src={icon_school} class={styles.icon} />
+
+                  <Field
+                    isLink
+                    border
+                    name="cityName"
+                    label="所属城市"
+                    placeholder="请选择"
+                    readonly
+                    inputAlign="right"
+                    v-model={data.cityName}
+                    onClick={() => {
+                      if (browserInfo.ios && data.inputFouce < 2) {
+                        data.inputFouce++;
+                        setTimeout(() => {
+                          data.showArea = true;
+                        }, 400);
+                      } else {
+                        data.showArea = true;
+                      }
+                    }}
+                    rules={[{ required: true, message: '请选择' }]}></Field>
                   <Field
                     border
                     name="name"
@@ -188,7 +246,9 @@ export default defineComponent({
                     rows="1"
                     autosize
                     // type="textarea"
-                    placeholder="请输入学校全称"
+                    isLink
+                    readonly
+                    placeholder="请选择学校全称"
                     inputAlign="right"
                     v-model={forms.name}
                     onUpdate:modelValue={(val: string) => {
@@ -206,27 +266,17 @@ export default defineComponent({
                     onFocus={() => {
                       data.inputFouce++;
                     }}
-                  />
-                  <Field
-                    isLink
-                    border
-                    name="cityName"
-                    label="所属城市"
-                    placeholder="请选择"
-                    readonly
-                    inputAlign="right"
-                    v-model={data.cityName}
                     onClick={() => {
-                      if (browserInfo.ios && data.inputFouce < 2) {
-                        data.inputFouce++;
-                        setTimeout(() => {
-                          data.showArea = true;
-                        }, 700);
-                      } else {
-                        data.showArea = true;
+                      if (!data.cityName) {
+                        showToast('请选择城市');
+                        return;
+                      }
+                      state.schoolStatus = true;
+                      if (forms.schoolAreaId) {
+                        state.schoolPopupIndex = [forms.schoolAreaId];
                       }
                     }}
-                    rules={[{ required: true, message: '请选择' }]}></Field>
+                  />
                   <Field center border name="schoolNature" label="办学性质">
                     {{
                       input: () => (
@@ -497,10 +547,59 @@ export default defineComponent({
                       .map((item: any) => item.text)
                       .join('-');
                     data.showArea = false;
+
+                    getSchoolAreaList();
                   }}
                 />
               </Popup>
 
+              {/* 互通学校 */}
+              <Popup
+                v-model:show={state.schoolStatus}
+                position="bottom"
+                // round
+                safeAreaInsetBottom
+                lazyRender={false}
+                class={'popupBottomSearch'}
+                onOpen={() => {
+                  state.schoolPopupShow = true;
+                }}
+                onClosed={() => {
+                  state.schoolPopupShow = false;
+                }}>
+                {state.schoolPopupShow && (
+                  <div>
+                    <Picker
+                      showToolbar
+                      v-model={state.schoolPopupIndex}
+                      columns={state.schoolAreaList}
+                      loading={state.schoolLoading}
+                      columnsFieldNames={{
+                        text: 'name',
+                        value: 'id'
+                      }}
+                      onCancel={() => (state.schoolStatus = false)}
+                      onConfirm={(val: any) => {
+                        const selectedOption = val.selectedOptions[0];
+                        forms.schoolAreaId = selectedOption.id;
+                        forms.name = selectedOption.name;
+                        state.schoolStatus = false;
+                      }}>
+                      {{
+                        'columns-top': (
+                          <MSearch
+                            placeholder="请输入学校名称"
+                            onSearch={(val: any) => {
+                              getSchoolAreaList(val);
+                            }}
+                          />
+                        )
+                      }}
+                    </Picker>
+                  </div>
+                )}
+              </Popup>
+
               <Popup
                 class="popup-custom van-scale"
                 transition="van-scale"

二進制
src/views/student-register/images/new/icon-dengji.png


+ 13 - 1
src/views/student-register/modal/select-student/index.module.less

@@ -1,7 +1,7 @@
 .popupTitle {
   padding: 16px 0 20px;
   text-align: center;
-  font-weight: 500;
+  font-weight: 400;
   font-size: 18px;
   color: #131415;
   line-height: 25px;
@@ -14,6 +14,7 @@
   overflow-y: auto;
 
   .cell {
+    position: relative;
     display: flex;
     align-items: center;
     padding: 12px 10px;
@@ -58,6 +59,17 @@
       font-size: 16px;
       color: #131415;
       line-height: 22px;
+      display: flex;
+      align-items: center;
+    }
+
+    .tag {
+      margin-left: 5px;
+      display: inline-block;
+      width: 44px;
+      height: 18px;
+      background: url('../../images/new/icon-dengji.png') no-repeat center;
+      background-size: contain;
     }
 
     .schoolname {

+ 26 - 15
src/views/student-register/modal/select-student/index.tsx

@@ -14,6 +14,10 @@ export default defineComponent({
     studentItem: {
       type: Object,
       default: () => ({})
+    },
+    showAdd: {
+      type: Boolean,
+      default: true
     }
   },
   emits: ['close', 'confirm'],
@@ -67,7 +71,12 @@ export default defineComponent({
                 <Image src={item.avatar} class={styles.userImg} fit="cover" />
 
                 <div class={styles.usernames}>
-                  <div class={styles.name}>{item.nickname}</div>
+                  <div class={styles.name}>
+                    {item.nickname}
+                    {!props.showAdd && item.registerFlag && (
+                      <span class={styles.tag}></span>
+                    )}
+                  </div>
                   {item.schoolName && (
                     <div class={styles.schoolname}>{item.schoolName}</div>
                   )}
@@ -76,20 +85,22 @@ export default defineComponent({
             </div>
           ))}
         </RadioGroup>
-        <div class={styles.addStudentBtn}>
-          <Button
-            block
-            color="linear-gradient( 135deg, #31C7FF 0%, #007AFE 100%)"
-            onClick={() => {
-              //
-              // radioChecked.value = null;
-              emit('confirm', {});
-              // emit('close');
-            }}>
-            <i class={styles.iconAdd}></i>
-            <span>新增学生</span>
-          </Button>
-        </div>
+        {props.showAdd && (
+          <div class={styles.addStudentBtn}>
+            <Button
+              block
+              color="linear-gradient( 135deg, #31C7FF 0%, #007AFE 100%)"
+              onClick={() => {
+                //
+                // radioChecked.value = null;
+                emit('confirm', {});
+                // emit('close');
+              }}>
+              <i class={styles.iconAdd}></i>
+              <span>新增学生</span>
+            </Button>
+          </div>
+        )}
       </div>
     );
   }