index.html 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373
  1. <extend name="Public:base" />
  2. <block name="content">
  3. <link rel="stylesheet" href="__PUBLIC__/css/orders-64a960fa.css?v=2" >
  4. <div class="wrapper" style="display: block;">
  5. <ul class="category-bar">
  6. <li class="J_cate-item <?php if($type == 0){ ?>s-selected<?php } ?>" onclick="location.href='{:U('Order/index', array('type' => 0))}'"><span><span>全部</span></span></li>
  7. <li class="J_cate-item <?php if($type == 3){ ?>s-selected<?php } ?>" onclick="location.href='{:U('Order/index', array('type' => 3))}'"><span><span>待付款</span></span></li>
  8. <li class="J_cate-item <?php if($type == 1){ ?>s-selected<?php } ?>" onclick="location.href='{:U('Order/index', array('type' => 1))}'"><span><span>待发货</span></span></li>
  9. <li class="J_cate-item <?php if($type == 4){ ?>s-selected<?php } ?>" onclick="location.href='{:U('Order/index', array('type' => 4))}'"><span><span>待收货</span></span></li>
  10. <li class="J_cate-item J_remain-comment <?php if($type == 6){ ?>s-selected<?php } ?>" onclick="location.href='{:U('Order/index', array('type' => 6))}'"><span><span>待评价</span></span></li>
  11. <li class="J_cate-item J_remain-comment <?php if($type == 12){ ?>s-selected<?php } ?>" onclick="location.href='{:U('Order/index', array('type' => 12))}'"><span><span>售后</span></span></li>
  12. </ul>
  13. <section class="list J_list">
  14. <ul class="J_list-content orders" id="tuan_list">
  15. <volist name="list" id="d">
  16. <li class="item">
  17. <div class="time">
  18. <span></span>
  19. </div>
  20. <div class="oneOrder">
  21. <div class="title">
  22. <span class="status"><span>{$d.status_name}</span></span>
  23. </div>
  24. <ul class="goods" onclick="location.href='{:U('Order/info', array('id' => $d['order_id']))}';">
  25. <?php foreach($d['goods_list'] as $goods){ ?>
  26. <li class="oneGood" >
  27. <div class="img-wrapper">
  28. <img class="icon" src="<?php echo $goods['goods_images']; ?>" />
  29. </div>
  30. <div class="title">
  31. <?php if($goods['is_pin'] ==1) { ?>
  32. <span class="pintuan">拼团</span>
  33. <?php } ?>
  34. <?php echo $goods['name']; ?>
  35. </div>
  36. <div class="sku">
  37. <?php echo $goods['option_str']; ?>
  38. </div>
  39. <div class="money">
  40. <span class="price"><strong>&yen; <?php echo round($goods['price'],2); ?></strong></span>
  41. <span class="num">x <?php echo $goods['quantity']; ?></span>
  42. </div>
  43. </li>
  44. <?php } ?>
  45. </ul>
  46. </div>
  47. <div class="total">
  48. <?php if($d['shipping_fare']>0){?>
  49. <div class="info">
  50. 运费:<?php echo $d['shipping_fare']; ?>
  51. </div>
  52. <?php } ?>
  53. <div class="info">
  54. 共{$d.quantity}件商品 总计:
  55. <strong>&yen;{$d.total}</strong>
  56. </div>
  57. <div class="btns">
  58. <!-- 待付款 -->
  59. <?php if($d['order_status_id'] == 3){ ?>
  60. <div class="btn " onclick="order_cancel(this)" data-o-id="{$d.order_id}" >
  61. <span> 取消订单</span>
  62. </div>
  63. <div class="btn highlight" onclick="location.href='{:U('Payment/order_pay', array('order_id' => $d['order_id']))}';">
  64. <span>去支付</span>
  65. </div>
  66. <?php } ?>
  67. <!-- 拼团中 -->
  68. <?php if($d['order_status_id'] == 2){ ?>
  69. <div class="btn " onclick="location.href='{:U('Group/info', array('group_order_id' => $d['hash_order_id']))}';">
  70. <span>邀请好友拼团</span>
  71. </div>
  72. <?php } ?>
  73. <!-- 待收货 -->
  74. <?php if( in_array($d['order_status_id'], array(4,12))){ ?>
  75. <div class="btn highlight" onclick="order_receive(this)" rel="确认收货" data-o-id="{$d.order_id}">
  76. <span>确认收货</span>
  77. </div>
  78. <div class="btn " onclick="location.href='{:U('Order/goods_express', array('id' => $d['order_id']))}';" rel="查看物流" data-o-id="{$d.order_id}">
  79. <span>查看物流 </span>
  80. </div>
  81. <a class="_order_btn_shipping" onclick="location.href='{:U('Order/goods_express', array('id' => $d['order_id']))}';"></a>
  82. <?php } ?>
  83. <!-- 待评价-->
  84. <?php if($d['order_status_id'] == 6){ ?>
  85. <div class="btn highlight" onclick="location.href='{:U('Order/comment', array('order_id' => $d['order_id']))}';">
  86. <span>立即评价</span>
  87. </div>
  88. <?php } ?>
  89. </div>
  90. </div>
  91. </li>
  92. </volist>
  93. </ul>
  94. </section>
  95. <?php if(empty($list)){ ?>
  96. <style>
  97. .recommend {
  98. border-top: .32rem solid #f4f4f4;
  99. background: #fff;
  100. }
  101. .recommend-hd {
  102. margin: 0 .4rem;
  103. font-size: .52rem;
  104. position: relative;
  105. line-height: 1.6rem;
  106. color: #666;
  107. }
  108. .recommend-hd span {
  109. position: absolute;
  110. top: 0;
  111. right: 0;
  112. font-size: .48rem;
  113. color: #999;
  114. }
  115. .recommend-bd {
  116. margin: auto .4rem;
  117. }
  118. .recommend .goods-item {
  119. display: block;
  120. float: left;
  121. width: 48%;
  122. margin-right: 2%;
  123. }
  124. .recommend .goods-item {
  125. margin-bottom: .2rem;
  126. }
  127. .recommend .goods-cover {
  128. background-color: #fcfcfc;
  129. position: relative;
  130. }
  131. .recommend .goods-props {
  132. margin-top: .2rem;
  133. overflow: hidden;
  134. height: 1.4rem;
  135. }
  136. .recommend .goods-props span {
  137. float: left;
  138. margin: 0 .2rem .2rem 0;
  139. padding: 0 .2rem;
  140. line-height: .7rem!important;
  141. font-size: .5rem;
  142. background: #f2f5f8;
  143. color: #9394a6;
  144. }
  145. .recommend .goods-price {
  146. margin-top: .3rem;
  147. color: #333;
  148. font-size: .48rem;
  149. }
  150. .cart .empty-cart {
  151. text-align: center;
  152. margin: 1.856rem 0 .85333333rem;
  153. }
  154. .cart .empty-cart .cart-img {
  155. display: inline-block;
  156. width: 4.43733333rem;
  157. height: 4.544rem;
  158. }
  159. .cart .empty-cart .cart-hint {
  160. padding: .512rem 0;
  161. color: #3d3d3d;
  162. font-size: .59733333rem;
  163. line-height: .85333333rem;
  164. }
  165. .cart .empty-cart .cart-btn {
  166. display: inline-block;
  167. border: 1px solid #f7afbc;
  168. border-radius: .17066667rem;
  169. padding: .46933333rem .68266667rem;
  170. background-color: #fff;
  171. color: #ff4965;
  172. font-size: .59733333rem;
  173. line-height: .59733333rem;
  174. }
  175. </style>
  176. <section class="grid-wrap cart" id="cart-info">
  177. <div class="empty-cart">
  178. <i class="cart-img"></i>
  179. <p class="cart-hint">订单空空如也,马上去挑选哦~</p>
  180. <a class="cart-btn J_go2login" href="{:U('Index/index')}">去挑选</a>
  181. </div></section>
  182. {~W('Product/related_usecenter_goods_list')}
  183. <?php } ?>
  184. </div>
  185. <div class="popup-mask" style="display: none;position: fixed; width: 100%;height: auto;top: 50%;z-index: 999999999; background: rgba(0, 0, 0, 0);">
  186. <div class="popup-main" style=" max-width: 50%; height: auto;margin: auto;background-color: rgba(0,0,0,.8);color: #f0f0f0;font-size: 16px;padding: 10px;text-align: center;border-radius: 5px;box-shadow: 0 0 24px -1px #383838; background: rgba(41, 49, 61, 0.701961);">
  187. <div class="popup-content"><div style="color:#fff;font-size:0.6rem;margin:0"></div>
  188. </div>
  189. </div>
  190. </div>
  191. <div class="center" id="center_pullup" style="display:none;">
  192. <span><img class="img_rotate" src="__PUBLIC__/images/pull_loading_8eba142.png"/>
  193. </span><span class="orders_text"></span>
  194. </div>
  195. <style>
  196. .category-bar{
  197. padding: 0 .8rem;
  198. overflow-x:auto;
  199. overflow-y: hidden;
  200. white-space: nowrap;
  201. }
  202. .category-bar li{
  203. float:none;
  204. width:auto;
  205. display: inline-block;
  206. margin-left: .8rem;
  207. }
  208. .wrapper{
  209. width:100%;
  210. overflow:hidden;
  211. }
  212. .center {
  213. width: 170px;
  214. margin: 0 auto;
  215. text-align: center;
  216. }
  217. .img_rotate {
  218. width: 30px;
  219. height: 30px;
  220. margin-top: 7px;
  221. margin-right: 5px;
  222. -webkit-animation: loading 1s linear 0s infinite;
  223. }
  224. @-webkit-keyframes loading {
  225. 0% {
  226. -webkit-transform: rotate(0);
  227. }
  228. 100% {
  229. -webkit-transform: rotate(360deg);
  230. }
  231. }
  232. .orders_text {
  233. line-height: 45px;
  234. font-weight: 700;
  235. font-size: 15px;
  236. }
  237. </style>
  238. </block>
  239. <block name="foot_script">
  240. <script>
  241. function show_mask(title)
  242. {
  243. $('.popup-content div').html(title);
  244. $('.popup-mask').fadeIn(1500,function(){
  245. $('.popup-mask').fadeOut(1500);
  246. })
  247. }
  248. //确认收货
  249. function order_receive(obj)
  250. {
  251. var order_id = $(obj).attr('data-o-id');
  252. $.ajax({
  253. url:"{:U('Order/receive_order')}",
  254. type:'post',
  255. data:{order_id:order_id},
  256. dataType:'json',
  257. success:function(result){
  258. if(result.code == 1){
  259. show_mask('收货成功');
  260. $(obj).hide();
  261. } else {
  262. show_mask(result.msg);
  263. }
  264. }
  265. })
  266. }
  267. //取消订单
  268. function order_cancel(obj)
  269. {
  270. var order_id = $(obj).attr('data-o-id');
  271. if(!confirm('确认取消订单吗?'))
  272. {
  273. return false;
  274. }
  275. $.ajax({
  276. url:"{:U('Order/cancel_order')}",
  277. type:'post',
  278. data:{order_id:order_id},
  279. dataType:'json',
  280. success:function(result){
  281. if(result.code == 1){
  282. show_mask('取消成功');
  283. $(obj).parent().parent().fadeOut();
  284. } else {
  285. show_mask(result.msg);
  286. }
  287. }
  288. })
  289. }
  290. var offset = 0;
  291. var _pa = 2;
  292. var is_can_next = 1;
  293. var cur_url = "{:U('Order/index',array('type' => $type))}";
  294. var req_step = 1;
  295. function loaddata()
  296. {
  297. var totalheight = parseFloat($(window).height()) + parseFloat($(window).scrollTop()); //浏览器的高度加上滚动条的高度
  298. if ($(document).height() <= totalheight+200) //当文档的高度小于或者等于总的高度的时候,开始动态加载数据
  299. {
  300. console.log(3);
  301. if(is_can_next == 1)//加载数据
  302. {
  303. is_can_next = 0;
  304. nextpage();
  305. }
  306. }
  307. }
  308. function nextpage()
  309. {
  310. $('#center_pullup').show();
  311. $.ajax(
  312. {
  313. url: cur_url,
  314. type:'post',
  315. data:{page:_pa},
  316. dataType: 'json',
  317. success: function(result){
  318. if(result.code == 1)
  319. {
  320. $('#tuan_list').append(result.html);
  321. $('#center_pullup').hide();
  322. _pa++;
  323. is_can_next = 1;
  324. } else if(result.code == 0) {
  325. $('#center_pullup').remove();
  326. }
  327. }
  328. }
  329. );
  330. }
  331. $(function(){
  332. $(window).scroll( function() {
  333. loaddata();
  334. });
  335. })
  336. </script>
  337. </block>