Authored by 沈志敏

Merge branch 'release/5.1' of git.yoho.cn:fe/yohobuywap-node into release/5.1

@@ -125,7 +125,7 @@ const favoriteBrand = (req, res, next) => { @@ -125,7 +125,7 @@ const favoriteBrand = (req, res, next) => {
125 } 125 }
126 res.json({ 126 res.json({
127 code: 200, 127 code: 200,
128 - message: '收藏成功', 128 + message: data.message,
129 data: '' 129 data: ''
130 }); 130 });
131 }).catch(next); 131 }).catch(next);
@@ -98,7 +98,7 @@ const getDetailData = (req, res, next) => { @@ -98,7 +98,7 @@ const getDetailData = (req, res, next) => {
98 res.render('plustar/detail', { 98 res.render('plustar/detail', {
99 module: 'guang', 99 module: 'guang',
100 page: 'plustar-detail', 100 page: 'plustar-detail',
101 - title: result.brandName, 101 + title: result.brand_name,
102 pageHeader: headerModel.setNav({ 102 pageHeader: headerModel.setNav({
103 navTitle: result.brand_name 103 navTitle: result.brand_name
104 }), 104 }),
@@ -108,7 +108,7 @@ const getDetailData = (req, res, next) => { @@ -108,7 +108,7 @@ const getDetailData = (req, res, next) => {
108 res.render('plustar/detail', { 108 res.render('plustar/detail', {
109 module: 'guang', 109 module: 'guang',
110 page: 'plustar-detail', 110 page: 'plustar-detail',
111 - title: result.brandName, 111 + title: result.brand_name,
112 ps: result, 112 ps: result,
113 uid: uid, 113 uid: uid,
114 isApp: isApp ? true : false 114 isApp: isApp ? true : false
@@ -252,9 +252,6 @@ const getRelatedEditorial = (brandId, uid, udid, clientType, isApp) => { @@ -252,9 +252,6 @@ const getRelatedEditorial = (brandId, uid, udid, clientType, isApp) => {
252 pageView: data.views_num 252 pageView: data.views_num
253 }); 253 });
254 }); 254 });
255 -  
256 -  
257 -  
258 return list; 255 return list;
259 } else { 256 } else {
260 logger.error('editorial data return code is not 200'); 257 logger.error('editorial data return code is not 200');
@@ -264,13 +261,19 @@ const getRelatedEditorial = (brandId, uid, udid, clientType, isApp) => { @@ -264,13 +261,19 @@ const getRelatedEditorial = (brandId, uid, udid, clientType, isApp) => {
264 }; 261 };
265 262
266 // 是否收藏 263 // 是否收藏
267 -const isCollection = (uid, brandId, clientType) => {  
268 - return serviceAPI.get('shops/service/v1/favorite/getUidBrandFav', {  
269 - uid: uid, 264 +const isCollection = (brandId, clientType, uid) => {
  265 +
  266 + let param = {
270 brandId: brandId, 267 brandId: brandId,
271 client_type: clientType, 268 client_type: clientType,
272 private_key: privateKeyList[clientType] 269 private_key: privateKeyList[clientType]
273 - }).then((result) => { 270 + };
  271 +
  272 + if (uid) {
  273 + param.uid = uid;
  274 + }
  275 +
  276 + return serviceAPI.get('shops/service/v1/favorite/getUidBrandFav', param).then((result) => {
274 277
275 if (result && result.code === 200) { 278 if (result && result.code === 200) {
276 279
@@ -313,7 +316,7 @@ const getDetailData = (id, uid, udid, gender, isApp, clientType) => { @@ -313,7 +316,7 @@ const getDetailData = (id, uid, udid, gender, isApp, clientType) => {
313 jumpToApp = 1; 316 jumpToApp = 1;
314 } 317 }
315 318
316 - return Promise.all([isCollection(uid, brandId, clientType), getRelatedEditorial(brandId, uid, udid, clientType, isApp), getNewProduct(brandId, gender, url, isApp)]).then((result) => { 319 + return Promise.all([isCollection(brandId, clientType, uid), getRelatedEditorial(brandId, uid, udid, clientType, isApp), getNewProduct(brandId, gender, url, isApp)]).then((result) => {
317 320
318 list = _.assign(list, { 321 list = _.assign(list, {
319 isLike: result[0], 322 isLike: result[0],
@@ -341,7 +344,7 @@ const getDetailData = (id, uid, udid, gender, isApp, clientType) => { @@ -341,7 +344,7 @@ const getDetailData = (id, uid, udid, gender, isApp, clientType) => {
341 * [品牌详情异步数据] 344 * [品牌详情异步数据]
342 */ 345 */
343 const getDetailDataAsync = (brandId, uid, udid, clientType, isApp) => { 346 const getDetailDataAsync = (brandId, uid, udid, clientType, isApp) => {
344 - return Promise.all([isCollection(uid, brandId, clientType), getRelatedEditorial(brandId, uid, udid, clientType, isApp)]).then((result) => { 347 + return Promise.all([isCollection(brandId, clientType, uid), getRelatedEditorial(brandId, uid, udid, clientType, isApp)]).then((result) => {
345 return { 348 return {
346 isLike: result[0], 349 isLike: result[0],
347 infos: result[1] 350 infos: result[1]
@@ -80,14 +80,18 @@ const _formatOrderGoods = (orderGoods, count, haveLink, tickets) => { @@ -80,14 +80,18 @@ const _formatOrderGoods = (orderGoods, count, haveLink, tickets) => {
80 * 获取快递有关信息 80 * 获取快递有关信息
81 * @private 81 * @private
82 */ 82 */
83 -const _assignExpressInfo = (showLogistics, order, result) => {  
84 - if (showLogistics && order.express_company.caption && order.express_number) {  
85 - Object.assign(result, { 83 +const _assignExpressInfo = (showLogistics, order) => {
  84 + let data = {};
  85 +
  86 + if (showLogistics && order.express_company && order.express_company.caption) {
  87 + data = {
86 logisticsUrl: helpers.urlFormat('/home/logistic', {order_code: order.order_code}), 88 logisticsUrl: helpers.urlFormat('/home/logistic', {order_code: order.order_code}),
87 logisticsCompany: order.express_company.caption, 89 logisticsCompany: order.express_company.caption,
88 - logisticsNum: order.express_number  
89 - }); 90 + logisticsNum: order.express_number || ''
  91 + };
90 } 92 }
  93 +
  94 + return data;
91 }; 95 };
92 96
93 /** 97 /**
@@ -164,7 +168,7 @@ const _getOrderStatus = (order, showLogistics) => { @@ -164,7 +168,7 @@ const _getOrderStatus = (order, showLogistics) => {
164 qrcode: helpers.urlFormat(`/home/QRcode/${order.order_code}`) 168 qrcode: helpers.urlFormat(`/home/QRcode/${order.order_code}`)
165 }); 169 });
166 } else { 170 } else {
167 - _assignExpressInfo(showLogistics, order, result); 171 + Object.assign(result, _assignExpressInfo(showLogistics, order));
168 } 172 }
169 break; 173 break;
170 case 6: 174 case 6:
@@ -180,7 +184,7 @@ const _getOrderStatus = (order, showLogistics) => { @@ -180,7 +184,7 @@ const _getOrderStatus = (order, showLogistics) => {
180 qrcode: helpers.urlFormat(`/home/QRcode/${order.order_code}`) 184 qrcode: helpers.urlFormat(`/home/QRcode/${order.order_code}`)
181 }); 185 });
182 } else { 186 } else {
183 - _assignExpressInfo(showLogistics, order, result); 187 + Object.assign(result, _assignExpressInfo(showLogistics, order));
184 } 188 }
185 break; 189 break;
186 default: 190 default:
@@ -213,7 +217,7 @@ const _getOrderStatus = (order, showLogistics) => { @@ -213,7 +217,7 @@ const _getOrderStatus = (order, showLogistics) => {
213 Object.assign(result, { 217 Object.assign(result, {
214 unreceived: true 218 unreceived: true
215 }); 219 });
216 - _assignExpressInfo(showLogistics, order, result); 220 + Object.assign(result, _assignExpressInfo(showLogistics, order));
217 break; 221 break;
218 case 6: 222 case 6:
219 223
@@ -221,7 +225,7 @@ const _getOrderStatus = (order, showLogistics) => { @@ -221,7 +225,7 @@ const _getOrderStatus = (order, showLogistics) => {
221 Object.assign(result, { 225 Object.assign(result, {
222 completed: true 226 completed: true
223 }); 227 });
224 - _assignExpressInfo(showLogistics, order, result); 228 + Object.assign(result, _assignExpressInfo(showLogistics, order));
225 break; 229 break;
226 default: 230 default:
227 break; 231 break;
@@ -29,7 +29,7 @@ const closeReasons = () => { @@ -29,7 +29,7 @@ const closeReasons = () => {
29 const _assignExpressInfo = (showLogistics, order) => { 29 const _assignExpressInfo = (showLogistics, order) => {
30 let data = {}; 30 let data = {};
31 31
32 - if (showLogistics && order.expressCompany.caption) { 32 + if (showLogistics && order.expressCompany && order.expressCompany.caption) {
33 data = { 33 data = {
34 logisticsUrl: helpers.urlFormat('/home/logistic', {order_code: order.orderCode}), 34 logisticsUrl: helpers.urlFormat('/home/logistic', {order_code: order.orderCode}),
35 logisticsCompany: order.expressCompany.caption, 35 logisticsCompany: order.expressCompany.caption,
@@ -1220,9 +1220,8 @@ const _detailDataPkg = (origin, ua) => { @@ -1220,9 +1220,8 @@ const _detailDataPkg = (origin, ua) => {
1220 // }); 1220 // });
1221 1221
1222 // } 1222 // }
1223 -  
1224 // 上市期 1223 // 上市期
1225 - origin.expectArrivalTime && (dest.periodOfMarket = `${origin.expectArrivalTime}月`); 1224 + origin.expect_arrival_time && (dest.periodOfMarket = origin.expect_arrival_time);
1226 1225
1227 // 商品咨询 1226 // 商品咨询
1228 dest.feedbacks = { 1227 dest.feedbacks = {
@@ -44,7 +44,6 @@ @@ -44,7 +44,6 @@
44 <button class="limit-sale data-can-get-limit-code data-bind" id='limit-sale'>获取限购码</button> 44 <button class="limit-sale data-can-get-limit-code data-bind" id='limit-sale'>获取限购码</button>
45 <button class="got-limit-sale data-code-empty data-bind">限购码已被抢光</button> 45 <button class="got-limit-sale data-code-empty data-bind">限购码已被抢光</button>
46 <button class="got-limit-sale data-got-code data-bind">已获取限购码</button> 46 <button class="got-limit-sale data-got-code data-bind">已获取限购码</button>
47 -  
48 {{#if periodOfMarket}} 47 {{#if periodOfMarket}}
49 <div class="period-of-market"> 48 <div class="period-of-market">
50 <h1>上市期:</h1> 49 <h1>上市期:</h1>
@@ -16,15 +16,15 @@ module.exports = { @@ -16,15 +16,15 @@ module.exports = {
16 siteUrl: '//m.yohobuy.com', 16 siteUrl: '//m.yohobuy.com',
17 assetUrl: '//localhost:5001', 17 assetUrl: '//localhost:5001',
18 domains: { 18 domains: {
19 - // api: 'http://api-test3.yohops.com:9999/',  
20 - // service: 'http://service-test3.yohops.com:9999/',  
21 - // liveApi: 'http://testapi.live.yohops.com:9999/',  
22 - // singleApi: 'http://api-test3.yohops.com:9999/' 19 + api: 'http://api-test3.yohops.com:9999/',
  20 + service: 'http://service-test3.yohops.com:9999/',
  21 + liveApi: 'http://testapi.live.yohops.com:9999/',
  22 + singleApi: 'http://api-test3.yohops.com:9999/'
23 23
24 - api: 'http://api.yoho.cn/',  
25 - service: 'http://service.yoho.cn/',  
26 - liveApi: 'http://api.live.yoho.cn/',  
27 - singleApi: 'http://single.yoho.cn/' 24 + // api: 'http://api.yoho.cn/',
  25 + // service: 'http://service.yoho.cn/',
  26 + // liveApi: 'http://api.live.yoho.cn/',
  27 + // singleApi: 'http://single.yoho.cn/'
28 }, 28 },
29 subDomains: { 29 subDomains: {
30 host: '.m.yohobuy.com', 30 host: '.m.yohobuy.com',
@@ -367,7 +367,6 @@ $basicBtnC: #eb0313; @@ -367,7 +367,6 @@ $basicBtnC: #eb0313;
367 367
368 .period-of-market { 368 .period-of-market {
369 float: right; 369 float: right;
370 - margin-right: 1.4rem;  
371 color: #d0021b; 370 color: #d0021b;
372 font-size: 24px; 371 font-size: 24px;
373 372
@@ -60,9 +60,12 @@ @@ -60,9 +60,12 @@
60 .selected { 60 .selected {
61 display: none; 61 display: none;
62 color: #d0021b !important; 62 color: #d0021b !important;
63 - font-weight: bold;  
64 height: 79px; 63 height: 79px;
65 line-height: 40px; 64 line-height: 40px;
  65 +
  66 + .time {
  67 + font-weight: bold;
  68 + }
66 } 69 }
67 .normal { 70 .normal {
68 display: block; 71 display: block;
@@ -5,7 +5,7 @@ @@ -5,7 +5,7 @@
5 font-size: 24px; 5 font-size: 24px;
6 line-height: 1.4; 6 line-height: 1.4;
7 color: #b0b0b0; 7 color: #b0b0b0;
8 - padding: 40px 30px 185px; 8 + padding: 30px 30px 185px;
9 9
10 h5 { 10 h5 {
11 font-size: 25px; 11 font-size: 25px;