...
|
...
|
@@ -6,6 +6,8 @@ |
|
|
|
|
|
const _ = require('lodash');
|
|
|
|
|
|
const NOW_YEAR = new Date().getFullYear();
|
|
|
|
|
|
const getSeoCheckedParamsName = (sorts, checked) => {
|
|
|
let kd = {};
|
|
|
|
...
|
...
|
@@ -77,7 +79,13 @@ const listDefaultTdk = { |
|
|
description: '潮流网购就上YOHO!BUY有货,有货网潮流商品专卖店提供潮流商品品牌、潮流商品价格、潮流商品图片等信息。销售正品新款潮流男装、潮流女装、潮流童装,全场低至4折,★全场品牌正品保证,支持货到付款!★' // eslint-disable-line
|
|
|
};
|
|
|
|
|
|
const getListSeo = (cen, sorts, checked) => {
|
|
|
/**
|
|
|
* 列表页seo
|
|
|
* @param sorts
|
|
|
* @param checked
|
|
|
* @returns {{title: string, keywords: string, description: string}}
|
|
|
*/
|
|
|
const getListSeo = (sorts, checked) => {
|
|
|
let {brand, channel, color, style, sort} = getSeoCheckedParamsName(sorts, checked);
|
|
|
|
|
|
if (brand && _.indexOf(brand, '、') > -1) {
|
...
|
...
|
@@ -106,6 +114,37 @@ const getListSeo = (cen, sorts, checked) => { |
|
|
}
|
|
|
};
|
|
|
|
|
|
/**
|
|
|
* 新品到页 seo
|
|
|
* @param sorts
|
|
|
* @param checked
|
|
|
* @returns {{title: string, keywords: string, description: string}}
|
|
|
*/
|
|
|
const getNewListSeo = (sorts, checked) => {
|
|
|
const tdk = {
|
|
|
title: `【潮流新品】_引领潮流_${NOW_YEAR}时尚潮流新品-YOHO!BUY 有货`,
|
|
|
keywords: `潮流新品.引领潮流,${NOW_YEAR}时尚潮流新品`,
|
|
|
description: `【潮流新品】,${NOW_YEAR}时尚潮流新品,潮流网购就上YOHO!BUY有货,有货网销售正品新款,全场低至4折,★全场品牌正品保证,支持货到付款!★`
|
|
|
};
|
|
|
|
|
|
const kd = getSeoCheckedParamsName(sorts, checked);
|
|
|
let name = _.compact([kd.price ? `价格在${kd.price}` : '', kd.brand,
|
|
|
kd.channel, kd.color, kd.size, kd.sort]).join('_');
|
|
|
|
|
|
if (name) {
|
|
|
tdk.title = `【潮流新品】_${name}-YOHO!BUY 有货`;
|
|
|
}
|
|
|
|
|
|
return tdk;
|
|
|
};
|
|
|
|
|
|
/**
|
|
|
* sale列表页seo
|
|
|
* @param sorts
|
|
|
* @param checked
|
|
|
* @param type
|
|
|
* @returns {{title: string, keywords: string, description: string}}
|
|
|
*/
|
|
|
const getSaleListSeo = (sorts, checked, type) => {
|
|
|
const defaultTdk = saleDefaultSeoMap[type] || {};
|
|
|
const kd = getSeoCheckedParamsName(sorts, checked);
|
...
|
...
|
@@ -132,6 +171,12 @@ const getSaleListSeo = (sorts, checked, type) => { |
|
|
};
|
|
|
};
|
|
|
|
|
|
/**
|
|
|
* 全球购列表页seo
|
|
|
* @param sorts
|
|
|
* @param checked
|
|
|
* @returns {{title: string, keywords: string, description: string}}
|
|
|
*/
|
|
|
const getGlobalListSeo = (sorts, checked) => {
|
|
|
const defaultTdk = {
|
|
|
title: '全球购潮流服装配饰,创意生活用品_男生|女生|潮童服装,鞋履,配饰品牌正品-YOHO!BUY有货',
|
...
|
...
|
@@ -157,6 +202,12 @@ const getGlobalListSeo = (sorts, checked) => { |
|
|
};
|
|
|
};
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 店铺首页seo
|
|
|
* @param shopInfo
|
|
|
* @returns {{title: string, keywords: string, description: string}}
|
|
|
*/
|
|
|
const getShopHomeSeo = (shopInfo) => {
|
|
|
let params = {
|
|
|
nameEn: '',
|
...
|
...
|
@@ -186,6 +237,13 @@ const getShopHomeSeo = (shopInfo) => { |
|
|
};
|
|
|
};
|
|
|
|
|
|
/**
|
|
|
* 店铺列表页seo
|
|
|
* @param sorts
|
|
|
* @param checked
|
|
|
* @param shopInfo
|
|
|
* @returns {{title: string, keywords: string, description: string}}
|
|
|
*/
|
|
|
const getShopListSeo = (sorts, checked, shopInfo) => {
|
|
|
const kd = getSeoCheckedParamsName(sorts, checked);
|
|
|
const defaultTdk = getShopHomeSeo(shopInfo);
|
...
|
...
|
@@ -210,12 +268,34 @@ const getShopListSeo = (sorts, checked, shopInfo) => { |
|
|
};
|
|
|
};
|
|
|
|
|
|
/**
|
|
|
* 商品详情页seo
|
|
|
* @param goodsInfo
|
|
|
* @param navs
|
|
|
* @returns {{title: string, keywords: string, description: string}}
|
|
|
*/
|
|
|
const getProductDetailSeo = (goodsInfo, navs) => {
|
|
|
let brandName = _.get(goodsInfo, 'data.brand_info.brand_name', '');
|
|
|
let sortName = _.get(navs, '[1].name', '');
|
|
|
let productName = _.get(goodsInfo, 'data.product_name', '');
|
|
|
let priceName = _.get(goodsInfo, 'data.format_sales_price');
|
|
|
|
|
|
return {
|
|
|
title: `${productName}_${brandName}${sortName}-YOHO!BUY 有货`,
|
|
|
keywords: `${brandName}${sortName},${brandName}${sortName}价格,${brandName}${sortName}图片`,
|
|
|
description: `${productName},有货网仅售${priceName}元,购买${brandName +
|
|
|
sortName},了解${brandName + sortName}商品信息就上有货网!`
|
|
|
};
|
|
|
};
|
|
|
|
|
|
module.exports = {
|
|
|
getListSeo,
|
|
|
getSeoCheckedParamsName,
|
|
|
getListSeo,
|
|
|
getNewListSeo,
|
|
|
getSaleListSeo,
|
|
|
getGlobalListSeo,
|
|
|
getShopHomeSeo,
|
|
|
getShopListSeo,
|
|
|
getProductDetailSeo
|
|
|
};
|
|
|
|
...
|
...
|
|