Authored by htoooth

Merge remote-tracking branch 'origin/master' into feature/seo-1120

... ... @@ -41,7 +41,7 @@ const tdk = require('./utils/getTDK');
helpers.image = _.flow(helpers.image, fp.replace(/\/quality\/\d*$/, '/quality/90'));
// NOTE:这里修改了参数的个数
helpers.getUrlBySkc = skn => `//item.yohobuy.com/${skn}.html`;
helpers.getUrlBySkc = skn => `//www.yohobuy.com/product/${skn}.html`;
global.middleware = path.resolve('./doraemon/middleware');
global.utils = path.resolve('./utils');
... ...
... ... @@ -580,7 +580,7 @@ module.exports = class extends global.yoho.BaseModel {
return progress;
}
_getNormalPro(isCancel, status, createTime) {
_getNormalPro(isCancel, status, createTime, statusStr) {
let progress = {
middleStatus: [
{
... ... @@ -612,6 +612,11 @@ module.exports = class extends global.yoho.BaseModel {
} else if (status === 6) {
progress.percent = '100%';
progress.middleStatus[3].cur = true;
// 显示接口返回订单状态文案
if (statusStr) {
progress.middleStatus[3].name = `4. ${statusStr}`;
}
}
}
... ... @@ -775,7 +780,8 @@ module.exports = class extends global.yoho.BaseModel {
);
}
return that._getNormalPro(orderDetail.is_cancel, +orderDetail.status, orderDetail.create_time);
return that._getNormalPro(orderDetail.is_cancel, +orderDetail.status,
orderDetail.create_time, statusInfo.statusStr);
}
}());
... ...
... ... @@ -216,6 +216,7 @@ function _getSkuDataByProductBaseInfo(data) {
let defaultImage = '';// 默认图
let defaultSkuFlag = false; // 选中状态
let marketPrice = _.get(data, 'market_price', 0.0);
let imageAlt = _imageAlt(data); // eslint-disable-line
if (_.isEmpty(_.get(data, 'goods_list', []))) {
return {
... ... @@ -256,7 +257,8 @@ function _getSkuDataByProductBaseInfo(data) {
url: '',
shower: good.image_url,
img: good.image_url,
title: goodsDetail.title
title: goodsDetail.title,
imageAlt
});
}
});
... ... @@ -335,7 +337,8 @@ function _getSkuDataByProductBaseInfo(data) {
return {
defaultImage: defaultImage,
skuGoods: skuGoods,
totalStorageNum: totalStorageNum
totalStorageNum: totalStorageNum,
imageAlt
};
}
... ... @@ -909,6 +912,51 @@ function _getIntroInfo(productSkn, maxSortId, additionalData) {
return result;
}
function _genderHelper(gender) {
gender = gender || '';
switch (gender) {
case '1':
case '1,3': {
return '男款';
}
case '2':
case '2,3': {
return '女款';
}
default: {
return '';
}
}
}
function _imageAlt(goodsInfo) {
let navs = _getSortNavAsync({data: goodsInfo}, null);
let alt = '';
if (_.get(goodsInfo, 'brand_info.brand_name_en')) {
alt += _.get(goodsInfo, 'brand_info.brand_name_en') + '|';
}
if (_.get(goodsInfo, 'brand_info.brand_name_cn')) {
alt += _.get(goodsInfo, 'brand_info.brand_name_cn') + '|';
}
if (_.get(goodsInfo, 'gender')) {
alt += _genderHelper(_.get(goodsInfo, 'data.gender', '1,3')) + '|';
}
if (_.get(navs, '[1].name')) {
alt += navs[1].name + '|';
}
if (_.get(goodsInfo, 'product_name', '')) {
alt += _.get(goodsInfo, 'product_name', '');
}
return alt;
}
/**
* 获取seo信息
*
... ... @@ -917,38 +965,35 @@ function _getIntroInfo(productSkn, maxSortId, additionalData) {
* @return array
*/
function _getSeoByGoodsInfo(goodsInfo, navs) {
let title = '';
let brandName = '';
let sortName = '';
let productName = _.get(goodsInfo, 'data.product_name', '');
goodsInfo = goodsInfo || {};
navs = navs || [];
if (goodsInfo.brandName) {
title = goodsInfo.brandName + ' ';
brandName = goodsInfo.brandName;
if (_.get(goodsInfo, 'data.brand_info.brand_name', '')) {
brandName = _.get(goodsInfo, 'data.brand_info.brand_name');
}
if (_.get(navs, '[1].name')) {
sortName = navs[1].name;
title += navs[1].name + '|';
}
title += goodsInfo.name + '正品 | YOHO!BUY 有货';
let title = `【${brandName}${sortName}】` + productName + ' | YOHO!BUY 有货';
let keywords = brandName + sortName + ',' + brandName + '专卖店,' + brandName + '官方授权店,' +
brandName + '正品,' + brandName + '打折,' + brandName + '折扣店,' + brandName + '真品,' + brandName + '代购';
let keywords = brandName + sortName + ',' + brandName + sortName + '价格,' + brandName + sortName + '图片';
let description = `YOHO!BUY 有货-${brandName}官方授权店,${goodsInfo.name}图片、报价、介绍。` +
`YOHO!BUY 有货${brandName}专卖店提供${brandName}正品、${brandName}真品、 ${brandName}打折、${brandName}代购等。`;
let description = `${productName},有货网仅售${_.get(goodsInfo, 'data.format_sales_price')}元,` +
`购买${brandName + sortName},了解${brandName + sortName}商品信息就上有货网!`;
let cononicalURL = goodsInfo.productUrl;
let cononicalURL = helpers.getUrlBySkc(_.get(goodsInfo, 'data.product_skn'));
return {
title: title,
keywords: keywords.replace(/~+/, ''),
description: description,
cononicalURL: cononicalURL
cononicalURL: cononicalURL,
};
}
... ... @@ -1193,6 +1238,7 @@ function _detailDataPkg(origin, uid, vipLevel, cookies) {
result.img = skuData.defaultImage;
result.colors = skuData.skuGoods;
result.imageAlt = skuData.imageAlt;
let totalStorageNum = skuData.totalStorageNum;
// 限购商品
... ... @@ -1534,7 +1580,7 @@ function showMainAsync(req, data) {
result.detail.goodsInfo.imageBanner = _getProductActivityBanner(productDescription.banner);
// seo
result.seo = _getSeoByGoodsInfo(productInfo.goodsInfo, sortNavigator);
result.seo = _getSeoByGoodsInfo(productData, sortNavigator);
// 商品页面统计
result.statGoodsInfo = Object.assign({fullSortName: sortNavigator.map(x => x.name).join('-')},
... ... @@ -1595,7 +1641,7 @@ function recommendAsync(skn, page, limit) {
}
const formatPrice = p => ${p}`;
const productUrl = (productSkn) => helpers.getUrlBySkc(productSkn);
const productUrl = helpers.getUrlBySkc;
const productImageUrl = Fn.pipe(Fn.prop('default_images'), _.partial(helpers.image, _, 280, 382, 2, 70));
let products = _.get(recommendData, 'data.product_list', []).map((rp) => {
... ...
... ... @@ -167,8 +167,8 @@ function _getShopData(channel, params, shopInfo) {
});
_.forEach(prodList, value => {
list[value.product_skn] = {
img: value.default_images,
list[value.skn] = {
img: value.default_images || value.thumb,
title: value.product_name,
price: ${value.sales_price}`
};
... ...
... ... @@ -13,7 +13,7 @@
<span class="ac-type">{{type}}</span>
<span class="ac-des {{#if_cond ../activity.length '>' 3}}small{{/if_cond}}">
{{#if url}}
<a target="_blank" href="{{url}}">{{des}}</a>
<a target="_blank" href="{{url}}" rel="nofollow">{{des}}</a>
{{^}}
<span>{{des}}</span>
{{/if}}
... ... @@ -30,7 +30,7 @@
<span class="ac-type">{{type}}</span>
<span class="ac-des {{#if_cond ../activity.length '>' 3}}small{{/if_cond}}">
{{#if url}}
<a target="_blank" href="{{url}}">{{des}}</a>
<a target="_blank" href="{{url}}" rel="nofollow">{{des}}</a>
{{^}}
<span>{{des}}</span>
{{/if}}
... ...
... ... @@ -95,7 +95,7 @@
退回商品保证吊牌、标签、包装完整,详情点击
<br />
<a href="//www.yohobuy.com/help/detail?id=49"
target="_blank">&gt;&gt;退换货政策</a>
target="_blank" rel="nofollow">&gt;&gt;退换货政策</a>
</span>
</span>
</p>
... ... @@ -114,7 +114,7 @@
<div class="common-question">
<p>
<span class="common-advice">
<a href="#textbox-wrapper" id="common-advice">
<a href="#textbox-wrapper" id="common-advice" rel="nofollow">
<i class="iconfont advice"> &#xe602;</i>
我要咨询<i class="iconfont click">&#xe608;</i>
</a>
... ...
... ... @@ -29,9 +29,8 @@
{{/ isPresell}}
{{/ tags}}
</div>
<div id="min-img">
<img id="img-show" class="img-show" src="{{image2 img w=420 h=560}}" alt="{{name}}">
<img id="img-show" class="img-show" src="{{image2 img w=420 h=560}}" alt="{{imageAlt}}">
<div class="magnifier move-object hide"></div>
<div class="magnifier move-over"></div>
<div id="max" class="magnifier max hide">
... ... @@ -49,14 +48,14 @@
{{#if focus}}
{{# thumbs}}
<img class="thumb {{#if @first}}active{{/if}}" src="{{image2 img w=75 h=100}}"
alt="{{title}}"
alt="{{imageAlt}}"
data-shower="{{image2 shower w=420 h=560}}"
data-origin="{{image2 shower w=750 h=1000}}">
{{/ thumbs}}
{{^}}
{{# thumbs}}
<img class="thumb lazy"
alt="{{title}}"
alt="{{imageAlt}}"
data-original="{{image2 img w=75 h=100}}"
data-shower="{{image2 shower w=420 h=560}}"
data-origin="{{image2 shower w=750 h=1000}}">
... ...
... ... @@ -269,7 +269,7 @@
<div class="center-content clearfix">
<div class="about-us">
<div class="left-flag">
<a class='govicon' href="http://odr.jsdsgsxt.gov.cn:8081/mbm/entweb/elec/certView?siteId=f2b6e3b8d18241afb8dd6cadf7f15406" target="_blank" rel="nofollow">
<a class='govicon' href="http://www.jsdsgsxt.gov.cn/mbm/entweb/elec/certView.shtml?siteId=f2b6e3b8d18241afb8dd6cadf7f15406" target="_blank" rel="nofollow">
<div class="govimg"></div>
</a>
<a href="https://ss.knet.cn/verifyseal.dll?sn=e14021832010046477dka7000000&amp;ct=df&amp;a=1&amp;pa=0.5902942178957805" target="_blank" rel="nofollow">
... ... @@ -279,7 +279,7 @@
<img src="{{image2 '//static.yohobuy.com/images/v3/icon/isc2.png'}}">
</a>
</div>
<p>
<p class="links">
<a href="//www.yohobuy.com" rel="nofollow">返回首页</a>
<span>|</span>
<a href="//www.yohobuy.com/yohobuy.html">YOHO!BUY 有货</a>
... ...
... ... @@ -27,7 +27,7 @@
<i class="cart-item-check iconfont {{#isChecked}}cart-item-checked{{/isChecked}}" data-role="cart-item-check"></i>
<code>预售商品</code>
预售商品购物须知 <i class="iconfont hover-tip">&#xe6c9;
<p class="tip-text">预售商品不参加活动,不可使用优惠券,不同上市期的商品我们将为您先到先发</p>
<p class="tip-text">由于商品上市期不同,同笔订单商品需同时发货,预售商品不参加活动,不可使用优惠券</p>
</i>{{tips}}
</div>
... ...
This diff could not be displayed because it is too large.
{
"name": "yohobuy-node",
"version": "6.1.12",
"version": "6.1.16",
"private": true,
"description": "A New Yohobuy Project With Express",
"repository": {
... ...
... ... @@ -335,6 +335,10 @@
}
}
.links {
word-break: keep-all;
}
.left-flag {
margin-top: 3px;
position: absolute;
... ...