coupon_bag1.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>我的券包</title>
  6. <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
  7. <meta name="apple-mobile-web-app-capable" content="yes">
  8. <meta name="apple-mobile-web-app-status-bar-style" content="black">
  9. <link rel="stylesheet" type="text/css" href="css/mui.min.css?v=2018111001" />
  10. <link rel="stylesheet" type="text/css" href="css/iconfont.css?v=2018111001" />
  11. <link rel="stylesheet" type="text/css" href="css/style.css?v=2018111001" />
  12. <style>
  13. .my-yhq-list {
  14. background-color: transparent;
  15. padding: 0 15px;
  16. }
  17. .my-yhq-list:before,
  18. .my-yhq-list:after {
  19. display: none;
  20. }
  21. .my-yhq-list .my-yhq-cell {
  22. margin: 13px 0;
  23. position: relative;
  24. }
  25. .my-yhq-list .my-yhq-cell:last-child {
  26. margin-bottom: 0;
  27. }
  28. .my-yhq-list .fixed-box {
  29. position: absolute;
  30. left: 0;
  31. top: 0;
  32. width: 100%;
  33. height: 100%;
  34. }
  35. .my-yhq-list .table {
  36. display: table;
  37. height: 100%;
  38. width: 100%;
  39. }
  40. .my-yhq-list .left-cell {
  41. display: table-cell;
  42. width: 69%;
  43. height: 100%;
  44. padding: 15px 10px;
  45. }
  46. .my-yhq-list .right-cell {
  47. display: table-cell;
  48. width: 28%;
  49. height: 100%;
  50. text-align: right;
  51. padding-right: 14px;
  52. vertical-align: middle;
  53. }
  54. .my-yhq-list .left-cell .tit {
  55. font-size: 15px;
  56. }
  57. .my-yhq-list .left-cell .time {
  58. font-size: 12px;
  59. margin-bottom: 0;
  60. margin-top: 10px;
  61. color: #999;
  62. }
  63. .my-yhq-list .left-cell .condition {
  64. position: absolute;
  65. left: 10px;
  66. bottom: 15px;
  67. font-size: 12px;
  68. color: #999;
  69. }
  70. .my-yhq-list .right-cell .money {
  71. color: #fff;
  72. margin: 5px 0;
  73. }
  74. .my-yhq-list .right-cell .money>span {
  75. font-size: 20px;
  76. color: #63ccde;
  77. }
  78. .my-yhq-list .right-cell .my-btn {
  79. color: #fff;
  80. padding: 8px 10px;
  81. font-size: 14px;
  82. border-radius: 5px;
  83. }
  84. .my-yhq-list .right-cell .my-btn:active {
  85. background-color: rgba(0, 0, 0, .5);
  86. }
  87. .grayscale {
  88. color: #807f80 !important;
  89. }
  90. .my-yhq-list .right-cell .my-btn.grayscale {
  91. opacity: 0;
  92. }
  93. .mui-table-view-chevron .mui-table-view-cell {
  94. padding-right: 15px;
  95. }
  96. .mui-segmented-control .mui-control-item {
  97. line-height: 1;
  98. height: 50px;
  99. vertical-align: bottom;
  100. border: 0;
  101. border-bottom: 0;
  102. color: #444;
  103. background-color: transparent !important;
  104. padding-bottom: 3px;
  105. }
  106. .mui-segmented-control .mui-control-item.mui-active {
  107. background-color: transparent !important;
  108. border-bottom: 0;
  109. }
  110. .mui-segmented-control .mui-control-item.mui-active:after {
  111. content: '';
  112. width: 70px;
  113. height: 2px;
  114. background: #63CCDE;
  115. position: absolute;
  116. left: 50%;
  117. bottom: 0;
  118. margin-left: -35px;
  119. }
  120. .tab-yhq-list .mui-control-item.mui-active {
  121. color: #1cc9f4 !important;
  122. border-bottom: 0;
  123. }
  124. .tab-yhq-list {
  125. background: #fff;
  126. border: 0;
  127. border-bottom: 1px solid rgba(0, 0, 0, .1);
  128. position: fixed;
  129. left: 0;
  130. top: 0;
  131. width: 100%;
  132. z-index: 10;
  133. }
  134. .tab-yhq-list .mui-control-item {
  135. position: relative;
  136. }
  137. .mui-control-item.mui-active .mui-tab-label {
  138. color: #1cc9f4;
  139. }
  140. .tab-yhq-list .mui-control-item {
  141. color: #a1a1a1;
  142. }
  143. .mui-control-content {
  144. margin-top: 70px;
  145. }
  146. .icon-all>span:first-child {
  147. min-width: 28px;
  148. min-height: 25px;
  149. background-size: 100%;
  150. position: absolute;
  151. top: 16px;
  152. left: 50%;
  153. -webkit-transform: translateX(-50%);
  154. transform: translateX(-50%);
  155. }
  156. .icon-all.mui-active>span:first-child {}
  157. .icon-noused>span:first-child {
  158. min-width: 25px;
  159. min-height: 25px;
  160. background-size: 100%;
  161. position: absolute;
  162. top: 16px;
  163. left: 50%;
  164. -webkit-transform: translateX(-50%);
  165. transform: translateX(-50%);
  166. }
  167. .icon-noused.mui-active>span:first-child {}
  168. .icon-used>span:first-child {
  169. min-width: 25px;
  170. min-height: 25px;
  171. background-size: 100%;
  172. position: absolute;
  173. top: 16px;
  174. left: 50%;
  175. -webkit-transform: translateX(-50%);
  176. transform: translateX(-50%);
  177. }
  178. .icon-used.mui-active>span:first-child {}
  179. .icon-overdue>span:first-child {
  180. min-width: 25px;
  181. min-height: 25px;
  182. background-size: 100%;
  183. position: absolute;
  184. top: 16px;
  185. left: 50%;
  186. -webkit-transform: translateX(-50%);
  187. transform: translateX(-50%);
  188. }
  189. .icon-overdue.mui-active>span:first-child {}
  190. .mui-scroll-wrapper {
  191. padding-top: 10px;
  192. bottom: 100px;
  193. }
  194. .middle-center {
  195. display: table-cell;
  196. text-align: center;
  197. vertical-align: middle;
  198. color: #fff;
  199. }
  200. .right-bottom {
  201. position: absolute;
  202. right: 15px;
  203. bottom: 15px;
  204. color: #fff;
  205. }
  206. .coupon-href {
  207. text-align: center;
  208. width: 120px;
  209. margin: 0 auto;
  210. position: fixed;
  211. bottom: 80px;
  212. left: 50%;
  213. margin-left: -60px;
  214. text-decoration: underline;
  215. font-size: 12px;
  216. color: #666;
  217. }
  218. .see-details {
  219. color: #63ccde;
  220. margin-left: 20px;
  221. }
  222. </style>
  223. <script type="text/javascript">
  224. // 屏蔽分享
  225. window.hiddenAllWechatMenu = true;
  226. </script>
  227. </head>
  228. <body style="background: #fff;">
  229. <div class="loading-bg">
  230. <div class="mui-loading">
  231. <div class="mui-spinner">
  232. </div>
  233. &nbsp;&nbsp;加载中...
  234. </div>
  235. </div>
  236. <nav class="mui-bar mui-bar-tab" id="footer-bar">
  237. <a class="mui-tab-item ">
  238. <div class="iconfont">
  239. <svg class="icon" aria-hidden="true">
  240. <use xlink:href="#icon-kang-hui"></use>
  241. </svg>
  242. </div>
  243. <span class="mui-tab-label">首页</span>
  244. </a>
  245. <a class="mui-tab-item go_gwc">
  246. <div class="iconfont icon-gouwuche-num">
  247. <svg class="icon" aria-hidden="true">
  248. <use xlink:href="#icon-ji-hui"></use>
  249. </svg>
  250. <span class="mui-badge">0</span>
  251. </div>
  252. <span class="mui-tab-label">购物车</span>
  253. </a>
  254. <a class="mui-tab-item ">
  255. <div class="iconfont">
  256. <svg class="icon" aria-hidden="true">
  257. <use xlink:href="#icon-yi-hui"></use>
  258. </svg>
  259. </div>
  260. <span class="mui-tab-label">订单</span>
  261. </a>
  262. <a class="mui-tab-item mui-active-select">
  263. <div class="iconfont">
  264. <svg class="icon" aria-hidden="true">
  265. <use xlink:href="#icon-W-qing"></use>
  266. </svg>
  267. </div>
  268. <span class="mui-tab-label">我的</span>
  269. </a>
  270. </nav>
  271. <div class="mui-content">
  272. <div id="pullrefresh_yhq_list" class="mui-content mui-scroll-wrapper" style="background: #fff;">
  273. <div class="mui-scroll">
  274. <ul class="my-yhq-list">
  275. <!-- <li class="my-yhq-cell">
  276. <img width="100%" src="images/yhq_used_bg.png" />
  277. <div class="fixed-box">
  278. <div class="table go_web_link" url="#">
  279. <div class="left-cell">
  280. <span class="tit">滤芯兑换券</span>
  281. <p class="time">与其他产品下单时方可可用</p>
  282. <span class="condition">有效期至2019-11-24</span>
  283. </div>
  284. <div class="right-cell">
  285. <div class="money">
  286. <span>T1/T2</span>
  287. </div>
  288. </div>
  289. </div>
  290. </div>
  291. </li>
  292. <li class="my-yhq-cell">
  293. <img width="100%" src="images/yhq_noused_bg.png" />
  294. <div class="fixed-box">
  295. <div class="table go_web_link" url="#">
  296. <div class="left-cell">
  297. <span class="tit">优惠券</span>
  298. <p class="time">满500元可使用</p>
  299. <span class="condition">有效期至2019-11-24</span>
  300. </div>
  301. <div class="right-cell">
  302. <div class="money">
  303. <span>¥500</span>
  304. </div>
  305. </div>
  306. </div>
  307. </div>
  308. </li>
  309. <li class="my-yhq-cell">
  310. <img width="100%" src="images/yhq_used_bg.png" />
  311. <div class="fixed-box">
  312. <div class="table go_web_link" url="#">
  313. <div class="left-cell">
  314. <span class="tit">用户关注券</span>
  315. <p class="time">仅部分产品可用<u class="see-details">查看详情</u></p>
  316. <span class="condition">有效期至2019-11-24</span>
  317. </div>
  318. <div class="right-cell">
  319. <div class="money">
  320. <span>¥500</span>
  321. </div>
  322. </div>
  323. </div>
  324. </div>
  325. </li> -->
  326. </ul>
  327. </div>
  328. </div>
  329. </div>
  330. <script type="text/javascript" src="js/mui.min.js"></script>
  331. <script type="text/javascript" src="js/jquery-2.1.1.min.js"></script>
  332. <script type="text/javascript" src="js/main.js"></script>
  333. <script src="js/iconfont.js"></script>
  334. <script>
  335. var tabindex = 0,
  336. pageNumber = 0,
  337. pagesize = 10;
  338. mui.init({
  339. pullRefresh: {
  340. container: '#pullrefresh_yhq_list',
  341. down: {
  342. //callback: pulldownRefresh
  343. },
  344. up: {
  345. contentrefresh: '正在加载...',
  346. contentnomore: '没有更多数据了!',
  347. callback: pullupRefresh
  348. }
  349. }
  350. });
  351. /**
  352. * 上拉加载具体业务实现
  353. */
  354. function pullupRefresh() {
  355. ++pageNumber;
  356. var btnArray = ['否', '是'];
  357. var src = '';
  358. if(tabindex == 1) {
  359. src = base_path + '/coupon/couponItemList?useStatus=1';
  360. } else {
  361. src = base_path + '/coupon/couponItemList?useStatus=2';
  362. }
  363. $.ajax(src, {
  364. data: {},
  365. dataType: 'json',
  366. type: 'post',
  367. timeout: 15000,
  368. xhrFields: {
  369. withCredentials: true
  370. },
  371. crossDomain: true,
  372. success: function(dt) {
  373. if(dt.isRedirect) {
  374. location.href = dt.redirectURL;
  375. } else {
  376. if(dt.status) {
  377. var table = document.body.querySelector('.my-yhq-list');
  378. if(pageNumber == 1 && tabindex == 2){
  379. var li = document.createElement('li');
  380. li.className = 'my-yhq-cell';
  381. li.innerHTML = '<img width="100%" src="images/yhq_used_bg.png" />'+
  382. '<div class="fixed-box">'+
  383. ' <div class="table go_web_link" url="#">'+
  384. ' <div class="left-cell">'+
  385. ' <span class="tit">滤芯套装优惠</span>'+
  386. ' <p class="time">会员购买滤芯套装优惠100元</p>'+
  387. ' <span class="condition"></span>'+
  388. ' </div>'+
  389. ' <div class="right-cell">'+
  390. ' <div class="money">'+
  391. ' <span></span>'+
  392. ' </div>'+
  393. ' </div>'+
  394. '</div>';
  395. table.appendChild(li);
  396. }
  397. mui(dt.data.itemList).each(function(index) {
  398. var li = document.createElement('li');
  399. var re_moeny = '';
  400. if(this.couponType == 1){
  401. re_moeny = accDiv(this.couponReduce, 100)+'元'
  402. }else if(this.couponType == 2){
  403. re_moeny = "-" + (100 - this.couponReduce) + "%"
  404. }else if(this.couponType == 3){
  405. re_moeny = "T1/T2"
  406. }
  407. li.className = 'my-yhq-cell';
  408. li.innerHTML = '<img width="100%" src="images/yhq_used_bg.png" />'+
  409. '<div class="fixed-box">'+
  410. ' <div class="table go_web_link" url="#">'+
  411. ' <div class="left-cell">'+
  412. ' <span class="tit">'+ this.couponName +'</span>'+
  413. ' <p class="time">'+ cufte(this.couponItemRemark) +'</p>'+
  414. ' <span class="condition">有效期至'+ this.couponUseEndDate +'</span>'+
  415. ' </div>'+
  416. ' <div class="right-cell">'+
  417. ' <div class="money">'+
  418. ' <span>'+ re_moeny +'</span>'+
  419. ' </div>'+
  420. ' </div>'+
  421. '</div>';
  422. table.appendChild(li);
  423. })
  424. if(pageNumber == 1 && tabindex == 1 && dt.data.itemList.length == 0 ){
  425. mui('#pullrefresh_yhq_list').pullRefresh().disablePullupToRefresh();
  426. var li = document.createElement('li');
  427. li.className = 'my-yhq-cell';
  428. li.innerHTML = '<img style="width:100px;display:block;margin:60px auto 20px auto;" src="images/null-3.png" /><h6 class="mui-text-center">暂无任何优惠券哟!</h6>';
  429. table.appendChild(li);
  430. }
  431. mui('#pullrefresh_yhq_list').pullRefresh().disablePullupToRefresh();
  432. } else {
  433. mui.confirm(dt.message + '是否重新加载页面?', '提示', btnArray, function(e) {
  434. if(e.index == 1) {}
  435. })
  436. }
  437. }
  438. },
  439. error: function(xhr, type, errorThrown) {
  440. console.log(xhr)
  441. }
  442. })
  443. }
  444. mui.ready(function() {
  445. tabindex = getParam("type");
  446. if(tabindex == 2){
  447. document.title = '会员专享';
  448. }
  449. mui('#pullrefresh_yhq_list').pullRefresh().pullupLoading();
  450. console.log("页面加载完毕")
  451. document.querySelector('.loading-bg').style.display = 'none';
  452. });
  453. $(document).on('tap', '.coupon-href', function() {
  454. location.href = 'coupon_dec.html';
  455. });
  456. $(document).on('tap', '.go_web_link', function() {
  457. location.href = $(this).attr("url");
  458. });
  459. </script>
  460. </body>
  461. </html>