[AI Generated]: refactor(Views): 优化设备成员页结构与样式细节

This commit is contained in:
17792275749
2026-05-12 11:10:18 +08:00
parent d520bc275a
commit 6a4f09e0a0
2 changed files with 376 additions and 10 deletions
@@ -0,0 +1,300 @@
.equipmentMember {
width: 100%;
height: 100%;
/* 顶部浅红提示条(未连接态) */
.tips {
width: 100%;
height: 56rpx;
display: flex;
padding-left: 30rpx;
align-items: center;
flex-shrink: 0;
box-sizing: border-box;
background-color: rgba(255, 77, 79, 0.12);
.tips-icon {
color: #FF4D4F;
width: 28rpx;
height: 28rpx;
font-size: 20rpx;
font-weight: bold;
margin-right: 10rpx;
line-height: 24rpx;
text-align: center;
border-radius: 50%;
box-sizing: border-box;
border: 1rpx solid #FF4D4F;
}
.tips-text {
color: #FF4D4F;
height: 24rpx;
font-size: 24rpx;
line-height: 24rpx;
}
}
.seaction {
width: 100%;
height: 100%;
padding: 24rpx 30rpx 0 ;
box-sizing: border-box;
/* 设备卡(大卡:左插画 + 右信息) */
.device-card {
width: 100%;
display: flex;
align-items: center;
padding: 30rpx;
border-radius: 20rpx;
box-sizing: border-box;
margin-bottom: 24rpx;
background-color: #FFFFFF;
.device-illustration {
width: 90rpx;
height: 90rpx;
border-radius: 24rpx;
margin-right: 24rpx;
background-color: rgba(19, 133, 250, 0.12);
}
.device-info {
flex: 1;
height: auto;
.device-name {
color: #252535;
height: 32rpx;
font-size: 32rpx;
font-weight: bold;
line-height: 32rpx;
margin-bottom: 10rpx;
}
.device-status {
height: 28rpx;
display: flex;
align-items: center;
.status-dot {
width: 12rpx;
height: 12rpx;
border-radius: 50%;
margin-right: 10rpx;
}
.status-dot-on {
background-color: #2AC79F;
}
.status-dot-off {
background-color: #B6B6B6;
}
.status-text {
color: #77849E;
height: 28rpx;
font-size: 28rpx;
line-height: 28rpx;
}
}
}
}
/* 成员卡(容量小标题 + 列表整体白卡) */
.member-card {
width: 100%;
margin-bottom: 40rpx;
border-radius: 20rpx;
background-color: #FFFFFF;
/* 容量小标题 */
.member-card-header {
width: 100%;
height: 88rpx;
display: flex;
padding: 0 30rpx;
box-sizing: border-box;
border-bottom: 1rpx solid #EAECF1;
justify-content: space-between;
.capacity-label {
color: #252535;
height: 88rpx;
font-size: 30rpx;
font-weight: bold;
line-height: 88rpx;
}
.capacity-value {
color: #1385FA;
height: 88rpx;
font-size: 28rpx;
font-weight: bold;
line-height: 88rpx;
}
}
/* 列表 */
.member-card-list {
width: 100%;
padding: 0 30rpx;
box-sizing: border-box;
.member-item {
width: 100%;
display: flex;
align-items: center;
padding: 20rpx 0;
box-sizing: border-box;
border-bottom: 1rpx solid #F0F0F2;
&:last-child {
border-bottom: none;
}
.member-avatar {
width: 90rpx;
height: 90rpx;
border-radius: 20rpx;
margin-right: 24rpx;
box-sizing: border-box;
border: 3rpx solid #50A6FF;
}
.member-info {
flex: 1;
display: flex;
flex-flow: column;
justify-content: center;
overflow: hidden;
.member-name-row {
height: 40rpx;
display: flex;
align-items: center;
margin-bottom: 16rpx;
.member-name {
color: #252535;
height: 40rpx;
font-size: 32rpx;
font-weight: bold;
line-height: 40rpx;
margin-right: 20rpx;
}
}
.member-meta {
height: 26rpx;
display: flex;
align-items: center;
.meta-text {
color: #77849E;
height: 26rpx;
font-size: 26rpx;
line-height: 26rpx;
}
.meta-divider {
color: #B6B6B6;
height: 26rpx;
font-size: 26rpx;
line-height: 26rpx;
margin: 0 12rpx;
}
}
}
/* 右侧:badge 或纯文字编辑/删除 */
.member-actions {
height: 48rpx;
display: flex;
align-items: center;
flex-shrink: 0;
.action-text {
color: #808080;
height: 48rpx;
font-size: 24rpx;
line-height: 46rpx;
margin-left: 20rpx;
border-radius: 8rpx;
box-sizing: border-box;
padding: 0 20rpx;
border: 1rpx solid #E6E6EA;
}
.action-text-danger {
color: #FF4D4F;
border: 1rpx solid #FF4D4F;
}
}
}
}
}
/* 通用 badge(本人 / 他人添加) */
.badge {
height: 40rpx;
padding: 0 18rpx;
font-size: 24rpx;
line-height: 40rpx;
border-radius: 8rpx;
}
.badge-self {
color: #1385FA;
background-color: rgba(19, 133, 250, 0.12);
}
.badge-other {
color: #77849E;
background-color: rgba(0, 0, 0, 0);
}
/* 底部添加成员按钮 */
.add-member {
width: 580rpx;
height: 88rpx;
display: flex;
align-items: center;
justify-content: center;
margin: 0 auto;
border-radius: 44rpx;
background-color: #1385FA;
.add-member-icon {
color: #FFFFFF;
width: 32rpx;
font-size: 28rpx;
font-weight: bold;
height: 32rpx;
line-height: 30rpx;
border-radius: 50%;
text-align: center;
margin-right: 15rpx;
border: 2rpx solid #ffffff;
}
.add-member-text {
color: #FFFFFF;
height: 88rpx;
font-size: 32rpx;
font-weight: bold;
line-height: 88rpx;
text {
font-weight: 500;
}
}
}
.add-member-disabled {
opacity: 0.4;
}
}
}
@@ -1,15 +1,81 @@
<view class="equipmentMember">
<block>
<view class="tips"></view>
<!-- 未连接提示条 -->
<block wx:if="{{ !connected }}">
<view class="tips">
<view class="tips-icon">!</view>
<text class="tips-text">设备未连接,请前往连接</text>
</view>
</block>
<view class="member-card">
<view class="member-card-header"></view>
<view class="member-card-List"></view>
</view>
<view class="seaction">
<!-- 设备卡 -->
<view class="device-card">
<view class="device-illustration"></view>
<view class="device-info">
<view class="device-name">{{ deviceCard.name }}</view>
<view class="device-status">
<view class="status-dot {{ connected ? 'status-dot-on' : 'status-dot-off' }}"></view>
<view class="status-text">{{ connected ? '蓝牙已连接' : '未连接' }}</view>
</view>
</view>
</view>
<view class="add-member">
<view></view>
<view>添加成员(最多10位)</view>
<!-- 成员卡(容量 + 列表) -->
<view class="member-card">
<!-- 设备容量(仅已连接态) -->
<block wx:if="{{ connected }}">
<view class="member-card-header">
<view class="capacity-label">设备容量</view>
<view class="capacity-value">
{{ deviceCard.capacityUsed }}/{{ deviceCard.capacityTotal }}
</view>
</view>
</block>
<!-- 成员列表 -->
<scroll-view scroll-y class="member-card-list">
<block wx:for="{{ memberList }}" wx:key="id">
<view class="member-item">
<!-- 头像色块 -->
<view class="member-avatar" style="background: {{ item.avatar }};"></view>
<!-- 信息列 -->
<view class="member-info">
<view class="member-name-row">
<view class="member-name">{{ item.name }}</view>
<block wx:if="{{ item.isSelf }}">
<view class="badge badge-self">本人</view>
</block>
</view>
<view class="member-meta">
<text class="meta-text">{{ item.gender }}</text>
<text class="meta-divider">·</text>
<text class="meta-text">{{ item.age }}岁</text>
<text class="meta-divider">|</text>
<text class="meta-text">{{ item.height }}cm</text>
</view>
</view>
<!-- 右侧:他人添加 badge 或 纯文字编辑/删除 -->
<view class="member-actions">
<block wx:if="{{ item.isFromOther }}">
<view class="badge badge-other">他人添加</view>
</block>
<block wx:elif="{{ !item.isSelf }}">
<view class="action-text" data-id="{{ item.id }}" bind:tap="onTapEdit">编辑</view>
<view class="action-text action-text-danger" data-id="{{ item.id }}" bind:tap="onTapDelete">删除</view>
</block>
</view>
</view>
</block>
</scroll-view>
</view>
<!-- 底部添加成员按钮 -->
<view class="add-member {{ connected ? '' : 'add-member-disabled' }}" bind:tap="onTapAddMember">
<view class="add-member-icon">+</view>
<view class="add-member-text">添加成员<text>(最多10位)</text></view>
</view>
</view>
</view>
</view>