新闻列表和新增dialog提示
This commit is contained in:
parent
e5db973125
commit
5eb282a80f
@ -15,22 +15,31 @@ Page({
|
||||
},
|
||||
doGetNewsList: function(page) {
|
||||
var self = this;
|
||||
app.dialog.loading('正在加载');
|
||||
app.restAjax.get(app.restAjax.path('{newsUrl}/app/newscontent/listpagenewscontentrelease', [self.data.news.newsUrl]), {
|
||||
page: page,
|
||||
rows: self.data.rows
|
||||
}, null, function(code, data) {
|
||||
if(data.length == 0) {
|
||||
if(data.rows.length == 0) {
|
||||
app.dialog.msg('暂无数据');
|
||||
return;
|
||||
}
|
||||
var newsArray;
|
||||
if(page <= 1) {
|
||||
newsArray = data.rows;
|
||||
} else {
|
||||
newsArray = self.data.news.newsList;
|
||||
newsArray = newsArray.concat(data.rows);
|
||||
}
|
||||
self.setData({
|
||||
currentPage: page,
|
||||
'news.newsList': data.rows
|
||||
'news.newsList': newsArray
|
||||
})
|
||||
}, function(code, data) {
|
||||
app.dialog.msg(data.msg);
|
||||
}, function() {
|
||||
wx.stopPullDownRefresh();
|
||||
wx.hideLoading();
|
||||
});
|
||||
},
|
||||
/**
|
||||
|
@ -5,4 +5,11 @@ function msg(text) {
|
||||
duration: 1000
|
||||
})
|
||||
}
|
||||
module.exports.msg = msg;
|
||||
function loading(msg) {
|
||||
wx.showLoading({
|
||||
title: msg,
|
||||
mask: true
|
||||
})
|
||||
}
|
||||
module.exports.msg = msg;
|
||||
module.exports.loading = loading;
|
Loading…
Reference in New Issue
Block a user