|
@@ -43,10 +43,18 @@
|
|
|
/>
|
|
|
</div>
|
|
|
</template>
|
|
|
- <template #message-title>
|
|
|
+ <template #message-title="contact">
|
|
|
<!-- <div @click="openDrawer('right')" style="position: absolute;right: 14px;top: 10px;">-->
|
|
|
<!-- <i class="el-icon-more" style="cursor: pointer"/>-->
|
|
|
<!-- </div>-->
|
|
|
+ <div>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ size="small"
|
|
|
+ style="position: absolute;right: 14px;top: 10px;z-index: 1000"
|
|
|
+ @click="showDetail(contact.extId)"
|
|
|
+ >详情</el-button>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
</lemon-imui>
|
|
|
</div>
|
|
@@ -187,7 +195,6 @@ export default {
|
|
|
},
|
|
|
shareCourse(nv) {
|
|
|
if (nv) {
|
|
|
- console.log('shareCourse', nv)
|
|
|
// 发送小程序卡片消息
|
|
|
const IMUI = this.$refs.IMUI;
|
|
|
const contact = IMUI.currentContact;
|
|
@@ -197,28 +204,14 @@ export default {
|
|
|
|
|
|
// 创建消息对象
|
|
|
let message = {
|
|
|
- id: generateUUID(),
|
|
|
- status: 'going',
|
|
|
type: 'miniprogram',
|
|
|
- sendTime: Date.now(),
|
|
|
- content: {
|
|
|
- appid: nv.miniprogramAppid,
|
|
|
- pagepath: nv.miniprogramPage,
|
|
|
- title: nv.miniprogramTitle,
|
|
|
- thumbnail: nv.miniprogramPicUrl
|
|
|
- },
|
|
|
+ content: nv,
|
|
|
toContactId: contact.conversationId,
|
|
|
- fromUser: {
|
|
|
- id: this.qwUser.id,
|
|
|
- displayName: this.qwUser.qwUserName,
|
|
|
- avatar: "https://cos.his.cdwjyyh.com/fs/20241231/22a765a96da247d1b83ea94fef438a41.png"
|
|
|
- },
|
|
|
};
|
|
|
|
|
|
this.detail.open = false
|
|
|
this.$store.dispatch('qwIm/shareCourse', null)
|
|
|
|
|
|
- this.appendRemoteMessage(message)
|
|
|
// 使用handleSend方法发送消息
|
|
|
this.handleSend(
|
|
|
message,
|
|
@@ -399,7 +392,7 @@ export default {
|
|
|
this.appendRemoteMessage(data)
|
|
|
let conversation = IMUI.findConversation(message.toContactId);
|
|
|
conversation.lastSendTime = message.sendTime;
|
|
|
- conversation.lastContent = message.content;
|
|
|
+ conversation.lastContent = IMUI.lastContentRender(message)
|
|
|
IMUI.topPopConversations(conversation);
|
|
|
next();
|
|
|
} else {
|
|
@@ -420,7 +413,7 @@ export default {
|
|
|
if(code === 200){
|
|
|
let conversation = IMUI.findConversation(message.toContactId);
|
|
|
conversation.lastSendTime = message.sendTime;
|
|
|
- conversation.lastContent = message.content;
|
|
|
+ conversation.lastContent = IMUI.lastContentRender(message)
|
|
|
IMUI.topPopConversations(conversation);
|
|
|
next();
|
|
|
} else {
|
|
@@ -436,19 +429,17 @@ export default {
|
|
|
params = {
|
|
|
"sessionId": message.toContactId,
|
|
|
"appKey": this.qwUser.appKey,
|
|
|
- "content": JSON.stringify(message.content),
|
|
|
+ "content": message.content,
|
|
|
"msgType": 5 // 小程序消息类型
|
|
|
};
|
|
|
sendMsg(params).then(response => {
|
|
|
- const {code} = response
|
|
|
+ const {code, data} = response
|
|
|
if(code === 200){
|
|
|
+ this.appendRemoteMessage(data)
|
|
|
let conversation = IMUI.findConversation(message.toContactId);
|
|
|
conversation.lastSendTime = message.sendTime;
|
|
|
- conversation.lastContent = "小程序";
|
|
|
+ conversation.lastContent = IMUI.lastContentRender(message)
|
|
|
IMUI.topPopConversations(conversation);
|
|
|
- next && next();
|
|
|
- } else {
|
|
|
- next && next({status:'failed'})
|
|
|
}
|
|
|
});
|
|
|
}
|