Authored by 陈峰

逛功能测试问题修改完毕

... ... @@ -22,7 +22,6 @@ const channels = {
* [编辑页面]
*/
const editor = (req, res, next) => {
let uid = req.user.uid,
udid = req.sessionID,
id = req.query.id || 0,
... ... @@ -35,8 +34,7 @@ const editor = (req, res, next) => {
parameter = {
pageHeader: headerModel.setNav({
navTitle: title
}),
pageFooter: true
})
};
}
... ...
... ... @@ -65,7 +65,6 @@ const _pageArticleContent = (articleContent, isApp, gender) => {
skns.push(goods.id);
arr[goods.id] = goods.src;
});
// 通过SKN获取商品信息
productDetailModel.productInfoBySkns(skns).then((product) => {
if (product.data.product_list) {
... ... @@ -146,15 +145,16 @@ const _pageArticleContent = (articleContent, isApp, gender) => {
build.moreLink = art.link.data[0].url;
contents.push(build);
joinContentFunc(++i, len);
} else {
joinContentFunc(++i, len);
}
} else {
resolve(contents);
}
};
}
joinContentFunc(0, articleContent.length);
});
};
}
/**
* [处理品牌数据]
* @param {[array]} getBrand [品牌原数据]
... ... @@ -165,8 +165,7 @@ const _relatedBrand = (getBrand) => {
brand.thumb = brand.thumb.replace('http://', '//');
});
return relatedBrand;
};
}
/**
* [处理标签数据]
* @param {[array]} tags [标签原数据]
... ... @@ -183,8 +182,7 @@ const _relatedTag = (tags, isApp) => {
relatedTag.push(value);
});
return relatedTag;
};
}
/**
* [处理相关文章数据]
* @param {[array]} getOtherArticle [相关文章原数据]
... ... @@ -202,8 +200,7 @@ const _relatedInfo = (getOtherArticle, isApp) => {
relatedInfo.push(value);
});
return relatedInfo;
};
}
/**
* [处理分享内容]
* @param {[int]} id [资讯id]
... ... @@ -222,8 +219,7 @@ const _shareInfo = (id, getArticle) => {
shareInfo.shareImg = helpers.image(getArticle.cover_image, 640, 320);
}
return shareInfo;
};
}
/**
* [逛资讯详情页]
*/
... ... @@ -247,8 +243,7 @@ const index = (req, res, next) => {
parameter = {
pageHeader: headerModel.setNav({
navTitle: title
}),
pageFooter: true
})
};
}
... ... @@ -284,13 +279,12 @@ const index = (req, res, next) => {
pageView: detail.getArticle.pageViews,
content: []
};
if (detail.getArticleContent) {
// 生成内容部分
//生成内容部分
return _pageArticleContent(detail.getArticleContent, isApp, gender).then((contents) => {
guang.detail.content = contents;
// 相关品牌
if (detail.getBrand && detail.getBrand.length) {
guang.relatedBrand = _relatedBrand(detail.getBrand);
... ... @@ -310,7 +304,7 @@ const index = (req, res, next) => {
if (detail.getArticle.cover_image) {
let shareInfo = _shareInfo(id, detail.getArticle);
Object.assign(guang, shareInfo);
data.title = detail.getArticle.article_title;
data.title = detail.getArticle.article_title + ' | Yoho!Buy有货 | 潮流购物逛不停';
data.title_more = true;
data.description = detail.getArticle.article_summary;
data.description_more = true;
... ... @@ -333,7 +327,6 @@ const index = (req, res, next) => {
}
}).catch(next);
};
/**
* [逛mini内容页]
*/
... ... @@ -368,13 +361,12 @@ const mini = (req, res, next) => {
pageView: detail.getArticle.pageViews,
content: []
};
if (detail.getArticleContent) {
// 生成内容部分
//生成内容部分
return _pageArticleContent(detail.getArticleContent, isApp, gender).then((contents) => {
guang.detail.content = contents;
// 相关品牌
if (detail.getBrand && detail.getBrand.length) {
guang.relatedBrand = _relatedBrand(detail.getBrand);
... ... @@ -430,17 +422,16 @@ const foryoho = (req, res, next) => {
data.brand = detail.getBrand;
if (detail.getArticleContent) {
// 生成内容部分
//生成内容部分
return _pageArticleContent(detail.getArticleContent, isApp, gender).then((contents) => {
data.content = contents;
// 内容中的相关推荐和悬浮商品移到data层级
//内容中的相关推荐和悬浮商品移到data层级
let relatedRecoIndex = data.content.findIndex((cont) => {
return typeof cont.relatedReco !== 'undefined';
});
})
let collocationIndex = data.content.findIndex((cont) => {
return typeof cont.collocation !== 'undefined';
});
})
if (relatedRecoIndex > 0) {
data.goods = data.content[relatedRecoIndex].relatedReco;
data.content.splice(relatedRecoIndex, 1);
... ... @@ -458,7 +449,7 @@ const foryoho = (req, res, next) => {
}
}).catch(next);
};
}
module.exports = {
index,
... ...
... ... @@ -13,20 +13,20 @@ const helpers = global.yoho.helpers;
* [订阅逛最新的资讯]
*/
const index = (req, res, next) => {
let gender = req.query.gender || '1,2,3',
items = [];
let gender = req.query.gender || '1,2,3',
items = [];
res.setHeader('Content-Type', 'text/xml; charset=utf-8');
return rssModel.getRssArticle(gender).then((result) => {
return res.render('rss/index', {
layout: false,
time: (new Date()).toUTCString(),
items: result
});
});
res.setHeader('Content-Type', 'text/xml; charset=utf-8');
return rssModel.getRssArticle(gender).then((result) => {
return res.render('rss/index', {
layout: false,
time: (new Date()).toUTCString(),
items: result
});
});
};
module.exports = {
index
index
};
... ...
... ... @@ -33,7 +33,7 @@ router.get('/plusstar/resources-template', plusstar.resourcesTemplate); // æ½®æµ
router.get('/', index.index); // 逛首页
router.get('/tags/index', index.tag); // 逛标签页
router.get('/author/list', index.editor); // 编辑简介
router.get('/author/index', index.editor); // 编辑简介
router.get('/index/page', index.pageData); // 逛列表页面的资讯分页
... ...
<div class="guang-detail-page guang-page yoho-page">
<div class="guang-detail-page guang-page yoho-page {{#if guangDetail}}guang-detail{{/if}} {{#if guangEzine}}guang-ezine{{/if}}">
{{# guang}}
<div id="wrapper">
<div id="scroller">
... ...
... ... @@ -7,6 +7,8 @@
var $ = require('yoho-jquery');
var info = require('./info-common');
require('../common');
var loadMore = info.loadMore;
var winH = $(window).height();
... ...
... ... @@ -258,6 +258,7 @@ function loadMore($container, opt, url) {
delete opt.isTab;
},
error: function() {
console.log('error')
tip.show('网络断开连接了~');
searching = false;
delete opt.isTab;
... ...
... ... @@ -27,6 +27,7 @@ var thumbWidth = 0,
scrollToEl = document.querySelector('#wrapper .collocation-block');
require('../common');
require('../plugin/wx-share')();
/**
... ... @@ -188,10 +189,20 @@ $('img').on('load', function() {
// 初始化页面,包括是否使用iscorll初始化页面
// 接口暴露在HTML中,使用压缩名
(function(useIscroll) {
(function() {
var useIscroll;
var isIphone = navigator.userAgent.indexOf('iPhone') > 0 ? true : false;
var $this, $title;
if ($('.guang-detail-page').hasClass('guang-detail')) {
useIscroll = true;
} else if($('.guang-detail-page').hasClass('guang-ezine')) {
useIscroll = false;
}
$('.main-wrap').css({
position: 'static'
})
pageInIscroll = isIphone && useIscroll;
ellipsis.init();
... ... @@ -259,4 +270,4 @@ $('img').on('load', function() {
if (pageInIscroll) {
initIscroll();
}
}(false));
}());
... ...
.err-page {
.err-bg {
position: fixed;
height: 5rem;
width: 5rem;
height: 200px;
width: 200px;
top: 50%;
left: 50%;
margin-left: -2.5rem;
margin-top: -2.5rem;
margin-left: -100px;
margin-top: -100px;
background: resolve('common/404.png') no-repeat;
background-size: 100% 100%;
}
... ...
.load-more-info {
width: 100%;
height: 1.75rem;
line-height: 1.75rem;
height: 70px;
line-height: 70px;
text-align: center;
font-size: 0.35rem;
font-size: 14PX;
overflow: hidden;
.status {
... ...
... ... @@ -473,6 +473,14 @@
}
.title {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
word-break: break-all;
overflow: hidden;
}
.publish-time {
font-size: 18px;
margin-top: 0;
... ...