Authored by yyq

Merge branch 'release/6.3' into gray

@@ -41,7 +41,7 @@ const tdk = require('./utils/getTDK'); @@ -41,7 +41,7 @@ const tdk = require('./utils/getTDK');
41 helpers.image = _.flow(helpers.image, fp.replace(/\/quality\/\d*$/, '/quality/90')); 41 helpers.image = _.flow(helpers.image, fp.replace(/\/quality\/\d*$/, '/quality/90'));
42 42
43 // NOTE:这里修改了参数的个数 43 // NOTE:这里修改了参数的个数
44 -helpers.getUrlBySkc = skn => `//item.yohobuy.com/${skn}.html`; 44 +helpers.getUrlBySkc = skn => `//www.yohobuy.com/product/${skn}.html`;
45 45
46 global.middleware = path.resolve('./doraemon/middleware'); 46 global.middleware = path.resolve('./doraemon/middleware');
47 global.utils = path.resolve('./utils'); 47 global.utils = path.resolve('./utils');
@@ -580,7 +580,7 @@ module.exports = class extends global.yoho.BaseModel { @@ -580,7 +580,7 @@ module.exports = class extends global.yoho.BaseModel {
580 return progress; 580 return progress;
581 } 581 }
582 582
583 - _getNormalPro(isCancel, status, createTime) { 583 + _getNormalPro(isCancel, status, createTime, statusStr) {
584 let progress = { 584 let progress = {
585 middleStatus: [ 585 middleStatus: [
586 { 586 {
@@ -612,6 +612,11 @@ module.exports = class extends global.yoho.BaseModel { @@ -612,6 +612,11 @@ module.exports = class extends global.yoho.BaseModel {
612 } else if (status === 6) { 612 } else if (status === 6) {
613 progress.percent = '100%'; 613 progress.percent = '100%';
614 progress.middleStatus[3].cur = true; 614 progress.middleStatus[3].cur = true;
  615 +
  616 + // 显示接口返回订单状态文案
  617 + if (statusStr) {
  618 + progress.middleStatus[3].name = `4. ${statusStr}`;
  619 + }
615 } 620 }
616 } 621 }
617 622
@@ -775,7 +780,8 @@ module.exports = class extends global.yoho.BaseModel { @@ -775,7 +780,8 @@ module.exports = class extends global.yoho.BaseModel {
775 ); 780 );
776 } 781 }
777 782
778 - return that._getNormalPro(orderDetail.is_cancel, +orderDetail.status, orderDetail.create_time); 783 + return that._getNormalPro(orderDetail.is_cancel, +orderDetail.status,
  784 + orderDetail.create_time, statusInfo.statusStr);
779 } 785 }
780 }()); 786 }());
781 787
@@ -216,6 +216,7 @@ function _getSkuDataByProductBaseInfo(data) { @@ -216,6 +216,7 @@ function _getSkuDataByProductBaseInfo(data) {
216 let defaultImage = '';// 默认图 216 let defaultImage = '';// 默认图
217 let defaultSkuFlag = false; // 选中状态 217 let defaultSkuFlag = false; // 选中状态
218 let marketPrice = _.get(data, 'market_price', 0.0); 218 let marketPrice = _.get(data, 'market_price', 0.0);
  219 + let imageAlt = _imageAlt(data); // eslint-disable-line
219 220
220 if (_.isEmpty(_.get(data, 'goods_list', []))) { 221 if (_.isEmpty(_.get(data, 'goods_list', []))) {
221 return { 222 return {
@@ -256,7 +257,8 @@ function _getSkuDataByProductBaseInfo(data) { @@ -256,7 +257,8 @@ function _getSkuDataByProductBaseInfo(data) {
256 url: '', 257 url: '',
257 shower: good.image_url, 258 shower: good.image_url,
258 img: good.image_url, 259 img: good.image_url,
259 - title: goodsDetail.title 260 + title: goodsDetail.title,
  261 + imageAlt
260 }); 262 });
261 } 263 }
262 }); 264 });
@@ -335,7 +337,8 @@ function _getSkuDataByProductBaseInfo(data) { @@ -335,7 +337,8 @@ function _getSkuDataByProductBaseInfo(data) {
335 return { 337 return {
336 defaultImage: defaultImage, 338 defaultImage: defaultImage,
337 skuGoods: skuGoods, 339 skuGoods: skuGoods,
338 - totalStorageNum: totalStorageNum 340 + totalStorageNum: totalStorageNum,
  341 + imageAlt
339 }; 342 };
340 } 343 }
341 344
@@ -909,6 +912,51 @@ function _getIntroInfo(productSkn, maxSortId, additionalData) { @@ -909,6 +912,51 @@ function _getIntroInfo(productSkn, maxSortId, additionalData) {
909 return result; 912 return result;
910 } 913 }
911 914
  915 +function _genderHelper(gender) {
  916 + gender = gender || '';
  917 +
  918 + switch (gender) {
  919 + case '1':
  920 + case '1,3': {
  921 + return '男款';
  922 + }
  923 + case '2':
  924 + case '2,3': {
  925 + return '女款';
  926 + }
  927 + default: {
  928 + return '';
  929 + }
  930 + }
  931 +}
  932 +
  933 +function _imageAlt(goodsInfo) {
  934 + let navs = _getSortNavAsync({data: goodsInfo}, null);
  935 + let alt = '';
  936 +
  937 + if (_.get(goodsInfo, 'brand_info.brand_name_en')) {
  938 + alt += _.get(goodsInfo, 'brand_info.brand_name_en') + '|';
  939 + }
  940 +
  941 + if (_.get(goodsInfo, 'brand_info.brand_name_cn')) {
  942 + alt += _.get(goodsInfo, 'brand_info.brand_name_cn') + '|';
  943 + }
  944 +
  945 + if (_.get(goodsInfo, 'gender')) {
  946 + alt += _genderHelper(_.get(goodsInfo, 'data.gender', '1,3')) + '|';
  947 + }
  948 +
  949 + if (_.get(navs, '[1].name')) {
  950 + alt += navs[1].name + '|';
  951 + }
  952 +
  953 + if (_.get(goodsInfo, 'product_name', '')) {
  954 + alt += _.get(goodsInfo, 'product_name', '');
  955 + }
  956 +
  957 + return alt;
  958 +}
  959 +
912 /** 960 /**
913 * 获取seo信息 961 * 获取seo信息
914 * 962 *
@@ -917,38 +965,35 @@ function _getIntroInfo(productSkn, maxSortId, additionalData) { @@ -917,38 +965,35 @@ function _getIntroInfo(productSkn, maxSortId, additionalData) {
917 * @return array 965 * @return array
918 */ 966 */
919 function _getSeoByGoodsInfo(goodsInfo, navs) { 967 function _getSeoByGoodsInfo(goodsInfo, navs) {
920 - let title = '';  
921 let brandName = ''; 968 let brandName = '';
922 let sortName = ''; 969 let sortName = '';
  970 + let productName = _.get(goodsInfo, 'data.product_name', '');
923 971
924 goodsInfo = goodsInfo || {}; 972 goodsInfo = goodsInfo || {};
925 navs = navs || []; 973 navs = navs || [];
926 974
927 - if (goodsInfo.brandName) {  
928 - title = goodsInfo.brandName + ' ';  
929 - brandName = goodsInfo.brandName; 975 + if (_.get(goodsInfo, 'data.brand_info.brand_name', '')) {
  976 + brandName = _.get(goodsInfo, 'data.brand_info.brand_name');
930 } 977 }
931 978
932 if (_.get(navs, '[1].name')) { 979 if (_.get(navs, '[1].name')) {
933 sortName = navs[1].name; 980 sortName = navs[1].name;
934 - title += navs[1].name + '|';  
935 } 981 }
936 982
937 - title += goodsInfo.name + '正品 | YOHO!BUY 有货'; 983 + let title = `【${brandName}${sortName}】` + productName + ' | YOHO!BUY 有货';
938 984
939 - let keywords = brandName + sortName + ',' + brandName + '专卖店,' + brandName + '官方授权店,' +  
940 - brandName + '正品,' + brandName + '打折,' + brandName + '折扣店,' + brandName + '真品,' + brandName + '代购'; 985 + let keywords = brandName + sortName + ',' + brandName + sortName + '价格,' + brandName + sortName + '图片';
941 986
942 - let description = `YOHO!BUY 有货-${brandName}官方授权店,${goodsInfo.name}图片、报价、介绍。` +  
943 - `YOHO!BUY 有货${brandName}专卖店提供${brandName}正品、${brandName}真品、 ${brandName}打折、${brandName}代购等。`; 987 + let description = `${productName},有货网仅售${_.get(goodsInfo, 'data.format_sales_price')}元,` +
  988 + `购买${brandName + sortName},了解${brandName + sortName}商品信息就上有货网!`;
944 989
945 - let cononicalURL = goodsInfo.productUrl; 990 + let cononicalURL = helpers.getUrlBySkc(_.get(goodsInfo, 'data.product_skn'));
946 991
947 return { 992 return {
948 title: title, 993 title: title,
949 keywords: keywords.replace(/~+/, ''), 994 keywords: keywords.replace(/~+/, ''),
950 description: description, 995 description: description,
951 - cononicalURL: cononicalURL 996 + cononicalURL: cononicalURL,
952 }; 997 };
953 } 998 }
954 999
@@ -1193,6 +1238,7 @@ function _detailDataPkg(origin, uid, vipLevel, cookies) { @@ -1193,6 +1238,7 @@ function _detailDataPkg(origin, uid, vipLevel, cookies) {
1193 1238
1194 result.img = skuData.defaultImage; 1239 result.img = skuData.defaultImage;
1195 result.colors = skuData.skuGoods; 1240 result.colors = skuData.skuGoods;
  1241 + result.imageAlt = skuData.imageAlt;
1196 let totalStorageNum = skuData.totalStorageNum; 1242 let totalStorageNum = skuData.totalStorageNum;
1197 1243
1198 // 限购商品 1244 // 限购商品
@@ -1534,7 +1580,7 @@ function showMainAsync(req, data) { @@ -1534,7 +1580,7 @@ function showMainAsync(req, data) {
1534 result.detail.goodsInfo.imageBanner = _getProductActivityBanner(productDescription.banner); 1580 result.detail.goodsInfo.imageBanner = _getProductActivityBanner(productDescription.banner);
1535 1581
1536 // seo 1582 // seo
1537 - result.seo = _getSeoByGoodsInfo(productInfo.goodsInfo, sortNavigator); 1583 + result.seo = _getSeoByGoodsInfo(productData, sortNavigator);
1538 1584
1539 // 商品页面统计 1585 // 商品页面统计
1540 result.statGoodsInfo = Object.assign({fullSortName: sortNavigator.map(x => x.name).join('-')}, 1586 result.statGoodsInfo = Object.assign({fullSortName: sortNavigator.map(x => x.name).join('-')},
@@ -1595,7 +1641,7 @@ function recommendAsync(skn, page, limit) { @@ -1595,7 +1641,7 @@ function recommendAsync(skn, page, limit) {
1595 } 1641 }
1596 1642
1597 const formatPrice = p => ${p}`; 1643 const formatPrice = p => ${p}`;
1598 - const productUrl = (productSkn) => helpers.getUrlBySkc(productSkn); 1644 + const productUrl = helpers.getUrlBySkc;
1599 const productImageUrl = Fn.pipe(Fn.prop('default_images'), _.partial(helpers.image, _, 280, 382, 2, 70)); 1645 const productImageUrl = Fn.pipe(Fn.prop('default_images'), _.partial(helpers.image, _, 280, 382, 2, 70));
1600 1646
1601 let products = _.get(recommendData, 'data.product_list', []).map((rp) => { 1647 let products = _.get(recommendData, 'data.product_list', []).map((rp) => {
@@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@
13 <span class="ac-type">{{type}}</span> 13 <span class="ac-type">{{type}}</span>
14 <span class="ac-des {{#if_cond ../activity.length '>' 3}}small{{/if_cond}}"> 14 <span class="ac-des {{#if_cond ../activity.length '>' 3}}small{{/if_cond}}">
15 {{#if url}} 15 {{#if url}}
16 - <a target="_blank" href="{{url}}">{{des}}</a> 16 + <a target="_blank" href="{{url}}" rel="nofollow">{{des}}</a>
17 {{^}} 17 {{^}}
18 <span>{{des}}</span> 18 <span>{{des}}</span>
19 {{/if}} 19 {{/if}}
@@ -30,7 +30,7 @@ @@ -30,7 +30,7 @@
30 <span class="ac-type">{{type}}</span> 30 <span class="ac-type">{{type}}</span>
31 <span class="ac-des {{#if_cond ../activity.length '>' 3}}small{{/if_cond}}"> 31 <span class="ac-des {{#if_cond ../activity.length '>' 3}}small{{/if_cond}}">
32 {{#if url}} 32 {{#if url}}
33 - <a target="_blank" href="{{url}}">{{des}}</a> 33 + <a target="_blank" href="{{url}}" rel="nofollow">{{des}}</a>
34 {{^}} 34 {{^}}
35 <span>{{des}}</span> 35 <span>{{des}}</span>
36 {{/if}} 36 {{/if}}
@@ -95,7 +95,7 @@ @@ -95,7 +95,7 @@
95 退回商品保证吊牌、标签、包装完整,详情点击 95 退回商品保证吊牌、标签、包装完整,详情点击
96 <br /> 96 <br />
97 <a href="//www.yohobuy.com/help/detail?id=49" 97 <a href="//www.yohobuy.com/help/detail?id=49"
98 - target="_blank">&gt;&gt;退换货政策</a> 98 + target="_blank" rel="nofollow">&gt;&gt;退换货政策</a>
99 </span> 99 </span>
100 </span> 100 </span>
101 </p> 101 </p>
@@ -114,7 +114,7 @@ @@ -114,7 +114,7 @@
114 <div class="common-question"> 114 <div class="common-question">
115 <p> 115 <p>
116 <span class="common-advice"> 116 <span class="common-advice">
117 - <a href="#textbox-wrapper" id="common-advice"> 117 + <a href="#textbox-wrapper" id="common-advice" rel="nofollow">
118 <i class="iconfont advice"> &#xe602;</i> 118 <i class="iconfont advice"> &#xe602;</i>
119 我要咨询<i class="iconfont click">&#xe608;</i> 119 我要咨询<i class="iconfont click">&#xe608;</i>
120 </a> 120 </a>
@@ -29,9 +29,8 @@ @@ -29,9 +29,8 @@
29 {{/ isPresell}} 29 {{/ isPresell}}
30 {{/ tags}} 30 {{/ tags}}
31 </div> 31 </div>
32 -  
33 <div id="min-img"> 32 <div id="min-img">
34 - <img id="img-show" class="img-show" src="{{image2 img w=420 h=560}}" alt="{{name}}"> 33 + <img id="img-show" class="img-show" src="{{image2 img w=420 h=560}}" alt="{{imageAlt}}">
35 <div class="magnifier move-object hide"></div> 34 <div class="magnifier move-object hide"></div>
36 <div class="magnifier move-over"></div> 35 <div class="magnifier move-over"></div>
37 <div id="max" class="magnifier max hide"> 36 <div id="max" class="magnifier max hide">
@@ -49,14 +48,14 @@ @@ -49,14 +48,14 @@
49 {{#if focus}} 48 {{#if focus}}
50 {{# thumbs}} 49 {{# thumbs}}
51 <img class="thumb {{#if @first}}active{{/if}}" src="{{image2 img w=75 h=100}}" 50 <img class="thumb {{#if @first}}active{{/if}}" src="{{image2 img w=75 h=100}}"
52 - alt="{{title}}" 51 + alt="{{imageAlt}}"
53 data-shower="{{image2 shower w=420 h=560}}" 52 data-shower="{{image2 shower w=420 h=560}}"
54 data-origin="{{image2 shower w=750 h=1000}}"> 53 data-origin="{{image2 shower w=750 h=1000}}">
55 {{/ thumbs}} 54 {{/ thumbs}}
56 {{^}} 55 {{^}}
57 {{# thumbs}} 56 {{# thumbs}}
58 <img class="thumb lazy" 57 <img class="thumb lazy"
59 - alt="{{title}}" 58 + alt="{{imageAlt}}"
60 data-original="{{image2 img w=75 h=100}}" 59 data-original="{{image2 img w=75 h=100}}"
61 data-shower="{{image2 shower w=420 h=560}}" 60 data-shower="{{image2 shower w=420 h=560}}"
62 data-origin="{{image2 shower w=750 h=1000}}"> 61 data-origin="{{image2 shower w=750 h=1000}}">
@@ -27,7 +27,7 @@ @@ -27,7 +27,7 @@
27 <i class="cart-item-check iconfont {{#isChecked}}cart-item-checked{{/isChecked}}" data-role="cart-item-check"></i> 27 <i class="cart-item-check iconfont {{#isChecked}}cart-item-checked{{/isChecked}}" data-role="cart-item-check"></i>
28 <code>预售商品</code> 28 <code>预售商品</code>
29 预售商品购物须知 <i class="iconfont hover-tip">&#xe6c9; 29 预售商品购物须知 <i class="iconfont hover-tip">&#xe6c9;
30 - <p class="tip-text">预售商品不参加活动,不可使用优惠券,不同上市期的商品我们将为您先到先发</p> 30 + <p class="tip-text">由于商品上市期不同,同笔订单商品需同时发货,预售商品不参加活动,不可使用优惠券</p>
31 </i>{{tips}} 31 </i>{{tips}}
32 </div> 32 </div>
33 33
This diff could not be displayed because it is too large.
1 { 1 {
2 "name": "yohobuy-node", 2 "name": "yohobuy-node",
3 - "version": "6.1.12", 3 + "version": "6.1.13",
4 "private": true, 4 "private": true,
5 "description": "A New Yohobuy Project With Express", 5 "description": "A New Yohobuy Project With Express",
6 "repository": { 6 "repository": {