Files
memind/miniapp/pages/chat/index.wxml
john 048f25f580 feat(miniapp): add privacy consent and legal pages
Show privacy popup on launch, gate login on legal consent, and link
user agreement and privacy policy pages in the mini program.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-12 12:18:54 +08:00

77 lines
2.6 KiB
Plaintext

<view class="page chat-page">
<view class="chat-header">
<view class="chat-title">
<text>{{sessionId ? '继续会话' : '新会话'}}</text>
<text wx:if="{{error}}" class="header-error">{{error}}</text>
</view>
<view class="header-actions">
<button class="header-button" bindtap="startNewChat">新聊天</button>
<button class="header-button" bindtap="openLegalCenter">隐私</button>
<button class="header-button" bindtap="handleLogout">退出</button>
</view>
</view>
<scroll-view class="messages" scroll-y scroll-into-view="{{scrollIntoView}}">
<view wx:if="{{messages.length === 0 && !loading}}" class="empty-state">
<text>发一条消息开始使用 TKMind。</text>
</view>
<view wx:for="{{messages}}" wx:key="id" id="msg-{{index}}" class="message-row {{item.role}}">
<view class="message {{item.role}}">
<view class="message-body">
<block wx:for="{{item.parts || []}}" wx:for-item="part" wx:for-index="partIndex" wx:key="partIndex">
<text wx:if="{{part.type === 'text'}}" class="message-text">{{part.text}}</text>
<text
wx:elif="{{part.type === 'link'}}"
class="message-link"
bindtap="openLink"
data-url="{{part.url}}"
>{{part.text}}</text>
</block>
</view>
<view wx:if="{{item.pageLinks && item.pageLinks.length}}" class="page-links">
<view
wx:for="{{item.pageLinks}}"
wx:for-item="page"
wx:key="publicUrl"
class="page-link-card"
bindtap="openLink"
data-url="{{page.publicUrl}}"
>
<text class="page-link-title">{{page.title}}</text>
</view>
</view>
</view>
<view
class="message-copy"
bindtap="copyMessage"
data-text="{{item.copyText}}"
aria-role="button"
aria-label="复制"
>
<view class="copy-icon"></view>
</view>
</view>
<view wx:if="{{loading}}" class="message-row assistant">
<view class="message assistant">
<text class="message-text">正在思考...</text>
</view>
</view>
</scroll-view>
<view class="composer panel">
<input
class="input"
value="{{draft}}"
placeholder="输入你的问题,回车发送"
maxlength="2000"
confirm-type="send"
disabled="{{loading}}"
bindinput="handleInput"
bindconfirm="sendMessage"
/>
<button class="send" loading="{{loading}}" disabled="{{loading}}" bindtap="sendMessage">发送</button>
</view>
</view>
<privacy-popup />