From 2361b7954825b9cecdde13484fee1436b85ef42e Mon Sep 17 00:00:00 2001 From: Jason <5340635+wen-jason@user.noreply.gitee.com> Date: Fri, 16 Sep 2022 15:35:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AF=86=E7=A0=81=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../widgets/user-info/user-info.vue | 2 +- .../pages/change_password/change_password.vue | 25 ++++++++++++++----- app/src/pages/user_set/user_set.vue | 25 +++++++++++++++---- 3 files changed, 40 insertions(+), 12 deletions(-) diff --git a/app/src/components/widgets/user-info/user-info.vue b/app/src/components/widgets/user-info/user-info.vue index c6c1e9c1..7c687222 100644 --- a/app/src/components/widgets/user-info/user-info.vue +++ b/app/src/components/widgets/user-info/user-info.vue @@ -17,7 +17,7 @@ 未登录 - + diff --git a/app/src/pages/change_password/change_password.vue b/app/src/pages/change_password/change_password.vue index f9d044b1..8cb0dd92 100644 --- a/app/src/pages/change_password/change_password.vue +++ b/app/src/pages/change_password/change_password.vue @@ -3,11 +3,14 @@ class="register bg-white min-h-full flex flex-col items-center px-[40rpx] pt-[100rpx] box-border" > - 修改登录密码 + + {{ type == 'set' ? '设置登录密码' : '修改登录密码' }} + - + import { userChangePwd } from '@/api/user' -import { reactive } from 'vue' +import { onLoad } from '@dcloudio/uni-app' +import { reactive, ref } from 'vue' -const formData = reactive({ - oldPassword: '', +const type = ref('') +const formData = reactive({ password: '', password2: '' }) const handleConfirm = async () => { - if (!formData.oldPassword) return uni.$u.toast('请输入原来的密码') + if (!formData.oldPassword && type.value != 'set') return uni.$u.toast('请输入原来的密码') if (!formData.password) return uni.$u.toast('请输入密码') if (!formData.password2) return uni.$u.toast('请输入确认密码') if (formData.password != formData.password2) return uni.$u.toast('两次输入的密码不一致') @@ -58,6 +62,15 @@ const handleConfirm = async () => { uni.$u.toast('操作成功') uni.navigateBack() } + +onLoad((options) => { + type.value = options.type || '' + if (type.value == 'set') { + uni.setNavigationBarTitle({ + title: '设置登录密码' + }) + } +})