Authored by 郭成尧

记录一些待处理信息

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