coupon_bag1.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496
  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 icon-shouye"></div>
  239. <span class="mui-tab-label">首页</span>
  240. </a>
  241. <a class="mui-tab-item">
  242. <div class="iconfont icon-gouwuche"><span class="mui-badge">0</span></div>
  243. <span class="mui-tab-label">购物车</span>
  244. </a>
  245. <a class="mui-tab-item">
  246. <div class="iconfont icon-dingdan"></div>
  247. <span class="mui-tab-label">订单</span>
  248. </a>
  249. <a class="mui-tab-item mui-active">
  250. <div class="iconfont icon-wode"></div>
  251. <span class="mui-tab-label">我的</span>
  252. </a>
  253. </nav>
  254. <div class="mui-content">
  255. <div id="pullrefresh_yhq_list" class="mui-content mui-scroll-wrapper" style="background: #fff;">
  256. <div class="mui-scroll">
  257. <ul class="my-yhq-list">
  258. <!-- <li class="my-yhq-cell">
  259. <img width="100%" src="images/yhq_used_bg.png" />
  260. <div class="fixed-box">
  261. <div class="table go_web_link" url="#">
  262. <div class="left-cell">
  263. <span class="tit">滤芯兑换券</span>
  264. <p class="time">与其他产品下单时方可可用</p>
  265. <span class="condition">有效期至2019-11-24</span>
  266. </div>
  267. <div class="right-cell">
  268. <div class="money">
  269. <span>T1/T2</span>
  270. </div>
  271. </div>
  272. </div>
  273. </div>
  274. </li>
  275. <li class="my-yhq-cell">
  276. <img width="100%" src="images/yhq_noused_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">满500元可使用</p>
  282. <span class="condition">有效期至2019-11-24</span>
  283. </div>
  284. <div class="right-cell">
  285. <div class="money">
  286. <span>¥500</span>
  287. </div>
  288. </div>
  289. </div>
  290. </div>
  291. </li>
  292. <li class="my-yhq-cell">
  293. <img width="100%" src="images/yhq_used_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">仅部分产品可用<u class="see-details">查看详情</u></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. </ul>
  310. </div>
  311. </div>
  312. </div>
  313. <script type="text/javascript" src="js/mui.min.js"></script>
  314. <script type="text/javascript" src="js/jquery-2.1.1.min.js"></script>
  315. <script type="text/javascript" src="js/main.js"></script>
  316. <script>
  317. var tabindex = 0,
  318. pageNumber = 0,
  319. pagesize = 10;
  320. mui.init({
  321. pullRefresh: {
  322. container: '#pullrefresh_yhq_list',
  323. down: {
  324. //callback: pulldownRefresh
  325. },
  326. up: {
  327. contentrefresh: '正在加载...',
  328. contentnomore: '没有更多数据了!',
  329. callback: pullupRefresh
  330. }
  331. }
  332. });
  333. /**
  334. * 上拉加载具体业务实现
  335. */
  336. function pullupRefresh() {
  337. ++pageNumber;
  338. var btnArray = ['否', '是'];
  339. var src = '';
  340. if(tabindex == 1) {
  341. src = base_path + '/coupon/couponItemList?useStatus=1';
  342. } else {
  343. src = base_path + '/coupon/couponItemList?useStatus=2';
  344. }
  345. $.ajax(src, {
  346. data: {},
  347. dataType: 'json',
  348. type: 'post',
  349. timeout: 15000,
  350. xhrFields: {
  351. withCredentials: true
  352. },
  353. crossDomain: true,
  354. success: function(dt) {
  355. if(dt.isRedirect) {
  356. location.href = dt.redirectURL;
  357. } else {
  358. if(dt.status) {
  359. var table = document.body.querySelector('.my-yhq-list');
  360. if(pageNumber == 1 && tabindex == 2){
  361. var li = document.createElement('li');
  362. li.className = 'my-yhq-cell';
  363. li.innerHTML = '<img width="100%" src="images/yhq_used_bg.png" />'+
  364. '<div class="fixed-box">'+
  365. ' <div class="table go_web_link" url="#">'+
  366. ' <div class="left-cell">'+
  367. ' <span class="tit">滤芯套装优惠</span>'+
  368. ' <p class="time">会员购买滤芯套装优惠100元</p>'+
  369. ' <span class="condition"></span>'+
  370. ' </div>'+
  371. ' <div class="right-cell">'+
  372. ' <div class="money">'+
  373. ' <span></span>'+
  374. ' </div>'+
  375. ' </div>'+
  376. '</div>';
  377. table.appendChild(li);
  378. }
  379. mui(dt.data.itemList).each(function(index) {
  380. var li = document.createElement('li');
  381. var re_moeny = '';
  382. if(this.couponType == 1){
  383. re_moeny = accDiv(this.couponReduce, 100)+'元'
  384. }else if(this.couponType == 2){
  385. re_moeny = "-" + (100 - this.couponReduce) + "%"
  386. }else if(this.couponType == 3){
  387. re_moeny = "T1/T2"
  388. }
  389. li.className = 'my-yhq-cell';
  390. li.innerHTML = '<img width="100%" src="images/yhq_used_bg.png" />'+
  391. '<div class="fixed-box">'+
  392. ' <div class="table go_web_link" url="#">'+
  393. ' <div class="left-cell">'+
  394. ' <span class="tit">'+ this.couponName +'</span>'+
  395. ' <p class="time">'+ cufte(this.couponItemRemark) +'</p>'+
  396. ' <span class="condition">有效期至'+ this.couponUseEndDate +'</span>'+
  397. ' </div>'+
  398. ' <div class="right-cell">'+
  399. ' <div class="money">'+
  400. ' <span>'+ re_moeny +'</span>'+
  401. ' </div>'+
  402. ' </div>'+
  403. '</div>';
  404. table.appendChild(li);
  405. })
  406. if(pageNumber == 1 && tabindex == 1 && dt.data.itemList.length == 0 ){
  407. mui('#pullrefresh_yhq_list').pullRefresh().disablePullupToRefresh();
  408. var li = document.createElement('li');
  409. li.className = 'my-yhq-cell';
  410. li.innerHTML = '<img style="width:100px;display:block;margin:60px auto 20px auto;" src="images/null-3.png" /><h6 class="mui-text-center">暂无任何优惠券哟!</h6>';
  411. table.appendChild(li);
  412. }
  413. mui('#pullrefresh_yhq_list').pullRefresh().disablePullupToRefresh();
  414. } else {
  415. mui.confirm(dt.message + '是否重新加载页面?', '提示', btnArray, function(e) {
  416. if(e.index == 1) {}
  417. })
  418. }
  419. }
  420. },
  421. error: function(xhr, type, errorThrown) {
  422. console.log(xhr)
  423. }
  424. })
  425. }
  426. mui.ready(function() {
  427. tabindex = getParam("type");
  428. if(tabindex == 2){
  429. document.title = '会员专享';
  430. }
  431. mui('#pullrefresh_yhq_list').pullRefresh().pullupLoading();
  432. console.log("页面加载完毕")
  433. document.querySelector('.loading-bg').style.display = 'none';
  434. });
  435. $(document).on('tap', '.coupon-href', function() {
  436. location.href = 'coupon_dec.html';
  437. });
  438. $(document).on('tap', '.go_web_link', function() {
  439. location.href = $(this).attr("url");
  440. });
  441. </script>
  442. </body>
  443. </html>