From 60a2bbb4052efdf8d6f5f531ff18462895bb1804 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E8=BE=89?= <814457906@qq.com> Date: Tue, 15 Nov 2022 16:45:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/forgotPassword/forgotPassword.vue | 11 ++++++++++- pages/login/login.vue | 9 +++++++-- pages/register/register.vue | 6 +++++- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/pages/forgotPassword/forgotPassword.vue b/pages/forgotPassword/forgotPassword.vue index 65883de..089abdc 100644 --- a/pages/forgotPassword/forgotPassword.vue +++ b/pages/forgotPassword/forgotPassword.vue @@ -50,6 +50,11 @@ getCodeBtnColor: "#4C7BC9", //获取验证码的color } }, + onLoad(options) { + if(options.phone){ + this.phone = options.phone + } + }, methods: { pwdlogin() { if (this.password !== this.newpassword) { @@ -64,9 +69,13 @@ this.$refs.uToast.show({ title: '密码修改成功', type: 'success', - url: '/pages/login/login', duration: '1500' }) + setTimeout(e => { + uni.navigateTo({ + url: `/pages/login/login?phone=${this.phone}&password=${this.password}` + }) + }, 1500) } else { this.$refs.uToast.show({ title: res.msg, diff --git a/pages/login/login.vue b/pages/login/login.vue index d208c1f..5f21e7f 100644 --- a/pages/login/login.vue +++ b/pages/login/login.vue @@ -34,7 +34,12 @@ }; }, //获取到传值 - onLoad(options) {}, + onLoad(options) { + if (options.phone && options.password) { + this.phone = options.phone + this.password = options.password + } + }, methods: { //密码登录 pwdlogin() { @@ -83,7 +88,7 @@ //跳转忘记密码页面 goforgotPassword() { uni.navigateTo({ - url: "/pages/forgotPassword/forgotPassword" + url: `/pages/forgotPassword/forgotPassword?phone=${this.phone}` }) }, }, diff --git a/pages/register/register.vue b/pages/register/register.vue index 570776e..01654c2 100644 --- a/pages/register/register.vue +++ b/pages/register/register.vue @@ -115,9 +115,13 @@ this.$refs.uToast.show({ title: '注册成功,前往登录', type: 'success', - url: '/pages/login/login', duration: '1500' }) + setTimeout(e => { + uni.navigateTo({ + url: `/pages/login/login?phone=${this.phone}&password=${this.password}` + }) + }, 1500) } else { this.$refs.uToast.show({ title: res.msg,