|
@@ -21,20 +21,21 @@ import {
|
|
|
showToast
|
|
|
} from 'vant';
|
|
|
import OWxTip from '@/components/m-wx-tip';
|
|
|
-import MProtocol from '@/components/m-protocol';
|
|
|
+// import MProtocol from '@/components/m-protocol';
|
|
|
import MImgCode from '@/components/m-img-code';
|
|
|
import { browser, checkPhone } from '@/helpers/utils';
|
|
|
import request from '@/helpers/request';
|
|
|
import { useStudentRegisterStore } from '@/store/modules/student-register-store';
|
|
|
-import { setLoginInit, state } from '@/state';
|
|
|
-import iconGift from '../images/icon-gift.png';
|
|
|
+// import { setLoginInit, state } from '@/state';
|
|
|
+// import iconGift from '../images/icon-gift.png';
|
|
|
import { useRoute, useRouter } from 'vue-router';
|
|
|
import MSticky from '@/components/m-sticky';
|
|
|
-import registerBgIcon from '../images/register-bg.png';
|
|
|
+// import registerBgIcon from '../images/register-bg.png';
|
|
|
import vipGiftIcon from '../images/vip-gift-icon.png';
|
|
|
-import agreeYes from '../images/agree-yes.png';
|
|
|
-import agreeNo from '../images/agree-no.png';
|
|
|
+// import agreeYes from '../images/agree-yes.png';
|
|
|
+// import agreeNo from '../images/agree-no.png';
|
|
|
import MMessageTip from '@/components/m-message-tip';
|
|
|
+import SelectStudent from '../modal/select-student';
|
|
|
|
|
|
const classList: any = [];
|
|
|
for (let i = 1; i <= 40; i++) {
|
|
@@ -44,9 +45,8 @@ for (let i = 1; i <= 40; i++) {
|
|
|
export default defineComponent({
|
|
|
name: 'register-new',
|
|
|
emits: ['close', 'submit'],
|
|
|
- setup(props, { emit }) {
|
|
|
+ setup() {
|
|
|
const route = useRoute();
|
|
|
- const router = useRouter();
|
|
|
const studentRegisterStore = useStudentRegisterStore();
|
|
|
// 初始化学校编号
|
|
|
studentRegisterStore.setShoolId(route.query.sId as any);
|
|
@@ -86,23 +86,46 @@ export default defineComponent({
|
|
|
imgCodeStatus: false,
|
|
|
gradeNumText: '',
|
|
|
currentClassText: '',
|
|
|
+ multi_user_limit: 1, // 限制注册学生数量
|
|
|
gradeStatus: false,
|
|
|
classStatus: false,
|
|
|
loading: false,
|
|
|
schoolId: route.query.sId as any,
|
|
|
+ showSelectStudent: false, // 选择学生
|
|
|
+ studentList: [], // 手机号关联学生列表
|
|
|
+ studentItem: {} as any, // 选择的学生
|
|
|
+ isRegister: 'create' as 'create' | 'update' | '', // 是否注册学生
|
|
|
+ isTipRegister: true, // 是否显示名字不一致 - 默认显示
|
|
|
+ isChangeSchool: false, // 是否切换学校
|
|
|
details: {} as any,
|
|
|
gradeYear: null,
|
|
|
schoolType: null,
|
|
|
- giftVipDay: null,
|
|
|
+ giftVipDay: null as any,
|
|
|
showTips: false,
|
|
|
showButton: false,
|
|
|
showMessage: '请使用微信打开',
|
|
|
+ gradePopupShow: false,
|
|
|
+ gradePopupIndex: [] as any, // 年级下拉索引
|
|
|
+ classPopupShow: false,
|
|
|
+ classPopupIndex: [] as any // 班级下拉索引
|
|
|
+ });
|
|
|
+ const otherParams = reactive({
|
|
|
showOtherSchool: false,
|
|
|
- showOtherMessage: ''
|
|
|
+ showOtherMessage: '',
|
|
|
+ /** limit 超限制,change 更换学生,nickname 名称不一致 */
|
|
|
+ otherType: '' as 'limit' | 'change' | 'nickname',
|
|
|
+ showCancelButton: true,
|
|
|
+ cancelButtonColor: '',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ showConfirmButton: true,
|
|
|
+ confirmButtonColor: '',
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ messageAlign: 'left' as 'center' | 'left' | 'right'
|
|
|
});
|
|
|
const isAgree = ref(false);
|
|
|
const studentInfo = reactive({
|
|
|
autoRegister: true,
|
|
|
+ multiUser: true, // 是否为多用户
|
|
|
client_id: 'cooleshow-student',
|
|
|
client_secret: 'cooleshow-student',
|
|
|
extra: {
|
|
@@ -127,6 +150,12 @@ export default defineComponent({
|
|
|
});
|
|
|
};
|
|
|
|
|
|
+ // 格式化提示状态
|
|
|
+ const changeTipStatus = (register: boolean, school: boolean) => {
|
|
|
+ forms.isTipRegister = register;
|
|
|
+ forms.isChangeSchool = school;
|
|
|
+ };
|
|
|
+
|
|
|
const onSendCode = () => {
|
|
|
// 发送验证码
|
|
|
if (!checkPhone(studentInfo.username)) {
|
|
@@ -134,6 +163,54 @@ export default defineComponent({
|
|
|
}
|
|
|
forms.imgCodeStatus = true;
|
|
|
};
|
|
|
+ // const getUserInfos = async () => {
|
|
|
+ // if (
|
|
|
+ // studentInfo.password.length !== 6 ||
|
|
|
+ // !checkPhone(studentInfo.username)
|
|
|
+ // ) {
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
+ // try {
|
|
|
+ // const { data } = await request.get(
|
|
|
+ // `/edu-app/open/student/studentInfo?mobile=${studentInfo.username}&code=${studentInfo.password}&type=REGISTER`
|
|
|
+ // );
|
|
|
+ // if (data) {
|
|
|
+ // if (!studentInfo.extra.nickname) {
|
|
|
+ // studentInfo.extra.nickname = data.nickname;
|
|
|
+ // }
|
|
|
+
|
|
|
+ // if (!studentInfo.extra.currentGradeNum) {
|
|
|
+ // studentInfo.extra.currentGradeNum = data.currentGradeNum;
|
|
|
+ // }
|
|
|
+
|
|
|
+ // if (!studentInfo.extra.currentClass) {
|
|
|
+ // studentInfo.extra.currentClass = data.currentClass;
|
|
|
+ // }
|
|
|
+ // // if (!studentInfo.extra.gender) {
|
|
|
+ // studentInfo.extra.gender =
|
|
|
+ // studentInfo.extra.gender !== data.gender
|
|
|
+ // ? data.gender
|
|
|
+ // : studentInfo.extra.gender;
|
|
|
+
|
|
|
+ // // studentInfo.username = data.nickname;
|
|
|
+
|
|
|
+ // classList.forEach((i: any) => {
|
|
|
+ // if (i.value === data.currentClass) {
|
|
|
+ // forms.currentClassText = i.text;
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+
|
|
|
+ // const tempGrade: any = gradeList.value[0] || [];
|
|
|
+ // tempGrade?.forEach((i: any) => {
|
|
|
+ // if (i.value === data.currentGradeNum) {
|
|
|
+ // forms.gradeNumText = i.text;
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ // } catch {
|
|
|
+ // //
|
|
|
+ // }
|
|
|
+ // };
|
|
|
const getUserInfos = async () => {
|
|
|
if (
|
|
|
studentInfo.password.length !== 6 ||
|
|
@@ -142,43 +219,40 @@ export default defineComponent({
|
|
|
return;
|
|
|
}
|
|
|
try {
|
|
|
- // 15907120131;
|
|
|
const { data } = await request.get(
|
|
|
`/edu-app/open/student/studentInfo?mobile=${studentInfo.username}&code=${studentInfo.password}&type=REGISTER`
|
|
|
);
|
|
|
- if (data) {
|
|
|
- if (!studentInfo.extra.nickname) {
|
|
|
- studentInfo.extra.nickname = data.nickname;
|
|
|
- }
|
|
|
-
|
|
|
- if (!studentInfo.extra.currentGradeNum) {
|
|
|
- studentInfo.extra.currentGradeNum = data.currentGradeNum;
|
|
|
- }
|
|
|
-
|
|
|
- if (!studentInfo.extra.currentClass) {
|
|
|
- studentInfo.extra.currentClass = data.currentClass;
|
|
|
- }
|
|
|
- // if (!studentInfo.extra.gender) {
|
|
|
- studentInfo.extra.gender =
|
|
|
- studentInfo.extra.gender !== data.gender
|
|
|
- ? data.gender
|
|
|
- : studentInfo.extra.gender;
|
|
|
-
|
|
|
- // studentInfo.username = data.nickname;
|
|
|
-
|
|
|
- classList.forEach((i: any) => {
|
|
|
- if (i.value === data.currentClass) {
|
|
|
- forms.currentClassText = i.text;
|
|
|
- }
|
|
|
- });
|
|
|
+ forms.studentList = data || [];
|
|
|
|
|
|
+ if (forms.studentList.length > 0) {
|
|
|
+ const firstStudent: any = forms.studentList[0];
|
|
|
+ forms.studentItem = firstStudent;
|
|
|
+ studentInfo.extra.nickname = firstStudent.nickname;
|
|
|
const tempGrade: any = gradeList.value[0] || [];
|
|
|
tempGrade?.forEach((i: any) => {
|
|
|
- if (i.value === data.currentGradeNum) {
|
|
|
+ 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;
|
|
|
+ // }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ 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(true, false);
|
|
|
+ forms.studentItem = [];
|
|
|
}
|
|
|
} catch {
|
|
|
//
|
|
@@ -194,36 +268,100 @@ export default defineComponent({
|
|
|
countDownRef.value.reset();
|
|
|
};
|
|
|
|
|
|
- const onSubmit = async (isRegister = false) => {
|
|
|
+ //
|
|
|
+ const checkSubmit = () => {
|
|
|
+ const { extra } = studentInfo;
|
|
|
+ if (
|
|
|
+ forms.studentItem.nickname !== extra.nickname &&
|
|
|
+ forms.isTipRegister
|
|
|
+ ) {
|
|
|
+ otherParams.showOtherMessage =
|
|
|
+ '学生姓名与上次提交信息不一致,请确认修改学生信息或创建新的学生账号';
|
|
|
+ otherParams.showOtherSchool = true;
|
|
|
+ otherParams.showCancelButton = 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.confirmButtonColor =
|
|
|
+ 'linear-gradient( 305deg, #40C8FF 0%, #3192FF 100%)';
|
|
|
+ otherParams.confirmButtonText = '我知道了';
|
|
|
+ otherParams.otherType = 'limit';
|
|
|
+ otherParams.messageAlign = 'center';
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 判断是否为同一个学校
|
|
|
+ if (
|
|
|
+ forms.studentItem.schoolId !== forms.details.id &&
|
|
|
+ !forms.isChangeSchool &&
|
|
|
+ forms.isRegister === 'update'
|
|
|
+ ) {
|
|
|
+ otherParams.showOtherMessage = `您已绑定【${
|
|
|
+ forms.details.name || ''
|
|
|
+ }】,提交后将更换到【${
|
|
|
+ forms.studentItem?.schoolName
|
|
|
+ }】,是否确认提交?`;
|
|
|
+ otherParams.showOtherSchool = true;
|
|
|
+ otherParams.showCancelButton = true;
|
|
|
+ otherParams.cancelButtonColor = '';
|
|
|
+ otherParams.cancelButtonText = '取消';
|
|
|
+ otherParams.confirmButtonColor = '';
|
|
|
+ otherParams.confirmButtonText = '确定';
|
|
|
+ otherParams.otherType = 'change';
|
|
|
+ otherParams.messageAlign = 'left';
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ };
|
|
|
+
|
|
|
+ const onSubmit = async () => {
|
|
|
try {
|
|
|
- if (checkForm()) return;
|
|
|
+ if (checkForm() || checkSubmit()) return;
|
|
|
forms.loading = true;
|
|
|
- if (!isRegister) {
|
|
|
- const checkSchool = await request.get(
|
|
|
- `/edu-app/open/student/studentSchool?mobile=${studentInfo.username}&code=${studentInfo.password}&type=REGISTER`
|
|
|
- );
|
|
|
- if (checkSchool.data?.schoolId !== forms.schoolId) {
|
|
|
- forms.showOtherSchool = true;
|
|
|
- forms.showOtherMessage = `您已绑定【${
|
|
|
- forms.details.name || ''
|
|
|
- }】,提交后将更换到【${
|
|
|
- checkSchool.data?.schoolName
|
|
|
- }】,是否确认提交?`;
|
|
|
- return;
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
- await request.get('/edu-app/open/student/schoolQuery', {
|
|
|
- params: {
|
|
|
- schoolId: forms.schoolId,
|
|
|
- mobile: studentInfo.username
|
|
|
- }
|
|
|
- });
|
|
|
- const { extra, ...res } = studentInfo;
|
|
|
+ // await request.get('/edu-app/open/student/schoolQuery', {
|
|
|
+ // params: {
|
|
|
+ // schoolId: forms.schoolId,
|
|
|
+ // mobile: studentInfo.username
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // const { extra, ...res } = studentInfo;
|
|
|
+ const { extra, loginType, autoRegister, password, multiUser, ...res } =
|
|
|
+ studentInfo;
|
|
|
+ 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', {
|
|
|
hideLoading: false,
|
|
|
requestType: 'form',
|
|
|
data: {
|
|
|
+ loginType: tLoginType,
|
|
|
+ autoRegister: tAutoRegister,
|
|
|
+ password: tPassword,
|
|
|
+ multiUser: tMultiUser,
|
|
|
...res,
|
|
|
extra: JSON.stringify({
|
|
|
...extra,
|
|
@@ -238,10 +376,18 @@ export default defineComponent({
|
|
|
} else {
|
|
|
setTimeout(() => {
|
|
|
showToast('报名成功');
|
|
|
- router.push('/download');
|
|
|
+ // router.push('/download');
|
|
|
}, 100);
|
|
|
+ setTimeout(() => {
|
|
|
+ if (browser().weixin) {
|
|
|
+ // 关闭微信
|
|
|
+ (window as any).WeixinJSBridge.call('closeWindow');
|
|
|
+ }
|
|
|
+ }, 1000);
|
|
|
}
|
|
|
} catch {
|
|
|
+ // 重置信息 - 如果是新建则不提示
|
|
|
+ changeTipStatus(forms.isRegister === 'create' ? false : true, false);
|
|
|
} finally {
|
|
|
forms.loading = false;
|
|
|
}
|
|
@@ -295,12 +441,34 @@ export default defineComponent({
|
|
|
} catch {}
|
|
|
};
|
|
|
|
|
|
- onMounted(() => {
|
|
|
- getRegisterGoods();
|
|
|
+ onMounted(async () => {
|
|
|
+ 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;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ await getRegisterGoods();
|
|
|
+ } catch {}
|
|
|
});
|
|
|
return () => (
|
|
|
<div class={styles.registerModal}>
|
|
|
- {forms.giftVipDay ? (
|
|
|
+ {/* {forms.giftVipDay ? (
|
|
|
<div class={styles.memberNumer}>
|
|
|
<img src={iconGift} class={styles.iconGift} />
|
|
|
|
|
@@ -311,167 +479,215 @@ export default defineComponent({
|
|
|
</div>
|
|
|
) : (
|
|
|
''
|
|
|
- )}
|
|
|
-
|
|
|
- <img class={styles.headBg} src={registerBgIcon} />
|
|
|
- <Form labelAlign="top" class={styles.registerForm}>
|
|
|
- <Field
|
|
|
- clearable={false}
|
|
|
- label="联系方式"
|
|
|
- placeholder="请输入手机号码"
|
|
|
- type="tel"
|
|
|
- autocomplete="off"
|
|
|
- class={styles.username}
|
|
|
- v-model={studentInfo.username}
|
|
|
- required
|
|
|
- input-align="right"
|
|
|
- maxlength={11}>
|
|
|
- {{
|
|
|
- label: () => (
|
|
|
- <div>
|
|
|
- 联系方式
|
|
|
- {/* (直接监护人) */}
|
|
|
- <p class={styles.tips}>(直接监护人)</p>
|
|
|
+ )} */}
|
|
|
+
|
|
|
+ <div class={styles.studentRegisterContainer}>
|
|
|
+ <div
|
|
|
+ class={[
|
|
|
+ styles.studentSection,
|
|
|
+ styles.studentSectionForm,
|
|
|
+ styles.noSendDay
|
|
|
+ ]}>
|
|
|
+ <div class={styles.title3}></div>
|
|
|
+ <Form labelAlign="left" class={styles.registerForm}>
|
|
|
+ <Field
|
|
|
+ clearable={false}
|
|
|
+ label="联系方式(直接监护人)"
|
|
|
+ placeholder="请输入手机号码"
|
|
|
+ type="tel"
|
|
|
+ required
|
|
|
+ autocomplete="off"
|
|
|
+ inputAlign="right"
|
|
|
+ class={styles.username}
|
|
|
+ v-model={studentInfo.username}
|
|
|
+ border={false}
|
|
|
+ maxlength={11}>
|
|
|
+ {{
|
|
|
+ label: () => (
|
|
|
+ <div>
|
|
|
+ 联系方式
|
|
|
+ <p class={styles.tips}>(直接监护人)</p>
|
|
|
+ </div>
|
|
|
+ )
|
|
|
+ }}
|
|
|
+ </Field>
|
|
|
+ <div class={['van-hairline--bottom', styles.fieldTipsGroup]}>
|
|
|
+ <div class={[styles.fieldTips]}>
|
|
|
+ 手机号是音乐数字课堂的唯一登录账户
|
|
|
</div>
|
|
|
- )
|
|
|
- }}
|
|
|
- </Field>
|
|
|
- <div class={[styles.fieldTipsGroup]}>
|
|
|
- <div class={[styles.fieldTips]}>
|
|
|
- 手机号是音乐数字课堂的唯一登录账户
|
|
|
- </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <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>
|
|
|
+ </Form>
|
|
|
</div>
|
|
|
- <Field
|
|
|
- center
|
|
|
- clearable={false}
|
|
|
- label="验证码"
|
|
|
- placeholder="请输入验证码"
|
|
|
- autocomplete="off"
|
|
|
- type="number"
|
|
|
- v-model={studentInfo.password}
|
|
|
- required
|
|
|
- input-align="right"
|
|
|
- maxlength={6}
|
|
|
- onUpdate:modelValue={(val: any) => {
|
|
|
- getUserInfos();
|
|
|
- }}>
|
|
|
- {{
|
|
|
- button: () =>
|
|
|
- forms.countDownStatus ? (
|
|
|
- <span
|
|
|
+ <div
|
|
|
+ class={[
|
|
|
+ styles.studentSection,
|
|
|
+ styles.studentSectionForm,
|
|
|
+ forms.giftVipDay <= 0 && styles.noSendDay
|
|
|
+ ]}>
|
|
|
+ <div class={styles.title1}></div>
|
|
|
+ <Form labelAlign="left" class={styles.registerForm}>
|
|
|
+ {/* 大于等于2,则可以切换学生 */}
|
|
|
+ {forms.studentList.length > 1 && (
|
|
|
+ <div
|
|
|
+ class={[
|
|
|
+ styles.selectStudentGroup,
|
|
|
+ forms.showSelectStudent && styles.selectStudentGroupChecked
|
|
|
+ ]}
|
|
|
+ onClick={() => (forms.showSelectStudent = true)}>
|
|
|
+ <i
|
|
|
class={[
|
|
|
- styles.codeText,
|
|
|
- !validatePhone.value ? styles.codeTextDisabled : ''
|
|
|
- ]}
|
|
|
- onClick={onSendCode}>
|
|
|
- 获取验证码
|
|
|
+ styles.studentIcon,
|
|
|
+ !forms.studentItem.userId && styles.studentIconAdd
|
|
|
+ ]}></i>
|
|
|
+ <span>
|
|
|
+ {forms.studentItem.userId
|
|
|
+ ? forms.studentItem.nickname
|
|
|
+ : '新增学生'}
|
|
|
</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}
|
|
|
- label="学生姓名"
|
|
|
- placeholder="请输入学生姓名"
|
|
|
- autocomplete="off"
|
|
|
- maxlength={14}
|
|
|
- v-model={studentInfo.extra.nickname}
|
|
|
- required
|
|
|
- input-align="right"
|
|
|
- />
|
|
|
- <Field
|
|
|
- clearable={false}
|
|
|
- label="学生性别"
|
|
|
- placeholder="请选择性别"
|
|
|
- autocomplete="off"
|
|
|
- required
|
|
|
- input-align="right"
|
|
|
- // v-model={studentInfo.extra.nickname}
|
|
|
- >
|
|
|
- {{
|
|
|
- input: () => (
|
|
|
- <RadioGroup
|
|
|
- checked-color="#ffcb75"
|
|
|
- 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}
|
|
|
- round>
|
|
|
- <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}
|
|
|
- round>
|
|
|
- <Radio class={styles.radioItem} name={0}></Radio>女
|
|
|
- </Tag>
|
|
|
- </RadioGroup>
|
|
|
- )
|
|
|
- }}
|
|
|
- </Field>
|
|
|
- <Field
|
|
|
- clearable={false}
|
|
|
- label="所在年级"
|
|
|
- placeholder="请选择年级"
|
|
|
- isLink
|
|
|
- readonly
|
|
|
- clickable={false}
|
|
|
- modelValue={forms.gradeNumText}
|
|
|
- onClick={() => (forms.gradeStatus = true)}
|
|
|
- required
|
|
|
- input-align="right"
|
|
|
- />
|
|
|
- <Field
|
|
|
- clearable={false}
|
|
|
- label="所在班级"
|
|
|
- placeholder="请选择班级"
|
|
|
- isLink
|
|
|
- readonly
|
|
|
- clickable={false}
|
|
|
- modelValue={forms.currentClassText}
|
|
|
- onClick={() => (forms.classStatus = true)}
|
|
|
- required
|
|
|
- input-align="right"
|
|
|
- />
|
|
|
- {studentInfo.extra.registerType === 'GIFT_VIP_DAY' &&
|
|
|
- forms.giftVipDay &&
|
|
|
- Number(forms.giftVipDay) > 0 ? (
|
|
|
- <div class={styles.giftTips}>
|
|
|
- <img src={vipGiftIcon} />
|
|
|
- <span>
|
|
|
- 注册成功即可获得乐器AI学练工具<i>{forms.giftVipDay}</i>天有效期
|
|
|
- </span>
|
|
|
- </div>
|
|
|
- ) : null}
|
|
|
- </Form>
|
|
|
+ </div>
|
|
|
+ )}
|
|
|
+ <Field
|
|
|
+ clearable={false}
|
|
|
+ label="学生姓名"
|
|
|
+ placeholder="请输入学生姓名"
|
|
|
+ autocomplete="off"
|
|
|
+ maxlength={14}
|
|
|
+ v-model={studentInfo.extra.nickname}
|
|
|
+ required
|
|
|
+ input-align="right"
|
|
|
+ />
|
|
|
+ <Field
|
|
|
+ clearable={false}
|
|
|
+ label="学生性别"
|
|
|
+ placeholder="请选择性别"
|
|
|
+ autocomplete="off"
|
|
|
+ required
|
|
|
+ input-align="right"
|
|
|
+ // v-model={studentInfo.extra.nickname}
|
|
|
+ >
|
|
|
+ {{
|
|
|
+ input: () => (
|
|
|
+ <RadioGroup
|
|
|
+ checked-color="#ffcb75"
|
|
|
+ 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}
|
|
|
+ round>
|
|
|
+ <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}
|
|
|
+ round>
|
|
|
+ <Radio class={styles.radioItem} name={0}></Radio>女
|
|
|
+ </Tag>
|
|
|
+ </RadioGroup>
|
|
|
+ )
|
|
|
+ }}
|
|
|
+ </Field>
|
|
|
+ <Field
|
|
|
+ clearable={false}
|
|
|
+ label="所在年级"
|
|
|
+ placeholder="请选择年级"
|
|
|
+ isLink
|
|
|
+ readonly
|
|
|
+ clickable={false}
|
|
|
+ modelValue={forms.gradeNumText}
|
|
|
+ onClick={() => {
|
|
|
+ forms.gradePopupIndex = [studentInfo.extra.currentGradeNum];
|
|
|
+ forms.gradeStatus = true;
|
|
|
+ }}
|
|
|
+ required
|
|
|
+ input-align="right"
|
|
|
+ />
|
|
|
+ <Field
|
|
|
+ clearable={false}
|
|
|
+ label="所在班级"
|
|
|
+ placeholder="请选择班级"
|
|
|
+ isLink
|
|
|
+ readonly
|
|
|
+ clickable={false}
|
|
|
+ modelValue={forms.currentClassText}
|
|
|
+ onClick={() => {
|
|
|
+ forms.classPopupIndex = [studentInfo.extra.currentClass];
|
|
|
+ forms.classStatus = true;
|
|
|
+ }}
|
|
|
+ required
|
|
|
+ input-align="right"
|
|
|
+ />
|
|
|
+ {studentInfo.extra.registerType === 'GIFT_VIP_DAY' &&
|
|
|
+ forms.giftVipDay &&
|
|
|
+ Number(forms.giftVipDay) > 0 ? (
|
|
|
+ <div class={styles.giftTips}>
|
|
|
+ <img src={vipGiftIcon} />
|
|
|
+ <span>
|
|
|
+ 注册成功即可获得乐器AI学练工具<i>{forms.giftVipDay}</i>
|
|
|
+ 天有效期
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ ) : null}
|
|
|
+ </Form>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
{/* <div class={styles.agreeColumn}>
|
|
|
<img src={isAgree.value ? agreeYes : agreeNo} onClick={() => (isAgree.value = !isAgree.value)} />
|
|
|
<p onClick={(e: MouseEvent) => {
|
|
@@ -486,16 +702,20 @@ export default defineComponent({
|
|
|
/> */}
|
|
|
|
|
|
<MSticky position="bottom">
|
|
|
- <Button
|
|
|
- type="primary"
|
|
|
- class={styles.submitBtn}
|
|
|
- color="linear-gradient( 135deg, #31C7FF 0%, #007AFE 100%)"
|
|
|
- block
|
|
|
- onClick={() => onSubmit()}
|
|
|
- disabled={forms.loading}
|
|
|
- loading={forms.loading}>
|
|
|
- 确认
|
|
|
- </Button>
|
|
|
+ <div class={styles.paymentContainer}>
|
|
|
+ <div class={styles.traditionBtn}>
|
|
|
+ <Button
|
|
|
+ type="primary"
|
|
|
+ class={styles.submitBtn}
|
|
|
+ color="linear-gradient( 135deg, #31C7FF 0%, #007AFE 100%)"
|
|
|
+ round
|
|
|
+ onClick={() => onSubmit()}
|
|
|
+ disabled={forms.loading}
|
|
|
+ loading={forms.loading}>
|
|
|
+ 提交注册
|
|
|
+ </Button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</MSticky>
|
|
|
|
|
|
{forms.imgCodeStatus ? (
|
|
@@ -517,38 +737,54 @@ export default defineComponent({
|
|
|
round
|
|
|
safeAreaInsetBottom
|
|
|
lazyRender={false}
|
|
|
- class={'popupBottomSearch'}>
|
|
|
- <Picker
|
|
|
- showToolbar
|
|
|
- columns={gradeList.value as any}
|
|
|
- modelValue={[studentInfo.extra.currentGradeNum]}
|
|
|
- onCancel={() => (forms.gradeStatus = false)}
|
|
|
- onConfirm={(val: any) => {
|
|
|
- const selectedOption = val.selectedOptions[0];
|
|
|
- studentInfo.extra.currentGradeNum = selectedOption.value;
|
|
|
- forms.gradeNumText = selectedOption.text;
|
|
|
- forms.gradeStatus = false;
|
|
|
- }}
|
|
|
- />
|
|
|
+ class={'popupBottomSearch'}
|
|
|
+ onOpen={() => {
|
|
|
+ forms.gradePopupShow = true;
|
|
|
+ }}
|
|
|
+ onClosed={() => {
|
|
|
+ forms.gradePopupShow = false;
|
|
|
+ }}>
|
|
|
+ {forms.gradePopupShow && (
|
|
|
+ <Picker
|
|
|
+ showToolbar
|
|
|
+ v-model={forms.gradePopupIndex}
|
|
|
+ columns={gradeList.value as any}
|
|
|
+ onCancel={() => (forms.gradeStatus = false)}
|
|
|
+ onConfirm={(val: any) => {
|
|
|
+ const selectedOption = val.selectedOptions[0];
|
|
|
+ studentInfo.extra.currentGradeNum = selectedOption.value;
|
|
|
+ forms.gradeNumText = selectedOption.text;
|
|
|
+ forms.gradeStatus = false;
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ )}
|
|
|
</Popup>
|
|
|
{/* 班级 */}
|
|
|
<Popup
|
|
|
v-model:show={forms.classStatus}
|
|
|
position="bottom"
|
|
|
round
|
|
|
- class={'popupBottomSearch'}>
|
|
|
- <Picker
|
|
|
- showToolbar
|
|
|
- columns={classList}
|
|
|
- modelValue={[studentInfo.extra.currentClass]}
|
|
|
- onCancel={() => (forms.classStatus = false)}
|
|
|
- onConfirm={(val: any) => {
|
|
|
- const selectedOption = val.selectedOptions[0];
|
|
|
- studentInfo.extra.currentClass = selectedOption.value;
|
|
|
- forms.currentClassText = selectedOption.text;
|
|
|
- forms.classStatus = false;
|
|
|
- }}
|
|
|
- />
|
|
|
+ class={'popupBottomSearch'}
|
|
|
+ onOpen={() => {
|
|
|
+ forms.classPopupShow = true;
|
|
|
+ }}
|
|
|
+ onClosed={() => {
|
|
|
+ forms.classPopupShow = false;
|
|
|
+ }}>
|
|
|
+ {forms.classPopupShow && (
|
|
|
+ <Picker
|
|
|
+ showToolbar
|
|
|
+ v-model={forms.classPopupIndex}
|
|
|
+ columns={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;
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ )}
|
|
|
</Popup>
|
|
|
{/* 是否在微信中打开 */}
|
|
|
<OWxTip
|
|
@@ -570,17 +806,97 @@ export default defineComponent({
|
|
|
/>
|
|
|
|
|
|
<MMessageTip
|
|
|
- show={forms.showOtherSchool}
|
|
|
- messageAlign="left"
|
|
|
- message={forms.showOtherMessage}
|
|
|
- showCancelButton
|
|
|
- onCancel={() => (forms.showOtherSchool = false)}
|
|
|
+ show={otherParams.showOtherSchool}
|
|
|
+ messageAlign={otherParams.messageAlign}
|
|
|
+ message={otherParams.showOtherMessage}
|
|
|
+ showCancelButton={otherParams.showCancelButton}
|
|
|
+ cancelButtonColor={otherParams.cancelButtonColor}
|
|
|
+ cancelButtonText={otherParams.cancelButtonText}
|
|
|
+ confirmButtonColor={otherParams.confirmButtonColor}
|
|
|
+ confirmButtonText={otherParams.confirmButtonText}
|
|
|
+ onCancel={() => {
|
|
|
+ otherParams.showOtherSchool = false;
|
|
|
+ if (otherParams.otherType === 'nickname') {
|
|
|
+ forms.isRegister = 'create'; // 新建
|
|
|
+ changeTipStatus(false, false);
|
|
|
+ onSubmit();
|
|
|
+ } else if (otherParams.otherType === 'limit') {
|
|
|
+ }
|
|
|
+ }}
|
|
|
onConfirm={() => {
|
|
|
- forms.showOtherSchool = false;
|
|
|
- // 直接注册
|
|
|
- onSubmit(true);
|
|
|
+ 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
|
|
|
+ );
|
|
|
+ }
|
|
|
}}
|
|
|
/>
|
|
|
+
|
|
|
+ <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) => {
|
|
|
+ forms.studentItem = val;
|
|
|
+ if (val.userId) {
|
|
|
+ const firstStudent = val;
|
|
|
+ studentInfo.extra.nickname = firstStudent.nickname;
|
|
|
+ const tempGrade: any = gradeList.value[0] || [];
|
|
|
+ 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;
|
|
|
+ // }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ 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);
|
|
|
+ studentInfo.extra.nickname = '';
|
|
|
+ studentInfo.extra.currentGradeNum = '';
|
|
|
+ studentInfo.extra.currentClass = '';
|
|
|
+ studentInfo.extra.gender = 1;
|
|
|
+ forms.currentClassText = '';
|
|
|
+ forms.gradeNumText = '';
|
|
|
+ }
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ </Popup>
|
|
|
</div>
|
|
|
);
|
|
|
}
|