|
@@ -26,13 +26,7 @@ import {
|
|
|
reactive,
|
|
|
ref
|
|
|
} from 'vue';
|
|
|
-import qs from 'query-string';
|
|
|
-import {
|
|
|
- state as baseState,
|
|
|
- goWechatAuth,
|
|
|
- setLogin,
|
|
|
- setLoginInit
|
|
|
-} from '@/state';
|
|
|
+import { setLogin, setLoginInit } from '@/state';
|
|
|
import styles from './index.module.less';
|
|
|
import MSticky from '@/components/m-sticky';
|
|
|
// import MVideo from '@/components/m-video';
|
|
@@ -40,25 +34,9 @@ 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 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 { useCountDown } from '@vant/use';
|
|
|
|
|
|
import MImgCode from '@/components/m-img-code';
|
|
|
import { useInterval, useIntervalFn } from '@vueuse/core';
|
|
@@ -542,7 +520,7 @@ export default defineComponent({
|
|
|
try {
|
|
|
// 15907120131;
|
|
|
const { data } = await request.get(
|
|
|
- `/edu-app/open/student/studentInfo?mobile=${studentInfo.username}&code=${studentInfo.password}&type=REGISTER`
|
|
|
+ `/edu-app/open/student/studentInfo?mobile=${studentInfo.username}&code=${studentInfo.password}&type=REGISTER&activationCodeFlag=1`
|
|
|
);
|
|
|
forms.studentList = data || [];
|
|
|
|
|
@@ -688,6 +666,86 @@ export default defineComponent({
|
|
|
return str;
|
|
|
};
|
|
|
|
|
|
+ // 获取地区学校详情
|
|
|
+ const getSchoolAreaDetail = async () => {
|
|
|
+ // open/schoolArea/detail/1815689916881935735
|
|
|
+ try {
|
|
|
+ const { data } = await request.get(
|
|
|
+ '/edu-app/open/schoolArea/detail/' + forms.schoolAreaId
|
|
|
+ );
|
|
|
+ console.log(data, 'data');
|
|
|
+
|
|
|
+ if (data.school) {
|
|
|
+ const schoolInfo = data.school || {};
|
|
|
+ const schoolInstrumentList = schoolInfo.schoolInstrumentList || [];
|
|
|
+ if (schoolInfo.schoolInstrumentSetType === 'SCHOOL') {
|
|
|
+ const instrumentCode = schoolInstrumentList[0]?.instrumentCode;
|
|
|
+ forms.gradeList = getGradeList(
|
|
|
+ schoolInfo.gradeYear,
|
|
|
+ instrumentCode
|
|
|
+ );
|
|
|
+ forms.classList = classList;
|
|
|
+ } else if (schoolInfo.schoolInstrumentSetType === 'GRADE') {
|
|
|
+ schoolInstrumentList.forEach((item: any) => {
|
|
|
+ forms.gradeList.push({
|
|
|
+ text: GRADE_ENUM[item.gradeNum],
|
|
|
+ value: item.gradeNum,
|
|
|
+ instrumentId: item.instrumentId,
|
|
|
+ instrumentCode: item.instrumentCode
|
|
|
+ });
|
|
|
+ });
|
|
|
+ forms.gradeList.sort((a: any, b: any) => a.value - b.value);
|
|
|
+ forms.classList = classList;
|
|
|
+ } else if (schoolInfo.schoolInstrumentSetType === 'CLASS') {
|
|
|
+ // 班级
|
|
|
+ const tempGradeList: any[] = [];
|
|
|
+ schoolInstrumentList.forEach((item: any) => {
|
|
|
+ if (!tempGradeList.includes(item.gradeNum)) {
|
|
|
+ tempGradeList.push(item.gradeNum);
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ const lastGradeList: any[] = [];
|
|
|
+ tempGradeList.forEach((temp: any) => {
|
|
|
+ const list = {
|
|
|
+ text: GRADE_ENUM[temp],
|
|
|
+ value: temp,
|
|
|
+ instrumentId: '',
|
|
|
+ instrumentCode: '',
|
|
|
+ instrumentName: '',
|
|
|
+ classList: [] as any
|
|
|
+ };
|
|
|
+ schoolInstrumentList.forEach((item: any) => {
|
|
|
+ if (temp === item.gradeNum) {
|
|
|
+ list.instrumentId = item.instrumentId;
|
|
|
+ list.instrumentCode = item.instrumentCode;
|
|
|
+ list.instrumentName = item.instrumentName;
|
|
|
+ list.classList.push({
|
|
|
+ text: item.classNum + '班',
|
|
|
+ value: item.classNum,
|
|
|
+ instrumentCode: item.instrumentCode
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ // 排序班级
|
|
|
+ list.classList.sort((a: any, b: any) => a.value - b.value);
|
|
|
+ lastGradeList.push(list);
|
|
|
+ });
|
|
|
+ lastGradeList.sort((a: any, b: any) => a.value - b.value);
|
|
|
+ forms.gradeList = lastGradeList;
|
|
|
+ forms.classList = [];
|
|
|
+ } else {
|
|
|
+ forms.gradeList = getGradeList(schoolInfo.gradeYear);
|
|
|
+ forms.classList = classList;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ forms.gradeList = getGradeList();
|
|
|
+ forms.classList = classList;
|
|
|
+ }
|
|
|
+ } catch {
|
|
|
+ //
|
|
|
+ }
|
|
|
+ };
|
|
|
onMounted(async () => {
|
|
|
try {
|
|
|
const code: any = route.query.code;
|
|
@@ -792,7 +850,7 @@ export default defineComponent({
|
|
|
v-model={studentInfo.extra.nickname}>
|
|
|
{{
|
|
|
extra: () =>
|
|
|
- forms.studentList.length > 1 && (
|
|
|
+ forms.studentList.length >= 1 && (
|
|
|
<div
|
|
|
class={[
|
|
|
styles.selectStudentGroup,
|
|
@@ -1024,10 +1082,16 @@ export default defineComponent({
|
|
|
onCancel={() => (forms.schoolStatus = false)}
|
|
|
onConfirm={(val: any) => {
|
|
|
const selectedOption = val.selectedOptions[0];
|
|
|
- forms.schoolId = null;
|
|
|
+ forms.schoolId = selectedOption.schoolId || null;
|
|
|
forms.schoolAreaId = selectedOption.id;
|
|
|
forms.schoolName = selectedOption.name;
|
|
|
forms.schoolStatus = false;
|
|
|
+
|
|
|
+ forms.gradeNumText = '';
|
|
|
+ studentInfo.extra.currentGradeNum = null;
|
|
|
+ forms.currentClassText = '';
|
|
|
+ studentInfo.extra.currentClass = null;
|
|
|
+ getSchoolAreaDetail();
|
|
|
}}>
|
|
|
{{
|
|
|
'columns-top': (
|
|
@@ -1291,16 +1355,19 @@ export default defineComponent({
|
|
|
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.schoolId = null;
|
|
|
forms.schoolAreaId = null;
|
|
|
forms.schoolName = '';
|
|
|
+ forms.gradeNumText = '';
|
|
|
+ studentInfo.extra.currentGradeNum = null;
|
|
|
+ forms.currentClassText = '';
|
|
|
+ studentInfo.extra.currentClass = null;
|
|
|
|
|
|
getSchoolAreaList();
|
|
|
}}
|