YOUFANG1.0.4 消息列表
This commit is contained in:
@@ -0,0 +1,92 @@
|
||||
//加载flag
|
||||
var mm_loading = false;
|
||||
//最多可加载的条目
|
||||
//var maxItems = 100;
|
||||
//每次加载添加多少条目
|
||||
var mm_itemsPerLoad = 10;
|
||||
|
||||
var mm_totalCount = 0;
|
||||
|
||||
function addMessage(loadNum,startNum){
|
||||
axios.get(BASE_PATH + "/rest/message/loadMessages",{
|
||||
params:{
|
||||
loadNum:loadNum,
|
||||
startNum:startNum
|
||||
}
|
||||
}).then(function(response){
|
||||
var messageList = response.data.data.list;
|
||||
if(messageList != null && messageList.length == 0){
|
||||
// 删除加载提示符
|
||||
$('#loadTip4').remove();
|
||||
// 加载完毕,则注销无限加载事件,以防不必要的加载
|
||||
//$.detachInfiniteScroll($('.infinite-scroll'));
|
||||
return;
|
||||
}
|
||||
mm_totalCount = response.data.data.totalCount;
|
||||
tab.mm_num = mm_totalCount;
|
||||
var html="";
|
||||
$.each(messageList,function(){
|
||||
// var clickStr = "";
|
||||
// if(this.operation==0){//打开详情
|
||||
// href = '<a href="../message/detail?mid='+this.midStr+'"';
|
||||
// }
|
||||
// if(this.operation==1){打开页面
|
||||
// href = '<a href="../'+this.operationPage+'"';
|
||||
// }
|
||||
// if(this.operation==2){打开Url
|
||||
// href = '<a target="_blank" href="'+this.operationPage+'"';
|
||||
// }
|
||||
html+='<li>'+
|
||||
'<a class="item-content message01 '+(this.readStatus==0?'message01-new':'')+'" onclick="messageGoto(this,\''+this.operation+'\',\''+this.operationPage+'\',\''+this.midStr+'\')">'+
|
||||
'<div class="item-media"><i class="icon icon-message01"></i></div>'+
|
||||
'<div class="item-inner">'+
|
||||
'<div class="item-title-row">'+
|
||||
'<div class="item-title">'+(this.title.length>20?this.title.substring(0,19):this.title)+'</div>'+
|
||||
'</div>'+
|
||||
'<div class="item-subtitle">'+this.addTimeStr+'</div>'+
|
||||
'</div>'+
|
||||
'</a>'+
|
||||
'</li>';
|
||||
})
|
||||
$("#messageUl").append(html);
|
||||
if(mm_totalCount<mm_itemsPerLoad){
|
||||
// 加载完毕,则注销无限加载事件,以防不必要的加载
|
||||
// $.detachInfiniteScroll($('.infinite-scroll'));
|
||||
// 删除加载提示符
|
||||
$('#loadTip4').remove();
|
||||
}
|
||||
}).catch(function(error){
|
||||
console.log(error);
|
||||
});
|
||||
}
|
||||
|
||||
function messageGoto(_this,operation,operationPage,mid){
|
||||
var subpage_style = {
|
||||
top: '0',
|
||||
bottom: '50px',
|
||||
};
|
||||
axios.post('/rest/message/readMesage',{mid:mid}).then(function(response){
|
||||
console.log(response)
|
||||
}).catch(function(error){
|
||||
console.log(error)
|
||||
});
|
||||
$(_this).removeClass("message01-new")
|
||||
if(operation==0){
|
||||
clicked('/views/message/detail.html',true,false,{},{mid:mid},function(){})
|
||||
}
|
||||
if(operation==1){
|
||||
var pages = operationPage+'.html';
|
||||
if(plus.webview.getWebviewById(pages)==null){
|
||||
plus.webview.create(pages, pages, subpage_style);
|
||||
}
|
||||
plus.webview.show(pages);
|
||||
}
|
||||
if(operation==2){
|
||||
if (operationPage != null && operationPage != "") {
|
||||
clicked('../webview_embed.html', true,false,{},{url:operationPage})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user