| | |
| | | <text class="font40 ywicon icon-liebiao " bindtap="chatRoomListClick"></text> |
| | | <text class="font40 ywicon icon-jia " bind:tap="newChatRoomClick"></text> |
| | | </view> |
| | | <view class="flex-auto flex flex-col overflow-y-auto"> |
| | | <view class="flex {{item.role===RoleEnum.user ? 'user':'assistant'}} {{index===0 ? 'mt-0':'mt-30'}}" wx:for="{{chatHistory}}" wx:key="index"> |
| | | <view class="chat-bubble"> |
| | | <!-- <knowledge></knowledge> --> |
| | | <!-- 出错 --> |
| | | <!-- <text>你好啊手动阀手动阀</text> --> |
| | | <scroll-view class="flex-auto flex flex-col overflow-y-auto" scroll-y="true" scroll-into-view="{{toViewId}}"> |
| | | <view class="h-full flex flex-col"> |
| | | <block wx:if="{{activeChatRoom&& activeChatRoom.isInitial}}"> |
| | | <view class="ml-10 "> |
| | | <view class="robot-tip mt-10 p-20"><text class="font24 "><text style="font-style: italic; line-height: 50rpx;font-size: 28rpx;font-weight: 550;">欢迎来到AI世界, |
| | | </text>你可以和他对话得到想要得答案 |
| | | 试试点击下方问题 |
| | | </text> |
| | | </view> |
| | | </view> |
| | | <view class="mx-10 mt-50 font-24"> |
| | | <view class="bg-gray-200 rounded-lg p-20 {{index===0 ? 'mt-0':'mt-20'}}" wx:for="{{displaySampleList}}" style="width: fit-content;" bind:tap="sampleClick" data-item="{{item}}"> |
| | | <view class="over-ellisis-2 " style="width: fit-content;font-size: 24rpx;"> |
| | | {{item.sample_title}} |
| | | </view> |
| | | </view> |
| | | <view class="w-300 ml-auto mr-auto mt-30 text-white font28 py-18" style="text-align: center;background: linear-gradient(to right,#37d0e0,#5988e0);border-radius: 300rpx"> |
| | | <text class="ywicon icon-maikefeng"></text> |
| | | 开启语音对话吧~ |
| | | </view> |
| | | </view> |
| | | </block> |
| | | <block wx:else> |
| | | <view class="flex {{item.role===RoleEnum.user ? 'user':'assistant'}} {{index===0 ? 'mt-0':'mt-30'}}" wx:for="{{chatHistory}}" wx:key="index" id="chat-item-{{index}}"> |
| | | <view class="chat-bubble"> |
| | | <chat-loading wx:if="{{isTalking && index===chatHistory.length-1}}" data="{{processText}}"></chat-loading> |
| | | |
| | | <block wx:if="{{ item.content.errCode === ErrorCode.Message}}"> |
| | | <normal-text data="{{item.content.errMsg}}" color="#ef4444"></normal-text> |
| | | </block> |
| | | <block wx:else> |
| | | <block wx:if="{{ item.content.errCode === ErrorCode.Message}}"> |
| | | <normal-text data="{{item.content.errMsg}}" color="#ef4444"></normal-text> |
| | | </block> |
| | | <block wx:else> |
| | | <normal-text wx:if="{{item.content.type===AnswerType.Text}}" data="{{item.content.values}}"></normal-text> |
| | | <knowledge wx:elif="{{item.content.type===AnswerType.Knowledge}}" data="{{item.content.values}}"></knowledge> |
| | | <summary-wrapper wx:elif="{{item.content.type===AnswerType.Summary}}" data="{{item.content.values}}" originData="{{item.content.origin}}"></summary-wrapper> |
| | | </block> |
| | | </block> |
| | | </view> |
| | | <image src="{{roleImageMap[item.role]}}" class="size-55 flex-0"></image> |
| | | </view> |
| | | |
| | | </block> |
| | | |
| | | <block wx:else> |
| | | <normal-text wx:if="{{item.content.type===AnswerType.Text}}" data="{{item.content.values}}"></normal-text> |
| | | <knowledge wx:elif="{{item.content.type===AnswerType.Knowledge}}" data="{{item.content.values}}"></knowledge> |
| | | <summary-wrapper wx:elif="{{item.content.type===AnswerType.Summary}}" data="{{item.content.values}}" originData="{{item.content.origin}}"></summary-wrapper> |
| | | </block> |
| | | |
| | | |
| | | </view> |
| | | <image src="{{roleImageMap[item.role]}}" class="size-55 flex-0"></image> |
| | | </view> |
| | | |
| | | <!-- <van-button type="default">默认按钮</van-button> |
| | | <van-button type="primary">主要按钮</van-button> |
| | | <van-button type="info">信息按钮</van-button> |
| | | <van-button type="warning">警告按钮</van-button> |
| | | <van-button type="danger">危险按钮</van-button> --> |
| | | </view> |
| | | </scroll-view> |
| | | </view> |
| | | <view class="flex-0 flex-items-center py-20" style="background-color: #f4f6f8;"> |
| | | <text class="font35 ywicon icon-fenxiang flex-0 mx-15"></text> |
| | | <van-field left-icon="replay" custom-class="py-3 flex-items-center" input-class="ml-10" type="textarea" autosize placeholder="你是谁?" class="flex-auto" model:value="{{sendText}}" bind:change="onSendTextChange"></van-field> |
| | | <text class="font35 ywicon {{!sendText? 'icon-dianhua1':'icon-fasongxiaoxi'}} flex-0 mx-15"></text> |
| | | <text class="font46 ywicon icon-fenxiang flex-0 mx-15"></text> |
| | | <van-field left-icon="replay" custom-class="py-3 flex-items-center van-field" input-class="ml-10" type="textarea" autosize placeholder="在这里输入你的问题" class="flex-auto" model:value="{{sendText}}" bind:change="onSendTextChange" size="large"></van-field> |
| | | <text class="font45 ywicon {{!sendText? 'icon-dianhua1':'icon-fasongxiaoxi'}} flex-0 mx-15" bind:tap="inputRighBtnClick"></text> |
| | | </view> |
| | | <fui-drawer model:show="{{drawerIsShow}}" direction="left"> |
| | | <view class="w-450 flex flex-col relative" style="height: calc(100% - 90rpx)"> |
| | | <view class="w-450 flex flex-col relative h-full" > |
| | | <text class="ywicon icon-guanbi absolute right-10 top-10" bindtap="drawerCloseClick"></text> |
| | | <view class="p-15 flex flex-col justify-between" style="background-color: #e8f0fd;"> |
| | | <view class="flex-items-center"> |
| | |
| | | <text class="text-gray-400 ">历史记录</text> |
| | | <!-- <text class="text-blue-400">一键清空所有</text> --> |
| | | </view> |
| | | <view class="flex-auto font25 overflow-y-auto my-20"> |
| | | <scroll-view class="flex-auto font25 overflow-y-auto my-20" scroll-y="{{true}}"> |
| | | <view class="flex-items-center justify-between {{index===0 ? 'mt-0':'mt-24'}}" wx:for="{{chatRoomList}}" wx:key="id" data-item="{{item}}" bindtap="chatRoomClick"> |
| | | <view class="flex-auto flex-items-center" style="color:{{activeChatRoom.id===item.id ?'#35cfab':''}}"> |
| | | <text class="ywicon icon-xiaoxi1 mr-6"></text> |
| | |
| | | </view> |
| | | <text class="ywicon icon-shanchu ml-30" data-item="{{item}}" catchtap="delChatRoomClick"></text> |
| | | </view> |
| | | </view> |
| | | </scroll-view> |
| | | </view> |
| | | </view> |
| | | </fui-drawer> |