Files
xl-mobile/src/pages/register/index.vue

72 lines
2.2 KiB
Vue
Raw Normal View History

2025-03-25 16:35:39 +08:00
<script setup>
2025-03-26 19:10:41 +08:00
import {reactive} from "vue";
import XNav from "../../components/XNav.vue";
import BulletChat from "../login/BulletChat.vue";
import XInput from "../../components/XInput.vue";
import SendMsg from "../../components/SendMsg.vue";
2025-05-08 19:54:38 +08:00
import Api from "../../api/index.js";
2025-06-13 10:35:17 +08:00
import {showToast, verifyForm} from "../../utils/uils.js";
2025-03-25 16:35:39 +08:00
2025-03-26 19:10:41 +08:00
const form = reactive({
2025-05-08 19:54:38 +08:00
mobile: null,
wechat: null,
captcha: null,
2025-03-26 19:10:41 +08:00
password: null,
2025-05-08 19:54:38 +08:00
invite: null,
2025-03-26 19:10:41 +08:00
});
2025-06-13 10:35:17 +08:00
const rules = {
mobile: {
reg: /^1[3-9]\d{9}$/,
msg: '手机号错误'
},
wechat: {}
};
2025-05-08 19:54:38 +08:00
const success = async () => {
2025-06-13 10:35:17 +08:00
verifyForm(form, rules);
2025-05-08 19:54:38 +08:00
const {msg} = await Api.system.register(form);
showToast(msg);
2025-03-26 19:10:41 +08:00
}
2025-03-25 16:35:39 +08:00
</script>
<template>
<!--注册-->
2025-03-26 19:10:41 +08:00
<XNav></XNav>
<view class="h-[390rpx] relative overflow-hidden">
2025-05-08 19:54:38 +08:00
<image class="!absolute left-1/2 top-1/2 -translate-1/2 !w-[1198rpx] !h-[806rpx] !pb-[40rpx]"
2025-03-26 19:10:41 +08:00
src="/static/icons/bg.png"></image>
2025-03-25 16:35:39 +08:00
2025-05-08 19:54:38 +08:00
<view class="!flex gap-[16rpx] items-center !mt-[56rpx] !ml-[16rpx] relative z-10">
2025-03-26 19:10:41 +08:00
<image class="!w-[68rpx] !h-[68rpx]" src="/static/icons/hi.png"></image>
<view class="title">欢迎注册</view>
</view>
<BulletChat></BulletChat>
</view>
2025-05-08 19:54:38 +08:00
<view class="h-full bg-white !-mt-[20rpx] rounded-t-[20rpx] !pt-[44rpx] relative z-10">
2025-03-26 19:10:41 +08:00
<view class="!px-[34rpx] !flex flex-col gap-[40rpx]">
2025-05-08 19:54:38 +08:00
<x-input v-model:model-value="form.wechat" placeholder="请输入微信号"></x-input>
<x-input v-model:model-value="form.mobile" placeholder="请输入手机号"></x-input>
<send-msg v-model:model-value="form.captcha" :mobile="form.mobile"></send-msg>
2025-03-26 19:10:41 +08:00
<x-input v-model:model-value="form.password" placeholder="请输入登录密码"></x-input>
2025-05-08 19:54:38 +08:00
<x-input v-model:model-value="form.invite" placeholder="请输入邀请码"></x-input>
2025-03-26 19:10:41 +08:00
<tui-button class="!mt-[52rpx]" @click="success">确认注册</tui-button>
</view>
</view>
</template>
2025-03-25 16:35:39 +08:00
2025-03-26 19:10:41 +08:00
<style lang="scss" scoped>
.title {
color: rgb(29, 33, 41);
font-size: 26px;
font-weight: 700;
line-height: 28px;
letter-spacing: 0;
text-align: left;
}
2025-03-25 16:35:39 +08:00
</style>