Authored by xuqi

order list

... ... @@ -947,18 +947,20 @@
order: {
orders: [
...
]
],
//没有订单的情况不传orders
walkWayUrl: '' //随便逛逛url
}
}
//订单
{
detailUrl: '',
orderNum: '',
orderStatus: '',
goods: [
{
id: '',
thumb: '',
gift: true, //是否赠品
advanceBuy: true, //是否加价购
... ...
... ... @@ -13,7 +13,7 @@ var $navLi = $('#order-nav > li'),
var $curContainer = $orderContainer.children('.orders').first();//保存当前显示的order-container
var navHammer;
var navHammer, orderHammer;
lazyLoad();
... ... @@ -34,3 +34,19 @@ navHammer.on('tap', function(e) {
$curContainer.addClass('hide');
$curContainer = $orderContainer.children(':eq(' + index + ')').removeClass('hide');
});
orderHammer = new Hammer(document.getElementById('order-container'));
orderHammer.on('tap', function(e) {
var $cur = $(e.target),
$order,
url;
if ($cur.closest('.locHref').length > 0) {
return;
}
$order = $cur.closest('.order');
url = $order.data('href');
location.href = url;
});
\ No newline at end of file
... ...
... ... @@ -2,11 +2,16 @@
background: #f0f0f0;
.order {
display: block;
background: #fff;
margin: 30rem / $pxConvertRem 0;
border-top: 1px solid #e0e0e0;
border-bottom: 1px solid #e0e0e0;
&:last-child {
margin-bottom: 0;
}
.header, .footer {
height: 90rem / $pxConvertRem;
line-height: 90rem / $pxConvertRem;
... ... @@ -37,7 +42,7 @@
border-top: 1px solid #e0e0e0;
text-align: right;
> .btn {
.btn {
display: inline-block;
box-sizing: border-box;
height: 60rem / $pxConvertRem;
... ... @@ -46,6 +51,7 @@
font-size: 24rem / $pxConvertRem;
text-align: center;
border: 1px solid #000;
@include border-radius(5px);
}
.pay {
... ... @@ -56,6 +62,22 @@
}
}
}
.no-order {
text-align: center;
color: #f0f0f0;
.iconfont {
font-size: 50px;
}
.walk-way {
display: block;
color: #fff;
background: #fff;
@include border-radius(5px);
}
}
}
.order-nav {
... ...
... ... @@ -18,9 +18,7 @@
<div id="order-container" class="order-container">
<div class="all orders">
{{#each orders}}
{{> me/order/order}}
{{/each}}
{{> me/order/orders}}
</div>
<div class="unpaid orders hide"></div>
<div class="unshipped orders hide"></div>
... ...
<div class="order" data-id="{{orderNum}}">
<div class="order" data-id="{{orderNum}}" data-href="{{detailUrl}}">
<header class="header">
订单编号:{{orderNum}}
<span class="order-status">{{orderStatus}}</span>
... ... @@ -15,24 +15,24 @@
{{!-- 对应订单状态的操作逻辑 --}}
{{!-- 完成和取消订单显示删除按钮 --}}
<div class="order-opt">
{{#unless unpaid}}
{{#unless unreceived}}
<div class="order-opt">
<span class="btn del">删除订单</span>
</div>
{{/unless}}
{{/unless}}
{{#if unpaid}}
<div class="order-opt">
<span class="btn cancel">取消订单</span>
<a class="locHref" href="{{payUrl}}">
<span class="btn pay">立即付款</span>
</div>
</a>
{{/if}}
{{#if unreceived}}
<div class="order-opt">
<a class="check-logistics" href="{{logisticsUrl}}">查看物流</a>
</div>
<a class="locHref" href="{{logisticsUrl}}">
<span class="btn check-logistics">查看物流</span>
</a>
{{/if}}
</div>
</div>
\ No newline at end of file
... ...
{{#if walkwayUrl}}
<div class="no-order">
<span class="iconfont">&#xe632;</span>
<span>你还没有订单</span>
<a class="walk-way" href="{{walkwayUrl}}">随便逛逛</a>
</div>
{{^}}
{{#each orders}}
{{> me/order/order}}
{{/each}}
{{/if}}
\ No newline at end of file
... ...
... ... @@ -420,10 +420,10 @@ class HomeController extends AbstractAction
} else {
$order['walkwayUrl'] = 'http://www.baidu.com';
}
//渲染模板
$this->_view->display('order', array(
'order' => $order
'order' => $order,
'orderPage' => true
));
}
... ...