Toggle navigation
Toggle navigation
This project
Loading...
Sign in
wangshusheng
/
YOHOBUYPC
·
Commits
Go to a project
GitLab
Go to dashboard
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
727314fb054de20faf52d50518aa1b504372d43d
1 parent
4a42fa20
build my order
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
344 additions
and
7 deletions
docs/data-structure.md
static/index.js
static/js/me/entry.js
static/js/me/order.js
static/sass/me/_index.scss
static/sass/me/_order.scss
template/m.yohobuy.com/actions/index/home/order.phtml
template/m.yohobuy.com/partials/layout/use.phtml
template/m.yohobuy.com/partials/me/order/good.phtml
template/m.yohobuy.com/partials/me/order/order.phtml
yohobuy/m.yohobuy.com/application/controllers/Home.php
docs/data-structure.md
View file @
727314f
...
...
@@ -893,4 +893,37 @@
//查看全部VIP特权页面
all: true
}
}
### 我的订单
{
order: {
allOrders:
[
...
]
}
}
//订单
{
orderNum: '',
tradingStatus: '',
goods: [
{
id: '',
thumb: '',
gift: true, //是否赠品
advanceBuy: true, //是否加价购
name: '',
color: '黄色',
size: 'X',
price: '588',
count: 2
},
...
],
count: 1,
sumCost: '199.00'
}
\ No newline at end of file
...
...
static/index.js
View file @
727314f
...
...
@@ -8,5 +8,6 @@ require('./js/home/entry');
require
(
'./js/index/entry'
);
require
(
'./js/passport/entry'
);
require
(
'./js/product/entry'
);
require
(
'./js/me/entry'
);
module
.
exports
=
yohobuy
;
...
...
static/js/me/entry.js
0 → 100644
View file @
727314f
/**
* 个人中心js打包入口文件
* @author: xuqi<qi.xu@yoho.cn>
* @date: 2015/11/10
*/
require
(
'./order'
);
\ No newline at end of file
...
...
static/js/me/order.js
0 → 100644
View file @
727314f
/**
* 个人中心--我的订单
* @author: xuqi<qi.xu@yoho.cn>
* @date: 2015/11/10
*/
var
$
=
require
(
'jquery'
),
Hammer
=
require
(
'yoho.hammer'
),
lazyLoad
=
require
(
'yoho.lazyload'
);
var
$navLi
=
$
(
'#order-nav > li'
),
$orderContainer
=
$
(
'#order-container'
);
var
$curContainer
=
$orderContainer
.
children
(
'.orders'
).
first
();
//保存当前显示的order-container
var
navHammer
;
lazyLoad
();
navHammer
=
new
Hammer
(
document
.
getElementById
(
'order-nav'
));
navHammer
.
on
(
'tap'
,
function
(
e
)
{
var
$cur
=
$
(
e
.
target
).
closest
(
'li'
),
index
;
if
(
$cur
.
length
===
0
||
$cur
.
hasClass
(
'active'
))
{
return
;
}
index
=
$cur
.
index
();
$navLi
.
filter
(
'.active'
).
removeClass
(
'active'
);
$cur
.
addClass
(
'active'
);
$curContainer
.
addClass
(
'hide'
);
$curContainer
=
$orderContainer
.
children
(
':eq('
+
index
+
')'
).
removeClass
(
'hide'
);
});
...
...
static/sass/me/_index.scss
View file @
727314f
@import
"home"
,
"vip-grade"
;
\ No newline at end of file
@import
"home"
,
"vip-grade"
,
"order"
;
\ No newline at end of file
...
...
static/sass/me/_order.scss
0 → 100644
View file @
727314f
.order-page
{
background
:
#f0f0f0
;
.order
{
background
:
#fff
;
margin
:
30rem
/
$pxConvertRem
0
;
border-top
:
1px
solid
#e0e0e0
;
border-bottom
:
1px
solid
#e0e0e0
;
.header
,
.footer
{
height
:
90rem
/
$pxConvertRem
;
line-height
:
90rem
/
$pxConvertRem
;
font-size
:
30rem
/
$pxConvertRem
;
padding
:
0
30rem
/
$pxConvertRem
;
}
.header
{
border-bottom
:
1px
solid
#e0e0e0
;
}
.trading-status
{
float
:
right
;
}
.footer
{
text-align
:
right
;
border-top
:
1px
solid
#e0e0e0
;
}
.sum-cost
{
color
:
#e01
;
}
}
}
.order-nav
{
border-bottom
:
1px
solid
#e0e0e0
;
background
:
#fff
;
>
li
{
float
:
left
;
height
:
90rem
/
$pxConvertRem
;
width
:
25%
;
line-height
:
90rem
/
$pxConvertRem
;
color
:
#b0b0b0
;
font-size
:
26rem
/
$pxConvertRem
;
text-align
:
center
;
&
.active
{
color
:
#000
;
}
}
}
.order-good
{
position
:
relative
;
padding
:
20rem
/
$pxConvertRem
0
;
margin-left
:
34rem
/
$pxConvertRem
;
height
:
160rem
/
$pxConvertRem
;
border-bottom
:
1px
solid
#e0e0e0
;
font-size
:
26rem
/
$pxConvertRem
;
&
:last-child
{
border-bottom
:
none
;
}
.thumb-wrap
{
position
:
relative
;
float
:
left
;
width
:
120rem
/
$pxConvertRem
;
height
:
160rem
/
$pxConvertRem
;
}
.thumb
{
width
:
100%
;
height
:
100%
;
}
.tag
{
position
:
absolute
;
bottom
:
0
;
left
:
0
;
right
:
0
;
color
:
#fff
;
text-align
:
center
;
font-size
:
12px
;
}
.gift-tag
{
height
:
25rem
/
$pxConvertRem
;
background
:
#a1ce4e
;
&
:before
{
content
:
'赠品'
;
}
}
.advance-buy-tag
{
height
:
25rem
/
$pxConvertRem
;
background
:
#eb76aa
;
&
:before
{
content
:
'加价购'
;
}
}
.deps
{
margin-left
:
135rem
/
$pxConvertRem
;
}
.name
{
font-size
:
28rem
/
$pxConvertRem
;
max-width
:
70%
;
}
.row
:nth-child
(
2
)
{
height
:
45rem
/
$pxConvertRem
;
line-height
:
45rem
/
$pxConvertRem
;
>
span
{
margin-right
:
15rem
/
$pxConvertRem
;
}
}
.color
,
.size
{
color
:
#b6b6b6
;
}
.price-wrap
{
position
:
absolute
;
top
:
20rem
/
$pxConvertRem
;
right
:
30rem
/
$pxConvertRem
;
}
.price
{
color
:
#e01
;
}
.count
{
display
:
block
;
color
:
#999
;
text-align
:
right
;
line-height
:
45rem
/
$pxConvertRem
;
}
}
\ No newline at end of file
...
...
template/m.yohobuy.com/actions/index/home/order.phtml
0 → 100644
View file @
727314f
{
{>
layout/header
}
}
<div
class=
"order-page yoho-page"
>
{
{#
order
}
}
<ul
id=
"order-nav"
class=
"order-nav clearfix"
>
<li
class=
"active"
>
全部
</li>
<li>
待付款
</li>
<li>
待发货
</li>
<li>
待收货
</li>
</ul>
<div
id=
"order-container"
class=
"order-container"
>
<div
class=
"all orders"
>
{
{#
allOrders
}
}
{
{>
me/order/order
}
}
{
{/
allOrders
}
}
</div>
<div
class=
"obligation orders hide"
></div>
<div
class=
"unshipped orders hide"
></div>
<div
class=
"unreceived orders hide"
></div>
</div>
{
{/
order
}
}
</div>
{
{>
layout/footer
}
}
\ No newline at end of file
...
...
template/m.yohobuy.com/partials/layout/use.phtml
View file @
727314f
...
...
@@ -187,4 +187,11 @@
<script>
seajs.use('js/shopping-cart/gift-advance');
</script>
{{/if}}
{{!-- 个人中心 --}}
{{#if orderPage}}
<script>
seajs.use('js/me/order');
</script>
{{/if}}
\ No newline at end of file
...
...
template/m.yohobuy.com/partials/me/order/good.phtml
0 → 100644
View file @
727314f
<div class="order-good" data-id={{id}}>
<div class="thumb-wrap">
<img class="thumb lazy" data-original={{thumb}}>
<p class="tag{{#if gift}} gift-tag{{/if}}{{#if advanceBuy}} advance-buy-tag{{/if}}"></p>
</div>
<div class="deps">
<p class="name row">{{name}}</p>
<p class="row">
{{#if color}}
<span class="color">
颜色:{{color}}
</span>
{{/if}}
{{#if size}}
<span class="size">
尺码:{{size}}
</span>
{{/if}}
</p>
<p class="row price-wrap">
<span class="price">
¥{{price}}
</span>
<span class="count">
×{{count}}
</span>
</p>
</div>
</div>
\ No newline at end of file
...
...
template/m.yohobuy.com/partials/me/order/order.phtml
0 → 100644
View file @
727314f
<div class="order">
<header class="header">
订单编号:{{orderNum}}
<span class="trading-status">{{tradingStatus}}</span>
</header>
<section class="order-goods">
{{# goods}}
{{> me/order/good}}
{{/ goods}}
</section>
<footer class="footer">
共{{count}}件商品 实付<span class="sum-cost">¥{{sumCost}}</span>
</footer>
</div>
\ No newline at end of file
...
...
yohobuy/m.yohobuy.com/application/controllers/Home.php
View file @
727314f
...
...
@@ -39,12 +39,45 @@ class HomeController extends AbstractAction
*/
public
function
ordersAction
()
{
$uid
=
$this
->
getUid
();
$type
=
$this
->
get
(
'type'
,
1
);
$orders
=
\Index\UserModel
::
getUserOrderData
(
967016
,
$type
);
print_r
(
$orders
);
// $uid = $this->getUid();
// $type = $this->get('type', 1);
// $orders = \Index\UserModel::getUserOrderData(967016, $type);
$order
=
array
(
'allOrders'
=>
array
(
array
(
'orderNum'
=>
'408539077'
,
'tradingStatus'
=>
'交易成功'
,
'goods'
=>
array
(
array
(
'id'
=>
1
,
'thumb'
=>
'http://img11.static.yhbimg.com/goodsimg/2015/11/04/05/01ce2aff32fc3c90584f516167cd526d91.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90'
,
'name'
=>
'Adidas Originals ZX FLUXM22508'
,
'color'
=>
'黄'
,
'size'
=>
'43'
,
'price'
=>
'699.00'
,
'count'
=>
'2'
),
array
(
'id'
=>
1
,
'thumb'
=>
'http://img10.static.yhbimg.com/goodsimg/2015/11/04/05/0188f1aca49ac478a565ec029b5d2d4a6c.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90'
,
'name'
=>
'B.Duck浴室玩伴mini浮水鸭'
,
'gift'
=>
true
,
'color'
=>
'黄'
,
'size'
=>
'43'
,
'price'
=>
'0.00'
,
'count'
=>
'1'
)
),
'count'
=>
2
,
'sumCost'
=>
'699.00'
)
)
);
$this
->
_view
->
display
(
'order'
,
array
(
'order'
=>
$order
,
'orderPage'
=>
true
));
// print_r($orders);
}
/**
...
...
Please
register
or
login
to post a comment