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
毕凯
9 years ago
Commit
3c615929431d63ff431ee8d32b13327b5cc3e5a3
2 parents
20d849ed
80ea5de3
Merge branch 'develop' of
http://git.dev.yoho.cn/web/yohobuy
into develop
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
97 additions
and
24 deletions
docs/data-structure.md
library/LibModels/Wap/Home/IndexData.php
static/sass/index/_index.scss
template/m.yohobuy.com/actions/index/index/index.phtml
yohobuy/m.yohobuy.com/application/controllers/Index.php
yohobuy/m.yohobuy.com/application/models/Index/Home.php
docs/data-structure.md
View file @
3c61592
...
...
@@ -817,7 +817,7 @@
},
...
],
totalNum: 20
}
...
...
@@ -1262,7 +1262,7 @@
name: '黄色',
colorNum:10,
sizeNumStr:'10/20/30' //对应的商品尺码数目,用斜杠分割
},
...
],
...
...
@@ -1283,7 +1283,7 @@
'id' : '',
'preferenceUrl' :'',
}
### 评价列表页面
### 评价列表页面
{
'comments':{
'list' :
[
...
...
@@ -1375,5 +1375,7 @@
'entitle' : 'LIFESTYLE',
}
],
'showYohood' : true/false
'showYohood' : true/false,
'yohoodHref' : '/yohood'
}
...
...
library/LibModels/Wap/Home/IndexData.php
View file @
3c61592
...
...
@@ -67,5 +67,17 @@ class IndexData
return
Yohobuy
::
get
(
Yohobuy
::
SERVICE_URL
.
'operations/api/v5/resource/home'
,
$param
);
}
/**
* 获取频道选择页数据
*
* @return array
*/
public
static
function
channelData
()
{
$param
=
Yohobuy
::
param
();
$param
[
'client_secret'
]
=
Sign
::
getSign
(
$param
);
return
Yohobuy
::
get
(
Yohobuy
::
SERVICE_URL
.
'operations/api/v5/entrance/getEntrance'
,
$param
,
3600
);
}
}
...
...
static/sass/index/_index.scss
View file @
3c61592
...
...
@@ -2,6 +2,16 @@
width
:
100%
;
overflow
:
hidden
;
margin
:
0
auto
;
#yohood
{
background-color
:
transparent
;
background-image
:
image-url
(
'yohood.png'
);
background-size
:
40%
;
background-repeat
:
no-repeat
;
background-position-x
:
26%
;
background-position-y
:
36%
;
border
:
none
;
border-bottom
:
4px
solid
#fff
;
}
.index-header
{
box-sizing
:
border-box
;
padding
:
0
20rem
/
$pxConvertRem
;
...
...
template/m.yohobuy.com/actions/index/index/index.phtml
View file @
3c61592
...
...
@@ -23,7 +23,7 @@
<a
href=
"{{href}}"
class=
"list-item"
>
{
{title
}
}
<span
class=
"lighter"
>
{
{entitle
}
}</span>
<span
class=
"iconfont right-icon"
>
614
;</span></a>
{
{/channelList
}
}
{
{#showYohood
}
}
<a
href=
"
/yohood
"
id=
"yohood"
class=
"list-item"
>
<span
class=
"iconfont right-icon"
>
614
;</span></a>
<a
href=
"
{{yohoodHref}}
"
id=
"yohood"
class=
"list-item"
>
<span
class=
"iconfont right-icon"
>
614
;</span></a>
{
{/showYohood
}
}
</div>
</div>
...
...
yohobuy/m.yohobuy.com/application/controllers/Index.php
View file @
3c61592
...
...
@@ -23,16 +23,16 @@ class IndexController extends AbstractAction
// 设置浏览器缓存5分钟
$this
->
setExpires
(
300
);
}
$result
=
Index\HomeModel
::
getChannel
();
$result
[
'background'
]
=
Index\HomeModel
::
getBgImage
();
$result
[
'channelPage'
]
=
true
;
$result
[
'showDownloadApp'
]
=
true
;
$result
[
'searchUrl'
]
=
Helpers
::
url
(
''
,
null
,
'search'
);
$result
[
'pageFooter'
]
=
true
;
// 渲染模板
$this
->
_view
->
display
(
'index'
,
array
(
'background'
=>
Index\HomeModel
::
getBgImage
(),
'channelPage'
=>
true
,
'showDownloadApp'
=>
true
,
'searchUrl'
=>
Helpers
::
url
(
''
,
null
,
'search'
),
'pageFooter'
=>
true
,
));
$this
->
_view
->
display
(
'index'
,
$result
);
}
/**
* 设置升级公告路由
*
...
...
yohobuy/m.yohobuy.com/application/models/Index/Home.php
View file @
3c61592
...
...
@@ -10,7 +10,7 @@ use Configs\CacheConfig;
/**
* 首页相关的模板数据模型
*
*
* @name HomeModel
* @package models
* @copyright yoho.inc
...
...
@@ -52,7 +52,7 @@ class HomeModel
/**
* 选择频道
*
*
* @return void
*/
public
static
function
goSwitchChannel
()
...
...
@@ -70,7 +70,7 @@ class HomeModel
/**
* 设置选择的频道保存到浏览器COOKIE
*
*
* @param string $cookie
* @return void
*/
...
...
@@ -81,7 +81,7 @@ class HomeModel
/**
* 获取频道选择页的背景图片
*
*
* @return string | false
*/
public
static
function
getBgImage
()
...
...
@@ -122,7 +122,7 @@ class HomeModel
/**
* 获取男生,女生底部banner
*
*
* @return string | false
*/
public
static
function
getBottomBanner
(
$channel
)
...
...
@@ -164,7 +164,7 @@ class HomeModel
}
// 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存
else
{
Cache
::
set
(
$cache
,
$result
);
Cache
::
set
(
$cache
,
$result
);
}
}
...
...
@@ -173,7 +173,7 @@ class HomeModel
/**
* 获取男生首页的楼层数据
*
*
* @return array | false
*/
public
static
function
getBoysFloor
()
...
...
@@ -204,13 +204,13 @@ class HomeModel
Cache
::
set
(
CacheConfig
::
KEY_ACTION_BOYS_INDEX
,
$result
);
}
}
return
$result
;
}
/**
* 获取女生首页的楼层数据
*
*
* @return array | false
*/
public
static
function
getGirlsFloor
()
...
...
@@ -247,7 +247,7 @@ class HomeModel
/**
* 获取潮童首页的楼层数据
*
*
* @return array | false
*/
public
static
function
getKidsFloor
()
...
...
@@ -284,7 +284,7 @@ class HomeModel
/**
* 获取创意生活首页的楼层数据
*
*
* @return array | false
*/
public
static
function
getLifestyleFloor
()
...
...
@@ -319,4 +319,53 @@ class HomeModel
return
$result
;
}
/**
* 获取频道选择页数据
*
* @return array
*/
public
static
function
getChannel
(){
$result
=
array
();
$result
[
'showYohood'
]
=
false
;
$data
=
IndexData
::
channelData
();
$channelList
=
array
();
if
(
isset
(
$data
[
'data'
][
'list'
])){
foreach
(
$data
[
'data'
][
'list'
]
as
$key
=>
$value
){
switch
(
$value
[
'channel_id'
])
{
case
5
:
$result
[
'showYohood'
]
=
true
;
$result
[
'yohoodHref'
]
=
'/yohood'
;
break
;
case
1
:
$channelList
[
$key
][
'href'
]
=
'/boys'
;
$channelList
[
$key
][
'title'
]
=
'男生'
;
$channelList
[
$key
][
'entitle'
]
=
'BOYS'
;
break
;
case
2
:
$channelList
[
$key
][
'href'
]
=
'/girls'
;
$channelList
[
$key
][
'title'
]
=
'女生'
;
$channelList
[
$key
][
'entitle'
]
=
'GIRLS'
;
break
;
case
3
:
$channelList
[
$key
][
'href'
]
=
'/kids'
;
$channelList
[
$key
][
'title'
]
=
'潮童'
;
$channelList
[
$key
][
'entitle'
]
=
'KIDS'
;
break
;
case
4
:
$channelList
[
$key
][
'href'
]
=
'/lifestyle'
;
$channelList
[
$key
][
'title'
]
=
'创意生活'
;
$channelList
[
$key
][
'entitle'
]
=
'LIFESTYLE'
;
break
;
default
:
break
;
}
}
$result
[
'channelList'
]
=
$channelList
;
}
return
$result
;
}
}
...
...
Please
register
or
login
to post a comment