继续修改登录,已完成账户密码登录
This commit is contained in:
parent
0f9a78b64c
commit
92d05778b9
56
config.js
56
config.js
@ -1,31 +1,31 @@
|
|||||||
// 应用全局配置
|
// 应用全局配置
|
||||||
const config = {
|
const config = {
|
||||||
// baseUrl: 'https://vue.ruoyi.vip/prod-api',
|
// baseUrl: 'https://vue.ruoyi.vip/prod-api',
|
||||||
// baseUrl: 'http://localhost/prod-api',
|
// baseUrl: 'http://localhost/prod-api',
|
||||||
baseUrl: 'https://ngtools.cn:8443',
|
baseUrl: 'https://ngtools.cn:8443',
|
||||||
//cloud后台网关地址
|
//cloud后台网关地址
|
||||||
// baseUrl: 'http://192.168.10.3:8080',
|
// baseUrl: 'http://192.168.10.3:8080',
|
||||||
// 应用信息
|
// 应用信息
|
||||||
appInfo: {
|
appInfo: {
|
||||||
// 应用名称
|
// 应用名称
|
||||||
name: "ruoyi-app-vue3",
|
name: "天然气工具箱",
|
||||||
// 应用版本
|
// 应用版本
|
||||||
version: "1.1.0",
|
version: "1.1.0",
|
||||||
// 应用logo
|
// 应用logo
|
||||||
logo: "/static/logo.png",
|
logo: "/static/logo.png",
|
||||||
// 官方网站
|
// 官方网站
|
||||||
site_url: "http://ruoyi.vip",
|
site_url: "http://ruoyi.vip",
|
||||||
// 政策协议
|
// 政策协议
|
||||||
agreements: [{
|
agreements: [{
|
||||||
title: "隐私政策",
|
title: "隐私政策",
|
||||||
url: "https://ruoyi.vip/protocol.html"
|
url: "https://ruoyi.vip/protocol.html"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "用户服务协议",
|
title: "用户服务协议",
|
||||||
url: "https://ruoyi.vip/protocol.html"
|
url: "https://ruoyi.vip/protocol.html"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default config
|
export default config
|
||||||
11
pages.json
11
pages.json
@ -261,15 +261,6 @@
|
|||||||
|
|
||||||
"root": "pages_system/pages",
|
"root": "pages_system/pages",
|
||||||
"pages": [{
|
"pages": [{
|
||||||
"path": "dict/index"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "dict/data",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "计算工具"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "register/index",
|
"path": "register/index",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "注册",
|
"navigationBarTitleText": "注册",
|
||||||
@ -278,7 +269,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "forgot/index",
|
"path": "forget/index",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "忘记密码",
|
"navigationBarTitleText": "忘记密码",
|
||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom"
|
||||||
|
|||||||
1078
pages/login.vue
1078
pages/login.vue
File diff suppressed because it is too large
Load Diff
@ -7,14 +7,14 @@
|
|||||||
<!-- 标况体积流量m³/s -->
|
<!-- 标况体积流量m³/s -->
|
||||||
<uni-forms-item :style="{ width: selectWidth + 'px' }" label="标况体积流量m³/s" name="dVFlowb">
|
<uni-forms-item :style="{ width: selectWidth + 'px' }" label="标况体积流量m³/s" name="dVFlowb">
|
||||||
<a-yjly-inputunit :modelValue="meterResult.dVFlowb" :unit-type="'volumeflow'"
|
<a-yjly-inputunit :modelValue="meterResult.dVFlowb" :unit-type="'volumeflow'"
|
||||||
v-model:unitOrder="meterResult.dVFlowUnit" :show-english-only="true" :decimal-places="5"
|
v-model:unitOrder="meterResult.dVFlowUnit" :show-english-only="true" :decimal-places="6"
|
||||||
:width="selectWidth" :input-disable="true" />
|
:width="selectWidth" :input-disable="true" />
|
||||||
</uni-forms-item>
|
</uni-forms-item>
|
||||||
|
|
||||||
<!-- 工况体积流量 -->
|
<!-- 工况体积流量 -->
|
||||||
<uni-forms-item :style="{ width: selectWidth + 'px' }" label="工况体积流量" name="dVFlowf">
|
<uni-forms-item :style="{ width: selectWidth + 'px' }" label="工况体积流量" name="dVFlowf">
|
||||||
<a-yjly-inputunit :modelValue="meterResult.dVFlowf" :unit-type="'volumeflow'"
|
<a-yjly-inputunit :modelValue="meterResult.dVFlowf" :unit-type="'volumeflow'"
|
||||||
v-model:unitOrder="meterResult.dVFlowWorkUnit" :show-english-only="true" :decimal-places="5"
|
v-model:unitOrder="meterResult.dVFlowWorkUnit" :show-english-only="true" :decimal-places="6"
|
||||||
:input-disable="true" :width="selectWidth" />
|
:input-disable="true" :width="selectWidth" />
|
||||||
</uni-forms-item>
|
</uni-forms-item>
|
||||||
|
|
||||||
@ -22,13 +22,13 @@
|
|||||||
<uni-forms-item :style="{ width: selectWidth + 'px' }" label="标况质量流量" name="dMFlowb">
|
<uni-forms-item :style="{ width: selectWidth + 'px' }" label="标况质量流量" name="dMFlowb">
|
||||||
<a-yjly-inputunit :modelValue="meterResult.dMFlowb" :unit-type="'massflow'"
|
<a-yjly-inputunit :modelValue="meterResult.dMFlowb" :unit-type="'massflow'"
|
||||||
v-model:unitOrder="meterResult.dMFlowUnit" :input-disable="true" :show-english-only="true"
|
v-model:unitOrder="meterResult.dMFlowUnit" :input-disable="true" :show-english-only="true"
|
||||||
:decimal-places="5" :width="selectWidth" />
|
:decimal-places="6" :width="selectWidth" />
|
||||||
</uni-forms-item>
|
</uni-forms-item>
|
||||||
|
|
||||||
<!-- 标况能量流量 -->
|
<!-- 标况能量流量 -->
|
||||||
<uni-forms-item :style="{ width: selectWidth + 'px' }" label="标况能量流量" name="dEFlowb">
|
<uni-forms-item :style="{ width: selectWidth + 'px' }" label="标况能量流量" name="dEFlowb">
|
||||||
<a-yjly-inputunit :modelValue="meterResult.dEFlowb" :unit-type="'energyflow'"
|
<a-yjly-inputunit :modelValue="meterResult.dEFlowb" :unit-type="'energyflow'"
|
||||||
v-model:unitOrder="meterResult.dEFlowUnit" :show-english-only="true" :decimal-places="5"
|
v-model:unitOrder="meterResult.dEFlowUnit" :show-english-only="true" :decimal-places="6"
|
||||||
:width="selectWidth" :input-disable="true" />
|
:width="selectWidth" :input-disable="true" />
|
||||||
</uni-forms-item>
|
</uni-forms-item>
|
||||||
<!-- 求超压缩因子 E -->
|
<!-- 求超压缩因子 E -->
|
||||||
|
|||||||
@ -1,524 +1,510 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="register-container">
|
<view class="register-container">
|
||||||
<view class="register-header">
|
<view class="register-header">
|
||||||
<text class="back-btn" @click="goBack">‹</text>
|
<text class="back-btn" @click="goBack">‹</text>
|
||||||
<text class="title">用户注册</text>
|
<text class="title">用户注册</text>
|
||||||
<view class="placeholder"></view>
|
<view class="placeholder"></view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="register-content">
|
<view class="register-content">
|
||||||
<view class="register-form">
|
<view class="register-form">
|
||||||
<view class="form-item">
|
<view class="form-item">
|
||||||
<text class="label">用户名</text>
|
<text class="label">用户名</text>
|
||||||
<input
|
<input v-model="registerForm.username" class="input" placeholder="请输入用户名"
|
||||||
v-model="registerForm.username"
|
placeholder-class="placeholder" />
|
||||||
class="input"
|
</view>
|
||||||
placeholder="请输入用户名"
|
|
||||||
placeholder-class="placeholder"
|
|
||||||
/>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view class="form-item">
|
<view class="form-item">
|
||||||
<text class="label">手机号</text>
|
<text class="label">手机号</text>
|
||||||
<input
|
<input v-model="registerForm.phone" class="input" type="number" placeholder="请输入手机号"
|
||||||
v-model="registerForm.phone"
|
placeholder-class="placeholder" />
|
||||||
class="input"
|
</view>
|
||||||
type="number"
|
|
||||||
placeholder="请输入手机号"
|
|
||||||
placeholder-class="placeholder"
|
|
||||||
/>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view class="form-item">
|
<view class="form-item">
|
||||||
<text class="label">验证码</text>
|
<text class="label">验证码</text>
|
||||||
<view class="code-input">
|
<view class="code-input">
|
||||||
<input
|
<input v-model="registerForm.code" class="input" type="number" placeholder="请输入验证码"
|
||||||
v-model="registerForm.code"
|
placeholder-class="placeholder" />
|
||||||
class="input"
|
<button class="send-code-btn" :disabled="countdown > 0" @click="sendCode">
|
||||||
type="number"
|
{{ countdown > 0 ? `${countdown}s` : '获取验证码' }}
|
||||||
placeholder="请输入验证码"
|
</button>
|
||||||
placeholder-class="placeholder"
|
</view>
|
||||||
/>
|
</view>
|
||||||
<button
|
|
||||||
class="send-code-btn"
|
|
||||||
:disabled="countdown > 0"
|
|
||||||
@click="sendCode"
|
|
||||||
>
|
|
||||||
{{ countdown > 0 ? `${countdown}s` : '获取验证码' }}
|
|
||||||
</button>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view class="form-item">
|
<view class="form-item">
|
||||||
<text class="label">密码</text>
|
<text class="label">密码</text>
|
||||||
<input
|
<input v-model="registerForm.password" class="input" password placeholder="请输入密码"
|
||||||
v-model="registerForm.password"
|
placeholder-class="placeholder" />
|
||||||
class="input"
|
</view>
|
||||||
password
|
|
||||||
placeholder="请输入密码"
|
|
||||||
placeholder-class="placeholder"
|
|
||||||
/>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view class="form-item">
|
<view class="form-item">
|
||||||
<text class="label">确认密码</text>
|
<text class="label">确认密码</text>
|
||||||
<input
|
<input v-model="registerForm.confirmPassword" class="input" password placeholder="请再次输入密码"
|
||||||
v-model="registerForm.confirmPassword"
|
placeholder-class="placeholder" />
|
||||||
class="input"
|
</view>
|
||||||
password
|
|
||||||
placeholder="请再次输入密码"
|
|
||||||
placeholder-class="placeholder"
|
|
||||||
/>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view class="form-item" v-if="registerForm.showEmail">
|
<view class="form-item" v-if="registerForm.showEmail">
|
||||||
<text class="label">邮箱</text>
|
<text class="label">邮箱</text>
|
||||||
<input
|
<input v-model="registerForm.email" class="input" type="email" placeholder="请输入邮箱(选填)"
|
||||||
v-model="registerForm.email"
|
placeholder-class="placeholder" />
|
||||||
class="input"
|
</view>
|
||||||
type="email"
|
|
||||||
placeholder="请输入邮箱(选填)"
|
|
||||||
placeholder-class="placeholder"
|
|
||||||
/>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view class="agreement">
|
<view class="agreement">
|
||||||
<checkbox-group @change="toggleAgreement">
|
<checkbox-group @change="toggleAgreement">
|
||||||
<label class="checkbox-label">
|
<label class="checkbox-label">
|
||||||
<checkbox :checked="agreed" color="#007aff" />
|
<checkbox :checked="agreed" color="#007aff" />
|
||||||
<text class="agreement-text">我已阅读并同意</text>
|
<text class="agreement-text">我已阅读并同意</text>
|
||||||
</label>
|
</label>
|
||||||
</checkbox-group>
|
</checkbox-group>
|
||||||
<text class="agreement-link" @click="showAgreement">《用户协议》</text>
|
<text class="agreement-link" @click="showAgreement">《用户协议》</text>
|
||||||
<text class="agreement-link" @click="showPrivacy">《隐私政策》</text>
|
<text class="agreement-link" @click="showPrivacy">《隐私政策》</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<button class="register-btn" @click="handleRegister" :disabled="registering">
|
<button class="register-btn" @click="handleRegister" :disabled="registering">
|
||||||
{{ registering ? '注册中...' : '注册' }}
|
{{ registering ? '注册中...' : '注册' }}
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<view class="login-link">
|
<view class="login-link">
|
||||||
<text>已有账号? </text>
|
<text>已有账号? </text>
|
||||||
<text class="link" @click="goLogin">立即登录</text>
|
<text class="link" @click="goLogin">立即登录</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 第三方注册 -->
|
<!-- 第三方注册 -->
|
||||||
<view class="third-register">
|
<view class="third-register">
|
||||||
<view class="divider">
|
<view class="divider">
|
||||||
<text class="divider-text">第三方注册</text>
|
<text class="divider-text">第三方注册</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="register-methods">
|
<view class="register-methods">
|
||||||
<view class="method-item" @click="handleWechatRegister">
|
<view class="method-item" @click="handleWechatRegister">
|
||||||
<view class="method-icon wechat">
|
<view class="method-icon wechat">
|
||||||
<text class="iconfont">💬</text>
|
<text class="iconfont">💬</text>
|
||||||
</view>
|
</view>
|
||||||
<text class="method-text">微信注册</text>
|
<text class="method-text">微信注册</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, reactive } from 'vue'
|
import {
|
||||||
import { onLoad, onShow } from '@dcloudio/uni-app'
|
ref,
|
||||||
import modal from '@/plugins/modal'
|
reactive
|
||||||
import { getCodeImg, login, sendPhoneCode, verifyPhoneCode } from '@/api/login'
|
} from 'vue'
|
||||||
import { getWxCode } from '@/utils/geek'
|
import {
|
||||||
import { wxLogin } from '@/api/oauth'
|
onLoad,
|
||||||
import useUserStore from '@/store/modules/user'
|
onShow
|
||||||
import { setToken } from '@/utils/auth'
|
} from '@dcloudio/uni-app'
|
||||||
import config from '@/config.js'
|
import modal from '@/plugins/modal'
|
||||||
const userStore = useUserStore()
|
import {
|
||||||
|
getCodeImg,
|
||||||
|
login,
|
||||||
|
sendPhoneCode,
|
||||||
|
verifyPhoneCode
|
||||||
|
} from '@/api/login'
|
||||||
|
import {
|
||||||
|
getWxCode
|
||||||
|
} from '@/utils/geek'
|
||||||
|
import {
|
||||||
|
wxLogin
|
||||||
|
} from '@/api/oauth'
|
||||||
|
import useUserStore from '@/store/modules/user'
|
||||||
|
import {
|
||||||
|
setToken
|
||||||
|
} from '@/utils/auth'
|
||||||
|
import config from '@/config.js'
|
||||||
|
const userStore = useUserStore()
|
||||||
|
|
||||||
// 响应式数据
|
// 响应式数据
|
||||||
const registering = ref(false)
|
const registering = ref(false)
|
||||||
const agreed = ref(false)
|
const agreed = ref(false)
|
||||||
const countdown = ref(0)
|
const countdown = ref(0)
|
||||||
let countdownTimer = null
|
let countdownTimer = null
|
||||||
|
|
||||||
// 注册表单
|
// 注册表单
|
||||||
const registerForm = reactive({
|
const registerForm = reactive({
|
||||||
username: '',
|
username: '',
|
||||||
phone: '',
|
phone: '',
|
||||||
code: '',
|
code: '',
|
||||||
password: '',
|
password: '',
|
||||||
confirmPassword: '',
|
confirmPassword: '',
|
||||||
email: '',
|
email: '',
|
||||||
showEmail: false
|
showEmail: false
|
||||||
})
|
})
|
||||||
|
|
||||||
// 发送验证码
|
// 发送验证码
|
||||||
const sendCode = async () => {
|
const sendCode = async () => {
|
||||||
if (!registerForm.phone) {
|
if (!registerForm.phone) {
|
||||||
modal.alert('请输入手机号')
|
modal.alert('请输入手机号')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!/^1[3-9]\d{9}$/.test(registerForm.phone)) {
|
if (!/^1[3-9]\d{9}$/.test(registerForm.phone)) {
|
||||||
modal.alert('请输入正确的手机号')
|
modal.alert('请输入正确的手机号')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await sendPhoneCode({ phone: registerForm.phone }, 'register')
|
await sendPhoneCode({
|
||||||
modal.alert('验证码已发送')
|
phone: registerForm.phone
|
||||||
|
}, 'register')
|
||||||
|
modal.alert('验证码已发送')
|
||||||
|
|
||||||
// 开始倒计时
|
// 开始倒计时
|
||||||
countdown.value = 60
|
countdown.value = 60
|
||||||
countdownTimer = setInterval(() => {
|
countdownTimer = setInterval(() => {
|
||||||
countdown.value--
|
countdown.value--
|
||||||
if (countdown.value <= 0) {
|
if (countdown.value <= 0) {
|
||||||
clearInterval(countdownTimer)
|
clearInterval(countdownTimer)
|
||||||
}
|
}
|
||||||
}, 1000)
|
}, 1000)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
modal.alert(error.message || '验证码发送失败')
|
modal.alert(error.message || '验证码发送失败')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 处理注册
|
// 处理注册
|
||||||
const handleRegister = async () => {
|
const handleRegister = async () => {
|
||||||
if (!validateForm()) return
|
if (!validateForm()) return
|
||||||
|
|
||||||
registering.value = true
|
registering.value = true
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// 验证验证码
|
// 验证验证码
|
||||||
await verifyPhoneCode({
|
await verifyPhoneCode({
|
||||||
phone: registerForm.phone,
|
phone: registerForm.phone,
|
||||||
code: registerForm.code
|
code: registerForm.code
|
||||||
}, 'register')
|
}, 'register')
|
||||||
|
|
||||||
// 执行注册
|
// 执行注册
|
||||||
const params = {
|
const params = {
|
||||||
username: registerForm.username,
|
username: registerForm.username,
|
||||||
password: registerForm.password,
|
password: registerForm.password,
|
||||||
phonenumber: registerForm.phone
|
phonenumber: registerForm.phone
|
||||||
}
|
}
|
||||||
|
|
||||||
if (registerForm.email) {
|
if (registerForm.email) {
|
||||||
params.email = registerForm.email
|
params.email = registerForm.email
|
||||||
}
|
}
|
||||||
|
|
||||||
const res = await register(params)
|
const res = await register(params)
|
||||||
|
|
||||||
if (res.token) {
|
if (res.token) {
|
||||||
setToken(res.token)
|
setToken(res.token)
|
||||||
await userStore.getInfo()
|
await userStore.getInfo()
|
||||||
modal.alert('注册成功', () => {
|
uni.switchTab({
|
||||||
uni.reLaunch({
|
url: '/pages/login'
|
||||||
url: '/pages/index'
|
});
|
||||||
})
|
}
|
||||||
})
|
} catch (error) {
|
||||||
}
|
modal.alert(error.message || '注册失败')
|
||||||
} catch (error) {
|
} finally {
|
||||||
modal.alert(error.message || '注册失败')
|
registering.value = false
|
||||||
} finally {
|
}
|
||||||
registering.value = false
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 表单验证
|
// 表单验证
|
||||||
const validateForm = () => {
|
const validateForm = () => {
|
||||||
if (!registerForm.username) {
|
if (!registerForm.username) {
|
||||||
modal.alert('请输入用户名')
|
modal.alert('请输入用户名')
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!registerForm.phone) {
|
if (!registerForm.phone) {
|
||||||
modal.alert('请输入手机号')
|
modal.alert('请输入手机号')
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!/^1[3-9]\d{9}$/.test(registerForm.phone)) {
|
if (!/^1[3-9]\d{9}$/.test(registerForm.phone)) {
|
||||||
modal.alert('请输入正确的手机号')
|
modal.alert('请输入正确的手机号')
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!registerForm.code) {
|
if (!registerForm.code) {
|
||||||
modal.alert('请输入验证码')
|
modal.alert('请输入验证码')
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!registerForm.password) {
|
if (!registerForm.password) {
|
||||||
modal.alert('请输入密码')
|
modal.alert('请输入密码')
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
if (registerForm.password.length < 6) {
|
if (registerForm.password.length < 6) {
|
||||||
modal.alert('密码长度不能少于6位')
|
modal.alert('密码长度不能少于6位')
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
if (registerForm.password !== registerForm.confirmPassword) {
|
if (registerForm.password !== registerForm.confirmPassword) {
|
||||||
modal.alert('两次输入的密码不一致')
|
modal.alert('两次输入的密码不一致')
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!agreed.value) {
|
if (!agreed.value) {
|
||||||
modal.alert('请同意用户协议和隐私政策')
|
modal.alert('请同意用户协议和隐私政策')
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
// 微信注册
|
// 微信注册
|
||||||
const handleWechatRegister = async () => {
|
const handleWechatRegister = async () => {
|
||||||
try {
|
try {
|
||||||
const code = await getWxCode()
|
const code = await getWxCode()
|
||||||
const res = await wxRegister('miniapp', code)
|
const res = await wxRegister('miniapp', code)
|
||||||
|
|
||||||
if (res.token) {
|
if (res.token) {
|
||||||
setToken(res.token)
|
setToken(res.token)
|
||||||
await userStore.getInfo()
|
await userStore.getInfo()
|
||||||
modal.alert('注册成功', () => {
|
modal.alert('注册成功', () => {
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
url: '/pages/index'
|
url: '/pages/index'
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
modal.alert(error.message || '微信注册失败')
|
modal.alert(error.message || '微信注册失败')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 切换协议同意状态
|
// 切换协议同意状态
|
||||||
const toggleAgreement = (e) => {
|
const toggleAgreement = (e) => {
|
||||||
agreed.value = e.detail.value.length > 0
|
agreed.value = e.detail.value.length > 0
|
||||||
}
|
}
|
||||||
|
|
||||||
// 显示用户协议
|
// 显示用户协议
|
||||||
const showAgreement = () => {
|
const showAgreement = () => {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages_system/pages/login/agreement?type=user'
|
url: '/pages_system/pages/login/agreement?type=user'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 显示隐私政策
|
// 显示隐私政策
|
||||||
const showPrivacy = () => {
|
const showPrivacy = () => {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages_system/pages/login/agreement?type=privacy'
|
url: '/pages_system/pages/login/agreement?type=privacy'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 返回登录页面
|
// 返回登录页面
|
||||||
const goBack = () => {
|
const goBack = () => {
|
||||||
uni.navigateBack()
|
uni.navigateBack()
|
||||||
}
|
}
|
||||||
|
|
||||||
const goLogin = () => {
|
const goLogin = () => {
|
||||||
uni.redirectTo({
|
uni.redirectTo({
|
||||||
url: '/pages/login'
|
url: '/pages/login'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 清理计时器
|
// 清理计时器
|
||||||
import { onUnmounted } from 'vue'
|
import {
|
||||||
onUnmounted(() => {
|
onUnmounted
|
||||||
if (countdownTimer) {
|
} from 'vue'
|
||||||
clearInterval(countdownTimer)
|
onUnmounted(() => {
|
||||||
}
|
if (countdownTimer) {
|
||||||
})
|
clearInterval(countdownTimer)
|
||||||
|
}
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.register-container {
|
.register-container {
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
background: #f5f5f5;
|
background: #f5f5f5;
|
||||||
}
|
}
|
||||||
|
|
||||||
.register-header {
|
.register-header {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
padding: 40rpx 30rpx;
|
padding: 40rpx 30rpx;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
border-bottom: 1rpx solid #e0e0e0;
|
border-bottom: 1rpx solid #e0e0e0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.back-btn {
|
.back-btn {
|
||||||
font-size: 50rpx;
|
font-size: 50rpx;
|
||||||
color: #333;
|
color: #333;
|
||||||
width: 60rpx;
|
width: 60rpx;
|
||||||
height: 60rpx;
|
height: 60rpx;
|
||||||
line-height: 60rpx;
|
line-height: 60rpx;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.title {
|
.title {
|
||||||
font-size: 36rpx;
|
font-size: 36rpx;
|
||||||
color: #333;
|
color: #333;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
.placeholder {
|
.placeholder {
|
||||||
width: 60rpx;
|
width: 60rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.register-content {
|
.register-content {
|
||||||
padding: 40rpx;
|
padding: 40rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.register-form {
|
.register-form {
|
||||||
background: #fff;
|
background: #fff;
|
||||||
border-radius: 20rpx;
|
border-radius: 20rpx;
|
||||||
padding: 40rpx;
|
padding: 40rpx;
|
||||||
margin-bottom: 40rpx;
|
margin-bottom: 40rpx;
|
||||||
box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.05);
|
box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.05);
|
||||||
}
|
}
|
||||||
|
|
||||||
.form-item {
|
.form-item {
|
||||||
margin-bottom: 30rpx;
|
margin-bottom: 30rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.label {
|
.label {
|
||||||
display: block;
|
display: block;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
color: #333;
|
color: #333;
|
||||||
margin-bottom: 10rpx;
|
margin-bottom: 10rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.input {
|
.input {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 80rpx;
|
height: 80rpx;
|
||||||
border: 2rpx solid #e0e0e0;
|
border: 2rpx solid #e0e0e0;
|
||||||
border-radius: 10rpx;
|
border-radius: 10rpx;
|
||||||
padding: 0 20rpx;
|
padding: 0 20rpx;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
.code-input {
|
.code-input {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 20rpx;
|
gap: 20rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.send-code-btn {
|
.send-code-btn {
|
||||||
width: 200rpx;
|
width: 200rpx;
|
||||||
height: 80rpx;
|
height: 80rpx;
|
||||||
background: #007aff;
|
background: #007aff;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
border: none;
|
border: none;
|
||||||
border-radius: 10rpx;
|
border-radius: 10rpx;
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
.send-code-btn[disabled] {
|
.send-code-btn[disabled] {
|
||||||
background: #ccc;
|
background: #ccc;
|
||||||
}
|
}
|
||||||
|
|
||||||
.agreement {
|
.agreement {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
margin: 40rpx 0;
|
margin: 40rpx 0;
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.checkbox-label {
|
.checkbox-label {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
margin-right: 10rpx;
|
margin-right: 10rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.agreement-text {
|
.agreement-text {
|
||||||
margin-left: 10rpx;
|
margin-left: 10rpx;
|
||||||
color: #666;
|
color: #666;
|
||||||
}
|
}
|
||||||
|
|
||||||
.agreement-link {
|
.agreement-link {
|
||||||
color: #007aff;
|
color: #007aff;
|
||||||
margin: 0 5rpx;
|
margin: 0 5rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.register-btn {
|
.register-btn {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 88rpx;
|
height: 88rpx;
|
||||||
background: #007aff;
|
background: #007aff;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
border: none;
|
border: none;
|
||||||
border-radius: 44rpx;
|
border-radius: 44rpx;
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
margin-bottom: 30rpx;
|
margin-bottom: 30rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.register-btn[disabled] {
|
.register-btn[disabled] {
|
||||||
background: #ccc;
|
background: #ccc;
|
||||||
}
|
}
|
||||||
|
|
||||||
.login-link {
|
.login-link {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
color: #666;
|
color: #666;
|
||||||
}
|
}
|
||||||
|
|
||||||
.link {
|
.link {
|
||||||
color: #007aff;
|
color: #007aff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.third-register {
|
.third-register {
|
||||||
background: #fff;
|
background: #fff;
|
||||||
border-radius: 20rpx;
|
border-radius: 20rpx;
|
||||||
padding: 40rpx;
|
padding: 40rpx;
|
||||||
box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.05);
|
box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.05);
|
||||||
}
|
}
|
||||||
|
|
||||||
.divider {
|
.divider {
|
||||||
position: relative;
|
position: relative;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin-bottom: 40rpx;
|
margin-bottom: 40rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.divider::before {
|
.divider::before {
|
||||||
content: '';
|
content: '';
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 50%;
|
top: 50%;
|
||||||
left: 0;
|
left: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
height: 1rpx;
|
height: 1rpx;
|
||||||
background: #e0e0e0;
|
background: #e0e0e0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.divider-text {
|
.divider-text {
|
||||||
background: #fff;
|
background: #fff;
|
||||||
padding: 0 20rpx;
|
padding: 0 20rpx;
|
||||||
color: #999;
|
color: #999;
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.register-methods {
|
.register-methods {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.method-item {
|
.method-item {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.method-icon {
|
.method-icon {
|
||||||
width: 100rpx;
|
width: 100rpx;
|
||||||
height: 100rpx;
|
height: 100rpx;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
margin-bottom: 10rpx;
|
margin-bottom: 10rpx;
|
||||||
font-size: 40rpx;
|
font-size: 40rpx;
|
||||||
background: #07c160;
|
background: #07c160;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.method-text {
|
.method-text {
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
color: #666;
|
color: #666;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
Loading…
Reference in New Issue
Block a user