|
@@ -41,7 +41,7 @@ for (let i = 1; i <= 40; i++) {
|
|
|
export default defineComponent({
|
|
|
name: 'register-modal',
|
|
|
emits: ['close', 'submit'],
|
|
|
- setup(props, { emit }) {
|
|
|
+ setup() {
|
|
|
const route = useRoute();
|
|
|
const router = useRouter();
|
|
|
const studentRegisterStore = useStudentRegisterStore();
|
|
@@ -103,7 +103,9 @@ export default defineComponent({
|
|
|
showMessage: '请使用微信打开',
|
|
|
showOtherSchool: false,
|
|
|
showOtherMessage: '',
|
|
|
+ gradePopupShow: false,
|
|
|
gradePopupIndex: [] as any, // 年级下拉索引
|
|
|
+ classPopupShow: false,
|
|
|
classPopupIndex: [] as any // 班级下拉索引
|
|
|
});
|
|
|
const otherParams = reactive({
|
|
@@ -121,6 +123,7 @@ export default defineComponent({
|
|
|
});
|
|
|
const studentInfo = reactive({
|
|
|
autoRegister: true,
|
|
|
+ multiUser: true, // 是否为多用户
|
|
|
client_id: 'cooleshow-student',
|
|
|
client_secret: 'cooleshow-student',
|
|
|
extra: {
|
|
@@ -165,18 +168,27 @@ export default defineComponent({
|
|
|
try {
|
|
|
if (checkForm() || checkSubmit()) return;
|
|
|
forms.loading = true;
|
|
|
-
|
|
|
- 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 { extra, ...res } = studentInfo;
|
|
|
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,
|
|
@@ -195,8 +207,14 @@ 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 {
|
|
|
// 重置信息 - 如果是新建则不提示
|
|
@@ -246,12 +264,8 @@ export default defineComponent({
|
|
|
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) => {
|
|
@@ -657,41 +671,54 @@ export default defineComponent({
|
|
|
round
|
|
|
safeAreaInsetBottom
|
|
|
lazyRender={false}
|
|
|
- class={'popupBottomSearch'}>
|
|
|
- <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;
|
|
|
- }}
|
|
|
- />
|
|
|
+ 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
|
|
|
- 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;
|
|
|
- }}
|
|
|
- // onChange={val => {
|
|
|
- // console.log(forms.classPopupIndex, 'classPopupIndex');
|
|
|
- // }}
|
|
|
- />
|
|
|
+ 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
|