Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHO-ACTIVITY-PHP
·
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
Plain Diff
Browse Files
Authored by
uedxwg
9 years ago
Commit
0280c0e07db596bbfcccedd861afd390bfcd2af9
2 parents
3ebe35a4
835c3b0e
Merge branch 'develop' of
http://git.dev.yoho.cn/web/yohobuy
into develop
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
153 additions
and
106 deletions
framework
library/Action/AbstractAction.php
static/js/me/address.js
static/sass/me/_address.scss
static/sass/me/_home.scss
static/sass/product/_recommend-for-you.scss
template/m.yohobuy.com/actions/index/home/favorite.phtml
template/m.yohobuy.com/actions/index/home/favorite_brand.phtml
template/m.yohobuy.com/actions/index/home/favorite_product.phtml
template/m.yohobuy.com/actions/index/home/index.phtml
template/m.yohobuy.com/partials/home/favorite_brand_list.phtml
template/m.yohobuy.com/partials/home/favorite_product_list.phtml
template/m.yohobuy.com/partials/me/address/edit-address.phtml
template/m.yohobuy.com/partials/product/recommend-for-you.phtml
yohobuy/m.yohobuy.com/application/controllers/Home.php
yohobuy/m.yohobuy.com/application/models/Index/User.php
framework
@
e9d066dd
Subproject commit
75bbc3b075de19f239532f60c5995d06c5f814e2
Subproject commit
e9d066dd88a8e7e37103021c427a205a5cfcdcec
...
...
library/Action/AbstractAction.php
View file @
0280c0e
...
...
@@ -382,23 +382,27 @@ class AbstractAction extends Controller_Abstract
$header
[
'navHome'
]
=
$homeUrl
.
'?go=1&t='
.
time
();
}
// 根据COOKIE记录的频道进行导航定位
$channel
=
Helpers
::
getChannelByCookie
();
switch
(
$channel
)
{
default
:
case
1
:
$header
[
'boys'
]
=
true
;
break
;
case
2
:
$header
[
'girls'
]
=
true
;
break
;
case
3
:
$header
[
'kids'
]
=
true
;
break
;
case
4
:
$header
[
'lifeStyle'
]
=
true
;
break
;
}
$controller
=
$this
->
getRequest
()
->
getControllerName
();
if
(
$controller
!==
'Home'
)
{
// 根据COOKIE记录的频道进行导航定位
$channel
=
Helpers
::
getChannelByCookie
();
switch
(
$channel
)
{
default
:
case
1
:
$header
[
'boys'
]
=
true
;
break
;
case
2
:
$header
[
'girls'
]
=
true
;
break
;
case
3
:
$header
[
'kids'
]
=
true
;
break
;
case
4
:
$header
[
'lifeStyle'
]
=
true
;
break
;
}
}
$this
->
_view
->
assign
(
'pageHeader'
,
$header
);
}
/**
...
...
static/js/me/address.js
View file @
0280c0e
...
...
@@ -28,10 +28,8 @@ function editAddress(data) {
$addressForm
.
find
(
'[name="area_code"]'
).
val
(
data
.
areaCode
||
''
);
$addressForm
.
find
(
'[name="area"]'
).
val
(
data
.
area
||
''
);
$addressForm
.
find
(
'[name="address"]'
).
val
(
data
.
address
||
''
);
$footer
.
hide
();
$editAddressPage
.
show
();
// $addressForm.find('[name="address"]').blur();
// $addressForm.find('[name="consignee"]').focus();
}
$confim
.
on
(
'touchend'
,
'.cancel'
,
function
()
{
...
...
static/sass/me/_address.scss
View file @
0280c0e
.my-address-page
{
position
:
absolute
;
bottom
:
0
;
top
:
pxToRem
(
90px
);
width
:
100%
;
background
:
#f0f0f0
;
padding-bottom
:
pxToRem
(
20px
);
.address-item
{
padding
:
pxToRem
(
20px
)
pxToRem
(
30px
);
...
...
@@ -41,6 +39,7 @@
.add-address
{
display
:
block
;
margin-top
:
pxToRem
(
30px
);
margin-bottom
:
pxToRem
(
30px
);
font-size
:
pxToRem
(
32px
);
line-height
:
pxToRem
(
88px
);
color
:
#444
;
...
...
static/sass/me/_home.scss
View file @
0280c0e
.my-page
{
color
:
#444
;
background
:
#f0f0f0
;
padding-bottom
:
pxToRem
(
20px
);
a
{
color
:
#444
;
...
...
static/sass/product/_recommend-for-you.scss
View file @
0280c0e
...
...
@@ -13,7 +13,7 @@
}
.swiper-container
{
padding
:
pxToRem
(
20px
)
0
;
padding
:
pxToRem
(
30px
)
0
pxToRem
(
20px
)
;
width
:
100%
;
height
:
pxToRem
(
252px
);
overflow
:
hidden
;
...
...
template/m.yohobuy.com/actions/index/home/favorite.phtml
View file @
0280c0e
...
...
@@ -8,40 +8,7 @@
<div
class=
"fav-content"
id=
"fav-content"
>
<div
class=
"fav-type"
>
<ul
class=
"fav-product-list"
>
{
{#
hasFavProduct
}
}
<li
data-id=
"{{fav_id}}"
>
<a
href=
"{{link}}"
>
<div
class=
"fav-img-box"
>
<img
src=
"{{imgUrl}}"
alt=
""
/>
</div>
<div
class=
"fav-info-list"
>
<h
2
>
{
{title
}
}</h
2
>
<div
class=
"fav-price"
>
{
{#
discountPrice
}
}
<span
class=
"new-price"
>
{
{.
}
}</span>
{
{/
discountPrice
}
}
<span
class=
"fav-price {{# discountPrice}}price-underline{{/ discountPrice}}"
>
{
{price
}
}</span>
</div>
{
{#
savePrice
}
}
<div
class=
"save-price save-price-number"
>
比收藏时降价了<span>
{
{.
}
}</span>
<span
class=
"del-fav"
></span>
</div>
{
{/
savePrice
}
}
{
{^
savePrice
}
}
<div
class=
"save-price"
>
{
{#
sellOut
}
}
<span
class=
"sell-out"
>已售罄</span>
{
{/
sellOut
}
}
<span
class=
"del-fav"
></span>
</div>
{
{/
savePrice
}
}
</div>
</a>
</li>
{
{/
hasFavProduct
}
}
{
{>
home/favorite_product_list
}
}
</ul>
{
{^
hasFavProduct
}
}
...
...
@@ -50,43 +17,7 @@
{
{/
hasFavProduct
}
}
</div>
<div
class=
"fav-type"
>
{
{#
hasFavBrand
}
}
<div
class=
"fav-brand-swiper"
>
<div
class=
"swiper-header"
>
<div
class=
"swiper-logo"
>
<img
src=
"{{brandImg}}"
alt=
""
/>
</div>
<div
class=
"brand-info"
>
<span
class=
"brand-name"
>
{
{brandName
}
}</span>
<div
class=
"brand-update"
>
{
{#
update
}
}
<span
class=
"brand-new"
>上新<b>
{
{.
}
}</b></span>
{
{/
update
}
}
{
{#
discount
}
}
<span
class=
"brand-discount"
>折扣<b>
{
{.
}
}</b></span>
{
{/
discount
}
}
</div>
</div>
<a
class=
"fav-more"
href=
"{{link}}"
></a>
</div>
<div
id=
"swiper-container-{{id}}"
class=
"swiper-container"
data-id=
"{{id}}"
>
<ul
class=
"swiper-wrapper swiper-wrapper-{{id}}"
>
{
{#
productList
}
}
<li
class=
"swiper-slide"
>
<img
class=
"swiper-lazy"
data-src=
"{{imgUrl}}"
alt=
""
/>
<div
class=
"brand-product"
>
<p
class=
"{{# discount}}price-discount{{/ discount}}"
>
{
{price
}
}
{
{#
discount
}
}<span>
{
{.
}
}
{
{/
discount
}
}<span>
</p>
</div>
<div
class=
"swiper-lazy-preloader"
></div>
</li>
{
{/
productList
}
}
</ul>
</div>
</div>
{
{/
hasFavBrand
}
}
{
{>
home/favorite_brand_list
}
}
{
{^
hasFavBrand
}
}
<span
class=
"fav-null"
>您暂无收藏任何品牌</span>
...
...
template/m.yohobuy.com/actions/index/home/favorite_brand.phtml
0 → 100644
View file @
0280c0e
{
{>
home/favorite_brand_list
}
}
\ No newline at end of file
...
...
template/m.yohobuy.com/actions/index/home/favorite_product.phtml
0 → 100644
View file @
0280c0e
{
{>
home/favorite_product_list
}
}
\ No newline at end of file
...
...
template/m.yohobuy.com/actions/index/home/index.phtml
View file @
0280c0e
...
...
@@ -6,7 +6,7 @@
<span
class=
"user-avatar"
data-avatar=
"{{head_ico}}"
></span>
<span
class=
"username"
>
{
{profile_name
}
}</span>
{
{#vip_info
}
}
<span
class=
"vip-icon vip-{{
next
_level}}"
></span>
<span
class=
"vip-icon vip-{{
cur
_level}}"
></span>
{
{/vip_info
}
}
<div
class=
"iconfont more-icon"
>
604
;</div>
</a>
...
...
template/m.yohobuy.com/partials/home/favorite_brand_list.phtml
0 → 100644
View file @
0280c0e
{
{#
hasFavBrand
}
}
<div
class=
"fav-brand-swiper"
>
<div
class=
"swiper-header"
>
<div
class=
"swiper-logo"
>
<img
src=
"{{brandImg}}"
alt=
""
/>
</div>
<div
class=
"brand-info"
>
<span
class=
"brand-name"
>
{
{brandName
}
}</span>
<div
class=
"brand-update"
>
{
{#
update
}
}
<span
class=
"brand-new"
>上新<b>
{
{.
}
}</b></span>
{
{/
update
}
}
{
{#
discount
}
}
<span
class=
"brand-discount"
>折扣<b>
{
{.
}
}</b></span>
{
{/
discount
}
}
</div>
</div>
<a
class=
"fav-more"
href=
"{{link}}"
></a>
</div>
<div
id=
"swiper-container-{{id}}"
class=
"swiper-container"
data-id=
"{{id}}"
>
<ul
class=
"swiper-wrapper swiper-wrapper-{{id}}"
>
{
{#
productList
}
}
<li
class=
"swiper-slide"
>
<img
class=
"swiper-lazy"
data-src=
"{{imgUrl}}"
alt=
""
/>
<div
class=
"brand-product"
>
<p
class=
"{{# discount}}price-discount{{/ discount}}"
>
{
{price
}
}
{
{#
discount
}
}<span>
{
{.
}
}
{
{/
discount
}
}<span>
</p>
</div>
<div
class=
"swiper-lazy-preloader"
></div>
</li>
{
{/
productList
}
}
</ul>
</div>
</div>
{
{/
hasFavBrand
}
}
\ No newline at end of file
...
...
template/m.yohobuy.com/partials/home/favorite_product_list.phtml
0 → 100644
View file @
0280c0e
{
{#
hasFavProduct
}
}
<li
data-id=
"{{fav_id}}"
>
<a
href=
"{{link}}"
>
<div
class=
"fav-img-box"
>
<img
src=
"{{imgUrl}}"
alt=
""
/>
</div>
<div
class=
"fav-info-list"
>
<h
2
>
{
{title
}
}</h
2
>
<div
class=
"fav-price"
>
{
{#
discountPrice
}
}
<span
class=
"new-price"
>
{
{.
}
}</span>
{
{/
discountPrice
}
}
<span
class=
"fav-price {{# discountPrice}}price-underline{{/ discountPrice}}"
>
{
{price
}
}</span>
</div>
{
{#
savePrice
}
}
<div
class=
"save-price save-price-number"
>
比收藏时降价了<span>
{
{.
}
}</span>
<span
class=
"del-fav"
></span>
</div>
{
{/
savePrice
}
}
{
{^
savePrice
}
}
<div
class=
"save-price"
>
{
{#
sellOut
}
}
<span
class=
"sell-out"
>已售罄</span>
{
{/
sellOut
}
}
<span
class=
"del-fav"
></span>
</div>
{
{/
savePrice
}
}
</div>
</a>
</li>
{
{/
hasFavProduct
}
}
\ No newline at end of file
...
...
template/m.yohobuy.com/partials/me/address/edit-address.phtml
View file @
0280c0e
...
...
@@ -2,7 +2,7 @@
<form class="edit-address">
<input type="hidden" name="id" value="">
<label class="username">
收件人
收件人
姓名
<input type="text" name="consignee" value="">
</label>
<label class="mobile">
...
...
template/m.yohobuy.com/partials/product/recommend-for-you.phtml
View file @
0280c0e
<div class="recommend-for-you">
<div class="recommend-for-you
hide
">
</div>
\ No newline at end of file
...
...
yohobuy/m.yohobuy.com/application/controllers/Home.php
View file @
0280c0e
...
...
@@ -28,9 +28,9 @@ class HomeController extends AbstractAction
// 检查用户是否登录, 未登录则跳转到登录页
// @todo 为了方便测试,支持传uid参数
$uid
=
$this
->
getUid
();
if
(
!
$uid
)
{
/*
if (!$uid) {
$uid = $this->_uid = $this->get('uid', 8826435); //$this->getUid(true);
}
}
*/
$action
=
$this
->
getRequest
()
->
getActionName
();
if
(
!
$uid
&&
$action
!==
'index'
)
{
...
...
@@ -61,7 +61,7 @@ class HomeController extends AbstractAction
$data
+=
UserModel
::
getUserProfileData
(
$uid
);
$data
+=
UserModel
::
getInfoNumData
(
$uid
);
}
$this
->
_view
->
display
(
'index'
,
$data
);
}
...
...
@@ -98,8 +98,8 @@ class HomeController extends AbstractAction
$uid
=
$this
->
getUid
();
$gender
=
Helpers
::
getGenderByCookie
();
$favProducts
=
UserModel
::
getFavProductData
(
$uid
);
$favBrands
=
UserModel
::
getFavBrandData
(
$uid
,
$gender
);
$favProducts
=
UserModel
::
getFavProductData
(
$this
->
_uid
,
1
,
10
);
$favBrands
=
UserModel
::
getFavBrandData
(
$this
->
_uid
,
10
,
1
,
10
);
$data
=
array
(
'favPage'
=>
true
,
//加载js
...
...
@@ -119,6 +119,44 @@ class HomeController extends AbstractAction
}
/**
* 用户收藏的商品数据获取接口
*/
public
function
favProductAction
()
{
$result
=
array
();
if
(
$this
->
isAjax
())
{
$page
=
$this
->
post
(
'page'
,
1
);
$result
=
UserModel
::
getFavProductData
(
$this
->
_uid
,
$page
,
10
);
}
if
(
empty
(
$result
))
{
echo
' '
;
}
else
{
$this
->
_view
->
display
(
'favorite_product'
,
$result
);
}
}
/**
* 用户收藏的品牌数据获取接口
*/
public
function
favBrandAction
()
{
$result
=
array
();
if
(
$this
->
isAjax
())
{
$page
=
$this
->
post
(
'page'
,
1
);
$result
=
UserModel
::
getFavBrandData
(
$this
->
_uid
,
10
,
$page
,
10
);
}
if
(
empty
(
$result
))
{
echo
' '
;
}
else
{
$this
->
_view
->
display
(
'favorite_brand'
,
$result
);
}
}
/**
* 用户收藏的商品-删除
*/
public
function
favoriteDelAction
()
...
...
@@ -205,6 +243,7 @@ class HomeController extends AbstractAction
'couponsUrl'
=>
UserModel
::
getCouponData
(
$uid
),
'couponsPage'
=>
true
);
$this
->
_view
->
display
(
'coupons'
,
$coupons
);
}
...
...
yohobuy/m.yohobuy.com/application/models/Index/User.php
View file @
0280c0e
...
...
@@ -145,14 +145,16 @@ class UserModel
* 处理用户收藏的商品数据
*
* @param int $uid 用户ID
* @param int $page 第几页
* @param int $limit 限制读取的数目,默认10
* @return array|mixed 处理之后的收藏的商品数据
*/
public
static
function
getFavProductData
(
$uid
)
public
static
function
getFavProductData
(
$uid
,
$page
,
$limit
)
{
$result
=
array
();
// 调用接口获取用户收藏的商品数据
$favProduct
=
UserData
::
favoriteProductData
(
$uid
);
$favProduct
=
UserData
::
favoriteProductData
(
$uid
,
$page
,
$limit
);
// 处理用户收藏的商品数据
if
(
isset
(
$favProduct
[
'data'
])
&&
!
empty
(
$favProduct
[
'data'
]))
{
...
...
Please
register
or
login
to post a comment