[AI Generated]: feat(device): 设备列表添加 scroll-view 支持滚动,优化布局结构

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
17792275749
2026-05-26 14:36:01 +08:00
co-authored by Claude Sonnet 4.6
parent 0a05fde0ba
commit 14ec4fe177
2 changed files with 174 additions and 163 deletions
+40 -36
View File
@@ -5,49 +5,53 @@
<!-- 设备卡片列表 -->
<view class="device-list">
<block wx:for="{{ deviceList }}" wx:key="id">
<view class="device-card">
<scroll-view class="scrollView" scroll-y>
<view class="scroll-view-content">
<block wx:for="{{ deviceList }}" wx:key="id">
<view class="device-card">
<!-- 上半:图标 + 设备信息 + 状态(色点 + 文字) -->
<view class="card-top">
<image class="card-icon" src="/images/device/{{ item.scaleDeviceName }}.png" mode="aspectFit"></image>
<view class="card-info">
<view class="card-name">{{ item.scaleDeviceName }}</view>
<view class="card-status">
<!-- 已连接:绿点 + "已连接" -->
<block wx:if="{{ item.connected }}">
<view class="card-dot card-dot-on"></view>
<text class="card-status-text card-status-on">已连接</text>
</block>
<!-- 未连接:红点 + "未连接" -->
<block wx:else>
<view class="card-dot card-dot-off"></view>
<text class="card-status-text card-status-off">未连接</text>
</block>
<!-- 上半:图标 + 设备信息 + 状态(色点 + 文字) -->
<view class="card-top">
<image class="card-icon" src="/images/device/{{ item.scaleDeviceName }}.png" mode="aspectFit"></image>
<view class="card-info">
<view class="card-name">{{ item.scaleDeviceName }}</view>
<view class="card-status">
<!-- 已连接:绿点 + "已连接" -->
<block wx:if="{{ item.connected }}">
<view class="card-dot card-dot-on"></view>
<text class="card-status-text card-status-on">已连接</text>
</block>
<!-- 未连接:红点 + "未连接" -->
<block wx:else>
<view class="card-dot card-dot-off"></view>
<text class="card-status-text card-status-off">未连接</text>
</block>
</view>
</view>
</view>
</view>
</view>
<!-- 分隔线 -->
<view class="card-divider"></view>
<!-- 分隔线 -->
<view class="card-divider"></view>
<!-- 下半:操作按钮(单/双形态) -->
<block wx:if="{{ item.connected }}">
<!-- 已连接:单按钮居中 -->
<view class="card-actions card-actions-single">
<view class="btn-ghost-full" bind:tap="onTapMember">成员管理</view>
</view>
</block>
<block wx:else>
<!-- 未连接:双按钮 连接 / 成员管理 -->
<view class="card-actions card-actions-double">
<view class="btn-ghost-half" data-connect-device-info="{{ item.connectDeviceInfo }}" bind:tap="onTapConnect">连接</view>
<view class="btn-ghost-half" bind:tap="onTapMember">成员管理</view>
</view>
</block>
<!-- 下半:操作按钮(单/双形态) -->
<block wx:if="{{ item.connected }}">
<!-- 已连接:单按钮居中 -->
<view class="card-actions card-actions-single">
<view class="btn-ghost-full" bind:tap="onTapMember">成员管理</view>
</view>
</block>
<block wx:else>
<!-- 未连接:双按钮 连接 / 成员管理 -->
<view class="card-actions card-actions-double">
<view class="btn-ghost-half" data-connect-device-info="{{ item.connectDeviceInfo }}" bind:tap="onTapConnect">连接</view>
<view class="btn-ghost-half" bind:tap="onTapMember">成员管理</view>
</view>
</block>
</view>
</block>
</scroll-view>
</view>
<!-- 底部「添加设备」主按钮 -->