提交 0333d974 编写于 作者: F fancy

聊天模式增加但窗口模式

上级 7c928e31
<div class="o2_im_out" data-o2-element="o2ImMainNode"> <div class="o2_im_out" data-o2-element="o2ImMainNode">
<div class="o2_im_chat_list"> <div class="o2_im_chat_list" data-o2-element="o2ConversationListNode">
<!--top--> <!--top-->
<div class="o2_im_chat_list_top"> <div class="o2_im_chat_list_top">
<div class="add" data-o2-element="o2ImConvCreateNode" data-o2-events="click:tapCreateSingleConv"> <div class="add" data-o2-element="o2ImConvCreateNode" data-o2-events="click:tapCreateSingleConv">
......
MWF.require("MWF.widget.UUID", null, false); MWF.require("MWF.widget.UUID", null, false);
MWF.xDesktop.requireApp("Template", "MForm", null, false); MWF.xDesktop.requireApp("Template", "MForm", null, false);
MWF.xDesktop.requireApp("Template", "MPopupForm", null, false); MWF.xDesktop.requireApp("Template", "MPopupForm", null, false);
MWF.xApplication.IMV2.options.multitask = true; //多窗口
MWF.xApplication.IMV2.Main = new Class({ MWF.xApplication.IMV2.Main = new Class({
Extends: MWF.xApplication.Common.Main, Extends: MWF.xApplication.Common.Main,
Implements: [Options, Events], Implements: [Options, Events],
...@@ -15,13 +16,13 @@ MWF.xApplication.IMV2.Main = new Class({ ...@@ -15,13 +16,13 @@ MWF.xApplication.IMV2.Main = new Class({
"isResize": true, "isResize": true,
"isMax": true, "isMax": true,
"title": MWF.xApplication.IMV2.LP.title, "title": MWF.xApplication.IMV2.LP.title,
"conversationId": "" "conversationId": "", // 传入的当前会话id
"mode": "default" // 展现模式:default onlyChat 。 onlyChat的模式需要传入conversationId 会打开这个会话的聊天窗口并隐藏左边的会话列表
}, },
onQueryLoad: function () { onQueryLoad: function () {
this.lp = MWF.xApplication.IMV2.LP; this.lp = MWF.xApplication.IMV2.LP;
this.app = this; this.app = this;
this.conversationNodeItemList = []; this.conversationNodeItemList = [];
this.conversationId = this.options.conversationId || "";
this.messageList = []; this.messageList = [];
this.emojiList = []; this.emojiList = [];
//添加87个表情 //添加87个表情
...@@ -32,8 +33,20 @@ MWF.xApplication.IMV2.Main = new Class({ ...@@ -32,8 +33,20 @@ MWF.xApplication.IMV2.Main = new Class({
}; };
this.emojiList.push(emoji); this.emojiList.push(emoji);
} }
if (!this.status) {
this.conversationId = this.options.conversationId || "";
this.mode = this.options.mode || "default";
} else {
this.conversationId = this.status.conversationId || "";
this.mode = this.status.mode || "default";
}
}, },
// 刷新的时候缓存数据
recordStatus: function(){
return {"conversationId": this.conversationId, "mode": this.mode};
},
onQueryClose: function () { onQueryClose: function () {
this.closeListening(); this.closeListening();
}, },
...@@ -65,6 +78,15 @@ MWF.xApplication.IMV2.Main = new Class({ ...@@ -65,6 +78,15 @@ MWF.xApplication.IMV2.Main = new Class({
this.app.content = this.o2ImMainNode; this.app.content = this.o2ImMainNode;
//启动监听 //启动监听
this.startListening(); this.startListening();
// 处理窗口模式
if (this.mode === "onlyChat" && this.conversationId != "") {
this.o2ConversationListNode.setStyle("display", "none");
this.chatNode.setStyle("margin-left", "2px");
} else {
this.o2ConversationListNode.setStyle("display", "flex");
this.chatNode.setStyle("margin-left", "259px");
}
//获取会话列表 //获取会话列表
this.conversationNodeItemList = []; this.conversationNodeItemList = [];
o2.Actions.load("x_message_assemble_communicate").ImAction.myConversationList(function (json) { o2.Actions.load("x_message_assemble_communicate").ImAction.myConversationList(function (json) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册