2024-07-15 16:43:11 +08:00
|
|
|
|
<template>
|
|
|
|
|
|
<div class="Detail">
|
2024-08-15 17:54:20 +08:00
|
|
|
|
<!-- <AiTopFixed>
|
2024-07-15 16:43:11 +08:00
|
|
|
|
<div class="back">
|
2024-08-15 17:54:20 +08:00
|
|
|
|
<div class="top-select" @click="back">
|
2024-07-15 16:43:11 +08:00
|
|
|
|
<u-icon name="arrow-left" color="#fff" size="28"></u-icon>返回
|
2024-08-15 17:54:20 +08:00
|
|
|
|
</div>
|
2024-08-15 17:30:50 +08:00
|
|
|
|
<p>模型应用:{{messageList[0].aiConfigName}}</p>
|
2024-07-15 16:43:11 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<div class="search-content">
|
|
|
|
|
|
<u-search v-model="searchVal" :clearabled="true" placeholder="请输入搜索关键词…" :show-action="false"
|
2024-07-16 14:21:57 +08:00
|
|
|
|
bg-color="#F4F6FA" search-icon-color="#666" color="#666" height="72" @search="getSearchList" @clear="handerClear">
|
2024-07-15 16:43:11 +08:00
|
|
|
|
</u-search>
|
|
|
|
|
|
</div>
|
2024-08-15 17:54:20 +08:00
|
|
|
|
</AiTopFixed> -->
|
|
|
|
|
|
<div class="search-content">
|
2024-08-22 14:59:21 +08:00
|
|
|
|
<p>已切换至{{messageList[0].aiConfigName}}</p>
|
2024-07-16 14:33:33 +08:00
|
|
|
|
<u-search v-model="searchVal" :clearabled="true" placeholder="请输入搜索关键词…" :show-action="false"
|
|
|
|
|
|
bg-color="#F4F6FA" search-icon-color="#666" color="#666" height="72" @search="getSearchList" @clear="handerClear">
|
|
|
|
|
|
</u-search>
|
2024-08-15 17:54:20 +08:00
|
|
|
|
</div>
|
2024-07-15 16:43:11 +08:00
|
|
|
|
<div class="list-content">
|
|
|
|
|
|
<div v-for="(item, index) in messageList" :key="index">
|
|
|
|
|
|
<div class="send-time">{{item.createTime.substring(5, 16)}}</div>
|
|
|
|
|
|
<div :class="item.userType == 1 ? 'item-left' : 'item-right'">
|
2024-08-22 14:59:21 +08:00
|
|
|
|
<img src="https://cdn.sinoecare.com/i/2024/08/22/66c6de5a9db60.jpg" alt="" class="user-img" v-if="item.userType == 1">
|
2024-07-15 16:43:11 +08:00
|
|
|
|
<div class="item" :class="'item'+index">
|
|
|
|
|
|
<u-icon name="play-right-fill" color="#CCE2FF" size="20" v-if="item.userType != 1" class="u-icon-right"></u-icon>
|
|
|
|
|
|
<u-icon name="play-left-fill" color="#F3F5F7" size="20" v-if="item.userType == 1" class="u-icon-left"></u-icon>
|
|
|
|
|
|
<div class="voice-div" v-if="item.sdkFileUrl" @click="play(item.sdkFileUrl, index)">
|
|
|
|
|
|
<span>8”</span>
|
|
|
|
|
|
<img src="https://cdn.cunwuyun.cn/wechat/baiduAI/play-d.gif" alt="" v-if="item.isPlay">
|
|
|
|
|
|
<img src="https://cdn.cunwuyun.cn/wechat/baiduAI/play-j.png" alt="" v-else>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<p v-if="!item.sdkFileUrl">{{item.content || ''}}</p>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<img src="https://cdn.cunwuyun.cn/wechat/baiduAI/user-img.png" alt="" class="user-img" v-if="item.userType != 1">
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<AiEmpty v-if="!messageList.length"/>
|
|
|
|
|
|
</div>
|
2024-08-22 14:59:21 +08:00
|
|
|
|
<img src="https://cdn.sinoecare.com/i/2024/08/22/66c69f4d33eb1.png" alt="" class="bg-center">
|
2024-07-15 16:43:11 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
|
|
|
|
|
|
|
import {mapState} from "vuex";
|
|
|
|
|
|
export default {
|
|
|
|
|
|
name: 'Detail',
|
|
|
|
|
|
props: ['params'],
|
|
|
|
|
|
data() {
|
|
|
|
|
|
return {
|
|
|
|
|
|
backgroundNavbar: {
|
|
|
|
|
|
background: 'url(https://cdn.cunwuyun.cn/wechat/biaopin/residentAssistant/header-bg.jpeg) no-repeat',
|
|
|
|
|
|
backgroundSize: 'cover',
|
|
|
|
|
|
},
|
|
|
|
|
|
searchVal: '',
|
|
|
|
|
|
messageList: [
|
|
|
|
|
|
// {
|
|
|
|
|
|
// userType: 0,
|
|
|
|
|
|
// sdkFileUrl: 'http://test87ftp.cunwuyun.cn/20240104/output.mp3',
|
|
|
|
|
|
// isPlay: false
|
|
|
|
|
|
// }
|
|
|
|
|
|
],
|
|
|
|
|
|
current: 1,
|
|
|
|
|
|
pages: 2,
|
2024-07-17 11:05:45 +08:00
|
|
|
|
aiConfigId: '',
|
|
|
|
|
|
conversationId: ''
|
2024-07-15 16:43:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
computed: {
|
|
|
|
|
|
...mapState(['user']),
|
|
|
|
|
|
},
|
2024-07-16 14:33:33 +08:00
|
|
|
|
onLoad(e) {
|
|
|
|
|
|
this.aiConfigId = e.aiConfigId
|
2024-07-17 11:05:45 +08:00
|
|
|
|
this.conversationId = e.conversationId
|
2024-07-15 16:43:11 +08:00
|
|
|
|
this.getHistoryList()
|
|
|
|
|
|
},
|
|
|
|
|
|
onShow() {
|
|
|
|
|
|
document.title = 'Copilot小助理'
|
|
|
|
|
|
},
|
|
|
|
|
|
onPullDownRefresh() {
|
|
|
|
|
|
if(this.current > this.pages) {
|
|
|
|
|
|
return this.$u.toast('没有更多记录')
|
|
|
|
|
|
}
|
|
|
|
|
|
this.current = this.current + 1
|
|
|
|
|
|
this.getHistoryList()
|
|
|
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
|
|
|
getHistoryList() {
|
|
|
|
|
|
if(!this.user.token) {
|
|
|
|
|
|
return this.$u.toast("请先进行登录")
|
|
|
|
|
|
}
|
|
|
|
|
|
this.$loading()
|
2024-07-17 11:05:45 +08:00
|
|
|
|
this.$http.post(`/app/appaicopilotinfo/list?current=${this.current}&size=10&content=${this.searchVal}&aiConfigId=${this.aiConfigId}&conversationId=${this.conversationId}`).then(res => {
|
2024-07-15 16:43:11 +08:00
|
|
|
|
if(res.code == 0 && res.data.records.length) {
|
|
|
|
|
|
res.data.records.map((item) => {
|
|
|
|
|
|
if(item.sdkFileUrl) {
|
|
|
|
|
|
item.isPlay = false
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
this.messageList = this.current == 1 ? res.data.records : [...res.data.records, ...this.messageList]
|
|
|
|
|
|
var idPage = res.data.records.length-1
|
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
|
uni.pageScrollTo({
|
|
|
|
|
|
duration: 300,
|
|
|
|
|
|
selector: this.current == 1 ? `.item${this.messageList.length-1}` : `.item${idPage}`
|
|
|
|
|
|
});
|
|
|
|
|
|
})
|
|
|
|
|
|
this.pages = res.data.pages
|
|
|
|
|
|
this.$hideLoading()
|
|
|
|
|
|
}else {
|
|
|
|
|
|
if(this.current == 1) {
|
|
|
|
|
|
this.messageList = []
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
getSearchList() {
|
|
|
|
|
|
this.current = 1
|
|
|
|
|
|
this.getHistoryList()
|
|
|
|
|
|
},
|
|
|
|
|
|
handerClear() {
|
|
|
|
|
|
this.searchVal = ''
|
|
|
|
|
|
this.getSearchList()
|
|
|
|
|
|
},
|
|
|
|
|
|
play(src, index) {
|
|
|
|
|
|
innerAudioContext.stop();
|
|
|
|
|
|
if(this.messageList[index].isPlay) {
|
|
|
|
|
|
innerAudioContext.onStop(() => {
|
|
|
|
|
|
this.messageList[index].isPlay = false
|
|
|
|
|
|
})
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
this.messageList.map((item) => {
|
|
|
|
|
|
if(item.sdkFileUrl) {
|
|
|
|
|
|
item.isPlay = false
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
this.messageList[index].isPlay = true
|
|
|
|
|
|
innerAudioContext.src = src;
|
|
|
|
|
|
|
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
|
innerAudioContext.play();
|
|
|
|
|
|
})
|
|
|
|
|
|
innerAudioContext.onEnded(() => {
|
|
|
|
|
|
this.messageList[index].isPlay = false
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
playStop(index) {
|
|
|
|
|
|
innerAudioContext.stop();
|
|
|
|
|
|
innerAudioContext.onStop(() => {
|
|
|
|
|
|
this.messageList[index].isPlay = false
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
back() {
|
|
|
|
|
|
this.$emit('back')
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
}
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
|
page {
|
|
|
|
|
|
height: 100%;
|
|
|
|
|
|
}
|
|
|
|
|
|
.Detail {
|
|
|
|
|
|
height: 100vh;
|
|
|
|
|
|
background-color: #fff;
|
|
|
|
|
|
position: relative;
|
|
|
|
|
|
.back {
|
|
|
|
|
|
position: relative;
|
|
|
|
|
|
padding-top: 28px;
|
|
|
|
|
|
.top-select {
|
|
|
|
|
|
line-height: 64px;
|
|
|
|
|
|
background: #026AF2;
|
|
|
|
|
|
border-radius: 32px;
|
|
|
|
|
|
position: absolute;
|
|
|
|
|
|
left: 0;
|
|
|
|
|
|
top: 28px;
|
|
|
|
|
|
text-align: center;
|
|
|
|
|
|
padding: 0 24px;
|
|
|
|
|
|
font-family: PingFangSC-Medium;
|
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
|
font-size: 28px;
|
|
|
|
|
|
color: #FFF;
|
|
|
|
|
|
z-index: 9;
|
|
|
|
|
|
::v-deep .u-icon {
|
|
|
|
|
|
margin-right: 8px;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
p {
|
|
|
|
|
|
text-align: center;
|
|
|
|
|
|
font-family: PingFangSC-Regular;
|
|
|
|
|
|
font-size: 24px;
|
|
|
|
|
|
color: #708099;
|
|
|
|
|
|
line-height: 64px;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
.search-content {
|
2024-08-22 14:59:21 +08:00
|
|
|
|
padding: 28px 32px;
|
2024-07-15 16:43:11 +08:00
|
|
|
|
width: 100%;
|
|
|
|
|
|
box-sizing: border-box;
|
2024-08-15 17:54:20 +08:00
|
|
|
|
position: fixed;
|
|
|
|
|
|
left: 0;
|
2024-08-22 14:59:21 +08:00
|
|
|
|
z-index: 9;
|
2024-08-22 16:42:31 +08:00
|
|
|
|
background-color: #fff;
|
2024-08-22 14:59:21 +08:00
|
|
|
|
p {
|
|
|
|
|
|
line-height: 34px;
|
|
|
|
|
|
font-family: PingFangSC-Regular;
|
|
|
|
|
|
font-weight: 400;
|
|
|
|
|
|
font-size: 24px;
|
|
|
|
|
|
color: #999;
|
|
|
|
|
|
text-align: center;
|
|
|
|
|
|
padding-bottom: 28px;
|
|
|
|
|
|
}
|
2024-07-15 16:43:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.list-content {
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
|
background-color: #fff;
|
2024-08-22 14:59:21 +08:00
|
|
|
|
padding: 238px 32px 364px;
|
2024-07-15 16:43:11 +08:00
|
|
|
|
.send-time {
|
|
|
|
|
|
display: block;
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
line-height: 28px;
|
|
|
|
|
|
font-family: PingFangSC-Regular;
|
|
|
|
|
|
font-weight: 400;
|
|
|
|
|
|
font-size: 20px;
|
|
|
|
|
|
color: #999;
|
|
|
|
|
|
text-align: center;
|
|
|
|
|
|
margin-bottom: 28px;
|
|
|
|
|
|
}
|
|
|
|
|
|
.user-img {
|
|
|
|
|
|
display: inline-block;
|
|
|
|
|
|
width: 72px;
|
|
|
|
|
|
height: 72px;
|
|
|
|
|
|
vertical-align: top;
|
|
|
|
|
|
}
|
|
|
|
|
|
.item {
|
|
|
|
|
|
display: inline-block;
|
|
|
|
|
|
max-width: 440px;
|
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
|
padding: 18px;
|
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
|
margin-bottom: 28px;
|
|
|
|
|
|
position: relative;
|
|
|
|
|
|
.voice-div {
|
|
|
|
|
|
img {
|
|
|
|
|
|
width: 26px;
|
|
|
|
|
|
height: 28px;
|
|
|
|
|
|
}
|
|
|
|
|
|
span {
|
|
|
|
|
|
display: inline-block;
|
|
|
|
|
|
color: #333;
|
|
|
|
|
|
font-size: 28px;
|
|
|
|
|
|
font-family: PingFangSC;
|
|
|
|
|
|
line-height: 28px;
|
|
|
|
|
|
margin-right: 68px;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
p {
|
|
|
|
|
|
word-break: break-all;
|
|
|
|
|
|
line-height: 40px;
|
|
|
|
|
|
font-family: SourceHanSansCN-Regular;
|
|
|
|
|
|
font-size: 32px;
|
|
|
|
|
|
color: #333;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
.item-right {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
justify-content: flex-end;
|
|
|
|
|
|
.item {
|
|
|
|
|
|
background-color: #CCE2FF;
|
|
|
|
|
|
}
|
|
|
|
|
|
.user-img {
|
|
|
|
|
|
margin-left: 24px;
|
|
|
|
|
|
}
|
|
|
|
|
|
.u-icon-right {
|
|
|
|
|
|
position: absolute;
|
|
|
|
|
|
top: 12px;
|
|
|
|
|
|
right: -12px;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
.item-left {
|
|
|
|
|
|
.item {
|
|
|
|
|
|
background-color: #F3F5F7;
|
|
|
|
|
|
}
|
|
|
|
|
|
.user-img {
|
|
|
|
|
|
margin-right: 24px;
|
|
|
|
|
|
}
|
|
|
|
|
|
.u-icon-left {
|
|
|
|
|
|
position: absolute;
|
|
|
|
|
|
top: 12px;
|
|
|
|
|
|
left: -12px;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2024-08-22 14:59:21 +08:00
|
|
|
|
.bg-center {
|
|
|
|
|
|
position: fixed;
|
|
|
|
|
|
top: 50%;
|
|
|
|
|
|
left: 50%;
|
|
|
|
|
|
width: 306px;
|
|
|
|
|
|
height: 364px;
|
|
|
|
|
|
margin: -182px 0 0 -153px;
|
|
|
|
|
|
}
|
2024-07-15 16:43:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
</style>
|