| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333 | 
							- <!DOCTYPE html>
 
- <html>
 
- 	<head>
 
- 		<meta charset="UTF-8">
 
- 		<title>积分中心</title>
 
- 		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
 
- 		<meta name="apple-mobile-web-app-capable" content="yes">
 
- 		<meta name="apple-mobile-web-app-status-bar-style" content="black">
 
- 		<link rel="stylesheet" type="text/css" href="css/mui.min.css" />
 
- 		<link rel="stylesheet" type="text/css" href="css/iconfont.css" />
 
- 		<link rel="stylesheet" type="text/css" href="css/style.css" />
 
- 		<style>
 
- 			.mui-content{background: #fff;}
 
- 			.jifen-top{position: relative;border-bottom: 10px solid #f2f2f2;}
 
- 			.jifen-top img{
 
- 				display: block;
 
- 				width: 100%;
 
- 			}
 
- 			.jifen-middle{position: absolute;top: 50%;left: 40px;right: 40px;height: 24px;margin-top: -12px;color: #74c7dd;}
 
- 			.jifen-middle .mui-table-cell{vertical-align: middle;}
 
- 			.jifen-middle strong{font-size: 26px;}
 
- 			.jifen-middle .mui-btn{border-radius: 25px;border: 0;padding: 3px 10px 3px 10px;color: #fff;font-size: 12px;background: #74c7dd;}
 
- 			.jifen-middle .mui-btn:active{background: #74c7dd !important;}
 
- 			.jifen-title{color: #243052;font-size: 17px;font-weight: bold;margin-bottom: 15px;}
 
- 			.jifen-box{padding:28px 16px;border-bottom: 10px solid #f2f2f2;}
 
- 			.btn-go-shop{border-radius: 25px;padding:3px 16px 3px 16px;color: #243052;border: 1px solid rgba(36,48,82,.5);font-size: 12px;}
 
- 			.btn-go-shop:active{background: #fff !important;color: #243052 !important;border: 1px solid rgba(36,48,82,.5);}
 
- 			.date-yuan{width: 39px;border: 1px solid rgba(51,51,51,.1);border-radius: 40px;text-align: center;padding: 8px 0;font-size: 12px;color: #666;}
 
- 			.table-yuan{border-radius: 25px;border: 1px solid rgba(51,51,51,.1);padding: 7px 16px;font-size: 14px;}
 
- 			.jifen-list>li{margin: 15px 0;color: #333;}
 
- 			.jifen-list>li>.mui-table{
 
- 				margin: 10px 0;
 
- 			}
 
- 			.jifen-list i{color: #74c7dd;font-style: normal;}
 
- 			.jifen-list i.mui-h5{color: #333;}
 
- 			.mui-col-xs-10{vertical-align: middle;}
 
- 			.mui-pull-bottom-pocket{height: 0px;}
 
- 		</style>
 
- 		<script type="text/javascript" src="//res.wx.qq.com/open/js/jweixin-1.1.0.js"></script>
 
- 		<script>
 
- 			//屏蔽分享
 
- 			document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {
 
- 				WeixinJSBridge.call('hideOptionMenu');
 
- 			});
 
- 		</script>
 
- 	</head>
 
- 	<body style="background: #fff;">
 
- 		<div class="loading-bg">
 
- 			<div class="mui-loading">
 
- 				<div class="mui-spinner">
 
- 				</div>
 
- 				  加载中...
 
- 			</div>
 
- 		</div>
 
- 		<div class="mui-content">
 
- 			<div class="jifen-top">
 
- 				<img src="images/jifen-bg.jpg" />
 
- 				<div class="jifen-middle">
 
- 					<div class="mui-table">
 
- 					<div class="mui-table-cell">
 
- 						<strong class="user-integeal">0</strong> 积分
 
- 					</div>
 
- 					<div class="mui-table-cell mui-text-right">
 
- 						<button type="button" class="mui-btn go-integral-rule">积分规则</button>
 
- 					</div>
 
- 				</div>
 
- 				</div>
 
- 			</div>
 
- 			<div class="jifen-box">
 
- 			<div class="jifen-title">积分商城</div>
 
- 			<img width="62%" src="images/jifen-next.jpg" />
 
- 			</div>
 
- 			<div class="jifen-box">
 
- 			<div class="jifen-title">领积分</div>
 
- 			<div>
 
- 				<div class="mui-table">
 
- 		                <div class="mui-table-cell mui-col-xs-2" style="vertical-align: middle;">
 
- 		                    <i class="iconfont icon-w-huiyuanjifengouwuche" style="font-size: 36px;color: #57b5f9;margin-left: 5px;"></i>
 
- 		                </div>
 
- 		                <div class="mui-table-cell mui-col-xs-7" style="padding-left: 5px;vertical-align: middle;">
 
- 		                    <div>消费领积分</div>
 
- 		                    <p class="mui-h6 mui-ellipsis">消费10元,可获得1积分</p>
 
- 		                </div>
 
- 		                <div class="mui-table-cell mui-col-xs-3 mui-text-right" style="vertical-align: middle;">
 
- 		                    <button type="button" class="mui-btn btn-go-shop">去下单</button>
 
- 		                </div>
 
- 		            </div>
 
- 			</div>
 
- 			</div>
 
- 			<div class="jifen-box" style="border: 0;padding-bottom: 50px;">
 
- 			<div class="jifen-title">积分明细</div>
 
- 			<ul class="jifen-list">
 
- 			
 
- 				<li id="pullrefresh_yhq_list" >
 
- 					<div></div>
 
- 					
 
- 					<!-- <div class="mui-table">
 
- 						<div class="mui-table-cell mui-col-xs-2">
 
- 							<div class="date-yuan">
 
- 								11.14
 
- 							</div>
 
- 						</div>
 
- 						<div class="mui-table-cell mui-col-xs-10">
 
- 							<div class="mui-table table-yuan">
 
- 								<div class="mui-table-cell">
 
- 									购买滤芯
 
- 								</div>
 
- 								<div class="mui-table-cell mui-text-right">
 
- 									<i>+2699</i>
 
- 								</div>
 
- 							</div>
 
- 						</div>
 
- 					</div>
 
- 					<div class="mui-table">
 
- 						<div class="mui-table-cell mui-col-xs-2">
 
- 							<div class="date-yuan">
 
- 								11.14
 
- 							</div>
 
- 						</div>
 
- 						<div class="mui-table-cell mui-col-xs-10">
 
- 							<div class="mui-table table-yuan">
 
- 								<div class="mui-table-cell">
 
- 									购买滤芯
 
- 								</div>
 
- 								<div class="mui-table-cell mui-text-right">
 
- 									<i>+2699</i>
 
- 								</div>
 
- 							</div>
 
- 						</div>
 
- 					</div> -->
 
- 				</li>
 
- 				
 
- 				<!-- <li>
 
- 					<div>2018年</div>
 
- 					<div class="mui-table">
 
- 						<div class="mui-table-cell mui-col-xs-2">
 
- 							<div class="date-yuan">
 
- 								11.14
 
- 							</div>
 
- 						</div>
 
- 						<div class="mui-table-cell mui-col-xs-10">
 
- 							<div class="mui-table table-yuan">
 
- 								<div class="mui-table-cell">
 
- 									购买滤芯
 
- 								</div>
 
- 								<div class="mui-table-cell mui-text-right">
 
- 									<i>+2699</i>
 
- 								</div>
 
- 							</div>
 
- 						</div>
 
- 					</div>
 
- 					
 
- 					<div class="mui-table">
 
- 						<div class="mui-table-cell mui-col-xs-2">
 
- 							<div class="date-yuan">
 
- 								11.14
 
- 							</div>
 
- 						</div>
 
- 						<div class="mui-table-cell mui-col-xs-10">
 
- 							<div class="mui-table table-yuan">
 
- 								<div class="mui-table-cell">
 
- 									购买滤芯
 
- 								</div>
 
- 								<div class="mui-table-cell mui-text-right">
 
- 									<i class="mui-h5">-2699</i>
 
- 								</div>
 
- 							</div>
 
- 						</div>
 
- 					</div>
 
- 				</li> -->
 
- 				
 
- 				
 
- 			</ul>
 
- 			</div>
 
- 		</div>
 
- 		<script type="text/javascript" src="js/mui.min.js"></script>
 
- 		<script type="text/javascript" src="js/jquery-2.1.1.min.js"></script>
 
- 		<script type="text/javascript" src="js/main.js"></script>
 
- 		<script type="text/javascript">
 
- 			window.addEventListener('pageshow', function(e) {
 
- 				// 通过persisted属性判断是否存在 BF Cache
 
- 				if(e.persisted) {
 
- 					location.reload();
 
- 				}
 
- 			});
 
- 			var pageNO = 0,
 
- 				pageSize = 10;
 
- 			
 
- 			mui.init({
 
- 				pullRefresh: {
 
- 					container: '#pullrefresh_yhq_list',
 
- 					down: {
 
- 						height: 0,
 
- 						//callback: pulldownRefresh
 
- 					},
 
- 					up: {
 
- 						contentdown: '',
 
- 						contentrefresh: '正在加载...',
 
- 						contentnomore: '',
 
- 						callback: pullupRefresh
 
- 					}
 
- 					// down: {
 
- 					// 	height: 75,
 
- 					// 	callback: false,
 
- 					// },
 
- 					// up: {
 
- 					// 	auto: false,
 
- 					// 	offset: 100, //距离底部高度(到达该高度即触发)
 
- 					// 	show: true,
 
- 					// 	contentdown: '',
 
- 					// 	contentrefresh: '正在加载...',
 
- 					// 	contentnomore: '',
 
- 					// 	callback: pullupRefresh
 
- 					// },
 
- 				}
 
- 			});
 
- 			
 
- 			
 
- 			/**
 
- 			 * 上拉加载具体业务实现
 
- 			 */
 
- 			function pullupRefresh() {
 
- 				++pageNO; //每次上拉页数+1
 
- 				$.ajax(base_path + '/integralLog/getIntegral?dates=' + new Date().getTime(), {
 
- 					data: {
 
- 						pageSize:pageSize,
 
- 						pageNO:pageNO
 
- 					},
 
- 					dataType: 'json',
 
- 					type: 'post',
 
- 					timeout: 15000,
 
- 					xhrFields: {
 
- 						withCredentials: true
 
- 					},
 
- 					crossDomain: true,
 
- 					success: function(dt) {
 
- 						console.log(dt);
 
- 						if(dt.isRedirect) {
 
- 							location.href = dt.redirectURL;
 
- 						}else{
 
- 							
 
- 							mui('#pullrefresh_yhq_list').pullRefresh().endPullupToRefresh(dt.data.list.length < pageSize); //endPullupToRefresh(ture)表示没有更多数据了,停止上拉加载
 
- 							var html='';
 
- 							for(var i=0;i<dt.data.list.length;i++){
 
- 								var item = dt.data.list[i];
 
- 								
 
- 								var newDate = new Date(item.inteLogCreateTime);
 
- 								var year = newDate.getFullYear();
 
- 								var month = newDate.getMonth() + 1;
 
- 								var date = newDate.getDate();
 
- 								html+='<div class="mui-table integral-li" year="'+ year +'">'
 
- 								html+='<div class="mui-table-cell mui-col-xs-2"><div class="date-yuan">'+ month +'.'+ date +'</div></div>'
 
- 								
 
- 								html+='<div class="mui-table-cell mui-col-xs-10">'
 
- 								html+='<div class="mui-table table-yuan">'
 
- 								html+='<div class="mui-table-cell">'+ item.inteConfName +'</div>'
 
- 								if(item.inteLogType == 1){
 
- 									html+='<div class="mui-table-cell mui-text-right"><i>+'+ item.inteLogChangeNum +'</i></div>'
 
- 								}else if(item.inteLogType == 2){
 
- 									html+='<div class="mui-table-cell mui-text-right"><i>-'+ item.inteLogChangeNum +'</i></div>'
 
- 								}
 
- 								html+='</div>'
 
- 								html+='</div>'
 
- 								html+='</div>'
 
- 							}
 
- 							$('#pullrefresh_yhq_list').append(html);
 
- 							setYear();
 
- 						}
 
- 					},
 
- 					error: function(xhr, type, errorThrown) {
 
- 						errorfn(xhr)
 
- 					}
 
- 				});
 
- 			}
 
- 			
 
- 			mui.ready(function() {
 
- 				document.querySelector('.loading-bg').style.display = 'none';
 
- 				mui('#pullrefresh_yhq_list').pullRefresh().pullupLoading(); //首次加载
 
- 				
 
- 				$.ajax(base_path + '/user/member?dates=' + new Date().getTime(), {
 
- 					dataType: 'json',
 
- 					type: 'post',
 
- 					timeout: 15000,
 
- 					xhrFields: {
 
- 						withCredentials: true
 
- 					},
 
- 					crossDomain: true,
 
- 					success: function(dt) {
 
- 						if(dt.isRedirect) {
 
- 							location.href = dt.redirectURL;
 
- 						} else {
 
- 							var data = dt.data;
 
- 							if(dt.status) {
 
- 								$(".user-integeal").html(data.userSurplusIntegral);
 
- 							}
 
- 						}
 
- 					},
 
- 					error: function(xhr, type, errorThrown) {
 
- 						console.log(xhr)
 
- 					}
 
- 				});
 
- 			});
 
- 			$(document).on('tap', '.go-integral-rule', function() {
 
- 				location.href='integral-rule.html';
 
- 			});
 
- 			$(document).on('tap', '.btn-go-shop', function() {
 
- 				location.href='chanpin_list.html';
 
- 			});
 
- 			
 
- 			function setYear(){
 
- 				var oldyear = '';
 
- 				$("#pullrefresh_yhq_list").find(".integral-li").each(function(){
 
- 					var year = $(this).attr('year')+'年';
 
- 					if(oldyear != year){
 
- 						oldyear = year;
 
- 						
 
- 						var $prevNode = $(this).prev() //返回上一个兄弟节点
 
- 						var yearVal = '';
 
- 						if($prevNode != null){
 
- 							yearVal = $prevNode.html();
 
- 						}
 
- 						if(yearVal != year){
 
- 							$(this).before("<div>"+ year +"</div>");
 
- 						}
 
- 					}
 
- 				})
 
- 			}
 
- 		</script>
 
- 	</body>
 
- </html>
 
 
  |