|
@@ -1,21 +1,22 @@
|
|
|
<template>
|
|
<template>
|
|
|
- <ie-page :safeAreaInsetBottom="false">
|
|
|
|
|
|
|
+ <ie-page bg-color="#F6F8FA" :safeAreaInsetBottom="false">
|
|
|
<ie-navbar title="完善信息"></ie-navbar>
|
|
<ie-navbar title="完善信息"></ie-navbar>
|
|
|
<uv-form labelPosition="left" :model="form" labelWidth="70px" ref="formRef">
|
|
<uv-form labelPosition="left" :model="form" labelWidth="70px" ref="formRef">
|
|
|
<content-card title="考生信息">
|
|
<content-card title="考生信息">
|
|
|
<uv-form-item label="学生姓名" prop="name" borderBottom required>
|
|
<uv-form-item label="学生姓名" prop="name" borderBottom required>
|
|
|
- <uv-input v-model="form.nickName" border="none" placeholder="请输入姓名" :custom-style="customStyle">
|
|
|
|
|
|
|
+ <uv-input v-model="form.nickName" border="none" placeholder="请输入姓名" placeholderClass="text-30"
|
|
|
|
|
+ font-size="30rpx" :custom-style="customStyle">
|
|
|
</uv-input>
|
|
</uv-input>
|
|
|
</uv-form-item>
|
|
</uv-form-item>
|
|
|
<uv-form-item label="所在省份" prop="location" borderBottom required>
|
|
<uv-form-item label="所在省份" prop="location" borderBottom required>
|
|
|
<ie-picker ref="pickerRef" v-model="form.location" :list="appStore.provinceList" placeholder="选择省份"
|
|
<ie-picker ref="pickerRef" v-model="form.location" :list="appStore.provinceList" placeholder="选择省份"
|
|
|
- :custom-style="customStyle" key-label="dictLabel" key-value="dictValue"
|
|
|
|
|
- @change="handleProvinceChange"></ie-picker>
|
|
|
|
|
|
|
+ :custom-style="customStyle" key-label="dictLabel" key-value="dictValue" :disabled="isProvinceDisabled"
|
|
|
|
|
+ :show-arrow="!isProvinceDisabled" @change="handleProvinceChange"></ie-picker>
|
|
|
</uv-form-item>
|
|
</uv-form-item>
|
|
|
<uv-form-item label="考生类别" prop="examType" borderBottom required>
|
|
<uv-form-item label="考生类别" prop="examType" borderBottom required>
|
|
|
- <ie-picker ref="pickerRef" v-model="form.examType" :list="examTypeList" :disabled="!form.location"
|
|
|
|
|
|
|
+ <ie-picker ref="pickerRef" v-model="form.examType" :list="examTypeList" :disabled="isExamTypeDisabled"
|
|
|
placeholder="选择考生类别" :custom-style="customStyle" key-label="dictLabel" key-value="dictValue"
|
|
placeholder="选择考生类别" :custom-style="customStyle" key-label="dictLabel" key-value="dictValue"
|
|
|
- @change="handleExamTypeChange"></ie-picker>
|
|
|
|
|
|
|
+ :show-arrow="!isExamTypeDisabled" @change="handleExamTypeChange"></ie-picker>
|
|
|
</uv-form-item>
|
|
</uv-form-item>
|
|
|
<uv-form-item v-if="form.examType === 'VHS'" label="专业类别" prop="majorType" borderBottom required>
|
|
<uv-form-item v-if="form.examType === 'VHS'" label="专业类别" prop="majorType" borderBottom required>
|
|
|
<ie-picker ref="pickerRef" v-model="form.majorType" :list="majorTypes" :disabled="!form.examType"
|
|
<ie-picker ref="pickerRef" v-model="form.majorType" :list="majorTypes" :disabled="!form.examType"
|
|
@@ -23,51 +24,58 @@
|
|
|
@change="handleMajorChange"></ie-picker>
|
|
@change="handleMajorChange"></ie-picker>
|
|
|
</uv-form-item>
|
|
</uv-form-item>
|
|
|
<uv-form-item label="毕业年份" prop="year" required>
|
|
<uv-form-item label="毕业年份" prop="year" required>
|
|
|
- <ie-picker ref="pickerRef" v-model="form.endYear" :list="endYearList" placeholder="选择毕业年份"
|
|
|
|
|
- :custom-style="customStyle" key-label="dictLabel" key-value="dictValue"></ie-picker>
|
|
|
|
|
|
|
+ <ie-picker ref="pickerRef" v-model="form.endYear" :list="endYearList" :disabled="!form.examType"
|
|
|
|
|
+ placeholder="选择毕业年份" :custom-style="customStyle" key-label="dictLabel" key-value="dictValue"></ie-picker>
|
|
|
</uv-form-item>
|
|
</uv-form-item>
|
|
|
|
|
|
|
|
</content-card>
|
|
</content-card>
|
|
|
<content-card title="邀请信息">
|
|
<content-card title="邀请信息">
|
|
|
<uv-form-item label="邀请码" prop="form.inviteCode">
|
|
<uv-form-item label="邀请码" prop="form.inviteCode">
|
|
|
- <uv-input v-model="form.inviteCode" border="none" placeholder="请输入邀请码(非必填)" :custom-style="customStyle">
|
|
|
|
|
|
|
+ <uv-input v-model="form.inviteCode" border="none" placeholder="请输入邀请码(非必填)" font-size="30rpx"
|
|
|
|
|
+ :custom-style="customStyle">
|
|
|
</uv-input>
|
|
</uv-input>
|
|
|
</uv-form-item>
|
|
</uv-form-item>
|
|
|
</content-card>
|
|
</content-card>
|
|
|
<content-card title="文化素质">
|
|
<content-card title="文化素质">
|
|
|
- <uv-form-item label="语文" prop="form.scores.chinese" borderBottom>
|
|
|
|
|
- <uv-input v-model="scores.chinese" border="none" placeholder="满分100分" :custom-style="customStyle">
|
|
|
|
|
|
|
+ <uv-form-item label="语文" prop="form.scores.chinese" borderBottom :required="isImproveMode">
|
|
|
|
|
+ <uv-input v-model="scoresForm.chinese" border="none" type="number" placeholder="满分100分" font-size="30rpx"
|
|
|
|
|
+ :custom-style="customStyle">
|
|
|
</uv-input>
|
|
</uv-input>
|
|
|
</uv-form-item>
|
|
</uv-form-item>
|
|
|
- <uv-form-item label="数学" prop="form.score.mathematics" borderBottom>
|
|
|
|
|
- <uv-input v-model="scores.mathematics" border="none" placeholder="满分100分" :custom-style="customStyle">
|
|
|
|
|
|
|
+ <uv-form-item label="数学" prop="form.score.mathematics" borderBottom :required="isImproveMode">
|
|
|
|
|
+ <uv-input v-model="scoresForm.mathematics" border="none" type="number" placeholder="满分100分" font-size="30rpx"
|
|
|
|
|
+ :custom-style="customStyle">
|
|
|
</uv-input>
|
|
</uv-input>
|
|
|
</uv-form-item>
|
|
</uv-form-item>
|
|
|
- <uv-form-item label="外语" prop="form.scores.foreign" borderBottom>
|
|
|
|
|
- <uv-input v-model="scores.foreign" border="none" placeholder="满分100分" :custom-style="customStyle">
|
|
|
|
|
|
|
+ <uv-form-item label="外语" prop="form.scores.foreign" borderBottom :required="isImproveMode">
|
|
|
|
|
+ <uv-input v-model="scoresForm.foreign" border="none" type="number" placeholder="满分100分" font-size="30rpx"
|
|
|
|
|
+ :custom-style="customStyle">
|
|
|
</uv-input>
|
|
</uv-input>
|
|
|
</uv-form-item>
|
|
</uv-form-item>
|
|
|
- <uv-form-item label="物理" prop="form.scores.physics" borderBottom>
|
|
|
|
|
- <uv-input v-model="scores.physics" border="none" placeholder="满分100分" :custom-style="customStyle">
|
|
|
|
|
|
|
+ <uv-form-item label="物理" prop="form.scores.physics" borderBottom :required="isImproveMode">
|
|
|
|
|
+ <uv-input v-model="scoresForm.physics" border="none" type="number" placeholder="满分100分" font-size="30rpx"
|
|
|
|
|
+ :custom-style="customStyle">
|
|
|
</uv-input>
|
|
</uv-input>
|
|
|
</uv-form-item>
|
|
</uv-form-item>
|
|
|
- <uv-form-item label="政治" prop="form.scores.political">
|
|
|
|
|
- <uv-input v-model="scores.political" border="none" placeholder="满分100分" :custom-style="customStyle">
|
|
|
|
|
|
|
+ <uv-form-item label="政治" prop="form.scores.political" :required="isImproveMode">
|
|
|
|
|
+ <uv-input v-model="scoresForm.political" border="none" type="number" placeholder="满分100分" font-size="30rpx"
|
|
|
|
|
+ :custom-style="customStyle">
|
|
|
</uv-input>
|
|
</uv-input>
|
|
|
</uv-form-item>
|
|
</uv-form-item>
|
|
|
</content-card>
|
|
</content-card>
|
|
|
- <!-- <content-card title="学校信息">
|
|
|
|
|
- <uv-form-item label="学校名称" prop="form.name">
|
|
|
|
|
- <uv-input v-model="form.name" border="none" placeholder="请输入学校名称" :custom-style="customStyle">
|
|
|
|
|
- </uv-input>
|
|
|
|
|
|
|
+ <content-card v-if="isImproveMode" title="学校信息">
|
|
|
|
|
+ <uv-form-item label="学校名称" prop="form.name" borderBottom :required="isImproveMode">
|
|
|
|
|
+ <ie-picker ref="pickerRef" v-model="form.schoolName" :disabled="isSchoolDisabled" placeholder="请选择就读学校"
|
|
|
|
|
+ :custom-style="customStyle" :custom-label="form.schoolName" @click="handleSchoolSelect"
|
|
|
|
|
+ :show-arrow="!isSchoolDisabled"></ie-picker>
|
|
|
</uv-form-item>
|
|
</uv-form-item>
|
|
|
- <uv-form-item label="所在班级" prop="form.name">
|
|
|
|
|
- <uv-input v-model="form.name" border="none" placeholder="请输入所在班级" :custom-style="customStyle">
|
|
|
|
|
- </uv-input>
|
|
|
|
|
|
|
+ <uv-form-item label="所在班级" prop="form.name" :required="isImproveMode">
|
|
|
|
|
+ <ie-picker ref="pickerRef" v-model="form.classId" :list="classList" :disabled="!form.schoolId" title="选择班级"
|
|
|
|
|
+ placeholder="请选择所在班级" :custom-style="customStyle" key-label="name" key-value="classId"></ie-picker>
|
|
|
</uv-form-item>
|
|
</uv-form-item>
|
|
|
- </content-card> -->
|
|
|
|
|
|
|
+ </content-card>
|
|
|
</uv-form>
|
|
</uv-form>
|
|
|
- <ie-safe-toolbar :height="84">
|
|
|
|
|
|
|
+ <ie-safe-toolbar :height="84" :shadow="false">
|
|
|
<view class="px-18 py-16">
|
|
<view class="px-18 py-16">
|
|
|
<ie-button @click="handleSubmit">确认提交</ie-button>
|
|
<ie-button @click="handleSubmit">确认提交</ie-button>
|
|
|
</view>
|
|
</view>
|
|
@@ -80,69 +88,58 @@ import ContentCard from './components/content-card.vue';
|
|
|
import { useUserStore } from '@/store/userStore';
|
|
import { useUserStore } from '@/store/userStore';
|
|
|
import { } from '@/api/modules/login';
|
|
import { } from '@/api/modules/login';
|
|
|
import { getExamTypes, getExamMajors, getGraduateYears } from '@/api/modules/system';
|
|
import { getExamTypes, getExamMajors, getGraduateYears } from '@/api/modules/system';
|
|
|
-import { registry } from '@/api/modules/login';
|
|
|
|
|
|
|
+import { registry, improve } from '@/api/modules/login';
|
|
|
import { useTransferPage } from '@/hooks/useTransferPage';
|
|
import { useTransferPage } from '@/hooks/useTransferPage';
|
|
|
|
|
|
|
|
import { useAppStore } from '@/store/appStore';
|
|
import { useAppStore } from '@/store/appStore';
|
|
|
-import { useDictStore } from '@/store/dictStore';
|
|
|
|
|
-import config from "@/config";
|
|
|
|
|
-import { RegisterInfo, Scores } from '@/types/user';
|
|
|
|
|
|
|
+import { BindCardInfo, ClassItem, RegisterInfo, SchoolItem, Scores, StudentBindCardInfo } from '@/types/user';
|
|
|
import { DictItem } from '@/types';
|
|
import { DictItem } from '@/types';
|
|
|
|
|
+import { STUDENT_BIND_INFO } from '@/types/injectionSymbols';
|
|
|
|
|
+import { getClassList } from '@/api/modules/user';
|
|
|
const userStore = useUserStore();
|
|
const userStore = useUserStore();
|
|
|
const appStore = useAppStore();
|
|
const appStore = useAppStore();
|
|
|
-const dictStore = useDictStore();
|
|
|
|
|
-const { prevData, transferTo } = useTransferPage();
|
|
|
|
|
-// const endYearList = computed(() => {
|
|
|
|
|
-// return dictStore.getDictValues('end_year');
|
|
|
|
|
-// });
|
|
|
|
|
-
|
|
|
|
|
|
|
+const { prevData, transferTo, transferBack } = useTransferPage();
|
|
|
|
|
|
|
|
-const form = ref<Partial<RegisterInfo>>({});
|
|
|
|
|
-const scores = ref<Scores>({})
|
|
|
|
|
|
|
+// const form2 = ref<Partial<StudentBindCardInfo>>({});
|
|
|
|
|
+// provide(STUDENT_BIND_INFO, form2);
|
|
|
|
|
+const form = ref<Partial<BindCardInfo>>({});
|
|
|
|
|
+const scoresForm = ref<Scores>({})
|
|
|
const formRef = ref();
|
|
const formRef = ref();
|
|
|
-const rules = ref({
|
|
|
|
|
- name: [{ type: 'string', required: true, message: '请输入姓名', trigger: ['blur', 'change'] }],
|
|
|
|
|
- location: [{ type: 'string', required: true, message: '请选择省份', trigger: ['blur', 'change'] }],
|
|
|
|
|
- examType: [{ type: 'string', required: true, message: '请选择考生类别', trigger: ['blur', 'change'] }],
|
|
|
|
|
- majorType: [{ type: 'string', required: true, message: '请选择专业类别', trigger: ['blur', 'change'] }],
|
|
|
|
|
- endYear: [{ type: 'string', required: true, message: '请选择毕业年份', trigger: ['blur', 'change'] }],
|
|
|
|
|
-});
|
|
|
|
|
const customStyle = {
|
|
const customStyle = {
|
|
|
paddingLeft: '26px'
|
|
paddingLeft: '26px'
|
|
|
};
|
|
};
|
|
|
const examTypeList = ref<DictItem[]>([]);
|
|
const examTypeList = ref<DictItem[]>([]);
|
|
|
const endYearList = ref<DictItem[]>([]);
|
|
const endYearList = ref<DictItem[]>([]);
|
|
|
const majorTypes = ref<DictItem[]>([]);
|
|
const majorTypes = ref<DictItem[]>([]);
|
|
|
-
|
|
|
|
|
|
|
+const isImproveMode = computed(() => prevData.value.scene === 'phone_improve' || prevData.value.scene === 'card_improve');
|
|
|
|
|
+const isSchoolDisabled = computed(() => prevData.value.scene === 'card_improve' && prevData.value.card.assignSchoolId);
|
|
|
|
|
+const isProvinceDisabled = computed(() => prevData.value.scene === 'card_improve' && prevData.value.card.assignLocation);
|
|
|
|
|
+const isExamTypeDisabled = computed(() => (prevData.value.scene === 'card_improve' && prevData.value.card.assignExamType) || !form.value.location);
|
|
|
const handleProvinceChange = (val: string) => {
|
|
const handleProvinceChange = (val: string) => {
|
|
|
|
|
+ if (isProvinceDisabled.value) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
form.value.examType = '';
|
|
form.value.examType = '';
|
|
|
form.value.majorType = '';
|
|
form.value.majorType = '';
|
|
|
loadExamTypes();
|
|
loadExamTypes();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const handleExamTypeChange = (val: string) => {
|
|
const handleExamTypeChange = (val: string) => {
|
|
|
|
|
+ if (isExamTypeDisabled.value) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
form.value.majorType = '';
|
|
form.value.majorType = '';
|
|
|
loadMajorTypes();
|
|
loadMajorTypes();
|
|
|
loadGraduateYears();
|
|
loadGraduateYears();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-const handleShowExamTypePicker = () => {
|
|
|
|
|
- if (!form.value.location) {
|
|
|
|
|
- uni.$ie.showToast('请先选择省份');
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
const loadExamTypes = async () => {
|
|
const loadExamTypes = async () => {
|
|
|
|
|
+ console.log(111, form.value.location)
|
|
|
if (!form.value.location) {
|
|
if (!form.value.location) {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
getExamTypes(form.value.location).then(res => {
|
|
getExamTypes(form.value.location).then(res => {
|
|
|
examTypeList.value = res.data;
|
|
examTypeList.value = res.data;
|
|
|
- // if (examTypeList.value.length > 0) {
|
|
|
|
|
- // // 只有一个考生类别,自动选择
|
|
|
|
|
- // form.value.examType = examTypeList.value[0].dictValue as string;
|
|
|
|
|
- // }
|
|
|
|
|
}).catch(err => {
|
|
}).catch(err => {
|
|
|
console.log('获取考生类别失败', err)
|
|
console.log('获取考生类别失败', err)
|
|
|
});
|
|
});
|
|
@@ -165,10 +162,6 @@ const loadGraduateYears = async () => {
|
|
|
}
|
|
}
|
|
|
getGraduateYears(form.value.location, form.value.examType).then(res => {
|
|
getGraduateYears(form.value.location, form.value.examType).then(res => {
|
|
|
endYearList.value = res.data;
|
|
endYearList.value = res.data;
|
|
|
- if (endYearList.value.length > 0) {
|
|
|
|
|
- // 只有一个毕业年份,自动选择
|
|
|
|
|
- // form.value.endYear = endYearList.value[0].dictValue as string;
|
|
|
|
|
- }
|
|
|
|
|
}).catch(err => {
|
|
}).catch(err => {
|
|
|
console.log('获取毕业年份失败', err)
|
|
console.log('获取毕业年份失败', err)
|
|
|
});
|
|
});
|
|
@@ -178,17 +171,45 @@ const handleMajorChange = (val: string) => {
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+const classList = ref<ClassItem[]>([]);
|
|
|
|
|
+const handleSchoolSelect = () => {
|
|
|
|
|
+ if (isSchoolDisabled.value) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ transferTo('/pagesSystem/pages/school-select/school-select', {
|
|
|
|
|
+ data: form.value
|
|
|
|
|
+ }).then(res => {
|
|
|
|
|
+ const school = res as SchoolItem;
|
|
|
|
|
+ form.value.schoolId = school.id;
|
|
|
|
|
+ form.value.schoolName = school.name;
|
|
|
|
|
+ console.log(form.value)
|
|
|
|
|
+ form.value.classId = undefined;
|
|
|
|
|
+ classList.value = [];
|
|
|
|
|
+ handleGetClassList();
|
|
|
|
|
+ });
|
|
|
|
|
+}
|
|
|
|
|
+const handleGetClassList = () => {
|
|
|
|
|
+ if (!form.value.schoolId) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ getClassList({ schoolId: form.value.schoolId }).then(res => {
|
|
|
|
|
+ classList.value = res.data;
|
|
|
|
|
+ console.log(classList.value)
|
|
|
|
|
+ });
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
const loginValidate = () => {
|
|
const loginValidate = () => {
|
|
|
const { nickName, location, examType, endYear } = form.value;
|
|
const { nickName, location, examType, endYear } = form.value;
|
|
|
- if (!nickName) {
|
|
|
|
|
|
|
+ if (!nickName || nickName.trim() === '') {
|
|
|
uni.$ie.showToast('请输入姓名');
|
|
uni.$ie.showToast('请输入姓名');
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
- if (!location) {
|
|
|
|
|
|
|
+ if (!location || location.trim() === '') {
|
|
|
uni.$ie.showToast('请选择省份');
|
|
uni.$ie.showToast('请选择省份');
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
- if (!examType) {
|
|
|
|
|
|
|
+ if (!examType || examType.trim() === '') {
|
|
|
uni.$ie.showToast('请选择考生类别');
|
|
uni.$ie.showToast('请选择考生类别');
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
@@ -202,34 +223,161 @@ const loginValidate = () => {
|
|
|
uni.$ie.showToast('请选择毕业年份');
|
|
uni.$ie.showToast('请选择毕业年份');
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
|
|
+ if (isImproveMode.value) {
|
|
|
|
|
+ if (!scoresForm.value.chinese || scoresForm.value.chinese < 0 || scoresForm.value.chinese > 100) {
|
|
|
|
|
+ uni.$ie.showToast('请输入正确的语文成绩');
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if (isImproveMode.value) {
|
|
|
|
|
+ if (!scoresForm.value.mathematics || scoresForm.value.mathematics < 0 || scoresForm.value.mathematics > 100) {
|
|
|
|
|
+ uni.$ie.showToast('请输入正确的数学成绩');
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if (isImproveMode.value) {
|
|
|
|
|
+ if (!scoresForm.value.foreign || scoresForm.value.foreign < 0 || scoresForm.value.foreign > 100) {
|
|
|
|
|
+ uni.$ie.showToast('请输入正确的外语成绩');
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if (isImproveMode.value) {
|
|
|
|
|
+ if (!scoresForm.value.physics || scoresForm.value.physics < 0 || scoresForm.value.physics > 100) {
|
|
|
|
|
+ uni.$ie.showToast('请输入正确的物理成绩');
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if (isImproveMode.value) {
|
|
|
|
|
+ if (!scoresForm.value.political || scoresForm.value.political < 0 || scoresForm.value.political > 100) {
|
|
|
|
|
+ uni.$ie.showToast('请输入正确的政治成绩');
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if (isImproveMode.value) {
|
|
|
|
|
+ if (!form.value.schoolId) {
|
|
|
|
|
+ uni.$ie.showToast('请选择学校');
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if (isImproveMode.value) {
|
|
|
|
|
+ if (!form.value.classId) {
|
|
|
|
|
+ uni.$ie.showToast('请选择班级');
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|
|
|
const handleSubmit = async () => {
|
|
const handleSubmit = async () => {
|
|
|
- console.log(form.value)
|
|
|
|
|
- // const valid = await formRef.value.validate();
|
|
|
|
|
- // const valid = await loginValidate();
|
|
|
|
|
const valid = loginValidate();
|
|
const valid = loginValidate();
|
|
|
if (valid) {
|
|
if (valid) {
|
|
|
- const { mobile, password, code, uuid } = prevData.value;
|
|
|
|
|
- const params = {
|
|
|
|
|
|
|
+ let params = {
|
|
|
...form.value,
|
|
...form.value,
|
|
|
- mobile,
|
|
|
|
|
- password,
|
|
|
|
|
- code,
|
|
|
|
|
- uuid,
|
|
|
|
|
- scores: scores.value,
|
|
|
|
|
|
|
+ scores: scoresForm.value,
|
|
|
};
|
|
};
|
|
|
- registry(params as RegisterInfo).then(res => {
|
|
|
|
|
- const token = res.token;
|
|
|
|
|
- if (token) {
|
|
|
|
|
-
|
|
|
|
|
|
|
+ try {
|
|
|
|
|
+ if (isImproveMode.value) {
|
|
|
|
|
+ const { cardNo, password } = prevData.value;
|
|
|
|
|
+ params = {
|
|
|
|
|
+ ...params,
|
|
|
|
|
+ username: cardNo,
|
|
|
|
|
+ password,
|
|
|
|
|
+ }
|
|
|
|
|
+ console.log('params', params)
|
|
|
|
|
+ if (prevData.value.scene === 'card_improve') {
|
|
|
|
|
+ uni.$ie.showLoading();
|
|
|
|
|
+ const { token } = await registry(params as BindCardInfo);
|
|
|
|
|
+ if (token) {
|
|
|
|
|
+ await userStore.login(token);
|
|
|
|
|
+ }
|
|
|
|
|
+ uni.$ie.hideLoading();
|
|
|
|
|
+ uni.$ie.showSuccess('登录成功');
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ transferTo('/pagesMain/pages/index/index', {
|
|
|
|
|
+ type: 'reLaunch'
|
|
|
|
|
+ });
|
|
|
|
|
+ }, 800);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ uni.$ie.showLoading();
|
|
|
|
|
+ await improve(params as BindCardInfo);
|
|
|
|
|
+ uni.$ie.hideLoading();
|
|
|
|
|
+ uni.$ie.showSuccess('绑定成功');
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ transferTo('/pagesMain/pages/index/index', {
|
|
|
|
|
+ type: 'reLaunch'
|
|
|
|
|
+ });
|
|
|
|
|
+ }, 800);
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ const { mobile, password, code, uuid } = prevData.value;
|
|
|
|
|
+ params = {
|
|
|
|
|
+ ...params,
|
|
|
|
|
+ mobile,
|
|
|
|
|
+ password,
|
|
|
|
|
+ code,
|
|
|
|
|
+ uuid,
|
|
|
|
|
+ }
|
|
|
|
|
+ uni.$ie.showLoading();
|
|
|
|
|
+ const { token } = await registry(params as RegisterInfo);
|
|
|
|
|
+ if (token) {
|
|
|
|
|
+ const isLogin = await userStore.login(token);
|
|
|
|
|
+ uni.$ie.hideLoading();
|
|
|
|
|
+ uni.$ie.showSuccess('登录成功');
|
|
|
|
|
+ if (isLogin) {
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ transferTo('/pagesMain/pages/index/index', {
|
|
|
|
|
+ type: 'reLaunch'
|
|
|
|
|
+ });
|
|
|
|
|
+ }, 88);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
- });
|
|
|
|
|
|
|
+ } catch (error) {
|
|
|
|
|
+ console.error(error)
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+const gatherInfo = () => {
|
|
|
|
|
+ const { scene, card, phone, code, uuid } = prevData.value;
|
|
|
|
|
+ console.log('prevData.value', prevData.value)
|
|
|
|
|
+ if (scene === 'card_improve') {
|
|
|
|
|
+ form.value = {
|
|
|
|
|
+ location: card.assignLocation,
|
|
|
|
|
+ examType: card.assignExamType,
|
|
|
|
|
+ endYear: card.endYear,
|
|
|
|
|
+ majorType: card.majorType,
|
|
|
|
|
+ schoolId: card.assignSchoolId,
|
|
|
|
|
+ schoolName: card.assignSchoolName,
|
|
|
|
|
+ classId: card.classId,
|
|
|
|
|
+ mobile: phone
|
|
|
|
|
+ // code
|
|
|
|
|
+ };
|
|
|
|
|
+ loadExamTypes();
|
|
|
|
|
+ handleGetClassList();
|
|
|
|
|
+ } else if (scene === 'phone_improve') {
|
|
|
|
|
+ const { nickName, location, examType, endYear, scores } = userStore.userInfo;
|
|
|
|
|
+ form.value = {
|
|
|
|
|
+ nickName,
|
|
|
|
|
+ location,
|
|
|
|
|
+ examType,
|
|
|
|
|
+ endYear,
|
|
|
|
|
+ scores
|
|
|
|
|
+ };
|
|
|
|
|
+ scoresForm.value = scores;
|
|
|
|
|
+ if (location) {
|
|
|
|
|
+ loadExamTypes();
|
|
|
|
|
+ }
|
|
|
|
|
+ if (examType) {
|
|
|
|
|
+ loadMajorTypes();
|
|
|
|
|
+ }
|
|
|
|
|
+ if (endYear) {
|
|
|
|
|
+ loadGraduateYears();
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
onLoad(() => {
|
|
onLoad(() => {
|
|
|
- console.log(prevData.value)
|
|
|
|
|
|
|
+ gatherInfo();
|
|
|
});
|
|
});
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|