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
郝肖肖
9 years ago
Commit
cc64a3276959d4e024f6a5818e11bf3e664f92ff
2 parents
d42d6614
8f2ee4c3
merage plusstar
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
84 additions
and
59 deletions
static/dist/myohobuy/5.0.2/index.css
static/dist/myohobuy/5.0.2/shop.css
static/js/guang/plus-star/list.js
static/sass/guang/_plus-star.css
template/m.yohobuy.com/actions/guang/plusstar/list.phtml
yohobuy/m.yohobuy.com/application/models/Guang/Plusstar.php
yohobuy/m.yohobuy.com/application/modules/Guang/controllers/Plusstar.php
static/dist/myohobuy/5.0.2/index.css
View file @
cc64a32
This diff could not be displayed because it is too large.
static/dist/myohobuy/5.0.2/shop.css
View file @
cc64a32
This diff could not be displayed because it is too large.
static/js/guang/plus-star/list.js
View file @
cc64a32
...
...
@@ -15,18 +15,10 @@ var mySwiper;
lazyLoad
(
$
(
'img.lazy'
));
$
(
'.star-content li'
).
each
(
function
(
key
,
item
)
{
$
(
item
).
find
(
'.swiper-container'
).
addClass
(
'swiper-'
+
key
);
mySwiper
=
new
Swiper
(
'.swiper-'
+
key
,
{
lazyLoading
:
true
,
pagination
:
'.swiper-'
+
key
+
' .pagination-inner'
});
});
$
(
'#nav-tab'
).
bind
(
'contextmenu'
,
function
(
e
)
{
return
false
;
});
$
(
'#nav-tab'
).
on
(
'touchend touchcancel'
,
function
(
e
)
{
var
$this
=
$
(
e
.
target
).
closest
(
'li'
);
...
...
@@ -34,11 +26,32 @@ $('#nav-tab').on('touchend touchcancel', function(e) {
return
;
}
$navs
.
toggleClass
(
'focus'
);
$contents
.
toggleClass
(
'hide'
);
$navs
.
removeClass
(
'focus'
);
$this
.
addClass
(
'focus'
);
$contents
.
addClass
(
'hide'
);
$contents
.
eq
(
$this
.
index
()).
removeClass
(
'hide'
);
if
(
typeof
$this
.
swiper
===
'undefined'
)
{
//解决隐藏式,swiper不渲染
$this
.
swiper
=
false
;
$contents
.
find
(
'li'
).
each
(
function
(
key
,
item
)
{
$
(
item
).
find
(
'.swiper-container'
).
addClass
(
'swiper-'
+
key
);
mySwiper
=
new
Swiper
(
'.swiper-'
+
key
,
{
lazyLoading
:
true
,
pagination
:
'.swiper-'
+
key
+
' .pagination-inner'
});
});
}
$
(
document
).
trigger
(
'scroll'
);
//Trigger lazyLoad
});
if
(
$
(
'#nav-tab'
).
find
(
'li:eq(0)'
).
hasClass
(
'focus'
))
{
//解决li隐藏 swiper不渲染的问题
$
(
'#nav-tab'
).
find
(
'li:eq(0)'
).
removeClass
(
'focus'
);
$
(
'#nav-tab'
).
find
(
'li:eq(0)'
).
trigger
(
'touchend'
);
}
$
(
'#nav-tab'
).
on
(
'touchstart'
,
function
(
e
)
{
var
target
=
e
.
target
||
e
.
srcElement
;
...
...
static/sass/guang/_plus-star.css
View file @
cc64a32
...
...
@@ -9,28 +9,31 @@
height
:
60px
;
padding
:
10px
0
;
background-color
:
#fff
;
}
.star-nav
,
.plus-nav
{
box-sizing
:
border-box
;
float
:
left
;
width
:
50%
;
height
:
60px
;
line-height
:
60px
;
font-size
:
16
PX
;
text-align
:
center
;
color
:
#ccc
;
li
{
box-sizing
:
border-box
;
float
:
left
;
width
:
50%
;
height
:
60px
;
line-height
:
60px
;
font-size
:
16
PX
;
text-align
:
center
;
color
:
#ccc
;
border-right
:
1px
solid
#ccc
;
&.focus
{
color
:
#000
;
&.focus
{
color
:
#000
;
}
&
:last-child
{
border-right
:
none
;
}
}
}
.bytouch
{
background
:
#eee
;
}
.star-nav
{
border-right
:
1px
solid
#ccc
;
}
.plus-star-row
{
margin-bottom
:
30px
;
...
...
template/m.yohobuy.com/actions/guang/plusstar/list.phtml
View file @
cc64a32
{
{>layout/header
}
}
<div
class=
"ps-list-page ps-page yoho-page"
>
{
{#
ps
}
}
{
{#
if
ps
}
}
<ul
id=
"nav-tab"
class=
"nav-tab clearfix"
>
<li
class=
"star-nav focus"
>
{
{sName
}
}</li>
<li
class=
"plus-nav"
>
{
{pName
}
}</li>
{
{#
ps
}
}
<li
{
{#if
focus
}
}
class=
"focus"
{
{/if
}
}
>
{
{name
}
}</li>
{
{/ps
}
}
</ul>
<div
id=
"ps-content"
class=
"ps-content"
>
<ul
class=
"star-content content"
>
{
{#
star
}
}
{
{>
guang/ps_item
}
}
{
{/
star
}
}
</ul>
<ul
class=
"plus-content content hide"
>
{
{#
plus
}
}
{
{>
guang/ps_item
}
}
{
{/
plus
}
}
</ul>
{
{#
ps
}
}
<ul
class=
"content{{#if focus}}{{^}} hide {{/if}}"
>
{
{#
list
}
}
{
{>
guang/ps_item
}
}
{
{/list
}
}
</ul>
{
{/ps
}
}
</div>
{
{/
ps
}
}
{
{/
if
}
}
</div>
{
{>layout/footer
}
}
\ No newline at end of file
...
...
yohobuy/m.yohobuy.com/application/models/Guang/Plusstar.php
View file @
cc64a32
...
...
@@ -42,7 +42,7 @@ class PlusstarModel
}
if
(
USE_CACHE
)
{
$key
=
CacheConfig
::
KEY_ACTION_GUANG_PLUSSTAR_INDEX
.
$channel
;
$key
=
CacheConfig
::
KEY_ACTION_GUANG_PLUSSTAR_INDEX
.
$channel
.
'k1'
;
// 先尝试获取一级缓存(master), 有数据则直接返回.
$result
=
Cache
::
get
(
$key
,
'master'
);
if
(
!
empty
(
$result
))
{
...
...
@@ -61,8 +61,20 @@ class PlusstarModel
return
$result
;
}
$result
[
'ps'
][
'star'
]
=
self
::
formatData
(
$brandList
[
'recom'
][
'data'
][
'list'
][
0
][
'data'
],
$gender
,
true
);
$result
[
'ps'
][
'plus'
]
=
self
::
formatData
(
$brandList
[
'all'
][
'data'
][
'list'
][
0
][
'data'
],
$gender
,
true
);
if
(
!
empty
(
$brandList
[
'recom'
][
'data'
][
'list'
][
0
][
'data'
]))
{
$result
[
'ps'
][]
=
array
(
'list'
=>
self
::
formatData
(
$brandList
[
'recom'
][
'data'
][
'list'
][
0
][
'data'
],
$gender
,
true
),
'focus'
=>
true
,
'name'
=>
'设计师'
,
);
}
if
(
!
empty
(
$brandList
[
'all'
][
'data'
][
'list'
][
0
][
'data'
]))
{
$result
[
'ps'
][]
=
array
(
'list'
=>
self
::
formatData
(
$brandList
[
'all'
][
'data'
][
'list'
][
0
][
'data'
],
$gender
,
true
),
'name'
=>
'经典潮牌'
,
);
}
// 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存
if
(
USE_CACHE
)
{
...
...
@@ -95,7 +107,7 @@ class PlusstarModel
}
if
(
USE_CACHE
)
{
$key
=
CacheConfig
::
KEY_ACTION_GUANG_PLUSSTAR_LIST
.
$channel
;
$key
=
CacheConfig
::
KEY_ACTION_GUANG_PLUSSTAR_LIST
.
$channel
.
'k1'
;
// 先尝试获取一级缓存(master), 有数据则直接返回.
$result
=
Cache
::
get
(
$key
,
'master'
);
if
(
!
empty
(
$result
))
{
...
...
@@ -104,14 +116,22 @@ class PlusstarModel
}
$result
=
array
();
$star
=
array
();
$brandList
=
PlusstarData
::
brandList
(
$gender
,
$channel
);
if
(
!
empty
(
$brandList
[
'star'
][
'data'
][
'list'
][
0
][
'data'
]))
{
$result
[
'ps'
][
'star'
]
=
self
::
formatData
(
$brandList
[
'star'
][
'data'
][
'list'
][
0
][
'data'
],
$gender
,
false
);
//$result['ps']['pName'] = isset($brandList['star']['data']['brand_type_name']) ? $brandList['star']['data']['brand_type_name'] : '';
}
if
(
!
empty
(
$brandList
[
'original'
][
'data'
][
'list'
][
0
][
'data'
]))
{
$result
[
'ps'
][
'plus'
]
=
self
::
formatData
(
$brandList
[
'original'
][
'data'
][
'list'
][
0
][
'data'
],
$gender
,
true
);
//$result['ps']['sName'] = isset($brandList['original']['data']['brand_type_name']) ? $brandList['original']['data']['brand_type_name'] : '';
$result
[
'ps'
][]
=
array
(
'list'
=>
self
::
formatData
(
$brandList
[
'original'
][
'data'
][
'list'
][
0
][
'data'
],
$gender
,
true
),
'focus'
=>
true
,
'name'
=>
'原创潮牌'
,
);
}
if
(
!
empty
(
$brandList
[
'star'
][
'data'
][
'list'
][
0
][
'data'
]))
{
$result
[
'ps'
][]
=
array
(
'list'
=>
self
::
formatData
(
$brandList
[
'star'
][
'data'
][
'list'
][
0
][
'data'
],
$gender
,
false
),
'name'
=>
'明星潮品'
,
);
}
if
(
USE_CACHE
)
{
...
...
yohobuy/m.yohobuy.com/application/modules/Guang/controllers/Plusstar.php
View file @
cc64a32
...
...
@@ -29,10 +29,7 @@ class PlusstarController extends AbstractAction
$data
=
Guang\PlusstarModel
::
getBrands
(
$gender
);
$data
[
'psList'
]
=
true
;
// 控制模板中的JS使用
$data
[
'ps'
][
'sName'
]
=
'明星潮品'
;
$data
[
'ps'
][
'pName'
]
=
'原创潮牌'
;
$data
[
'pageFooter'
]
=
true
;
$this
->
_view
->
display
(
'list'
,
$data
);
}
else
{
$this
->
setTitle
(
'国际优选'
);
...
...
@@ -40,8 +37,6 @@ class PlusstarController extends AbstractAction
$data
=
Guang\PlusstarModel
::
getFirstBrands
(
$gender
);
$data
[
'psList'
]
=
true
;
// 控制模板中的JS使用
$data
[
'ps'
][
'sName'
]
=
'设计师'
;
$data
[
'ps'
][
'pName'
]
=
'经典潮牌'
;
$data
[
'pageFooter'
]
=
true
;
$this
->
_view
->
display
(
'list'
,
$data
);
...
...
@@ -50,8 +45,6 @@ class PlusstarController extends AbstractAction
/**
* 明星原创-品牌列表页
*
* 备注:已不使用暂留着,可去掉
* @param int gender "1,3"表示男, "2,3"表示女
*/
public
function
listAction
()
...
...
@@ -63,8 +56,6 @@ class PlusstarController extends AbstractAction
$data
=
Guang\PlusstarModel
::
getBrands
(
$gender
);
$data
[
'psList'
]
=
true
;
// 控制模板中的JS使用
$data
[
'ps'
][
'sName'
]
=
'明星潮品'
;
$data
[
'ps'
][
'pName'
]
=
'原创潮牌'
;
$this
->
_view
->
display
(
'list'
,
$data
);
}
...
...
Please
register
or
login
to post a comment