Authored by xuqi

order list page

... ... @@ -19,7 +19,9 @@ var activeType = $navLi.filter('.active').data('type'); //当前active的项的i
var orderPage = {};
var loading = false;
var inAjax = false;
var loading = require('../plugin/loading');
var navHammer, orderHammer;
... ... @@ -30,10 +32,13 @@ function getOrders() {
page: orderPage[activeType] ? (orderPage[activeType] + 1) : 1
};
if (loading) {
if (inAjax) {
return;
}
inAjax = true;
loading.show();
$.ajax({
type: 'GET',
url: '/home/getOrders',
... ... @@ -55,6 +60,9 @@ function getOrders() {
lazyLoad($curContainer.children('.order:gt(' + (num - 1) + ') .lazy'));
}
}
inAjax = false;
loading.hide();
}
});
}
... ... @@ -73,6 +81,8 @@ lazyLoad();
$navLi.width(100 / liCount + '%');
}());
loading.init();
//导航切换
navHammer = new Hammer(document.getElementById('order-nav'));
navHammer.on('tap', function(e) {
... ...
... ... @@ -539,7 +539,25 @@ class HomeController extends AbstractAction
// } else {
// $order['walkwayUrl'] = 'http://www.baidu.com';
// }
$order['walkwayUrl'] = 'http://m.yohobuy.com';
$order['navs'] = array(
array(
'name' => '全部',
'active' => true,
'typeId' => '1'
),
array(
'name' => '待付款',
'typeId' => '2'
),
array(
'name' => '待发货',
'typeId' => '3'
),
array(
'name' => '待收货',
'typeId' => '4'
)
);
//渲染模板
$this->_view->display('order', array(
'order' => $order,
... ...