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
Plain Diff
Browse Files
Authored by
hf
10 years ago
Commit
92debe37d707643b52a8e1726f1e4be7389d250c
2 parents
719a3b0c
d0d754b9
fixes bug to version 0.0.3
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
60 additions
and
103 deletions
library/LibModels/Wap/Product/NewsaleData.php
library/Plugin/DataProcess/ListProcess.php
library/Plugin/DataProcess/NewSaleProcess.php
static/sass/home/_floor-header.scss
static/sass/home/_goods-category.scss
static/sass/home/_maybe-like.scss
template/m.yohobuy.com/actions/product/newsale/new.phtml
template/m.yohobuy.com/actions/product/newsale/sale.phtml
template/m.yohobuy.com/partials/home/floor_header_more.phtml
yohobuy/m.yohobuy.com/application/models/Product/Newsale.php
yohobuy/m.yohobuy.com/application/modules/Product/controllers/Newsale.php
library/LibModels/Wap/Product/NewsaleData.php
View file @
92debe3
...
...
@@ -56,25 +56,10 @@ class NewsaleData
$param
[
'limit'
]
=
$limit
;
$param
[
'yh_channel'
]
=
$channel
;
$build
=
$param
;
$build
[
'dayLimit'
]
=
1
;
$build
[
'client_secret'
]
=
Sign
::
getSign
(
$build
);
$urlList
[
'new'
]
=
Yohobuy
::
httpBuildQuery
(
Yohobuy
::
API_URL
,
$build
);
$build
=
$param
;
$build
[
'dayLimit'
]
=
2
;
$build
[
'client_secret'
]
=
Sign
::
getSign
(
$build
);
$urlList
[
'week'
]
=
Yohobuy
::
httpBuildQuery
(
Yohobuy
::
API_URL
,
$build
);
$build
=
$param
;
$build
[
'dayLimit'
]
=
3
;
$build
[
'client_secret'
]
=
Sign
::
getSign
(
$build
);
$urlList
[
'sale'
]
=
Yohobuy
::
httpBuildQuery
(
Yohobuy
::
API_URL
,
$build
);
$build
=
array
();
$param
=
array
();
$param
[
'dayLimit'
]
=
1
;
$param
[
'client_secret'
]
=
Sign
::
getSign
(
$param
);
return
Yohobuy
::
get
Multi
(
$urlList
);
return
Yohobuy
::
get
(
Yohobuy
::
API_URL
,
$param
);
}
/**
...
...
@@ -147,13 +132,10 @@ class NewsaleData
$param
[
'limit'
]
=
$limit
;
$param
[
'yh_channel'
]
=
$channel
;
// 构建url地址列表
$urlList
=
array
();
$param
[
'p_d'
]
=
'0.1,0.9'
;
$param
[
'client_secret'
]
=
Sign
::
getSign
(
$param
);
$urlList
[
'ALL'
]
=
Yohobuy
::
httpBuildQuery
(
Yohobuy
::
API_URL
,
$param
);
return
Yohobuy
::
get
Multi
(
$urlList
);
return
Yohobuy
::
get
(
Yohobuy
::
API_URL
,
$param
);
}
/**
...
...
library/Plugin/DataProcess/ListProcess.php
View file @
92debe3
...
...
@@ -198,7 +198,7 @@ class ListProcess
$result
=
array
(
'title'
=>
'品类'
,
'name'
=>
'所有品类'
,
'dataType'
=>
'
m
sort'
,
'dataType'
=>
'sort'
,
'subs'
=>
array
(
array
(
'chosed'
=>
true
,
...
...
library/Plugin/DataProcess/NewSaleProcess.php
View file @
92debe3
...
...
@@ -20,50 +20,32 @@ class NewSaleProcess
public
static
function
newSaleData
(
$products
)
{
$result
=
array
();
$noTab
=
true
;
$productsLi
=
array
();
$tabItem
=
array
();
foreach
(
$products
as
$single
)
{
if
(
empty
(
$single
))
{
continue
;
}
// 处理Filter
if
(
isset
(
$single
[
'filter'
]))
{
$result
[
'filter'
]
=
ListProcess
::
getFilterData
(
$single
[
'filter'
]);
}
// 处理Tabs
$noTab
=
true
;
if
(
isset
(
$single
[
'tabs'
])
&&
$noTab
)
{
$result
[
'tabs'
]
=
array
();
foreach
(
$single
[
'tabs'
]
as
$key
=>
$one
)
{
$tabItem
=
array
();
$tabItem
[
'title'
]
=
$one
;
$tabItem
[
'dataId'
]
=
$key
;
if
(
$key
===
1
)
{
$tabItem
[
'focus'
]
=
true
;
}
$result
[
'tabs'
][]
=
$tabItem
;
// 处理Tabs
if
(
isset
(
$products
[
'tabs'
]))
{
$result
[
'tabs'
]
=
array
();
foreach
(
$products
[
'tabs'
]
as
$key
=>
$one
)
{
$tabItem
=
array
();
$tabItem
[
'title'
]
=
$one
;
$tabItem
[
'dataId'
]
=
$key
;
if
(
$key
===
1
)
{
$tabItem
[
'focus'
]
=
true
;
}
$
noTab
=
false
;
$
result
[
'tabs'
][]
=
$tabItem
;
}
}
// 处理商品
$productsLi
=
array
();
if
(
isset
(
$single
[
'product_list'
]))
{
foreach
(
$single
[
'product_list'
]
as
$value
)
{
$productsLi
[
'goods'
][]
=
Helpers
::
formatProduct
(
$value
,
true
,
false
,
false
);
}
}
// 处理Filter
if
(
isset
(
$products
[
'filter'
]))
{
$result
[
'filter'
]
=
ListProcess
::
getFilterData
(
$products
[
'filter'
]);
}
// 对于第一个productsLi添加show字段
if
(
!
isset
(
$result
[
'goodsContainer'
][
0
]))
{
$productsLi
[
'show'
]
=
true
;
}
// 处理商品
if
(
isset
(
$products
[
'product_list'
]))
{
foreach
(
$products
[
'product_list'
]
as
$single
)
{
$result
[
'goodsContainer'
][]
=
$productsLi
;
$result
[
'goods'
][]
=
Helpers
::
formatProduct
(
$single
,
true
,
false
,
false
);
}
}
return
$result
;
...
...
static/sass/home/_floor-header.scss
View file @
92debe3
...
...
@@ -22,9 +22,10 @@
color
:
#444
;
.more-btn
{
position
:
absolute
;
right
:
30rem
/
$pxConvertR
em
;
right
:
0
.75r
em
;
top
:
0
;
bottom
:
0
;
color
:
#b0b0b0
;
font-size
:
1
.25rem
;
}
}
\ No newline at end of file
...
...
static/sass/home/_goods-category.scss
View file @
92debe3
...
...
@@ -40,11 +40,12 @@
.goods-category
.category-list
{
background
:
#f5f7f6
;
height
:
383rem
/
$pxConvertRem
;
border-bottom
:
1px
solid
#e0e0e0
;
overflow
:
hidden
;
li
{
float
:
left
;
width
:
191rem
/
$pxConvertRem
;
height
:
181rem
/
$pxConvertRem
;
height
:
191rem
/
$pxConvertRem
;
border-left
:
1px
solid
#e0e0e0
;
.first-show
{
...
...
static/sass/home/_maybe-like.scss
View file @
92debe3
...
...
@@ -41,7 +41,7 @@
}
.load-more-info
{
width
:
100%
;
height
:
5
70rem
/
$pxConvertRem
;
height
:
70rem
/
$pxConvertRem
;
line-height
:
70rem
/
$pxConvertRem
;
text-align
:
center
;
font-size
:
14px
;
...
...
template/m.yohobuy.com/actions/product/newsale/new.phtml
View file @
92debe3
...
...
@@ -28,18 +28,13 @@
</ul>
<div
id=
"goods-container"
class=
"goods-container"
>
{
{#
goodsContainer
}
}
<div
class=
"new-goods container clearfix"
>
{
{#if
goods
}
}
{
{#
goods
}
}
{
{>
good
}
}
{
{/
goods
}
}
{
{^
}
}
<p
class=
"no-result"
>未找到相关搜索结果</p>
{
{/if
}
}
</div>
{
{/
goodsContainer
}
}
<div
class=
"container clearfix"
>
{
{#
goods
}
}
{
{>
good
}
}
{
{/
goods
}
}
</div>
<div
class=
"container hide clearfix"
></div>
<div
class=
"container hide clearfix"
></div>
{
{>
filter
}
}
</div>
...
...
template/m.yohobuy.com/actions/product/newsale/sale.phtml
View file @
92debe3
...
...
@@ -38,19 +38,13 @@
</ul>
<div
id=
"goods-container"
class=
"goods-container"
>
{
{#
goodsContainer
}
}
<div
class=
"new-goods container clearfix"
>
{
{#if
goods
}
}
{
{#
goods
}
}
{
{>
good
}
}
{
{/
goods
}
}
{
{^
}
}
<p
class=
"no-result"
>未找到相关搜索结果</p>
{
{/if
}
}
</div>
<div
class=
"price-goods container hide clearfix"
></div>
<div
class=
"discount-goods container hide clearfix"
></div>
{
{/
goodsContainer
}
}
<div
class=
"new-goods container clearfix"
>
{
{#
goods
}
}
{
{>
good
}
}
{
{/
goods
}
}
</div>
<div
class=
"price-goods container hide clearfix"
></div>
<div
class=
"discount-goods container hide clearfix"
></div>
{
{>
filter
}
}
</div>
...
...
template/m.yohobuy.com/partials/home/floor_header_more.phtml
View file @
92debe3
{
{#
title
}
}
<div
class=
"floor-header-more"
>
<h
2
>
{
{title
}
}</h
2
>
<a
class=
"more-btn iconfont"
href=
"{{more_url}}"
>
{
{more_name
}
}
</a>
<a
class=
"more-btn iconfont"
href=
"{{more_url}}"
>

618
;
</a>
</div>
{
{/
title
}
}
\ No newline at end of file
...
...
yohobuy/m.yohobuy.com/application/models/Product/Newsale.php
View file @
92debe3
...
...
@@ -118,8 +118,8 @@ class NewsaleModel
}
/* 格式化商品数据 */
if
(
!
empty
(
$products
))
{
$result
=
NewSaleProcess
::
newSaleData
(
$products
);
if
(
isset
(
$products
[
'code'
])
&&
$products
[
'code'
]
==
200
)
{
$result
=
NewSaleProcess
::
newSaleData
(
$products
[
'data'
]);
}
return
$result
;
...
...
@@ -155,8 +155,8 @@ class NewsaleModel
}
/* 格式化商品数据 */
if
(
!
empty
(
$products
))
{
$result
=
NewSaleProcess
::
newSaleData
(
$products
);
if
(
isset
(
$products
[
'code'
])
&&
$products
[
'code'
]
==
200
)
{
$result
=
NewSaleProcess
::
newSaleData
(
$products
[
'data'
]);
}
return
$result
;
...
...
@@ -171,6 +171,8 @@ class NewsaleModel
*/
private
static
function
cacheControl
(
$cacheKey
,
$codeKey
)
{
$result
=
array
();
if
(
USE_CACHE
)
{
// 先尝试获取一级缓存(master), 有数据则直接返回.
$result
=
Cache
::
get
(
$cacheKey
,
'master'
);
...
...
yohobuy/m.yohobuy.com/application/modules/Product/controllers/Newsale.php
View file @
92debe3
...
...
@@ -32,11 +32,11 @@ class NewsaleController extends AbstractAction
}
// 设置一些筛选的默认参数
$data
+=
array
(
'brand'
=>
0
,
'sort'
=>
0
,
'brand'
=>
'0'
,
'sort'
=>
'0'
,
'gender'
=>
Helpers
::
getGenderByCookie
(),
'price'
=>
0
,
'size'
=>
0
,
'price'
=>
'0'
,
'size'
=>
'0'
,
'dayLimit'
=>
1
,
'discount'
=>
''
);
...
...
@@ -65,11 +65,11 @@ class NewsaleController extends AbstractAction
}
// 设置一些筛选的默认参数
$data
+=
array
(
'brand'
=>
0
,
'sort'
=>
0
,
'brand'
=>
'0'
,
'sort'
=>
'0'
,
'gender'
=>
Helpers
::
getGenderByCookie
(),
'price'
=>
0
,
'size'
=>
0
,
'price'
=>
'0'
,
'size'
=>
'0'
,
'discount'
=>
'0.1,0.9'
);
...
...
Please
register
or
login
to post a comment