|
@@ -1,12 +1,12 @@
|
|
|
<template>
|
|
|
<view id='app'>
|
|
|
<view class="placeholder"></view>
|
|
|
+ <view class="head">
|
|
|
+ <text>睿宝AI</text>
|
|
|
+ </view>
|
|
|
<view class="pageView">
|
|
|
<view class="sidebar-left"></view>
|
|
|
<view class="body">
|
|
|
- <view class="head">
|
|
|
- <text>睿宝AI</text>
|
|
|
- </view>
|
|
|
<view class="list-wrap">
|
|
|
<scroll-view id="content-box" scroll-y="true" class="scrollview" :scroll-top="msgList.scrollTop">
|
|
|
<!-- 聊天主体 -->
|
|
@@ -24,7 +24,8 @@
|
|
|
<loadingPointsVue></loadingPointsVue>
|
|
|
</view>
|
|
|
<view class="content left" v-if='!msgList.isloading[index]'>
|
|
|
- {{ msgList.otherChatList[index] }}</view>
|
|
|
+ {{ msgList.otherChatList[index] }}
|
|
|
+ </view>
|
|
|
</view>
|
|
|
<image class="avtar" src="../../static/Ai-avatar.png" mode="aspectFit"></image>
|
|
|
</view>
|
|
@@ -80,7 +81,7 @@
|
|
|
otherChatList: [],
|
|
|
len: 0,
|
|
|
isloading: [],
|
|
|
- isClick:false
|
|
|
+ isClick: false
|
|
|
})
|
|
|
|
|
|
// 发送消息
|
|
@@ -105,7 +106,7 @@
|
|
|
|
|
|
obj.otherContent = await GetNewsList(data)
|
|
|
|
|
|
- await sleep(16000);
|
|
|
+ // await sleep(16000);
|
|
|
getChatContent(obj.otherContent, msgList.len)
|
|
|
|
|
|
|
|
@@ -130,12 +131,12 @@
|
|
|
})
|
|
|
})
|
|
|
})
|
|
|
-
|
|
|
+
|
|
|
//滚动至聊天底部
|
|
|
- watch([msgList.otherChatList,msgList.chatList], (newVal) => {
|
|
|
+ watch([msgList.otherChatList, msgList.chatList], (newVal) => {
|
|
|
scrollToBottom()
|
|
|
})
|
|
|
-
|
|
|
+
|
|
|
// 调用数据接口
|
|
|
const GetNewsList = async (data) => {
|
|
|
msgList.chatMsg = ''
|
|
@@ -143,13 +144,13 @@
|
|
|
console.log(res)
|
|
|
return res
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// ------- 聊天逐字输出 -----------
|
|
|
// 延时函数
|
|
|
const sleep = ((delaytime = 10000) => {
|
|
|
return new Promise(resolve => setTimeout(resolve, delaytime));
|
|
|
})
|
|
|
-
|
|
|
+
|
|
|
// 逐字显示内容
|
|
|
const getChatContent = ((text, index) => {
|
|
|
console.log(index)
|
|
@@ -163,8 +164,8 @@
|
|
|
let nowStr = text.substring(0, msgList.textCount);
|
|
|
msgList.otherChatList[index - 1] = nowStr;
|
|
|
}
|
|
|
-
|
|
|
- }, 200);
|
|
|
+
|
|
|
+ }, 50);
|
|
|
console.log(msgList.timer)
|
|
|
msgList.textCount = 0
|
|
|
msgList.isloading[index - 1] = false
|