-
Notifications
You must be signed in to change notification settings - Fork 2
/
vip-collect.html
121 lines (117 loc) · 5.09 KB
/
vip-collect.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<title>我的收藏</title>
<link rel="stylesheet" href="css/weui.min.css">
<link rel="stylesheet" href="css/jquery-weui.min.css">
<link rel="stylesheet" href="css/rem-fix.css">
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<!-- body 顶部加上如下代码 -->
<div class="weui-pull-to-refresh__layer">
<div class='weui-pull-to-refresh__arrow'></div>
<div class='weui-pull-to-refresh__preloader'></div>
<div class="down">下拉刷新</div>
<div class="up">释放刷新</div>
<div class="refresh">正在刷新</div>
</div>
<!-- 容器 -->
<div class="container">
<!--<div class="product-item-warp">
<div class="product-photo-warp"><img src="images/banner1.png"></div>
<div class="product-info-warp">
<div class="product-title">不想做城市里的空巢族你可以选择带它回家</div>
<div class="product-price">¥688.00</div>
<div class="product-describe">人们忙碌一天回到家打开门就能感受到家的温暖</div>
<div class="product-join">火速参团</div>
<div class="product-tips">
<div class="product-number"><span class="product-number-icon"><img src="images/join.png"></span>20件起拍</div>
<div class="product-default-price">单价:288.00</div>
</div>
</div>
</div>-->
</div>
<div class="weui-loadmore">
<i class="weui-loading"></i>
<span class="weui-loadmore__tips">正在加载</span>
</div>
<script src="js/jquery-2.1.4.min.js"></script>
<script src="js/jquery-weui.min.js"></script>
<script src="js/swiper.min.js"></script>
<script>
function GetQueryString(name)
{
var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
var r = window.location.search.substr(1).match(reg);
if(r!=null)return unescape(r[2]); return null;
}
var indexCategory={
page:1,
loading:false,
//get the order info
init:function () {
indexCategory.post();
$(document.body).pullToRefresh();
indexCategory.refreshing();
},
post:function(){
$.ajax({
url: "http://www.hejizhihe.com/TeamBuying/WechatApi/getCollectionList.do?page="+indexCategory.page,
type:'post',
dataType:'json',
success:function (data) {
if(data.resultCode!=1000){//get information error
console.log('正确码出错'+data.resultCode)
}else{//get information successfully
var returnObject=data.returnObject,html = '';
for(var i=0;i<returnObject.length;i++){
html += '<div class="product-item-warp">'+
'<div class="product-photo-warp"><img src="'+returnObject[i].ProductImg1+'"></div>'+
'<div class="product-info-warp">'+
'<div class="product-title">'+returnObject[i].ProductName+'</div>'+
'<div class="product-price">'+returnObject[i].OpenPrice+'</div>'+
'<div class="product-describe">'+returnObject[i].BuyReason+'</div>'+
'<a class="product-join" href="product.html?ProductId='+returnObject[i].id+'">火速参团</a>'+
'<div class="product-tips">'+
'<div class="product-number"><span class="product-number-icon"><img src="images/join.png"></span>'+returnObject[i].NumOfOpen+'件起拍</div>'+
'<div class="product-default-price">单价:'+returnObject[i].MarkPrice+'</div>'+
'</div>'+
'</div>'+
'</div>';
}
if(returnObject.length < 10){
$(".weui-loadmore").hide();
$(document.body).destroyInfinite()
}
$(".container").append(html);
$(document.body).pullToRefreshDone();
}
},
fail:function () {
console.log('获取信息失败')
}
});
},
refreshing:function () {
$(document.body).on("pull-to-refresh", function() {
$(".container").html('');
indexCategory.page=1;
indexCategory.post();
});
},
infinite:function () {
$(document.body).infinite().on("infinite", function() {
if(indexCategory.loading) return;
indexCategory.loading = true;
indexCategory.post();
});
},
};
//on page load
indexCategory.init();
</script>
</body>
</html>