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
Email Patches
Plain Diff
Browse Files
Authored by
郝肖肖
9 years ago
Commit
06cb4f6c2d867017c2d208707243444d8500bb18
1 parent
f8d4835b
基础模板 水牌位
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
68 additions
and
3 deletions
template/www.yohobuy.com/partials/product/left-content.phtml
web-static/sass/product/_list.css
yohobuy/www.yohobuy.com/application/models/Product/Shop.php
yohobuy/www.yohobuy.com/application/modules/Product/controllers/Index.php
template/www.yohobuy.com/partials/product/left-content.phtml
View file @
06cb4f6
...
...
@@ -114,3 +114,17 @@
{
{#if
node
}
}
<div
id=
"brand-card"
class=
"brand-card"
data-node=
"{{node}}"
></div>
{
{/if
}
}
{
{!--
水牌广告-基础模板
--
}
}
{
{#signboard
}
}
<div
class=
"sell-signboard left-modular"
>
<h
2
class=
"title"
>
{
{title
}
}</h
2
>
<ul
class=
"left-list"
>
{
{#each
list
}
}
<li>
<a
target=
"_blank"
href=
"{{url}}"
><img
src=
"{{img}}"
alt=
"{{title}}"
/></a>
</li>
{
{/each
}
}
</ul>
</div>
{
{/signboard
}
}
...
...
web-static/sass/product/_list.css
View file @
06cb4f6
...
...
@@ -108,6 +108,19 @@
}
}
}
.sell-signboard
{
.left-list
li
{
padding-left
:
0
;
height
:
auto
;
margin-bottom
:
10px
;
line-height
:
inherit
;
img
{
width
:
100%
;
}
}
}
}
.min-screen
.product-list-page
.sort-intro
{
...
...
yohobuy/www.yohobuy.com/application/models/Product/Shop.php
View file @
06cb4f6
...
...
@@ -562,10 +562,36 @@ class ShopModel
return
$result
;
}
/**
* 基础模板
* @param type int $shopId 店铺id
* @return type []
*/
public
static
function
basisTemplate
(
$shopId
)
{
$result
=
array
();
$shopData
=
ShopData
::
shopsDecoratorList
(
$shopId
);
$data
=
array
(
'signboard'
=>
array
());
$parameters
[
'shopId'
]
=
$shopId
;
$shopList
=
ShopData
::
shopsDecoratorList
(
$shopId
);
if
(
isset
(
$shopList
[
'data'
][
'list'
])
&&
$shopList
[
'code'
]
===
200
)
{
foreach
(
$shopList
[
'data'
][
'list'
]
as
$list
)
{
$fun
=
$list
[
'resource_name'
];
if
(
is_callable
(
"self::
$fun
"
))
{
$list
=
self
::
$fun
(
self
::
getResourceData
(
$list
),
$parameters
);
switch
(
$fun
)
{
case
'shopTopBanner'
:
$data
[
$fun
]
=
$list
;
break
;
case
'signboard'
:
$data
[
$fun
]
=
array
(
'title'
=>
isset
(
$list
[
0
][
'title'
])
?
$list
[
0
][
'title'
]
:
''
,
'list'
=>
$list
);
break
;
}
}
}
}
return
$data
;
}
/**
...
...
yohobuy/www.yohobuy.com/application/modules/Product/controllers/Index.php
View file @
06cb4f6
...
...
@@ -27,7 +27,7 @@ class IndexController extends WebAction
if
(
!
$result
)
{
$this
->
go
(
SITE_MAIN
);
}
$type
=
intval
(
isset
(
$result
[
'type'
])
?
$result
[
'type'
]
:
''
);
switch
(
$type
)
{
case
1
:
...
...
@@ -47,6 +47,16 @@ class IndexController extends WebAction
$this
->
shopHome
(
$result
[
'shopId'
]);
exit
(
0
);
}
//基础模板
if
(
$result
[
'shopTemplateType'
]
===
1
&&
!
empty
(
$result
[
'shopId'
]))
{
$basisData
=
ShopModel
::
basisTemplate
(
$result
[
'shopId'
]);
$result
[
'brandBanner'
]
=
empty
(
$basisData
[
'shopTopBanner'
][
'banner'
])
?
$result
[
'brandBanner'
]
:
$basisData
[
'shopTopBanner'
][
'banner'
];
$result
[
'signboard'
]
=
$basisData
[
'signboard'
];
if
(
isset
(
$result
[
'node'
]))
{
unset
(
$result
[
'node'
]);
}
}
break
;
}
...
...
@@ -81,6 +91,8 @@ class IndexController extends WebAction
//调用模型获得品牌页数据
$data
=
BrandsModel
::
getBrandSearchData
(
$condition
,
$options
);
//水牌位
$data
[
'signboard'
]
=
isset
(
$result
[
'signboard'
])
?
$result
[
'signboard'
]
:
''
;
$seo
=
$data
[
'seo'
];
$data
=
array
(
//初始化js
...
...
Please
register
or
login
to post a comment