Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOBUYPC
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
2
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Plain Diff
Browse Files
Authored by
Rock Zhang
9 years ago
Commit
a6bb6c591b72ee24a01f5c3e66e3c2b725831198
2 parents
876ceb02
c5aa356e
Merge branch 'develop' of git.dev.yoho.cn:web/yohobuy into develop
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
156 additions
and
129 deletions
docs/data-structure.md
library/Api/Yohobuy.php
static/js/guang/info.js
static/js/me/address.js
static/js/me/my-guang.js
static/js/me/order.js
static/js/product/newsale/hot-rank.js
static/sass/me/_address.scss
static/sass/me/_coupons.scss
static/sass/me/_home.scss
static/sass/me/_order.scss
template/m.yohobuy.com/actions/index/home/coupons.phtml
template/m.yohobuy.com/actions/index/home/index.phtml
template/m.yohobuy.com/actions/index/home/order.phtml
yohobuy/m.yohobuy.com/application/controllers/Home.php
yohobuy/m.yohobuy.com/application/models/Home/Order.php
docs/data-structure.md
View file @
a6bb6c5
...
...
@@ -943,7 +943,8 @@
{
name: '',
active: true,
typeId: 1
typeId: 1,
url: ''
},
...
]
...
...
library/Api/Yohobuy.php
View file @
a6bb6c5
...
...
@@ -18,17 +18,18 @@ class Yohobuy
{
// /* 正式环境 */
// const API_URL = 'http://api2.open.yohobuy.com/';
// const API_URL2 = 'http://api.open.yohobuy.com/';
// const SERVICE_URL = 'http://service.api.yohobuy.com/';
// const YOHOBUY_URL = 'http://www.yohobuy.com/';
const
API_URL
=
'http://api2.open.yohobuy.com/'
;
const
API_URL2
=
'http://api.open.yohobuy.com/'
;
const
SERVICE_URL
=
'http://service.api.yohobuy.com/'
;
const
YOHOBUY_URL
=
'http://www.yohobuy.com/'
;
/* 测试环境 */
const
API_URL
=
'http://test2.open.yohobuy.com/'
;
const
SERVICE_URL
=
'http://test.service.api.yohobuy.com/'
;
const
YOHOBUY_URL
=
'http://www.yohobuy.com/'
;
const
API_URL_MYCENTER
=
'http://192.168.102.213:8080/api-gateway-web/'
;
// 我的个人中心接口URL
const
API_URL_SHOPINGCART
=
'http://192.168.102.213:8080/api-gateway-web/'
;
// 我的购物车接口URL
// const API_URL = 'http://test2.open.yohobuy.com/';
// const SERVICE_URL = 'http://test.service.api.yohobuy.com/';
// const YOHOBUY_URL = 'http://www.yohobuy.com/';
// const API_URL_MYCENTER = 'http://192.168.102.213:8080/api-gateway-web/'; // 我的个人中心接口URL
// const API_URL_SHOPINGCART = 'http://192.168.102.213:8080/api-gateway-web/'; // 我的购物车接口URL
/**
* 私钥列表
...
...
static/js/guang/info.js
View file @
a6bb6c5
...
...
@@ -5,16 +5,16 @@
*/
var
$
=
require
(
'jquery'
),
Hammer
=
require
(
'yoho.hammer'
),
ellipsis
=
require
(
'mlellipsis'
),
lazyLoad
=
require
(
'yoho.lazyload'
);
Hammer
=
require
(
'yoho.hammer'
),
ellipsis
=
require
(
'mlellipsis'
),
lazyLoad
=
require
(
'yoho.lazyload'
);
var
tip
=
require
(
'../plugin/tip'
);
var
loading
=
require
(
'../plugin/loading'
);
var
$loadMoreInfo
=
$
(
'#load-more-info'
);
var
$loading
=
$
(
''
),
$noMore
=
$
(
''
);
$noMore
=
$
(
''
);
var
searching
=
false
;
...
...
@@ -34,8 +34,8 @@ function setLazyLoadAndMellipsis($infos) {
$infos
.
each
(
function
()
{
var
$this
=
$
(
this
),
$title
=
$this
.
find
(
'.info-title'
),
$text
=
$this
.
find
(
'.info-text'
);
$title
=
$this
.
find
(
'.info-title'
),
$text
=
$this
.
find
(
'.info-text'
);
$title
[
0
].
mlellipsis
(
2
);
$text
[
0
].
mlellipsis
(
2
);
...
...
@@ -57,10 +57,10 @@ function initInfosEvt($container) {
cHammer
.
on
(
'tap'
,
function
(
e
)
{
var
$this
=
$
(
e
.
target
),
opt
=
'ok'
,
$likeBtn
,
$collectBtn
,
$info
;
opt
=
'ok'
,
$likeBtn
,
$collectBtn
,
$info
;
$likeBtn
=
$this
.
closest
(
'.like-btn'
);
if
(
$likeBtn
.
length
>
0
)
{
...
...
static/js/me/address.js
View file @
a6bb6c5
...
...
@@ -27,7 +27,9 @@ function editAddress(data) {
$addressForm
.
find
(
'[name="area"]'
).
val
(
data
.
area
||
''
);
$addressForm
.
find
(
'[name="address"]'
).
val
(
data
.
address
||
''
);
$editAddressPage
.
show
();
$addressForm
.
find
(
'[name="consignee"]'
).
focus
();
// $addressForm.find('[name="address"]').blur();
// $addressForm.find('[name="consignee"]').focus();
}
function
deleteAddress
(
data
)
{
...
...
static/js/me/my-guang.js
0 → 100644
View file @
a6bb6c5
/**
* 我的逛
* @author xuqi<qi.xu@yoho.cn>
* @date: 2015/11/17
*/
var
$
=
require
(
'jquery'
);
var
info
=
require
(
'../guang/info'
);
info
.
initInfoEvt
(
$
(
'#info-list'
));
\ No newline at end of file
...
...
static/js/me/order.js
View file @
a6bb6c5
...
...
@@ -17,27 +17,32 @@ var winH = $(window).height();
var
activeType
=
$navLi
.
filter
(
'.active'
).
data
(
'type'
);
//当前active的项的index
var
orderPage
=
{};
var
order
=
{
page
:
0
,
end
:
false
};
var
inAjax
=
false
;
var
loading
=
require
(
'../plugin/loading'
);
var
navHammer
,
orderHammer
;
var
orderHammer
;
//加载订单
function
getOrders
()
{
function
getOrders
(
option
)
{
var
opt
=
{
type
:
activeType
,
page
:
order
Page
[
activeType
]
?
(
orderPage
[
activeType
]
+
1
)
:
1
page
:
order
.
page
+
1
};
var
show
=
option
&&
option
.
showLoadingMask
;
if
(
inAjax
)
{
return
;
}
inAjax
=
true
;
loading
.
showLoadingMask
();
show
&&
loading
.
showLoadingMask
();
$
.
ajax
({
type
:
'GET'
,
...
...
@@ -46,23 +51,27 @@ function getOrders() {
success
:
function
(
data
)
{
var
num
;
if
(
data
.
code
===
200
)
{
orderPage
[
opt
.
type
]
=
opt
.
page
;
if
(
data
!==
' '
)
{
order
.
page
=
opt
.
page
;
if
(
opt
.
page
===
1
)
{
$curContainer
.
html
(
data
.
data
);
$curContainer
.
html
(
data
);
lazyLoad
(
$curContainer
.
find
(
'.lazy'
));
}
else
{
num
=
$curContainer
.
children
(
'.order'
).
length
;
$curContainer
.
append
(
data
.
data
);
$curContainer
.
append
(
data
);
//lazyload
lazyLoad
(
$curContainer
.
children
(
'.order:gt('
+
(
num
-
1
)
+
')
.lazy'
));
lazyLoad
(
$curContainer
.
children
(
'.order:gt('
+
(
num
-
1
)
+
')
'
).
find
(
'
.lazy'
));
}
window
.
rePosFooter
();
//重新计算底部位置
}
else
{
order
.
end
=
true
;
}
inAjax
=
false
;
loading
.
hideLoadingMask
();
show
&&
loading
.
hideLoadingMask
();
}
});
}
...
...
@@ -83,33 +92,6 @@ lazyLoad();
loading
.
init
(
$
(
'body'
));
//满屏loading
//导航切换
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'
);
activeType
=
$cur
.
data
(
'type'
);
if
(
orderPage
[
activeType
])
{
return
;
}
else
{
getOrders
();
}
});
//点击订单区域跳转订单详情页
orderHammer
=
new
Hammer
(
document
.
getElementById
(
'order-container'
));
orderHammer
.
on
(
'tap'
,
function
(
e
)
{
...
...
@@ -168,9 +150,13 @@ orderHammer.on('tap', function(e) {
});
$
(
window
).
scroll
(
function
()
{
if
(
$
(
window
).
scrollTop
()
+
winH
>
if
(
order
.
end
===
false
&&
$
(
window
).
scrollTop
()
+
winH
>
$
(
document
).
height
()
-
0.25
*
$orderContainer
.
height
())
{
getOrders
();
//下拉请求时不显示mask
getOrders
({
noLoadingMask
:
true
});
}
});
...
...
static/js/product/newsale/hot-rank.js
View file @
a6bb6c5
...
...
@@ -11,7 +11,8 @@ var page = 1,
navSwiper
,
notab
=
0
,
sort
=
''
,
id
=
''
;
id
=
''
,
noResult
=
'<p class="no-result">未找到相关搜索结果</p>'
;
function
hotrank
(
page
,
sort
,
tabId
,
notab
)
{
loading
.
showLoadingMask
();
...
...
@@ -28,7 +29,11 @@ function hotrank(page, sort, tabId, notab) {
if
(
page
===
1
)
{
$
(
'.rank-main'
).
remove
();
}
$
(
'#hotRank'
).
append
(
data
);
if
(
data
===
' '
)
{
$
(
'#hotRank'
).
html
(
noResult
);
}
else
{
$
(
'#hotRank'
).
append
(
data
);
}
lazyLoad
(
$
(
'img.lazy'
));
$
(
'.rank-main ul li:gt(2)'
).
find
(
'.item-content i'
).
removeClass
(
'top'
);
winH
=
$
(
window
).
height
();
...
...
static/sass/me/_address.scss
View file @
a6bb6c5
...
...
@@ -142,8 +142,8 @@
input
,
textarea
{
position
:
absolute
;
top
:
0
;
right
:
0
;
width
:
pxToRem
(
400px
);
right
:
pxToRem
(
40px
);
width
:
pxToRem
(
360px
);
height
:
pxToRem
(
88px
);
color
:
#444
;
padding
:
0
;
...
...
@@ -156,6 +156,8 @@
}
textarea
{
right
:
0
;
width
:
pxToRem
(
400px
);
height
:
pxToRem
(
58px
)
*
2
;
padding
:
pxToRem
(
20px
)
0
;
}
...
...
static/sass/me/_coupons.scss
View file @
a6bb6c5
...
...
@@ -45,9 +45,8 @@
p
{
width
:
55
.517241%
;
height
:
auto
;
padding
:
0
5%
1
0
em
/
$pxConvertRem
;;
padding
:
0
5%
1
8
em
/
$pxConvertRem
;;
float
:
left
;
font-size
:
44em
/
$pxConvertRem
;
&
:first-of-type
{
padding-top
:
30em
/
$pxConvertRem
;
font-size
:
60em
/
$pxConvertRem
;
...
...
static/sass/me/_home.scss
View file @
a6bb6c5
...
...
@@ -78,7 +78,7 @@
font-size
:
pxToRem
(
32px
);
line-height
:
pxToRem
(
88px
);
span
{
a
{
color
:
#e0e0e0
;
float
:
right
;
}
...
...
@@ -110,6 +110,7 @@
background
:
#fff
;
.list-item
{
display
:
block
;
position
:
relative
;
padding
:
0
pxToRem
(
30px
);
font-size
:
pxToRem
(
32px
);
...
...
static/sass/me/_order.scss
View file @
a6bb6c5
...
...
@@ -106,7 +106,14 @@
border-bottom
:
1px
solid
#e0e0e0
;
background
:
#fff
;
>
li
{
a
{
display
:
block
;
height
:
100%
;
width
:
100%
;
color
:
#b0b0b0
;
}
>
li
{
float
:
left
;
height
:
90rem
/
$pxConvertRem
;
width
:
25%
;
...
...
@@ -115,7 +122,7 @@
font-size
:
26rem
/
$pxConvertRem
;
text-align
:
center
;
&
.active
{
&
.active
a
{
color
:
#000
;
}
}
...
...
template/m.yohobuy.com/actions/index/home/coupons.phtml
View file @
a6bb6c5
...
...
@@ -3,18 +3,25 @@
<span
class=
"active"
>未使用</span>
<span>已使用</span>
</div>
{
{#
couponsUrl
}
}
<div
class=
"employ-list"
>
{
{#
unused
}
}
<div
class=
"employ-main"
>
<span>
50
</span>
<p>【summer
sale】下装满¥
399
减¥
50
券</p>
<p>有效期:
2014.07
.
28
-
2014.09
.
15
</p>
</div>
{
{/
unused
}
}
</div>
<div
class=
"employ-list not none"
>
{
{#
used
}
}
<div
class=
"employ-main"
>
<span>
60
</span>
<p>【summer
sale】下装满¥
399
减¥
60
券</p>
<p>有效期:
2014.07
.
28
-
2014.09
.
15
</p>
<span>
{
{
money
}
}</span>
<p>
{
{
coupon_name
}
}</p>
<p>
{
{
couponValidity
}
}</p>
</div>
{
{/
used
}
}
</div>
{
{/
couponsUrl
}
}
{
{>
layout/footer
}
}
\ No newline at end of file
...
...
template/m.yohobuy.com/actions/index/home/index.phtml
View file @
a6bb6c5
...
...
@@ -11,15 +11,15 @@
</div>
</div>
<div
class=
"my-link clearfix"
>
<a
class=
"link-item"
href=
"/home"
>
<a
class=
"link-item"
href=
"/home
/
"
>
{
{product_favorite_total
}
}
<p>收藏的商品</p>
</a>
<a
class=
"link-item"
href=
"/home"
>
<a
class=
"link-item"
href=
"/home
/
"
>
{
{brand_favorite_total
}
}
<p>收藏的品牌</p>
</a>
<a
class=
"link-item"
href=
"/home"
>
<a
class=
"link-item"
href=
"/home
/
"
>
{
{product_browse
}
}
<p>浏览记录</p>
</a>
...
...
@@ -27,9 +27,9 @@
<div
class=
"my-order"
>
<div
class=
"order-title"
>
我的订单
<
span
class=
"iconfont
"
>
<
a
class=
"iconfont"
href=
"/home/order
"
>
查看全部订单

604
;
</
span
>
</
a
>
</div>
<div
class=
"order-type clearfix"
>
<a
class=
"type-item"
href=
"/home/order"
>
...
...
@@ -47,44 +47,44 @@
</div>
</div>
<div
class=
"group-list"
>
<
div
class=
"list-item
"
>
<
a
class=
"list-item"
href=
"/home/address
"
>
<span
class=
"iconfont icon"
>
637
;</span>
地址管理
<span
class=
"iconfont num"
>
3

604
;</span>
</
div
>
</
a
>
</div>
<div
class=
"group-list"
>
<
div
class=
"list-item
"
>
<
a
class=
"list-item"
href=
"/home/
"
>
<span
class=
"iconfont icon"
>
63
a;</span>
优惠券
<span
class=
"iconfont num"
>
{
{coupon_num
}
}

604
;</span>
</div>
<div
class=
"list-item"
>
</a>
<a
class=
"list-item"
href=
"/home/"
>
<span
class=
"iconfont icon"
>
635
;</span>
YOHO
币
<span
class=
"iconfont num"
>
{
{yoho_coin_num
}
}

604
;</span>
</
div
>
</
a
>
</div>
<div
class=
"group-list"
>
<
div
class=
"list-item
"
>
<
a
class=
"list-item"
href=
"/home/
"
>
<span
class=
"iconfont icon"
>
636
;</span>
消息
<span
class=
"iconfont num"
>
{
{inbox_total
}
}

604
;</span>
</
div
>
</
a
>
</div>
<div
class=
"group-list"
>
<
div
class=
"list-item
"
>
<
a
class=
"list-item"
href=
"/home/
"
>
<span
class=
"iconfont icon"
>
63
c;</span>
在线客服
<span
class=
"iconfont num"
>
604
;</span>
</
div
>
</
a
>
</div>
<div
class=
"group-list"
>
<
div
class=
"list-item
"
>
<
a
class=
"list-item"
href=
"/home/
"
>
<span
class=
"iconfont icon"
>
639
;</span>
帮助
<span
class=
"iconfont num"
>
604
;</span>
</
div
>
</
a
>
</div>
{
{>
product/recommend-for-you
}
}
...
...
template/m.yohobuy.com/actions/index/home/order.phtml
View file @
a6bb6c5
...
...
@@ -4,7 +4,7 @@
<ul
id=
"order-nav"
class=
"order-nav clearfix"
>
{
{#each
navs
}
}
<li
{
{#if
active
}
}class=
"active"
{
{/if
}
}
data-type=
"{{typeId}}"
>
{
{name
}
}
<a
href=
"{{url}}"
>
{
{name
}
}</a>
</li>
{
{/each
}
}
</ul>
...
...
yohobuy/m.yohobuy.com/application/controllers/Home.php
View file @
a6bb6c5
...
...
@@ -212,8 +212,6 @@ class HomeController extends AbstractAction
'couponsUrl'
=>
\Index\UserModel
::
getCouponData
(
$uid
,
$status
),
'couponsPage'
=>
true
);
print_r
(
$coupons
);
$this
->
_view
->
display
(
'coupons'
,
$coupons
);
}
...
...
@@ -449,19 +447,19 @@ class HomeController extends AbstractAction
$data
=
OrderModel
::
getNavs
(
$type
);
if
(
!
empty
(
$data
))
{
$order
[
'navs'
]
=
$data
;
$order
[
'orderPage'
]
=
true
;
}
else
{
$this
->
error
();
}
$this
->
_view
->
display
(
'order'
,
array
(
'order'
=>
$order
,
'pageFooter'
=>
true
'pageFooter'
=>
true
,
'orderPage'
=>
true
));
}
//ajax请求订单页面
public
function
getOrderAction
()
{
public
function
getOrder
s
Action
()
{
//判断是不是ajax请求
if
(
!
$this
->
isAjax
())
{
$this
->
error
();
...
...
@@ -481,7 +479,11 @@ class HomeController extends AbstractAction
if
(
!
empty
(
$data
))
{
$order
[
'orders'
]
=
$data
;
}
else
{
$order
[
'walkwayUrl'
]
=
'http://www.baidu.com'
;
if
(
$page
>
1
)
{
echo
" "
;
}
else
{
$order
[
'walkwayUrl'
]
=
'http://www.baidu.com'
;
}
}
//渲染模板
$this
->
_view
->
display
(
'order-content'
,
$order
);
...
...
yohobuy/m.yohobuy.com/application/models/Home/Order.php
View file @
a6bb6c5
...
...
@@ -121,55 +121,58 @@ class OrderModel
}
return
$arr
;
}
//根据type值设置nav属性
public
function
getNavs
(
$type
){
public
function
getNavs
(
$type
)
{
$nav
=
array
(
array
(
'name'
=>
'全部'
,
'typeId'
=>
'1'
'typeId'
=>
'1'
,
'url'
=>
'/home/order?type=1'
),
array
(
'name'
=>
'待付款'
,
'typeId'
=>
'2'
'typeId'
=>
'2'
,
'url'
=>
'/home/order?type=2'
),
array
(
'name'
=>
'待发货'
,
'typeId'
=>
'3'
'typeId'
=>
'3'
,
'url'
=>
'/home/order?type=3'
),
array
(
'name'
=>
'待收货'
,
'typeId'
=>
'4'
'typeId'
=>
'4'
,
'url'
=>
'/home/order?type=4'
)
);
foreach
(
$nav
as
$key
=>
$vo
){
switch
(
$type
)
{
case
1
:
if
(
$vo
[
'typeId'
]
==
1
){
$nav
[
$key
][
'active'
]
=
true
;
}
break
;
case
2
:
if
(
$vo
[
'typeId'
]
==
2
){
$nav
[
$key
][
'active'
]
=
true
;
}
break
;
case
3
:
if
(
$vo
[
'typeId'
]
==
3
){
$nav
[
$key
][
'active'
]
=
true
;
}
break
;
case
4
:
if
(
$vo
[
'typeId'
]
==
4
){
$nav
[
$key
][
'active'
]
=
true
;
}
break
;
default
:
break
;
}
foreach
(
$nav
as
$key
=>
$vo
)
{
switch
(
$type
)
{
case
1
:
if
(
$vo
[
'typeId'
]
==
1
)
{
$nav
[
$key
][
'active'
]
=
true
;
}
break
;
case
2
:
if
(
$vo
[
'typeId'
]
==
2
)
{
$nav
[
$key
][
'active'
]
=
true
;
}
break
;
case
3
:
if
(
$vo
[
'typeId'
]
==
3
)
{
$nav
[
$key
][
'active'
]
=
true
;
}
break
;
case
4
:
if
(
$vo
[
'typeId'
]
==
4
)
{
$nav
[
$key
][
'active'
]
=
true
;
}
break
;
default
:
break
;
}
}
return
$nav
;
}
}
...
...
Please
register
or
login
to post a comment