优化
This commit is contained in:
@@ -184,6 +184,7 @@ export default {
|
||||
chatInfo: {},
|
||||
currentConversation: null,
|
||||
inid: null,
|
||||
chatPartnerinfo: {},
|
||||
// parentMessage: null,
|
||||
style: {
|
||||
backgroundColor: "#ffffff",
|
||||
@@ -208,7 +209,19 @@ export default {
|
||||
// 监听itemDetail事件
|
||||
eventChannel.on("itemDetail", (data) => {
|
||||
this.item = data.item; // 将接收到的数据赋值给item
|
||||
console.log(" itemDetail", data.item);
|
||||
//获取对方用户信息
|
||||
request({
|
||||
url: "user/getUserInfo",
|
||||
method: "POST",
|
||||
data: {
|
||||
id: data.item.senderId,
|
||||
},
|
||||
userInfo: true,
|
||||
}).then((res) => {
|
||||
if (res.code === 200) {
|
||||
this.chatPartnerinfo = res.data;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
uni.getStorage({
|
||||
@@ -297,22 +310,19 @@ export default {
|
||||
inviteHint(){
|
||||
this.$refs.popups.close();
|
||||
// 发送邀请消息
|
||||
const conversationID = `C2C${this.item.senderId}`;
|
||||
const myitem = JSON.stringify(this.list[this.InvitingPartyEventindex]);
|
||||
const youritem = JSON.stringify(this.item);
|
||||
uni.redirectTo({
|
||||
url: `/TUIKit/components/TUIChat/index?conversationID=${conversationID}&myitem=${myitem}&youritem=${youritem}`,
|
||||
});
|
||||
// uni.redirectTo({
|
||||
// url: `/pages/index/chat/chat?userId=${this.item}&nickname=${nickname}&avatar=${avatar}&myitem=${myitem}&youritem=${youritem}&type=pk`,
|
||||
// });
|
||||
},
|
||||
// 打开邀请弹窗
|
||||
close() {
|
||||
this.$refs.popup.close();
|
||||
},
|
||||
openChat() {
|
||||
// 打开聊天页面
|
||||
const conversationID = `C2C${this.item.senderId}`;
|
||||
uni.navigateTo({
|
||||
url: `/TUIKit/components/TUIChat/index?conversationID=${conversationID}`,
|
||||
wx.navigateTo({
|
||||
url: `/pages/index/chat/chat?userId=${this.chatPartnerinfo.id}&nickname=${this.chatPartnerinfo.nickName}&avatar=${this.chatPartnerinfo.headerIcon}`,
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user