123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195 |
- <!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/main.css" />
- <style>
- .mui-content{background-color: #f1f1f1;}
- .my-yhq-list{background-color:#f1f1f1;padding:0 15px;}
- .my-yhq-list:before,.my-yhq-list:after{display: none;}
- .my-yhq-list .my-yhq-cell{margin: 15px 0;position: relative;}
- .my-yhq-list .my-yhq-cell:last-child{margin-bottom: 0;}
- .my-yhq-list .fixed-box{position: absolute;left: 0;top: 0;width: 100%;height: 100%;}
- .my-yhq-list .table{display: table;height: 100%;width: 100%;}
- .my-yhq-list .left-cell{display: table-cell;width: 69%;height: 100%;padding: 10px;}
- .my-yhq-list .right-cell{display: table-cell;width: 31%;height: 100%;text-align: center;vertical-align: middle;}
- .my-yhq-list .left-cell .tit{font-size: 20px;color: #f44f80;}
- .my-yhq-list .left-cell .time{color: #f44f80;font-size: 12px;}
- .my-yhq-list .left-cell .condition{position: absolute;left: 10px;bottom: 15px;font-size: 12px;color: #807f80;}
- .my-yhq-list .right-cell .money{color: #333;margin: 5px 0;}
- .my-yhq-list .right-cell .money>span{font-size: 35px;}
- .my-yhq-list .right-cell .my-btn{color: #fff;padding:8px 10px;font-size: 14px;border-radius: 5px;}
- .my-yhq-list .right-cell .my-btn:active{background-color: rgba(0,0,0,.5);}
- .grayscale{color: #807f80 !important;}
- .my-yhq-list .right-cell .my-btn.grayscale{opacity: 0;}
- .mui-table-view-chevron .mui-table-view-cell {padding-right: 15px;}
- .mui-segmented-control .mui-control-item.mui-active{background-color: transparent !important;border-bottom: 2px solid #fa4b4f !important;}
- .mui-segmented-control .mui-control-item{line-height: 1;height: 50px;vertical-align: bottom;border: 0;border-bottom: 2px solid transparent;color: #444;background-color: transparent !important;padding-bottom: 3px;}
- .tab-yhq-list{background: #fff;border: 0;position: fixed;left: 0;top: 0;width: 100%;z-index: 10;}
- .tab-yhq-list .mui-control-item{position: relative;}
- .mui-control-item.mui-active .mui-tab-label{color: #f44f80;}
- .tab-yhq-list .mui-control-item{color: #a1a1a1;}
- .mui-control-content{margin-top: 70px;}
- .tab-yhq-list .mui-control-item.mui-active {color: #f44f80 !important;border-bottom: 2px solid #f44f80;}
- .icon-all>span:first-child {background: url(images/all_icon.png) center bottom no-repeat;min-width: 28px;min-height: 25px;background-size: 100%;position: absolute;top: 2px;left:50%;-webkit-transform: translateX(-50%);transform: translateX(-50%);}
- .icon-all.mui-active>span:first-child {background: url(images/all1_icon.png) center bottom no-repeat;background-size: 100%;}
- .icon-noused>span:first-child {background: url(images/noused_icon.png) center bottom no-repeat;min-width: 25px;min-height: 25px;background-size: 100%;position: absolute;top: 2px;left:50%;-webkit-transform: translateX(-50%);transform: translateX(-50%);}
- .icon-noused.mui-active>span:first-child {background: url(images/noused1_icon.png) center bottom no-repeat;background-size: 100%;}
- .icon-used>span:first-child {background: url(images/used_icon.png) center bottom no-repeat;min-width: 25px;min-height: 25px;background-size: 100%;position: absolute;top: 2px;left:50%;-webkit-transform: translateX(-50%);transform: translateX(-50%);}
- .icon-used.mui-active>span:first-child {background: url(images/used1_icon.png) center bottom no-repeat;background-size: 100%;}
- .icon-overdue>span:first-child {background: url(images/overdue_icon.png) center bottom no-repeat;min-width: 25px;min-height: 25px;background-size: 100%;position: absolute;top: 2px;left:50%;-webkit-transform: translateX(-50%);transform: translateX(-50%);}
- .icon-overdue.mui-active>span:first-child {background: url(images/overdue1_icon.png) center bottom no-repeat;background-size: 100%;}
- .mui-popup.mui-popup-in{height: 360px;background: url(images/yhq_dlg_bg.png) center top /100% no-repeat;}
-
- .mui-popup-inner{background-color: transparent;margin-top: 80px;padding: 15px 15px 5px 15px;position: static;}
- .mui-popup-title{font-size: 16px;color: #939393;}
- .mui-popup-title+.mui-popup-text{margin-top: 15px;}
- .mui-popup-text strong{color: #fc5b8b;}
- .mui-popup-text span{color: #fc5b8b;font-size: 35px;}
- .mui-popup-button{background-color: transparent;}
- .mui-popup-button:after,.mui-popup-inner:after{display: none;}
- .mui-popup-button:first-child{border-radius: 25px;background: #f44f80;height: 38px;line-height: 40px;font-weight: 100;color: #fff;width: 50%;margin: 10px auto;}
- .mui-popup-button:first-child:active{background: #fc5b8b;}
- .mui-popup-button:last-child{border-radius: 25px;background: #dcdcdc;height: 38px;line-height: 40px;font-weight: 100;color: #fff;width: 50%;margin: 10px auto;}
- .mui-popup-button:last-child:active{background: #c9c9c9;}
- .mui-popup-buttons{display: block;}
- .x-close{position: absolute;right:32px;top: 0;width:20px;}
- .mui-popup.mui-popup-out{-webkit-transition-duration: 0ms;transition-duration: 0ms;}
- .mui-scroll-wrapper{top:0;bottom:50px;}
- </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>
- <div class="loading-bg">
- <div class="mui-loading">
- <div class="mui-spinner">
- </div>
- 加载中...
- </div>
- </div>
- <footer class="mui-bar mui-bar-tab" id="footer-bar-tab">
- <a class="mui-tab-item mui-active">
- <span class="iconfont icon-shouye"></span>
- <span class="mui-tab-label">首页</span>
- </a>
- <a class="mui-tab-item">
- <span class="iconfont icon-gouwuche"></span>
- <span class="mui-tab-label">购物车</span>
- </a>
- <a class="mui-tab-item">
- <span class="iconfont icon-dingdan"></span>
- <span class="mui-tab-label">订单</span>
- </a>
- <a class="mui-tab-item">
- <span class="iconfont icon-wode"></span>
- <span class="mui-tab-label">我的</span>
- </a>
- </footer>
- <div class="mui-content">
- <!--下拉刷新容器-->
- <div id="pullrefresh_yhq_list" class="mui-content mui-scroll-wrapper">
- <div class="mui-scroll">
- <!--数据列表-->
- <ul class="my-yhq-list">
-
- </ul>
- </div>
- </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>
- var tabindex = 1,pageNumber = 0,pagesize = 10;
- var tabindex=$('.tab-yhq-list .mui-active').prop('tabindex');
- var count = 0;
- /**
- * 上拉加载具体业务实现
- */
- function pullupRefresh() {
- ++pageNumber;
- $.ajax( base_path + '/wechat/coupon/couponItemList?dates=' + new Date().getTime(),{
- data :{
- pageNO : pageNumber
- },
- dataType:'json',
- type:'post',
- xhrFields: {
- withCredentials: true
- },
- crossDomain: true,
- timeout:15000,
- success:function(dt){
- if(dt.isRedirect) {
- location.href = dt.redirectURL;
- } else {
- var data = dt.data.itemList;
- mui('#pullrefresh_yhq_list').pullRefresh().endPullupToRefresh((++count > 2)); //参数为true代表没有更多数据了。
- var table = document.body.querySelector('.my-yhq-list');
-
- mui(data).each(function(index) {
- var li = document.createElement('li');
- var src = 'images/yhq-1.png';
- if(new Date(this.couponUseEndDate) >= new Date){
- li.className = 'my-yhq-cell';
- }else{
- li.className = 'my-yhq-cell active';
- src = 'images/yhq-2.png';
- }
- var couponReduceHtml = '';
- var couponReduceTypeHtml = '';
- if(this.couponType == 1){ //减免金额
- couponReduceHtml += this.couponReduce/100;
- couponReduceTypeHtml = '¥'
- }else if(this.couponType == 2){ //减免率
- couponReduceHtml += this.couponReduce/100 + "折" ;
- couponReduceTypeHtml = '';
- }
- li.innerHTML = '<img width="100%" src="'+ src + '" /><div class="fixed-box"><div class="table"><div class="left-cell"><span class="tit">'+ this.couponName +'</span><p class="time">有效期至'+ this.couponUseEndDate +'</p><span class="condition">无使用限制条件</span></div><div class="right-cell"><div class="money"><strong>'+ couponReduceTypeHtml +'</strong><span>'+ couponReduceHtml +'</span></div><span class="my-btn"></span></div></div></div';
- //li.innerHTML = '<img width="100%" src="images/yhq_overdue_bg.png" /><div class="fixed-box grayscale"><div class="table"><div class="left-cell"><span class="tit grayscale">优惠券</span><p class="time grayscale">有效期至2016年12月12日</p><span class="condition">无使用限制条件</span></div><div class="right-cell"><div class="money grayscale"><strong>¥</strong><span>50</span></div><span class="my-btn grayscale">立即领取</span></div></div></div>';
- table.appendChild(li);
- });
-
- mui('#pullrefresh_yhq_list').pullRefresh().endPullupToRefresh(false);
- }
- },
- error:function(xhr,type,errorThrown){
- //异常处理;
- console.log(xhr);
- }
- });
- }
- mui.ready(function() {
- mui.init({
- pullRefresh: {
- container: '#pullrefresh_yhq_list',
- down: {
- },
- up: {
- contentrefresh: '正在加载...',
- callback: pullupRefresh
- }
- }
- });
- mui('#pullrefresh_yhq_list').pullRefresh().pullupLoading();
- console.log("页面加载完毕")
- document.querySelector('.loading-bg').style.display = 'none';
- });
- </script>
- </body>
- </html>
|