121
This commit is contained in:
@@ -14,6 +14,9 @@
|
||||
<option value="1">男</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="input" v-if="isNeedCode">
|
||||
激活码:<input name="nick" placeholder="联系客服获取激活码" maxlength="50" class="ipt" type="text" v-model="code" />
|
||||
</div>
|
||||
<div class="input">
|
||||
<input type="button"" class=" btn btn-danger" value="注册角色" @click="SubRegInfo" />.
|
||||
<Abar href="/">返回首页</Abar>
|
||||
@@ -29,6 +32,9 @@ definePageMeta({
|
||||
|
||||
const nick = ref('');
|
||||
const sex = ref(0);
|
||||
const code = ref('');
|
||||
const isNeedCode = ref(false);
|
||||
const data = ref<any>({});
|
||||
|
||||
const SubRegInfo = async (): Promise<void> => {
|
||||
if (nick.value == null || nick.value == '') {
|
||||
@@ -36,9 +42,9 @@ const SubRegInfo = async (): Promise<void> => {
|
||||
return;
|
||||
}
|
||||
MessageExtend.LoadingToast("注册中...");
|
||||
let result = await LoginService.RegisterInfo(nick.value, sex.value);
|
||||
let result = await LoginService.RegisterInfo(nick.value, sex.value, code.value);
|
||||
MessageExtend.LoadingClose();
|
||||
if (result.code == 0) {
|
||||
if (result.code == 0) {
|
||||
PageExtend.Redirect("/map");
|
||||
}
|
||||
else {
|
||||
@@ -49,10 +55,24 @@ const SubRegInfo = async (): Promise<void> => {
|
||||
|
||||
onMounted(async () => {
|
||||
try {
|
||||
|
||||
await BindData();
|
||||
}
|
||||
finally {
|
||||
PageLoading.Close();
|
||||
}
|
||||
})
|
||||
|
||||
const BindData = async () => {
|
||||
let result = await PubService.GetOnAreaInfo();
|
||||
if (result.code == 0) {
|
||||
data.value = result.data;
|
||||
isNeedCode.value = result.data.isNeedCode == 1;
|
||||
}
|
||||
else {
|
||||
MessageExtend.ShowDialogEvent("提示", result.msg, () => {
|
||||
PageExtend.RedirectTo('/');
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user