代码拉取完成,页面将自动刷新
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title></title>
<link type="text/css" rel="stylesheet" href="css/hui.css" />
<style type="text/css">
.HUI_Wrap li{background: #ffffff;list-style: none;}
.HUI_Wrap li+li{margin-top: 0.2rem;border-top: 2px solid #CCCCCC;}
.HUI_Wrap li::after{content: '';display: block;clear: both;}
</style>
</head>
<body style="background: none;">
<div class="HUI_Wrap" id="list">
</div>
<script type="text/javascript" src="js/hui.js"></script>
<script src="js/huiSlide.js" type="text/javascript" charset="utf-8"></script>
<script>
page = 1;
more = 1;
hui.plusReady(function () {
hui.refresh(ref);
hui.centerLoading();
getlist();
hui.loadMore(loadMore);
})
function ref () {
page = 1;
more = 1;
getlist();
}
function getlist () {
hui.getJSON(
'http://jkfree.space/index.php/app/order/unpay/uid/'+plus.storage.getItem('id')+'/page/'+page,
function (data) {
hui('#list').html('');
hui.endRefresh();
hui.endLoadMore();
hui.centerLoading(true);
var str = "";
var data = data.data;
console.log(JSON.stringify(data))
if(data != ''){
for (var i = 0,count = data.length; i < count; i++) {
str += '<li style="padding-top: 1rem;" onclick="pay('+data[i].id+','+data[i].good_id+')">'
str += '<div>'
str += '<div class="HUI_FL"">'
str += ' 订单号:<span id="chargeNum">'+data[i].order+'</span>'
str += '</div>'
str += '<span class="HUI_Icons HUI_Icons_enter HUI_FR" style="margin-right: 1rem;font-size: 1.2rem;"></span>'
str += '</div>'
str += '<div class="HUI_FL" style="width: 60%;padding:1rem 0;">'
str += '<div>'
str += '<div class="HUI_FL" style="width: 48%;text-indent: 2rem;">'
str += '<img src="'+data[i].pic+'" style="width: 60%;" id="pic"/>'
str += '</div>'
str += '<div class="HUI_FL" style="width: 48%;padding-top: 0.5rem;">'
str += '<p id="goodname">'+data[i].good_name+'</p>'
str += '<p style="font-size: 1rem;color: #9E9E9E;" id="desc">'+data[i].desc+'</p>'
str += '<p style="font-size: 1rem;color: #9E9E9E;">数量<span id="num" style="font-size: 1rem;color: #9E9E9E;">1</span></p>'
str += '</div>'
str += '</div>'
str += '</div>'
str += '<div class="HUI_FL" style="width: 40%;line-height: 7rem;">'
str += '<span class="HUI_FR" style="color: #FF0000;margin-right: 1rem;">¥<span class="price" style="color: #FF0000;" id="price">'+data[i].price+'.00</span></span>'
str += '</div>'
str += '</li>'
}
}else if(more == 1){
str = '<li style="text-align:center;background:none;">已全部加载</li>';
more = 0;
}
var ul = document.createElement('ul');
ul.innerHTML = str;
hui(ul).appendTo('#list');
page++;
},
function () {
hui.toast('连接服务器失败!')
}
);
}
function loadMore () {
console.log(page)
hui.getJSON(
'http://jkfree.space/index.php/app/order/unpay/uid/'+plus.storage.getItem('id')+'/page/'+page,
function (data) {
hui.endRefresh();
hui.endLoadMore();
hui.centerLoading(true);
var str = "";
var data = data.data;
console.log(JSON.stringify(data))
if(data != ''){
for (var i = 0,count = data.length; i < count; i++) {
str += '<li style="padding-top: 1rem;" onclick="pay('+data[i].id+','+data[i].good_id+')">'
str += '<div>'
str += '<div class="HUI_FL"">'
str += ' 订单号:<span id="chargeNum">'+data[i].order+'</span>'
str += '</div>'
str += '<span class="HUI_Icons HUI_Icons_enter HUI_FR" style="margin-right: 1rem;font-size: 1.2rem;"></span>'
str += '</div>'
str += '<div class="HUI_FL" style="width: 60%;padding:1rem 0;">'
str += '<div>'
str += '<div class="HUI_FL" style="width: 48%;text-indent: 2rem;">'
str += '<img src="'+data[i].pic+'" style="width: 60%;" id="pic"/>'
str += '</div>'
str += '<div class="HUI_FL" style="width: 48%;padding-top: 0.5rem;">'
str += '<p id="goodname">'+data[i].good_name+'</p>'
str += '<p style="font-size: 1rem;color: #9E9E9E;" id="desc">'+data[i].desc+'</p>'
str += '<p style="font-size: 1rem;color: #9E9E9E;">数量<span id="num" style="font-size: 1rem;color: #9E9E9E;">1</span></p>'
str += '</div>'
str += '</div>'
str += '</div>'
str += '<div class="HUI_FL" style="width: 40%;line-height: 7rem;">'
str += '<span class="HUI_FR" style="color: #FF0000;margin-right: 1rem;">¥<span class="price" style="color: #FF0000;" id="price">'+data[i].price+'.00</span></span>'
str += '</div>'
str += '</li>'
}
}else if(more == 1){
str = '<li style="text-align:center">已全部加载</li>';
more = 0;
}
var ul = document.createElement('ul');
ul.innerHTML = str;
hui(ul).appendTo('#list');
page++;
},
function () {
hui.toast('连接服务器失败!')
}
);
}
hui.Back = function(){
var parentWebview = plus.webview.getWebviewById('unpay.html');
parentWebview.evalJS('hui.Back()');
}
function pay(order_id, good_id) {
hui.open('charge.html',{top:'0px',bottom:'0px'},true,{good_id:good_id,order_id:order_id,uid:plus.storage.getItem('id')});
}
</script>
</body>
</html>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。