STM32_KQZLJC/minicode-1/pages/logs/logs.wxml

62 lines
1.9 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<view class="container">
<!-- 顶部标题栏 -->
<view class="header">
<view class="back-btn" bindtap="goBack">
<text class="back-icon">←</text>
<text class="back-text">返回</text>
</view>
<text class="title">蓝牙数据日志</text>
<button class="clear-btn" bindtap="clearLogs">
清空
</button>
</view>
<!-- 日志统计 -->
<view class="stats-bar">
<text class="stats-text">共 {{logs.length}} 条记录</text>
<text class="last-update" wx:if="{{logs.length > 0}}">
最后更新: {{logs[0].time}}
</text>
</view>
<!-- 日志列表 -->
<view class="logs-list">
<!-- 空状态 -->
<view wx:if="{{logs.length === 0}}" class="empty-state">
<view class="empty-icon">📋</view>
<text class="empty-text">暂无蓝牙数据日志</text>
<text class="empty-hint">连接蓝牙设备后,数据将自动记录到此处</text>
</view>
<!-- 日志列表项 -->
<view
wx:for="{{logs}}"
wx:key="{{index}}"
class="log-item"
data-index="{{index}}"
>
<view class="log-header">
<text class="log-time">{{item.time}}</text>
<view class="log-type {{item.type}}">
<text class="type-text">{{item.type === 'data' ? '数据' : '系统'}}</text>
</view>
</view>
<view class="log-content">
<text class="log-data" wx:if="{{item.type === 'data'}}">
{{item.data}}
</text>
<text class="log-message" wx:else>
{{item.message}}
</text>
</view>
<view class="log-details" wx:if="{{item.details}}">
<text class="details-text">{{item.details}}</text>
</view>
</view>
</view>
<!-- 底部提示 -->
<view class="footer-tips">
<text class="tips-text">💡 提示日志记录最多保存100条超出后会自动清理最早的记录</text>
</view>
</view>