Exemple #1
0
	Model.prototype.contactInfoClick = function(event) {
		var gid;
		if (this.isFromDlg.get()) {
			var row = event.bindingContext.$object;
			if(row.val("fCheckRow") === "0"){
				row.val("fCheckRow","1");
			}else{
				row.val("fCheckRow","0");
			}
			this.getDataArray(row);
		} else {
			if (event.bindingContext.$object.val("type") === 'group') {
				gid = event.bindingContext.$object.val("fID");
				var peer = IM.getGroupPeer(gid);
				justep.Shell.fireEvent('onGroupInfoPage', {
					id : peer.id,
					type : peer.type
				});
			} else {
				justep.Shell.fireEvent('onContactInfoPage', {
					"contactId" : event.bindingContext.$object.val('fSpersonID'),
					"name" : event.bindingContext.$object.val("fsName")
				});
			}
		}
		if (!justep.Browser.isIOS) {
			return false;
		}
	};
	Model.prototype.modelModelConstruct = function(event) {
		if (IM.isLoggedIn()) {
			this.init();
		} else {
			justep.Shell.on('onLoggedIn', this.init, this);
		}
	};
								IM.createGroup(sName, null, self.userIds).then(function(peer) {
									justep.Shell.fireEvent("onGroupSendMessagePage", {
										id : peer.id,
										type : peer.type
									});
									self.createGroupState.set(true);
								}, function(e) {
Exemple #4
0
	Model.prototype.open = function(event) {
		var row = event.bindingContext.$object;
		var url = "../1/template.w";
		justep.Shell.showPage(require.toUrl(url), {
			rowid : row.val("id")
		});
	};
				IM.leaveGroup(gPeer.id).then(function() {
					IM.deleteChat(gPeer);
					if (self.currentDialogID.peek() === id) {
						self.currentDialogID.set(null);
						justep.Shell.fireEvent('onCloseMessagePage');
					}
				});
Exemple #6
0
	Model.prototype.btn_logticsClick = function(event){
		var baasData = this.comp("baasData");
		var parms ={};
		parms.city= baasData.getValue("fcity", baasData.getCurrentRow());
		parms.address= baasData.getValue("faddress", baasData.getCurrentRow());
		justep.Shell.showPage("logistics",parms);
	};
			justep.Util.confirm("确定删除该联系人的对话?", function() {
				IM.deleteChat(peer);
				if (self.currentDialogID.peek() === id) {
					self.currentDialogID.set(null);
					justep.Shell.fireEvent('onCloseMessagePage');
				}
			});
Exemple #8
0
	Model.prototype.deptNameClick = function(event) {
		var sFID = event.bindingContext.$object.val("fsFID");
		var sName = event.bindingContext.$object.val("fsfName");
		if (!this.isFromDlg.get() && sFID) {
			if (justep.Browser.isPC) {
				justep.Shell.fireEvent('createDeptDlg', {
					sFID : sFID,
					sName : sName
				});
			} else {
				justep.Shell.showPage("createDlgByDept", {
					sFID : sFID,
					sName : sName
				});
			}
		}
	};
	var Model = function() {
		this.callParent();
		this.dialogs = {}; // 会话列表
		this.currentDialogID = justep.Bind.observable();
		justep.Shell.on('onSendMessagePage', function(event) {
			this.showMessagePage(event.id, event.type);
		}, this);
		justep.Shell.on('onGroupSendMessagePage', function(event) {
			// var rows = this.comp("dialogData").find([ "fID" ], [ event.id ],
			// true);
			// if (rows && rows.length > 0)
			// this.showMessagePage(rows[0].val("fID"), rows[0].val("fType"));
			this.showMessagePage(event.id, event.type);
		}, this);
		this.pageTitle = $(document).attr("title");
		this.filterVal = justep.Bind.observable();
		this.isGroup = justep.Bind.observable(false);
	};
Exemple #10
0
				this.$more.on('click', function(){
					var params = me.more.params;
					var oUrl = new justep.URL(me.more.url);
					if(params) oUrl.setParam(params);
					var url = require.toUrl(oUrl.toString());
					var option = $.extend({},me.more);
					option.url = url;
					justep.Shell.showPage(option);
				});
	Model.prototype.showMessagePage = function(fid, type) {
		var peer = type === 'user' ? IM.getUserPeer(fid) : IM.getGroupPeer(fid);
		if (peer.id != this.currentDialogID.peek()) {
			this.currentDialogID.set(peer.id);
			justep.Shell.fireEvent('onShowMessagePage', {
				id : fid,
				type : type,
			});
		}
	};
Exemple #12
0
	Model.prototype.open = function(event) {
		var urlJson = {"latestNews" : "../4/latestNews.w","professionNews" : "../4/professionNews.w","news" : "../4/news.w"};
		var row = event.bindingContext.$object;
		var contents = this.comp("dataContents");
		var key = contents.getActiveXid();
		var url = urlJson[key];
		justep.Shell.showPage(require.toUrl(url), {
			rowid : row.val('id')
		});
	};
	Model.prototype.AddBtnClick = function(event) {
		justep.Shell.showPage(require.toUrl("./addMainTaskActivity.w"), {
			"status" : 0
		});
	};
Exemple #14
0
			IM.leaveGroup(peer.id).then(function() {
				IM.deleteChat(peer);
				justep.Shell.showMainPage();
			});
Exemple #15
0
	Model.prototype.btn_authClick = function(event){
		
		justep.Shell.showPage("auth");
	};
Exemple #16
0
	Model.prototype.backBtnClick = function(event) {
		justep.Shell.closePage();
	};
Exemple #17
0
				IM.leaveGroup(gid).then(function() {
					IM.deleteChat(peer);
					self.owner.close();
					if (justep.Browser.isPC)
						justep.Shell.fireEvent('onCloseMessagePage');
				});
Exemple #18
0
	Model.prototype.closeWin = function(event) {
		justep.Shell.closePage();
	};
	Model.prototype.showListClick = function(event) {
		var fID = this.comp("mainData").val("sID");
		justep.Shell.showPage(require.toUrl("./workTaskDetailActivity.w"), {
			"fID" : fID
		});
	};
Exemple #20
0
	Model.prototype.listClick = function(event){
		justep.Shell.showPage("registered");
	};
Exemple #21
0
	Model.prototype.manageGroupBtnClick = function(event) {
		justep.Shell.showPage("$UI/work/org/createOrgActivity.m.w");
	};
Exemple #22
0
	Model.prototype.backBtnClick = function(event) {
		if(this.watchID)
			navigator.accelerometer.clearWatch(this.watchID);
		justep.Shell.closePage();
	};
Exemple #23
0
		justep.Shell.on('onGroupInfoPage', function(event) {
			justep.Shell.showPage('groupmembers', {
				id : event.id,
				type : event.type
			});
		});
Exemple #24
0
	Model.prototype.modelLoad = function(event){
		justep.Shell.showPage("main");
	};
Exemple #25
0
	Model.prototype.personalBtnClick = function(event) {
		justep.Shell.showPage("personal");
	};
Exemple #26
0
		this.userID.then(function(id) {
			justep.Shell.fireEvent("onSendMessagePage", {
				id : id,
				type : "user"
			});
		});
	Model.prototype.outTaskRowClick = function(event) {
		justep.Shell.showPage(require.toUrl("./workTaskOutActivity.w"));
	};
Exemple #28
0
	Model.prototype.postClick = function(event){
		justep.Shell.showPage("post");
	};
Exemple #29
0
		justep.Shell.on('onContactInfoPage', function(event) {
			justep.Shell.showPage("contact", {
				contactId : event.contactId
			});
		});
Exemple #30
0
			this.on('onModelConstructDone', function() {
				// 特殊逻辑,否则路由有问题
				justep.Shell.showMainPage();
			});