- 浏览: 89440 次
- 性别:
- 来自: 孝感
-
文章分类
最新评论
/**
* 名人关注模型
*/
Ext.regModel("focusFamous",{
fields: [{
name: 'id',
type: 'string'
},{
name: 'pic',
type: 'string'
},{
name: 'name',
type: 'string'
},{
name: 'valPic',
type: 'string'
},{
name: 'sex',
type: 'string'
},{
name: 'city',
type: 'string'
},{
name: 'area',
type: 'string'
}]
})
/**
* 好友动态模型
*/
Ext.regModel("friendsAction",{
fields: [{
name: 'id',
type: 'string'
},{
name: 'pic',
type: 'string'
},{
name: 'name',
type: 'string'
},{
name: 'pubPic',
type: 'string'
},{
name: 'pubDate',
type: 'string'
},{
name: 'content',
type: 'string'
},{
name: 'agent',
type: 'string'
},{
name: 'transmits',
type: 'integer'
},{
name: 'comments',
type: 'integer'
}]
})
/**
* 名人关注
* @class travelbook.view.FocusFamous
* @extends Ext.Panel
*/
travelbook.view.FocusFamous = Ext.extend(Ext.Panel, {
id: 'focusFamous',
modal: true,
centered: true,
floating: true,
isFirst: true,
height: '100%',
width: '100%',
style: 'filter:alpha(opacity=10);'
+'-moz-opacity:0.5;'
+'-khtml-opacity: 0.5;'
+'opacity: 0.5;',
initComponent : function() {
travelbook.view.FocusFamous.superclass.initComponent.call(this);
this.listeners = {
afterlayout: function(){
var famousList = Ext.getCmp('famousList');
if(undefined != famousList){
famousList.setHeight(this.getHeight()-92);
}
}
};
},
dockedItems: [{
xtype: 'toolbar',
ui: 'dark',
title: '关注名人',
layout: {
pack: 'left'
},
dock: 'top'
},{
xtype: 'toolbar',
ui: 'dark',
dock: 'bottom',
layout: 'hbox',
defaults: {
xtype: 'button',
ui: 'decline',
flex: '2'
},
items: [{
text: '关注已选',
handler: function(){
travelbook.community.focusChecked();
}
},{
text: '关注全部',
handler: function(){
travelbook.community.focusAll();
}
},{
text: '取消',
handler: function(){
Ext.getCmp('focusFamous').hide({type:'cube',direction:'up'});
//进入好友列表
travelbook.community.showFriendsList();
}
}]
}],
items: [{
id: 'famousList',
xtype: 'list',
height: '100%',
store: new Ext.data.Store({
model: 'focusFamous',
sorters: 'id',
getGroupString: function(record){
return record.get('id')[0];
},
data: [{
id: '1001',
pic: '../images/pic.jpg',
name: '卢静',
valPic: '../images/valPic.jpg',
sex: '女',
city: '浙江',
area: '杭州'
},{
id: '1002',
pic: '../images/pic.jpg',
name: '卢静',
valPic: '../images/valPic.jpg',
sex: '女',
city: '浙江',
area: '杭州'
},{
id: '1003',
pic: '../images/pic.jpg',
name: '卢静',
valPic: '../images/valPic.jpg',
sex: '女',
city: '浙江',
area: '杭州'
},{
id: '1004',
pic: '../images/pic.jpg',
name: '卢静',
valPic: '../images/valPic.jpg',
sex: '女',
city: '浙江',
area: '杭州'
},{
id: '1005',
pic: '../images/pic.jpg',
name: '卢静',
valPic: '../images/valPic.jpg',
sex: '女',
city: '浙江',
area: '杭州'
},{
id: '1006',
pic: '../images/pic.jpg',
name: '卢静',
valPic: '../images/valPic.jpg',
sex: '女',
city: '浙江',
area: '杭州'
},{
id: '1007',
pic: '../images/pic.jpg',
name: '卢静',
valPic: '../images/valPic.jpg',
sex: '女',
city: '浙江',
area: '杭州'
},{
id: '1008',
pic: '../images/pic.jpg',
name: '卢静',
valPic: '../images/valPic.jpg',
sex: '女',
city: '浙江',
area: '杭州'
}]
}),
itemTpl: '<div style="float:left;width:80%;font-size:12px;cursor:pointer;" onclick="travelbook.community.showOwnDatum({id})">'
+'<div style="float:left">'
+'<img width="50" height="50" src="{pic}"/> '
+'</div>'
+'<div style="float:left">'
+'<div>'
+'<div>'
+'{name} '
+'<img width="10" height="10" src="{valPic}"/> '
+'</div>'
+'<div>'
+'{sex}, {city} {area}'
+'</div>'
+'<div id="discloseDiv{id}">'
+'aaaaa'
+'</div>'
+'</div>'
+'</div>'
+'</div>'
+'<div style="float:right;">'
+'<img name="focusFamousChkImg" id="focusFamousChkImg_{id}" src="../images/unchecked.png" width="50" height="50" style="cursor:pointer;" onclick="travelbook.community.chooseFamous({id})"/>'
+'</div>'
}]
});
Ext.reg("travelbook.view.FocusFamous",travelbook.view.FocusFamous)
/**
* 好友列表
* @class travelbook.view.FriendsList
* @extends Ext.Panel
*/
travelbook.view.FriendsList = Ext.extend(Ext.Panel, {
id: 'friendsList',
height: '100%',
// width: '100%',
style: 'background:transparent',
initComponent : function() {
travelbook.view.FocusFamous.superclass.initComponent.call(this);
},
items: [{
id: 'membersList',
xtype: 'list',
height: '100%',
width: '100%',
store: new Ext.data.Store({
model: 'friendsAction',
sorters: 'id',
getGroupString: function(record){
return record.get('id')[0];
},
//id pic name pubDate content agent transmits comments
data: [{
id: '2001',
pic: '../images/_pic.jpg',
name: '抽烟发芽',
pubPic: '../images/_valPic.jpg',
pubDate: '2分钟前',
content: '今天天气非常好,适合海边去泡一泡.一早起床建议大家多使用车主宝典.',
agent: '车主宝典',
transmits: 6,
comments: 8
},{
id: '2002',
pic: '../images/_pic.jpg',
name: '抽烟发芽',
pubPic: '../images/_valPic.jpg',
pubDate: '2分钟前',
content: '今天天气非常好,适合海边去泡一泡.一早起床建议大家多使用车主宝典.',
agent: '车主宝典',
transmits: 6,
comments: 8
},{
id: '2003',
pic: '../images/_pic.jpg',
name: '抽烟发芽',
pubPic: '../images/_valPic.jpg',
pubDate: '2分钟前',
content: '今天天气非常好,适合海边去泡一泡.一早起床建议大家多使用车主宝典.',
agent: '车主宝典',
transmits: 6,
comments: 8
},{
id: '2004',
pic: '../images/_pic.jpg',
name: '抽烟发芽',
pubPic: '../images/_valPic.jpg',
pubDate: '2分钟前',
content: '今天天气非常好,适合海边去泡一泡.一早起床建议大家多使用车主宝典.',
agent: '车主宝典',
transmits: 6,
comments: 8
},{
id: '2005',
pic: '../images/_pic.jpg',
name: '抽烟发芽',
pubPic: '../images/_valPic.jpg',
pubDate: '2分钟前',
content: '今天天气非常好,适合海边去泡一泡.一早起床建议大家多使用车主宝典.',
agent: '车主宝典',
transmits: 6,
comments: 8
},{
id: '2006',
pic: '../images/_pic.jpg',
name: '抽烟发芽',
pubPic: '../images/_valPic.jpg',
pubDate: '2分钟前',
content: '今天天气非常好,适合海边去泡一泡.一早起床建议大家多使用车主宝典.',
agent: '车主宝典',
transmits: 6,
comments: 8
},{
id: '2007',
pic: '../images/_pic.jpg',
name: '抽烟发芽',
pubPic: '../images/_valPic.jpg',
pubDate: '2分钟前',
content: '今天天气非常好,适合海边去泡一泡.一早起床建议大家多使用车主宝典.',
agent: '车主宝典',
transmits: 6,
comments: 8
},{
id: '2008',
pic: '../images/_pic.jpg',
name: '抽烟发芽',
pubPic: '../images/_valPic.jpg',
pubDate: '2分钟前',
content: '今天天气非常好,适合海边去泡一泡.一早起床建议大家多使用车主宝典.',
agent: '车主宝典',
transmits: 6,
comments: 8
}]
}),
itemTpl: '<table style="font-size:12px;width:100%;">'
+'<tr>'
+'<td>'
+'<img width="60" height="60" src="{pic}"/>'
+'</td>'
+'<td>'
+'<div>'
+'<div style="float:left">'
+'{name}'
+'</div>'
+'<div style="float:right">'
+'<img width="10" height="10" src="{pubPic}"/> {pubDate}'
+'</div>'
+'</div>'
+'<div>'
+'<div style="color:green">'
+'<div style="float:left">'
+'{content}'
+'</div>'
+'<div style="float:right">'
+' '
+'</div>'
+'</div>'
+'</div>'
+'<div>'
+'<div style="float:left">'
+'转发({transmits})评论({comments})'
+'</div>'
+'<div style="float:right">'
+'来自{agent}'
+'</div>'
+'</div>'
+'</td>'
+'</tr>'
+'</table>',
listeners : {
itemtap : function(list, index, item, e) {
var store = list.getStore(),
host = store.getAt(index);
//进入动态详情
travelbook.community.showActionDetail();
}
}
}]
});
Ext.reg("travelbook.view.FriendsList",travelbook.view.FriendsList)
/**
* 个人信息
* @class travelbook.view.PersonalInfo
* @extends Ext.Panel
*/
travelbook.view.PersonalInfo = Ext.extend(Ext.Panel, {
id: 'personalInfo',
width: '100%',
layout: 'card',
style: 'background:#FFFFFF;',
initComponent : function() {
travelbook.view.PersonalInfo.superclass.initComponent.call(this);
},
recordTpl: new Ext.XTemplate([
'<div style="background:#FFFFFF;">'
+ '<tpl for=".">'
+ '<table style="width:100%;font-size:13px;">'
+ '<tr>'
+ '<td>'
+ '<div>'
+'<img src="{pic}" width="45" height="45" style="cursor:pointer;" onclick="travelbook.community.showOwnDatum({id})"/>'
+ '</div>'
+ '</td>'
+ '<td>'
+ '<div>'
+'{name} '
+'<img src="{valPic}" width="10" height="10"/>'
+ '</div>'
+ '<div>'
+'<img src="{levelSun}" width="15" height="15"/>'
+'<img src="{levelMoon}" width="15" height="15"/>'
+'<img src="{levelStar}" width="15" height="15"/>'
+'</div>'
+ '</td>'
+ '<td style="text-align:center;">'
+ '<div>'
+'<img src="{arrowPic}" width="30" height="30"/>'
+ '</div>'
+ '<div style="font-size:12px;">'
+'{levelName} '
+ '</div>'
+ '</td>'
+ '</tr>'
+ '</table>'
+'</tpl></div>'
])
});
Ext.reg("travelbook.view.PersonalInfo",travelbook.view.PersonalInfo);
/**
* 个人信息(详情)
* @class travelbook.view.PersonalInfoDetail
* @extends Ext.Panel
*/
travelbook.view.PersonalInfoDetail = Ext.extend(Ext.Panel, {
id: 'personalInfoDetail',
layout: 'card',
width: '100%',
style: 'background:#FFFFFF;',
initComponent : function() {
travelbook.view.PersonalInfoDetail.superclass.initComponent.call(this);
},
recordTpl: new Ext.XTemplate([
'<div style="background:#FFFFFF;">'
+ '<tpl for=".">'
+ '<table style="width:100%;font-size:13px;">'
+ '<tr>'
+ '<td>'
+ '<div>'
+'<img src="{pic}" width="45" height="45"/>'
+ '</div>'
+ '</td>'
+ '<td>'
+ '<div>'
+'{name} '
+'<img src="{valPic}" width="10" height="10"/>'
+ '</div>'
+ '<div>'
+'<img src="{levelSun}" width="15" height="15"/>'
+'<img src="{levelMoon}" width="15" height="15"/>'
+'<img src="{levelStar}" width="15" height="15"/>'
+'</div>'
+ '</td>'
+ '<td style="text-align:center;">'
+ '<div>'
+'<img src="{arrowPic}" width="30" height="30"/>'
+ '</div>'
+ '<div style="font-size:12px;">'
+'{levelName} '
+ '</div>'
+ '</td>'
+ '</tr>'
+ '</table>'
// + '<div id="iframe">'
// + '</div>'
+'</tpl></div>'
])
});
Ext.reg("travelbook.view.PersonalInfoDetail",travelbook.view.PersonalInfoDetail);
/**
* 访友列表
* @class travelbook.view.FriendGroups
* @extends Ext.Panel
*/
travelbook.view.FriendGroups = Ext.extend(Ext.Panel, {
id: 'friendGroups',
width: '85%',
layout: 'card',
initComponent : function() {
travelbook.view.FriendGroups.superclass.initComponent.call(this);
},
recordTpl: new Ext.XTemplate([
'<div>'
+'<tpl for=".">'
+'<table cellspacing="10" cellpadding="10" width="100%" style="font-size:12px;border: 1px solid white;">'
+'<tr>'
+'<td>'
+'<img width="40" height="40" src="{pic}"/>'
+'</td>'
+'<td width="200">'
+'<div>'
+'<div style="float:left;color:#FFFFFF;">'
+'{name}'
+'</div>'
+'<div style="float:right;color:#FFFFFF;">'
+' <img width="10" height="10" src="{pubPic}"/> {pubDate}'
+'</div>'
+'</div>'
+'<div width="100%">'
+'<div>'
+'<div style="float:left;color:green;">'
+'{content}'
+'</div>'
+'<div style="float:right">'
+' '
+'</div>'
+'</div>'
+'</div>'
+'</td>'
+'</tr>'
+'</table>'
+'</tpl></div>'
])
});
Ext.reg("travelbook.view.FriendGroups",travelbook.view.FriendGroups);
/**
* 个人语录
* @class travelbook.view.PersonalWords
* @extends Ext.Panel
*/
travelbook.view.PersonalWords = Ext.extend(Ext.Panel, {
id: 'personalWords',
width: '100%',
layout: 'card',
initComponent : function() {
travelbook.view.PersonalWords.superclass.initComponent.call(this);
},
recordTpl: new Ext.XTemplate([
'<div>'
+ '<tpl for=".">'
+ '<div style="font-size:13px;">'
+ '<div style="float:left;position:absolutly;width:100%;color:#FFFFFF;">'
+ '<div style="float:left;">'
+'转发了消息,并且说:{saywords}'
+ '</div>'
+ '<div style="float:right;">'
+'{pubDate}'
+ '</div>'
+ '</div>'
+ '<div style="float:left;position:absolutly;">'
+ '<div>'
+'<span style="color:#FFFFFF;">@{fromAuthor}</span>: '
+'<span style="color:#FFFF3C;">{content}</span>'
+ '</div>'
+ '<div style="color:#FFFFFF;;">'
+'原文转发({transmits}) | 原文评论({comments})'
+ '</div>'
+ '</div>'
+ '</div>'
+'</tpl></div>'
])
});
Ext.reg("travelbook.view.PersonalWords",travelbook.view.PersonalWords);
/**
* 个人勋章
* @class travelbook.view.Honour
* @extends Ext.Panel
*/
travelbook.view.Honour = Ext.extend(Ext.Panel, {
id: 'honour',
layout: 'card',
width: '100%',
style: 'background:#FFFFFF;font-size:12px;',
initComponent : function() {
travelbook.view.Honour.superclass.initComponent.call(this);
},
recordTpl: new Ext.XTemplate([
'<div>'
+ '<tpl for=".">'
+ '<div>'
+'<span style="color:#336699;"><b>TA的勋章:</b></span>'
+'<img src="{honourPic}" width="20" height="20"/><img src="{honourPic}" width="20" height="20"/>'
+ '</div>'
+ '</tpl>'
+'</div>'
])
});
Ext.reg("travelbook.view.Honour",travelbook.view.Honour);
/**
* 个人介绍
* @class travelbook.view.IntroduceSura
* @extends Ext.Panel
*/
travelbook.view.IntroduceSura = Ext.extend(Ext.Panel, {
id: 'introduceSura',
layout: 'card',
width: '100%',
style: 'background:#FFFFFF;font-size:12px;',
initComponent : function() {
travelbook.view.IntroduceSura.superclass.initComponent.call(this);
},
recordTpl: new Ext.XTemplate([
'<div style="background:#FFFFFF;">'
+ '<tpl for=".">'
+ '<div>'
+'<span style="color:#336699;"><b>TA的简介:</b></span> {introduce}'
+ '</div>'
+ '</tpl>'
+'</div>'
])
});
Ext.reg("travelbook.view.IntroduceSura",travelbook.view.IntroduceSura);
/**
* 应用项
* @class travelbook.view.AppItem
* @extends Ext.Panel
*/
travelbook.view.AppItem = Ext.extend(Ext.Panel, {
id: 'appItem',
layout: 'card',
width: '100%',
style: 'background:#FFFFFF;font-size:12px;',
initComponent : function() {
travelbook.view.AppItem.superclass.initComponent.call(this);
},
recordTpl: new Ext.XTemplate([
'<div style="background:#FFFFFF;">'
+ '<tpl for=".">'
+ '<table cellspacing="10" cellspadding="5" width="100%" style="text-align:center;">'
+ '<tr>'
+ '<td style="border-top:1px solid #336699;border-right:1px solid #336699;">'
+ '<div style="color:#336699;"><b>{focus}</b></div>'
+ '<div>关注</div>'
+ '</td>'
+ '<td style="border-top:1px solid #336699;border-right:1px solid #336699;">'
+ '<div style="color:#336699;font:bold;"><b>{fans}</b></div>'
+ '<div>粉丝</div>'
+ '</td>'
+ '<td style="border-top:1px solid #336699;border-right:1px solid #336699;">'
+ '<div style="color:#336699;font:bold;"><b>{speakings}</b></div>'
+ '<div>发言</div>'
+ '</td>'
+ '<td style="border-top:1px solid #336699;border-right:1px solid #336699;">'
+ '<div style="color:#336699;font:bold;"><b>{label}</b></div>'
+ '<div>标注</div>'
+ '</td>'
+ '<td style="border-top:1px solid #336699;border-right:1px solid #336699;">'
+ '<div style="color:#336699;font:bold;"><b>{stepPoints}</b></div>'
+ '<div>踩点</div>'
+ '</td>'
+ '</tr>'
+ '</table>'
+ '</tpl></div>'
])
});
Ext.reg("travelbook.view.AppItem",travelbook.view.AppItem);
/**
* 个人言论
* @class travlebook.view.OwnWords
* @extends Ext.Panel
*/
travelbook.view.OwnWords = Ext.extend(Ext.Panel, {
id: 'ownWords',
layout: 'card',
width: '100%',
initComponent : function() {
travelbook.view.OwnWords.superclass.initComponent.call(this);
},
recordTpl: new Ext.XTemplate([
'<div style="background:gray;color:#FFFFFF;">'
+ '<tpl for=".">'
+ '<div style="font-size:13px;">'
+ '<div style="text-align:right;">'
+'{pubDate}'
+ '</div>'
+ '<div>'
+'{content}'
+ '</div>'
+ '<div>'
+ '<div>'
+'<img src="{suraPic}" width="50" height="50"/>'
+ '</div>'
+ '<div>'
+' '
+ '</div>'
+ '</div>'
+ '<div>'
+ '<div style="float:left;">'
+'转发({transmits}) 评论({comments})'
+ '</div>'
+ '<div style="float:right;">'
+'来自{agent}'
+ '</div>'
+ '</div>'
+ '</div>'
+'</tpl></div>'
])
});
Ext.reg("travelbook.view.OwnWords",travelbook.view.OwnWords);
/**
* 动态详情
* @class travelbook.view.ActionDetail
* @extends Ext.Panel
*/
travelbook.view.ActionDetail = Ext.extend(Ext.Panel, {
id: 'actionDetail',
fullscreen: true,
isLoaded: false,
scroll: 'vertical',
style: 'background:gray;',
layout: 'vbox',
width: '100%',
initComponent : function() {
travelbook.view.ActionDetail.superclass.initComponent.call(this);
},
listeners: {
added: function(){
this.add({xtype: 'travelbook.view.PersonalInfo'});
this.add({xtype: 'travelbook.view.PersonalWords'});
this.add({xtype: 'travelbook.view.FriendGroups'});
this.doLayout(true,false);
},
show: function(){
//加载数据
travelbook.community.loadActionDetailData();
},
activate: function(){
travelbook.controller.BackTarget = 'community';
}
},
dockedItems: [{
xtype: 'travelbook.view.Topbar',
title: '动态详情',
back: function(){
travelbook.community.back();
}
},{
xtype: 'panel',
dock: 'bottom',
layout: {
type: 'hbox',
align: 'center',
pack: 'center'
},
style: 'background:white;',
defaults: {
xtype: 'button',
ui: 'round'
},
items: [{
text: '∑',
handler: function(){
Ext.Msg.alert('',this.text);
}
},{
text: '⊙',
handler: function(){
Ext.Msg.alert('',this.text);
}
},{
text: '⊿',
handler: function(){
Ext.Msg.alert('',this.text);
}
},{
text: '●',
handler: function(){
Ext.Msg.alert('',this.text);
}
},{
text: '∏',
handler: function(){
Ext.Msg.alert('',this.text);
}
}]
}]
});
Ext.reg("travelbook.view.ActionDetail",travelbook.view.ActionDetail);
/**
* TA的资料
* @class travelbook.view.OwnDatum
* @extends Ext.Panel
*/
travelbook.view.OwnDatum = Ext.extend(Ext.Panel, {
id: 'ownDatum',
isLoaded: false,
layout: 'vbox',
scroll: 'vertical',
style: 'background:gray;',
initComponent : function() {
travelbook.view.OwnDatum.superclass.initComponent.call(this);
},
listeners: {
added: function(){
this.add({xtype: 'travelbook.view.PersonalInfoDetail'});
this.add({xtype: 'travelbook.view.Honour'});
this.add({xtype: 'travelbook.view.IntroduceSura'});
this.add({xtype: 'travelbook.view.AppItem'});
this.add({xtype: 'travelbook.view.OwnWords'});
this.doLayout(true,false);
},
show: function(){
//加载数据
travelbook.community.loadOwnDatumData();
},
activate: function(){
travelbook.controller.BackTarget = 'actionDetail';
}
},
dockedItems: [{
xtype: 'travelbook.view.Topbar',
title: 'TA的资料',
back: function(){
travelbook.community.back();
}
},{
xtype: 'panel',
dock: 'bottom',
layout: {
type: 'hbox',
align: 'center',
pack: 'center'
},
style: 'background:white;',
defaults: {
xtype: 'button',
ui: 'round'
},
items: [{
text: '@',
handler: function(){
Ext.Msg.alert('',this.text);
}
},{
text: '〓',
handler: function(){
Ext.Msg.alert('',this.text);
}
},{
text: '▼',
handler: function(){
Ext.Msg.alert('',this.text);
}
},{
text: '★',
handler: function(){
Ext.Msg.alert('',this.text);
}
},{
text: '&',
handler: function(){
Ext.Msg.alert('',this.text);
}
}]
}]
});
Ext.reg("travelbook.view.OwnDatum",travelbook.view.OwnDatum);
/***
* 社区
* @class travelbook.view.Community
* @extends Ext.Panel
*/
travelbook.view.Community = Ext.extend(Ext.Panel, {
id: 'community',
fullscreen : true,
layout: 'card',
initComponent : function() {
travelbook.view.Community.superclass.initComponent.call(this);
this.activeItem = 0;
this.listeners = {
added: function(){
//显示名人关注
travelbook.community.showFocusFamous();
},
show: function(){
//显示好友列表
travelbook.community.showFriendsList();
},
activate: function(){
travelbook.controller.BackTarget = 'main';
}
};
},
dockedItems : [{
xtype: 'travelbook.view.Topbar',
title: '社区',
back:function(){
travelbook.community.back();
}
}],
items: [{
//好友动态
id: 'friendAction',
xtype: 'tabpanel',
ui: 'light',
activeItem: 1,
listeners: {
afterlayout: function(self,layout){
var membersList = Ext.getCmp('membersList');
var community = Ext.getCmp('community');
if((undefined != membersList)&&(undefined != community)){
membersList.setHeight(community.getHeight()-92);
}
}
},
items: [{
id: 'squareTab',
title: '广场',
html: 'square ...'
},{
id: 'friendsTab',
height: '100%',
title: '好友'
},{
id: 'communicationTab',
title: '热议',
html: 'communication ...'
}]
}]
});
Ext.reg("travelbook.view.Community", travelbook.view.Community);
/***
* 全局回退标识
* @type String
*/
travelbook.controller.BackTarget = 'main';
/***
* 控制器
*/
travelbook.community = new Ext.Controller({
//显示名人关注
showFocusFamous: function(){
var focusFamous = Ext.getCmp('focusFamous');
if (undefined == focusFamous) {
Ext.getCmp('viewport').addItem({xtype:'travelbook.view.FocusFamous'});
}
Ext.getCmp('focusFamous').show({type:'slide',direction:'up'});
},
//显示好友列表
showFriendsList: function(){
var community = Ext.getCmp('community');
var friendAction = Ext.getCmp('friendAction');
var friendsList = Ext.getCmp('friendsList');
var friendsTab = Ext.getCmp('friendsTab');
if (undefined == friendsList) {
friendsTab.add({xtype: 'travelbook.view.FriendsList'});
friendsTab.doLayout();
}
friendAction.setActiveItem(friendsTab);
community.setActiveItem(friendAction);
Ext.getCmp('viewport').setActiveItem(community);
},
//显示动态详情
showActionDetail: function(){
var actionDetail = Ext.getCmp('actionDetail');
if (undefined == actionDetail) {
Ext.getCmp('viewport').addItem({xtype:'travelbook.view.ActionDetail'});
}
Ext.getCmp('viewport').setActiveItem('actionDetail',{type:'cube',direction:'left'});
//设置回退标识
travelbook.controller.BackTarget = 'community';
},
//显示TA的资料
showOwnDatum: function(id){//名人Id
//隐藏名人关注
Ext.getCmp("focusFamous").hide("flip");
var ownDatum = Ext.getCmp('ownDatum');
if (undefined == ownDatum) {
Ext.getCmp("viewport").addItem({xtype:"travelbook.view.OwnDatum"});
}
Ext.getCmp("viewport").setActiveItem("ownDatum",{type:'cube',direction:'left'});
//设置回退标识
travelbook.controller.BackTarget = 'actionDetail';
},
//选中或取消选中关注对象
chooseFamous: function(id){//名人Id
var focusFamousChkImg = document.getElementById('focusFamousChkImg_'+id),
imgSrc = focusFamousChkImg.src;
var status = imgSrc.substring(imgSrc.lastIndexOf('/')+1,imgSrc.lastIndexOf('.'));
if(status == 'unchecked'){
focusFamousChkImg.src = '../images/checked.png';
}else {
focusFamousChkImg.src = '../images/unchecked.png';
}
},
//关注选中
focusChecked: function(){
//计数器,批量Id,临时Id,图片路径,状态标量
var cnt = 0, ids = '',tmpId, imgSrc = '', status = '';
var focusFamousChkImg = document.getElementsByName('focusFamousChkImg');
for(var i=0; i<focusFamousChkImg.length; i++){
imgSrc = focusFamousChkImg[i].src;
status = imgSrc.substring(imgSrc.lastIndexOf('/')+1,imgSrc.lastIndexOf('.'));
if(status == 'checked'){
cnt ++;
tmpId = focusFamousChkImg[i].id;
ids += tmpId.substring(tmpId.lastIndexOf('_')+1,tmpId.length) + ',';
}
}
ids = ids.substring(0, ids.length-1);
if(cnt == 0){
alert('您没有关注任何人喔,赶紧选一个吧~');
}else{
alert('共关注 '+cnt+' 人, \r\n编号: '+ids);
}
},
//关注全部
focusAll: function(){
//计数器,批量Id,临时Id
var cnt = 0, ids = '',tmpId;
var focusFamousChkImg = document.getElementsByName('focusFamousChkImg');
for(var i=0; i<focusFamousChkImg.length; i++){
focusFamousChkImg[i].src = '../images/checked.png';
cnt ++;
tmpId = focusFamousChkImg[i].id;
ids += tmpId.substring(tmpId.lastIndexOf('_')+1,tmpId.length) + ',';
}
ids = ids.substring(0, ids.length-1);
alert('共关注 '+cnt+' 人, \r\n编号: '+ids);
},
//加载动态详情各组件数据
loadActionDetailData: function(){
var actionDetail = Ext.getCmp('actionDetail');
if(!actionDetail.isLoaded){
actionDetail.isLoaded = true;
var personalInfo = Ext.getCmp('personalInfo'),
personalInfoTpl = personalInfo.recordTpl;
var data = [{
id: '2001',
pic: '../images/portrait.jpg',
name: '爱煮茶',
valPic: '../images/valPic.jpg',
levelSun: '../images/sun.jpg',
levelMoon: '../images/moon.jpg',
levelStar: '../images/star.jpg',
levelName: '赤脚大仙',
arrowPic: '../images/arrow.jpg'
}];
personalInfoTpl.overwrite(personalInfo.body, data);
var personalWords = Ext.getCmp('personalWords'),
personalWordsTpl = personalWords.recordTpl;
var data = [{
id: '2001',
name: '爱煮茶',
saywords: '说的在理儿。',
pubDate: '20分钟前',
levelName: '赤脚大仙',
fromAuthor: '琳敏卿',
content: '65岁的富翁正在与一位风华正茂的妙龄女子谈恋爱,而且准备向她求婚,他征求自己的好朋友的意见:假如我说自己45岁,她是不是会嫁给我? 假如你说自己今年90岁,朋友狡黠地回答,那么成功率会更大些!',
transmits: 6,
comments: 8
}];
personalWordsTpl.overwrite(personalWords.body, data);
var friendGroups = Ext.getCmp('friendGroups'),
friendGroupsTpl = friendGroups.recordTpl;
var data = [{
id: '2001',
pic: '../images/__pic.jpg',
name: '咖啡有毒',
pubPic: '../images/__valPic.jpg',
pubDate: '20分钟前',
content: '有朋友就是好哇!'
},{
id: '2002',
pic: '../images/__pic.jpg',
name: '咖啡有毒',
pubPic: '../images/__valPic.jpg',
pubDate: '20分钟前',
content: '有朋友就是好哇!.'
}];
friendGroupsTpl.overwrite(friendGroups.body, data);
actionDetail.doLayout(true,false);
}
},
//加载TA的资料
loadOwnDatumData: function(){
var ownDatum = Ext.getCmp('ownDatum');
if(!ownDatum.isLoaded){
ownDatum.isLoaded = true;
//个人介绍
var personalInfoDetail = Ext.getCmp('personalInfoDetail'),
personalInfoDetailTpl = personalInfoDetail.recordTpl;
var data = [{
id: '2001',
pic: '../images/portrait.jpg',
name: '爱煮茶',
valPic: '../images/valPic.jpg',
levelSun: '../images/sun.jpg',
levelMoon: '../images/moon.jpg',
levelStar: '../images/star.jpg',
levelName: '赤脚大仙',
arrowPic: '../images/arrow.jpg'
}];
personalInfoDetailTpl.overwrite(personalInfoDetail.body, data);
//this.createIframe('http://192.168.1.136:8080/touch/app/views/community/form.jsp');
//个人勋章
var honour = Ext.getCmp('honour'),
honourTpl = honour.recordTpl;
var data = [{
id: '2001',
honourPic: '../images/Image_BusinessWedding.png'
}];
honourTpl.overwrite(honour.body, data);
//个人简介
var introduceSura = Ext.getCmp('introduceSura'),
introduceSuraTpl = introduceSura.recordTpl;
var data = [{
id: '2001',
introduce: '他还木有介绍!'
}];
introduceSuraTpl.overwrite(introduceSura.body, data);
//动作项
var appItem = Ext.getCmp('appItem'),
appItemTpl = appItem.recordTpl;
var data = [{
id: '2001',
focus: 20,
fans: 30,
speakings: 123,
label: 12,
stepPoints: 5
}];
appItemTpl.overwrite(appItem.body, data);
//个人转发
var ownWords = Ext.getCmp('ownWords'),
ownWordsTpl = ownWords.recordTpl;
var data = [{
id: '2001',
pubDate: '6分钟前',
content: '【这些街头小吃最好不要吃】①臭豆腐:硫酸亚铁②麻辣烫:地沟油,双氧水,福尔马林③毛鸡蛋:寄生虫④烤肉串:流泪猫或死猪肉⑤包子:猪肉瘤,血脖肉,死猪肉⑥油饼油条:铝超标,敌敌畏,地沟油⑦海鲜排挡:寄生虫,水银,甲醛⑧煎饼果子:地沟油,过期火腿⑨烤红薯:化工桶⑩炸鸡翅:臭鸡翅.',
suraPic: '../images/Image_AD_Big.png',
transmits: 50,
comments: 10,
agent: '车主宝典'
}];
ownWordsTpl.overwrite(ownWords.body, data);
ownDatum.doLayout(true,false);
}
},
//动态创建iFrame
createIframe: function(url){
var iframe = document.createElement('iframe');
iframe.src = url;
iframe.width = '100%';
iframe.height = 150;
iframe.frameborder = 0;
iframe.style.border = 'solid black 1px;';
//alert(document.getElementById("iframe"));
document.getElementById("iframe").appendChild(iframe);
},
//回退
back: function(){
try{
Ext.getCmp('viewport').setActiveItem(travelbook.controller.BackTarget,{type:'cube',direction:'right'});
}catch(Exception){
//返回至名人关注
Ext.getCmp('viewport').setActiveItem(Ext.getCmp('focusFamous'),{type:'cube',derection:'down'});
}
}
});
发表评论
-
sencha列表数据刷新和显示更多的插件模拟(iPhone & Android)
2012-03-15 17:50 3012/*************************** ... -
自定义动态生成Model以及数据格式处理代码精细
2011-07-05 09:57 1245package org.fanzone.util; ... -
关于SenchaTouch生成动态TabPanel的一些代码摘要
2011-07-05 09:44 2351tab_auto.js Ext.ns("mars.v ... -
Sencha Touch 探究资料
2011-07-05 09:41 1561关于Sencha Touch探究的资料除了官网上面的简单例子h ... -
自定义SenchaTouch数据JSON格式处理工具
2011-06-03 20:19 1464package org.fanzone.util; ...
相关推荐
Sencha Touch 2 是一款专为移动设备设计的前端框架,它基于JavaScript,用于构建高性能的触屏应用。本示例“sencha-touch2 mvc demo”是关于Sencha Touch 2 MVC架构的一个简单演示,它展示了如何在移动应用中有效地...
`xtype`是Sencha框架(如Ext JS和Sencha Touch)中用于组件类型的扩展名,它允许开发者通过一个简短的字符串来创建各种组件。这种机制极大地简化了代码,使得开发人员能够快速地构建复杂且功能丰富的用户界面。 ###...
以下是常见的C++笔试面试题及其核心知识点解析,帮助您系统复习
计算机短期培训教案.pdf
计算机二级Access笔试题库.pdf
下是一份关于C++毕业答辩的心得总结,内容涵盖技术准备、答辩技巧和注意事项,供参考
内容概要:本文档详细介绍了英特尔为苹果公司构建的基于智能处理单元(IPU)的Cassandra集群的技术验证(PoC)。主要内容涵盖IPU存储用例、已建存储PoC、MEV到MMG400的过渡、苹果构建IPU-Cassandra集群的动机以及PoC开发进展。文档还探讨了硬件配置、软件环境设置、性能调优措施及其成果,特别是针对延迟和吞吐量的优化。此外,文档展示了六节点Cassandra集群的具体架构和测试结果,强调了成本和复杂性的降低。 适合人群:对分布式数据库系统、NoSQL数据库、IPU技术感兴趣的IT专业人员和技术管理人员。 使用场景及目标:适用于希望了解如何利用IPU提升Cassandra集群性能的企业技术人员。主要目标是展示如何通过IPU减少服务器部署的成本和功耗,同时提高数据处理效率。 其他说明:文档中涉及的内容属于机密级别,仅供特定授权人员查阅。文中提到的技术细节和测试结果对于评估IPU在大规模数据中心的应用潜力至关重要。
计算机二级考试C语言题.pdf
计算机发展史.pdf
计算机仿真技术系统的分析方法.pdf
yolo编程相关资源,python编程与YOLO算法组成的坐姿检测系统,功能介绍: 一:实时检测学生错误坐姿人数 二:通过前端阿里云平台显示上传数据,实现数据可视化
办公室网安全监控uptime-kuma,docker镜像离线压缩包
计算机课程设计-网络编程项目源码.zip
将该dll包放入项目并引用,可以操作打印机
杰奇2.3内核淡绿唯美小说网站源码 PC+手机版 自动采集 全站伪静态,送10.1版本关关采集器
计算机辅助教学.pdf
内容概要:本文详细介绍了如何利用天文相机和其他相关硬件设备搭建一套高画质、高帧率的流星监控系统,以及针对红色精灵闪电这一特殊自然现象的捕捉方法。文中不仅涵盖了硬件的选择标准如CMOS靶面尺寸、量子效率等重要参数,还提供了基于Python和OpenCV实现的基本监控代码示例,包括亮度突变检测、运动检测算法等关键技术点。此外,对于安装位置的选择、供电方式、成本控制等方面也有具体的指导建议。 适用人群:对天文摄影感兴趣的爱好者,尤其是希望捕捉流星和红色精灵闪电等瞬时天文现象的专业人士或业余玩家。 使用场景及目标:适用于希望搭建个人天文观测站,用于科学研究或个人兴趣爱好的场景。目标是能够稳定可靠地捕捉到流星和红色精灵闪电等难以捉摸的天文现象,为研究提供高质量的数据资料。 其他说明:文中提到的一些技术和方法虽然较为复杂,但对于有一定编程基础和技术动手能力的人来说是非常实用的参考资料。同时,文中提供的省钱技巧也为预算有限的用户提供了一些有价值的建议。
时间序列分析-基于R(第2版)习题数据
内容概要:本文详细介绍了如何使用LabVIEW通过网口读取阿特拉斯PM4000控制器的扭矩值。主要内容涵盖开放式通讯协议的理解、阿特拉斯调试软件和测试软件的应用、LabVIEW程序的具体实现步骤,包括初始化网络连接、发送读取扭矩值命令、接收并解析扭矩值数据,以及关闭网络连接。文中还提供了多个调试技巧和注意事项,如硬件接线配置、数据解析方法、常见错误及其解决办法,以及性能优化建议。 适合人群:从事工业自动化领域的工程师和技术人员,尤其是那些需要集成阿特拉斯设备并与之进行数据交互的专业人士。 使用场景及目标:适用于需要实时监控和采集阿特拉斯PM4000控制器扭矩值的工业应用场景,旨在提高数据采集效率和准确性,确保设备运行状态的良好监测。 其他说明:文中提供的代码片段和调试经验有助于快速定位和解决问题,提升开发效率。此外,还强调了数据解析过程中需要注意的细节,如字节序问题和超时设置等。