zhuyuan-ice-gl-zy001/~/Projects/guanghulab-miniapp/pages/index/index.wxml

43 lines
1.5 KiB
Text
Raw 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="page">
<!-- 顶部:搜索 + AI 问答入口 -->
<view class="topbar">
<view class="search-wrap">
<input class="search" placeholder="搜知识库…" placeholder-class="ph"
value="{{keyword}}" bindinput="onSearchInput" confirm-type="search" />
</view>
<view class="ai-btn" bindtap="onAskAI">问 AI</view>
</view>
<!-- 标签筛选 -->
<scroll-view class="tags" scroll-x enable-flex>
<view wx:for="{{tags}}" wx:key="*this"
class="tag-chip {{item === activeTag ? 'tag-active' : ''}}"
data-tag="{{item}}" bindtap="onTapTag">{{item}}</view>
</scroll-view>
<!-- 卡片流 -->
<view wx:for="{{notes}}" wx:key="id" class="card note-card"
data-id="{{item.id}}" bindtap="onTapNote">
<view class="note-head">
<text class="note-title">{{item.title}}</text>
<text class="lock">{{item.visibility === 'private' ? '🔒' : '🌐'}}</text>
</view>
<view class="note-summary">{{item.summary}}</view>
<view class="note-foot">
<view class="note-tags">
<text wx:for="{{item.tags}}" wx:for-item="t" wx:key="*this" class="tag">{{t}}</text>
</view>
<view class="note-meta">
<text wx:if="{{item.aiReadable}}" class="ai-eye">AI👁</text>
<text class="time">{{item.updatedAt}}</text>
</view>
</view>
</view>
<view wx:if="{{!notes.length}}" class="empty">湖面平静,还没有条目</view>
<!-- 新建按钮 -->
<view class="fab" bindtap="onTapAdd">+</view>
</view>