This commit is contained in:
zhu
2026-03-27 17:55:18 +08:00
parent ee03132cee
commit 382f6b9811
34 changed files with 1406 additions and 376 deletions

103
pages/chat/index.wxml Normal file
View File

@@ -0,0 +1,103 @@
<page-meta root-font-size="system"></page-meta>
<view class="bg-gradient c-container">
<t-navbar class="custom-top-navbar"
fixed="{{false}}"
title="AI健康管家">
</t-navbar>
<scroll-view class="silder"
scroll-top="{{scrollTop}}"
scroll-y>
<view class="chat-item {{item.chat_type == 1 ? 'user-msg' : 'ai-msg'}}"
id="chat-${{index}}"
wx:for="{{chatList}}"
wx:key="index">
<view class="lawyer-info flex-align"
wx:if="{{item.chat_type !=1}}">
<text>AI助手</text>
</view>
<!-- 显示图片格式 -->
<view wx:if="{{item.con_type == 2}}">
<image src="{{item.chat_content}}"
class="chat-image"
data-url="{{item.chat_content}}"
bind:tap="viewImg"
mode="aspectFill" />
</view>
<view class="chat-message "
wx:else>
<view class="loading"
wx:if="{{item.loading}}"></view>
<view wx:elif="{{item.tool}}">
{{item.tool}}
</view>
<view wx:elif="{{item.chat_type == 1}}">
{{item.chat_content}}
</view>
<towxml wx:elif="{{item.chat_type == 2}}"
data-text="{{item}}"
bind:longpress="copy"
nodes="{{item.md_content}}" />
<!-- 底部功能 -->
<view wx:if="{{item.chat_status == 2}}"
class="stop-tip">
(已停止)
</view>
<view class="m-footer flex-between"
wx:elif="{{item.end}}">
<view class="tip">
AI助手仅提供基于康复指南的一般性建议不构成医疗诊断。如遇紧急情况请立即就医
</view>
<view class="flex-align">
<t-icon name="file-copy"
class="sound-icon"
data-text="{{item}}"
bind:tap="copy" />
</view>
</view>
</view>
<!-- 快捷按钮 -->
<view class="quick-warpper"
wx:if="{{item.quick_btn.length > 0 && item.end}}">
<view class="quick-item quick-{{quick.type}} {{quick.color ? 'color' : ''}}"
wx:for="{{item.quick_btn}}"
style="background-color: {{quick.color}};"
wx:for-item="quick"
wx:key="index"
bind:tap="handQuick"
data-parent="{{item}}"
data-data="{{quick}}">
{{quick.text}}
</view>
</view>
</view>
</scroll-view>
<!-- 底部按钮 -->
<view class="bottom-position">
<!-- 输入框 -->
<view class="input-warpper flex-align">
<input placeholder="有什么问题尽管问我"
bindblur="bindkeyboardBlur"
bindinput="changeInput"
bindconfirm="submitInput"
value="{{inputText}}"
hold-keyboard="{{false}}"
adjust-position="{{false}}"
bindkeyboardheightchange="bindkeyboardheightchange" />
<view class="push-btn flex-center {{inputText !='' ? 'active-push' : ''}} "
wx:if="{{aiStatus==3}}"
bind:tap="submitInput">
<t-icon name="send-filled" />
</view>
<t-icon name="stop-circle-filled"
class="stop-btn"
bind:tap="stopMessage"
wx:else />
</view>
</view>
<!-- 占位撑高 -->
<view style="height: {{keyboardBottom}}px;"
class="empty"></view>
</view>