123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493 |
- <!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?v=2018111001" />
- <link rel="stylesheet" type="text/css" href="css/iconfont.css?v=2018111001" />
- <link rel="stylesheet" type="text/css" href="css/style.css?v=2018111001" />
- <style>
- .my-yhq-list {
- background-color: transparent;
- padding: 0 15px;
- }
-
- .my-yhq-list:before,
- .my-yhq-list:after {
- display: none;
- }
-
- .my-yhq-list .my-yhq-cell {
- margin: 13px 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;
- font-weight: bold;
- }
-
- .my-yhq-list .left-cell .time {
- 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: #fff;
- margin: 5px 0;
- }
-
- .my-yhq-list .right-cell .money>span {
- font-size: 25px;
- color: #63ccde;
- }
-
- .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 {
- line-height: 1;
- height: 50px;
- vertical-align: bottom;
- border: 0;
- border-bottom: 0;
- color: #444;
- background-color: transparent !important;
- padding-bottom: 3px;
- }
-
- .mui-segmented-control .mui-control-item.mui-active {
- background-color: transparent !important;
- border-bottom: 0;
- }
-
- .mui-segmented-control .mui-control-item.mui-active:after {
- content: '';
- width: 70px;
- height: 2px;
- background: #63CCDE;
- position: absolute;
- left: 50%;
- bottom: 0;
- margin-left: -35px;
- }
-
- .tab-yhq-list .mui-control-item.mui-active {
- color: #1cc9f4 !important;
- border-bottom: 0;
- }
-
- .tab-yhq-list {
- background: #fff;
- border: 0;
- border-bottom: 1px solid rgba(0, 0, 0, .1);
- 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: #1cc9f4;
- }
-
- .tab-yhq-list .mui-control-item {
- color: #a1a1a1;
- }
-
- .mui-control-content {
- margin-top: 70px;
- }
-
- .icon-all>span:first-child {
- min-width: 28px;
- min-height: 25px;
- background-size: 100%;
- position: absolute;
- top: 16px;
- left: 50%;
- -webkit-transform: translateX(-50%);
- transform: translateX(-50%);
- }
-
- .icon-all.mui-active>span:first-child {}
-
- .icon-noused>span:first-child {
- min-width: 25px;
- min-height: 25px;
- background-size: 100%;
- position: absolute;
- top: 16px;
- left: 50%;
- -webkit-transform: translateX(-50%);
- transform: translateX(-50%);
- }
-
- .icon-noused.mui-active>span:first-child {}
-
- .icon-used>span:first-child {
- min-width: 25px;
- min-height: 25px;
- background-size: 100%;
- position: absolute;
- top: 16px;
- left: 50%;
- -webkit-transform: translateX(-50%);
- transform: translateX(-50%);
- }
-
- .icon-used.mui-active>span:first-child {}
-
- .icon-overdue>span:first-child {
- min-width: 25px;
- min-height: 25px;
- background-size: 100%;
- position: absolute;
- top: 16px;
- left: 50%;
- -webkit-transform: translateX(-50%);
- transform: translateX(-50%);
- }
-
- .icon-overdue.mui-active>span:first-child {}
-
- .mui-scroll-wrapper {
- top: 50px;
- bottom: 100px;
- }
-
- .middle-center {
- display: table-cell;
- text-align: center;
- vertical-align: middle;
- color: #fff;
- }
-
- .right-bottom {
- position: absolute;
- right: 15px;
- bottom: 15px;
- color: #fff;
- }
-
- .coupon-href {
- text-align: center;
- width: 120px;
- margin: 0 auto;
- position: fixed;
- bottom: 80px;
- left: 50%;
- margin-left: -60px;
- text-decoration: underline;
- font-size: 12px;
- color: #666;
- }
- </style>
- <script type="text/javascript">
- // 屏蔽分享
- window.hiddenAllWechatMenu = true;
- </script>
- </head>
- <body style="background: #fff;">
- <div class="loading-bg">
- <div class="mui-loading">
- <div class="mui-spinner">
- </div>
- 加载中...
- </div>
- </div>
- <nav class="mui-bar mui-bar-tab" id="footer-bar">
- <a class="mui-tab-item">
- <div class="iconfont icon-shouye"></div>
- <span class="mui-tab-label">首页</span>
- </a>
- <a class="mui-tab-item">
- <div class="iconfont icon-gouwuche"><span class="mui-badge">0</span></div>
- <span class="mui-tab-label">购物车</span>
- </a>
- <a class="mui-tab-item">
- <div class="iconfont icon-dingdan"></div>
- <span class="mui-tab-label">订单</span>
- </a>
- <a class="mui-tab-item mui-active">
- <div class="iconfont icon-wode"></div>
- <span class="mui-tab-label">我的</span>
- </a>
- </nav>
- <div class="mui-content">
- <div class="mui-segmented-control tab-yhq-list">
- <a class="mui-control-item icon-all " tabindex="10" href="#item1mobile">
- <!--<span class="iconfont icon-youhuiquan"></span>-->
- <span class="mui-tab-label">优惠券</span>
- </a>
- <a class="mui-control-item icon-noused mui-active" tabindex="11" href="#item2mobile">
- <!--<span class="iconfont icon-tiququan"></span>-->
- <span class="mui-tab-label">兑换券</span>
- </a>
- </div>
- <!--下拉刷新容器-->
- <div id="pullrefresh_yhq_list" class="mui-content mui-scroll-wrapper" style="background: #fff;">
- <div class="mui-scroll">
- <!--数据列表-->
- <ul class="my-yhq-list">
- <li class="my-yhq-cell">
- <img width="100%" src="images/yhq_used_bg.png" />
- <div class="fixed-box">
- <div class="table go_web_link" url="#">
- <div class="left-cell">
- <span class="tit">优惠券</span>
- <p class="time">满2000元可使用</p>
- <span class="condition">有效期至2019-11-24</span>
- </div>
- <div class="right-cell">
- <div class="money">
- <span>¥100</span>
- </div>
- </div>
- </div>
- </div>
- </li>
- <li class="my-yhq-cell">
- <img width="100%" src="images/yhq_used_bg.png" />
- <div class="fixed-box">
- <div class="table go_web_link" url="#">
- <div class="left-cell">
- <span class="tit">用户关注券</span>
- <p class="time">仅部分产品可用<u class="see-details">查看详情</u></p>
- <span class="condition">有效期至2019-11-24</span>
- </div>
- <div class="right-cell">
- <div class="money">
- <span>¥500</span>
- </div>
- </div>
- </div>
- </div>
- </li>
- </ul>
- </div>
- </div>
- </div>
- <!--<div class="coupon-href">兑换券使用流程</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 = 10,
- pageNumber = 0,
- pagesize = 10;
- mui.init({
- pullRefresh: {
- container: '#pullrefresh_yhq_list',
- down: {
- //callback: pulldownRefresh
- },
- up: {
- contentrefresh: '正在加载...',
- contentnomore: '没有更多数据了!',
- callback: pullupRefresh
- }
- }
- });
- /**
- * 上拉加载具体业务实现
- */
- function pullupRefresh() {
- ++pageNumber;
- var btnArray = ['否', '是'];
- var src = '',
- coupon_name = '优惠券';
- if(tabindex == 10) {
- src = base_path + '/coupon/couponItemList?useStatus=10';
- } else {
- coupon_name = '兑换券<span class="mui-h6">(可换T1或t2滤芯一支)</span>';
- src = base_path + '/coupon/couponItemList?useStatus=11';
- }
- $.ajax(src, {
- data: {},
- dataType: 'json',
- type: 'post',
- timeout: 15000,
- xhrFields: {
- withCredentials: true
- },
- crossDomain: true,
- success: function(dt) {
- if(dt.isRedirect) {
- location.href = dt.redirectURL;
- } else {
- if(dt.status) {
- console.log(dt)
- var coupon_data = [];
- coupon_data = dt.data.itemList;
- mui('#pullrefresh_yhq_list').pullRefresh().endPullupToRefresh(coupon_data.length < pagesize);
- var table = document.body.querySelector('.my-yhq-list');
- mui(coupon_data).each(function(index) {
- var li = document.createElement('li');
- li.className = 'my-yhq-cell';
- var sa = '未使用',
- src = 'images/bg_quan_02.jpg';
- if(tabindex == 10) {
- var ptrice;
- if(this.couponType == 1) {
- ptrice = accDiv(this.couponReduce, 100) + '元'
- } else {
- ptrice = "-" + (100 - this.couponReduce) + "%"
- }
- if(this.couponUseStatus == 1 && this.couponItemRemark == "normal") {
- var url = 'chanpin_list.html';
- if(this.couponId == 10002) {
- url = '20190618.html';
- }
- li.innerHTML = '<img width="100%" src="images/yhq_used_bg.png" /><div class="fixed-box"><div class="table go_web_link" url="' + url + '"><div class="left-cell"><span class="tit">' + this.couponName + '</span><p class="time">有效期至' + this.couponUseEndDate + '</p><span class="condition">满' + accDiv(this.couponConsumeEnough, 100) + '元可使用</span></div><div class="right-cell"><div class="money"><span>' + ptrice + '</span></div></div></div></div'
- } else {
- 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">' + this.couponName + '</span><p class="time grayscale">有效期至' + this.couponUseEndDate + '</p><span class="condition">满' + accDiv(this.couponConsumeEnough, 100) + '元可使用</span></div><div class="right-cell"><div class="money grayscale"><span>' + ptrice + '</span></div><span class="my-btn grayscale">立即领取</span></div></div></div>'
- }
- } else if(tabindex == 11) {
- if(this.pledgeStatus == '2') {
- sa = '已使用'
- src = '//s.iamberry.com/watero/images/shop/bg_quan_01.jpg';
- }
- var tips = '';
- if(this.couponId == 10000) {
- tips = '与其他产品一起下单时方可使用';
- } else if(this.couponId == 10001) {
- tips = '仅限购买WaterO滤芯T1/T2一支抵扣使用';
- }
- if(this.couponUseStatus == 1 && this.couponItemRemark == "normal") {
- console.log(this.couponUseEndDate)
- li.innerHTML = '<img width="100%" src="images/yhq_used_bg.png" /><div class="fixed-box"><div class="table go_web_link" url="chanpin_list.html?proType=2"><div class="left-cell"><span class="tit">' + coupon_name + '</span><p class="time">有效期至' + this.couponUseEndDate + '</p><span class="condition">' + tips + '</span></div><div class="right-cell"><div class="money"><span>' + this.exchange.exchangeName + '</span></div></div></div></div'
- } else {
- 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">' + coupon_name + '</span><p class="time grayscale">有效期至' + this.couponUseEndDate + '</p><span class="condition">' + tips + '</span></div><div class="right-cell"><div class="money grayscale"><span>' + this.exchange.exchangeName + '</span></div><span class="my-btn grayscale">立即领取</span></div></div></div>'
- }
- console.log("1")
- }
- table.appendChild(li);
- mui('#pullrefresh_yhq_list').pullRefresh().disablePullupToRefresh();
- });
- if(coupon_data.length == 0) {
- mui('#pullrefresh_yhq_list').pullRefresh().disablePullupToRefresh();
- var li = document.createElement('li');
- li.className = 'my-yhq-cell';
- li.innerHTML = '<img style="width:100px;display:block;margin:60px auto 20px auto;" src="images/null-3.png" /><h6 class="mui-text-center">暂无任何优惠券哟!</h6>';
- table.appendChild(li);
- }
- } else {
- mui.confirm(dt.message + '是否重新加载页面?', '提示', btnArray, function(e) {
- if(e.index == 1) {}
- })
- }
- }
- },
- error: function(xhr, type, errorThrown) {
- console.log(xhr)
- }
- })
- }
- mui.ready(function() {
- tabindex = getParam("tabindex");
- $('.tab-yhq-list>a').removeClass("mui-active");
- $('.tab-yhq-list>a[tabindex=' + tabindex + ']').addClass("mui-active");
- mui('#pullrefresh_yhq_list').pullRefresh().pullupLoading();
- console.log("页面加载完毕")
- document.querySelector('.loading-bg').style.display = 'none';
- });
- mui.each(document.querySelectorAll('.tab-yhq-list .mui-control-item'), function(index, el) {
- el.addEventListener('tap', function() {
- pageNumber = 0;
- switch(index) {
- case 0:
- tabindex = 10;
- break;
- case 1:
- tabindex = 11;
- break;
- default:
- tabindex = 10;
- break;
- }
- $('.my-yhq-list').empty();
- mui('#pullrefresh_yhq_list').pullRefresh().refresh(true);
- mui('#pullrefresh_yhq_list').pullRefresh().pullupLoading();
- }, false);
- });
- $(document).on('tap', '.coupon-href', function() {
- location.href = 'coupon_dec.html';
- });
- $(document).on('tap', '.go_web_link', function() {
- location.href = $(this).attr("url");
- });
- </script>
- </body>
- </html>
|