Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy into develop
Showing
18 changed files
with
337 additions
and
341 deletions
@@ -296,17 +296,17 @@ class AbstractAction extends Controller_Abstract | @@ -296,17 +296,17 @@ class AbstractAction extends Controller_Abstract | ||
296 | /** | 296 | /** |
297 | * 设置网站导航头部信息 | 297 | * 设置网站导航头部信息 |
298 | * | 298 | * |
299 | - * @param string $backUrl 返回的链接 | ||
300 | * @param string $title 头部标题 | 299 | * @param string $title 头部标题 |
300 | + * @param string $backUrl 返回的链接 | ||
301 | * @param string $homeUrl 返回首页的链接 | 301 | * @param string $homeUrl 返回首页的链接 |
302 | * @return void | 302 | * @return void |
303 | */ | 303 | */ |
304 | - protected function setNavHeader($backUrl, $title, $homeUrl) | 304 | + protected function setNavHeader($title = '', $backUrl = true, $homeUrl = '/') |
305 | { | 305 | { |
306 | $header = array(); | 306 | $header = array(); |
307 | 307 | ||
308 | - if (!empty($backUrl)) { | ||
309 | - $header['navBack'] = $backUrl; | 308 | + if ($backUrl) { |
309 | + $header['navBack'] = true; | ||
310 | } | 310 | } |
311 | if (!empty($title)) { | 311 | if (!empty($title)) { |
312 | $header['navTitle'] = $title; | 312 | $header['navTitle'] = $title; |
@@ -16,12 +16,43 @@ use Api\Sign; | @@ -16,12 +16,43 @@ use Api\Sign; | ||
16 | */ | 16 | */ |
17 | class BrandData | 17 | class BrandData |
18 | { | 18 | { |
19 | + const URI_BRAND_TOPPOS = 'operations/api/v5/resource/get'; | ||
20 | + | ||
21 | + /** | ||
22 | + * 封装获取品牌一览页面的数据 | ||
23 | + * | ||
24 | + * @param string $contentCode 获取广告资源需要的位置码 | ||
25 | + * @param int $channel 频道标识 1:男,2:女,3:潮童,4:创意生活 | ||
26 | + * @return array( | ||
27 | + * "brandTop": "顶部的轮翻广告及热门品牌数据", | ||
28 | + * "brandList": "按字母'A-Z'分组的品牌列表数据" | ||
29 | + * ) | ||
30 | + * @author fei.hong <fei.hong@yoho.cn> | ||
31 | + */ | ||
32 | + public static function package($contentCode, $channel) | ||
33 | + { | ||
34 | + $urlList = array(); | ||
35 | + | ||
36 | + /* 顶部的轮翻广告及热门品牌数据 */ | ||
37 | + $param = Yohobuy::param(); | ||
38 | + $param['content_code'] = $contentCode; | ||
39 | + $param['client_secret'] = Sign::getSign($param); | ||
40 | + $urlList['brandTop'] = Yohobuy::httpBuildQuery(Yohobuy::SERVICE_URL . self::URI_BRAND_TOPPOS, $param); | ||
41 | + | ||
42 | + /* 按字母"A-Z"分组的品牌列表数据 */ | ||
43 | + $param = Yohobuy::param(); | ||
44 | + $param['method'] = 'app.brand.brandlist'; | ||
45 | + $param['yh_channel'] = $channel; | ||
46 | + $param['client_secret'] = Sign::getSign($param); | ||
47 | + $urlList['brandList'] = Yohobuy::httpBuildQuery(Yohobuy::API_URL, $param); | ||
48 | + | ||
49 | + return Yohobuy::getMulti($urlList); | ||
50 | + } | ||
19 | 51 | ||
20 | /** | 52 | /** |
21 | * 获取品牌数据 | 53 | * 获取品牌数据 |
22 | * | 54 | * |
23 | * @param integer $channel 是否,默认1表示是,传值为空是app中用于品牌搜索的数据 | 55 | * @param integer $channel 是否,默认1表示是,传值为空是app中用于品牌搜索的数据 |
24 | - * | ||
25 | * @return array 品牌数据 | 56 | * @return array 品牌数据 |
26 | */ | 57 | */ |
27 | public static function getBrandsData($channel = 1) | 58 | public static function getBrandsData($channel = 1) |
@@ -38,16 +69,17 @@ class BrandData | @@ -38,16 +69,17 @@ class BrandData | ||
38 | /** | 69 | /** |
39 | * 获取品牌页顶部楼层数据 | 70 | * 获取品牌页顶部楼层数据 |
40 | * | 71 | * |
72 | + * @param string $contentCode 位置码 | ||
41 | * @return array 品牌也顶部楼层数据 | 73 | * @return array 品牌也顶部楼层数据 |
42 | */ | 74 | */ |
43 | - public static function getBrandTopData() | 75 | + public static function getBrandTopData($contentCode) |
44 | { | 76 | { |
45 | // 构建必传参数 | 77 | // 构建必传参数 |
46 | $param = Yohobuy::param(); | 78 | $param = Yohobuy::param(); |
47 | - $param['content_code'] = 'ce6ac059493ec26241a8cbe0bfa1b17a'; | 79 | + $param['content_code'] = $contentCode; |
48 | $param['client_secret'] = Sign::getSign($param); | 80 | $param['client_secret'] = Sign::getSign($param); |
49 | 81 | ||
50 | - return Yohobuy::get(Yohobuy::SERVICE_URL . 'operations/api/v5/resource/get', $param); | 82 | + return Yohobuy::get(Yohobuy::SERVICE_URL . self::URI_BRAND_TOPPOS, $param); |
51 | } | 83 | } |
52 | 84 | ||
53 | /** | 85 | /** |
@@ -10,15 +10,26 @@ class Helpers | @@ -10,15 +10,26 @@ class Helpers | ||
10 | 10 | ||
11 | /** | 11 | /** |
12 | * 根据尺寸获得图片url | 12 | * 根据尺寸获得图片url |
13 | - * @param string $fileName 文件名 | 13 | + * @param string $url 路径 |
14 | * @param integer $width 图片宽度 | 14 | * @param integer $width 图片宽度 |
15 | * @param integer $height 图片高度 | 15 | * @param integer $height 图片高度 |
16 | * @param integer $mode 模式 | 16 | * @param integer $mode 模式 |
17 | * @return string 图片地址 | 17 | * @return string 图片地址 |
18 | */ | 18 | */ |
19 | - public static function getImageUrl($fileName, $width, $height, $mode = 2) | 19 | + public static function getImageUrl($url, $width, $height, $mode = 2) |
20 | { | 20 | { |
21 | - return strtr($fileName, array('{width}' => $width, '{height}' => $height, '{mode}' => $mode)); | 21 | + return strtr($url, array('{width}' => $width, '{height}' => $height, '{mode}' => $mode)); |
22 | + } | ||
23 | + | ||
24 | + /** | ||
25 | + * 获取过滤后的URL链接 | ||
26 | + * | ||
27 | + * @param string $url 路径 | ||
28 | + * @return string 去除掉如&openby:yohobuy={"action":"go.brand"}这样的APP附加参数 | ||
29 | + */ | ||
30 | + public static function getFilterUrl($url) | ||
31 | + { | ||
32 | + return strstr($url, '&openby:yohobuy=', true); | ||
22 | } | 33 | } |
23 | 34 | ||
24 | /** | 35 | /** |
1 | {{> layout/page_footer}} | 1 | {{> layout/page_footer}} |
2 | {{#if rlsEnv}} | 2 | {{#if rlsEnv}} |
3 | - <script src="http://static.wap.yohobuy.com/js/sea.js"></script> | ||
4 | - <script>seajs.config({base:'http://static.wap.yohobuy.com/'});</script> | 3 | +<script src="http://cdn.yoho.cn/myohobuy/{{version}}/lib.js"></script> |
4 | +<script src="http://cdn.yoho.cn/myohobuy/{{version}}/index.js"></script> | ||
5 | {{/if}} | 5 | {{/if}} |
6 | {{#if testEnv}} | 6 | {{#if testEnv}} |
7 | - <script src="http://cdn.yoho.cn/myohobuy/{{version}}/lib.js"></script> | ||
8 | - <script src="http://cdn.yoho.cn/myohobuy/{{version}}/index.js"></script> | 7 | +<script src="http://static.buy.test.yoho.cn/dist/myohobuy/{{version}}/lib.js"></script> |
8 | +<script src="http://static.buy.test.yoho.cn/dist/myohobuy/{{version}}/index.js"></script> | ||
9 | {{/if}} | 9 | {{/if}} |
10 | {{#if devEnv}} | 10 | {{#if devEnv}} |
11 | - <script src="http://localhost:8000/static/js/sea.js?nowrap"></script> | ||
12 | - <script> | ||
13 | - seajs.config({ | ||
14 | - base: 'http://localhost:8000/' | ||
15 | - }); | ||
16 | - </script> | 11 | +<script src="http://localhost:8000/static/js/sea.js?nowrap"></script> |
12 | +<script>seajs.config({base: 'http://localhost:8000/'});</script> | ||
17 | {{/if}} | 13 | {{/if}} |
18 | {{> layout/use}} | 14 | {{> layout/use}} |
19 | </body> | 15 | </body> |
1 | <!DOCTYPE html> | 1 | <!DOCTYPE html> |
2 | <html> | 2 | <html> |
3 | <head> | 3 | <head> |
4 | - <meta charset="utf-8"> | ||
5 | - <title>{{title}}YOHO!有货</title> | ||
6 | - <meta name="keywords" content="{{keywords}}Yoho! 有货官网,潮流志,潮流男装,潮牌,美国潮牌,日本潮牌,香港潮牌,潮牌店,新品首发,欧美潮流,全球购,代购,时尚,流行,特卖,B2C,正品,购物网站,网上购物,货到付款"> | ||
7 | - <meta name="description" content="{{description}}YOHO! 有货,年轻人潮流购物中心,中国最大的潮流商品购物网站。100%品牌正品保证,支持货到付款。作为YOHO!旗下的购物平台,汇集了全球潮流时尚商品和中国最流行的商品,也是国内最大的原创文化商品平台,也是香港,台湾地区流行商品的集中地。同时包含日本、韩国等众多国外潮流品牌,带给您全新潮流购物体验。"> | ||
8 | - <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"> | ||
9 | - <meta http-equiv="cleartype" content="on"> | ||
10 | - <meta name="apple-mobile-web-app-status-bar-style" content="black" /> | ||
11 | - <meta content="telephone=no" name="format-detection" /> | ||
12 | - <meta content="email=no" name="format-detection" /> | ||
13 | - <script type="text/javascript"> | ||
14 | - (function (doc, win) { | 4 | +<meta charset="utf-8"> |
5 | +<title>{{title}}YOHO!有货</title> | ||
6 | +<meta name="keywords" content="{{keywords}}Yoho! 有货官网,潮流志,潮流男装,潮牌,美国潮牌,日本潮牌,香港潮牌,潮牌店,新品首发,欧美潮流,全球购,代购,时尚,流行,特卖,B2C,正品,购物网站,网上购物,货到付款"> | ||
7 | +<meta name="description" content="{{description}}YOHO! 有货,年轻人潮流购物中心,中国最大的潮流商品购物网站。100%品牌正品保证,支持货到付款。作为YOHO!旗下的购物平台,汇集了全球潮流时尚商品和中国最流行的商品,也是国内最大的原创文化商品平台,也是香港,台湾地区流行商品的集中地。同时包含日本、韩国等众多国外潮流品牌,带给您全新潮流购物体验。"> | ||
8 | +<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"> | ||
9 | +<meta http-equiv="cleartype" content="on"> | ||
10 | +<meta name="apple-mobile-web-app-status-bar-style" content="black" /> | ||
11 | +<meta content="telephone=no" name="format-detection" /> | ||
12 | +<meta content="email=no" name="format-detection" /> | ||
13 | +<script type="text/javascript"> | ||
14 | + (function(doc, win) { | ||
15 | var docEl = doc.documentElement; | 15 | var docEl = doc.documentElement; |
16 | - (function () { | 16 | + (function() { |
17 | var clientWidth = docEl.clientWidth; | 17 | var clientWidth = docEl.clientWidth; |
18 | if (!clientWidth) { | 18 | if (!clientWidth) { |
19 | return; | 19 | return; |
@@ -21,16 +21,16 @@ | @@ -21,16 +21,16 @@ | ||
21 | docEl.style.fontSize = 20 * (clientWidth / 320) + 'px'; | 21 | docEl.style.fontSize = 20 * (clientWidth / 320) + 'px'; |
22 | }()); | 22 | }()); |
23 | })(document, window); | 23 | })(document, window); |
24 | - </script> | ||
25 | - {{#if rlsEnv}} | ||
26 | - <link rel="stylesheet" href="http://static.wap.yohobuy.com/css/index.css"> | ||
27 | - {{/if}} | ||
28 | - {{#if testEnv}} | ||
29 | - <link rel="stylesheet" href="http://cdn.yoho.cn/myohobuy/{{version}}/index.css"> | ||
30 | - {{/if}} | ||
31 | - {{#if devEnv}} | ||
32 | - <link rel="stylesheet" href="http://static.dev.yohobuy.com/css/index.css"> | ||
33 | - {{/if}} | 24 | +</script> |
25 | +{{#if rlsEnv}} | ||
26 | +<link rel="stylesheet" href="http://cdn.yoho.cn/myohobuy/{{version}}/index.css"> | ||
27 | +{{/if}} | ||
28 | +{{#if testEnv}} | ||
29 | +<link rel="stylesheet" href="http://static.buy.test.yoho.cn/dist/myohobuy/{{version}}/index.css"> | ||
30 | +{{/if}} | ||
31 | +{{#if devEnv}} | ||
32 | +<link rel="stylesheet" href="http://static.dev.yohobuy.com/css/index.css"> | ||
33 | +{{/if}} | ||
34 | </head> | 34 | </head> |
35 | <body {{#if isPassportPage}}class=passport-body{{/if}}> | 35 | <body {{#if isPassportPage}}class=passport-body{{/if}}> |
36 | -{{> layout/page_header}} | ||
36 | + {{> layout/page_header}} |
1 | {{#pageHeader}} | 1 | {{#pageHeader}} |
2 | - <header class="yoho-header"> | ||
3 | - {{#navBack}} | ||
4 | - <a href={{.}} class="nav-back"></a> | ||
5 | - {{/navBack}} | 2 | +<header class="yoho-header"> |
3 | + {{#if navBack}} | ||
4 | + <a href="javascript:history.go(-1);" class="nav-back"></a> | ||
5 | + {{/if}} | ||
6 | {{#navHome}} | 6 | {{#navHome}} |
7 | - <a href={{.}} class="nav-home"></a> | 7 | + <a href="{{.}}" class="nav-home"></a> |
8 | {{/navHome}} | 8 | {{/navHome}} |
9 | {{#navTitle}} | 9 | {{#navTitle}} |
10 | <p class="nav-title">{{.}}</p> | 10 | <p class="nav-title">{{.}}</p> |
11 | {{/navTitle}} | 11 | {{/navTitle}} |
12 | - </header> | 12 | +</header> |
13 | {{/pageHeader}} | 13 | {{/pageHeader}} |
1 | <script> | 1 | <script> |
2 | seajs.use('js/common'); | 2 | seajs.use('js/common'); |
3 | </script> | 3 | </script> |
4 | - | ||
5 | {{!-- 逛(PLUS+STAR) --}} | 4 | {{!-- 逛(PLUS+STAR) --}} |
6 | {{#if psList}} | 5 | {{#if psList}} |
7 | - <script> | 6 | +<script> |
8 | seajs.use('js/guang/plus-star/list'); | 7 | seajs.use('js/guang/plus-star/list'); |
9 | - </script> | 8 | +</script> |
10 | {{/if}} | 9 | {{/if}} |
11 | {{#if psDetail}} | 10 | {{#if psDetail}} |
12 | - <script> | 11 | +<script> |
13 | seajs.use('js/guang/plus-star/detail'); | 12 | seajs.use('js/guang/plus-star/detail'); |
14 | - </script> | 13 | +</script> |
15 | {{/if}} | 14 | {{/if}} |
16 | {{#if guangHome}} | 15 | {{#if guangHome}} |
17 | - <script> | 16 | +<script> |
18 | seajs.use('js/guang/home'); | 17 | seajs.use('js/guang/home'); |
19 | - </script> | 18 | +</script> |
20 | {{/if}} | 19 | {{/if}} |
21 | {{#if guangList}} | 20 | {{#if guangList}} |
22 | - <script> | 21 | +<script> |
23 | seajs.use('js/guang/list'); | 22 | seajs.use('js/guang/list'); |
24 | - </script> | 23 | +</script> |
25 | {{/if}} | 24 | {{/if}} |
26 | {{#if guangDetail}} | 25 | {{#if guangDetail}} |
27 | - <script> | 26 | +<script> |
28 | seajs.use('js/guang/detail'); | 27 | seajs.use('js/guang/detail'); |
29 | - </script> | 28 | +</script> |
30 | {{/if}} | 29 | {{/if}} |
31 | - | ||
32 | {{!-- 注册 --}} | 30 | {{!-- 注册 --}} |
33 | {{#if regIndex}} | 31 | {{#if regIndex}} |
34 | - <script> | 32 | +<script> |
35 | seajs.use('js/passport/register/register'); | 33 | seajs.use('js/passport/register/register'); |
36 | - </script> | 34 | +</script> |
37 | {{/if}} | 35 | {{/if}} |
38 | {{#if regCode}} | 36 | {{#if regCode}} |
39 | - <script> | 37 | +<script> |
40 | seajs.use('js/passport/register/code'); | 38 | seajs.use('js/passport/register/code'); |
41 | - </script> | 39 | +</script> |
42 | {{/if}} | 40 | {{/if}} |
43 | {{#if regPwd}} | 41 | {{#if regPwd}} |
44 | - <script> | 42 | +<script> |
45 | seajs.use('js/passport/register/password'); | 43 | seajs.use('js/passport/register/password'); |
46 | - </script> | 44 | +</script> |
47 | {{/if}} | 45 | {{/if}} |
48 | - | ||
49 | {{!-- 登陆 --}} | 46 | {{!-- 登陆 --}} |
50 | {{#if loginIndex}} | 47 | {{#if loginIndex}} |
51 | - <script> | 48 | +<script> |
52 | seajs.use('js/passport/login/login'); | 49 | seajs.use('js/passport/login/login'); |
53 | - </script> | 50 | +</script> |
54 | {{/if}} | 51 | {{/if}} |
55 | {{#if loginInterational}} | 52 | {{#if loginInterational}} |
56 | - <script> | 53 | +<script> |
57 | seajs.use('js/passport/login/interational'); | 54 | seajs.use('js/passport/login/interational'); |
58 | - </script> | 55 | +</script> |
59 | {{/if}} | 56 | {{/if}} |
60 | - | ||
61 | {{!-- 密码找回 --}} | 57 | {{!-- 密码找回 --}} |
62 | {{#if backEmail}} | 58 | {{#if backEmail}} |
63 | - <script> | 59 | +<script> |
64 | seajs.use('js/passport/back/email'); | 60 | seajs.use('js/passport/back/email'); |
65 | - </script> | 61 | +</script> |
66 | {{/if}} | 62 | {{/if}} |
67 | {{#if backEmailSuccess}} | 63 | {{#if backEmailSuccess}} |
68 | - <script> | 64 | +<script> |
69 | seajs.use('js/passport/back/email-success'); | 65 | seajs.use('js/passport/back/email-success'); |
70 | - </script> | 66 | +</script> |
71 | {{/if}} | 67 | {{/if}} |
72 | {{#if backMobile}} | 68 | {{#if backMobile}} |
73 | - <script> | 69 | +<script> |
74 | seajs.use('js/passport/back/mobile'); | 70 | seajs.use('js/passport/back/mobile'); |
75 | - </script> | 71 | +</script> |
76 | {{/if}} | 72 | {{/if}} |
77 | {{#if backCode}} | 73 | {{#if backCode}} |
78 | - <script> | 74 | +<script> |
79 | seajs.use('js/passport/back/code'); | 75 | seajs.use('js/passport/back/code'); |
80 | - </script> | 76 | +</script> |
81 | {{/if}} | 77 | {{/if}} |
82 | {{#if backNewPwd}} | 78 | {{#if backNewPwd}} |
83 | - <script> | 79 | +<script> |
84 | seajs.use('js/passport/back/new-password'); | 80 | seajs.use('js/passport/back/new-password'); |
85 | - </script> | 81 | +</script> |
86 | {{/if}} | 82 | {{/if}} |
87 | - | ||
88 | {{!-- 首页 --}} | 83 | {{!-- 首页 --}} |
89 | {{#if grilsHomePage}} | 84 | {{#if grilsHomePage}} |
90 | - <script> | 85 | +<script> |
91 | seajs.use('js/home/home'); | 86 | seajs.use('js/home/home'); |
92 | - </script> | 87 | +</script> |
93 | {{/if}} | 88 | {{/if}} |
94 | {{#if boysHomePage}} | 89 | {{#if boysHomePage}} |
95 | - <script> | 90 | +<script> |
96 | seajs.use('js/home/home'); | 91 | seajs.use('js/home/home'); |
97 | - </script> | 92 | +</script> |
98 | {{/if}} | 93 | {{/if}} |
99 | {{#if kidsHomePage}} | 94 | {{#if kidsHomePage}} |
100 | - <script> | 95 | +<script> |
101 | seajs.use('js/home/home'); | 96 | seajs.use('js/home/home'); |
102 | - </script> | 97 | +</script> |
103 | {{/if}} | 98 | {{/if}} |
104 | {{#if lifestyleHomePage}} | 99 | {{#if lifestyleHomePage}} |
105 | - <script> | 100 | +<script> |
106 | seajs.use('js/home/home'); | 101 | seajs.use('js/home/home'); |
107 | - </script> | 102 | +</script> |
108 | {{/if}} | 103 | {{/if}} |
109 | - | ||
110 | {{!-- 新品到着 --}} | 104 | {{!-- 新品到着 --}} |
111 | {{#if newArrival}} | 105 | {{#if newArrival}} |
112 | - <script> | 106 | +<script> |
113 | seajs.use('js/product/newsale/newarrival'); | 107 | seajs.use('js/product/newsale/newarrival'); |
114 | - </script> | 108 | +</script> |
115 | {{/if}} | 109 | {{/if}} |
116 | {{!-- 折扣专区 --}} | 110 | {{!-- 折扣专区 --}} |
117 | {{#if discount}} | 111 | {{#if discount}} |
118 | - <script> | 112 | +<script> |
119 | seajs.use('js/product/newsale/discount'); | 113 | seajs.use('js/product/newsale/discount'); |
120 | - </script> | 114 | +</script> |
121 | {{/if}} | 115 | {{/if}} |
122 | - | ||
123 | {{!-- 商品列表 --}} | 116 | {{!-- 商品列表 --}} |
124 | {{#if goodListPage}} | 117 | {{#if goodListPage}} |
125 | - <script> | 118 | +<script> |
126 | seajs.use('js/product/list'); | 119 | seajs.use('js/product/list'); |
127 | - </script> | 120 | +</script> |
128 | {{/if}} | 121 | {{/if}} |
129 | - | ||
130 | {{!-- 品类 --}} | 122 | {{!-- 品类 --}} |
131 | {{#if categoryPage}} | 123 | {{#if categoryPage}} |
132 | - <script> | 124 | +<script> |
133 | seajs.use('js/category/index'); | 125 | seajs.use('js/category/index'); |
134 | - </script> | 126 | +</script> |
135 | {{/if}} | 127 | {{/if}} |
136 | {{!-- 品牌 --}} | 128 | {{!-- 品牌 --}} |
137 | {{#if brandPage}} | 129 | {{#if brandPage}} |
138 | - <script> | 130 | +<script> |
139 | seajs.use('js/category/brand'); | 131 | seajs.use('js/category/brand'); |
140 | - </script> | 132 | +</script> |
141 | {{/if}} | 133 | {{/if}} |
142 | - | ||
143 | {{!-- 搜索 --}} | 134 | {{!-- 搜索 --}} |
144 | {{#if searchPage}} | 135 | {{#if searchPage}} |
145 | - <script> | 136 | +<script> |
146 | seajs.use('js/index/search'); | 137 | seajs.use('js/index/search'); |
147 | - </script> | 138 | +</script> |
148 | {{/if}} | 139 | {{/if}} |
149 | - | ||
150 | {{!-- 购物车 --}} | 140 | {{!-- 购物车 --}} |
151 | {{#if shoppingCartPage}} | 141 | {{#if shoppingCartPage}} |
152 | - <script> | 142 | +<script> |
153 | seajs.use('js/shopping-cart/index'); | 143 | seajs.use('js/shopping-cart/index'); |
154 | - </script> | 144 | +</script> |
155 | {{/if}} | 145 | {{/if}} |
@@ -13,6 +13,9 @@ class BoysController extends AbstractAction | @@ -13,6 +13,9 @@ class BoysController extends AbstractAction | ||
13 | */ | 13 | */ |
14 | public function indexAction() | 14 | public function indexAction() |
15 | { | 15 | { |
16 | + // 设置COOKIE标识用户访问过该页面了 | ||
17 | + Index\HomeModel::setSwitchToCookie(Index\HomeModel::COOKIE_NAME_BOYS); | ||
18 | + | ||
16 | // 设置网站标题 | 19 | // 设置网站标题 |
17 | $this->setTitle('男生首页'); | 20 | $this->setTitle('男生首页'); |
18 | // 显示侧边栏 | 21 | // 显示侧边栏 |
@@ -13,6 +13,9 @@ class GirlsController extends AbstractAction | @@ -13,6 +13,9 @@ class GirlsController extends AbstractAction | ||
13 | */ | 13 | */ |
14 | public function indexAction() | 14 | public function indexAction() |
15 | { | 15 | { |
16 | + // 设置COOKIE标识用户访问过该页面了 | ||
17 | + Index\HomeModel::setSwitchToCookie(Index\HomeModel::COOKIE_NAME_GIRLS); | ||
18 | + | ||
16 | // 设置网站标题 | 19 | // 设置网站标题 |
17 | $this->setTitle('女生首页'); | 20 | $this->setTitle('女生首页'); |
18 | // 显示侧边栏 | 21 | // 显示侧边栏 |
@@ -26,7 +29,6 @@ class GirlsController extends AbstractAction | @@ -26,7 +29,6 @@ class GirlsController extends AbstractAction | ||
26 | 'maybeLike' => true, | 29 | 'maybeLike' => true, |
27 | 'content' => Index\HomeModel::getGirlsFloor() | 30 | 'content' => Index\HomeModel::getGirlsFloor() |
28 | )); | 31 | )); |
29 | - | ||
30 | } | 32 | } |
31 | 33 | ||
32 | } | 34 | } |
@@ -13,6 +13,10 @@ class IndexController extends AbstractAction | @@ -13,6 +13,10 @@ class IndexController extends AbstractAction | ||
13 | */ | 13 | */ |
14 | public function indexAction() | 14 | public function indexAction() |
15 | { | 15 | { |
16 | + // 先检查COOKIE是否有访问过, 有则跳转到相应的频道页 | ||
17 | + Index\HomeModel::goSwitchChannel(); | ||
18 | + | ||
19 | + // 渲染模板 | ||
16 | $this->_view->display('index', array( | 20 | $this->_view->display('index', array( |
17 | 'background' => Index\HomeModel::getBgImage() | 21 | 'background' => Index\HomeModel::getBgImage() |
18 | )); | 22 | )); |
@@ -13,6 +13,9 @@ class KidsController extends AbstractAction | @@ -13,6 +13,9 @@ class KidsController extends AbstractAction | ||
13 | */ | 13 | */ |
14 | public function indexAction() | 14 | public function indexAction() |
15 | { | 15 | { |
16 | + // 设置COOKIE标识用户访问过该页面了 | ||
17 | + Index\HomeModel::setSwitchToCookie(Index\HomeModel::COOKIE_NAME_KIDS); | ||
18 | + | ||
16 | // 设置网站标题 | 19 | // 设置网站标题 |
17 | $this->setTitle('潮童首页'); | 20 | $this->setTitle('潮童首页'); |
18 | // 显示侧边栏 | 21 | // 显示侧边栏 |
@@ -26,7 +29,6 @@ class KidsController extends AbstractAction | @@ -26,7 +29,6 @@ class KidsController extends AbstractAction | ||
26 | 'maybeLike' => true, | 29 | 'maybeLike' => true, |
27 | 'content' => Index\HomeModel::getKidsFloor() | 30 | 'content' => Index\HomeModel::getKidsFloor() |
28 | )); | 31 | )); |
29 | - | ||
30 | } | 32 | } |
31 | 33 | ||
32 | } | 34 | } |
@@ -13,6 +13,9 @@ class LifestyleController extends AbstractAction | @@ -13,6 +13,9 @@ class LifestyleController extends AbstractAction | ||
13 | */ | 13 | */ |
14 | public function indexAction() | 14 | public function indexAction() |
15 | { | 15 | { |
16 | + // 设置COOKIE标识用户访问过该页面了 | ||
17 | + Index\HomeModel::setSwitchToCookie(Index\HomeModel::COOKIE_NAME_LIFESTYLE); | ||
18 | + | ||
16 | // 设置网站标题 | 19 | // 设置网站标题 |
17 | $this->setTitle('创意生活首页'); | 20 | $this->setTitle('创意生活首页'); |
18 | // 显示侧边栏 | 21 | // 显示侧边栏 |
@@ -26,7 +29,6 @@ class LifestyleController extends AbstractAction | @@ -26,7 +29,6 @@ class LifestyleController extends AbstractAction | ||
26 | 'maybeLike' => true, | 29 | 'maybeLike' => true, |
27 | 'content' => Index\HomeModel::getLifestyleFloor() | 30 | 'content' => Index\HomeModel::getLifestyleFloor() |
28 | )); | 31 | )); |
29 | - | ||
30 | } | 32 | } |
31 | 33 | ||
32 | } | 34 | } |
1 | +<?php | ||
2 | + | ||
3 | +namespace Category; | ||
4 | + | ||
5 | +use LibModels\Wap\Category\BrandData; | ||
6 | +use Configs\CacheConfig; | ||
7 | +use Plugin\Helpers; | ||
8 | + | ||
9 | +/** | ||
10 | + * 品牌相关的模板数据模型 | ||
11 | + * | ||
12 | + * @name BrandModel | ||
13 | + * @package Models/Category | ||
14 | + * @copyright yoho.inc | ||
15 | + * @version 1.0 (2015-10-21 13:52:44) | ||
16 | + * @author fei.hong <fei.hong@yoho.cn> | ||
17 | + */ | ||
18 | +class BrandModel | ||
19 | +{ | ||
20 | + /* 男生频道取品牌广告及热门品牌数据的位置码 */ | ||
21 | + const CODE_TOPPOS_BOYS = 'ce6ac059493ec26241a8cbe0bfa1b17a'; | ||
22 | + /* 女生频道取品牌广告及热门品牌数据的位置码 */ | ||
23 | + const CODE_TOPPOS_GIRLS = 'dac99cdedc1f948e84c145aca561f7d2'; | ||
24 | + /* 潮童频道取品牌广告及热门品牌数据的位置码 */ | ||
25 | + const CODE_TOPPOS_KIDS = '713784f93f52bb1a7b93916b2bb15510'; | ||
26 | + /* 创意生活频道取品牌广告及热门品牌数据的位置码 */ | ||
27 | + const CODE_TOPPOS_LIFESTYLE = 'f1aa914fd23cbcda71a87de6f5416c75'; | ||
28 | + | ||
29 | + /** | ||
30 | + * 根据频道获取品牌一览数据 | ||
31 | + * | ||
32 | + * @param int $channel 1表示男生频道, 2表示女生频道, 3表示潮童频道, 4表示创意生活频道 | ||
33 | + * @return array | ||
34 | + */ | ||
35 | + public static function getBrandByChannel($channel) | ||
36 | + { | ||
37 | + $result = array(); | ||
38 | + $brand = array(); | ||
39 | + | ||
40 | + /* 根据频道调用接口 */ | ||
41 | + switch (intval($channel)) { | ||
42 | + case 1: // 男生 | ||
43 | + $brand = BrandData::package(self::CODE_TOPPOS_BOYS, 1); | ||
44 | + break; | ||
45 | + case 2: // 女生 | ||
46 | + $brand = BrandData::package(self::CODE_TOPPOS_GIRLS, 2); | ||
47 | + break; | ||
48 | + case 3: // 潮童 | ||
49 | + $brand = BrandData::package(self::CODE_TOPPOS_KIDS, 3); | ||
50 | + break; | ||
51 | + case 4: // 创意生活 | ||
52 | + $brand = BrandData::package(self::CODE_TOPPOS_LIFESTYLE, 4); | ||
53 | + break; | ||
54 | + } | ||
55 | + | ||
56 | + /* 顶部的轮翻广告列表 */ | ||
57 | + if (!empty($brand['brandTop'][0]['data'])) { | ||
58 | + $build = array(); | ||
59 | + foreach ($brand['brandTop'][0]['data'] as $value) { | ||
60 | + $build['url'] = Helpers::getFilterUrl($value['url']); | ||
61 | + $build['img'] = Helpers::getImageUrl($value['src'], 640, 300); | ||
62 | + $build['title'] = $value['title']; | ||
63 | + $result['bannerTop']['list'][] = $build; | ||
64 | + } | ||
65 | + } | ||
66 | + | ||
67 | + /* 顶部的热门品牌列表 */ | ||
68 | + if (!empty($brand['brandTop'][1]['data']['list'])) { | ||
69 | + $build = array(); | ||
70 | + foreach ($brand['brandTop'][1]['data']['list'] as $value) { | ||
71 | + $build['url'] = Helpers::getFilterUrl($value['url']); | ||
72 | + $build['img'] = Helpers::getImageUrl($value['src'], 144, 144); | ||
73 | + $build['name'] = $value['name']; | ||
74 | + $result['hotBrand']['list'][] = $build; | ||
75 | + } | ||
76 | + } | ||
77 | + | ||
78 | + /* 按字母'A-Z'分组的品牌列表 */ | ||
79 | + if (!empty($brand['brandList']['brands'])) { | ||
80 | + $list = array(); | ||
81 | + $build = array(); | ||
82 | + foreach ($brand['brandList']['brands'] as $char => $value) { | ||
83 | + $build['title'] = $char; | ||
84 | + $build['list'] = array(); | ||
85 | + foreach ($value as $row) { | ||
86 | + $list['name'] = $row['brand_name']; | ||
87 | + $list['isHot'] = ($row['is_hot'] === 'Y') ? true : false; | ||
88 | + $list['isNew'] = ($row['is_show_new'] === 'Y') ? true : false; | ||
89 | + $list['url'] = 'http://' . $row['brand_domain'] . '.' . OLD_DOMAIN; | ||
90 | + $build['list'][] = $list; | ||
91 | + } | ||
92 | + $result['brandList'][] = $build; | ||
93 | + } | ||
94 | + } | ||
95 | + | ||
96 | + $brand = array(); | ||
97 | + | ||
98 | + return $result; | ||
99 | + } | ||
100 | + | ||
101 | +} |
@@ -19,8 +19,8 @@ use Configs\CacheConfig; | @@ -19,8 +19,8 @@ use Configs\CacheConfig; | ||
19 | */ | 19 | */ |
20 | class HomeModel | 20 | class HomeModel |
21 | { | 21 | { |
22 | - | ||
23 | /* 频道选择页取背景图片的位置码 */ | 22 | /* 频道选择页取背景图片的位置码 */ |
23 | + | ||
24 | const CODE_BG = '7ba9118028f9b22090b57341487567eb'; | 24 | const CODE_BG = '7ba9118028f9b22090b57341487567eb'; |
25 | 25 | ||
26 | /* 男生楼层资源的位置码 */ | 26 | /* 男生楼层资源的位置码 */ |
@@ -37,6 +37,44 @@ class HomeModel | @@ -37,6 +37,44 @@ class HomeModel | ||
37 | /* 女生底部广告的位置码 */ | 37 | /* 女生底部广告的位置码 */ |
38 | const CODE_BANNER_BOTTOM_GIRLS = '8c8bd1b89a22e5895f05882e0825b493'; | 38 | const CODE_BANNER_BOTTOM_GIRLS = '8c8bd1b89a22e5895f05882e0825b493'; |
39 | 39 | ||
40 | + /* COOKIE标识访问的是男生频道 */ | ||
41 | + const COOKIE_NAME_BOYS = 'boys'; | ||
42 | + /* COOKIE标识访问的是女生频道 */ | ||
43 | + const COOKIE_NAME_GIRLS = 'girls'; | ||
44 | + /* COOKIE标识访问的是潮童频道 */ | ||
45 | + const COOKIE_NAME_KIDS = 'kids'; | ||
46 | + /* COOKIE标识访问的是创意生活频道 */ | ||
47 | + const COOKIE_NAME_LIFESTYLE = 'lifestyle'; | ||
48 | + | ||
49 | + /** | ||
50 | + * 选择频道 | ||
51 | + * | ||
52 | + * @return void | ||
53 | + */ | ||
54 | + public static function goSwitchChannel() | ||
55 | + { | ||
56 | + // 通过COOKIE检查是否已设置过首页频道时,跳转到对应的频道页 | ||
57 | + if (!empty($_COOKIE['_Channel'])) { | ||
58 | + headers_sent() || header('Location: /' . $_COOKIE['_Channel']); | ||
59 | + exit(); | ||
60 | + } | ||
61 | + // 没有Cookie时, 设置默认访问的频道 | ||
62 | + else { | ||
63 | + self::setSwitchToCookie(self::COOKIE_NAME_BOYS); | ||
64 | + } | ||
65 | + } | ||
66 | + | ||
67 | + /** | ||
68 | + * 设置选择的频道保存到浏览器COOKIE | ||
69 | + * | ||
70 | + * @param string $cookie | ||
71 | + * @return void | ||
72 | + */ | ||
73 | + public static function setSwitchToCookie($cookie) | ||
74 | + { | ||
75 | + setcookie('_Channel', $cookie, time() + 86400 * 300, '/', '.' . SITE_DOMAIN); | ||
76 | + } | ||
77 | + | ||
40 | /** | 78 | /** |
41 | * 获取频道选择页的背景图片 | 79 | * 获取频道选择页的背景图片 |
42 | * | 80 | * |
@@ -44,6 +82,8 @@ class HomeModel | @@ -44,6 +82,8 @@ class HomeModel | ||
44 | */ | 82 | */ |
45 | public static function getBgImage() | 83 | public static function getBgImage() |
46 | { | 84 | { |
85 | + $result = false; | ||
86 | + | ||
47 | if (USE_CACHE) { | 87 | if (USE_CACHE) { |
48 | // 先尝试获取一级缓存(master), 有数据则直接返回. | 88 | // 先尝试获取一级缓存(master), 有数据则直接返回. |
49 | $result = Cache::get(CacheConfig::KEY_ACTION_INDEX_INDEX, 'master'); | 89 | $result = Cache::get(CacheConfig::KEY_ACTION_INDEX_INDEX, 'master'); |
@@ -56,8 +96,6 @@ class HomeModel | @@ -56,8 +96,6 @@ class HomeModel | ||
56 | $banner = IndexData::getBannerStart(self::CODE_BG); | 96 | $banner = IndexData::getBannerStart(self::CODE_BG); |
57 | if (isset($banner['data'][0]['data']['list'][0]['src'])) { | 97 | if (isset($banner['data'][0]['data']['list'][0]['src'])) { |
58 | $result = Helpers::getImageUrl($banner['data'][0]['data']['list'][0]['src'], 640, 800, 1); | 98 | $result = Helpers::getImageUrl($banner['data'][0]['data']['list'][0]['src'], 640, 800, 1); |
59 | - } else { | ||
60 | - $result = false; | ||
61 | } | 99 | } |
62 | 100 | ||
63 | if (USE_CACHE) { | 101 | if (USE_CACHE) { |
@@ -76,9 +114,13 @@ class HomeModel | @@ -76,9 +114,13 @@ class HomeModel | ||
76 | 114 | ||
77 | /** | 115 | /** |
78 | * 获取男生首页的楼层数据 | 116 | * 获取男生首页的楼层数据 |
117 | + * | ||
118 | + * @return array | false | ||
79 | */ | 119 | */ |
80 | public static function getBoysFloor() | 120 | public static function getBoysFloor() |
81 | { | 121 | { |
122 | + $result = array(); | ||
123 | + | ||
82 | if (USE_CACHE) { | 124 | if (USE_CACHE) { |
83 | // 先尝试获取一级缓存(master), 有数据则直接返回. | 125 | // 先尝试获取一级缓存(master), 有数据则直接返回. |
84 | $result = Cache::get(CacheConfig::KEY_ACTION_BOYS_INDEX, 'master'); | 126 | $result = Cache::get(CacheConfig::KEY_ACTION_BOYS_INDEX, 'master'); |
@@ -109,9 +151,13 @@ class HomeModel | @@ -109,9 +151,13 @@ class HomeModel | ||
109 | 151 | ||
110 | /** | 152 | /** |
111 | * 获取女生首页的楼层数据 | 153 | * 获取女生首页的楼层数据 |
154 | + * | ||
155 | + * @return array | false | ||
112 | */ | 156 | */ |
113 | public static function getGirlsFloor() | 157 | public static function getGirlsFloor() |
114 | { | 158 | { |
159 | + $result = array(); | ||
160 | + | ||
115 | if (USE_CACHE) { | 161 | if (USE_CACHE) { |
116 | // 先尝试获取一级缓存(master), 有数据则直接返回. | 162 | // 先尝试获取一级缓存(master), 有数据则直接返回. |
117 | $result = Cache::get(CacheConfig::KEY_ACTION_GIRLS_INDEX, 'master'); | 163 | $result = Cache::get(CacheConfig::KEY_ACTION_GIRLS_INDEX, 'master'); |
@@ -142,9 +188,13 @@ class HomeModel | @@ -142,9 +188,13 @@ class HomeModel | ||
142 | 188 | ||
143 | /** | 189 | /** |
144 | * 获取潮童首页的楼层数据 | 190 | * 获取潮童首页的楼层数据 |
191 | + * | ||
192 | + * @return array | false | ||
145 | */ | 193 | */ |
146 | public static function getKidsFloor() | 194 | public static function getKidsFloor() |
147 | { | 195 | { |
196 | + $result = false; | ||
197 | + | ||
148 | if (USE_CACHE) { | 198 | if (USE_CACHE) { |
149 | // 先尝试获取一级缓存(master), 有数据则直接返回. | 199 | // 先尝试获取一级缓存(master), 有数据则直接返回. |
150 | $result = Cache::get(CacheConfig::KEY_ACTION_KIDS_INDEX, 'master'); | 200 | $result = Cache::get(CacheConfig::KEY_ACTION_KIDS_INDEX, 'master'); |
@@ -175,9 +225,13 @@ class HomeModel | @@ -175,9 +225,13 @@ class HomeModel | ||
175 | 225 | ||
176 | /** | 226 | /** |
177 | * 获取创意生活首页的楼层数据 | 227 | * 获取创意生活首页的楼层数据 |
228 | + * | ||
229 | + * @return array | false | ||
178 | */ | 230 | */ |
179 | public static function getLifestyleFloor() | 231 | public static function getLifestyleFloor() |
180 | { | 232 | { |
233 | + $result = false; | ||
234 | + | ||
181 | if (USE_CACHE) { | 235 | if (USE_CACHE) { |
182 | // 先尝试获取一级缓存(master), 有数据则直接返回. | 236 | // 先尝试获取一级缓存(master), 有数据则直接返回. |
183 | $result = Cache::get(CacheConfig::KEY_ACTION_LIFESTYLE_INDEX, 'master'); | 237 | $result = Cache::get(CacheConfig::KEY_ACTION_LIFESTYLE_INDEX, 'master'); |
1 | <?php | 1 | <?php |
2 | use Action\AbstractAction; | 2 | use Action\AbstractAction; |
3 | -use LibModels\Wap\Category\BrandData; | ||
4 | 3 | ||
5 | /** | 4 | /** |
6 | - * 品牌 | 5 | + * 品牌相关的控制器 |
7 | */ | 6 | */ |
8 | class BrandController extends AbstractAction | 7 | class BrandController extends AbstractAction |
9 | { | 8 | { |
9 | + /** | ||
10 | + * 品牌一览 | ||
11 | + * | ||
12 | + * @param int channel 1表示男生频道, 2表示女生频道, 3表示潮童频道, 4表示创意生活频道 | ||
13 | + */ | ||
10 | public function indexAction() | 14 | public function indexAction() |
11 | { | 15 | { |
12 | - // 获取品牌数据 | ||
13 | - /*$brandTopData = BrandData::getBrandTopData(); | ||
14 | - $brandsData = BrandData::getBrandsData(); | 16 | + $this->setTitle('品牌一览'); |
17 | + $this->setNavHeader('品牌一览'); | ||
15 | 18 | ||
16 | - $brandTop = array(); | ||
17 | - if($brandTopData['code'] == 200) | ||
18 | - { | ||
19 | - $brandTop = $brandTopData['data']; | 19 | + /* 判断参数是否有效 */ |
20 | + $channel = $this->get('channel', 1); | ||
21 | + if (!is_numeric($channel) || intval($channel) > 4) { | ||
22 | + $channel = 1; | ||
20 | } | 23 | } |
21 | - $brands = array(); | ||
22 | - if($brandsData['code'] == 200) | ||
23 | - { | ||
24 | - $brands = $brandsData['data']; | ||
25 | - } | ||
26 | - | ||
27 | - echo '<pre>'; | ||
28 | - var_dump($brandTop, $brands);exit;*/ | ||
29 | - | ||
30 | - $data = array ( | ||
31 | - 'brandPage' => true, | ||
32 | - 'bannerTop' => array ( | ||
33 | - 'list' => array ( | ||
34 | - array ( | ||
35 | - 'url' => '', | ||
36 | - 'img' => 'http://img10.static.yhbimg.com/adpic/2015/10/15/10/01c161398d3baec2868abe85e26ba1a71d.jpg?imageMogr2/thumbnail/640x300/extent/640x300/background/d2hpdGU=/position/center/quality/90' | ||
37 | - ), | ||
38 | - array ( | ||
39 | - 'url' => '', | ||
40 | - 'img' => 'http://img13.static.yhbimg.com/adpic/2015/10/15/10/027c45cdc03e23c367ec0ff3d29b7c3f79.jpg?imageMogr2/thumbnail/640x300/extent/640x300/background/d2hpdGU=/position/center/quality/90' | ||
41 | - ), | ||
42 | - array ( | ||
43 | - 'url' => '', | ||
44 | - 'img' => 'http://img13.static.yhbimg.com/adpic/2015/10/15/10/022e2ac6daa33fc3cb8a0f04025a35994f.jpg?imageMogr2/thumbnail/640x300/extent/640x300/background/d2hpdGU=/position/center/quality/90' | ||
45 | - ) | ||
46 | - ) | ||
47 | - ), | ||
48 | - 'hotBrand' => array ( | ||
49 | - 'list' => array ( | ||
50 | - array ( | ||
51 | - 'url' => '', | ||
52 | - 'img' => 'http://img13.static.yhbimg.com/brandLogo/2014/08/12/17/0233d54f34d2534c08271a8fc27090a6af.jpg?imageMogr2/thumbnail/144x144/extent/144x144/background/d2hpdGU=/position/center/quality/90' | ||
53 | - ), | ||
54 | - array ( | ||
55 | - 'url' => '', | ||
56 | - 'img' => 'http://img12.static.yhbimg.com/brandLogo/2014/01/27/11/020b17265b2103b49005c57395b8b154a9.jpg?imageMogr2/thumbnail/144x144/extent/144x144/background/d2hpdGU=/position/center/quality/90' | ||
57 | - ), | ||
58 | - array ( | ||
59 | - 'url' => '', | ||
60 | - 'img' => 'http://img13.static.yhbimg.com/brandLogo/2014/11/27/09/02b403bdcbfb965bdc632fea5c29816746.png?imageMogr2/thumbnail/144x144/extent/144x144/background/d2hpdGU=/position/center/quality/90' | ||
61 | - ), | ||
62 | - array ( | ||
63 | - 'url' => '', | ||
64 | - 'img' => 'http://img13.static.yhbimg.com/brandLogo/2013/11/01/14/027e68260ba30c01b165c17fe043f2ce2c.jpg?imageMogr2/thumbnail/144x144/extent/144x144/background/d2hpdGU=/position/center/quality/90' | ||
65 | - ), | ||
66 | - array ( | ||
67 | - 'url' => '', | ||
68 | - 'img' => 'http://img11.static.yhbimg.com/brandLogo/2014/04/25/14/0179fa8eacf51fd1a89ec6f7fdeab88fc2.jpg?imageMogr2/thumbnail/144x144/extent/144x144/background/d2hpdGU=/position/center/quality/90' | ||
69 | - ), | ||
70 | - array ( | ||
71 | - 'url' => '', | ||
72 | - 'img' => 'http://img12.static.yhbimg.com/brandLogo/2014/01/27/11/02608437f8d8b6b7b15786214b0a5ef502.jpg?imageMogr2/thumbnail/144x144/extent/144x144/background/d2hpdGU=/position/center/quality/90' | ||
73 | - ), | ||
74 | - array ( | ||
75 | - 'url' => '', | ||
76 | - 'img' => 'http://img12.static.yhbimg.com/brandLogo/2013/02/28/17/020aae69720d683a7962c9b7fd3a92c801.jpg?imageMogr2/thumbnail/144x144/extent/144x144/background/d2hpdGU=/position/center/quality/90' | ||
77 | - ), | ||
78 | - array ( | ||
79 | - 'url' => '', | ||
80 | - 'img' => 'http://img13.static.yhbimg.com/brandLogo/2014/01/27/11/02bca7ac6414c7475b4a337e28a0365590.jpg?imageMogr2/thumbnail/144x144/extent/144x144/background/d2hpdGU=/position/center/quality/90' | ||
81 | - ) | ||
82 | - ) | ||
83 | - ), | ||
84 | - 'brandList' => array ( | ||
85 | - array ( | ||
86 | - 'title' => '0~9', | ||
87 | - 'list' => array( | ||
88 | - array ( | ||
89 | - 'name' => '004', | ||
90 | - 'isHot' => true | ||
91 | - ), | ||
92 | - array ( | ||
93 | - 'name' => '10*1', | ||
94 | - 'isNew' => true | ||
95 | - ), | ||
96 | - array ( | ||
97 | - 'name' => '2%' | ||
98 | - ) | ||
99 | - ) | ||
100 | - ), | ||
101 | - array ( | ||
102 | - 'title' => 'A', | ||
103 | - 'list' => array( | ||
104 | - array ( | ||
105 | - 'name' => 'Aape', | ||
106 | - 'isHot' => true | ||
107 | - ), | ||
108 | - array ( | ||
109 | - 'name' => 'Adfdfd', | ||
110 | - 'isNew' => true | ||
111 | - ), | ||
112 | - array ( | ||
113 | - 'name' => 'Acrwewwe' | ||
114 | - ) | ||
115 | - ) | ||
116 | - ), | ||
117 | - array ( | ||
118 | - 'title' => 'B', | ||
119 | - 'list' => array( | ||
120 | - array ( | ||
121 | - 'name' => 'Bape' | ||
122 | - ), | ||
123 | - array ( | ||
124 | - 'name' => 'Bdfdfd' | ||
125 | - ), | ||
126 | - array ( | ||
127 | - 'name' => 'Bcrwewwe' | ||
128 | - ) | ||
129 | - ) | ||
130 | - ), | ||
131 | - array ( | ||
132 | - 'title' => 'B', | ||
133 | - 'list' => array( | ||
134 | - array ( | ||
135 | - 'name' => 'Bape' | ||
136 | - ), | ||
137 | - array ( | ||
138 | - 'name' => 'Bdfdfd' | ||
139 | - ), | ||
140 | - array ( | ||
141 | - 'name' => 'Bcrwewwe' | ||
142 | - ) | ||
143 | - ) | ||
144 | - ), | ||
145 | - array ( | ||
146 | - 'title' => 'B', | ||
147 | - 'list' => array( | ||
148 | - array ( | ||
149 | - 'name' => 'Bape' | ||
150 | - ), | ||
151 | - array ( | ||
152 | - 'name' => 'Bdfdfd' | ||
153 | - ), | ||
154 | - array ( | ||
155 | - 'name' => 'Bcrwewwe' | ||
156 | - ) | ||
157 | - ) | ||
158 | - ), | ||
159 | - array ( | ||
160 | - 'title' => 'B', | ||
161 | - 'list' => array( | ||
162 | - array ( | ||
163 | - 'name' => 'Bape' | ||
164 | - ), | ||
165 | - array ( | ||
166 | - 'name' => 'Bdfdfd' | ||
167 | - ), | ||
168 | - array ( | ||
169 | - 'name' => 'Bcrwewwe' | ||
170 | - ) | ||
171 | - ) | ||
172 | - ), | ||
173 | - array ( | ||
174 | - 'title' => 'B', | ||
175 | - 'list' => array( | ||
176 | - array ( | ||
177 | - 'name' => 'Bape' | ||
178 | - ), | ||
179 | - array ( | ||
180 | - 'name' => 'Bdfdfd' | ||
181 | - ), | ||
182 | - array ( | ||
183 | - 'name' => 'Bcrwewwe' | ||
184 | - ) | ||
185 | - ) | ||
186 | - ), | ||
187 | - array ( | ||
188 | - 'title' => 'B', | ||
189 | - 'list' => array( | ||
190 | - array ( | ||
191 | - 'name' => 'Bape' | ||
192 | - ), | ||
193 | - array ( | ||
194 | - 'name' => 'Bdfdfd' | ||
195 | - ), | ||
196 | - array ( | ||
197 | - 'name' => 'Bcrwewwe' | ||
198 | - ) | ||
199 | - ) | ||
200 | - ), | ||
201 | - array ( | ||
202 | - 'title' => 'B', | ||
203 | - 'list' => array( | ||
204 | - array ( | ||
205 | - 'name' => 'Bape' | ||
206 | - ), | ||
207 | - array ( | ||
208 | - 'name' => 'Bdfdfd' | ||
209 | - ), | ||
210 | - array ( | ||
211 | - 'name' => 'Bcrwewwe' | ||
212 | - ) | ||
213 | - ) | ||
214 | - ), | ||
215 | - array ( | ||
216 | - 'title' => 'B', | ||
217 | - 'list' => array( | ||
218 | - array ( | ||
219 | - 'name' => 'Bape' | ||
220 | - ), | ||
221 | - array ( | ||
222 | - 'name' => 'Bdfdfd' | ||
223 | - ), | ||
224 | - array ( | ||
225 | - 'name' => 'Bcrwewwe' | ||
226 | - ) | ||
227 | - ) | ||
228 | - ) | ||
229 | - ) | ||
230 | - | ||
231 | - | ||
232 | - ); | ||
233 | 24 | ||
25 | + /* 获取渲染模板需要的数据 */ | ||
26 | + $data = Category\BrandModel::getBrandByChannel($channel); | ||
27 | + if (!is_array($data)) { | ||
28 | + $data = array(); | ||
29 | + } | ||
30 | + $data['brandPage'] = true; | ||
234 | 31 | ||
235 | - $this->_view->assign('title', 'YOHO!有货'); | ||
236 | - //$this->_view->display('brand', compact('brands')); | 32 | + // 渲染模板 |
237 | $this->_view->display('index', $data); | 33 | $this->_view->display('index', $data); |
238 | } | 34 | } |
239 | } | 35 | } |
@@ -2,6 +2,7 @@ | @@ -2,6 +2,7 @@ | ||
2 | use Yaf\Application; | 2 | use Yaf\Application; |
3 | 3 | ||
4 | define('SITE_DOMAIN', 'm.dev.yohobuy.com'); // 网站主域名 | 4 | define('SITE_DOMAIN', 'm.dev.yohobuy.com'); // 网站主域名 |
5 | +define('OLD_DOMAIN', 'm.yohobuy.com'); // 网站旧域名 | ||
5 | define('USE_CACHE', false); // 缓存的开关 | 6 | define('USE_CACHE', false); // 缓存的开关 |
6 | define('APPLICATION_PATH', dirname(__DIR__)); | 7 | define('APPLICATION_PATH', dirname(__DIR__)); |
7 | define('ROOT_PATH', dirname(dirname(APPLICATION_PATH))); | 8 | define('ROOT_PATH', dirname(dirname(APPLICATION_PATH))); |
@@ -2,6 +2,7 @@ | @@ -2,6 +2,7 @@ | ||
2 | use Yaf\Application; | 2 | use Yaf\Application; |
3 | 3 | ||
4 | define('SITE_DOMAIN', 'buy.test.yoho.cn'); // 网站主域名 | 4 | define('SITE_DOMAIN', 'buy.test.yoho.cn'); // 网站主域名 |
5 | +define('OLD_DOMAIN', 'm.yohobuy.com'); // 网站旧域名 | ||
5 | define('USE_CACHE', true); // 缓存的开关 | 6 | define('USE_CACHE', true); // 缓存的开关 |
6 | define('APPLICATION_PATH', dirname(__DIR__)); | 7 | define('APPLICATION_PATH', dirname(__DIR__)); |
7 | define('ROOT_PATH', dirname(dirname(APPLICATION_PATH))); | 8 | define('ROOT_PATH', dirname(dirname(APPLICATION_PATH))); |
@@ -2,6 +2,7 @@ | @@ -2,6 +2,7 @@ | ||
2 | use Yaf\Application; | 2 | use Yaf\Application; |
3 | 3 | ||
4 | define('SITE_DOMAIN', 'wap.yohobuy.com'); // 网站主域名 | 4 | define('SITE_DOMAIN', 'wap.yohobuy.com'); // 网站主域名 |
5 | +define('OLD_DOMAIN', 'm.yohobuy.com'); // 网站旧域名 | ||
5 | define('USE_CACHE', true); // 缓存的开关 | 6 | define('USE_CACHE', true); // 缓存的开关 |
6 | define('APPLICATION_PATH', dirname(__DIR__)); | 7 | define('APPLICATION_PATH', dirname(__DIR__)); |
7 | define('ROOT_PATH', dirname(dirname(APPLICATION_PATH))); | 8 | define('ROOT_PATH', dirname(dirname(APPLICATION_PATH))); |
-
Please register or login to post a comment