Authored by 郭成尧

记录一些待处理信息

@@ -6,7 +6,10 @@ @@ -6,7 +6,10 @@
6 6
7 'use strict'; 7 'use strict';
8 8
  9 +const library = '../../../library';
9 const mRoot = '../models'; 10 const mRoot = '../models';
  11 +const _ = require('lodash');
  12 +const cookie = require(`${library}/cookie`);
10 13
11 // 商品详情 model 14 // 商品详情 model
12 const detail = require(`${mRoot}/detail`); 15 const detail = require(`${mRoot}/detail`);
@@ -24,8 +27,9 @@ const preference = require(`${mRoot}/preference`); @@ -24,8 +27,9 @@ const preference = require(`${mRoot}/preference`);
24 * @return {[type]} [description] 27 * @return {[type]} [description]
25 */ 28 */
26 exports.index = (req, res) => { 29 exports.index = (req, res) => {
27 - var uid = null, // 需要修改为正式取 UID 的方式  
28 - vipLevel = 0; // 用户等级 30 +
  31 + var uid = !_.isEmpty(cookie.getUid(req)) ? cookie.getUid(req) : null;
  32 + var vipLevel = 0; // 用户等级
29 33
30 detail({ 34 detail({
31 id: req.params.id, 35 id: req.params.id,
@@ -94,10 +94,10 @@ const procShowStatus = (data, showStatus, isBeginSale) => { @@ -94,10 +94,10 @@ const procShowStatus = (data, showStatus, isBeginSale) => {
94 }; 94 };
95 95
96 /** 96 /**
97 - * 根据设备类型获得限购商品跳转app的url 待处理  
98 - * @param {[string]} productCode 限购商品码  
99 - * @param {[string]} skn 限购商品skn  
100 - * @return {[string]} 限购商品跳转url 97 + * 根据设备类型获得限购商品跳转app的url
  98 + * @param {string} productCode 限购商品码
  99 + * @param {string} skn 限购商品skn
  100 + * @return {string} 限购商品跳转url
101 */ 101 */
102 const getLimitCodeUrl = (productCode, skn, ua) => { 102 const getLimitCodeUrl = (productCode, skn, ua) => {
103 var url = 'yohoapp://yoho.app/openwith?limit_product_code=' + productCode + 103 var url = 'yohoapp://yoho.app/openwith?limit_product_code=' + productCode +
@@ -470,10 +470,10 @@ const detailDataPkg = (origin, uid, vipLevel, ua) => { @@ -470,10 +470,10 @@ const detailDataPkg = (origin, uid, vipLevel, ua) => {
470 dest = procShowStatus(dest, showStatus, isBeginSale); 470 dest = procShowStatus(dest, showStatus, isBeginSale);
471 dest.cartInfo.limitProductCode = origin.limitProductCode; 471 dest.cartInfo.limitProductCode = origin.limitProductCode;
472 dest.cartInfo.limitCodeUrl = getLimitCodeUrl(origin.limitProductCode, origin.erpProductId, ua); 472 dest.cartInfo.limitCodeUrl = getLimitCodeUrl(origin.limitProductCode, origin.erpProductId, ua);
473 - dest.cartInfo.limitProductPay = helpers.url('/cart/index/orderEnsure'); 473 + dest.cartInfo.limitProductPay = helpers.url('/cart/index/orderEnsure'); // 待处理 相关处理逻辑还不存在
474 } else { 474 } else {
475 dest.cartInfo.addToCartUrl = helpers.url('/product/buy_' + origin.id + '_' + 475 dest.cartInfo.addToCartUrl = helpers.url('/product/buy_' + origin.id + '_' +
476 - origin.goodsList.id + '.html'); // 待处理 确认 goodsId 的含义 476 + origin.goodsList.id + '.html'); // 待处理 相关处理逻辑还不存在
477 } 477 }
478 } else if (notForSale) { 478 } else if (notForSale) {
479 dest.cartInfo.notForSale = true; 479 dest.cartInfo.notForSale = true;
@@ -491,7 +491,8 @@ const detailDataPkg = (origin, uid, vipLevel, ua) => { @@ -491,7 +491,8 @@ const detailDataPkg = (origin, uid, vipLevel, ua) => {
491 // 底部简介的URL链接 待处理 491 // 底部简介的URL链接 待处理
492 // dest.introUrl = helpers.url('/product/intro_' + origin.erpProductId + 492 // dest.introUrl = helpers.url('/product/intro_' + origin.erpProductId +
493 // '/' + origin.cnAlphabet + '.html', null, ''); 493 // '/' + origin.cnAlphabet + '.html', null, '');
494 - dest.introUrl = 'http://localhost:6001/product/detail/intro/51257148'; 494 +
  495 + dest.introUrl = 'http://localhost:6001/product/detail/intro/' + origin.erpProductId;
495 dest.id = origin.id; 496 dest.id = origin.id;
496 497
497 return dest; 498 return dest;