|
|
|
|
@ -151,15 +151,15 @@
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<div>
|
|
|
|
|
<div class="interaction-detail">
|
|
|
|
|
<div v-if="scope.row.messages && scope.row.messages.length > 0">
|
|
|
|
|
<div v-for="(message, index) in scope.row.messages" :key="index" style="margin-bottom: 8px;">
|
|
|
|
|
<div v-if="scope.row.dialogues && scope.row.dialogues.length > 0">
|
|
|
|
|
<div v-for="(dialogue, index) in scope.row.dialogues" :key="index" style="margin-bottom: 8px;" v-show="dialogue.user && dialogue.user.id !== scope.row.user_id">
|
|
|
|
|
<span
|
|
|
|
|
class="clickable-user"
|
|
|
|
|
@click="showInteractionDetail(scope.row, message.to_user)"
|
|
|
|
|
@click="showInteractionDetail(scope.row, dialogue.user)"
|
|
|
|
|
style="font-size: 12px; cursor: pointer; color: #409EFF; text-decoration: underline;">
|
|
|
|
|
{{ (message.to_user && message.to_user.name) || '-' }}({{ (message.to_user && message.to_user.year) || '-' }}届)
|
|
|
|
|
{{ (dialogue.user && dialogue.user.name) || '-' }}({{ (dialogue.user && dialogue.user.year) || '-' }}届)
|
|
|
|
|
</span>
|
|
|
|
|
<span style="font-size: 12px; color: #666;"> · {{ formatDateTime(message.created_at) || '-' }}</span>
|
|
|
|
|
<span style="font-size: 12px; color: #666;"> · {{ formatDateTime(dialogue.last_datetime) || '-' }}</span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div v-else style="color: #999; font-size: 12px;">暂无交互记录</div>
|
|
|
|
|
@ -485,15 +485,15 @@ export default {
|
|
|
|
|
try {
|
|
|
|
|
// 获取该用户与发布者之间的消息列表
|
|
|
|
|
const params = {
|
|
|
|
|
to_user_id: (row.user && row.user.id) || '',
|
|
|
|
|
to_user_id: (targetUser && targetUser.id) || '',
|
|
|
|
|
user_id: (row.user && row.user.id) || '',
|
|
|
|
|
page_size: 50,
|
|
|
|
|
page: 1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const response = await getMessageList(params)
|
|
|
|
|
if (response && response.data) {
|
|
|
|
|
this.messageList = response.data
|
|
|
|
|
if (response && response.message && response.message.data) {
|
|
|
|
|
this.messageList = response.message.data
|
|
|
|
|
} else {
|
|
|
|
|
this.messageList = []
|
|
|
|
|
}
|
|
|
|
|
@ -502,7 +502,7 @@ export default {
|
|
|
|
|
// this.$message.warning('获取消息列表失败,显示模拟数据')
|
|
|
|
|
|
|
|
|
|
// 生成mock数据
|
|
|
|
|
this.messageList = this.generateMockMessages(row, targetUser)
|
|
|
|
|
// this.messageList = this.generateMockMessages(row, targetUser)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
@ -530,8 +530,8 @@ export default {
|
|
|
|
|
// 判断消息发送者是否为发布者
|
|
|
|
|
const isPublisher = this.currentSupplyDemand &&
|
|
|
|
|
this.currentSupplyDemand.user &&
|
|
|
|
|
message.from_user &&
|
|
|
|
|
message.from_user.id === this.currentSupplyDemand.user.id
|
|
|
|
|
message.user &&
|
|
|
|
|
message.user.id === this.currentSupplyDemand.user.id
|
|
|
|
|
|
|
|
|
|
return isPublisher ? 'message-right' : 'message-left'
|
|
|
|
|
},
|
|
|
|
|
@ -541,8 +541,8 @@ export default {
|
|
|
|
|
// 判断消息发送者是否为发布者
|
|
|
|
|
const isPublisher = this.currentSupplyDemand &&
|
|
|
|
|
this.currentSupplyDemand.user &&
|
|
|
|
|
message.from_user &&
|
|
|
|
|
message.from_user.id === this.currentSupplyDemand.user.id
|
|
|
|
|
message.user &&
|
|
|
|
|
message.user.id === this.currentSupplyDemand.user.id
|
|
|
|
|
|
|
|
|
|
return isPublisher ? 'message-right' : 'message-left'
|
|
|
|
|
},
|
|
|
|
|
@ -593,7 +593,7 @@ export default {
|
|
|
|
|
// 模拟发布者询问消息
|
|
|
|
|
mockMessages.push({
|
|
|
|
|
id: 'mock_1',
|
|
|
|
|
from_user: {
|
|
|
|
|
user: {
|
|
|
|
|
id: supplyDemand.user ? supplyDemand.user.id : 'mock_publisher',
|
|
|
|
|
name: publisherName
|
|
|
|
|
},
|
|
|
|
|
@ -605,7 +605,7 @@ export default {
|
|
|
|
|
// 模拟用户回复
|
|
|
|
|
mockMessages.push({
|
|
|
|
|
id: 'mock_2',
|
|
|
|
|
from_user: targetUser,
|
|
|
|
|
user: targetUser,
|
|
|
|
|
to_user: supplyDemand.user,
|
|
|
|
|
content: '您好!我对这个很感兴趣,想了解更多详细信息,可以详细介绍一下吗?',
|
|
|
|
|
created_at: new Date(now.getTime() - 1.5 * 60 * 60 * 1000).toISOString() // 1.5小时前
|
|
|
|
|
@ -614,7 +614,7 @@ export default {
|
|
|
|
|
// 模拟发布者详细回复
|
|
|
|
|
mockMessages.push({
|
|
|
|
|
id: 'mock_3',
|
|
|
|
|
from_user: {
|
|
|
|
|
user: {
|
|
|
|
|
id: supplyDemand.user ? supplyDemand.user.id : 'mock_publisher',
|
|
|
|
|
name: publisherName
|
|
|
|
|
},
|
|
|
|
|
@ -626,7 +626,7 @@ export default {
|
|
|
|
|
// 模拟用户确认
|
|
|
|
|
mockMessages.push({
|
|
|
|
|
id: 'mock_4',
|
|
|
|
|
from_user: targetUser,
|
|
|
|
|
user: targetUser,
|
|
|
|
|
to_user: supplyDemand.user,
|
|
|
|
|
content: '听起来很不错!我想进一步了解合作细节,方便电话沟通吗?',
|
|
|
|
|
created_at: new Date(now.getTime() - 30 * 60 * 1000).toISOString() // 30分钟前
|
|
|
|
|
@ -635,7 +635,7 @@ export default {
|
|
|
|
|
// 模拟发布者提供联系方式
|
|
|
|
|
mockMessages.push({
|
|
|
|
|
id: 'mock_5',
|
|
|
|
|
from_user: {
|
|
|
|
|
user: {
|
|
|
|
|
id: supplyDemand.user ? supplyDemand.user.id : 'mock_publisher',
|
|
|
|
|
name: publisherName
|
|
|
|
|
},
|
|
|
|
|
|