|  | @@ -132,7 +132,7 @@ export default defineComponent({
 | 
	
		
			
				|  |  |        // bugGoods: false, // 是否购买AI
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |        isRegister: 'create' as 'create' | 'update' | '', // 是否注册学生
 | 
	
		
			
				|  |  | -      isTipRegister: true, // 是否显示名字不一致 - 默认显示
 | 
	
		
			
				|  |  | +      isTipRegister: false, // 是否显示名字不一致 - 默认显示
 | 
	
		
			
				|  |  |        isChangeSchool: false, // 是否切换学校
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |        registerType: '', // 报名类型
 | 
	
	
		
			
				|  | @@ -450,6 +450,9 @@ export default defineComponent({
 | 
	
		
			
				|  |  |        } 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;
 | 
	
	
		
			
				|  | @@ -509,17 +512,18 @@ export default defineComponent({
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |        // 判断是否为同一个学校
 | 
	
		
			
				|  |  |        if (
 | 
	
		
			
				|  |  | +        forms.studentItem.schoolId &&
 | 
	
		
			
				|  |  |          forms.studentItem.schoolId !== forms.registerDetails.schoolId &&
 | 
	
		
			
				|  |  |          !forms.isChangeSchool &&
 | 
	
		
			
				|  |  |          forms.isRegister === 'update'
 | 
	
		
			
				|  |  |        ) {
 | 
	
		
			
				|  |  |          otherParams.showOtherMessage = `您已绑定【${
 | 
	
		
			
				|  |  |            forms.studentItem?.schoolName || ''
 | 
	
		
			
				|  |  | -        }】,提交后将更换到【
 | 
	
		
			
				|  |  | -        <span style="color: #2B85FF">${
 | 
	
		
			
				|  |  | +        }】,提交后将更换到
 | 
	
		
			
				|  |  | +        <span style="color: #2B85FF">【${
 | 
	
		
			
				|  |  |            forms.registerDetails.schoolName || ''
 | 
	
		
			
				|  |  | -        }</span>
 | 
	
		
			
				|  |  | -        】,是否确认提交?`;
 | 
	
		
			
				|  |  | +        }】</span>
 | 
	
		
			
				|  |  | +        ,是否确认提交?`;
 | 
	
		
			
				|  |  |          otherParams.showOtherSchool = true;
 | 
	
		
			
				|  |  |          otherParams.showCloseButton = false;
 | 
	
		
			
				|  |  |          otherParams.showCancelButton = true;
 | 
	
	
		
			
				|  | @@ -637,6 +641,45 @@ export default defineComponent({
 | 
	
		
			
				|  |  |        }
 | 
	
		
			
				|  |  |      };
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +    const updateStudentInfo = async () => {
 | 
	
		
			
				|  |  | +      try {
 | 
	
		
			
				|  |  | +        const { extra, username } = studentInfo;
 | 
	
		
			
				|  |  | +        const registerResult = await request.post('/edu-app/student/register', {
 | 
	
		
			
				|  |  | +          data: {
 | 
	
		
			
				|  |  | +            schoolId: forms.schoolId,
 | 
	
		
			
				|  |  | +            clientType: 'STUDENT',
 | 
	
		
			
				|  |  | +            schoolVerify: true,
 | 
	
		
			
				|  |  | +            ...extra,
 | 
	
		
			
				|  |  | +            giftVipDay:
 | 
	
		
			
				|  |  | +              forms.detailVip.membershipDays || 0 + forms.giftVipDay || 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 = '团购时间已截止,感谢您的参与'; //result.message;
 | 
	
		
			
				|  |  | +            forms.showButton = false;
 | 
	
		
			
				|  |  | +          }
 | 
	
		
			
				|  |  | +          console.log('-----');
 | 
	
		
			
				|  |  | +          return false;
 | 
	
		
			
				|  |  | +        } else {
 | 
	
		
			
				|  |  | +          console.log('=====');
 | 
	
		
			
				|  |  | +          return true;
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +      } catch {}
 | 
	
		
			
				|  |  | +    };
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |      // 登记成功之后购买
 | 
	
		
			
				|  |  |      const onRegisterSubmit = async () => {
 | 
	
		
			
				|  |  |        try {
 | 
	
	
		
			
				|  | @@ -650,6 +693,9 @@ export default defineComponent({
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          // 传统方式
 | 
	
		
			
				|  |  |          if (forms.joinType === 'tradition') {
 | 
	
		
			
				|  |  | +          const updateStatus = await updateStudentInfo();
 | 
	
		
			
				|  |  | +          if (!updateStatus) return;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |            setTimeout(() => {
 | 
	
		
			
				|  |  |              showToast('报名成功');
 | 
	
		
			
				|  |  |              // router.push('/download');
 | 
	
	
		
			
				|  | @@ -666,10 +712,7 @@ export default defineComponent({
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          if (schoolInfo.data.hasBuyCourse && vipList.length > 0) {
 | 
	
		
			
				|  |  |            // forms.dialogConfirmStatus = true;
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -          // 15907121011
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -          otherParams.showOtherMessage = `该学员已购买会员,是否确认购买?`;
 | 
	
		
			
				|  |  | +          otherParams.showOtherMessage = `该学员已购买会员,是否再次购买?`;
 | 
	
		
			
				|  |  |            otherParams.showOtherSchool = true;
 | 
	
		
			
				|  |  |            otherParams.showCloseButton = false;
 | 
	
		
			
				|  |  |            otherParams.showCancelButton = true;
 | 
	
	
		
			
				|  | @@ -774,6 +817,8 @@ export default defineComponent({
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |            // 判断是否有完成订单 并且选择 自备
 | 
	
		
			
				|  |  |            if (isFinal && forms.joinType === 'tradition') {
 | 
	
		
			
				|  |  | +            const studentResult = await updateStudentInfo();
 | 
	
		
			
				|  |  | +            if (!studentResult) return;
 | 
	
		
			
				|  |  |              setTimeout(() => {
 | 
	
		
			
				|  |  |                showToast('您已通过数字化方式报名成功');
 | 
	
		
			
				|  |  |              }, 100);
 | 
	
	
		
			
				|  | @@ -792,20 +837,19 @@ export default defineComponent({
 | 
	
		
			
				|  |  |              return true;
 | 
	
		
			
				|  |  |            }
 | 
	
		
			
				|  |  |            if (isPadding && forms.joinType === 'digitalize') {
 | 
	
		
			
				|  |  | -            // 会选判断逻辑 -
 | 
	
		
			
				|  |  | -            await request.get(
 | 
	
		
			
				|  |  | -              '/edu-app/userPaymentOrder/registerStatus/' + forms.schoolId
 | 
	
		
			
				|  |  | -            );
 | 
	
		
			
				|  |  | -            // const vipList = studentRegisterStore.getVip;
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -            // if (schoolInfo.data.hasBuyCourse && vipList.length > 0) {
 | 
	
		
			
				|  |  | -            //   forms.dialogConfirmStatus = true;
 | 
	
		
			
				|  |  | -            //   return true;
 | 
	
		
			
				|  |  | -            // }
 | 
	
		
			
				|  |  |              // 最终确认,有待支付订单直接去支付,没有则才会创建订单
 | 
	
		
			
				|  |  | -            state.config = paddingConfig?.paymentConfig;
 | 
	
		
			
				|  |  | -            state.orderNo = paddingConfig?.orderNo;
 | 
	
		
			
				|  |  | -            await lastSubmit();
 | 
	
		
			
				|  |  | +            // state.config = paddingConfig?.paymentConfig;
 | 
	
		
			
				|  |  | +            // state.orderNo = paddingConfig?.orderNo;
 | 
	
		
			
				|  |  | +            // const updateStatus = await updateStudentInfo();
 | 
	
		
			
				|  |  | +            // if (!updateStatus) return;
 | 
	
		
			
				|  |  | +            // await lastSubmit();
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            // 为了处理,有待支付订单,然后后台改了金额,会导致金额不一致
 | 
	
		
			
				|  |  | +            forms.dialogConfig = paddingConfig;
 | 
	
		
			
				|  |  | +            const cancelStatus = await cancelPaymentOrder();
 | 
	
		
			
				|  |  | +            if (cancelStatus) {
 | 
	
		
			
				|  |  | +              await paymentContinue();
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  |              return true;
 | 
	
		
			
				|  |  |            }
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -842,7 +886,10 @@ export default defineComponent({
 | 
	
		
			
				|  |  |          await request.post(
 | 
	
		
			
				|  |  |            '/edu-app/userPaymentOrder/cancelPayment/' + orderNo
 | 
	
		
			
				|  |  |          );
 | 
	
		
			
				|  |  | -      } catch {}
 | 
	
		
			
				|  |  | +        return true;
 | 
	
		
			
				|  |  | +      } catch {
 | 
	
		
			
				|  |  | +        return false;
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  |      };
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      const paymentContinue = async () => {
 | 
	
	
		
			
				|  | @@ -872,6 +919,10 @@ export default defineComponent({
 | 
	
		
			
				|  |  |            });
 | 
	
		
			
				|  |  |          });
 | 
	
		
			
				|  |  |          // 创建订单
 | 
	
		
			
				|  |  | +        const updateStatus = await updateStudentInfo();
 | 
	
		
			
				|  |  | +        console.log(updateStatus, 'updateStatus');
 | 
	
		
			
				|  |  | +        if (!updateStatus) return;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |          const result = await request.post(
 | 
	
		
			
				|  |  |            '/edu-app/userPaymentOrder/executeOrder',
 | 
	
		
			
				|  |  |            {
 | 
	
	
		
			
				|  | @@ -1176,6 +1227,22 @@ export default defineComponent({
 | 
	
		
			
				|  |  |        } catch {}
 | 
	
		
			
				|  |  |      };
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +    /** 手机号变更时清空验证码信息,用户信息 */
 | 
	
		
			
				|  |  | +    const phoneChangeEmptyInfo = () => {
 | 
	
		
			
				|  |  | +      studentInfo.password = '';
 | 
	
		
			
				|  |  | +      studentInfo.extra.nickname = '';
 | 
	
		
			
				|  |  | +      studentInfo.extra.currentGradeNum = '';
 | 
	
		
			
				|  |  | +      studentInfo.extra.currentClass = '';
 | 
	
		
			
				|  |  | +      studentInfo.extra.gender = 1;
 | 
	
		
			
				|  |  | +      forms.currentClassText = '';
 | 
	
		
			
				|  |  | +      forms.gradeNumText = '';
 | 
	
		
			
				|  |  | +      forms.studentList = []; // 手机号关联学生列表
 | 
	
		
			
				|  |  | +      forms.studentItem = {}; // 选择的学生
 | 
	
		
			
				|  |  | +      forms.isRegister = 'create'; // 是否注册学生
 | 
	
		
			
				|  |  | +      forms.isTipRegister = false; // 是否显示名字不一致 - 默认显示
 | 
	
		
			
				|  |  | +      forms.isChangeSchool = false; // 是否切换学校
 | 
	
		
			
				|  |  | +    };
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |      onMounted(async () => {
 | 
	
		
			
				|  |  |        try {
 | 
	
		
			
				|  |  |          // 获取支付类型
 | 
	
	
		
			
				|  | @@ -1263,7 +1330,10 @@ export default defineComponent({
 | 
	
		
			
				|  |  |                  class={styles.username}
 | 
	
		
			
				|  |  |                  v-model={studentInfo.username}
 | 
	
		
			
				|  |  |                  border={false}
 | 
	
		
			
				|  |  | -                maxlength={11}>
 | 
	
		
			
				|  |  | +                maxlength={11}
 | 
	
		
			
				|  |  | +                onUpdate:modelValue={() => {
 | 
	
		
			
				|  |  | +                  phoneChangeEmptyInfo();
 | 
	
		
			
				|  |  | +                }}>
 | 
	
		
			
				|  |  |                  {{
 | 
	
		
			
				|  |  |                    label: () => (
 | 
	
		
			
				|  |  |                      <div>
 | 
	
	
		
			
				|  | @@ -1804,6 +1874,9 @@ export default defineComponent({
 | 
	
		
			
				|  |  |                const paymentConfig = forms.dialogConfig;
 | 
	
		
			
				|  |  |                state.config = paymentConfig?.paymentConfig;
 | 
	
		
			
				|  |  |                state.orderNo = paymentConfig?.orderNo;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +              const updateStatus = await updateStudentInfo();
 | 
	
		
			
				|  |  | +              if (!updateStatus) return;
 | 
	
		
			
				|  |  |                await lastSubmit();
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |            }}
 | 
	
	
		
			
				|  | @@ -1870,7 +1943,7 @@ export default defineComponent({
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          <MMessageTip
 | 
	
		
			
				|  |  |            show={otherParams.showOtherSchool}
 | 
	
		
			
				|  |  | -          showCloseButton={otherParams.showCloseButton}
 | 
	
		
			
				|  |  | +          // showCloseButton={otherParams.showCloseButton}
 | 
	
		
			
				|  |  |            messageAlign={otherParams.messageAlign}
 | 
	
		
			
				|  |  |            message={otherParams.showOtherMessage}
 | 
	
		
			
				|  |  |            showCancelButton={otherParams.showCancelButton}
 | 
	
	
		
			
				|  | @@ -1879,13 +1952,15 @@ export default defineComponent({
 | 
	
		
			
				|  |  |            confirmButtonColor={otherParams.confirmButtonColor}
 | 
	
		
			
				|  |  |            confirmButtonText={otherParams.confirmButtonText}
 | 
	
		
			
				|  |  |            onClose={() => (otherParams.showOtherSchool = false)}
 | 
	
		
			
				|  |  | -          onCancel={() => {
 | 
	
		
			
				|  |  | +          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();
 | 
	
	
		
			
				|  | @@ -1939,11 +2014,16 @@ export default defineComponent({
 | 
	
		
			
				|  |  |              list={forms.studentList}
 | 
	
		
			
				|  |  |              onClose={() => (forms.showSelectStudent = false)}
 | 
	
		
			
				|  |  |              onConfirm={(val: any) => {
 | 
	
		
			
				|  |  | -              forms.studentItem = val;
 | 
	
		
			
				|  |  |                if (val.userId) {
 | 
	
		
			
				|  |  | +                forms.studentItem = val;
 | 
	
		
			
				|  |  |                  const firstStudent = val;
 | 
	
		
			
				|  |  |                  studentInfo.extra.nickname = firstStudent.nickname;
 | 
	
		
			
				|  |  |                  const tempGrade: any = forms.gradeList || [];
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +                studentInfo.extra.currentGradeNum = null;
 | 
	
		
			
				|  |  | +                forms.gradeNumText = '';
 | 
	
		
			
				|  |  | +                forms.instrumentCode = '';
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |                  tempGrade?.forEach((i: any) => {
 | 
	
		
			
				|  |  |                    if (i.value === firstStudent.currentGradeNum) {
 | 
	
		
			
				|  |  |                      forms.instrumentCode = i.instrumentCode;
 | 
	
	
		
			
				|  | @@ -1955,6 +2035,10 @@ export default defineComponent({
 | 
	
		
			
				|  |  |                      }
 | 
	
		
			
				|  |  |                    }
 | 
	
		
			
				|  |  |                  });
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +                studentInfo.extra.currentClass = null;
 | 
	
		
			
				|  |  | +                forms.currentClassText = '';
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |                  forms.classList.forEach((i: any) => {
 | 
	
		
			
				|  |  |                    if (i.value === firstStudent.currentClass) {
 | 
	
		
			
				|  |  |                      forms.currentClassText = i.text;
 | 
	
	
		
			
				|  | @@ -1964,15 +2048,33 @@ export default defineComponent({
 | 
	
		
			
				|  |  |                  studentInfo.extra.gender = firstStudent.gender;
 | 
	
		
			
				|  |  |                  forms.isRegister = 'update';
 | 
	
		
			
				|  |  |                  changeTipStatus(true, false);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +                forms.showSelectStudent = false;
 | 
	
		
			
				|  |  |                } else {
 | 
	
		
			
				|  |  | -                forms.isRegister = 'create';
 | 
	
		
			
				|  |  | -                changeTipStatus(false, false);
 | 
	
		
			
				|  |  | -                studentInfo.extra.nickname = '';
 | 
	
		
			
				|  |  | -                studentInfo.extra.currentGradeNum = '';
 | 
	
		
			
				|  |  | -                studentInfo.extra.currentClass = '';
 | 
	
		
			
				|  |  | -                studentInfo.extra.gender = 1;
 | 
	
		
			
				|  |  | -                forms.currentClassText = '';
 | 
	
		
			
				|  |  | -                forms.gradeNumText = '';
 | 
	
		
			
				|  |  | +                // 判断新建学员是否上限了
 | 
	
		
			
				|  |  | +                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;
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  |                }
 | 
	
		
			
				|  |  |              }}
 | 
	
		
			
				|  |  |            />
 |