This commit is contained in:
cansnow
2025-11-27 03:55:38 +08:00
parent 1626f0c52a
commit 198c3dd4a5
24 changed files with 2043 additions and 201 deletions
+8 -8
View File
@@ -15,9 +15,9 @@
</u-input>
</u-form-item>
<u-form-item prop="phoneNumber" label="手机号码" v-if="userInfo.type == 'mobile'">
<u-input v-model="userInfo.phoneNumber" border="surround" placeholder="请输入手机号码" clearable>
<u-input v-model="userInfo.mobile" border="surround" placeholder="请输入手机号码" clearable>
<view slot="prefix" class="phoneNumber_areacode" @click="showPicker">
<text class="areacode_content">+{{ userInfo.areaCode }}</text>
<text class="areacode_content">+{{ userInfo.region }}</text>
<u-icon class="arrow_down" name="arrow-down"></u-icon>
</view>
</u-input>
@@ -50,15 +50,15 @@
data() {
return {
userInfo: {
phoneNumber: "",
mobile: "",
email: "",
areaCode: "86",
region: "86",
invitationCode: "",
type:'email',
type:'mobile',
},
checked: [true],
rules: {
phoneNumber: [{
mobile: [{
type: "string",
required: true,
message: "请输入手机号码",
@@ -88,7 +88,7 @@
const options = {
mobile: this.userInfo.mobile,
email: this.userInfo.email,
areaCode: `+${this.userInfo.areaCode}`,
region: `+${this.userInfo.region}`,
event: this.isRegister ? 'register' : "reset_pwd",
invitationCode: this.userInfo.invitationCode,
type:this.userInfo.type
@@ -118,7 +118,7 @@
this.$refs.AreaPicker.init();
},
chooseArea(areaCode) {
this.userInfo.areaCode = areaCode;
this.userInfo.region = areaCode;
},
},
};
+5 -5
View File
@@ -39,9 +39,9 @@
isRegister: false,
codeValue: "",
userInfo: {
phoneNumber: "",
mobile: "",
email:"",
areaCode: "",
region: "",
},
formData: {
password: "",
@@ -101,9 +101,9 @@
this.$refs.loginForm.validate().then((valid) => {
if (valid) {
const options = {
mobile: this.userInfo.phoneNumber,
email: this.userInfo.em,
areaCode: `+${this.userInfo.areaCode}`,
mobile: this.userInfo.mobile,
email: this.userInfo.email,
region: `+${this.userInfo.region}`,
code: this.codeValue,
password: this.formData.password,
platform: uni.$u.os(),
+6 -6
View File
@@ -50,9 +50,9 @@
comfirmEying: false,
codeValue: "",
userInfo: {
phoneNumber: "",
mobile: "",
email: "",
areaCode: "",
region: "",
nickname: "",
password: "",
confirmPassword: "",
@@ -135,9 +135,9 @@
platform: uni.$u.os(),
autoLogin: true,
...this.userInfo,
areaCode: `+${this.userInfo.areaCode}`,
region: `+${this.userInfo.region}`,
password: md5(this.userInfo.password),
mobile: this.userInfo.phoneNumber
mobile: this.userInfo.mobile
};
try {
await businessRegister(options);
@@ -162,11 +162,11 @@
saveLoginInfo() {
uni.setStorage({
key: "lastPhoneNumber",
data: this.userInfo.phoneNumber,
data: this.userInfo.mobile,
});
uni.setStorage({
key: "lastAreaCode",
data: this.userInfo.areaCode,
data: this.userInfo.region,
});
},
},
+12 -19
View File
@@ -5,17 +5,17 @@
</view>
<view class="title">验证码已发送至手机</view>
<view class="sub_title">
{{ `+${userInfo.areaCode} ${userInfo.phoneNumber}` }}
{{ `+${userInfo.region} ${userInfo.mobile}` }}
</view>
<view class="code_container">
<!-- <view class="code_title">请输入验证码</view> -->
<u-code-input fontSize="24" color="#000" :focus="true" v-model="codeValue" hairline space="16"
@finish="checkCode" />
<view class="code_des">
<text>
<text v-if="count > 0">
{{ `${count}s` }}
</text>
<text @click="getSmsAgain"> 重发验证码 </text>
</view>
</view>
@@ -23,16 +23,9 @@
</template>
<script>
import user from "../../../store/modules/user";
import {
businessSendSms,
businessVerifyCode
} from "@/api/login";
import {
SmsUserFor
} from "@/constant";
import {
checkLoginError
} from "@/util/common";
import { businessSendSms, businessVerifyCode } from "@/api/login";
import { SmsUserFor } from "@/constant";
import { checkLoginError } from "@/util/common";
let timer;
export default {
data() {
@@ -40,8 +33,8 @@ import {
codeValue: "",
count: 60,
userInfo: {
phoneNumber: "",
areaCode: "",
mobile: "",
region: "",
email: "",
code: "",
type: "email",
@@ -74,10 +67,10 @@ import {
},
checkCode(value) {
const options = {
mobile: this.userInfo.phoneNumber,
mobile: this.userInfo.mobile,
email: this.userInfo.email,
type: this.userInfo.type,
areaCode: `+${this.userInfo.areaCode}`,
region: `+${this.userInfo.region}`,
event: this.isRegister ? 'register' : 'reset_pwd',
code: value,
};
@@ -115,10 +108,10 @@ import {
getSmsAgain() {
if (this.count === 0) {
const options = {
mobile: this.userInfo.phoneNumber,
mobile: this.userInfo.mobile,
email: this.userInfo.email,
type: this.userInfo.type,
areaCode: `+${this.userInfo.areaCode}`,
region: `+${this.userInfo.region}`,
event: this.isRegister ? 'register' : 'reset_pwd',
};
businessSendSms(options)