Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOBUYWAP
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
xuqi
9 years ago
Commit
193b585084073cd0ef6e72c0fc088f0e69ab3a43
1 parent
27b183c2
order list
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
74 additions
and
25 deletions
docs/data-structure.md
static/js/me/order.js
static/sass/me/_order.scss
template/m.yohobuy.com/actions/index/home/order.phtml
template/m.yohobuy.com/partials/me/order/order.phtml
template/m.yohobuy.com/partials/me/order/orders.phtml
yohobuy/m.yohobuy.com/application/controllers/Home.php
docs/data-structure.md
View file @
193b585
...
...
@@ -947,18 +947,20 @@
order: {
orders:
[
...
]
],
//没有订单的情况不传orders
walkWayUrl: '' //随便逛逛url
}
}
//订单
{
detailUrl: '',
orderNum: '',
orderStatus: '',
goods: [
{
id: '',
thumb: '',
gift: true, //是否赠品
advanceBuy: true, //是否加价购
...
...
static/js/me/order.js
View file @
193b585
...
...
@@ -13,7 +13,7 @@ var $navLi = $('#order-nav > li'),
var
$curContainer
=
$orderContainer
.
children
(
'.orders'
).
first
();
//保存当前显示的order-container
var
navHammer
;
var
navHammer
,
orderHammer
;
lazyLoad
();
...
...
@@ -33,4 +33,20 @@ 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
...
...
static/sass/me/_order.scss
View file @
193b585
...
...
@@ -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
{
...
...
template/m.yohobuy.com/actions/index/home/order.phtml
View file @
193b585
...
...
@@ -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>
...
...
template/m.yohobuy.com/partials/me/order/order.phtml
View file @
193b585
<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 @@
{{!-- 对应订单状态的操作逻辑 --}}
{{!-- 完成和取消订单显示删除按钮 --}}
{{#unless unpaid}}
{{#unless unreceived}}
<div class="order-opt">
<div class="order-opt">
{{#unless unpaid}}
{{#unless unreceived}}
<span class="btn del">删除订单</span>
</div>
{{/unless}}
{{/unless}}
{{/unless}}
{{#if unpaid}}
<div class="order-opt">
{{#if unpaid}}
<span class="btn cancel">取消订单</span>
<span class="btn pay">立即付款</span>
</div>
{{/if}}
<a class="locHref" href="{{payUrl}}">
<span class="btn pay">立即付款</span>
</a>
{{/if}}
{{#if unreceived}}
<div class="order-opt">
<a class="check-logistics" href="{{logisticsUrl}}">查看物流</a>
</div>
{{/if}}
{{#if unreceived}}
<a class="locHref" href="{{logisticsUrl}}">
<span class="btn check-logistics">查看物流</span>
</a>
{{/if}}
</div>
</div>
\ No newline at end of file
...
...
template/m.yohobuy.com/partials/me/order/orders.phtml
0 → 100644
View file @
193b585
{
{#if
walkwayUrl
}
}
<div
class=
"no-order"
>
<span
class=
"iconfont"
>
632
;</span>
<span>你还没有订单</span>
<a
class=
"walk-way"
href=
"{{walkwayUrl}}"
>随便逛逛</a>
</div>
{
{^
}
}
{
{#each
orders
}
}
{
{>
me/order/order
}
}
{
{/each
}
}
{
{/if
}
}
\ No newline at end of file
...
...
yohobuy/m.yohobuy.com/application/controllers/Home.php
View file @
193b585
...
...
@@ -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
));
}
...
...
Please
register
or
login
to post a comment