84 lines
2.0 KiB
Vue
84 lines
2.0 KiB
Vue
<template>
|
|
<view class="auth-form-page">
|
|
<app-navbar title="注册" />
|
|
<view class="auth-form-page__body">
|
|
<text class="auth-form-page__heading">注册用户</text>
|
|
|
|
<base-input v-model="phone" icon="phone" type="number" placeholder="请输入手机号" :maxlength="11" />
|
|
<base-input v-model="code" icon="shield" type="number" placeholder="请输入验证码" :maxlength="6">
|
|
<template #suffix>
|
|
<sms-code-btn :counting="counting" :seconds="seconds" @send="onSendCode" />
|
|
</template>
|
|
</base-input>
|
|
<base-input v-model="password" icon="lock" type="password" placeholder="请输入密码" />
|
|
<base-input v-model="confirmPassword" icon="lock" type="password" placeholder="请确认密码" />
|
|
|
|
<text class="auth-form-page__hint">{{ passwordRuleHint }}</text>
|
|
|
|
<view class="auth-form-page__btn">
|
|
<primary-button text="立即注册" @click="submit" />
|
|
</view>
|
|
|
|
<view class="auth-form-page__agreement">
|
|
<agreement-checkbox v-model="agreed" />
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { PASSWORD_RULE_HINT } from '@/utils/validate'
|
|
import { useRegister } from './use-register'
|
|
|
|
const passwordRuleHint = `${PASSWORD_RULE_HINT}。`
|
|
|
|
const {
|
|
phone,
|
|
code,
|
|
password,
|
|
confirmPassword,
|
|
agreed,
|
|
counting,
|
|
seconds,
|
|
onSendCode,
|
|
submit,
|
|
} = useRegister()
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
.auth-form-page {
|
|
min-height: 100vh;
|
|
background: $color-bg-page;
|
|
}
|
|
|
|
.auth-form-page__body {
|
|
padding: 32rpx $page-padding-x 48rpx;
|
|
}
|
|
|
|
.auth-form-page__heading {
|
|
display: block;
|
|
font-size: 44rpx;
|
|
font-weight: 700;
|
|
color: $color-text;
|
|
margin-bottom: 48rpx;
|
|
}
|
|
|
|
.auth-form-page__hint {
|
|
display: block;
|
|
margin-top: 16rpx;
|
|
font-size: 24rpx;
|
|
color: $color-text-secondary;
|
|
line-height: 1.5;
|
|
}
|
|
|
|
.auth-form-page__btn {
|
|
margin-top: 16rpx;
|
|
margin-bottom: 40rpx;
|
|
}
|
|
|
|
.auth-form-page__agreement {
|
|
display: flex;
|
|
justify-content: center;
|
|
}
|
|
</style>
|