主要更新uniapp相关功能
This commit is contained in:
1 parent
aa92ca40a2
commit
5b4dbb2b46
65 files changed
+8532
-1921
No files matched your search
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<view class="page">
|
||||
<view class="profile-header">
|
||||
<view class="profile-header" :style="headPad">
|
||||
<view class="profile-info">
|
||||
<view class="profile-avatar">
|
||||
<text class="avatar-text">{{ avatarText }}</text>
|
||||
@@ -24,27 +24,34 @@
|
||||
|
||||
<view class="main-scroll" style="margin-top:10rpx">
|
||||
<view class="menu-group" v-for="(group, gIndex) in menuGroups" :key="gIndex">
|
||||
<view
|
||||
class="menu-item"
|
||||
v-for="item in group"
|
||||
:key="item.title"
|
||||
@tap="onMenuTap(item)"
|
||||
>
|
||||
<view class="menu-left">
|
||||
<view class="menu-icon">
|
||||
<FaIcon :name="item.icon" color="#3973ff" :size="18" />
|
||||
</view>
|
||||
<text class="menu-title">{{ item.title }}</text>
|
||||
</view>
|
||||
<view class="menu-right">
|
||||
<text v-if="item.badge" class="menu-badge">{{ item.badge }}</text>
|
||||
<FaIcon name="chevron-right" color="#c0c4cc" :size="12" />
|
||||
</view>
|
||||
</view>
|
||||
<u-cell-group :border="false">
|
||||
<u-cell
|
||||
v-for="item in group"
|
||||
:key="item.title"
|
||||
:title="item.title"
|
||||
is-link
|
||||
@click="onMenuTap(item)"
|
||||
>
|
||||
<template #icon>
|
||||
<view class="menu-icon">
|
||||
<FaIcon :name="item.icon" color="#2563eb" :size="18" />
|
||||
</view>
|
||||
</template>
|
||||
<template #value>
|
||||
<text v-if="item.badge" class="menu-badge">{{ item.badge }}</text>
|
||||
</template>
|
||||
</u-cell>
|
||||
</u-cell-group>
|
||||
</view>
|
||||
|
||||
<view class="logout-btn" hover-class="logout-btn-hover" @tap.stop="handleLogout">
|
||||
<text class="logout-text">退出登录</text>
|
||||
<view class="logout-wrap">
|
||||
<u-button
|
||||
type="error"
|
||||
plain
|
||||
shape="circle"
|
||||
text="退出登录"
|
||||
@click="handleLogout"
|
||||
/>
|
||||
</view>
|
||||
|
||||
<view class="bottom-space" />
|
||||
@@ -56,6 +63,9 @@
|
||||
|
||||
<script setup>
|
||||
import { ref, computed, onMounted } from 'vue'
|
||||
import { mpHeadPad } from '@/utils/mpHead.js'
|
||||
|
||||
const headPad = mpHeadPad()
|
||||
import { getUser, setUser, logout, isLoggedIn, isSSOEnabled, getToken } from '@/utils/auth.js'
|
||||
import { getCurrentUser, logoutApi, logoutUAC } from '@/api/auth.js'
|
||||
import AppTabbar from '@/components/MainTabbar.vue'
|
||||
@@ -172,6 +182,9 @@ function handleLogout() {
|
||||
.profile-header {
|
||||
flex-shrink: 0;
|
||||
padding: calc(var(--status-bar-height, 44px) + 24rpx) $page-padding-x 40rpx;
|
||||
/* #ifdef MP-WEIXIN */
|
||||
padding-top: calc(env(safe-area-inset-top, 25px) + 88rpx);
|
||||
/* #endif */
|
||||
background: $hero-gradient;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
@@ -307,31 +320,6 @@ function handleLogout() {
|
||||
box-shadow: 0 8rpx 24rpx rgba(0, 0, 0, 0.12);
|
||||
}
|
||||
|
||||
.menu-item {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 32rpx 28rpx;
|
||||
transition: background 0.2s ease, transform 0.2s ease;
|
||||
|
||||
& + & {
|
||||
border-top: 1rpx solid $color-divider;
|
||||
}
|
||||
|
||||
&:active {
|
||||
background: $color-bg-page;
|
||||
transform: translateX(4rpx);
|
||||
}
|
||||
}
|
||||
|
||||
.menu-left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 20rpx;
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.menu-icon {
|
||||
width: 56rpx;
|
||||
height: 56rpx;
|
||||
@@ -343,55 +331,21 @@ function handleLogout() {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.menu-title {
|
||||
font-size: 30rpx;
|
||||
font-weight: 500;
|
||||
color: $color-text;
|
||||
}
|
||||
|
||||
.menu-right {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12rpx;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.menu-badge {
|
||||
font-size: 20rpx;
|
||||
font-weight: 600;
|
||||
color: #ffffff;
|
||||
background: linear-gradient(135deg, #3973ff 0%, #52a8ff 100%);
|
||||
background: linear-gradient(135deg, #2563eb 0%, #60a5fa 100%);
|
||||
padding: 6rpx 14rpx;
|
||||
border-radius: 12rpx;
|
||||
min-width: 36rpx;
|
||||
text-align: center;
|
||||
line-height: 1.4;
|
||||
box-shadow: 0 4rpx 12rpx rgba(57, 115, 255, 0.3);
|
||||
box-shadow: 0 4rpx 12rpx rgba(37, 99, 235, 0.3);
|
||||
}
|
||||
|
||||
.logout-btn {
|
||||
@include card;
|
||||
height: 100rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
.logout-wrap {
|
||||
margin-bottom: 12rpx;
|
||||
border-radius: 16rpx;
|
||||
background: linear-gradient(135deg, rgba(245, 108, 108, 0.1) 0%, rgba(245, 108, 108, 0.05) 100%);
|
||||
border: 1rpx solid rgba(245, 108, 108, 0.2);
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.logout-btn-hover {
|
||||
background: linear-gradient(135deg, rgba(245, 108, 108, 0.2) 0%, rgba(245, 108, 108, 0.1) 100%) !important;
|
||||
box-shadow: 0 4rpx 16rpx rgba(245, 108, 108, 0.15) !important;
|
||||
}
|
||||
|
||||
.logout-text {
|
||||
font-size: 32rpx;
|
||||
font-weight: 600;
|
||||
color: #f56c6c;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.bottom-space {
|
||||
|
||||
Reference in new issue
Block a user