jacky_008
jacky_008
  • 发布:2015-11-07 11:01
  • 更新:2015-11-07 11:01
  • 阅读:1088

上拉加载位置问题

分类:MUI
mui

var ordersUrl = httpUrl + '/service/pay/orders/list.html'
var userId = sessionStorage.getItem("userId");
var token = sessionStorage.getItem("token");
var curPage = sessionStorage.getItem("curPage");

mui.init({
pullRefresh: {
container: '#pullrefresh',
up: {
contentrefresh: '正在加载...',
callback: pullupRefresh
}
}
});

//请求接口数据
var orderstat = {
ajax1: function() {
$.ajax({
type: "post",
url: ordersUrl,
dataType: 'json', //服务器返回json格式数据
data: {
userId: userId,
token: token,
curPage: curPage
},
timeout: 10000, //超时时间设置为10秒;
success: function(data) {
orderstat.orderHtml(data)
},
error: function() {

        }  
    });  
},  
orderHtml: function(datalist) { //处理业务流程  
    console.log(datalist)  
    var dataleg = datalist.data  
    var orderlist = $(".mui-table-view-chevron")  
    console.log(dataleg)  
    for (var i = 0; i < dataleg.length; i++) {  
        var order_Html = '<ul class="order_list">'  
                        + '<li>订单编号:'+dataleg[i].orderCode+'<span class="mui-pull-right">'+dataleg[i].gmtCreate+'</span>'   
                        + '<p>收货人:'+dataleg[i].receiver.receiverName+ ' '+dataleg[i].receiver.receiverMobile+'</p>'  
                        + '<p>收货地址:'+dataleg[i].receiver.address+'</p>'   
                        + '</li>'   
                        + '<li><i></i><span class="title_tip">'+dataleg[i].business.businessName+'</span></li>'   
                        + '<li>'   
                        + '<section>'   
                        + '<div class="Images">'   
                        + '<img src="images/01.jpg" />'   
                        + '</div>'   
                        + '<div class="con">'   
                        + '<p>宝宝一周年相册一套,绿色清新时尚 </p>'   
                        + '<p><span>宝宝熊蓝色     大型号</span></p>'   
                        + '<p>¥ 200</p>'   
                        + '</div>'   
                        + '</section>'   
                        + '</li>'   
                        + '<li>数量 <span class="mui-pull-right">×2</span></li>'   
                        + '<li>运费<span class="mui-pull-right">¥'+dataleg[i].expressAmount+'</span></li>'   
                        + '<li>买家留言<span class="mgs">老板,记得别发错颜色!</span></li>'   
                        + '<li>' + '付款:¥ '+dataleg[i].needAmount+''  
                        + '<span class="mui-pull-right">'  
                        + '<button class="cancel">取消订单</button>'   
                        + ' <button href="#" class="pay">去支付</button>'   
                        + '</span>'   
                        + '</li>'   
                        + '</ul>';  
        var dom = $(order_Html)  
        orderlist.append(dom)  
    }  

},  
innit: function() {  
    orderstat.ajax1();  
}  

}
//处理业务流程
function pullupRefresh() {
mui('#pullrefresh').pullRefresh();
this.endPullupToRefresh(false);//参数为true代表没有更多数据了。
orderstat.innit();
}
if (mui.os.plus) {
mui.plusReady(function() {
setTimeout(function() {
mui('#pullrefresh').pullRefresh().pullupLoading();
}, 1000);

});  

} else {
mui.ready(function() {
mui('#pullrefresh').pullRefresh().pullupLoading();
});
}

上拉加载 第一条数据位置一直居于顶部是怎么回事情

2015-11-07 11:01 负责人:无 分享
已邀请:

该问题目前已经被锁定, 无法添加新回复