fix: index page center-aligned layout for device card

这个提交包含在:
Guoguo
2026-05-18 05:57:47 -07:00
父节点 b9a4f484bb
当前提交 fda403d6a9
修改 2 个文件,包含 27 行新增35 行删除
+5 -9
查看文件
@@ -18,18 +18,14 @@
<view class="page-content" wx:if="{{!loading && hasDevice}}">
<view class="device-card">
<view class="device-card-top">
<view class="device-icon">💆</view>
<view class="device-info">
<view class="device-name">{{deviceName || '我的光面膜'}}</view>
<view class="device-meta">
<view class="device-card-icon">💆</view>
<view class="device-card-name">{{deviceName || '光子美容仪'}}</view>
<view class="device-card-status">
<text class="status-badge status-badge-green" wx:if="{{connected}}">已连接</text>
<text class="status-badge" style="background:#ccc;" wx:else>未连接</text>
<text class="device-battery-text" wx:if="{{connected}}">🔋 {{battery}}%</text>
<text class="device-card-battery" wx:if="{{connected}}">🔋 {{battery}}%</text>
</view>
</view>
</view>
<button class="btn-reconnect" bindtap="onConnectBle" wx:if="{{hasDevice && !connected}}">重新连接</button>
<button class="btn-reconnect" bindtap="onConnectBle" wx:if="{{!connected}}">重新连接</button>
</view>
<view class="sub-info" bindtap="onViewSubscription">
+20 -24
查看文件
@@ -22,38 +22,31 @@
.device-card {
background: #fff;
border-radius: 16rpx;
padding: 28rpx;
padding: 36rpx 28rpx;
text-align: center;
}
.device-card-top {
display: flex;
align-items: center;
gap: 20rpx;
.device-card-icon {
font-size: 80rpx;
margin-bottom: 12rpx;
}
.device-icon {
font-size: 64rpx;
flex-shrink: 0;
}
.device-info {
flex: 1;
}
.device-name {
font-size: 32rpx;
.device-card-name {
font-size: 34rpx;
font-weight: 600;
color: #333;
margin-bottom: 16rpx;
}
.device-card-status {
display: flex;
align-items: center;
justify-content: center;
gap: 16rpx;
margin-bottom: 8rpx;
}
.device-meta {
display: flex;
align-items: center;
gap: 16rpx;
}
.device-battery-text {
.device-card-battery {
font-size: 24rpx;
color: #666;
}
@@ -61,7 +54,7 @@
.btn-reconnect {
display: block;
width: 100%;
margin-top: 20rpx;
margin-top: 24rpx;
padding: 20rpx;
background: #f5f5f5;
color: #E6508C;
@@ -91,6 +84,7 @@
padding: 24rpx;
margin-top: 20rpx;
}
.sub-info-left {
display: flex;
align-items: center;
@@ -98,9 +92,11 @@
font-size: 28rpx;
color: #333;
}
.sub-info-icon {
font-size: 32rpx;
}
.sub-info-arrow {
color: #999;
font-size: 32rpx;