登录界面和注册界面修改密码界面完成前后端对接

master
Gary 3 months ago
parent 6a7d31e1c0
commit 5a1e37bc96

@ -1,7 +1,7 @@
{
"pages": [
/*-----------------------------------------------------------------------------------------*/
/* {
{
"path": "pages/transition/page1/page1",
"style": {
"navigationStyle": "custom"
@ -42,11 +42,11 @@
"style": {
"navigationStyle": "custom"
}
},*/
},
/*------------------------------------------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------------------------------------------------*/
/* {
{
"path": "pages/login/account_login/account_login",
"style": {
"navigationStyle": "custom"
@ -69,18 +69,18 @@
"style": {
"navigationStyle": "custom"
}
},*/
},
/*------------------------------------------------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------------------------------------------------*/
/* {
{
"path": "pages/information/sex/sex",
"style": {
"navigationStyle": "custom"
}
},*/
},
/*------------------------------------------------------------------------------------------------------------*/
/*------------------------------------------------------------------------------------------------------*/
/* {
{
"path": "pages/information/boy_weight_start/boy_weight_start",
"style": {
"navigationStyle": "custom"
@ -97,10 +97,10 @@
"style": {
"navigationStyle": "custom"
}
},*/
},
/*------------------------------------------------------------------------------------------------------------*/
/*------------------------------------------------------------------------------------------------------------*/
/* {
{
"path": "pages/information/boy_height_start/boy_height_start",
"style": {
"navigationStyle": "custom"
@ -117,10 +117,10 @@
"style": {
"navigationStyle": "custom"
}
},*/
},
/*-----------------------------------------------------------------------------------------------------*/
/*------------------------------------------------------------------------------------------------------------*/
/* {
{
"path": "pages/information/girl_height_start/girl_height_start",
"style": {
"navigationStyle": "custom"
@ -137,10 +137,10 @@
"style": {
"navigationStyle": "custom"
}
},*/
},
/*------------------------------------------------------------------------------------------------------------*/
/*------------------------------------------------------------------------------------------------------------------------------------------*/
/* {
{
"path": "pages/information/girl_weight_start/girl_weight_start",
"style": {
"navigationStyle": "custom"
@ -157,23 +157,23 @@
"style": {
"navigationStyle": "custom"
}
},*/
},
/*--------------------------------------------------------------------------------------------------------------------------------------*/
/*----------------------------------------------------------使--------------------------------------------------*/
/* {
{
"path": "pages/information/purpose/purpose",
"style": {
"navigationStyle": "custom"
}
},*/
},
/*------------------------------------------------使-----------------------------------------------------------*/
/*-------------------------------------------------------------------------------------------------------------------*/
/*{
{
"path": "pages/transition/page8/page8",
"style": {
"navigationStyle": "custom"
}
},*/
},
/*--------------------------------------------------------------------------------------------------------------*/
{

@ -26,22 +26,26 @@
<!-- 账号输入框 -->
<view class="account_box login_form_item">
<view class="form_input_box">
<input class="account" name="account" type="text" placeholder="请输入你的电话号码"/>
<input class="account" v-model="phone_number" type="text" placeholder="请输入你的电话号码"/>
</view>
<view class="error_tip" v-if="isPhoneError">*</view>
</view>
<!-- 密码输入框 -->
<view class="passage_box login_form_item" v-if="isPassagePage">
<view class="form_input_box passage_input_box">
<input class="passage" name="passage" :password="isOpened" type="text" placeholder="请输入你的密码"/>
<input class="passage" v-model="password" :password="isOpened" type="text" placeholder="请输入你的密码"/>
<image @click="openEyesEvent" class="eyes" :src="eyesStateIcon"></image>
</view>
<view class="error_tip" v-if="isPassageError">*</view>
</view>
<!-- 验证码输入框 -->
<view class="captcha_box login_form_item" v-else>
<view class="form_input_box captcha_input_box">
<input class="captcha" name="captcha" type="text" placeholder="请输入你的验证码"/>
<input class="captcha" v-model="code" name="captcha" type="text" placeholder="请输入你的验证码"/>
<button class="captcha_button" @click="sendCaptchaEvent"
:style="{color:captchaButtonColor, backgroundColor:captchaButtonBackgroundColor}">
{{captchaButtonText}}
@ -65,13 +69,13 @@
<image class="goto_register" src="../../../static/login/account_login/register.png"></image>
</navigator>
<!-- 其他登录部分 -->
<view class="otherways_part">
<!-- <view class="otherways_part">
<image class="otherways_tips" src="../../../static/login/account_login/other_ways.png"></image>
<view class="two_ways">
<image class="qq_icon" src="../../../static/login/account_login/qq_icon.png"></image>
<image class="weixin_icon" src="../../../static/login/account_login/weixin_icon.png"></image>
</view>
</view>
</view>-->
</view>
</template>
@ -84,6 +88,17 @@ var codeTime = ref(0); //验证码的倒计时
const captchaButtonBackgroundColor = computed(() => isSendCaptcha.value ? "#ABCBFF" : "#ffffff"); //
const captchaButtonColor = computed(() => isSendCaptcha.value ? "#ffffff" : "#000364");//
const captchaButtonText = computed(() => isSendCaptcha.value ? (codeTime.value+"s后重新发送"):"发送验证码")
const phone_number=ref("");
const password=ref("");
const code=ref("");//
const which_way_to_login = ref("0"); // 使0 使1
const access_token = ref("0"); //token
const isPassagePage = ref(true); //
const passageWordsBottomBorder = computed(() => isPassagePage.value? "0.1rem solid #094ABC":"none"); //
@ -99,11 +114,24 @@ const isCaptchaError = ref(false);
//
function toCaptchaEvent(){
isPassagePage.value = false;
which_way_to_login.value=1;//
}
//
function sendCaptchaEvent(){
console.log("send captcha");
if (codeTime.value>0){ //
//
const isChinaPhone = /^1[3-9]\d{9}$/.test(phone_number.value);
if (!isChinaPhone) {
uni.showToast({
title: '请输入有效的中国大陆手机号',
icon: "none"
});
return; //
}
if (codeTime.value>0){ //
uni.showToast({ //
title: '不能重复获取',
icon:"none"
@ -119,41 +147,184 @@ function sendCaptchaEvent(){
codeTime.value = 0;
}
},1000)
};
}
function login(){
//
const serverAddress = app.globalData.fit_journey_login_address + '/phone_code_register/getPhoneCode';
console.log(String(phoneNumber.value));
//
}
//
const app = getApp();
//
uni.request({
url: serverAddress,
url: app.globalData.fit_journey_login_address + '/phone_code_register/getPhoneCode',
method: 'POST',
header: {
'Content-Type': 'application/x-www-form-urlencoded',
'content-type': 'application/x-www-form-urlencoded',
},
data: {
phone: phoneNumber.value
phone:String(phone_number.value)
},
success: (res) => {
console.log(res.data);
uni.showToast({
title: '发送验证码成功,请注意查收~',
icon: "none"
});
},
fail: (err) => {
console.log("请求失败", err);
error: (res) => {
console.log("请求失败!请求数据是", res);
}
});
}
function login() {
console.log(which_way_to_login.value);
if (which_way_to_login.value === 0) { //
console.log("这里开始运行了");
//
const serverAddress = app.globalData.fit_journey_login_address + '/AccountLogin/PhonePasswordLogin';
console.log("后端服务器的地址是" + serverAddress);
console.log("发送的账号是" + String(phone_number.value));
console.log("发送的密码是" + String(password.value));
if(phone_number.value==null||code.value==null){
uni.showToast({
title: '手机号和密码不能为空',
icon: "none"
});
}
//
uni.request({
url: serverAddress,
method: 'POST',
header: {
'content-type': 'application/x-www-form-urlencoded',
},
data: {
phone: String(phone_number.value),
password: String(password.value)
},
success: (res) => {
if (res.statusCode === 500) {
uni.showToast({
title: '账号或密码错误',
icon: "none"
});
} else {
uni.showToast({
title: '登录成功',
icon: "none"
});
access_token.value = res.data.data.token;
console.log("登录成功!从后端收集的token是", access_token.value);
// token
uni.setStorage({
key: 'access_token', //
data: access_token.value, //
success: () => {
console.log("Token 已存储到本地!");
},
fail: () => {
console.error("Token 存储失败!");
}
});
console.log(access_token.value);
console.log("登录成功!从后端收集的token是", uni.getStorageSync('access_token'));
uni.navigateTo({
url: '/pages/information/sex/sex'//
})
}
},
error: (res) => {
console.log("请求失败!请求数据是", res);
uni.showToast({
title: '登录失败,服务器错误',
icon: "none"
});
}
});
} else if (which_way_to_login.value === 1) { //
console.log("验证码登录部分开始运行了");
//
const serverAddress = app.globalData.fit_journey_login_address + '/PhoneLogin/phoneLogin';
console.log("后端服务器的地址是" + serverAddress);
console.log("发送的账号是" + String(phone_number.value));
console.log("发送的code是" + String(code.value));
if(phone_number.value==null||code.value==null){
uni.showToast({
title: '手机号和验证码不能为空',
icon: "none"
});
}
//
uni.request({
url: serverAddress,
method: 'POST',
header: {
'content-type': 'application/x-www-form-urlencoded',
},
data: {
phone: String(phone_number.value),
code: String(code.value)
},
success: (res) => {
console.log(res);
if (res.statusCode === 500) {
uni.showToast({
title: '账号或密码错误,或账号没有进行注册',
icon: "none"
});
} else {
uni.showToast({
title: '登录成功',
icon: "none"
});
access_token.value = res.data.data.token;
console.log("登录成功!从后端收集的token是", access_token.value);
// token
uni.setStorage({
key: 'access_token', //
data: access_token.value, //
success: () => {
console.log("Token 已存储到本地!");
},
fail: () => {
console.error("Token 存储失败!");
}
});
console.log(access_token.value);
console.log("登录成功!从后端收集的token是", uni.getStorageSync('access_token'));
//
uni.navigateTo({
url: '/pages/information/sex/sex'//
})
}
},
error: (res) => {
console.log("请求失败!请求数据是", res);
uni.showToast({
title: '登录失败,服务器错误',
icon: "none"
})
}
})
}
}
/*
//TODO:
console.log("login");
uni.navigateTo({
url: '/pages/information/sex/sex'//
})
}
})*/
//
function toPassageEvent(){
isPassagePage.value = true;
which_way_to_login.value=0;
}
//
function openEyesEvent()

@ -11,7 +11,7 @@
<!-- 密码输入 -->
<view class="passage_box change_password_form_item">
<view class="form_input_box passage_input_box">
<input type="text" class="passage" :password="isOpened_1" placeholder="请输入你的密码"/>
<input type="text" v-model="first_input_password" class="passage" :password="isOpened_1" placeholder="请输入你的密码"/>
<image @click="openEyesEvent_1" class="eyes" :src="eyesStateIcon_1"></image>
</view>
<!-- <view class="error_tip" v-if="isPassageError">*</view> -->
@ -19,7 +19,7 @@
<!-- 确认密码输入 -->
<view class="passage_box change_password_form_item">
<view class="form_input_box passage_input_box">
<input type="text" class="passage" :password="isOpened_2" placeholder="请再次确认密码"/>
<input type="text" v-model="second_input_password" class="passage" :password="isOpened_2" placeholder="请再次确认密码"/>
<image @click="openEyesEvent_2" class="eyes" :src="eyesStateIcon_2"></image>
</view>
<view class="error_tip" v-if="isPassageSameError">*</view>
@ -42,10 +42,17 @@
</template>
<script setup>
import { ref, computed } from 'vue';
import { ref, onMounted } from 'vue';
const isPassageSameError = ref(false);
const first_input_password = ref(''); //
const second_input_password= ref(''); //
const phone_number = ref(''); //
const code= ref(''); //
const title = '成功'; //
const content = '密码修改成功'; //
const isOpenPopUp = ref(false);//
@ -54,7 +61,14 @@ const isOpened_1 = ref(true); //输入框是否密码显示的标志
const eyesStateIcon_1 = ref("../../../static/login/change_password/pictures/closedeyes.png");
const isOpened_2 = ref(true); //
const eyesStateIcon_2 = ref("../../../static/login/change_password/pictures/closedeyes.png");
// 使 onLoad
onMounted(() => {
const options = getCurrentPages()[getCurrentPages().length - 1].options;
phone_number.value = options.phone_number || '';
code.value = options.code || '';
console.log('接收到的手机号是:', phone_number.value);
console.log('接收到的验证码是:', code.value);
});
//
function openEyesEvent_1(){
if (isOpened_1.value)
@ -84,8 +98,68 @@ function openEyesEvent_2(){
//
function ensureClickEvent(){
console.log('密码确认修改');
isOpenPopUp.value = true; //
console.log(phone_number.value);
console.log(first_input_password.value);
console.log(second_input_password.value);
console.log(code.value);
if(first_input_password.value !== second_input_password.value){
uni.showToast({
title: '两次密码不相同',
icon: "none"
});
isPassageSameError.value = true;
}
if(first_input_password.value.length<6||first_input_password.value.length>10){
uni.showToast({
title: '密码必须在6-10位之间',
icon: "none"
});
}
//
//
const app = getApp();
//
uni.request({
url: app.globalData.fit_journey_login_address + '/ForgetPassword/FindPassword',
method: 'POST',
header: {
'content-type': 'application/x-www-form-urlencoded',
},
data: {
phone:String(phone_number.value),
code:String (code.value),
newPassword:String(first_input_password.value)
},
success: (res) => {
if(res.data.code===200){
uni.showToast({
title: '修改密码成功!',
icon: "none"
});
}else if(res.data.code===400){
uni.showToast({
title: '修改密码失败!',
icon: "none"
});
}
uni.navigateTo({
url: '/pages/login/account_login/account_login',
animationType: 'pop-in',
animationDuration: 200
});
},
error: (res) => {
console.log("请求失败!请求数据是", res);
uni.showToast({
title: '发送验证码成功,请注意查收~',
icon: "none"
});
}
});
/*console.log('');
isOpenPopUp.value = true; //*/
}
function onOpenUpClick(){
//TODO:
@ -103,101 +177,5 @@ function onClosePopUPClick(){
</script>
<style lang="scss">
.change_password_box{
background-image: url("../../../static/login/change_password/pictures/background.png");
background-size: cover;
background-position: center;
height: 100vh;
width: auto;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
position: relative;
object-fit: contain;
//
.return_image{
position: absolute;
left: 16.5%;
right: 80.1%;
top: 8.62%;
bottom: 89.09%;
width: 0.8rem;
height: auto;
object-fit: contain;
}
//
.change_passage_words{
position: absolute;
left: 12.4%;
top: 30.8%;
font-family: 'PingFang SC';
font-size: 1.4rem;
color: #000364;
}
//
.change_password_form{
position: absolute;
width: 74.5%;
height: 33.6%;
top: 40%;
//
.change_password_form_item{
height: auto;
margin-bottom: 5%;
.form_input_box{
padding-left: 3%;
padding-right: 3%;
background-color: #D5E9FF;
border-radius: 12px;
}
.error_tip{
margin-top: 0.6vh;
padding-left: 3%;
font-size: 0.8rem;
color: #FF1E1E;
}
}
//
.passage_box{
display: flex;
flex-direction: column;
.passage_input_box{
display: flex;
align-items: center;
background-color: #D5E9FF;
border-radius: 12px;
position: relative;
.passage{
height: 5.5vh;
padding-left: 11%;
background-image: url("../../../static/login/change_password/pictures/lock_icon.png");
background-repeat: no-repeat;
background-size: 0.8rem;
background-position: 4.7% 50%;
font-size: 0.8rem;
}
.eyes{
width: 1rem;
height: 1rem;
position: absolute;
right: 13%;
}
}
}
//
.ensure_button{
display: flex;
align-items: center;
justify-content: center;
margin-top: 8%;
height: 5.5vh;
border-radius: 12px;
background-color: #4A69F7;
color: #FFFCFC;
text-align: center;
font-size: 1.2rem;
}
}
}
@import "@/static/login/change_password/css/change_password.scss";
</style>

@ -11,14 +11,14 @@
<!-- 手机号输入 -->
<view class="phone_number_box forget_passage_form_item">
<view class="form_input_box">
<input type="text" class="phone_number" placeholder="请输入你的电话号码"/>
<input type="text" v-model="phone_number" class="phone_number" placeholder="请输入你的电话号码"/>
</view>
<view class="error_tip" v-if="isPhoneError">*</view>
</view>
<!-- 验证码输入 -->
<view class="captcha_box forget_passage_form_item">
<view class="form_input_box captcha_input_box">
<input type="text" class="captcha" placeholder="请输入你的验证码"/>
<input type="text" v-model="code" class="captcha" placeholder="请输入你的验证码"/>
<button class="captcha_button" @click="sendCaptchaEvent"
:style="{color:captchaButtonColor, backgroundColor:captchaButtonBackgroundColor}">
{{captchaButtonText}}
@ -36,45 +36,90 @@
<script setup>
import { ref, computed } from 'vue';
const code = ref("");
const isPhoneError = ref(false);
const isCaptchaError = ref(false);
const phone_number =ref("");
const isSendCaptcha = ref(false); //
var codeTime = ref(0); //
const captchaButtonBackgroundColor = computed(() => isSendCaptcha.value ? "#ABCBFF" : "#ffffff"); //
const captchaButtonColor = computed(() => isSendCaptcha.value ? "#ffffff" : "#000364");//
const captchaButtonText = computed(() => isSendCaptcha.value ? (codeTime.value+"s后重新发送"):"发送验证码");
//
function sendCaptchaEvent(){
console.log("send captcha");
if (codeTime.value>0){ //
uni.showToast({ //
title: '不能重复获取',
icon:"none"
});
} else{ //
codeTime.value = 60;
isSendCaptcha.value = true;
var timer = setInterval(()=>{
codeTime.value--;
if(codeTime.value<1){
clearInterval(timer);
isSendCaptcha.value = false;
codeTime.value = 0;
}
},1000)
};
}
//
const isChinaPhone = /^1[3-9]\d{9}$/.test(phone_number.value);
if (!isChinaPhone) {
uni.showToast({
title: '请输入有效的中国大陆手机号',
icon: "none"
});
return; //
}
if (codeTime.value>0){ //
uni.showToast({ //
title: '不能重复获取',
icon:"none"
});
} else{ //
codeTime.value = 60;
isSendCaptcha.value = true;
var timer = setInterval(()=>{
codeTime.value--;
if(codeTime.value<1){
clearInterval(timer);
isSendCaptcha.value = false;
codeTime.value = 0;
}
},1000)
}
//
const app = getApp();
//
uni.request({
url: app.globalData.fit_journey_login_address + '/phone_code_register/getPhoneCode',
method: 'POST',
header: {
'content-type': 'application/x-www-form-urlencoded',
},
data: {
phone:String(phone_number.value)
},
success: (res) => {
uni.showToast({
title: '发送验证码成功,请注意查收~',
icon: "none"
});
},
error: (res) => {
console.log("请求失败!请求数据是", res);
}
});
}
//
function nextClickEvent(){
uni.navigateTo({
url:'/pages/login/change_password/change_password',
animationType: 'pop-in',
animationDuration: 200
})
function nextClickEvent() {
const isChinaPhone = /^1[3-9]\d{9}$/.test(phone_number.value);
if (!isChinaPhone) {
uni.showToast({
title: '请输入有效的中国大陆手机号',
icon: "none"
});
return; //
}
// 使 encodeURIComponent
const encodedPhoneNumber = encodeURIComponent(phone_number.value);
const encodedCode = encodeURIComponent(code.value);
console.log("携带参数跳转",phone_number.value,code.value);
uni.navigateTo({
url: `/pages/login/change_password/change_password?phone_number=${encodedPhoneNumber}&code=${encodedCode}`,
animationType: 'pop-in',
animationDuration: 200
});
}
</script>

@ -13,14 +13,14 @@
<!-- 手机号输入 -->
<view class="phone_number_box register_form_item">
<view class="form_input_box">
<input v-model="phonenum" type="text" class="phone_number" placeholder="请输入你的电话号码"/>
<input v-model="phone_number" type="text" class="phone_number" placeholder="请输入你的电话号码"/>
</view>
<view class="error_tip" v-if="isPhoneError">*</view>
</view>
<!-- 验证码输入 -->
<view class="captcha_box register_form_item">
<view class="form_input_box captcha_input_box">
<input v-model="captchanum" class="captcha" name="captcha" type="text" placeholder="请输入你的验证码"/>
<input v-model="code" class="captcha" name="captcha" type="text" placeholder="请输入你的验证码"/>
<button class="captcha_button" @click="sendCaptchaEvent"
:style="{color:captchaButtonColor, backgroundColor:captchaButtonBackgroundColor}">
{{captchaButtonText}}
@ -71,11 +71,10 @@ import { ref, computed } from 'vue';
const app = getApp();
/*手机号框相关变量*/
const phonenum = ref(); //
const phone_number = ref(""); //
const isPhoneError = ref(false);//
const code=ref("");
/*验证码框相关变量*/
const captchanum = ref(); //
const isCaptchaError = ref(false); //
const isSendCaptcha = ref(false); //
var codeTime = ref(0); //
@ -110,13 +109,13 @@ const pMatch = /^1(3[0-9]|4[01456879]|5[0-35-9]|6[2567]|7[0-8]|8[0-9]|9[0-35-9])
function checkPhone(){
var flag=true
//
if (phonenum.value==undefined){
if (phone_number.value===undefined){
flag = false
uni.showToast({ //
title: '手机号不能为空',
icon:"error",
});
}else if (!pMatch.test(phonenum.value)){
}else if (!pMatch.test(phone_number.value)){
flag = false
// isPhoneError.value = true
uni.showToast({ //
@ -129,49 +128,57 @@ function checkPhone(){
return flag
}
function sendCaptchaEvent(){
//TODO:
console.log("点击发送验证码按钮");
//
if (checkPhone()){
//
if (codeTime.value>0){ //
uni.showToast({ //
title: '不能重复获取',
icon:"none"
});
} else{ //
codeTime.value = 60;
isSendCaptcha.value = true;
var timer = setInterval(()=>{
codeTime.value--;
if(codeTime.value<1){
clearInterval(timer);
isSendCaptcha.value = false;
codeTime.value = 0;
}
},1000)
};
//
uni.request({
// url:app.globalData.fit_journey_login_address+'/phone_code_register/getPhoneCode',
url:'http://47.122.61.54:8084/phone_code_register/getPhoneCode',
method:'POST',
header:{
'Content-Type':'application/x-www-form-urlencoded',
},
data:{
phone:phonenum.value
},
success:(res)=>{
console.log('发送验证码请求成功:'+res.data)
},
fail:(err)=>{
console.log('发送验证码请求失败')
console.log(err)
}
})
}
//
const isChinaPhone = /^1[3-9]\d{9}$/.test(phone_number.value);
if (!isChinaPhone) {
uni.showToast({
title: '请输入有效的中国大陆手机号',
icon: "none"
});
return; //
}
if (codeTime.value>0){ //
uni.showToast({ //
title: '不能重复获取',
icon:"none"
});
} else{ //
codeTime.value = 60;
isSendCaptcha.value = true;
var timer = setInterval(()=>{
codeTime.value--;
if(codeTime.value<1){
clearInterval(timer);
isSendCaptcha.value = false;
codeTime.value = 0;
}
},1000)
}
//
const app = getApp();
//
uni.request({
url: app.globalData.fit_journey_login_address + '/phone_code_register/getPhoneCode',
method: 'POST',
header: {
'content-type': 'application/x-www-form-urlencoded',
},
data: {
phone:String(phone_number.value)
},
success: (res) => {
uni.showToast({
title: '发送验证码成功,请注意查收~',
icon: "none"
});
},
error: (res) => {
console.log("请求失败!请求数据是", res);
}
});
}
/*-----密码码相关函数-----*/
@ -206,17 +213,15 @@ function openEyesEvent_2(){
/*-----注册按钮相关函数-----*/
function checkSubmit(){
//TODO:
var flag = true
//
if (phonenum.value==undefined){
if (phone_number.value===undefined){
flag = false
uni.showToast({ //
title: '手机号不能为空',
icon:"error",
});
}else if (!pMatch.test(phonenum.value)){
}else if (!pMatch.test(phone_number.value)){
flag = false
// isPhoneError.value = true
uni.showToast({ //
@ -226,22 +231,27 @@ function checkSubmit(){
} else {
isPhoneError.value = false
}
//
if (passagenum.value==undefined){
if (passagenum.value===undefined){
flag = false
uni.showToast({ //
title: '密码不能为空',
icon:"error",
});
}else if (passagesamenum.value==undefined){
}else if (passagesamenum.value===undefined){
//
flag = false
uni.showToast({ //
title: '请再输入密码',
icon:"error",
});
}else if (passagenum.value!=passagesamenum.value){
}else if(passagenum.value.length < 6 || passagenum.value.length > 10) {
flag = false;
uni.showToast({
title: '密码长度必须为6到10位',
icon: "error",
});
} else if (passagenum.value!==passagesamenum.value){
//
flag = false
// isPassageSameError.value = true
@ -252,9 +262,8 @@ function checkSubmit(){
} else{
isPassageSameError.value = false
}
//
if (captchanum.value==undefined){
if (code.value===undefined){
flag = false
// isCaptchaError.value = true
uni.showToast({ //
@ -264,48 +273,70 @@ function checkSubmit(){
} else{
isCaptchaError.value = false
}
return flag
}
function registerEvent(){
//TODO:
//
console.log(code.value);
console.log(phone_number.value);
console.log(passagenum.value);
if (checkSubmit()){
//
console.log("服务器地址是:"+app.globalData.fit_journey_login_address);
uni.request({
// url:app.globalData.fit_journey_login_address+'/phone_code_register/registerByPhone',
url:'http://47.122.61.54:8084/phone_code_register/registerByPhone',
url:app.globalData.fit_journey_login_address+'/phone_code_register/registerByPhone',
header: {
'content-type': 'application/x-www-form-urlencoded',
},
method:'POST',
data:{
code:captchanum.value,
phone:phonenum.value
code:code.value,
phone:phone_number.value,
password:passagenum.value
},
success:(res)=>{
console.log('注册成功:'+res.data)
isRegisterSuccess.value = true
isOpenPopUp.value = true //
},
fail:(err)=>{
console.log('注册失败'+err)
isRegisterSuccess.value = false
isOpenPopUp.value = true //
}
})
}
if(res.data.code === 200) {
isRegisterSuccess.value = true
isOpenPopUp.value = true
}else if(res.data.code===400) {
uni.showToast({
title: '手机号已经被注册了~',
icon: "error",
});
}else if(res.data.code===401) {
uni.showToast({
title: '验证码错误~',
icon: "error",
});
}else if(res.data.code===500) {
uni.showToast({
title: '验证码过期~',
icon: "error",
});
}
},
fail:(err)=>{
isRegisterSuccess.value = false
isOpenPopUp.value = true //
}
})
}
}
/*-----弹窗相关函数-----*/
function onOpenUpClick(){
//TODO:
uni.navigateTo({
url: '/pages/login/account_login/account_login',
animationType: 'pop-in', //
animationType: 'pop-in',
animationDuration: 200
});
}
function onClosePopUPClick(){
//TODO:
isOpenPopUp.value = false;
}

@ -0,0 +1,97 @@
.change_password_box{
background-image: url("@/static/login/change_password/pictures/background.png");
background-size: cover;
background-position: center;
height: 100vh;
width: auto;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
position: relative;
object-fit: contain;
//
.return_image{
position: absolute;
left: 16.5%;
right: 80.1%;
top: 8.62%;
bottom: 89.09%;
width: 0.8rem;
height: auto;
object-fit: contain;
}
//
.change_passage_words{
position: absolute;
left: 12.4%;
top: 30.8%;
font-family: 'PingFang SC';
font-size: 1.4rem;
color: #000364;
}
//
.change_password_form{
position: absolute;
width: 74.5%;
height: 33.6%;
top: 40%;
//
.change_password_form_item{
height: auto;
margin-bottom: 5%;
.form_input_box{
padding-left: 3%;
padding-right: 3%;
background-color: #D5E9FF;
border-radius: 12px;
}
.error_tip{
margin-top: 0.6vh;
padding-left: 3%;
font-size: 0.8rem;
color: #FF1E1E;
}
}
//
.passage_box{
display: flex;
flex-direction: column;
.passage_input_box{
display: flex;
align-items: center;
background-color: #D5E9FF;
border-radius: 12px;
position: relative;
.passage{
height: 5.5vh;
padding-left: 11%;
background-image: url("@/static/login/change_password/pictures/lock_icon.png");
background-repeat: no-repeat;
background-size: 0.8rem;
background-position: 4.7% 50%;
font-size: 0.8rem;
}
.eyes{
width: 1rem;
height: 1rem;
position: absolute;
right: 13%;
}
}
}
//
.ensure_button{
display: flex;
align-items: center;
justify-content: center;
margin-top: 8%;
height: 5.5vh;
border-radius: 12px;
background-color: #4A69F7;
color: #FFFCFC;
text-align: center;
font-size: 1.2rem;
}
}
}
Loading…
Cancel
Save