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
Email Patches
Plain Diff
Browse Files
Authored by
周少峰
9 years ago
Commit
1698b0d960f8f6de86d521436ebe24bfa540e48d
1 parent
44eaae60
shop base template ,add getResizeImgurl
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
11 deletions
library/Plugin/DataProcess/ShopProcess.php
library/Plugin/Images.php
yohobuy/m.yohobuy.com/application/models/Product/List.php
yohobuy/m.yohobuy.com/application/modules/Product/controllers/Index.php
library/Plugin/DataProcess/ShopProcess.php
View file @
1698b0d
...
...
@@ -107,7 +107,7 @@ class ShopProcess
*/
private
static
function
shopTopBanner_APP
(
$data
)
{
self
::
$shopData
[
'branerImg'
]
=
Images
::
get
ImageUrl
(
$data
[
0
][
'shopSrc'
],
640
,
200
);
self
::
$shopData
[
'branerImg'
]
=
Images
::
get
ResizeImagesUrl
(
$data
[
0
][
'shopSrc'
],
640
,
200
,
1
);
}
/**
...
...
library/Plugin/Images.php
View file @
1698b0d
...
...
@@ -75,6 +75,19 @@ class Images
}
/**
* 获取图片地址
* @param $fileName http://img13.static.yhbimg.com/yhb-img02/2016/06/01/19/02878f3a909f5c468a1445210b38a9512f.jpg
* @param $width
* @param $height
* @param int $mode
* @return mixed
*/
public
static
function
getResizeImagesUrl
(
$fileName
,
$width
,
$height
,
$mode
=
2
)
{
$fileName
=
self
::
MakeTemplateRequest
(
$fileName
);
return
self
::
getImageUrl
(
$fileName
,
$width
,
$height
,
$mode
=
2
);
}
/**
* 获取图片URL模板
* @param $fileName
* @param int $mode
...
...
yohobuy/m.yohobuy.com/application/models/Product/List.php
View file @
1698b0d
...
...
@@ -419,6 +419,10 @@ class ListModel
$data
[
'decorator'
]
=
ListData
::
getShopDecorator
(
$shopId
);
//店铺信息
$data
[
'shopInfo'
]
=
ListData
::
getShopInfo
(
$shopId
,
$uid
);
//店铺使用基础模板,返回品牌页面
if
(
isset
(
$data
[
'shopInfo'
][
'data'
][
'shop_template_type'
])
&&
$data
[
'shopInfo'
][
'data'
][
'shop_template_type'
]
===
1
)
{
return
array
(
'goBrand'
=>
true
);
}
//店铺分类
$channel
=
Helpers
::
getChannelByCookie
();
$data
[
'shopCategory'
]
=
ListData
::
getShopCategory
(
$shopId
,
$channel
);
...
...
yohobuy/m.yohobuy.com/application/modules/Product/controllers/Index.php
View file @
1698b0d
...
...
@@ -128,21 +128,25 @@ class IndexController extends AbstractAction
//如果是app 或者多品店,可直接获取shopId
$appShopId
=
$this
->
get
(
'shop_id'
);
if
(
!
empty
(
$appShopId
))
{
$this
->
shop
(
$appShopId
);
exit
;
}
/* 品牌域名参数 @see Bootstrap.php */
$domain
=
$this
->
param
(
'named'
);
if
(
empty
(
$domain
))
{
$this
->
go
(
SITE_MAIN
);
// 如果店铺使用基础模板返回 true
if
(
!
$this
->
shop
(
$appShopId
)){
exit
;
}
}
else
{
/* 品牌域名参数 @see Bootstrap.php */
$domain
=
$this
->
param
(
'named'
);
if
(
empty
(
$domain
))
{
$this
->
go
(
SITE_MAIN
);
}
$brandLogo
=
Product\ListModel
::
getBrandLogoByDomain
(
$domain
,
$title
);
}
// 当前的登录用户UID
$uid
=
$this
->
getUid
();
// 存标题信息
$title
=
''
;
$brandLogo
=
Product\ListModel
::
getBrandLogoByDomain
(
$domain
,
$title
);
//如果店铺使用基础模板TODO
//如果店铺使用基础模板
TODO
$baseBanner
=
ListModel
::
getShopBaseBanner
(
$brandLogo
[
'shopId'
]);
//无店铺:0--->品牌页 无单品店有多品店:1--->搜索页 有单品店:2--->店铺页面
...
...
@@ -461,9 +465,10 @@ class IndexController extends AbstractAction
}
/**
* 店铺首页
* 店铺首页
|| 若店铺使用基础模板跳转品牌页
* @param int $shopId
* @author sefon 2016-4-26 20:50:58
* @return int
*/
private
function
shop
(
$shopId
)
{
...
...
@@ -479,6 +484,9 @@ class IndexController extends AbstractAction
$this
->
setCookie
(
'appUid'
,
$uid
);
}
$data
=
ListModel
::
shopData
(
$shopId
,
$uid
,
$appVersion
);
if
(
$data
[
'goBrand'
])
{
return
true
;
}
$this
->
_view
->
display
(
'shop'
,
array
(
'shopIndex'
=>
$data
,
'shopPage'
=>
array
(
...
...
Please
register
or
login
to post a comment