|
@@ -4,21 +4,22 @@
|
|
<!-- <img class="absolute h-full" :src="baseApi + info.picture" alt=""> -->
|
|
<!-- <img class="absolute h-full" :src="baseApi + info.picture" alt=""> -->
|
|
<div class="top bg-white px-2 flex justify-between">
|
|
<div class="top bg-white px-2 flex justify-between">
|
|
<el-button class="tm_button" type="info" icon="el-icon-arrow-left" circle @click="goBack"></el-button>
|
|
<el-button class="tm_button" type="info" icon="el-icon-arrow-left" circle @click="goBack"></el-button>
|
|
|
|
+ <div v-if="sceneId" class=" text-sm" style="max-width: 50%;">已进入场景:{{ sceneInfo.sceneName }}</div>
|
|
<div class="flex">
|
|
<div class="flex">
|
|
<el-button class="tm_button" type="info" circle>
|
|
<el-button class="tm_button" type="info" circle>
|
|
<i class="fa-solid fa-volume-high text-sm"></i>
|
|
<i class="fa-solid fa-volume-high text-sm"></i>
|
|
<!-- <i class="fa-solid fa-volume-xmark text-sm"></i> -->
|
|
<!-- <i class="fa-solid fa-volume-xmark text-sm"></i> -->
|
|
</el-button>
|
|
</el-button>
|
|
- <el-dropdown trigger="click">
|
|
|
|
|
|
+ <el-dropdown trigger="click" @command="rtHandleCommand">
|
|
<el-button class="tm_button ml-2" type="info" icon="el-icon-more" circle></el-button>
|
|
<el-button class="tm_button ml-2" type="info" icon="el-icon-more" circle></el-button>
|
|
<el-dropdown-menu slot="dropdown">
|
|
<el-dropdown-menu slot="dropdown">
|
|
- <el-dropdown-item icon="el-icon-warning-outline">查看详情</el-dropdown-item>
|
|
|
|
|
|
+ <el-dropdown-item command="1" icon="el-icon-warning-outline">查看详情</el-dropdown-item>
|
|
</el-dropdown-menu>
|
|
</el-dropdown-menu>
|
|
</el-dropdown>
|
|
</el-dropdown>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<audio ref="audio" muted v-show="false" :src="audioUrl" autoplay="" @ended="audioEnd" controls></audio>
|
|
<audio ref="audio" muted v-show="false" :src="audioUrl" autoplay="" @ended="audioEnd" controls></audio>
|
|
- <div class="chatContent">
|
|
|
|
|
|
+ <div class="chatContent" :style="`background-image: url(${baseApi + sceneInfo.background})`">
|
|
<!-- <div class="leftImg">
|
|
<!-- <div class="leftImg">
|
|
<img :src="baseApi + info.picture" alt="">
|
|
<img :src="baseApi + info.picture" alt="">
|
|
<div class="aiInfo">
|
|
<div class="aiInfo">
|
|
@@ -38,11 +39,11 @@
|
|
</div> -->
|
|
</div> -->
|
|
<div class="chat-box relative">
|
|
<div class="chat-box relative">
|
|
<div class="messages" ref="messages">
|
|
<div class="messages" ref="messages">
|
|
- <template v-for="(item, index) in returnMessage ">
|
|
|
|
|
|
+ <template v-for="(item, index) in returnMessage ">
|
|
<div v-if="item.role == 'assistant'" class="text-white mb-4 flex" :key="index">
|
|
<div v-if="item.role == 'assistant'" class="text-white mb-4 flex" :key="index">
|
|
<!-- ai返回的信息 -->
|
|
<!-- ai返回的信息 -->
|
|
<div class="pt-2 photo">
|
|
<div class="pt-2 photo">
|
|
- <img :src="baseApi + info.picture" class="rounded-full w-12 h-12 object-cover" />
|
|
|
|
|
|
+ <img :src="baseApi + info.picture" class="rounded-full w-12 h-12 object-cover" @click="toDetail" />
|
|
</div>
|
|
</div>
|
|
<div class="message fex-1 ml-2 mt-3 p-2 rounded-r-md rounded-bl-md text-base">
|
|
<div class="message fex-1 ml-2 mt-3 p-2 rounded-r-md rounded-bl-md text-base">
|
|
<div v-show="!item.content" class="loadingMessage">
|
|
<div v-show="!item.content" class="loadingMessage">
|
|
@@ -94,19 +95,37 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="bottom px-2">
|
|
<div class="bottom px-2">
|
|
- <div class="button text-white" @click="() => {
|
|
|
|
|
|
+ <div v-if="!sceneId" class="button text-white" @click="() => {
|
|
this.showBottomPopup = false
|
|
this.showBottomPopup = false
|
|
this.newStart()
|
|
this.newStart()
|
|
- }">
|
|
|
|
|
|
+ }
|
|
|
|
+ ">
|
|
|
|
+ <i class="icon iconfont icon-xinduihua"></i>
|
|
|
|
+ <div>新的对话</div>
|
|
|
|
+ </div>
|
|
|
|
+ <div v-if="sceneId" class="button text-white" @click="() => {
|
|
|
|
+ this.showBottomPopup = false
|
|
|
|
+ this.handleCommand3(2)
|
|
|
|
+ }
|
|
|
|
+ ">
|
|
|
|
+ <i class="icon iconfont icon-xinduihua"></i>
|
|
|
|
+ <div>新建场景对话</div>
|
|
|
|
+ </div>
|
|
|
|
+ <div v-if="sceneId" class="button text-white" @click="() => {
|
|
|
|
+ this.showBottomPopup = false
|
|
|
|
+ this.handleCommand3(3)
|
|
|
|
+ }
|
|
|
|
+ ">
|
|
<i class="icon iconfont icon-xinduihua"></i>
|
|
<i class="icon iconfont icon-xinduihua"></i>
|
|
- <div class="text-xs">新的对话</div>
|
|
|
|
|
|
+ <div>返回常规对话</div>
|
|
</div>
|
|
</div>
|
|
<div class="button text-white" @click="() => {
|
|
<div class="button text-white" @click="() => {
|
|
this.showBottomPopup = false
|
|
this.showBottomPopup = false
|
|
this.showHistory()
|
|
this.showHistory()
|
|
- }">
|
|
|
|
|
|
+ }
|
|
|
|
+ ">
|
|
<i class="icon iconfont icon-lishi"></i>
|
|
<i class="icon iconfont icon-lishi"></i>
|
|
- <div class="text-xs">历史对话</div>
|
|
|
|
|
|
+ <div>历史对话</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -116,10 +135,11 @@
|
|
<transition name="el-zoom-in-bottom">
|
|
<transition name="el-zoom-in-bottom">
|
|
<div class="popupContent popup2" v-show="showBottomPopup2">
|
|
<div class="popupContent popup2" v-show="showBottomPopup2">
|
|
<div class=" w-full text-center py-2 text-base font-semibold">历史对话</div>
|
|
<div class=" w-full text-center py-2 text-base font-semibold">历史对话</div>
|
|
- <div class="historyRow py-2 cursor-pointer" v-for="(item, index) in historyList" :key="index" @click="() => {
|
|
|
|
|
|
+ <div class="historyRow py-2 cursor-pointer" v-for="( item, index ) in historyList " :key="index" @click="() => {
|
|
showBottomPopup2 = false
|
|
showBottomPopup2 = false
|
|
clickDialogue(jsHistory, item, index)
|
|
clickDialogue(jsHistory, item, index)
|
|
- }">
|
|
|
|
|
|
+ }
|
|
|
|
+ ">
|
|
<div class="flex justify-between">
|
|
<div class="flex justify-between">
|
|
<div class="name text-base">{{ item.chatTitle }}</div>
|
|
<div class="name text-base">{{ item.chatTitle }}</div>
|
|
<div class="time">{{ item.createTime }}</div>
|
|
<div class="time">{{ item.createTime }}</div>
|
|
@@ -272,6 +292,20 @@ export default {
|
|
// 查找当前角色是否有对话记录
|
|
// 查找当前角色是否有对话记录
|
|
this.searchHistory(this.info.id)
|
|
this.searchHistory(this.info.id)
|
|
},
|
|
},
|
|
|
|
+ rtHandleCommand(value) {
|
|
|
|
+ // console.log(value);
|
|
|
|
+ if (value == 1) {
|
|
|
|
+ this.toDetail()
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ toDetail() {
|
|
|
|
+ this.$router.push({
|
|
|
|
+ path: '/detailH5',
|
|
|
|
+ query: {
|
|
|
|
+ id: this.info.id
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
// 显示历史聊天记录
|
|
// 显示历史聊天记录
|
|
showHistory() {
|
|
showHistory() {
|
|
this.showBottomPopup2 = true
|
|
this.showBottomPopup2 = true
|
|
@@ -325,7 +359,7 @@ export default {
|
|
handleCommand3(value) {
|
|
handleCommand3(value) {
|
|
if (value == 1) {
|
|
if (value == 1) {
|
|
} else if (value == 2) {
|
|
} else if (value == 2) {
|
|
- // 情况聊天记录
|
|
|
|
|
|
+ // 清空聊天记录
|
|
this.returnMessage = []
|
|
this.returnMessage = []
|
|
// 新建场景对话
|
|
// 新建场景对话
|
|
this.newStart()
|
|
this.newStart()
|
|
@@ -1225,7 +1259,9 @@ export default {
|
|
|
|
|
|
.chatContent {
|
|
.chatContent {
|
|
// margin-top: 30px;
|
|
// margin-top: 30px;
|
|
- background-size: 100% 100%;
|
|
|
|
|
|
+ background-size: cover;
|
|
|
|
+ background-position: center;
|
|
|
|
+ background-repeat: no-repeat;
|
|
display: flex;
|
|
display: flex;
|
|
height: calc(100% - 50px - 63px);
|
|
height: calc(100% - 50px - 63px);
|
|
justify-content: center;
|
|
justify-content: center;
|
|
@@ -1405,11 +1441,12 @@ export default {
|
|
|
|
|
|
.button {
|
|
.button {
|
|
height: 100%;
|
|
height: 100%;
|
|
- width: 60px;
|
|
|
|
|
|
+ width: 80px;
|
|
display: inline-flex;
|
|
display: inline-flex;
|
|
flex-direction: column;
|
|
flex-direction: column;
|
|
justify-content: center;
|
|
justify-content: center;
|
|
align-items: center;
|
|
align-items: center;
|
|
|
|
+ font-size: 11px;
|
|
|
|
|
|
.icon {
|
|
.icon {
|
|
width: 34px;
|
|
width: 34px;
|