pro-list-channel.html 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
  6. <meta name="apple-mobile-web-app-capable" content="yes">
  7. <meta name="apple-mobile-web-app-status-bar-style" content="black">
  8. <title>产品列表</title>
  9. <link rel="stylesheet" type="text/css" href="css/mui.min.css" />
  10. <link rel="stylesheet" type="text/css" href="css/iconfont.css" />
  11. <link rel="stylesheet" type="text/css" href="css/main.css" />
  12. <style>
  13. .btn-buy-know{border: 1px solid #999;position: absolute;right: 0;bottom: 0;}
  14. .pro-title{padding:10px 0 6px 0;}
  15. .pro-desc{padding: 0 0 8px 0;}
  16. .pro-delete{color: #999;margin-left: 15px;}
  17. .my-view-no .mui-table-view-cell:after{display: none;}
  18. </style>
  19. <script type="text/javascript" src="//res.wx.qq.com/open/js/jweixin-1.1.0.js"></script>
  20. <script>
  21. //屏蔽分享
  22. document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {
  23. WeixinJSBridge.call('hideOptionMenu');
  24. });
  25. </script>
  26. </head>
  27. <body>
  28. <!--内容开始-->
  29. <div class="mui-content">
  30. <ul class="mui-table-view mui-table-view-striped my-view-no mui-table-view-condensed" id="con_product_list" style="margin-top: 5px;">
  31. <!--<li class="mui-table-view-cell">
  32. <div class="mui-table">
  33. <div class="mui-table-cell mui-col-xs-12">
  34. <img width="100%" src="images/pro-channel-1.jpg">
  35. </div>
  36. </div>
  37. <div class="mui-table">
  38. <div class="mui-table-cell mui-col-xs-12">
  39. <h4 class="pro-title">上朵都市轻奢款声波牙刷</h4>
  40. <p class="pro-desc">柔和清洁牙龈,温柔呵护牙齿</p>
  41. <span class="pro-price">¥349.00</span><s class="pro-delete">¥399.00</s>
  42. <button type="button" class="mui-btn btn-buy-know pro-datail" color="203" >立即购买</button>
  43. </div>
  44. </div>
  45. </li>
  46. <li class="mui-table-view-cell">
  47. <div class="mui-table">
  48. <div class="mui-table-cell mui-col-xs-12">
  49. <img width="100%" src="images/pro-channel-2.jpg">
  50. </div>
  51. </div>
  52. <div class="mui-table">
  53. <div class="mui-table-cell mui-col-xs-12">
  54. <h4 class="pro-title">上朵儿童款声波牙刷</h4>
  55. <p class="pro-desc">柔羽呵护刷毛,专为孩子定制</p>
  56. <span class="pro-price">¥249.00</span><s class="pro-delete">¥289.00</s>
  57. <button type="button" class="mui-btn btn-buy-know pro-datail" color="208">立即购买</button>
  58. </div>
  59. </div>
  60. </li>-->
  61. </ul>
  62. </div>
  63. <!--内容结束-->
  64. <!-- 加载ing begin-->
  65. <div class="loading covers">
  66. <div class="loading-bj"></div>
  67. <p>正在加载...</p>
  68. </div>
  69. <!-- 加载ing end -->
  70. <script src="js/mui.min.js"></script>
  71. <script src="js/jquery-2.1.1.min.js"></script>
  72. <script src="js/main.js"></script>
  73. <script>
  74. window.addEventListener('pageshow', function(e) {
  75. // 通过persisted属性判断是否存在 BF Cache
  76. if(e.persisted) {
  77. location.reload();
  78. }
  79. });
  80. var channelType = getParam("channelType"); //类型
  81. var channelId = getParam("channelId"); //渠道id
  82. //ready事件
  83. mui.ready(function() {
  84. $(".loading").hide().css("opacity", "0");//隐藏(正在加载...)
  85. $.ajax(base_path + '/wechat/channelAdmin/getProductList?dates=' + new Date().getTime(), {
  86. data: {
  87. "channelType": channelType,
  88. "channelId": channelId
  89. },
  90. dataType: 'json',
  91. xhrFields: {
  92. withCredentials: true
  93. },
  94. crossDomain: true,
  95. type: 'get',
  96. timeout: 15000,
  97. success: function(dt) {
  98. if(dt.isRedirect) {
  99. location.href = dt.redirectURL;
  100. } else {
  101. console.log(dt);
  102. var str = '';
  103. mui.each(dt.data, function(index) {
  104. str += '<li class="mui-table-view-cell">'
  105. + '<div class="mui-table">'
  106. + '<div class="mui-table-cell mui-col-xs-12">'
  107. + '<img width="100%" src="'+ this.productIntroduceImg +'">'
  108. + '</div></div>'
  109. + '<div class="mui-table">'
  110. + ' <div class="mui-table-cell mui-col-xs-12">'
  111. + '<h4 class="pro-title">'+ this.productName +'</h4>'
  112. + '<p class="pro-desc">'+ this.productColorDes +'</p>'
  113. + '<span class="pro-price">¥'+ accDiv(this.productDiscount,100) +'</span><s class="pro-delete">¥'+ accDiv(this.productPrice,100) +'</s>'
  114. + '<button type="button" class="mui-btn btn-buy-know pro-datail" color="'+ this.colorId +'" >立即购买</button>'
  115. + ' </div>'
  116. + ' </div>'
  117. + ' </li>'
  118. });
  119. $("#con_product_list").html(str);
  120. $(".loading").hide().css("opacity", "0"); //隐藏(正在加载...)
  121. }
  122. },
  123. error: function(xhr, type, errorThrown) {
  124. console.log(xhr);
  125. mui.alert("获取订单列表失败!网络错误");
  126. }
  127. });
  128. });
  129. //跳转产品详情
  130. $(document).on('tap', '.pro-datail', function() {
  131. var id = $(this).attr("color");
  132. location.href='pro-details.html?colorId='+id+'&channelType='+channelType+'&channelId='+channelId;
  133. });
  134. </script>
  135. </body>
  136. </html>