|
@@ -25,6 +25,7 @@ import {
|
|
|
import { useRoute } from 'vue-router';
|
|
|
import { postMessage } from '@/helpers/native-message';
|
|
|
import Success from './component/success/index';
|
|
|
+import MImgCode from '@/components/m-img-code';
|
|
|
|
|
|
export default defineComponent({
|
|
|
name: 'SchoolRegister',
|
|
@@ -36,7 +37,7 @@ export default defineComponent({
|
|
|
provinceCode: '', // 所属省份
|
|
|
code: '', // 验证码
|
|
|
tenantId: route.query.tenantId || '', // 机构
|
|
|
- phone: null,
|
|
|
+ phone: null as any,
|
|
|
schoolId: route.query.schoolId || '', // 学校id
|
|
|
nickname: null,
|
|
|
gender: 1
|
|
@@ -48,7 +49,8 @@ export default defineComponent({
|
|
|
checked: true,
|
|
|
success: false,
|
|
|
areaList: {} as any,
|
|
|
- sendMsg: '获取验证码'
|
|
|
+ sendMsg: '获取验证码',
|
|
|
+ imgCodeStatus: false
|
|
|
});
|
|
|
const formateArea = (area: any[]) => {
|
|
|
const province_list: { [_: string]: string } = {};
|
|
@@ -86,7 +88,7 @@ export default defineComponent({
|
|
|
getAreaList();
|
|
|
});
|
|
|
/** 发送验证码 */
|
|
|
- const onSendSms = async () => {
|
|
|
+ const onSendSms = () => {
|
|
|
if (!forms.phone) {
|
|
|
showToast('请输入手机号码');
|
|
|
return;
|
|
@@ -95,6 +97,9 @@ export default defineComponent({
|
|
|
showToast('手机号码格式不正确');
|
|
|
return;
|
|
|
}
|
|
|
+ data.imgCodeStatus = true;
|
|
|
+ };
|
|
|
+ const onCodeSend = async (code: string) => {
|
|
|
if (data.sendMsg.includes('s')) return;
|
|
|
try {
|
|
|
await api_openSendSms({
|
|
@@ -112,8 +117,8 @@ export default defineComponent({
|
|
|
}
|
|
|
};
|
|
|
const onCountDown = () => {
|
|
|
- data.sendMsg = '30s';
|
|
|
- let count = 30;
|
|
|
+ data.sendMsg = '60s';
|
|
|
+ let count = 60;
|
|
|
let timer = setInterval(() => {
|
|
|
count--;
|
|
|
data.sendMsg = `${count}s`;
|
|
@@ -297,6 +302,17 @@ export default defineComponent({
|
|
|
v-model:show={data.success}>
|
|
|
<Success />
|
|
|
</Popup>
|
|
|
+
|
|
|
+ {data.imgCodeStatus ? (
|
|
|
+ <MImgCode
|
|
|
+ v-model:value={data.imgCodeStatus}
|
|
|
+ phone={forms.phone}
|
|
|
+ onClose={() => {
|
|
|
+ data.imgCodeStatus = false;
|
|
|
+ }}
|
|
|
+ onSendCode={onCodeSend}
|
|
|
+ />
|
|
|
+ ) : null}
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|