最后一条消息不显示历史发送时间

This commit is contained in:
liyuetong
2021-06-11 15:15:24 +08:00
parent c78cf9d6c1
commit e953754f1a
2 changed files with 3 additions and 11 deletions

View File

@@ -7,7 +7,7 @@ export default [
name: 'customerService',
component: customerService,
meta: {
title: '金掌智能客服',
title: '金掌智能客服',
index: 1
}
}

View File

@@ -4,7 +4,7 @@
<div ref="box" class="conversation-list pt10 pb60 inline-b" v-if="list.length">
<div v-for="(item, index) in list" :key="index">
<!-- 用户提问 -->
<div class="answer-box clearfix pb20 mh10" v-if="item.singleNode.question">
<div class="answer-box clearfix pb20 mh10" v-if="index != 0 && item.singleNode.question">
<div class="question-avatar fr">
<span class="color2f8 v-super mr8">{{ mandatorName }}</span>
<img src="./image/icon-customer.png" alt="" class="w35 v-sub" />
@@ -35,7 +35,7 @@
</template>
</div>
</div>
<div class="text-center fs10">{{ item.sendTime | formatDate }}</div>
<div class="text-center fs10" v-if="list.length - 1 != index">{{ item.sendTime | formatDate }}</div>
</div>
</div>
</div>
@@ -64,7 +64,6 @@ export default {
},
data() {
return {
status: 0, //默认没有历史记录
mandatorName: '',
SessionId: '',
MessageId: '',
@@ -91,7 +90,6 @@ export default {
pageSize: 1000
})
if (res.content.list.length) {
that.status = 1
that.list = res.content.list
res.content.list.map(itm => {
//纯图片需要xml字符串转换json数据数据解析
@@ -103,8 +101,6 @@ export default {
})
that.list = res.content.list
that.scrollToBottom() //滚动条定位底部
} else {
this.send('你好')
}
},
//发送消息
@@ -120,10 +116,6 @@ export default {
isQuestionQuery: '0'
})
if (res.result == 0) {
// status 0 表示没有历史记录,默认传‘你好’,前端不显示
if (that.status == 0) {
res.singleNode.question = ''
}
//纯图片需要xml字符串转换json数据数据解析
if (res.singleNode.isRichText == 2) {
res.singleNode.PicUrl = xmlLoad.xmlStr2json(res.singleNode.answerMsg).root.PicUrl