This commit is contained in:
oneao committed 2025-10-08 21:21:01 +08:00
1 parent 8770e4fddc
commit 1806808d11
2 files changed
+160 -175

No files matched your search

@@ -23,83 +23,58 @@ function handleLoginOut() {
<template> <template>
<view class="account-container"> <view class="account-container">
<view class="account-header"> <view class="account-header">
<view class="header-bg" /> <sar-avatar background="#7f8c8d" color="#fff">
<view class="welcome"> A
<view class="welcome-title"> </sar-avatar>
{{ userStore.isLogined ? '✨ 您好,欢迎回来!' : '你好,请登录!' }} <view class="user-info">
</view> <text class="user-account">
<sar-tag v-if="userStore.isLogined" theme="primary" round> 123
已登录 </text>
</sar-tag> <text class="user-orgid">
<sar-tag v-else theme="secondary"> 123
未登录 </text>
</sar-tag>
</view>
<view class="info-row">
<sar-icon name="user" size="28rpx" color="#0064fa" />
<view class="info-label">
账号
</view>
<view class="info-value">
{{ userStore.isLogined ? userStore.userInfo.userid : '登录后查看' }}
</view>
</view>
<view class="info-row">
<sar-icon name="organization" size="28rpx" color="#0064fa" />
<view class="info-label">
机构码
</view>
<view class="info-value">
{{ userStore.isLogined ? userStore.userInfo.orgid : '登录后查看' }}
</view>
</view> </view>
</view> </view>
<sar-list style="margin-top: 32rpx;">
<sar-list-item title="修改密码" hover arrow /> <view class="actions">
<sar-list-item title="退出登录" hover arrow @click="handleLoginOut" /> <sar-list-item title="修改资料" />
</sar-list> <sar-list-item title="退出登录" value="值" />
</view>
</view> </view>
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
.account-header { .account-header {
position: relative; display: flex;
align-items: center;
padding: 40rpx 32rpx; padding: 40rpx 32rpx;
background-color: #fff; background-color: #2c3e50; /* 工业风深色 */
border-bottom-left-radius: 24rpx; border-radius: 2rpx; /* 轻微卡片感 */
border-bottom-right-radius: 24rpx; box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.15);
.welcome {
position: relative;
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 32rpx;
z-index: 1;
.welcome-title { .user-info {
font-weight: 600; display: flex;
flex-direction: column;
justify-content: center;
margin-left: 32rpx;
color: #fff;
.user-account {
font-size: 34rpx; font-size: 34rpx;
color: #222; font-weight: 600;
} line-height: 42rpx;
}
.info-row {
display: flex;
align-items: center;
font-size: 28rpx;
z-index: 1;
margin-top: 24rpx;
.info-label {
width: 120rpx;
color: #555;
} }
.info-value { .user-orgid {
flex: 1; font-size: 28rpx;
color: #111; margin-top: 6rpx;
font-weight: 500; color: #6b788e;
line-height: 34rpx;
} }
} }
} }
.actions{
margin-top: 32rpx;
}
</style> </style>
+121 -111
View File
@@ -1,128 +1,138 @@
<!doctype html> <!DOCTYPE html>
<html lang="zh-CN"> <html lang="zh-CN">
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>个人中心</title> <title>个人中心</title>
<style> <style>
body { :root {
margin: 0; --theme-color: #2c3e50;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; --text-main: #2c3e50;
background: #f2f3f5; --text-sub: #7f8c8d;
color: #2c3e50; --bg-light: #f4f5f7;
} --card-bg: #ffffff;
}
.profile-container { body {
max-width: 420px; margin: 0;
margin: 20px auto; font-family: "SF Pro Text", "Roboto", "Segoe UI", Arial, sans-serif;
padding: 16px; background: var(--bg-light);
} color: var(--text-main);
}
/* 用户信息头部 */ /* 卡片式 Header */
.profile-header { .header-card {
display: flex; background: var(--theme-color);
align-items: center; color: #fff;
background: #fff; margin: 20px 16px 0;
padding: 16px; padding: 20px;
border: 1px solid #dfe4ea; display: flex;
border-radius: 4px; /* 小圆角,偏工业 */ align-items: center;
} box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.avatar { .avatar {
width: 70px; width: 70px;
height: 70px; height: 70px;
background: #95a5a6; background: #7f8c8d;
color: #fff; color: #fff;
font-size: 28px; font-size: 28px;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
margin-right: 16px; margin-right: 20px;
} flex-shrink: 0;
}
.user-info { .user-info {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
} }
.user-name { .welcome {
font-size: 18px; font-size: 14px;
font-weight: 600; color: #c0cfd8;
margin-bottom: 6px; margin-bottom: 6px;
color: #2c3e50; }
}
.status { .user-name {
display: flex; font-size: 20px;
align-items: center; font-weight: 600;
font-size: 14px; margin-bottom: 8px;
color: #2c3e50; }
}
.status-dot { .user-details span {
width: 8px; display: block;
height: 8px; font-size: 14px;
border-radius: 50%; color: #d0d6db;
margin-right: 6px; line-height: 1.6;
background-color: #27ae60; /* 在线:绿色 */ }
}
/* 下方信息块 */ /* 操作按钮区 */
.info-list { .actions {
margin-top: 20px; margin: 28px 16px;
background: #fff; display: flex;
border: 1px solid #dfe4ea; flex-direction: column;
border-radius: 4px; gap: 12px;
} }
.info-item { .btn {
display: flex; background: var(--theme-color);
justify-content: space-between; color: #fff;
padding: 14px 16px; text-align: center;
font-size: 15px; padding: 14px 0;
border-bottom: 1px solid #e0e0e0; font-size: 15px;
} border: none;
border-radius: 2px;
cursor: pointer;
transition: 0.2s;
}
.info-item:last-child { .btn:hover {
border-bottom: none; background: #1e2d3a;
} }
.info-label { .btn.secondary {
color: #7f8c8d; background: transparent;
} color: var(--theme-color);
border: 1px solid var(--theme-color);
}
.info-value { .btn.secondary:hover {
font-weight: 500; background: rgba(44,62,80,0.05);
color: #2c3e50; }
}
</style>
</head>
<body>
<div class="profile-container">
<!-- 顶部用户信息 -->
<div class="profile-header">
<div class="avatar">U</div>
<div class="user-info">
<div class="user-name">张三</div>
<div class="status">
<div class="status-dot"></div>
在线
</div>
</div>
</div>
<!-- 下方账号和机构码 --> /* 底部 */
<div class="info-list"> .footer {
<div class="info-item"> text-align: center;
<span class="info-label">账号</span> margin-top: 32px;
<span class="info-value">zhangsan</span> font-size: 12px;
</div> color: #999;
<div class="info-item"> }
<span class="info-label">机构码</span> </style>
<span class="info-value">123456</span> </head>
</div> <body>
<!-- 卡片式 Header -->
<div class="header-card">
<div class="avatar">U</div>
<div class="user-info">
<div class="welcome">欢迎登录!</div>
<div class="user-name">张三</div>
<div class="user-details">
<span>账号:zhangsan</span>
<span>机构码:A-102938</span>
</div> </div>
</div> </div>
</body> </div>
<!-- 操作按钮区 -->
<div class="actions">
<button class="btn">修改资料</button>
<button class="btn secondary">退出登录</button>
</div>
<!-- 底部 -->
<div class="footer">© 2025 工业控制系统中心</div>
</body>
</html> </html>