Authored by 陈峰

逛功能测试问题修改完毕

@@ -22,7 +22,6 @@ const channels = { @@ -22,7 +22,6 @@ const channels = {
22 * [编辑页面] 22 * [编辑页面]
23 */ 23 */
24 const editor = (req, res, next) => { 24 const editor = (req, res, next) => {
25 -  
26 let uid = req.user.uid, 25 let uid = req.user.uid,
27 udid = req.sessionID, 26 udid = req.sessionID,
28 id = req.query.id || 0, 27 id = req.query.id || 0,
@@ -35,8 +34,7 @@ const editor = (req, res, next) => { @@ -35,8 +34,7 @@ const editor = (req, res, next) => {
35 parameter = { 34 parameter = {
36 pageHeader: headerModel.setNav({ 35 pageHeader: headerModel.setNav({
37 navTitle: title 36 navTitle: title
38 - }),  
39 - pageFooter: true 37 + })
40 }; 38 };
41 } 39 }
42 40
@@ -65,7 +65,6 @@ const _pageArticleContent = (articleContent, isApp, gender) => { @@ -65,7 +65,6 @@ const _pageArticleContent = (articleContent, isApp, gender) => {
65 skns.push(goods.id); 65 skns.push(goods.id);
66 arr[goods.id] = goods.src; 66 arr[goods.id] = goods.src;
67 }); 67 });
68 -  
69 // 通过SKN获取商品信息 68 // 通过SKN获取商品信息
70 productDetailModel.productInfoBySkns(skns).then((product) => { 69 productDetailModel.productInfoBySkns(skns).then((product) => {
71 if (product.data.product_list) { 70 if (product.data.product_list) {
@@ -146,15 +145,16 @@ const _pageArticleContent = (articleContent, isApp, gender) => { @@ -146,15 +145,16 @@ const _pageArticleContent = (articleContent, isApp, gender) => {
146 build.moreLink = art.link.data[0].url; 145 build.moreLink = art.link.data[0].url;
147 contents.push(build); 146 contents.push(build);
148 joinContentFunc(++i, len); 147 joinContentFunc(++i, len);
  148 + } else {
  149 + joinContentFunc(++i, len);
149 } 150 }
150 } else { 151 } else {
151 resolve(contents); 152 resolve(contents);
152 } 153 }
153 - }; 154 + }
154 joinContentFunc(0, articleContent.length); 155 joinContentFunc(0, articleContent.length);
155 }); 156 });
156 -};  
157 - 157 +}
158 /** 158 /**
159 * [处理品牌数据] 159 * [处理品牌数据]
160 * @param {[array]} getBrand [品牌原数据] 160 * @param {[array]} getBrand [品牌原数据]
@@ -165,8 +165,7 @@ const _relatedBrand = (getBrand) => { @@ -165,8 +165,7 @@ const _relatedBrand = (getBrand) => {
165 brand.thumb = brand.thumb.replace('http://', '//'); 165 brand.thumb = brand.thumb.replace('http://', '//');
166 }); 166 });
167 return relatedBrand; 167 return relatedBrand;
168 -};  
169 - 168 +}
170 /** 169 /**
171 * [处理标签数据] 170 * [处理标签数据]
172 * @param {[array]} tags [标签原数据] 171 * @param {[array]} tags [标签原数据]
@@ -183,8 +182,7 @@ const _relatedTag = (tags, isApp) => { @@ -183,8 +182,7 @@ const _relatedTag = (tags, isApp) => {
183 relatedTag.push(value); 182 relatedTag.push(value);
184 }); 183 });
185 return relatedTag; 184 return relatedTag;
186 -};  
187 - 185 +}
188 /** 186 /**
189 * [处理相关文章数据] 187 * [处理相关文章数据]
190 * @param {[array]} getOtherArticle [相关文章原数据] 188 * @param {[array]} getOtherArticle [相关文章原数据]
@@ -202,8 +200,7 @@ const _relatedInfo = (getOtherArticle, isApp) => { @@ -202,8 +200,7 @@ const _relatedInfo = (getOtherArticle, isApp) => {
202 relatedInfo.push(value); 200 relatedInfo.push(value);
203 }); 201 });
204 return relatedInfo; 202 return relatedInfo;
205 -};  
206 - 203 +}
207 /** 204 /**
208 * [处理分享内容] 205 * [处理分享内容]
209 * @param {[int]} id [资讯id] 206 * @param {[int]} id [资讯id]
@@ -222,8 +219,7 @@ const _shareInfo = (id, getArticle) => { @@ -222,8 +219,7 @@ const _shareInfo = (id, getArticle) => {
222 shareInfo.shareImg = helpers.image(getArticle.cover_image, 640, 320); 219 shareInfo.shareImg = helpers.image(getArticle.cover_image, 640, 320);
223 } 220 }
224 return shareInfo; 221 return shareInfo;
225 -};  
226 - 222 +}
227 /** 223 /**
228 * [逛资讯详情页] 224 * [逛资讯详情页]
229 */ 225 */
@@ -247,8 +243,7 @@ const index = (req, res, next) => { @@ -247,8 +243,7 @@ const index = (req, res, next) => {
247 parameter = { 243 parameter = {
248 pageHeader: headerModel.setNav({ 244 pageHeader: headerModel.setNav({
249 navTitle: title 245 navTitle: title
250 - }),  
251 - pageFooter: true 246 + })
252 }; 247 };
253 } 248 }
254 249
@@ -284,13 +279,12 @@ const index = (req, res, next) => { @@ -284,13 +279,12 @@ const index = (req, res, next) => {
284 pageView: detail.getArticle.pageViews, 279 pageView: detail.getArticle.pageViews,
285 content: [] 280 content: []
286 }; 281 };
287 - 282 +
288 283
289 if (detail.getArticleContent) { 284 if (detail.getArticleContent) {
290 - // 生成内容部分 285 + //生成内容部分
291 return _pageArticleContent(detail.getArticleContent, isApp, gender).then((contents) => { 286 return _pageArticleContent(detail.getArticleContent, isApp, gender).then((contents) => {
292 guang.detail.content = contents; 287 guang.detail.content = contents;
293 -  
294 // 相关品牌 288 // 相关品牌
295 if (detail.getBrand && detail.getBrand.length) { 289 if (detail.getBrand && detail.getBrand.length) {
296 guang.relatedBrand = _relatedBrand(detail.getBrand); 290 guang.relatedBrand = _relatedBrand(detail.getBrand);
@@ -310,7 +304,7 @@ const index = (req, res, next) => { @@ -310,7 +304,7 @@ const index = (req, res, next) => {
310 if (detail.getArticle.cover_image) { 304 if (detail.getArticle.cover_image) {
311 let shareInfo = _shareInfo(id, detail.getArticle); 305 let shareInfo = _shareInfo(id, detail.getArticle);
312 Object.assign(guang, shareInfo); 306 Object.assign(guang, shareInfo);
313 - data.title = detail.getArticle.article_title; 307 + data.title = detail.getArticle.article_title + ' | Yoho!Buy有货 | 潮流购物逛不停';
314 data.title_more = true; 308 data.title_more = true;
315 data.description = detail.getArticle.article_summary; 309 data.description = detail.getArticle.article_summary;
316 data.description_more = true; 310 data.description_more = true;
@@ -333,7 +327,6 @@ const index = (req, res, next) => { @@ -333,7 +327,6 @@ const index = (req, res, next) => {
333 } 327 }
334 }).catch(next); 328 }).catch(next);
335 }; 329 };
336 -  
337 /** 330 /**
338 * [逛mini内容页] 331 * [逛mini内容页]
339 */ 332 */
@@ -368,13 +361,12 @@ const mini = (req, res, next) => { @@ -368,13 +361,12 @@ const mini = (req, res, next) => {
368 pageView: detail.getArticle.pageViews, 361 pageView: detail.getArticle.pageViews,
369 content: [] 362 content: []
370 }; 363 };
371 - 364 +
372 365
373 if (detail.getArticleContent) { 366 if (detail.getArticleContent) {
374 - // 生成内容部分 367 + //生成内容部分
375 return _pageArticleContent(detail.getArticleContent, isApp, gender).then((contents) => { 368 return _pageArticleContent(detail.getArticleContent, isApp, gender).then((contents) => {
376 guang.detail.content = contents; 369 guang.detail.content = contents;
377 -  
378 // 相关品牌 370 // 相关品牌
379 if (detail.getBrand && detail.getBrand.length) { 371 if (detail.getBrand && detail.getBrand.length) {
380 guang.relatedBrand = _relatedBrand(detail.getBrand); 372 guang.relatedBrand = _relatedBrand(detail.getBrand);
@@ -430,17 +422,16 @@ const foryoho = (req, res, next) => { @@ -430,17 +422,16 @@ const foryoho = (req, res, next) => {
430 data.brand = detail.getBrand; 422 data.brand = detail.getBrand;
431 423
432 if (detail.getArticleContent) { 424 if (detail.getArticleContent) {
433 - // 生成内容部分 425 + //生成内容部分
434 return _pageArticleContent(detail.getArticleContent, isApp, gender).then((contents) => { 426 return _pageArticleContent(detail.getArticleContent, isApp, gender).then((contents) => {
435 data.content = contents; 427 data.content = contents;
436 -  
437 - // 内容中的相关推荐和悬浮商品移到data层级 428 + //内容中的相关推荐和悬浮商品移到data层级
438 let relatedRecoIndex = data.content.findIndex((cont) => { 429 let relatedRecoIndex = data.content.findIndex((cont) => {
439 return typeof cont.relatedReco !== 'undefined'; 430 return typeof cont.relatedReco !== 'undefined';
440 - }); 431 + })
441 let collocationIndex = data.content.findIndex((cont) => { 432 let collocationIndex = data.content.findIndex((cont) => {
442 return typeof cont.collocation !== 'undefined'; 433 return typeof cont.collocation !== 'undefined';
443 - }); 434 + })
444 if (relatedRecoIndex > 0) { 435 if (relatedRecoIndex > 0) {
445 data.goods = data.content[relatedRecoIndex].relatedReco; 436 data.goods = data.content[relatedRecoIndex].relatedReco;
446 data.content.splice(relatedRecoIndex, 1); 437 data.content.splice(relatedRecoIndex, 1);
@@ -458,7 +449,7 @@ const foryoho = (req, res, next) => { @@ -458,7 +449,7 @@ const foryoho = (req, res, next) => {
458 449
459 } 450 }
460 }).catch(next); 451 }).catch(next);
461 -}; 452 +}
462 453
463 module.exports = { 454 module.exports = {
464 index, 455 index,
@@ -13,20 +13,20 @@ const helpers = global.yoho.helpers; @@ -13,20 +13,20 @@ const helpers = global.yoho.helpers;
13 * [订阅逛最新的资讯] 13 * [订阅逛最新的资讯]
14 */ 14 */
15 const index = (req, res, next) => { 15 const index = (req, res, next) => {
16 - let gender = req.query.gender || '1,2,3',  
17 - items = []; 16 + let gender = req.query.gender || '1,2,3',
  17 + items = [];
18 18
19 - res.setHeader('Content-Type', 'text/xml; charset=utf-8');  
20 - return rssModel.getRssArticle(gender).then((result) => {  
21 - return res.render('rss/index', {  
22 - layout: false,  
23 - time: (new Date()).toUTCString(),  
24 - items: result  
25 - });  
26 - }); 19 + res.setHeader('Content-Type', 'text/xml; charset=utf-8');
  20 + return rssModel.getRssArticle(gender).then((result) => {
  21 + return res.render('rss/index', {
  22 + layout: false,
  23 + time: (new Date()).toUTCString(),
  24 + items: result
  25 + });
  26 + });
27 }; 27 };
28 28
29 29
30 module.exports = { 30 module.exports = {
31 - index 31 + index
32 }; 32 };
@@ -33,7 +33,7 @@ router.get('/plusstar/resources-template', plusstar.resourcesTemplate); // æ½®æµ @@ -33,7 +33,7 @@ router.get('/plusstar/resources-template', plusstar.resourcesTemplate); // æ½®æµ
33 router.get('/', index.index); // 逛首页 33 router.get('/', index.index); // 逛首页
34 router.get('/tags/index', index.tag); // 逛标签页 34 router.get('/tags/index', index.tag); // 逛标签页
35 35
36 -router.get('/author/list', index.editor); // 编辑简介 36 +router.get('/author/index', index.editor); // 编辑简介
37 37
38 router.get('/index/page', index.pageData); // 逛列表页面的资讯分页 38 router.get('/index/page', index.pageData); // 逛列表页面的资讯分页
39 39
1 -<div class="guang-detail-page guang-page yoho-page"> 1 +<div class="guang-detail-page guang-page yoho-page {{#if guangDetail}}guang-detail{{/if}} {{#if guangEzine}}guang-ezine{{/if}}">
2 {{# guang}} 2 {{# guang}}
3 <div id="wrapper"> 3 <div id="wrapper">
4 <div id="scroller"> 4 <div id="scroller">
@@ -7,6 +7,8 @@ @@ -7,6 +7,8 @@
7 var $ = require('yoho-jquery'); 7 var $ = require('yoho-jquery');
8 8
9 var info = require('./info-common'); 9 var info = require('./info-common');
  10 +
  11 +require('../common');
10 var loadMore = info.loadMore; 12 var loadMore = info.loadMore;
11 13
12 var winH = $(window).height(); 14 var winH = $(window).height();
@@ -258,6 +258,7 @@ function loadMore($container, opt, url) { @@ -258,6 +258,7 @@ function loadMore($container, opt, url) {
258 delete opt.isTab; 258 delete opt.isTab;
259 }, 259 },
260 error: function() { 260 error: function() {
  261 + console.log('error')
261 tip.show('网络断开连接了~'); 262 tip.show('网络断开连接了~');
262 searching = false; 263 searching = false;
263 delete opt.isTab; 264 delete opt.isTab;
@@ -27,6 +27,7 @@ var thumbWidth = 0, @@ -27,6 +27,7 @@ var thumbWidth = 0,
27 scrollToEl = document.querySelector('#wrapper .collocation-block'); 27 scrollToEl = document.querySelector('#wrapper .collocation-block');
28 28
29 29
  30 +require('../common');
30 require('../plugin/wx-share')(); 31 require('../plugin/wx-share')();
31 32
32 /** 33 /**
@@ -188,10 +189,20 @@ $('img').on('load', function() { @@ -188,10 +189,20 @@ $('img').on('load', function() {
188 189
189 // 初始化页面,包括是否使用iscorll初始化页面 190 // 初始化页面,包括是否使用iscorll初始化页面
190 // 接口暴露在HTML中,使用压缩名 191 // 接口暴露在HTML中,使用压缩名
191 -(function(useIscroll) { 192 +(function() {
  193 + var useIscroll;
192 var isIphone = navigator.userAgent.indexOf('iPhone') > 0 ? true : false; 194 var isIphone = navigator.userAgent.indexOf('iPhone') > 0 ? true : false;
193 var $this, $title; 195 var $this, $title;
194 196
  197 + if ($('.guang-detail-page').hasClass('guang-detail')) {
  198 + useIscroll = true;
  199 + } else if($('.guang-detail-page').hasClass('guang-ezine')) {
  200 + useIscroll = false;
  201 + }
  202 + $('.main-wrap').css({
  203 + position: 'static'
  204 + })
  205 +
195 pageInIscroll = isIphone && useIscroll; 206 pageInIscroll = isIphone && useIscroll;
196 207
197 ellipsis.init(); 208 ellipsis.init();
@@ -259,4 +270,4 @@ $('img').on('load', function() { @@ -259,4 +270,4 @@ $('img').on('load', function() {
259 if (pageInIscroll) { 270 if (pageInIscroll) {
260 initIscroll(); 271 initIscroll();
261 } 272 }
262 -}(false)); 273 +}());
1 .err-page { 1 .err-page {
2 .err-bg { 2 .err-bg {
3 position: fixed; 3 position: fixed;
4 - height: 5rem;  
5 - width: 5rem; 4 + height: 200px;
  5 + width: 200px;
6 top: 50%; 6 top: 50%;
7 left: 50%; 7 left: 50%;
8 - margin-left: -2.5rem;  
9 - margin-top: -2.5rem; 8 + margin-left: -100px;
  9 + margin-top: -100px;
10 background: resolve('common/404.png') no-repeat; 10 background: resolve('common/404.png') no-repeat;
11 background-size: 100% 100%; 11 background-size: 100% 100%;
12 } 12 }
1 .load-more-info { 1 .load-more-info {
2 width: 100%; 2 width: 100%;
3 - height: 1.75rem;  
4 - line-height: 1.75rem; 3 + height: 70px;
  4 + line-height: 70px;
5 text-align: center; 5 text-align: center;
6 - font-size: 0.35rem; 6 + font-size: 14PX;
7 overflow: hidden; 7 overflow: hidden;
8 8
9 .status { 9 .status {
@@ -473,6 +473,14 @@ @@ -473,6 +473,14 @@
473 473
474 } 474 }
475 475
  476 + .title {
  477 + display: -webkit-box;
  478 + -webkit-box-orient: vertical;
  479 + -webkit-line-clamp: 2;
  480 + word-break: break-all;
  481 + overflow: hidden;
  482 + }
  483 +
476 .publish-time { 484 .publish-time {
477 font-size: 18px; 485 font-size: 18px;
478 margin-top: 0; 486 margin-top: 0;