Authored by xuqi

order list page

@@ -19,7 +19,9 @@ var activeType = $navLi.filter('.active').data('type'); //当前active的项的i @@ -19,7 +19,9 @@ var activeType = $navLi.filter('.active').data('type'); //当前active的项的i
19 19
20 var orderPage = {}; 20 var orderPage = {};
21 21
22 -var loading = false; 22 +var inAjax = false;
  23 +
  24 +var loading = require('../plugin/loading');
23 25
24 var navHammer, orderHammer; 26 var navHammer, orderHammer;
25 27
@@ -30,10 +32,13 @@ function getOrders() { @@ -30,10 +32,13 @@ function getOrders() {
30 page: orderPage[activeType] ? (orderPage[activeType] + 1) : 1 32 page: orderPage[activeType] ? (orderPage[activeType] + 1) : 1
31 }; 33 };
32 34
33 - if (loading) { 35 + if (inAjax) {
34 return; 36 return;
35 } 37 }
36 38
  39 + inAjax = true;
  40 + loading.show();
  41 +
37 $.ajax({ 42 $.ajax({
38 type: 'GET', 43 type: 'GET',
39 url: '/home/getOrders', 44 url: '/home/getOrders',
@@ -55,6 +60,9 @@ function getOrders() { @@ -55,6 +60,9 @@ function getOrders() {
55 lazyLoad($curContainer.children('.order:gt(' + (num - 1) + ') .lazy')); 60 lazyLoad($curContainer.children('.order:gt(' + (num - 1) + ') .lazy'));
56 } 61 }
57 } 62 }
  63 +
  64 + inAjax = false;
  65 + loading.hide();
58 } 66 }
59 }); 67 });
60 } 68 }
@@ -73,6 +81,8 @@ lazyLoad(); @@ -73,6 +81,8 @@ lazyLoad();
73 $navLi.width(100 / liCount + '%'); 81 $navLi.width(100 / liCount + '%');
74 }()); 82 }());
75 83
  84 +loading.init();
  85 +
76 //导航切换 86 //导航切换
77 navHammer = new Hammer(document.getElementById('order-nav')); 87 navHammer = new Hammer(document.getElementById('order-nav'));
78 navHammer.on('tap', function(e) { 88 navHammer.on('tap', function(e) {
@@ -539,7 +539,25 @@ class HomeController extends AbstractAction @@ -539,7 +539,25 @@ class HomeController extends AbstractAction
539 // } else { 539 // } else {
540 // $order['walkwayUrl'] = 'http://www.baidu.com'; 540 // $order['walkwayUrl'] = 'http://www.baidu.com';
541 // } 541 // }
542 -$order['walkwayUrl'] = 'http://m.yohobuy.com'; 542 + $order['navs'] = array(
  543 + array(
  544 + 'name' => '全部',
  545 + 'active' => true,
  546 + 'typeId' => '1'
  547 + ),
  548 + array(
  549 + 'name' => '待付款',
  550 + 'typeId' => '2'
  551 + ),
  552 + array(
  553 + 'name' => '待发货',
  554 + 'typeId' => '3'
  555 + ),
  556 + array(
  557 + 'name' => '待收货',
  558 + 'typeId' => '4'
  559 + )
  560 + );
543 //渲染模板 561 //渲染模板
544 $this->_view->display('order', array( 562 $this->_view->display('order', array(
545 'order' => $order, 563 'order' => $order,