2026-01-15 15:05:29 +08:00

45 lines
1.5 KiB
Plaintext

<view class="device-container">
<block wx:if="{{loading}}">
<!-- 加载中骨架屏 -->
<view wx:for="{{5}}" wx:key="index" class="skeleton-item">
<t-skeleton theme="paragraph" loading></t-skeleton>
</view>
</block>
<block wx:elif="{{loadError}}">
<!-- 加载错误提示 -->
<view class="error-container">
<t-empty icon="error-circle" description="加载失败,请下拉刷新重试" />
</view>
</block>
<block wx:elif="{{devices && devices.length > 0}}">
<!-- 设备列表 -->
<view class="device-list">
<block wx:for="{{devices}}" wx:key="id">
<view class="device-card" bindtap="viewSubDevices" data-device="{{item}}">
<view class="device-title">{{item.name}}</view>
<view class="device-info">
<view class="info-item usage">
<text>使用次数: {{item.usage_count || 0}}次</text>
</view>
<!-- 子设备数量显示 -->
<view class="info-item subdevice-count">
<text class="count">子设备: {{item.subDeviceCount}}个</text>
</view>
</view>
<view class="device-id-tag">ID: {{item.id}}</view>
</view>
</block>
</view>
</block>
<block wx:else>
<!-- 空数据提示 -->
<view class="empty-container">
<t-empty icon="device" description="暂无设备数据" />
</view>
</block>
</view>
<!-- Toast 消息提示 -->
<t-toast id="t-toast" />