|
|
@ -209,9 +209,9 @@ |
|
|
</text> |
|
|
</text> |
|
|
|
|
|
|
|
|
<!-- 或者 --> |
|
|
<!-- 或者 --> |
|
|
<text class="or-text" @click="goToLogin">已有账号? |
|
|
|
|
|
<text class="link">登录 |
|
|
|
|
|
</text> |
|
|
|
|
|
|
|
|
<text class="or-text" @click="goToLogin" |
|
|
|
|
|
>已有账号? |
|
|
|
|
|
<text class="link">登录 </text> |
|
|
</text> |
|
|
</text> |
|
|
|
|
|
|
|
|
<!-- 同意弹窗 --> |
|
|
<!-- 同意弹窗 --> |
|
|
@ -235,7 +235,12 @@ import countryList from "../login/list"; |
|
|
import footerBar from "../../../components/footerBar"; |
|
|
import footerBar from "../../../components/footerBar"; |
|
|
import uniPopup from "../../../uni_modules/uni-popup/components/uni-popup/uni-popup.vue"; |
|
|
import uniPopup from "../../../uni_modules/uni-popup/components/uni-popup/uni-popup.vue"; |
|
|
import { verificationPhone, verificationEmail } from "../login/verification"; |
|
|
import { verificationPhone, verificationEmail } from "../login/verification"; |
|
|
import { SendEmailCodeApi, SendPhoneCodeApi,verifyCodeApi,forgetApi } from "../../../api/start/login"; |
|
|
|
|
|
|
|
|
import { |
|
|
|
|
|
SendEmailCodeApi, |
|
|
|
|
|
SendPhoneCodeApi, |
|
|
|
|
|
verifyCodeApi, |
|
|
|
|
|
forgetApi, |
|
|
|
|
|
} from "../../../api/start/login"; |
|
|
|
|
|
|
|
|
const type = ref(""); |
|
|
const type = ref(""); |
|
|
const email = ref(""); |
|
|
const email = ref(""); |
|
|
@ -254,6 +259,7 @@ const verifyCode = ref(""); |
|
|
const isRecovering = ref(false); |
|
|
const isRecovering = ref(false); |
|
|
const newPasswordLookFirst = ref(false); |
|
|
const newPasswordLookFirst = ref(false); |
|
|
const newPasswordLookSecond = ref(false); |
|
|
const newPasswordLookSecond = ref(false); |
|
|
|
|
|
const account = ref(""); |
|
|
|
|
|
|
|
|
// 使用从list.js导入的完整国家列表数据 |
|
|
// 使用从list.js导入的完整国家列表数据 |
|
|
const countries = ref( |
|
|
const countries = ref( |
|
|
@ -301,7 +307,7 @@ function switchPhone() { |
|
|
verifyCode.value = ""; |
|
|
verifyCode.value = ""; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function register() { |
|
|
|
|
|
|
|
|
async function register() { |
|
|
if (isRecovering.value) { |
|
|
if (isRecovering.value) { |
|
|
if (!newPasswordFirst.value || !newPasswordSecond.value) { |
|
|
if (!newPasswordFirst.value || !newPasswordSecond.value) { |
|
|
uni.showToast({ |
|
|
uni.showToast({ |
|
|
@ -319,6 +325,32 @@ function register() { |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const account = changeAccount(); |
|
|
|
|
|
|
|
|
|
|
|
const res = await forgetApi({ |
|
|
|
|
|
account: account, |
|
|
|
|
|
password: newPasswordSecond.value, |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
console.log("res", res); |
|
|
|
|
|
|
|
|
|
|
|
if (res.code !== 200) { |
|
|
|
|
|
uni.showToast({ |
|
|
|
|
|
title: res.message, |
|
|
|
|
|
icon: "none", |
|
|
|
|
|
}); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
uni.showToast({ |
|
|
|
|
|
title: res.message, |
|
|
|
|
|
icon: "none", |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
uni.navigateTo({ |
|
|
|
|
|
url: "/pages/start/login/login", |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
// 密码逻辑 |
|
|
// 密码逻辑 |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
@ -384,13 +416,54 @@ function register() { |
|
|
console.log("登录:", email.value); |
|
|
console.log("登录:", email.value); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const account = changeAccount(); |
|
|
|
|
|
const loginType = changeLoginType(); |
|
|
|
|
|
|
|
|
|
|
|
const res = await verifyCodeApi({ |
|
|
|
|
|
loginType: loginType, //登录方式EMAIL,PHONE |
|
|
|
|
|
account: account, //登陆账号 手机号/邮箱 |
|
|
|
|
|
verifyCode: verifyCode.value, |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
if (res.code !== 200) { |
|
|
|
|
|
uni.showToast({ |
|
|
|
|
|
title: res.message, |
|
|
|
|
|
icon: "none", |
|
|
|
|
|
}); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
isRecovering.value = !isRecovering.value; |
|
|
isRecovering.value = !isRecovering.value; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// 如果已经同意,则继续登录流程 |
|
|
|
|
|
// uni.showToast({ |
|
|
|
|
|
// title: "登录成功", |
|
|
|
|
|
// icon: "success", |
|
|
|
|
|
// }); |
|
|
|
|
|
|
|
|
// 请求账户 |
|
|
|
|
|
function changeAccount() { |
|
|
|
|
|
if (switchType.value === "User") { |
|
|
|
|
|
account.value = deepChartID.value; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (switchType.value === "Phone") { |
|
|
|
|
|
account.value = `${country.value}${phone.value}`; |
|
|
|
|
|
} |
|
|
|
|
|
if (switchType.value === "Email") { |
|
|
|
|
|
account.value = email.value; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return account.value; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 改变请求时的type |
|
|
|
|
|
function changeLoginType() { |
|
|
|
|
|
if (switchType.value === "User") { |
|
|
|
|
|
return "DCCODE"; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (switchType.value === "Phone") { |
|
|
|
|
|
return "PHONE"; |
|
|
|
|
|
} |
|
|
|
|
|
if (switchType.value === "Email") { |
|
|
|
|
|
return "EMAIL"; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function goToLogin() { |
|
|
function goToLogin() { |
|
|
|