修改小程序及大屏

This commit is contained in:
2025-10-23 17:26:47 +08:00
parent 212dffd0da
commit 07bd3ce5da
90 changed files with 3348 additions and 3554 deletions

View File

@@ -113,7 +113,7 @@ Page({
onShow() {
// 每次显示页面时刷新数据
this.loadData();
this.loadUserData();
},
// 检查登录状态
@@ -127,7 +127,13 @@ Page({
}
},
// 加载用户数据
// 编辑个人资料
editProfile() {
wx.showToast({
title: '编辑功能开发中',
icon: 'none'
});
},
async loadUserData() {
try {
// 从本地存储获取用户信息

View File

@@ -2,3 +2,4 @@
"usingComponents": {},
"navigationBarTitleText": "我的"
}

View File

@@ -1,93 +1,57 @@
<!--pages/profile/profile.wxml-->
<view class="container">
<!-- 状态栏 -->
<view class="status-bar" style="height: {{statusBarHeight}}px;"></view>
<!-- 用户信息卡片 -->
<view class="user-card">
<view class="profile-container">
<!-- 用户信息头部 -->
<view class="profile-header">
<view class="user-avatar">
<image wx:if="{{userInfo.avatar}}" src="{{userInfo.avatar}}" class="avatar-img" mode="aspectFill" />
<image wx:else src="/images/avatar.png" class="avatar-img" />
</view>
<view class="user-info">
<view class="avatar-container" bindtap="onAvatarTap">
<image wx:if="{{userInfo.avatar}}" class="avatar" src="{{userInfo.avatar}}" mode="aspectFill" />
<view wx:else class="avatar-placeholder">
<text class="avatar-text">{{userInfo.name.charAt(0)}}</text>
</view>
<view class="avatar-badge">📷</view>
</view>
<view class="user-details">
<view class="user-name">{{userInfo.name}}</view>
<view class="user-account">账号: {{userInfo.account}}</view>
<view class="user-department">{{userInfo.department}}</view>
<view class="user-position">{{userInfo.position}}</view>
<view class="last-login">最后登录: {{userInfo.lastLoginTime}}</view>
</view>
<view class="username">{{userInfo.name || '西藏智慧三牧'}}</view>
<view class="user-role">{{userInfo.phone || '18003030830'}}</view>
</view>
</view>
<!-- 统计数据 -->
<view class="stats-section">
<view class="section-title">今日数据</view>
<view class="stats-grid">
<view class="stat-item">
<view class="stat-number">{{statsData.todayCheck}}</view>
<view class="stat-label">今日检查</view>
</view>
<view class="stat-item">
<view class="stat-number">{{statsData.totalFarmers}}</view>
<view class="stat-label">管理养殖户</view>
</view>
<view class="stat-item">
<view class="stat-number">{{statsData.totalAlerts}}</view>
<view class="stat-label">待处理告警</view>
</view>
<view class="stat-item">
<view class="stat-number">{{statsData.completedTasks}}</view>
<view class="stat-label">完成任务</view>
</view>
</view>
</view>
<!-- 快捷操作 -->
<view class="quick-actions-section">
<view class="section-title">快捷操作</view>
<view class="quick-actions">
<view
wx:for="{{quickActions}}"
wx:key="id"
class="quick-action-item"
style="background-color: {{item.color}}20;"
bindtap="onQuickActionTap"
data-id="{{item.id}}"
>
<view class="quick-action-icon" style="color: {{item.color}};">{{item.icon}}</view>
<view class="quick-action-title">{{item.title}}</view>
</view>
<view class="edit-btn" bindtap="editProfile">
<text class="edit-icon">✏️</text>
</view>
</view>
<!-- 功能菜单 -->
<view class="menu-section">
<view class="section-title">功能设置</view>
<view class="menu-list">
<view
wx:for="{{menuItems}}"
wx:key="id"
class="menu-item"
bindtap="onMenuItemTap"
data-id="{{item.id}}"
>
<view class="menu-icon">{{item.icon}}</view>
<view class="menu-content">
<view class="menu-title">{{item.title}}</view>
<view class="menu-desc">{{item.desc}}</view>
</view>
<view wx:if="{{item.arrow}}" class="menu-arrow">></view>
</view>
<view class="menu-item" bindtap="onMenuItemTap" data-id="system">
<view class="menu-icon">⚙️</view>
<view class="menu-text">系统设置</view>
<view class="menu-arrow">></view>
</view>
<view class="menu-item" bindtap="onMenuItemTap" data-id="trade">
<view class="menu-icon">📋</view>
<view class="menu-text">生资交易</view>
<view class="menu-arrow">></view>
</view>
<view class="menu-item" bindtap="onMenuItemTap" data-id="personnel">
<view class="menu-icon">👥</view>
<view class="menu-text">人员管理</view>
<view class="menu-arrow">></view>
</view>
<view class="menu-item" bindtap="onMenuItemTap" data-id="password">
<view class="menu-icon">👤</view>
<view class="menu-text">设置账号密码</view>
<view class="menu-arrow">></view>
</view>
</view>
<!-- 退出登录 -->
<view class="logout-section">
<button class="logout-btn" bindtap="onLogout">退出登录</button>
<button class="logout-btn" bindtap="onLogout">
<text class="logout-icon">🚪</text>
<text class="logout-text">退出登录</text>
</button>
</view>
<!-- 版本信息 -->
<view class="version-info">
<text class="version-text">版本 1.0.0</text>
</view>
</view>

View File

@@ -1,54 +1,150 @@
/* pages/profile/profile.wxss */
.container {
.profile-container {
min-height: 100vh;
background-color: #f5f5f5;
background: #f5f5f5;
padding: 0 0 40rpx 0;
}
.status-bar {
background-color: #2c5aa0;
}
/* 用户信息卡片 */
.user-card {
background: linear-gradient(135deg, #2c5aa0 0%, #4a7bc8 100%);
padding: 40rpx 30rpx 30rpx;
color: white;
}
.user-info {
/* 用户信息头部 */
.profile-header {
background: #4CAF50;
padding: 60rpx 40rpx 40rpx 40rpx;
display: flex;
align-items: center;
position: relative;
}
.avatar-container {
position: relative;
.user-avatar {
margin-right: 30rpx;
}
.avatar {
.avatar-img {
width: 120rpx;
height: 120rpx;
border-radius: 60rpx;
background: rgba(255, 255, 255, 0.2);
border: 4rpx solid rgba(255, 255, 255, 0.3);
}
.avatar-placeholder {
width: 120rpx;
height: 120rpx;
border-radius: 60rpx;
background-color: rgba(255, 255, 255, 0.2);
.user-info {
flex: 1;
}
.username {
font-size: 36rpx;
font-weight: 600;
color: #fff;
margin-bottom: 8rpx;
}
.user-role {
font-size: 28rpx;
color: rgba(255, 255, 255, 0.8);
}
.edit-btn {
position: absolute;
top: 60rpx;
right: 40rpx;
padding: 20rpx;
background: rgba(255, 255, 255, 0.2);
border-radius: 50%;
}
.edit-icon {
font-size: 32rpx;
color: #fff;
}
/* 功能菜单 */
.menu-section {
background: #fff;
margin: 20rpx 0;
border-radius: 16rpx;
overflow: hidden;
}
.menu-item {
display: flex;
align-items: center;
padding: 32rpx 40rpx;
border-bottom: 1rpx solid #f0f0f0;
position: relative;
}
.menu-item:last-child {
border-bottom: none;
}
.menu-item:active {
background: #f8f8f8;
}
.menu-icon {
font-size: 36rpx;
margin-right: 24rpx;
width: 40rpx;
text-align: center;
}
.menu-text {
flex: 1;
font-size: 32rpx;
color: #333;
}
.menu-arrow {
font-size: 28rpx;
color: #999;
}
/* 退出登录 */
.logout-section {
margin: 20rpx 0;
padding: 0 0 40rpx 0;
}
.logout-btn {
width: 100%;
height: 88rpx;
background: #fff;
border: 2rpx solid #ff4d4f;
border-radius: 16rpx;
display: flex;
align-items: center;
justify-content: center;
border: 4rpx solid rgba(255, 255, 255, 0.3);
font-size: 32rpx;
color: #ff4d4f;
font-weight: 500;
margin: 0 0 0 0;
}
.avatar-text {
font-size: 48rpx;
font-weight: bold;
color: white;
.logout-btn:active {
background: #fff2f0;
}
.logout-icon {
font-size: 32rpx;
margin-right: 16rpx;
}
.logout-text {
font-size: 32rpx;
}
/* 版本信息 */
.version-info {
text-align: center;
padding: 40rpx 0;
}
.version-text {
font-size: 24rpx;
color: #999;
}
.avatar-badge {
position: absolute;
bottom: 0;
@@ -178,11 +274,12 @@
/* 功能菜单 */
.menu-section {
background-color: white;
margin: 20rpx;
border-radius: 16rpx;
padding: 30rpx;
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.1);
margin: 25rpx 30rpx;
background: #ffffff;
border-radius: 20rpx;
padding: 35rpx 30rpx;
box-shadow: 0 8rpx 25rpx rgba(0, 0, 0, 0.08);
border: 1rpx solid rgba(76, 175, 80, 0.1);
}
.menu-list {
@@ -192,9 +289,10 @@
.menu-item {
display: flex;
align-items: center;
padding: 24rpx 0;
border-bottom: 1rpx solid #f0f0f0;
transition: background-color 0.3s ease;
padding: 28rpx 0;
border-bottom: 1rpx solid rgba(76, 175, 80, 0.1);
transition: all 0.3s ease;
position: relative;
}
.menu-item:last-child {
@@ -202,17 +300,23 @@
}
.menu-item:active {
background-color: #f8f9fa;
background-color: rgba(76, 175, 80, 0.05);
border-radius: 12rpx;
margin: 0 -15rpx;
padding: 28rpx 15rpx;
}
.menu-icon {
width: 48rpx;
height: 48rpx;
margin-right: 24rpx;
font-size: 36rpx;
width: 52rpx;
height: 52rpx;
margin-right: 28rpx;
font-size: 40rpx;
display: flex;
align-items: center;
justify-content: center;
background: linear-gradient(145deg, #f8f9fa, #ffffff);
border-radius: 26rpx;
box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.08);
}
.menu-content {
@@ -220,9 +324,63 @@
}
.menu-title {
font-size: 30rpx;
color: #333;
margin-bottom: 4rpx;
font-size: 32rpx;
color: #2c3e50;
margin-bottom: 6rpx;
font-weight: 600;
}
.menu-desc {
font-size: 26rpx;
color: #5a6c7d;
font-weight: 400;
}
.menu-arrow {
font-size: 28rpx;
color: #4CAF50;
font-weight: 600;
}
/* 退出登录 */
.logout-section {
margin: 25rpx 30rpx;
padding-bottom: 40rpx;
}
.logout-btn {
width: 100%;
background: linear-gradient(135deg, #f44336 0%, #e57373 100%);
color: white;
border: none;
border-radius: 20rpx;
padding: 35rpx;
font-size: 34rpx;
font-weight: 700;
box-shadow: 0 8rpx 20rpx rgba(244, 67, 54, 0.3);
transition: all 0.3s ease;
position: relative;
overflow: hidden;
}
.logout-btn::before {
content: '';
position: absolute;
top: 0;
left: -100%;
width: 100%;
height: 100%;
background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
transition: left 0.5s ease;
}
.logout-btn:active {
transform: scale(0.98);
box-shadow: 0 4rpx 12rpx rgba(244, 67, 54, 0.4);
}
.logout-btn:active::before {
left: 100%;
}
.menu-desc {