first
This commit is contained in:
90
pages/history/history.wxml
Normal file
90
pages/history/history.wxml
Normal file
@@ -0,0 +1,90 @@
|
||||
<view class="container">
|
||||
<view class="header">
|
||||
<text class="title">我的梦境记录</text>
|
||||
<text class="count">{{records.length}} 条记录</text>
|
||||
</view>
|
||||
|
||||
<!-- 搜索框 -->
|
||||
<view class="search-box">
|
||||
<icon type="search" size="16" color="#999" class="search-icon" />
|
||||
<input
|
||||
class="search-input"
|
||||
placeholder="搜索标签或内容..."
|
||||
bindinput="onSearchChange"
|
||||
/>
|
||||
</view>
|
||||
|
||||
<!-- 标签筛选 -->
|
||||
<view class="filter-tags" wx:if="{{allTags.length > 0}}">
|
||||
<scroll-view scroll-x="true" class="tags-scroll">
|
||||
<view
|
||||
class="filter-tag {{selectedFilterTag === '' ? 'active' : ''}}"
|
||||
bindtap="selectFilterTag"
|
||||
data-tag=""
|
||||
>
|
||||
全部
|
||||
</view>
|
||||
<view
|
||||
wx:for="{{allTags}}"
|
||||
wx:key="index"
|
||||
class="filter-tag {{selectedFilterTag === item ? 'active' : ''}}"
|
||||
bindtap="selectFilterTag"
|
||||
data-tag="{{item}}"
|
||||
>
|
||||
{{item}}
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
|
||||
<!-- 记录列表 -->
|
||||
<view class="records-list">
|
||||
<view wx:if="{{filteredRecords.length === 0}}" class="empty-state">
|
||||
<icon type="sleep" size="60" color="#ccc" />
|
||||
<text class="empty-text">还没有记录呢</text>
|
||||
<text class="empty-desc">快去记录你的第一个梦境吧</text>
|
||||
<button
|
||||
class="add-btn"
|
||||
bindtap="navigateToRecord"
|
||||
>
|
||||
+ 记录新梦境
|
||||
</button>
|
||||
</view>
|
||||
|
||||
<view
|
||||
wx:for="{{filteredRecords}}"
|
||||
wx:key="id"
|
||||
class="record-item"
|
||||
bindtap="navigateToDetail"
|
||||
data-id="{{item.id}}"
|
||||
>
|
||||
<view class="record-header">
|
||||
<text class="record-title">{{item.title}}</text>
|
||||
<text class="record-date">{{item.date}}</text>
|
||||
</view>
|
||||
|
||||
<view class="record-preview">
|
||||
<text class="preview-text">
|
||||
{{item.plot.length > 50 ? item.plot.substring(0, 50) + '...' : item.plot || '点击查看详情'}}
|
||||
</text>
|
||||
</view>
|
||||
|
||||
<view class="record-tags">
|
||||
<view
|
||||
wx:for="{{item.tags}}"
|
||||
wx:key="index"
|
||||
class="record-tag"
|
||||
>
|
||||
{{item}}
|
||||
</view>
|
||||
|
||||
<view class="emotion-indicator" wx:if="{{item.emotion}}">
|
||||
<icon
|
||||
type="{{getEmotionIcon(item.emotion)}}"
|
||||
size="16"
|
||||
color="#4a6fa5"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
Reference in New Issue
Block a user