//我的关注
var allPages = 1, // 总页数;
pageSize = 0,
pageNo = 1;
var table = document.body.querySelector('.list');
var nodatabox1 = document.getElementById("nodatabox1");
mui.init({
pullRefresh: {
container: '#pullrefresh',
/*down: {
callback: pulldownRefresh
},*/
up: {
contentrefresh: '正在加载...',
callback: pullupRefresh,
//auto:true
}
}
});
function pullupRefresh() {
pageNo = ++pageNo;
setTimeout(function() {
expert2(pageNo, 20)
}, 1000);
mui('#pullrefresh').pullRefresh().refresh(true);
}
/*function pulldownRefresh() {
setTimeout(function() {
getOneExpert(1, 10);
mui('#pullrefresh').pullRefresh().endPulldownToRefresh();
}, 1000);
}*/
mui.plusReady(function(){
mui('.list').on('tap','a',function(){
var id=this.getAttribute("data-id");
var datatype = this.getAttribute("data-type");
var ownerid = this.getAttribute("owner-id");
if(datatype == 1) {
mui.openWindow({
url: '../html/professorArticle.html',
id: 'html/professorArticle.html',
show: {
autoShow: false,
aniShow: "slide-in-right",
},
extras: {
articleId: id,
ownerid: ownerid,
}
});
}else if(datatype == 2){
mui.openWindow({
url: '../html/professorArticle.html',
id: 'html/professorArticle.html',
show: {
autoShow: false,
aniShow: "slide-in-right",
},
extras: {
articleId: id,
ownerid: ownerid,
oFlag:1
}
});
}
})
})
getOneExpert(1, 20);
/*获取第一页资源数据*/
function getOneExpert(pageNo, pageSize) {
mui.plusReady(function() {
var userId = plus.storage.getItem('userid');
mui.ajax(baseUrl + '/ajax/watch/qaPro', {
data: {
"professorId": userId,
"watchType": 3,
"pageNo": pageNo,
"pageSize": pageSize
},
dataType: 'json', //数据格式类型
type: 'GET', //http请求类型
//timeout: 10000,
//async:false,
success: function(data) {
plus.nativeUI.closeWaiting();
plus.webview.currentWebview().show("fade-in", 150);
table.innerHTML = '';
//mui('#pullrefresh').pullRefresh().refresh(true); //重置上拉加载
if(data.success && data.data.data != "") {
var datalist = data.data.data;
datalistEach(datalist);
mui('#pullrefresh').pullRefresh().refresh(true);
if(data.data.total