Merge branch 'develop' of git.dev.yoho.cn:web/yohobuy into develop
Showing
34 changed files
with
222 additions
and
199 deletions
@@ -39,6 +39,7 @@ class CacheConfig | @@ -39,6 +39,7 @@ class CacheConfig | ||
39 | const KEY_ACTION_PRODUCT_BRAND_DOMAINS = 'key_action_product_brand_domains'; // 所有品牌域名列表 | 39 | const KEY_ACTION_PRODUCT_BRAND_DOMAINS = 'key_action_product_brand_domains'; // 所有品牌域名列表 |
40 | const KEY_ACTION_PRODUCT_BRAND_NAMES = 'key_action_product_brand_names'; // 所有品牌名称列表 | 40 | const KEY_ACTION_PRODUCT_BRAND_NAMES = 'key_action_product_brand_names'; // 所有品牌名称列表 |
41 | const KEY_ACTION_PRODUCT_BRAND_LOGO = 'key_action_product_brand_logo'; // 品牌信息 | 41 | const KEY_ACTION_PRODUCT_BRAND_LOGO = 'key_action_product_brand_logo'; // 品牌信息 |
42 | + const KEY_ACTION_PRODUCT_BRAND_LOGO_DOMAIN = 'key_action_product_brand_logo_domain'; // 品牌信息通过域名取得 | ||
42 | 43 | ||
43 | const KEY_ACTION_SEARCH_SEARCH = 'key_action_search_search'; // 搜索的数据 | 44 | const KEY_ACTION_SEARCH_SEARCH = 'key_action_search_search'; // 搜索的数据 |
44 | const KEY_ACTION_SEARCH_FILTER = 'key_action_search_filter'; // 搜索的过滤条件 | 45 | const KEY_ACTION_SEARCH_FILTER = 'key_action_search_filter'; // 搜索的过滤条件 |
@@ -212,5 +212,16 @@ class BrandData | @@ -212,5 +212,16 @@ class BrandData | ||
212 | { | 212 | { |
213 | return Yohobuy::yarClient(Yohobuy::SERVICE_URL . '/shops/service/v1/brand', 'getBrandByids', array($id )); | 213 | return Yohobuy::yarClient(Yohobuy::SERVICE_URL . '/shops/service/v1/brand', 'getBrandByids', array($id )); |
214 | } | 214 | } |
215 | + | ||
216 | + /** | ||
217 | + * 通过域名获取品牌LOGO信息 | ||
218 | + * | ||
219 | + * @param int $id 用户ID | ||
220 | + * @return array | ||
221 | + */ | ||
222 | + public static function getBrandLogoByDomain($domain) | ||
223 | + { | ||
224 | + return Yohobuy::yarClient(Yohobuy::SERVICE_URL . '/shops/service/v1/brand', 'getBrandByDomain', array($domain )); | ||
225 | + } | ||
215 | 226 | ||
216 | } | 227 | } |
@@ -15,6 +15,7 @@ use Api\Yohobuy; | @@ -15,6 +15,7 @@ use Api\Yohobuy; | ||
15 | */ | 15 | */ |
16 | class DetailData | 16 | class DetailData |
17 | { | 17 | { |
18 | + | ||
18 | const URI_PACKAGE_ARTICLE = 'guang/service/v2/article/'; | 19 | const URI_PACKAGE_ARTICLE = 'guang/service/v2/article/'; |
19 | const URI_PACKAGE_AUTHOR = 'guang/service/v1/author/'; | 20 | const URI_PACKAGE_AUTHOR = 'guang/service/v1/author/'; |
20 | 21 | ||
@@ -36,15 +37,13 @@ class DetailData | @@ -36,15 +37,13 @@ class DetailData | ||
36 | 37 | ||
37 | // 客户端类型 | 38 | // 客户端类型 |
38 | $clientType = $isApp ? 'iphone' : 'h5'; | 39 | $clientType = $isApp ? 'iphone' : 'h5'; |
39 | - | 40 | + |
40 | // 获取资讯 | 41 | // 获取资讯 |
41 | - $article = Yohobuy::yarClient(Yohobuy::SERVICE_URL . self::URI_PACKAGE_ARTICLE, 'getArticle', array($id, $clientType)); | ||
42 | - if (!isset($article['tag'])) { | 42 | + $article = Yohobuy::yarClient(Yohobuy::SERVICE_URL . self::URI_PACKAGE_ARTICLE, 'getArticle', array($id, $clientType), 3600); |
43 | + if (!isset($article['author_id'])) { | ||
43 | return $result; | 44 | return $result; |
44 | } | 45 | } |
45 | - else { | ||
46 | - $result['getArticle'] = $article; | ||
47 | - } | 46 | + $result['getArticle'] = $article; |
48 | 47 | ||
49 | // 获取作者信息 | 48 | // 获取作者信息 |
50 | Yohobuy::yarConcurrentCall(Yohobuy::SERVICE_URL . self::URI_PACKAGE_AUTHOR, 'getAuthor', array($article['author_id'], $clientType), function ($retval) use (&$result) { | 49 | Yohobuy::yarConcurrentCall(Yohobuy::SERVICE_URL . self::URI_PACKAGE_AUTHOR, 'getAuthor', array($article['author_id'], $clientType), function ($retval) use (&$result) { |
@@ -62,9 +61,11 @@ class DetailData | @@ -62,9 +61,11 @@ class DetailData | ||
62 | }); | 61 | }); |
63 | 62 | ||
64 | // 获取资讯相关的其它资讯 | 63 | // 获取资讯相关的其它资讯 |
65 | - Yohobuy::yarConcurrentCall(Yohobuy::SERVICE_URL . self::URI_PACKAGE_ARTICLE, 'getOtherArticle', array($article['tag'], $id, 0, 3, $clientType), function ($retval) use (&$result) { | ||
66 | - $result['getOtherArticle'] = empty($retval) ? array() : $retval; | ||
67 | - }); | 64 | + if (isset($article['tag'])) { |
65 | + Yohobuy::yarConcurrentCall(Yohobuy::SERVICE_URL . self::URI_PACKAGE_ARTICLE, 'getOtherArticle', array($article['tag'], $id, 0, 3, $clientType), function ($retval) use (&$result) { | ||
66 | + $result['getOtherArticle'] = empty($retval) ? array() : $retval; | ||
67 | + }); | ||
68 | + } | ||
68 | 69 | ||
69 | // 调用发起请求 | 70 | // 调用发起请求 |
70 | Yohobuy::yarConcurrentLoop(); | 71 | Yohobuy::yarConcurrentLoop(); |
@@ -11,19 +11,12 @@ var $ = require('jquery'), | @@ -11,19 +11,12 @@ var $ = require('jquery'), | ||
11 | 11 | ||
12 | var swiper, | 12 | var swiper, |
13 | $fixTitleBar, | 13 | $fixTitleBar, |
14 | - $brandText, | ||
15 | - $brandHref, | ||
16 | $brandList = $('.brand-list'); | 14 | $brandList = $('.brand-list'); |
15 | +var $icon = $('.search-icon'); | ||
17 | 16 | ||
18 | var searchH = $('.newbrand-search').outerHeight(), | 17 | var searchH = $('.newbrand-search').outerHeight(), |
19 | headerH = $('.yoho-header').outerHeight(), | 18 | headerH = $('.yoho-header').outerHeight(), |
20 | brandSwipe = parseInt(searchH) + parseInt(headerH) - 1, | 19 | brandSwipe = parseInt(searchH) + parseInt(headerH) - 1, |
21 | - minBrandListTop, | ||
22 | - searchArray = [], | ||
23 | - clearTextHammer, | ||
24 | - removeHistory, | ||
25 | - searchList, | ||
26 | - yohoHistory, | ||
27 | minBrandListTop; | 20 | minBrandListTop; |
28 | 21 | ||
29 | var brandsData, | 22 | var brandsData, |
@@ -117,21 +110,6 @@ function searchResult() { | @@ -117,21 +110,6 @@ function searchResult() { | ||
117 | 110 | ||
118 | // 插入 dom,绑定事件 | 111 | // 插入 dom,绑定事件 |
119 | $('.search-result').html(html); | 112 | $('.search-result').html(html); |
120 | - $('.search-result .brand-list p').each(function (index) { | ||
121 | - searchList = new Hammer($('.search-result .brand-list p').eq(index)[0]); | ||
122 | - searchList.on('tap', function() { | ||
123 | - $brandText = $('.search-result .brand-list p').eq(index).find('a').html(); | ||
124 | - $brandHref = $('.search-result .brand-list p').eq(index).find('a').attr('href'); | ||
125 | - if (localStorage.getItem('yohoHistory')) { | ||
126 | - yohoHistory = localStorage.getItem('yohoHistory'); | ||
127 | - searchArray.push(yohoHistory); | ||
128 | - } | ||
129 | - if (searchArray.toString().split($brandText).length < 2) { | ||
130 | - searchArray.push('{"searchName":"' + $brandText + '","searchHref":"' + $brandText + '"}'); | ||
131 | - } | ||
132 | - localStorage.setItem('yohoHistory', searchArray); | ||
133 | - }); | ||
134 | - }); | ||
135 | } | 113 | } |
136 | 114 | ||
137 | if ($('.brand-search-page').length) { | 115 | if ($('.brand-search-page').length) { |
@@ -139,12 +117,13 @@ if ($('.brand-search-page').length) { | @@ -139,12 +117,13 @@ if ($('.brand-search-page').length) { | ||
139 | $keyword = $('#keyword'); | 117 | $keyword = $('#keyword'); |
140 | 118 | ||
141 | $keyword.on('input', function() { | 119 | $keyword.on('input', function() { |
142 | - $('.history').css('display', 'none'); | ||
143 | if ($keyword.val().length) { | 120 | if ($keyword.val().length) { |
144 | searchResult(); | 121 | searchResult(); |
122 | + $icon.css('color', '#000'); | ||
145 | $(this).closest('.search-box').css('width', '11.25rem'); | 123 | $(this).closest('.search-box').css('width', '11.25rem'); |
146 | $('.search-action').show(); | 124 | $('.search-action').show(); |
147 | } else { | 125 | } else { |
126 | + $icon.css('color', '#b2b2b2'); | ||
148 | $(this).closest('.search-box').css('width', '12.5rem'); | 127 | $(this).closest('.search-box').css('width', '12.5rem'); |
149 | $('.search-action').hide(); | 128 | $('.search-action').hide(); |
150 | } | 129 | } |
@@ -161,20 +140,5 @@ if ($('.brand-search-page').length) { | @@ -161,20 +140,5 @@ if ($('.brand-search-page').length) { | ||
161 | $('form.search-box').on('submit', function() { | 140 | $('form.search-box').on('submit', function() { |
162 | return false; | 141 | return false; |
163 | }); | 142 | }); |
164 | - if (localStorage && localStorage.getItem('yohoHistory')) { | ||
165 | - yohoHistory = $.parseJSON('[' + localStorage.getItem('yohoHistory') + ']'); | ||
166 | - if (yohoHistory) { | ||
167 | - $.each(yohoHistory, function(index, content) { | ||
168 | - $('<a href="' + content.searchHref + '">' + content.searchName + '</a>').appendTo('.historyList'); | ||
169 | - }); | ||
170 | - } | ||
171 | - } else { | ||
172 | - $('.history').css('display', 'none'); | ||
173 | - } | ||
174 | 143 | ||
175 | - removeHistory = new Hammer($('.removeHistory')[0]); | ||
176 | - removeHistory.on('tap', function(e) { | ||
177 | - $('.historyList').html(' '); | ||
178 | - localStorage.clear(); | ||
179 | - }); | ||
180 | } | 144 | } |
@@ -119,7 +119,7 @@ function rePosFooter() { | @@ -119,7 +119,7 @@ function rePosFooter() { | ||
119 | 119 | ||
120 | //未登录 | 120 | //未登录 |
121 | $op.prepend( | 121 | $op.prepend( |
122 | - '<a href="/signin.html">登录</a>' + | 122 | + '<a href="/signin.html?refer=' + location.href + '">登录</a>' + |
123 | '<span class="sep-line">|</span>' + | 123 | '<span class="sep-line">|</span>' + |
124 | '<a href="/reg.html">注册</a>' | 124 | '<a href="/reg.html">注册</a>' |
125 | ); | 125 | ); |
@@ -215,6 +215,7 @@ $('#yoho-footer').css({ | @@ -215,6 +215,7 @@ $('#yoho-footer').css({ | ||
215 | //set cookie | 215 | //set cookie |
216 | exports.set = function(c) { | 216 | exports.set = function(c) { |
217 | window.setCookie('_Channel', c, { | 217 | window.setCookie('_Channel', c, { |
218 | - expires: 365 | 218 | + expires: 365, |
219 | + domain: '.m.yohobuy.com' | ||
219 | }); | 220 | }); |
220 | }; | 221 | }; |
@@ -6,28 +6,36 @@ | @@ -6,28 +6,36 @@ | ||
6 | var $ = require('jquery'); | 6 | var $ = require('jquery'); |
7 | 7 | ||
8 | var $searchBox = $('.search-box'), | 8 | var $searchBox = $('.search-box'), |
9 | + $box = $('.box'), | ||
9 | $indexSearch = $('.index-search'), | 10 | $indexSearch = $('.index-search'), |
10 | $indexLogo = $('.index-logo'); | 11 | $indexLogo = $('.index-logo'); |
11 | 12 | ||
12 | -var $search = $searchBox.children('input'), | ||
13 | - $cancelSearch = $indexSearch.children('.no-search'); | 13 | +var $search = $searchBox.children('input[type="text"]'), |
14 | + $cancelSearch = $box.children('.no-search'), | ||
15 | + $searchIcon = $searchBox.children('.search-icon'); | ||
14 | 16 | ||
15 | require('../common'); | 17 | require('../common'); |
16 | 18 | ||
17 | $search.on('focus', function() { | 19 | $search.on('focus', function() { |
18 | - $indexSearch.addClass('action'); | 20 | + $box.addClass('action'); |
19 | $indexLogo.addClass('action'); | 21 | $indexLogo.addClass('action'); |
22 | +}).on('input', function() { | ||
23 | + if ($search.val() === '') { | ||
24 | + $searchIcon.addClass('empty'); | ||
25 | + } else { | ||
26 | + $searchIcon.removeClass('empty'); | ||
27 | + } | ||
20 | }); | 28 | }); |
21 | 29 | ||
22 | $cancelSearch.on('touchstart', function() { | 30 | $cancelSearch.on('touchstart', function() { |
23 | - $indexSearch.removeClass('action'); | 31 | + $box.removeClass('action'); |
24 | $indexLogo.removeClass('action'); | 32 | $indexLogo.removeClass('action'); |
25 | 33 | ||
26 | $search.blur(); | 34 | $search.blur(); |
27 | }); | 35 | }); |
28 | 36 | ||
29 | $searchBox.children('.clear-text').on('touchstart', function() { | 37 | $searchBox.children('.clear-text').on('touchstart', function() { |
30 | - $search.val('').focus(); | 38 | + $search.val('').focus().trigger('input'); |
31 | }); | 39 | }); |
32 | 40 | ||
33 | $searchBox.children('.search-icon').on('touchstart', function() { | 41 | $searchBox.children('.search-icon').on('touchstart', function() { |
@@ -34,10 +34,10 @@ chHammer.on('tap', function() { | @@ -34,10 +34,10 @@ chHammer.on('tap', function() { | ||
34 | 34 | ||
35 | $input.on('input', function() { | 35 | $input.on('input', function() { |
36 | if ($input.val() === '') { | 36 | if ($input.val() === '') { |
37 | - $icon.css('color','#b2b2b2'); | 37 | + $icon.css('color', '#b2b2b2'); |
38 | $clear.addClass('hide'); | 38 | $clear.addClass('hide'); |
39 | } else { | 39 | } else { |
40 | - $icon.css('color','#000'); | 40 | + $icon.css('color', '#000'); |
41 | $clear.removeClass('hide'); | 41 | $clear.removeClass('hide'); |
42 | } | 42 | } |
43 | }); | 43 | }); |
@@ -44,7 +44,8 @@ | @@ -44,7 +44,8 @@ | ||
44 | border: none; | 44 | border: none; |
45 | width: 95%; | 45 | width: 95%; |
46 | height: 60rem / $pxConvertRem; | 46 | height: 60rem / $pxConvertRem; |
47 | - line-height: 1; | 47 | + line-height: 60rem / $pxConvertRem; |
48 | + font-size: 1.2em; | ||
48 | padding: 0 10rem / $pxConvertRem; | 49 | padding: 0 10rem / $pxConvertRem; |
49 | } | 50 | } |
50 | 51 | ||
@@ -67,6 +68,7 @@ | @@ -67,6 +68,7 @@ | ||
67 | 68 | ||
68 | .clear-text { | 69 | .clear-text { |
69 | margin-right: 20rem / $pxConvertRem; | 70 | margin-right: 20rem / $pxConvertRem; |
71 | + color: #666; | ||
70 | } | 72 | } |
71 | } | 73 | } |
72 | } | 74 | } |
@@ -194,50 +196,4 @@ | @@ -194,50 +196,4 @@ | ||
194 | .search-result { | 196 | .search-result { |
195 | padding-top: 176rem / $pxConvertRem; | 197 | padding-top: 176rem / $pxConvertRem; |
196 | } | 198 | } |
197 | - .history{ | ||
198 | - width: 100%; | ||
199 | - height: auto; | ||
200 | - overflow: hidden; | ||
201 | - position: absolute; | ||
202 | - left: 0; | ||
203 | - top: 176rem / $pxConvertRem; | ||
204 | - > h6{ | ||
205 | - width: 100%; | ||
206 | - height: 88rem / $pxConvertRem; | ||
207 | - line-height: 88rem / $pxConvertRem; | ||
208 | - color: #999; | ||
209 | - text-indent: .6rem; | ||
210 | - font-size: 36em / $pxConvertRem; | ||
211 | - } | ||
212 | - .historyList{ | ||
213 | - width: 100%; | ||
214 | - height: auto; | ||
215 | - overflow: hidden; | ||
216 | - display: block; | ||
217 | - > a{ | ||
218 | - width: auto; | ||
219 | - height: 58rem / $pxConvertRem; | ||
220 | - overflow: hidden; | ||
221 | - line-height: 58rem / $pxConvertRem; | ||
222 | - margin: 0 0 20rem / $pxConvertRem .6rem; | ||
223 | - padding: 0 20rem / $pxConvertRem; | ||
224 | - float: left; | ||
225 | - background-color:#f8f8f8; | ||
226 | - color: #444; | ||
227 | - } | ||
228 | - } | ||
229 | - > span{ | ||
230 | - width: auto; | ||
231 | - height: 68rem / $pxConvertRem; | ||
232 | - overflow: hidden; | ||
233 | - display: inline-block; | ||
234 | - line-height: 68rem / $pxConvertRem; | ||
235 | - border:1px solid #e6e6e6; | ||
236 | - padding: 0 28rem / $pxConvertRem; | ||
237 | - font-size: 48em / $pxConvertRem; | ||
238 | - margin-left: .6rem; | ||
239 | - color: #000; | ||
240 | - } | ||
241 | - } | ||
242 | - | ||
243 | } | 199 | } |
1 | .hot-brands { | 1 | .hot-brands { |
2 | - background: #f0f0f0; | ||
3 | border-bottom: 1px solid #e0e0e0; | 2 | border-bottom: 1px solid #e0e0e0; |
3 | + background: #fff; | ||
4 | + | ||
5 | + .floor-header { | ||
6 | + background: #f0f0f0; | ||
7 | + margin: 0; | ||
8 | + padding: 29rem / $pxConvertRem 30rem / $pxConvertRem 0; | ||
9 | + border: 0; | ||
10 | + | ||
11 | + h2 { | ||
12 | + border: 1px solid #e0e0e0; | ||
13 | + background: #fff; | ||
14 | + border-bottom: 0; | ||
15 | + } | ||
16 | + } | ||
4 | 17 | ||
5 | a { | 18 | a { |
6 | display: block; | 19 | display: block; |
@@ -8,10 +21,6 @@ | @@ -8,10 +21,6 @@ | ||
8 | height: 100%; | 21 | height: 100%; |
9 | } | 22 | } |
10 | 23 | ||
11 | - > * { | ||
12 | - background: #fff; | ||
13 | - } | ||
14 | - | ||
15 | .brand { | 24 | .brand { |
16 | float: left; | 25 | float: left; |
17 | width: 158rem / $pxConvertRem; | 26 | width: 158rem / $pxConvertRem; |
@@ -71,7 +71,13 @@ | @@ -71,7 +71,13 @@ | ||
71 | background: white; | 71 | background: white; |
72 | border-radius: 5px; | 72 | border-radius: 5px; |
73 | margin-top: -13px; | 73 | margin-top: -13px; |
74 | - -webkit-tap-highlight-color: rgba(0, 0, 0, 0.5); | 74 | + -webkit-tap-highlight-color: rgba(0, 0, 0, 0.5); |
75 | + &:link, | ||
76 | + &:visited, | ||
77 | + &:hover, | ||
78 | + &:actived { | ||
79 | + color: #000; | ||
80 | + } | ||
75 | } | 81 | } |
76 | 82 | ||
77 | .circle-rightbottom { | 83 | .circle-rightbottom { |
@@ -3,6 +3,7 @@ | @@ -3,6 +3,7 @@ | ||
3 | overflow: hidden; | 3 | overflow: hidden; |
4 | margin: 0 auto; | 4 | margin: 0 auto; |
5 | .index-header { | 5 | .index-header { |
6 | + box-sizing: border-box; | ||
6 | padding: 0 20rem / $pxConvertRem; | 7 | padding: 0 20rem / $pxConvertRem; |
7 | width: 100%; | 8 | width: 100%; |
8 | height: 96rem / $pxConvertRem; | 9 | height: 96rem / $pxConvertRem; |
@@ -22,49 +23,49 @@ | @@ -22,49 +23,49 @@ | ||
22 | } | 23 | } |
23 | } | 24 | } |
24 | 25 | ||
25 | - .index-search { | ||
26 | - position: absolute; | ||
27 | - top: 0; | ||
28 | - right: 0; | ||
29 | - width: 384rem / $pxConvertRem; | ||
30 | - height: 96rem / $pxConvertRem; | ||
31 | - background: #fff; | 26 | + .box { |
27 | + position: relative; | ||
32 | overflow: hidden; | 28 | overflow: hidden; |
33 | - z-index: 3; | ||
34 | - @include transition(width .4s); | 29 | + z-index: 1; |
35 | 30 | ||
36 | &.action { | 31 | &.action { |
37 | - width: 620rem / $pxConvertRem; | ||
38 | .no-search, .clear-text { | 32 | .no-search, .clear-text { |
39 | display: block; | 33 | display: block; |
40 | } | 34 | } |
41 | 35 | ||
42 | .search-box { | 36 | .search-box { |
43 | - width: 512rem / $pxConvertRem; | 37 | + margin-left: 80rem / $pxConvertRem; |
44 | } | 38 | } |
45 | } | 39 | } |
40 | + } | ||
41 | + | ||
42 | + .index-search { | ||
43 | + height: 96rem / $pxConvertRem; | ||
44 | + background: #fff; | ||
45 | + overflow: hidden; | ||
46 | + @include transition(width .4s); | ||
46 | 47 | ||
47 | .search-box { | 48 | .search-box { |
48 | - float: left; | ||
49 | position: relative; | 49 | position: relative; |
50 | top: 20rem / $pxConvertRem; | 50 | top: 20rem / $pxConvertRem; |
51 | - width: 352rem / $pxConvertRem; | ||
52 | height: 56rem / $pxConvertRem; | 51 | height: 56rem / $pxConvertRem; |
53 | - padding-right: 40rem / $pxConvertRem; | ||
54 | - z-index: 1; | 52 | + padding-right: 80rem / $pxConvertRem; |
55 | transition: width 400ms; | 53 | transition: width 400ms; |
56 | box-sizing: border-box; | 54 | box-sizing: border-box; |
57 | border: 1px solid #ccc; | 55 | border: 1px solid #ccc; |
58 | overflow: hidden; | 56 | overflow: hidden; |
57 | + | ||
58 | + @include transition(margin-left 0.4s); | ||
59 | } | 59 | } |
60 | input { | 60 | input { |
61 | float: left; | 61 | float: left; |
62 | - width: 100%; | 62 | + width: 96%; |
63 | font-size: 28rem / $pxConvertRem; | 63 | font-size: 28rem / $pxConvertRem; |
64 | padding: 10rem / $pxConvertRem; | 64 | padding: 10rem / $pxConvertRem; |
65 | color: #999; | 65 | color: #999; |
66 | overflow: hidden; | 66 | overflow: hidden; |
67 | border: none; | 67 | border: none; |
68 | + -webkit-appearance: none; | ||
68 | } | 69 | } |
69 | .iconfont { | 70 | .iconfont { |
70 | position: absolute; | 71 | position: absolute; |
@@ -81,16 +82,22 @@ | @@ -81,16 +82,22 @@ | ||
81 | } | 82 | } |
82 | .search-icon { | 83 | .search-icon { |
83 | right: 10rem / $pxConvertRem; | 84 | right: 10rem / $pxConvertRem; |
84 | - color: #e6e6e6; | 85 | + color: #000; |
86 | + | ||
87 | + &.empty { | ||
88 | + color: #e6e6e6; | ||
89 | + } | ||
85 | } | 90 | } |
86 | } | 91 | } |
87 | 92 | ||
88 | .no-search { | 93 | .no-search { |
94 | + position: absolute; | ||
89 | display: none; | 95 | display: none; |
90 | float: left; | 96 | float: left; |
91 | margin-right: 10rem / $pxConvertRem; | 97 | margin-right: 10rem / $pxConvertRem; |
92 | color: #999; | 98 | color: #999; |
93 | font-size: 28rem / $pxConvertRem; | 99 | font-size: 28rem / $pxConvertRem; |
100 | + @inlcude transition(display .4s); | ||
94 | } | 101 | } |
95 | } | 102 | } |
96 | .index-container { | 103 | .index-container { |
@@ -29,7 +29,7 @@ | @@ -29,7 +29,7 @@ | ||
29 | top: 24rem / $pxConvertRem; | 29 | top: 24rem / $pxConvertRem; |
30 | right: 145rem / $pxConvertRem; | 30 | right: 145rem / $pxConvertRem; |
31 | font-size: 32rem / $pxConvertRem; | 31 | font-size: 32rem / $pxConvertRem; |
32 | - color: #b2b2b2; | 32 | + color: #666; |
33 | } | 33 | } |
34 | 34 | ||
35 | .search { | 35 | .search { |
@@ -38,8 +38,8 @@ | @@ -38,8 +38,8 @@ | ||
38 | left: 515rem / $pxConvertRem; | 38 | left: 515rem / $pxConvertRem; |
39 | border: none; | 39 | border: none; |
40 | background: transparent; | 40 | background: transparent; |
41 | - color: #b2b2b2; | ||
42 | - font-size: 32rem / $pxConvertRem; | 41 | + color: #000; |
42 | + font-size: 30rem / $pxConvertRem; | ||
43 | line-height: 56rem / $pxConvertRem; | 43 | line-height: 56rem / $pxConvertRem; |
44 | } | 44 | } |
45 | } | 45 | } |
@@ -13,7 +13,7 @@ | @@ -13,7 +13,7 @@ | ||
13 | 13 | ||
14 | input { | 14 | input { |
15 | height: 30px; | 15 | height: 30px; |
16 | - width: 100%; | 16 | + width: 95%; |
17 | border-radius: 15px; | 17 | border-radius: 15px; |
18 | text-indent: 26px; | 18 | text-indent: 26px; |
19 | background: #fff; | 19 | background: #fff; |
@@ -29,7 +29,7 @@ | @@ -29,7 +29,7 @@ | ||
29 | .search { | 29 | .search { |
30 | position: absolute; | 30 | position: absolute; |
31 | top: 12px; | 31 | top: 12px; |
32 | - right: 0; | 32 | + right: .4rem; |
33 | border: none; | 33 | border: none; |
34 | background: transparent; | 34 | background: transparent; |
35 | font-size: 16px; | 35 | font-size: 16px; |
@@ -10,11 +10,6 @@ | @@ -10,11 +10,6 @@ | ||
10 | </div> | 10 | </div> |
11 | </form> | 11 | </form> |
12 | </div> | 12 | </div> |
13 | - <div class="history"> | ||
14 | - <h6>历史纪录</h6> | ||
15 | - <div class="historyList"></div> | ||
16 | - <span class='removeHistory'>清空搜索历史</span> | ||
17 | - </div> | ||
18 | <div class="search-result"> | 13 | <div class="search-result"> |
19 | </div> | 14 | </div> |
20 | </div> | 15 | </div> |
@@ -3,15 +3,17 @@ | @@ -3,15 +3,17 @@ | ||
3 | <div class="index-container"> | 3 | <div class="index-container"> |
4 | <div class="index-header clearfix"> | 4 | <div class="index-header clearfix"> |
5 | <div class="iconfont index-logo"></div> | 5 | <div class="iconfont index-logo"></div> |
6 | - <form action="{{searchUrl}}" class="index-search"> | 6 | + <div class="box"> |
7 | <a href="javascript:void(0);" class="no-search">取消</a> | 7 | <a href="javascript:void(0);" class="no-search">取消</a> |
8 | - <div class="search-box"> | ||
9 | - <input type="hidden" name="from" value="search"> | ||
10 | - <input type="text" name="query" placeholder="搜索" autocomplete="off"> | ||
11 | - <span class="iconfont clear-text"></span> | ||
12 | - <span class="iconfont search-icon"></span> | ||
13 | - </div> | ||
14 | - </form> | 8 | + <form action="{{searchUrl}}" class="index-search"> |
9 | + <div class="search-box"> | ||
10 | + <input type="hidden" name="from" value="search"> | ||
11 | + <input type="text" name="query" placeholder="搜索" autocomplete="off"> | ||
12 | + <span class="iconfont clear-text"></span> | ||
13 | + <span class="iconfont search-icon empty"></span> | ||
14 | + </div> | ||
15 | + </form> | ||
16 | + </div> | ||
15 | </div> | 17 | </div> |
16 | <div class="index-channel"> | 18 | <div class="index-channel"> |
17 | <img class="img" src="{{background}}"> | 19 | <img class="img" src="{{background}}"> |
@@ -13,7 +13,7 @@ | @@ -13,7 +13,7 @@ | ||
13 | {{/if}} | 13 | {{/if}} |
14 | {{#if testEnv}} | 14 | {{#if testEnv}} |
15 | <script src="http://static.buy.test.yoho.cn/dist/myohobuy/{{version}}/lib.js"></script> | 15 | <script src="http://static.buy.test.yoho.cn/dist/myohobuy/{{version}}/lib.js"></script> |
16 | -<script src="http://static.buy.test.yoho.cn/dist/myohobuy/{{version}}/index.js"></script> | 16 | +<script src="http://static.buy.test.yoho.cn/dist/myohobuy/{{version}}/index-debug.js"></script> |
17 | {{/if}} | 17 | {{/if}} |
18 | {{#if devEnv}} | 18 | {{#if devEnv}} |
19 | <script src="http://localhost:8000/static/js/sea.js?nowrap"></script> | 19 | <script src="http://localhost:8000/static/js/sea.js?nowrap"></script> |
1 | {{# goodList}} | 1 | {{# goodList}} |
2 | {{# search}} | 2 | {{# search}} |
3 | <div id="search-input" class="search-input"> | 3 | <div id="search-input" class="search-input"> |
4 | - <form id="search-form" action={{url}} method="get"> | 4 | + <form id="search-form" action="{{url}}" method="get"> |
5 | <i class="search-icon iconfont"></i> | 5 | <i class="search-icon iconfont"></i> |
6 | - <input type="text" value={{default}} name="query"> | 6 | + <input type="text" value="{{default}}" name="query"> |
7 | + <input type="hidden" value="search" name="search"> | ||
7 | <i class="clear-input iconfont hide"></i> | 8 | <i class="clear-input iconfont hide"></i> |
8 | <button id="search" class="search" type="submit">搜索</button> | 9 | <button id="search" class="search" type="submit">搜索</button> |
9 | </form> | 10 | </form> |
@@ -23,7 +23,7 @@ class BoysController extends AbstractAction | @@ -23,7 +23,7 @@ class BoysController extends AbstractAction | ||
23 | } | 23 | } |
24 | 24 | ||
25 | // 设置COOKIE标识用户访问过该页面了 | 25 | // 设置COOKIE标识用户访问过该页面了 |
26 | - Index\HomeModel::setSwitchToCookie(Index\HomeModel::COOKIE_NAME_BOYS); | 26 | + // Index\HomeModel::setSwitchToCookie(Index\HomeModel::COOKIE_NAME_BOYS); |
27 | 27 | ||
28 | // 设置网站标题 | 28 | // 设置网站标题 |
29 | $this->setTitle('男生首页'); | 29 | $this->setTitle('男生首页'); |
@@ -18,7 +18,7 @@ class GirlsController extends AbstractAction | @@ -18,7 +18,7 @@ class GirlsController extends AbstractAction | ||
18 | $this->setExpires(300); // 缓存5分钟 | 18 | $this->setExpires(300); // 缓存5分钟 |
19 | 19 | ||
20 | // 设置COOKIE标识用户访问过该页面了 | 20 | // 设置COOKIE标识用户访问过该页面了 |
21 | - Index\HomeModel::setSwitchToCookie(Index\HomeModel::COOKIE_NAME_GIRLS); | 21 | + // Index\HomeModel::setSwitchToCookie(Index\HomeModel::COOKIE_NAME_GIRLS); |
22 | 22 | ||
23 | // 设置网站标题 | 23 | // 设置网站标题 |
24 | $this->setTitle('女生首页'); | 24 | $this->setTitle('女生首页'); |
@@ -18,7 +18,7 @@ class KidsController extends AbstractAction | @@ -18,7 +18,7 @@ class KidsController extends AbstractAction | ||
18 | $this->setExpires(300); // 缓存5分钟 | 18 | $this->setExpires(300); // 缓存5分钟 |
19 | 19 | ||
20 | // 设置COOKIE标识用户访问过该页面了 | 20 | // 设置COOKIE标识用户访问过该页面了 |
21 | - Index\HomeModel::setSwitchToCookie(Index\HomeModel::COOKIE_NAME_KIDS); | 21 | + // Index\HomeModel::setSwitchToCookie(Index\HomeModel::COOKIE_NAME_KIDS); |
22 | 22 | ||
23 | // 设置网站标题 | 23 | // 设置网站标题 |
24 | $this->setTitle('潮童首页'); | 24 | $this->setTitle('潮童首页'); |
@@ -18,7 +18,7 @@ class LifestyleController extends AbstractAction | @@ -18,7 +18,7 @@ class LifestyleController extends AbstractAction | ||
18 | $this->setExpires(300); // 缓存5分钟 | 18 | $this->setExpires(300); // 缓存5分钟 |
19 | 19 | ||
20 | // 设置COOKIE标识用户访问过该页面了 | 20 | // 设置COOKIE标识用户访问过该页面了 |
21 | - Index\HomeModel::setSwitchToCookie(Index\HomeModel::COOKIE_NAME_LIFESTYLE); | 21 | + // Index\HomeModel::setSwitchToCookie(Index\HomeModel::COOKIE_NAME_LIFESTYLE); |
22 | 22 | ||
23 | // 设置网站标题 | 23 | // 设置网站标题 |
24 | $this->setTitle('创意生活首页'); | 24 | $this->setTitle('创意生活首页'); |
@@ -16,11 +16,6 @@ class SearchController extends AbstractAction | @@ -16,11 +16,6 @@ class SearchController extends AbstractAction | ||
16 | */ | 16 | */ |
17 | public function indexAction() | 17 | public function indexAction() |
18 | { | 18 | { |
19 | - // 设置客户端浏览器1小时内不改变 | ||
20 | - $this->setLastModified(mktime(date('H'), 0, 0, date('n'), date('j'), date('Y'))); | ||
21 | - // 设置浏览器缓存5分钟 | ||
22 | - $this->setExpires(300); // 缓存5分钟 | ||
23 | - | ||
24 | $this->setNavHeader('搜索', true, SITE_MAIN); | 19 | $this->setNavHeader('搜索', true, SITE_MAIN); |
25 | 20 | ||
26 | //$this->_view->html('search'); | 21 | //$this->_view->html('search'); |
@@ -251,6 +246,7 @@ class SearchController extends AbstractAction | @@ -251,6 +246,7 @@ class SearchController extends AbstractAction | ||
251 | // $data = Product\ListModel::getClassData($condition); | 246 | // $data = Product\ListModel::getClassData($condition); |
252 | 247 | ||
253 | $data = Product\SearchModel::getSearchData($condition); | 248 | $data = Product\SearchModel::getSearchData($condition); |
249 | + | ||
254 | } while (false); | 250 | } while (false); |
255 | 251 | ||
256 | if (empty($data['new'])) { | 252 | if (empty($data['new'])) { |
@@ -168,7 +168,7 @@ class ListModel | @@ -168,7 +168,7 @@ class ListModel | ||
168 | } | 168 | } |
169 | 169 | ||
170 | // 调用接口查询数据 | 170 | // 调用接口查询数据 |
171 | - $brandLogo = BrandData::getBrandLogo($id); | 171 | + $brandLogo = BrandData::getBrandLogo($id); var_dump($brandLogo); exit; |
172 | // 处理返回的数据 | 172 | // 处理返回的数据 |
173 | if (isset($brandLogo['data'][0])) { | 173 | if (isset($brandLogo['data'][0])) { |
174 | $result = array( | 174 | $result = array( |
@@ -192,6 +192,53 @@ class ListModel | @@ -192,6 +192,53 @@ class ListModel | ||
192 | 192 | ||
193 | return $result; | 193 | return $result; |
194 | } | 194 | } |
195 | + | ||
196 | + /** | ||
197 | + * 根据品牌ID获取品牌LOGO | ||
198 | + * | ||
199 | + * @param int $id 品牌ID | ||
200 | + * @param string $title 品牌标题 | ||
201 | + * @return array | false | ||
202 | + */ | ||
203 | + public static function getBrandLogoByDomain($domain, &$title) | ||
204 | + { | ||
205 | + $result = false; | ||
206 | + | ||
207 | + if (USE_CACHE) { | ||
208 | + $key = CacheConfig::KEY_ACTION_PRODUCT_BRAND_LOGO_DOMAIN . strval($domain); | ||
209 | + // 先尝试获取一级缓存(master), 有数据则直接返回. | ||
210 | + $result = Cache::get($key, 'master'); | ||
211 | + if (!empty($result)) { | ||
212 | + return $result; | ||
213 | + } | ||
214 | + } | ||
215 | + | ||
216 | + // 调用接口查询数据 | ||
217 | + $brandLogo = BrandData::getBrandLogoByDomain($domain); | ||
218 | + // 处理返回的数据 | ||
219 | + if (isset($brandLogo['data'])) { | ||
220 | + $result = array( | ||
221 | + 'id' => $brandLogo['data']['id'], | ||
222 | + 'url' => Helpers::url('', null, $brandLogo['data']['brand_domain']), | ||
223 | + 'thumb' => Helpers::getImageUrl($brandLogo['data']['brand_ico'], 75, 40), | ||
224 | + 'name' => $brandLogo['data']['brand_name'], | ||
225 | + ); | ||
226 | + $title = $result['name']; | ||
227 | + } | ||
228 | + | ||
229 | + if (USE_CACHE) { | ||
230 | + // 接口调用异常时, 不害怕,从我们的二级缓存(slave)里再取数据. | ||
231 | + if (empty($result)) { | ||
232 | + $result = Cache::get($key, 'slave'); | ||
233 | + } | ||
234 | + // 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存 | ||
235 | + else { | ||
236 | + Cache::set($key, $result); // 缓存1小时 | ||
237 | + } | ||
238 | + } | ||
239 | + | ||
240 | + return $result; | ||
241 | + } | ||
195 | 242 | ||
196 | /** | 243 | /** |
197 | * 获取所有的品牌名称列表 | 244 | * 获取所有的品牌名称列表 |
@@ -49,7 +49,7 @@ class SearchModel | @@ -49,7 +49,7 @@ class SearchModel | ||
49 | // 处理返回的数据 | 49 | // 处理返回的数据 |
50 | if (isset($listData['code']) && $listData['code'] === 200) { | 50 | if (isset($listData['code']) && $listData['code'] === 200) { |
51 | $result = ListProcess::getListData($listData['data'], false); | 51 | $result = ListProcess::getListData($listData['data'], false); |
52 | - } | 52 | + } |
53 | 53 | ||
54 | if (USE_CACHE) { | 54 | if (USE_CACHE) { |
55 | // 接口调用异常时, 不害怕,从我们的二级缓存(slave)里再取数据. | 55 | // 接口调用异常时, 不害怕,从我们的二级缓存(slave)里再取数据. |
@@ -28,6 +28,8 @@ class IndexController extends AbstractAction | @@ -28,6 +28,8 @@ class IndexController extends AbstractAction | ||
28 | $gender = $this->get('gender', '1,2,3'); | 28 | $gender = $this->get('gender', '1,2,3'); |
29 | if (is_string($gender)) { | 29 | if (is_string($gender)) { |
30 | $gender = rawurldecode($gender); | 30 | $gender = rawurldecode($gender); |
31 | + } else { | ||
32 | + $gender = Helpers::getGenderByCookie(); | ||
31 | } | 33 | } |
32 | // // 设置侧边栏逛的默认选中状态 | 34 | // // 设置侧边栏逛的默认选中状态 |
33 | // if ($gender === '1,3') { | 35 | // if ($gender === '1,3') { |
@@ -26,18 +26,26 @@ class InfoController extends AbstractAction | @@ -26,18 +26,26 @@ class InfoController extends AbstractAction | ||
26 | $this->error(); | 26 | $this->error(); |
27 | } | 27 | } |
28 | 28 | ||
29 | + $data = array(); | ||
30 | + $data['guangDetail'] = true; // 模板中使用JS的标识 | ||
31 | + $data['guang']['id'] = $id; | ||
32 | + | ||
29 | // 标识是不是APP访问的 | 33 | // 标识是不是APP访问的 |
30 | $isApp = null !== $this->get('app_version', null); | 34 | $isApp = null !== $this->get('app_version', null); |
31 | - // 获取详情内容信息, 异常则跳到错误页面 | ||
32 | - $detail = DetailData::package($id, $isApp); | ||
33 | - if (empty($detail['getArticle'])) { | ||
34 | - $this->error(); | ||
35 | - } | 35 | + // 标识是否是微信访问 |
36 | + $isWeixin = stripos($this->server('HTTP_USER_AGENT', ''), 'MicroMessenger') !== false; | ||
36 | 37 | ||
37 | // WAP上设置头部导航 | 38 | // WAP上设置头部导航 |
38 | - if (!$isApp) { | 39 | + if (!$isApp && !$isWeixin) { |
39 | $this->setNavHeader('逛', true, SITE_MAIN); | 40 | $this->setNavHeader('逛', true, SITE_MAIN); |
40 | - } | 41 | + } |
42 | + | ||
43 | + // 获取详情内容信息, 异常则跳到错误页面 | ||
44 | + $detail = DetailData::package($id, $isApp); | ||
45 | + if (empty($detail['getArticle'])) { | ||
46 | + $this->_view->display('index', $data); | ||
47 | + return; | ||
48 | + } | ||
41 | 49 | ||
42 | $data = array(); | 50 | $data = array(); |
43 | $data['guangDetail'] = true; // 模板中使用JS的标识 | 51 | $data['guangDetail'] = true; // 模板中使用JS的标识 |
@@ -179,7 +187,7 @@ class InfoController extends AbstractAction | @@ -179,7 +187,7 @@ class InfoController extends AbstractAction | ||
179 | $data['shareImg'] = Helpers::getImageUrl($detail['getArticle']['cover_image'], 640, 320); | 187 | $data['shareImg'] = Helpers::getImageUrl($detail['getArticle']['cover_image'], 640, 320); |
180 | } | 188 | } |
181 | } | 189 | } |
182 | - | 190 | + |
183 | // 标识有微信分享 | 191 | // 标识有微信分享 |
184 | $data['hasWxShare'] = true; | 192 | $data['hasWxShare'] = true; |
185 | 193 | ||
@@ -188,7 +196,7 @@ class InfoController extends AbstractAction | @@ -188,7 +196,7 @@ class InfoController extends AbstractAction | ||
188 | $detail = array(); | 196 | $detail = array(); |
189 | $data = array(); | 197 | $data = array(); |
190 | } | 198 | } |
191 | - | 199 | + |
192 | /** | 200 | /** |
193 | * APP里使用的收藏内容的接口 | 201 | * APP里使用的收藏内容的接口 |
194 | * | 202 | * |
@@ -202,15 +210,14 @@ class InfoController extends AbstractAction | @@ -202,15 +210,14 @@ class InfoController extends AbstractAction | ||
202 | if (!$this->isAjax()) { | 210 | if (!$this->isAjax()) { |
203 | break; | 211 | break; |
204 | } | 212 | } |
205 | - | 213 | + |
206 | $id = $this->get('id'); | 214 | $id = $this->get('id'); |
207 | $type = $this->get('type'); | 215 | $type = $this->get('type'); |
208 | // 收藏 | 216 | // 收藏 |
209 | if ($type == 'fav') { | 217 | if ($type == 'fav') { |
210 | - | ||
211 | - } | ||
212 | - } | ||
213 | - while (false); | 218 | + |
219 | + } | ||
220 | + } while (false); | ||
214 | } | 221 | } |
215 | 222 | ||
216 | } | 223 | } |
@@ -85,6 +85,8 @@ class PlusstarController extends AbstractAction | @@ -85,6 +85,8 @@ class PlusstarController extends AbstractAction | ||
85 | $channel = $this->get('yh_channel'); | 85 | $channel = $this->get('yh_channel'); |
86 | // 标识是不是APP客户端 | 86 | // 标识是不是APP客户端 |
87 | $isApp = is_numeric($channel); | 87 | $isApp = is_numeric($channel); |
88 | + // 标识是否是微信访问 | ||
89 | + $isWeixin = stripos($this->server('HTTP_USER_AGENT', ''), 'MicroMessenger') !== false; | ||
88 | // APP访问时通过频道参数判断性别 | 90 | // APP访问时通过频道参数判断性别 |
89 | if ($isApp) { | 91 | if ($isApp) { |
90 | switch (intval($channel)) { | 92 | switch (intval($channel)) { |
@@ -99,7 +101,7 @@ class PlusstarController extends AbstractAction | @@ -99,7 +101,7 @@ class PlusstarController extends AbstractAction | ||
99 | } | 101 | } |
100 | $uid = $this->get('uid'); | 102 | $uid = $this->get('uid'); |
101 | $udid = $this->get('udid'); | 103 | $udid = $this->get('udid'); |
102 | - | 104 | + |
103 | $this->setSession('uid', $uid); | 105 | $this->setSession('uid', $uid); |
104 | } | 106 | } |
105 | // 从Cookie获取 | 107 | // 从Cookie获取 |
@@ -138,14 +140,14 @@ class PlusstarController extends AbstractAction | @@ -138,14 +140,14 @@ class PlusstarController extends AbstractAction | ||
138 | $data['ps']['newArrival']['moreUrl'] = $url; | 140 | $data['ps']['newArrival']['moreUrl'] = $url; |
139 | $data['ps']['newArrival']['naList'] = $brandInfo['getNewProduct']; | 141 | $data['ps']['newArrival']['naList'] = $brandInfo['getNewProduct']; |
140 | $data['ps']['infos'] = array(); | 142 | $data['ps']['infos'] = array(); |
141 | - | 143 | + |
142 | // 拼收藏的URL, 一个坑! | 144 | // 拼收藏的URL, 一个坑! |
143 | // 备注:此处是根据原来逛的代码硬扒过来的 | 145 | // 备注:此处是根据原来逛的代码硬扒过来的 |
144 | $defaultUrl = Helpers::url('/plustar/brandinfo', array('id' => $id), 'guang'); | 146 | $defaultUrl = Helpers::url('/plustar/brandinfo', array('id' => $id), 'guang'); |
145 | if ($isApp) { | 147 | if ($isApp) { |
146 | $url = $defaultUrl; | 148 | $url = $defaultUrl; |
147 | - $url .= '&openby:yohobuy={"action":"go.weblogin","params":{"jumpurl":{"url":"http:\/\/guang.m.yohobuy.com\/plustar\/brandinfo","param":{"id":' | ||
148 | - . $id . '}},"requesturl":{"url":"\/guang\/api\/v1\/favorite\/togglebrand","param":{"brand_id":"' . $brandId . '"}},"priority":"Y"}}'; | 149 | + $url .= '&openby:yohobuy={"action":"go.weblogin","params":{"jumpurl":{"url":"http:\/\/guang.m.yohobuy.com\/plustar\/brandinfo","param":{"id":' |
150 | + . $id . '}},"requesturl":{"url":"\/guang\/api\/v1\/favorite\/togglebrand","param":{"brand_id":"' . $brandId . '"}},"priority":"Y"}}'; | ||
149 | } else { | 151 | } else { |
150 | $url = Helpers::url('/signin.html', array('refer' => $defaultUrl)); | 152 | $url = Helpers::url('/signin.html', array('refer' => $defaultUrl)); |
151 | } | 153 | } |
@@ -157,20 +159,20 @@ class PlusstarController extends AbstractAction | @@ -157,20 +159,20 @@ class PlusstarController extends AbstractAction | ||
157 | 159 | ||
158 | // 相关文章 | 160 | // 相关文章 |
159 | foreach ($brandInfo['getArticleByBrand'] as $value) { | 161 | foreach ($brandInfo['getArticleByBrand'] as $value) { |
160 | - $data['ps']['infos'][] = Helpers::formatArticle($value, false, false, false, $uid); | 162 | + $data['ps']['infos'][] = Helpers::formatArticle($value, false, $isApp, false, $uid); |
161 | } | 163 | } |
162 | 164 | ||
163 | // 设置头部信息 | 165 | // 设置头部信息 |
164 | - if (!$isApp) { | 166 | + if (!$isApp && !$isWeixin) { |
165 | $this->setNavHeader($data['ps']['name'], true, SITE_MAIN); | 167 | $this->setNavHeader($data['ps']['name'], true, SITE_MAIN); |
166 | } | 168 | } |
167 | 169 | ||
168 | // 标识有微信分享 | 170 | // 标识有微信分享 |
169 | $data['hasWxShare'] = true; | 171 | $data['hasWxShare'] = true; |
170 | - | 172 | + |
171 | $data['shareLink'] = $defaultUrl; | 173 | $data['shareLink'] = $defaultUrl; |
172 | $data['shareTitle'] = $data['ps']['name']; | 174 | $data['shareTitle'] = $data['ps']['name']; |
173 | - $data['shareDesc'] = (mb_strlen($data['ps']['intro'],'utf-8') > 800) ? mb_substr($data['ps']['intro'], 0, 800, 'utf-8') . '...' : $data['ps']['intro']; | 175 | + $data['shareDesc'] = (mb_strlen($data['ps']['intro'], 'utf-8') > 120) ? mb_substr($data['ps']['intro'], 0, 120, 'utf-8') . '...' : $data['ps']['intro']; |
174 | $data['shareImg'] = $data['ps']['logo']; | 176 | $data['shareImg'] = $data['ps']['logo']; |
175 | 177 | ||
176 | $brandInfo = array(); | 178 | $brandInfo = array(); |
@@ -85,18 +85,23 @@ class IndexController extends AbstractAction | @@ -85,18 +85,23 @@ class IndexController extends AbstractAction | ||
85 | $this->go(SITE_MAIN); | 85 | $this->go(SITE_MAIN); |
86 | } | 86 | } |
87 | 87 | ||
88 | - /* 通过品牌域名找到对应的品牌ID */ | ||
89 | - $domainList = Product\ListModel::getAllBrandDomains(); | ||
90 | - $brandIds = array_keys($domainList, $domain); | 88 | + // 存标题信息 |
89 | + $title = ''; | ||
90 | + $brandLogo = Product\ListModel::getBrandLogoByDomain($domain, $title); | ||
91 | $brandId = 0; | 91 | $brandId = 0; |
92 | - if (isset($brandIds[0])) { | ||
93 | - $brandId = $brandIds[0]; | ||
94 | - } | ||
95 | - | 92 | + if ($brandLogo && isset($brandLogo['id'])) { |
93 | + $brandId = $brandLogo['id']; | ||
94 | + } | ||
95 | + | ||
96 | + /* 通过品牌域名找到对应的品牌ID */ | ||
97 | +// $domainList = Product\ListModel::getAllBrandDomains(); | ||
98 | +// $brandIds = array_keys($domainList, $domain); | ||
99 | +// $brandId = 0; | ||
100 | +// if (isset($brandIds[0])) { | ||
101 | +// $brandId = $brandIds[0]; | ||
102 | +// } | ||
96 | // 当前的登录用户UID | 103 | // 当前的登录用户UID |
97 | $uid = $this->getUid(); | 104 | $uid = $this->getUid(); |
98 | - // 存标题信息 | ||
99 | - $title = ''; | ||
100 | 105 | ||
101 | /* 搜索框相关 */ | 106 | /* 搜索框相关 */ |
102 | $from = $this->get('from'); | 107 | $from = $this->get('from'); |
@@ -114,7 +119,7 @@ class IndexController extends AbstractAction | @@ -114,7 +119,7 @@ class IndexController extends AbstractAction | ||
114 | 'gender' => FILTER_DEFAULT, | 119 | 'gender' => FILTER_DEFAULT, |
115 | 'p_d' => FILTER_DEFAULT,), false); | 120 | 'p_d' => FILTER_DEFAULT,), false); |
116 | $condition['brand'] = $brandId; | 121 | $condition['brand'] = $brandId; |
117 | - | 122 | + |
118 | if ($brandId === 0) { | 123 | if ($brandId === 0) { |
119 | $condition['query'] = $domain; | 124 | $condition['query'] = $domain; |
120 | } | 125 | } |
@@ -131,12 +136,13 @@ class IndexController extends AbstractAction | @@ -131,12 +136,13 @@ class IndexController extends AbstractAction | ||
131 | // 从搜索页过来的,显示搜索框, 和进入品牌引导信息 | 136 | // 从搜索页过来的,显示搜索框, 和进入品牌引导信息 |
132 | if ($from === 'search') { | 137 | if ($from === 'search') { |
133 | $data['goodList'] = array(); | 138 | $data['goodList'] = array(); |
134 | - $data['goodList']['brandWay'] = \Product\ListModel::getBrandLogoByIds($brandId, $title); | 139 | + //$data['goodList']['brandWay'] = \Product\ListModel::getBrandLogoByIds($brandId, $title); |
140 | + $data['goodList']['brandWay'] = $brandLogo; | ||
135 | $data['goodList']['search']['default'] = $query; | 141 | $data['goodList']['search']['default'] = $query; |
136 | $data['goodList']['search']['url'] = Helpers::url('', null, 'search'); | 142 | $data['goodList']['search']['url'] = Helpers::url('', null, 'search'); |
137 | } | 143 | } |
138 | // 品牌一览过来的展示品牌介绍和LOGO | 144 | // 品牌一览过来的展示品牌介绍和LOGO |
139 | - else { | 145 | + elseif ($brandId !== 0) { |
140 | $data['brandHome'] = \Product\ListModel::getBrandIntro($brandId, $uid, $title); | 146 | $data['brandHome'] = \Product\ListModel::getBrandIntro($brandId, $uid, $title); |
141 | $data['goodList'] = array(); | 147 | $data['goodList'] = array(); |
142 | } | 148 | } |
@@ -40,7 +40,7 @@ class OptController extends AbstractAction | @@ -40,7 +40,7 @@ class OptController extends AbstractAction | ||
40 | } | 40 | } |
41 | 41 | ||
42 | /* 判断用户是否登录 */ | 42 | /* 判断用户是否登录 */ |
43 | - $uid = $this->getUdid(); | 43 | + $uid = $this->getUid(); |
44 | if (!$uid) { | 44 | if (!$uid) { |
45 | $referer = $this->server('HTTP_REFERER', SITE_MAIN); | 45 | $referer = $this->server('HTTP_REFERER', SITE_MAIN); |
46 | $result = array('code' => 400, 'message' => '未登录', 'data' => Helpers::url('/signin.html', array('refer' => $referer))); | 46 | $result = array('code' => 400, 'message' => '未登录', 'data' => Helpers::url('/signin.html', array('refer' => $referer))); |
@@ -60,6 +60,7 @@ class OptController extends AbstractAction | @@ -60,6 +60,7 @@ class OptController extends AbstractAction | ||
60 | $result = array('code' => 401, 'message' => '参数不正确', 'data' => false); | 60 | $result = array('code' => 401, 'message' => '参数不正确', 'data' => false); |
61 | break; | 61 | break; |
62 | } | 62 | } |
63 | + | ||
63 | } while (false); | 64 | } while (false); |
64 | 65 | ||
65 | $this->echoJson($result); | 66 | $this->echoJson($result); |
1 | <?php | 1 | <?php |
2 | use Yaf\Application; | 2 | use Yaf\Application; |
3 | 3 | ||
4 | -define('SITE_MAIN', 'http://mtesth5.yohobuy.com'); // 网站主域名 | 4 | +define('SITE_MAIN', 'http://m.yohobuy.com'); // 网站主域名 |
5 | define('OLD_MAIN', 'http://m.yohobuy.com'); // 网站旧域名 | 5 | define('OLD_MAIN', 'http://m.yohobuy.com'); // 网站旧域名 |
6 | define('COOKIE_DOMAIN', '.yohobuy.com'); // COOKIE作用域 | 6 | define('COOKIE_DOMAIN', '.yohobuy.com'); // COOKIE作用域 |
7 | -define('SUB_DOMAIN', '.mtesth5.yohobuy.com'); // 子域名后缀 | 7 | +define('SUB_DOMAIN', '.m.yohobuy.com'); // 子域名后缀 |
8 | define('USE_CACHE', true); // 缓存的开关 | 8 | define('USE_CACHE', true); // 缓存的开关 |
9 | define('APPLICATION_PATH', dirname(__DIR__)); // 应用目录 | 9 | define('APPLICATION_PATH', dirname(__DIR__)); // 应用目录 |
10 | define('ROOT_PATH', dirname(dirname(APPLICATION_PATH))); // 根目录 | 10 | define('ROOT_PATH', dirname(dirname(APPLICATION_PATH))); // 根目录 |
-
Please register or login to post a comment