Authored by hf

fixes bug to guang and search

@@ -135,7 +135,6 @@ @@ -135,7 +135,6 @@
135 '.'<script> 135 '.'<script>
136 seajs.use(\'js/common\'); 136 seajs.use(\'js/common\');
137 </script> 137 </script>
138 -  
139 '.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('psList')))) ? '<script> 138 '.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('psList')))) ? '<script>
140 seajs.use(\'js/guang/plus-star/list\'); 139 seajs.use(\'js/guang/plus-star/list\');
141 </script> 140 </script>
@@ -151,8 +150,12 @@ @@ -151,8 +150,12 @@
151 ' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('guangDetail')))) ? '<script> 150 ' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('guangDetail')))) ? '<script>
152 seajs.use(\'js/guang/detail\'); 151 seajs.use(\'js/guang/detail\');
153 </script> 152 </script>
154 -' : '').'  
155 -'.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('regIndex')))) ? '<script> 153 +' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('guangEzine')))) ? '<script>
  154 + seajs.use(\'js/guang/detail\', function(detail) {
  155 + detail.init(true);
  156 + });
  157 +</script>
  158 +' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('regIndex')))) ? '<script>
156 seajs.use(\'js/passport/register/register\'); 159 seajs.use(\'js/passport/register/register\');
157 </script> 160 </script>
158 ' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('regCode')))) ? '<script> 161 ' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('regCode')))) ? '<script>
@@ -161,15 +164,13 @@ @@ -161,15 +164,13 @@
161 ' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('regPwd')))) ? '<script> 164 ' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('regPwd')))) ? '<script>
162 seajs.use(\'js/passport/register/password\'); 165 seajs.use(\'js/passport/register/password\');
163 </script> 166 </script>
164 -' : '').'  
165 -'.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('loginIndex')))) ? '<script> 167 +' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('loginIndex')))) ? '<script>
166 seajs.use(\'js/passport/login/login\'); 168 seajs.use(\'js/passport/login/login\');
167 </script> 169 </script>
168 -' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('loginInternational')))) ? ' <script> 170 +' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('loginInternational')))) ? '<script>
169 seajs.use(\'js/passport/login/international\'); 171 seajs.use(\'js/passport/login/international\');
170 - </script>  
171 -' : '').'  
172 -'.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('backEmail')))) ? '<script> 172 +</script>
  173 +' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('backEmail')))) ? '<script>
173 seajs.use(\'js/passport/back/email\'); 174 seajs.use(\'js/passport/back/email\');
174 </script> 175 </script>
175 ' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('backEmailSuccess')))) ? '<script> 176 ' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('backEmailSuccess')))) ? '<script>
@@ -184,13 +185,11 @@ @@ -184,13 +185,11 @@
184 ' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('backNewPwd')))) ? '<script> 185 ' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('backNewPwd')))) ? '<script>
185 seajs.use(\'js/passport/back/new-password\'); 186 seajs.use(\'js/passport/back/new-password\');
186 </script> 187 </script>
187 -' : '').'  
188 -'.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('channelPage')))) ? '<script> 188 +' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('channelPage')))) ? '<script>
189 seajs.use(\'js/index/channel\'); 189 seajs.use(\'js/index/channel\');
190 seajs.use(\'js/index/footer\'); 190 seajs.use(\'js/index/footer\');
191 </script> 191 </script>
192 -' : '').'  
193 -'.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('grilsHomePage')))) ? '<script> 192 +' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('grilsHomePage')))) ? '<script>
194 seajs.use(\'js/home/home\', function(h) { 193 seajs.use(\'js/home/home\', function(h) {
195 h.set(\'girls\'); 194 h.set(\'girls\');
196 }); 195 });
@@ -214,42 +213,34 @@ @@ -214,42 +213,34 @@
214 }); 213 });
215 seajs.use(\'js/index/footer\'); 214 seajs.use(\'js/index/footer\');
216 </script> 215 </script>
217 -' : '').'  
218 -'.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('newArrivalPage')))) ? '<script> 216 +' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('newArrivalPage')))) ? '<script>
219 seajs.use(\'js/product/newsale/newarrival\'); 217 seajs.use(\'js/product/newsale/newarrival\');
220 seajs.use(\'js/index/footer\'); 218 seajs.use(\'js/index/footer\');
221 </script> 219 </script>
222 -' : '').'  
223 -'.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('discountPage')))) ? '<script> 220 +' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('discountPage')))) ? '<script>
224 seajs.use(\'js/product/newsale/discount\'); 221 seajs.use(\'js/product/newsale/discount\');
225 seajs.use(\'js/index/footer\'); 222 seajs.use(\'js/index/footer\');
226 </script> 223 </script>
227 -' : '').'  
228 -'.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('goodListPage')))) ? '<script> 224 +' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('goodListPage')))) ? '<script>
229 seajs.use(\'js/product/list\'); 225 seajs.use(\'js/product/list\');
230 seajs.use(\'js/index/footer\'); 226 seajs.use(\'js/index/footer\');
231 </script> 227 </script>
232 -' : '').'  
233 -'.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('goodsDetailPage')))) ? '<script> 228 +' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('goodsDetailPage')))) ? '<script>
234 seajs.use(\'js/product/detail/detail\'); 229 seajs.use(\'js/product/detail/detail\');
235 </script> 230 </script>
236 -' : '').'  
237 -'.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('categoryPage')))) ? '<script> 231 +' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('categoryPage')))) ? '<script>
238 seajs.use(\'js/category/index\'); 232 seajs.use(\'js/category/index\');
239 seajs.use(\'js/index/footer\'); 233 seajs.use(\'js/index/footer\');
240 </script> 234 </script>
241 -' : '').'  
242 -'.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('brandPage')))) ? '<script> 235 +' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('brandPage')))) ? '<script>
243 seajs.use(\'js/category/brand\'); 236 seajs.use(\'js/category/brand\');
244 seajs.use(\'js/index/footer\'); 237 seajs.use(\'js/index/footer\');
245 </script> 238 </script>
246 -' : '').'  
247 -'.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('searchPage')))) ? '<script> 239 +' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('searchPage')))) ? '<script>
248 seajs.use(\'js/index/search\'); 240 seajs.use(\'js/index/search\');
249 seajs.use(\'js/index/footer\'); 241 seajs.use(\'js/index/footer\');
250 </script> 242 </script>
251 -' : '').'  
252 -'.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('shoppingCartPage')))) ? '<script> 243 +' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('shoppingCartPage')))) ? '<script>
253 seajs.use(\'js/shopping-cart/cart\'); 244 seajs.use(\'js/shopping-cart/cart\');
254 </script> 245 </script>
255 ' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('giftAdvancePage')))) ? '<script> 246 ' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('giftAdvancePage')))) ? '<script>
@@ -39,7 +39,7 @@ class DetailData @@ -39,7 +39,7 @@ class DetailData
39 $clientType = $isApp ? 'iphone' : 'h5'; 39 $clientType = $isApp ? 'iphone' : 'h5';
40 40
41 // 获取资讯 41 // 获取资讯
42 - $article = Yohobuy::yarClient(Yohobuy::SERVICE_URL . self::URI_PACKAGE_ARTICLE, 'getArticle', array($id, $clientType), 3600); 42 + $article = Yohobuy::yarClient(Yohobuy::SERVICE_URL . self::URI_PACKAGE_ARTICLE, 'getArticle', array($id, $clientType));
43 if (!isset($article['author_id'])) { 43 if (!isset($article['author_id'])) {
44 return $result; 44 return $result;
45 } 45 }
@@ -73,4 +73,47 @@ class DetailData @@ -73,4 +73,47 @@ class DetailData
73 return $result; 73 return $result;
74 } 74 }
75 75
  76 + /**
  77 + * 逛资讯详情页数据封装 (专为YOHO!潮流志APP提供)
  78 + *
  79 + * @param int $id 内容ID
  80 + * @param bool $isApp 标识是否是APP访问
  81 + * @return array
  82 + */
  83 + public static function packageFoEzine($id, $isApp = false)
  84 + {
  85 + $result = array();
  86 + $result['getAuthor'] = array();
  87 + $result['getArticle'] = array();
  88 + $result['getArticleContent'] = array();
  89 + $result['getBrand'] = array();
  90 + $result['getOtherArticle'] = array();
  91 +
  92 + // 客户端类型
  93 + $clientType = $isApp ? 'iphone' : 'h5';
  94 +
  95 + // 获取资讯
  96 + $article = Yohobuy::yarClient(Yohobuy::SERVICE_URL . self::URI_PACKAGE_ARTICLE, 'getArticle', array($id, $clientType));
  97 + if (!isset($article['author_id'])) {
  98 + return $result;
  99 + }
  100 + $result['getArticle'] = $article;
  101 +
  102 + // 获取资讯内容
  103 + Yohobuy::yarConcurrentCall(Yohobuy::SERVICE_URL . self::URI_PACKAGE_ARTICLE, 'getArticleContent', array($id, $clientType), function ($retval) use (&$result) {
  104 + $result['getArticleContent'] = empty($retval) ? array() : $retval;
  105 + });
  106 +
  107 + // 获取资讯相关的品牌
  108 + Yohobuy::yarConcurrentCall(Yohobuy::SERVICE_URL . self::URI_PACKAGE_ARTICLE, 'getBrand', array($id, $clientType), function ($retval) use (&$result) {
  109 + $result['getBrand'] = empty($retval) ? array() : $retval;
  110 + });
  111 +
  112 + // 调用发起请求
  113 + Yohobuy::yarConcurrentLoop();
  114 +
  115 + return $result;
  116 + }
  117 +
  118 +
76 } 119 }
@@ -125,7 +125,7 @@ class PlusstarData @@ -125,7 +125,7 @@ class PlusstarData
125 $result['getArticleByBrand'] = array(); 125 $result['getArticleByBrand'] = array();
126 126
127 // 品牌详情信息 127 // 品牌详情信息
128 - $brandInfo = Yohobuy::yarClient(Yohobuy::SERVICE_URL . self::URI_BRANDINFO_PLUSSTAR, 'getBrandInfo', array(array('id' => $id))); 128 + $brandInfo = Yohobuy::yarClient(Yohobuy::SERVICE_URL . self::URI_BRANDINFO_PLUSSTAR, 'getBrandInfo', array(array('id' => $id)), 3600); // 缓存1小时
129 if (!isset($brandInfo['data']['brand_id'])) { 129 if (!isset($brandInfo['data']['brand_id'])) {
130 return $result; 130 return $result;
131 } else { 131 } else {
@@ -160,7 +160,7 @@ class PlusstarData @@ -160,7 +160,7 @@ class PlusstarData
160 $param['gender'] = $gender; 160 $param['gender'] = $gender;
161 $param['order'] = 's_t_desc'; 161 $param['order'] = 's_t_desc';
162 $param['client_secret'] = Sign::getSign($param); 162 $param['client_secret'] = Sign::getSign($param);
163 - $newProduct = Yohobuy::get(Yohobuy::API_URL, $param); 163 + $newProduct = Yohobuy::get(Yohobuy::API_URL, $param, 1800); // 缓存30分钟
164 if (empty($newProduct['data']['product_list'])) { 164 if (empty($newProduct['data']['product_list'])) {
165 break; 165 break;
166 } 166 }
@@ -201,6 +201,14 @@ server @@ -201,6 +201,14 @@ server
201 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 201 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
202 proxy_set_header Accept-Encoding "gzip"; 202 proxy_set_header Accept-Encoding "gzip";
203 } 203 }
  204 + location ^~ /info/mini {
  205 + proxy_redirect off;
  206 + proxy_pass http://yohobuy;
  207 + proxy_set_header Host $host;
  208 + proxy_set_header X-Real-IP $remote_addr;
  209 + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  210 + proxy_set_header Accept-Encoding "gzip";
  211 + }
204 location ^~ /plustar { 212 location ^~ /plustar {
205 proxy_redirect off; 213 proxy_redirect off;
206 proxy_pass http://yohobuy; 214 proxy_pass http://yohobuy;
@@ -155,7 +155,7 @@ if (hasCollocationBlock) { @@ -155,7 +155,7 @@ if (hasCollocationBlock) {
155 /** 155 /**
156 * 初始化页面参数 156 * 初始化页面参数
157 */ 157 */
158 -exports.init = function (flag) { 158 +exports.init = function(flag) {
159 if (flag === true) { 159 if (flag === true) {
160 isEzinPage = true; 160 isEzinPage = true;
161 } 161 }
@@ -177,7 +177,7 @@ window.onload = function() { @@ -177,7 +177,7 @@ window.onload = function() {
177 click: true 177 click: true
178 }); 178 });
179 179
180 - document.addEventListener('touchmove', function (e) { 180 + document.addEventListener('touchmove', function(e) {
181 e.preventDefault(); 181 e.preventDefault();
182 }, false); 182 }, false);
183 183
1 { 1 {
2 "name": "yohobuy", 2 "name": "yohobuy",
3 - "version": "1.1.4", 3 + "version": "1.1.5",
4 "description": "yohobuy statics", 4 "description": "yohobuy statics",
5 "keywords": [], 5 "keywords": [],
6 "homepage": "", 6 "homepage": "",
@@ -154,10 +154,10 @@ @@ -154,10 +154,10 @@
154 </div> 154 </div>
155 155
156 {{!-- wx-share --}} 156 {{!-- wx-share --}}
157 - <input id="shareLink" type="hidden" value={{shareLink}}>  
158 - <input id="shareImg" type="hidden" value={{shareImg}}>  
159 - <input id="shareTitle" type="hidden" value={{shareTitle}}>  
160 - <input id="shareDesc" type="hidden" value={{shareDesc}}> 157 + <input id="shareLink" type="hidden" value="{{shareLink}}">
  158 + <input id="shareImg" type="hidden" value="{{shareImg}}">
  159 + <input id="shareTitle" type="hidden" value="{{shareTitle}}">
  160 + <input id="shareDesc" type="hidden" value="{{shareDesc}}">
161 {{/ guang}} 161 {{/ guang}}
162 </div> 162 </div>
163 {{> layout/footer}} 163 {{> layout/footer}}
@@ -52,13 +52,13 @@ @@ -52,13 +52,13 @@
52 </div> 52 </div>
53 {{/if}} 53 {{/if}}
54 54
55 - <input id="jump-to-app" type="hidden" value={{jumpToApp}}> 55 + <input id="jump-to-app" type="hidden" value="{{jumpToApp}}">
56 56
57 {{!-- wx-share --}} 57 {{!-- wx-share --}}
58 - <input id="shareLink" type="hidden" value={{shareLink}}>  
59 - <input id="shareImg" type="hidden" value={{shareImg}}>  
60 - <input id="shareTitle" type="hidden" value={{shareTitle}}>  
61 - <input id="shareDesc" type="hidden" value={{shareDesc}}> 58 + <input id="shareLink" type="hidden" value="{{shareLink}}">
  59 + <input id="shareImg" type="hidden" value="{{shareImg}}">
  60 + <input id="shareTitle" type="hidden" value="{{shareTitle}}">
  61 + <input id="shareDesc" type="hidden" value="{{shareDesc}}">
62 {{/ ps}} 62 {{/ ps}}
63 </div> 63 </div>
64 {{>layout/footer}} 64 {{>layout/footer}}
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>
@@ -28,7 +27,13 @@ @@ -28,7 +27,13 @@
28 seajs.use('js/guang/detail'); 27 seajs.use('js/guang/detail');
29 </script> 28 </script>
30 {{/if}} 29 {{/if}}
31 - 30 +{{#if guangEzine}}
  31 +<script>
  32 + seajs.use('js/guang/detail', function(detail) {
  33 + detail.init(true);
  34 + });
  35 +</script>
  36 +{{/if}}
32 {{!-- 注册 --}} 37 {{!-- 注册 --}}
33 {{#if regIndex}} 38 {{#if regIndex}}
34 <script> 39 <script>
@@ -45,7 +50,6 @@ @@ -45,7 +50,6 @@
45 seajs.use('js/passport/register/password'); 50 seajs.use('js/passport/register/password');
46 </script> 51 </script>
47 {{/if}} 52 {{/if}}
48 -  
49 {{!-- 登陆 --}} 53 {{!-- 登陆 --}}
50 {{#if loginIndex}} 54 {{#if loginIndex}}
51 <script> 55 <script>
@@ -53,11 +57,10 @@ @@ -53,11 +57,10 @@
53 </script> 57 </script>
54 {{/if}} 58 {{/if}}
55 {{#if loginInternational}} 59 {{#if loginInternational}}
56 - <script> 60 +<script>
57 seajs.use('js/passport/login/international'); 61 seajs.use('js/passport/login/international');
58 - </script> 62 +</script>
59 {{/if}} 63 {{/if}}
60 -  
61 {{!-- 密码找回 --}} 64 {{!-- 密码找回 --}}
62 {{#if backEmail}} 65 {{#if backEmail}}
63 <script> 66 <script>
@@ -84,7 +87,6 @@ @@ -84,7 +87,6 @@
84 seajs.use('js/passport/back/new-password'); 87 seajs.use('js/passport/back/new-password');
85 </script> 88 </script>
86 {{/if}} 89 {{/if}}
87 -  
88 {{!-- 频道选择页 --}} 90 {{!-- 频道选择页 --}}
89 {{#if channelPage}} 91 {{#if channelPage}}
90 <script> 92 <script>
@@ -92,7 +94,6 @@ @@ -92,7 +94,6 @@
92 seajs.use('js/index/footer'); 94 seajs.use('js/index/footer');
93 </script> 95 </script>
94 {{/if}} 96 {{/if}}
95 -  
96 {{!-- 首页 --}} 97 {{!-- 首页 --}}
97 {{#if grilsHomePage}} 98 {{#if grilsHomePage}}
98 <script> 99 <script>
@@ -126,7 +127,6 @@ @@ -126,7 +127,6 @@
126 seajs.use('js/index/footer'); 127 seajs.use('js/index/footer');
127 </script> 128 </script>
128 {{/if}} 129 {{/if}}
129 -  
130 {{!-- 新品到着 --}} 130 {{!-- 新品到着 --}}
131 {{#if newArrivalPage}} 131 {{#if newArrivalPage}}
132 <script> 132 <script>
@@ -134,7 +134,6 @@ @@ -134,7 +134,6 @@
134 seajs.use('js/index/footer'); 134 seajs.use('js/index/footer');
135 </script> 135 </script>
136 {{/if}} 136 {{/if}}
137 -  
138 {{!-- 折扣专区 --}} 137 {{!-- 折扣专区 --}}
139 {{#if discountPage}} 138 {{#if discountPage}}
140 <script> 139 <script>
@@ -142,7 +141,6 @@ @@ -142,7 +141,6 @@
142 seajs.use('js/index/footer'); 141 seajs.use('js/index/footer');
143 </script> 142 </script>
144 {{/if}} 143 {{/if}}
145 -  
146 {{!-- 商品列表 --}} 144 {{!-- 商品列表 --}}
147 {{#if goodListPage}} 145 {{#if goodListPage}}
148 <script> 146 <script>
@@ -150,14 +148,12 @@ @@ -150,14 +148,12 @@
150 seajs.use('js/index/footer'); 148 seajs.use('js/index/footer');
151 </script> 149 </script>
152 {{/if}} 150 {{/if}}
153 -  
154 {{!-- 商品详情 --}} 151 {{!-- 商品详情 --}}
155 {{#if goodsDetailPage}} 152 {{#if goodsDetailPage}}
156 <script> 153 <script>
157 seajs.use('js/product/detail/detail'); 154 seajs.use('js/product/detail/detail');
158 </script> 155 </script>
159 {{/if}} 156 {{/if}}
160 -  
161 {{!-- 品类 --}} 157 {{!-- 品类 --}}
162 {{#if categoryPage}} 158 {{#if categoryPage}}
163 <script> 159 <script>
@@ -165,7 +161,6 @@ @@ -165,7 +161,6 @@
165 seajs.use('js/index/footer'); 161 seajs.use('js/index/footer');
166 </script> 162 </script>
167 {{/if}} 163 {{/if}}
168 -  
169 {{!-- 品牌 --}} 164 {{!-- 品牌 --}}
170 {{#if brandPage}} 165 {{#if brandPage}}
171 <script> 166 <script>
@@ -173,7 +168,6 @@ @@ -173,7 +168,6 @@
173 seajs.use('js/index/footer'); 168 seajs.use('js/index/footer');
174 </script> 169 </script>
175 {{/if}} 170 {{/if}}
176 -  
177 {{!-- 搜索 --}} 171 {{!-- 搜索 --}}
178 {{#if searchPage}} 172 {{#if searchPage}}
179 <script> 173 <script>
@@ -181,7 +175,6 @@ @@ -181,7 +175,6 @@
181 seajs.use('js/index/footer'); 175 seajs.use('js/index/footer');
182 </script> 176 </script>
183 {{/if}} 177 {{/if}}
184 -  
185 {{!-- 购物车 --}} 178 {{!-- 购物车 --}}
186 {{#if shoppingCartPage}} 179 {{#if shoppingCartPage}}
187 <script> 180 <script>
@@ -51,6 +51,9 @@ class SearchController extends AbstractAction @@ -51,6 +51,9 @@ class SearchController extends AbstractAction
51 $condition['p_d'] = rawurldecode($condition['discount']); 51 $condition['p_d'] = rawurldecode($condition['discount']);
52 unset($condition['discount']); 52 unset($condition['discount']);
53 } 53 }
  54 + if (isset($condition['query'])) {
  55 + $condition['query'] = rawurlencode($condition['query']);
  56 + }
54 57
55 // 标识用户是否有输入搜索内容 58 // 标识用户是否有输入搜索内容
56 $haveQuery = $query !== null; 59 $haveQuery = $query !== null;
@@ -221,6 +224,10 @@ class SearchController extends AbstractAction @@ -221,6 +224,10 @@ class SearchController extends AbstractAction
221 if (isset($condition['gender'])) { 224 if (isset($condition['gender'])) {
222 $condition['gender'] = rawurldecode($condition['gender']); 225 $condition['gender'] = rawurldecode($condition['gender']);
223 } 226 }
  227 + if (isset($condition['query'])) {
  228 + $condition['query'] = rawurldecode($condition['query']);
  229 + }
  230 +
224 // 转换排序方式 231 // 转换排序方式
225 $type = $this->get('type', ''); 232 $type = $this->get('type', '');
226 $order = $this->get('order', 0); 233 $order = $this->get('order', 0);
@@ -47,10 +47,6 @@ class InfoController extends AbstractAction @@ -47,10 +47,6 @@ class InfoController extends AbstractAction
47 return; 47 return;
48 } 48 }
49 49
50 - $data = array();  
51 - $data['guangDetail'] = true; // 模板中使用JS的标识  
52 - $data['guang']['id'] = $id;  
53 -  
54 // 作者信息数据 50 // 作者信息数据
55 if (isset($detail['getAuthor']['name'])) { 51 if (isset($detail['getAuthor']['name'])) {
56 $data['guang']['author'] = array(); 52 $data['guang']['author'] = array();
@@ -204,20 +200,140 @@ class InfoController extends AbstractAction @@ -204,20 +200,140 @@ class InfoController extends AbstractAction
204 * @param type "fav"表示收藏 或者 "cancel"表示取消收藏 200 * @param type "fav"表示收藏 或者 "cancel"表示取消收藏
205 * @return json 201 * @return json
206 */ 202 */
207 - public function collectAction() 203 + public function miniAction()
208 { 204 {
209 - do {  
210 - if (!$this->isAjax()) { 205 + $id = $this->get('id');
  206 +
  207 + // 判断参数是否有效, 无效会跳转到错误页面
  208 + if (!is_numeric($id)) {
  209 + $this->error();
  210 + }
  211 +
  212 + $data = array();
  213 + $data['guangEzine'] = true; // 模板中使用JS的标识
  214 + $data['guang']['id'] = $id;
  215 +
  216 + // 获取详情内容信息, 异常则跳到错误页面
  217 + $detail = DetailData::packageFoEzine($id, true);
  218 + if (empty($detail['getArticle'])) {
  219 + $this->_view->display('index', $data);
  220 + return;
  221 + }
  222 +
  223 + $data['detail'] = array();
  224 + $data['detail']['title'] = $detail['getArticle']['article_title'];
  225 + $data['detail']['publishTime'] = $detail['getArticle']['publishTime'];
  226 + $data['detail']['pageView'] = $detail['getArticle']['pageViews'];
  227 + $data['detail']['content'] = array();
  228 +
  229 + if (!empty($detail['getArticleContent'])) {
  230 + $build = array();
  231 + $good = array();
  232 + $skns = array();
  233 + $product = array();
  234 +
  235 + foreach ($detail['getArticleContent'] as $value) {
  236 + $build = array();
  237 + // 文字
  238 + if (isset($value['text'])) {
  239 + $build['text'] = $value['text']['data']['text'];
  240 + }
  241 + // 单张图
  242 + elseif (isset($value['singleImage'])) {
  243 + $build['bigImage'] = Helpers::getImageUrl($value['singleImage']['data'][0]['src'], 640, 640);
  244 + } elseif (isset($value['smallPic']['data'])) {
  245 + $imgs = $value['smallPic']['data'];
  246 + $build['smallImage'] = array(
  247 + array(
  248 + 'src' => Helpers::getImageUrl($imgs[0]['src'], 315, 420)
  249 + ),
  250 + array(
  251 + 'src' => Helpers::getImageUrl($imgs[1]['src'], 315, 420)
  252 + )
  253 + );
  254 + }
  255 + // 相关推荐
  256 + elseif (isset($value['goods']['data'])) {
  257 + $good = array();
  258 + // 遍历取得SKN
  259 + $skns = array();
  260 + foreach ($value['goods']['data'] as $goods) {
  261 + $skns[] = $goods['id'];
  262 + }
  263 + // 通过SKN获取商品信息
  264 + $product = ListData::productInfoBySkns($skns);
  265 + if (!empty($product['data']['product_list'])) {
  266 + foreach ($product['data']['product_list'] as $i => $goods) {
  267 + // 最多显示4个
  268 + if ($i > 3) {
211 break; 269 break;
212 } 270 }
  271 + $good[] = Helpers::formatProduct($goods, false, true, true, 235, 314, true);
  272 + }
  273 + }
  274 + // 没有商品
  275 + if (!isset($i)) {
  276 + continue;
  277 + }
  278 + // 单个商品
  279 + elseif ($i === 0 && isset($good[0])) {
  280 + $build['relatedReco'] = $good[0];
  281 + }
  282 + // 多个商品
  283 + else {
  284 + $build['relatedReco'] = $good;
  285 + }
  286 + }
  287 + // 悬停浮动商品
  288 + elseif (isset($value['goodsGroup']['data'])) {
  289 + foreach ($value['goodsGroup']['data'] as $goods) {
  290 + $good = array();
  291 + $good['thumb'] = Helpers::getImageUrl($goods['cover']['cover'], 235, 314);
  292 + $good['type'] = Helpers::getProductIcon($goods['cover']['maxSortId']);
  293 + $good['goods'] = array();
  294 + $skns = array();
  295 + foreach ($goods['list'] as $mini) {
  296 + $skns[] = $mini['id'];
  297 + }
  298 + // 通过SKN获取商品信息
  299 + $product = ListData::productInfoBySkns($skns);
  300 + if (!empty($product['data']['product_list'])) {
  301 + foreach ($product['data']['product_list'] as $i => $goods) {
  302 + $good['goods'][] = Helpers::formatProduct($goods, false, true, true, 235, 314, true);
  303 + }
  304 + $build['collocation'][] = $good;
  305 + }
  306 + }
  307 + }
213 308
214 - $id = $this->get('id');  
215 - $type = $this->get('type');  
216 - // 收藏  
217 - if ($type == 'fav') { 309 + $data['detail']['content'][] = $build;
  310 + }
  311 + }
  312 +
  313 + // 相关品牌
  314 + if (!empty($detail['getBrand'])) {
  315 + $data['relatedBrand'] = $detail['getBrand'];
  316 + }
218 317
  318 + // 分享参数
  319 + if (isset($detail['getArticle']['cover_image'])) {
  320 + $data['shareLink'] = Helpers::url('/info/index', array('id' => $id), 'guang');
  321 + $data['shareTitle'] = $detail['getArticle']['article_title'];
  322 + $data['shareDesc'] = $detail['getArticle']['article_summary'];
  323 + if ($detail['getArticle']['cover_image_type'] == 1) {
  324 + $data['shareImg'] = Helpers::getImageUrl($detail['getArticle']['cover_image'], 640, 640);
  325 + } else {
  326 + $data['shareImg'] = Helpers::getImageUrl($detail['getArticle']['cover_image'], 640, 320);
  327 + }
219 } 328 }
220 - } while (false); 329 +
  330 + // 标识有微信分享
  331 + $data['hasWxShare'] = true;
  332 +
  333 + $this->_view->display('index', $data);
  334 +
  335 + $detail = array();
  336 + $data = array();
221 } 337 }
222 338
223 } 339 }
@@ -177,7 +177,7 @@ class PlusstarController extends AbstractAction @@ -177,7 +177,7 @@ class PlusstarController extends AbstractAction
177 177
178 $data['shareLink'] = $defaultUrl; 178 $data['shareLink'] = $defaultUrl;
179 $data['shareTitle'] = $data['ps']['name']; 179 $data['shareTitle'] = $data['ps']['name'];
180 - $data['shareDesc'] = (mb_strlen($data['ps']['intro'], 'utf-8') > 120) ? mb_substr($data['ps']['intro'], 0, 120, 'utf-8') . '...' : $data['ps']['intro']; 180 + $data['shareDesc'] = (mb_strlen($data['ps']['intro'], 'utf-8') > 120) ? trim(strip_tags(mb_substr($data['ps']['intro'], 0, 120, 'utf-8'))) . '...' : $data['ps']['intro'];
181 $data['shareImg'] = $data['ps']['logo']; 181 $data['shareImg'] = $data['ps']['logo'];
182 182
183 $brandInfo = array(); 183 $brandInfo = array();
@@ -50,7 +50,7 @@ application.template.ext = ".phtml" @@ -50,7 +50,7 @@ application.template.ext = ".phtml"
50 application.assets.path = ROOT_PATH "/assets" 50 application.assets.path = ROOT_PATH "/assets"
51 51
52 ; 应用的版本号 52 ; 应用的版本号
53 -application.version = "1.1.4" 53 +application.version = "1.1.5"
54 54
55 ; 网站SEO信息 55 ; 网站SEO信息
56 application.seo.title = "Yoho!Buy有货" 56 application.seo.title = "Yoho!Buy有货"
@@ -50,7 +50,7 @@ application.template.ext = ".phtml" @@ -50,7 +50,7 @@ application.template.ext = ".phtml"
50 application.assets.path = ROOT_PATH "/assets" 50 application.assets.path = ROOT_PATH "/assets"
51 51
52 ; 应用的版本号 52 ; 应用的版本号
53 -application.version = "1.1.4" 53 +application.version = "1.1.5"
54 54
55 ; 网站SEO信息 55 ; 网站SEO信息
56 application.seo.title = "Yoho!Buy有货" 56 application.seo.title = "Yoho!Buy有货"
@@ -50,7 +50,7 @@ application.template.ext = ".phtml" @@ -50,7 +50,7 @@ application.template.ext = ".phtml"
50 application.assets.path = ROOT_PATH "/assets" 50 application.assets.path = ROOT_PATH "/assets"
51 51
52 ; 应用的版本号 52 ; 应用的版本号
53 -application.version = "1.1.4" 53 +application.version = "1.1.5"
54 54
55 ; 网站SEO信息 55 ; 网站SEO信息
56 application.seo.title = "Yoho!Buy有货" 56 application.seo.title = "Yoho!Buy有货"
@@ -50,7 +50,7 @@ application.template.ext = ".phtml" @@ -50,7 +50,7 @@ application.template.ext = ".phtml"
50 application.assets.path = ROOT_PATH "/assets" 50 application.assets.path = ROOT_PATH "/assets"
51 51
52 ; 应用的版本号 52 ; 应用的版本号
53 -application.version = "1.1.4" 53 +application.version = "1.1.5"
54 54
55 ; 网站SEO信息 55 ; 网站SEO信息
56 application.seo.title = "Yoho!Buy有货" 56 application.seo.title = "Yoho!Buy有货"