Authored by htoooth

add

... ... @@ -94,8 +94,7 @@ class CommentAction extends YohoAction {
this.response.json({
code: result.code,
// TODO:
data: camelCase(_.get(pageResponse, 'list', [])).map((item)=> {
data: _.get(pageResponse, 'list', []).map((item)=> {
return {
avatar: _.get(item, 'userInfo.headIco', '') ?
... ... @@ -103,8 +102,8 @@ class CommentAction extends YohoAction {
DEFAULT_AVATAR_ICO,
userName: _.get(item, 'userInfo.nickName', ''),
date: moment(item.createTime, 'X').format('YYYY-MM-DD HH:mm:ss'),
color: _.get(item, 'goods.colorName', ''),
size: _.get(item, 'goods.sizeName', ''),
color: _.get(item, 'goods.color_name', ''),
size: _.get(item, 'goods.size_name', ''),
comment: item.content,
total: pageResponse.totalCount
};
... ...
... ... @@ -896,8 +896,6 @@ const _sizeInfoBoSort = (sizeInfoBo) => {
return {};
}
// TODO: 这里的排序代码很乱
_.get(sizeInfoBo, 'sizeBoList', []).forEach((sizeBoList, sizek)=> {
let sortAttr = {};
... ...
... ... @@ -110,17 +110,14 @@ const categoryNavigation = (data, params) => {
* @return {[array]}
*/
exports.processFloor = (list, params) => {
const formatData = [];
const formatData = {};
let floorData;
list = list || [];
// TODO:
list = camelCase(list);
// 格式化数据
_.forEach(list, (floor) => {
switch (floor.templateName) {
switch (floor.template_name) {
case 'NL2R':
floorData = {topBanner: floor.data};
break;
... ...
... ... @@ -73,17 +73,16 @@ exports.getSaleGoodsData = (params) => {
// 处理 VIP 商品数据
if (result[1].code === 200) {
// TODO:
let userInfo = result[1].data.vip_info ? camelCase(result[1].data.vip_info) : {};
let vipInfo = _.get(result, '[1].data.vip_info', {});
if (_.isEmpty(userInfo)) {
if (_.isEmpty(vipInfo)) {
logger.info('no user info');
}
if (params.saleType === '2') {
_.forEach(finalResult.goods, (value, key) => {
switch (userInfo.curLevel) {
switch (vipInfo.cur_level) {
case '1':
finalResult.goods[key].salesPrice = value.vip1Price;
finalResult.goods[key].vip1 = true;
... ... @@ -193,13 +192,15 @@ exports.getSaleIndexData = (channel) => {
if (result[4].code === 200) {
let breakingSizeSort = saleHandler.handleSaleBreakingSizeData(result[4].data);
return api.all([saleApi.getSaleGoodsList({
channel: channel,
saleType: '5', // app 与 pc 有冲突,为 PC 加一个 5 的选项
limit: '1',
breakSize: breakingSizeSort.breakSize,
breakSort: breakingSizeSort.breakSort
})]).then(subResult => {
return api.all([
saleApi.getSaleGoodsList({
channel: channel,
saleType: '5', // app 与 pc 有冲突,为 PC 加一个 5 的选项
limit: '1',
breakSize: breakingSizeSort.breakSize,
breakSort: breakingSizeSort.breakSort
})
]).then(subResult => {
if (subResult[0].code === 200) {
finalResult.saleCategory.push(
saleHandler.handleSaleCategoryData(
... ... @@ -316,17 +317,16 @@ exports.getSaleOthersData = (params, channel) => {
if (!_.isEmpty(result[4])) {
// 处理 VIP 商品数据
// TODO:
if (result[4].code === 200 && parseInt(params.saleType, 10) === 2) {
let userInfo = result[4].data.vip_info ? camelCase(result[4].data.vip_info) : {};
let vipInfo = _.get(result, '[4].data.vip_info', {});
if (_.isEmpty(userInfo)) {
if (_.isEmpty(vipInfo)) {
logger.info('no user info');
}
_.forEach(finalResult.goods, (value, key) => {
switch (userInfo.curLevel) {
switch (vipInfo.cur_level) {
case '1':
finalResult.goods[key].salesPrice = value.vip1Price;
finalResult.goods[key].vip1 = true;
... ...
... ... @@ -16,9 +16,9 @@ module.exports = {
siteUrl: 'http://www.yohobuy.com',
domains: {
favApi: 'http://192.168.102.31:8092/brower',
api: 'http://api-test3.yohops.com:9999/',
service: 'http://service-test3.yohops.com:9999/',
search: 'http://192.168.102.216:8080/yohosearch/'
api: 'http://api.yoho.yohoops.org/',
service: 'http://service.yoho.yohoops.org/',
search: 'http://search.yohoops.org/yohosearch/'
},
subDomains: {
host: '.yohobuy.com',
... ...
... ... @@ -49,11 +49,8 @@ const getNavBar = (data, type) => {
let navBars = [];
_.forEach(data, item => {
let obj = {},
// TODO:
lowEn = _.camelCase(item.sort_name_en).toLowerCase();
let obj = {};
let lowEn = _.camelCase(item.sort_name_en).toLowerCase();
obj.link = item.sort_url;
obj.cn = item.sort_name;
... ... @@ -142,7 +139,6 @@ const getSubNav = (data, type) => {
let subNav = [];
_.forEach(data, it => {
// TODO:
if (type === _.camelCase(it.sort_name_en).toLowerCase()) {
_.forEach(it.sub, item => {
let obj = {};
... ...
... ... @@ -14,7 +14,6 @@ module.exports = (list) => {
list = camelCase(list);
_.forEach(list, (floor) => {
// TODO:
floor[_.camelCase(floor.templateName)] = true;
// 特殊资源位处理
... ...