修改测试问题

This commit is contained in:
guanj
2026-06-29 11:01:44 +08:00
parent f008bcb4b8
commit 1d73755a43
56 changed files with 2875 additions and 2702 deletions

View File

@@ -5,32 +5,18 @@
<template v-if="step == 1">
<uni-forms ref="form" :rules="rules" :modelValue="formData">
<uni-forms-item name="phone">
<uni-easyinput
type="number"
v-model="formData.phone"
maxlength="11"
placeholder="请输入手机号"
/>
<uni-easyinput type="number" v-model="formData.phone" maxlength="11" placeholder="请输入手机号" />
</uni-forms-item>
<uni-forms-item name="code">
<view class="login-box-input">
<uni-easyinput
type="text"
v-model="formData.code"
placeholder="请输入验证码"
maxlength="6"
/>
<view
class="ml40"
style="
<uni-easyinput type="text" v-model="formData.code" placeholder="请输入验证码" maxlength="6" />
<view class="ml40" style="
margin-left: 40rpx;
font-size: 28rpx;
color: #666;
width: 200rpx;
text-align: center;
"
v-if="waitTime > 0"
>{{ waitTime + 's后重新获取' }}
" v-if="waitTime > 0">{{ waitTime + 's后重新获取' }}
</view>
<button class="login-box-input-btn" v-else @click="getCode" size="mini">
获取验证码
@@ -38,16 +24,13 @@
</view>
</uni-forms-item>
</uni-forms>
<button type="default" class="submit-btn" @click="firstSubmit">注册</button>
<button type="default" class="submit-btn" :loading="loadingButton" :disabled="loadingButton"
@click="firstSubmit">注册</button>
<view class="login-box-tips">
<view style="color: #999"
><checkbox
style="transform: scale(0.7)"
:checked="checkbox"
@click="checkbox = !checkbox"
/>
我已阅读并同意</view
>
<view style="color: #999">
<checkbox style="transform: scale(0.7)" :checked="checkbox" @click="checkbox = !checkbox" />
我已阅读并同意
</view>
<navigator url="/pages/mine/agreement" hover-class="none">用户协议</navigator>
<navigator url="/pages/mine/policy" hover-class="none">隐私政策</navigator>
</view>
@@ -61,7 +44,8 @@
<uni-easyinput type="text" v-model="formData.password2" placeholder="请再次确认密码" />
</uni-forms-item>
</uni-forms>
<button type="default" class="submit-btn" @click="secondSubmit">提交</button>
<button type="default" class="submit-btn" :loading="loadingButton" :disabled="loadingButton"
@click="secondSubmit">提交</button>
<view class="login-box-tips">
<view style="color: #999">说明密码长度为6-18</view>
</view>
@@ -82,6 +66,7 @@ export default {
loading: false,
waitTime: 0,
inter: null,
loadingButton: false,
// 表单数据
formData: {
phone: '',
@@ -125,7 +110,7 @@ export default {
},
}
},
onLoad() {},
onLoad() { },
methods: {
getCode() {
if (!this.checkbox) {
@@ -163,7 +148,9 @@ export default {
if (!this.checkbox) {
return this.$util.toast('请先阅读并同意用户协议和隐私政策!')
}
this.$refs.form.validate().then((valid, errors) => {
this.loadingButton = true
apiRegister({
phone: this.formData.phone,
code: this.formData.code,
@@ -176,11 +163,14 @@ export default {
autoLogin(this.formData.phone).then((res) => {
this.$util.loginSuccess(res.data)
})
}).finally(() => {
this.loadingButton = false
})
})
},
secondSubmit() {
this.$refs.form.validate().then((valid, errors) => {
this.loadingButton = true
console.log(this.formData.password.length)
if (this.formData.password.length < 6 || this.formData.password.length > 18) {
return this.$util.toast('密码长度为6-18位')
@@ -197,6 +187,8 @@ export default {
uni.reLaunch({
url: '/pages/user/login',
})
}).finally(() => {
this.loadingButton = false
})
})
},