修改首页、引导页等样式问题;对接登录接口
This commit is contained in:
@@ -172,7 +172,7 @@ const handleConfirm = () => {
|
||||
uni.showLoading({ title: '修改中...' });
|
||||
setTimeout(() =>{
|
||||
uni.navigateTo({
|
||||
url:'/pageSubPack/setting/setting'
|
||||
url:`/pageSubPack/setting/setting?newPassword=${confirmPassword.value}`
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
@@ -113,11 +113,16 @@ const handleConfirm = () =>{
|
||||
uni.showToast({ title: '请输入',icon: 'error'});
|
||||
return
|
||||
}
|
||||
setTimeout(()=>{
|
||||
uni.navigateTo({
|
||||
url:"/pageSubPack/setting/setting"
|
||||
})
|
||||
})
|
||||
}
|
||||
// 返回上一页
|
||||
const goBack = () => {
|
||||
uni.navigateBack();
|
||||
};
|
||||
// const goBack = () => {
|
||||
// uni.navigateBack();
|
||||
// };
|
||||
|
||||
</script>
|
||||
<style scoped>
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
<!-- 退出登录按钮 -->
|
||||
<view class="logout-btn-wrap">
|
||||
<button class="logout-btn" :disabled="!phoneNumber" @tap="handleLogout">退出登录</button>
|
||||
<button class="logout-btn" :disabled="!phoneNumber || !passwordNumber" @tap="handleLogout">退出登录</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -40,14 +40,16 @@ import { onLoad } from '@dcloudio/uni-app'
|
||||
|
||||
// 响应式数据
|
||||
const phoneNumber = ref('15699991212') // 绑定手机号
|
||||
const passwordNumber = ref('ckk123456')
|
||||
const passwordNumber = ref('')
|
||||
|
||||
// 页面加载时可从接口获取用户信息
|
||||
onLoad(() => {
|
||||
// 实际项目中从接口获取用户手机号
|
||||
// getUserInfo().then(res => {
|
||||
// phoneNumber.value = res.phone || ''
|
||||
// })
|
||||
onLoad((option) => {
|
||||
// console.log('option',option)
|
||||
passwordNumber.value = option.newPassword
|
||||
const userInfo = uni.getStorageSync('tempChangePwdParams')
|
||||
if(userInfo.phoneNumber){
|
||||
phoneNumber.value = userInfo.phoneNumber
|
||||
}
|
||||
})
|
||||
|
||||
// 返回上一页
|
||||
@@ -67,7 +69,7 @@ const goToChangePhone = () => {
|
||||
// 跳转到修改密码页面
|
||||
const goToModifyPassword = () => {
|
||||
uni.navigateTo({
|
||||
url: '/pageSubPack/setting/change -password'
|
||||
url: '/pageSubPack/setting/change-password'
|
||||
})
|
||||
}
|
||||
|
||||
@@ -90,19 +92,21 @@ const handleLogout = () => {
|
||||
const confirmLogout = () => {
|
||||
// 模拟退出登录接口请求
|
||||
uni.showLoading({ title: '退出中...' })
|
||||
|
||||
|
||||
setTimeout(() => {
|
||||
uni.hideLoading()
|
||||
// 清除本地存储的token等信息
|
||||
uni.removeStorageSync('token')
|
||||
uni.removeStorageSync('userInfo')
|
||||
|
||||
uni.clearStorageSync()
|
||||
// uni.removeStorageSync('token')
|
||||
// uni.removeStorageSync('userInfo')
|
||||
// uni.removeStorageSync('tempChangePwdParams')
|
||||
|
||||
// 提示并跳转到登录页
|
||||
uni.showToast({
|
||||
title: '退出登录成功',
|
||||
icon: 'success'
|
||||
})
|
||||
|
||||
|
||||
// 跳转到登录页,关闭所有页面
|
||||
uni.redirectTo({
|
||||
url: '/pageSubPack/loginSub/pwd-login'
|
||||
@@ -147,7 +151,7 @@ const confirmLogout = () => {
|
||||
.nav-title {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
font-size: 18px;
|
||||
font-size: 32rpx;
|
||||
font-weight: 500;
|
||||
color: #333;
|
||||
}
|
||||
@@ -173,14 +177,14 @@ const confirmLogout = () => {
|
||||
}
|
||||
|
||||
.item-label {
|
||||
font-size: 16px;
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.item-value {
|
||||
flex: 1;
|
||||
text-align: right;
|
||||
font-size: 16px;
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
margin-right: 10px;
|
||||
overflow: hidden;
|
||||
@@ -201,10 +205,10 @@ const confirmLogout = () => {
|
||||
color: #fff;
|
||||
border: none;
|
||||
border-radius: 6px;
|
||||
font-size: 16px;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
.logout-btn::after {
|
||||
border: none;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user