登录页面多一个返回按钮,个人中心页面未登录时,昵称作为登录按钮

This commit is contained in:
WindowBird 2025-09-01 15:14:25 +08:00
parent 7da3bc1f65
commit 6cee9d90b1
2 changed files with 22 additions and 1 deletions

View File

@ -1,5 +1,9 @@
<template>
<view class="login-container">
<view :style="{ top: getNavBarHeight() + 'rpx' }" class="goback" @click="goback">
<uni-icons :size="getTitleBarHeight()" type="left"></uni-icons>
</view>
<view class="logo-section">
<image :src="CommonEnum.LOGIN_SRC" class="logo-image"></image>
</view>
@ -78,6 +82,7 @@ import { wxLogin } from '@/api/auth/auth.js'
import { forceHideLoading, AutoLoadingManager } from '@/utils/request.js'
import { getServiceTerms, getPrivacyPolicy } from '@/api/article/article.js'
import { commonEnum } from '../../enum/commonEnum'
import { getNavBarHeight, getTitleBarHeight } from '../../utils/system'
export default {
data() {
@ -122,6 +127,11 @@ export default {
}
},
methods: {
getTitleBarHeight,
getNavBarHeight,
goback() {
uni.navigateBack()
},
getUrlParam(key, url) {
const regex = new RegExp(`[?&]${key}=([^&#]*)`)
const match = url.match(regex)
@ -321,9 +331,16 @@ export default {
<style lang="scss" scoped>
page {
position: relative;
background: #ffffff;
}
.goback {
color: #e80a0a;
position: absolute;
left: 20rpx;
}
.login-container {
padding-bottom: 40rpx;
max-width: 750rpx;

View File

@ -23,7 +23,7 @@
<view v-else style="padding: 30rpx"></view>
</view>
<view class="user-details">
<text class="user-name">{{ userInfo.nickName || '未登录' }}</text>
<text class="user-name" @click="goLogin()">{{ userInfo.nickName || '点击登录' }}</text>
<view class="settings-icon" @click="goToSettings">
<image :src="commonEnum.SET" class="settings-img" mode="aspectFit" />
@ -275,6 +275,10 @@ export default {
}
},
goLogin() {
if (checkLoginStatus()) {
}
},
//
goToSettings() {
//