Authored by 陈峰

resolve conflicts

... ... @@ -128,6 +128,8 @@ const _getChannelResource = (params) => {
params.new_device = true; // eslint-disable-line
}
params.new_device = true;
return api.get('operations/api/v5/resource/home', params, {
cache: true
}).then(result => {
... ...
... ... @@ -385,12 +385,12 @@ const orderList = (req, res) => {
title: '我的分期订单',
orders: ((()=> {
// 处理数据,订单只包含第一条物品纪录
var list = result.data ? result.data.orderList : [];
var list = result.data ? result.data.order_list : [];
if (list) {
list.forEach((item)=> {
item.orderGoods = [
item.orderGoods[0]
item.order_goods = [
item.order_goods[0]
];
});
}
... ... @@ -422,16 +422,16 @@ const orderDetail = (req, res) => {
order: (()=> {
let refundStatusCount = 0, completeStatusCount = 0, listCount = 0;
if (result && result.data && result.data.orderGoods) {
result.data.orderGoods = [
result.data.orderGoods[0]
if (result && result.data && result.data.order_goods) {
result.data.order_goods = [
result.data.order_goods[0]
];
}
if (result && result.data && result.data.packageList) {
listCount = result.data.packageList.length;
if (result && result.data && result.data.package_list) {
listCount = result.data.package_list.length;
result.data.packageList.forEach((item)=> {
result.data.package_list.forEach((item)=> {
if (item.status === 2) {
completeStatusCount++;
} else if (item.status === 4 || item.status === 5) {
... ...
... ... @@ -12,7 +12,6 @@ const helpers = global.yoho.helpers;
const api = global.yoho.API;
const serviceAPI = global.yoho.ServiceAPI;
const logger = global.yoho.logger;
const camelCase = global.yoho.camelCase;
const API_TIMEOUT = 10000;
// 处理还款列表数据
... ... @@ -278,7 +277,7 @@ const getSearchIntallment = (params) => {
_.forEach(goods, (data) => {
data.url = helpers.appUrlFormat(data.url, 'go.productDetail', {
product_skn: data.productSkn
product_skn: data.product_skn
});
});
... ... @@ -369,10 +368,10 @@ const getInstallmentOrders = (params) => {
}, {
timeout: API_TIMEOUT
}).then((result) => {
return Promise.resolve(camelCase(result));
return Promise.resolve(result);
});
} else {
return Promise.resolve(camelCase(response[method]));
return Promise.resolve(response[method]);
}
};
... ... @@ -429,7 +428,7 @@ const getInstallmentOrderDetail = (params) => {
}, {
timeout: API_TIMEOUT
}).then((result)=> {
return Promise.resolve(camelCase(result));
return Promise.resolve(result);
});
};
... ... @@ -450,7 +449,7 @@ const totalAmount = (params) => {
}, {
timeout: API_TIMEOUT
}).then((result)=> {
return Promise.resolve(camelCase(result));
return Promise.resolve(result);
});
};
... ... @@ -468,7 +467,7 @@ const checkVerifyCode = (uid, mobile, code) => {
}, {
timeout: API_TIMEOUT
}).then((result)=> {
return Promise.resolve(camelCase(result));
return Promise.resolve(result);
});
};
... ...
<div class="installment-order-page yoho-page">
{{#order}}
<div class="order-info">
{{#greaterThanZero refundedAmt}}
{{#greaterThanZero refunded_amt}}
<div class="refund-text">
该订单已退款¥{{refundedAmt}}
该订单已退款¥{{refunded_amt}}
</div>
{{/greaterThanZero}}
<div class="order-detail">
{{#orderGoods}}
{{#order_goods}}
<div class="image-box">
<img src="{{image goodsImage 90 120}}" alt="{{productName}}">
<img src="{{image goods_image 90 120}}" alt="{{product_name}}">
</div>
<div class="info-box">
<h3>{{productName}}</h3>
<h4>订单编号: {{../orderCode}}</h4>
<div class="date-box">{{../createTime}}</div>
<h3>{{product_name}}</h3>
<h4>订单编号: {{../order_code}}</h4>
<div class="date-box">{{../create_time}}</div>
</div>
{{/orderGoods}}
{{/order_goods}}
</div>
<div class="installment-summary">
<div class="installment-box">
<div>分期本金</div>
<div>¥{{avgPrincipalAmt}}</div>
<div>¥{{avg_principal_amt}}</div>
</div>
<div class="installment-box">
<div>分期手续费</div>
<div>¥{{avgFeeAmt}}</div>
<div>¥{{avg_fee_amt}}</div>
</div>
<div class="installment-box">
<div>分期总应还</div>
<div>¥{{totalAmt}}</div>
<div>¥{{total_amt}}</div>
</div>
</div>
</div>
<div class="detail-list-container {{#greaterThanZero refundedAmt}}refunded-list{{/greaterThanZero}}">
<div class="detail-list-container {{#greaterThanZero refunded_amt}}refunded-list{{/greaterThanZero}}">
<ul class="installment-list repay-list">
{{#each packageList}}
{{#each package_list}}
<li>
{{#isPaymentIncomplete status}}
<input id="sort-{{@index}}" type="checkbox"
class="installment-check-btn installment-term"
data-order-code="{{../orderCode}}"
data-curr-amt="{{currAmt}}"
data-sort-id="{{sortId}}"
data-fee="{{currFeeAmt}}"
data-delay-fee="{{currDealyFeeAmt}}"
data-amount="{{currPrincipalAmt}}"/>
data-order-code="{{../order_code}}"
data-curr-amt="{{curr_amt}}"
data-sort-id="{{sort_id}}"
data-fee="{{curr_fee_amt}}"
data-delay-fee="{{curr_dealy_fee_amt}}"
data-amount="{{curr_principal_amt}}"/>
{{/isPaymentIncomplete}}
<label for="sort-{{@index}}">
{{#isPaymentComplete status}}
<span class="detail-index">{{sortId}}.</span>
<span class="detail-index">{{sort_id}}.</span>
{{/isPaymentComplete}}
<span class="amount">¥{{currAmt}}</span>
<span class="amount">¥{{curr_amt}}</span>
<div class="fee">
{{currDate}}
本金:¥{{currPrincipalAmt}}
{{curr_date}}
本金:¥{{curr_principal_amt}}
{{#if currFeeAmt}}
手续费:¥{{currFeeAmt}}
{{#if curr_fee_amt}}
手续费:¥{{curr_fee_amt}}
{{/if}}
{{#greaterThanZero currDealyFeeAmt}}
逾期服务费:¥{{currDealyFeeAmt}}
{{#greaterThanZero curr_dealy_fee_amt}}
逾期服务费:¥{{curr_dealy_fee_amt}}
{{/greaterThanZero}}
</div>
<div class="status">
... ... @@ -90,4 +90,4 @@
{{#isRepaymentAllCompleted order.status}}
<div class="all-completed">已还清</div>
{{/isRepaymentAllCompleted}}
</div>
\ No newline at end of file
</div>
... ...
{{#if orders}}
{{#each orders}}
<li>
<a href="/home/installment/order/{{orderCode}}">
{{#orderGoods}}
<a href="/home/installment/order/{{order_code}}">
{{#order_goods}}
<div class="image-box">
<img src="{{image goodsImage 90 120}}" alt="{{productName}}"/>
<img src="{{image goods_image 90 120}}" alt="{{product_name}}"/>
</div>
<div class="title-box">
<div class="product-name">{{productName}}</div>
<div class="date-box">{{../createTime}}</div>
<div class="product-name">{{product_name}}</div>
<div class="date-box">{{../create_time}}</div>
</div>
{{/orderGoods}}
{{/order_goods}}
</a>
<div class="right-box">
<div class="amount">¥{{amount}}</div>
<div class="status">{{installStatus}}</div>
<div class="status">{{install_status}}</div>
</div>
<div class="clearfix"></div>
</li>
... ...
... ... @@ -10,7 +10,7 @@ const contentCodeConfig = require('../../../config/content-code');
const _ = require('lodash');
const camelCase = global.yoho.camelCase;
// const camelCase = global.yoho.camelCase;
const log = global.yoho.logger;
const serviceApi = global.yoho.ServiceAPI;
const api = global.yoho.API;
... ... @@ -75,7 +75,8 @@ const _convertNavData = (list) => {
const formatData = [];
list = list || [];
list = camelCase(list);
// list = camelCase(list);
_.forEach(list, (item) => {
formatData.push({
id: item.id,
... ... @@ -209,7 +210,6 @@ const getContent = (categoryId, channel, code) => {
const p = [_getNavData(categoryId), _getOutletResource(channel, code), _getHomeActivity(params)];
return Promise.all(p).then(data => {
return {
nav: data[0] || [],
content: data[1] || [],
... ...
... ... @@ -2,7 +2,7 @@
var api = global.yoho.API;
const camelCase = global.yoho.camelCase;
// const camelCase = global.yoho.camelCase;
const helpers = global.yoho.helpers;
const _ = require('lodash');
... ... @@ -16,7 +16,7 @@ const getPreferenceData = (data) => {
let list = data.data || {};
list = camelCase(list);
// list = camelCase(list);
let distGoods = [];
... ... @@ -27,20 +27,33 @@ const getPreferenceData = (data) => {
}
value.goodsId = value.goodsList[0].goodsId;
let goods = value;
// let goods = value;
let goods = [];
goods.push({
productSkn: value.product_skn,
productName: value.product_name,
defaultImages: value.default_images,
isSoonSoldOut: value.is_soon_sold_out,
url: helpers.urlFormat(`/product/pro_${value.product_id}_${value.goodsId}/${value.cn_alphabet}.html`),
marketPrice: value.market_price,
salesPrice: value.sales_price
});
// goods.url = helpers.urlFormat(`/product/pro_${value.product_id}_${value.goodsId}/${value.cn_alphabet}.html`);
goods.url = helpers.urlFormat(`/product/pro_${value.productId}_${value.goodsId}/${value.cnAlphabet}.html`);
if (_.get(goods, 'tags[0]', null)) {
goods.tags = [];
if (goods.is_new === 'Y') {
if (goods.isNew === 'Y') {
goods.tags.push({is_new: true});
} else if (goods.isAdvance === 'Y') {
} else if (goods.is_advance === 'Y') {
goods.tags.push({isAdvance: true});
} else if (goods.isDiscount === 'Y') {
} else if (goods.is_discount === 'Y') {
goods.tags.push({isDiscount: true});
} else if (goods.isYohoood === 'Y') {
} else if (goods.is_yohoood === 'Y') {
goods.tags.push({isYohoood: true});
} else if (goods.isLimited === 'Y') {
} else if (goods.is_limited === 'Y') {
goods.tags.push({isLimited: true});
}
}
... ...
... ... @@ -131,6 +131,7 @@ const _processBreakingSort = (list) => {
const sub = [];
list = list || [];
_.forEach(list, (data, index) => {
const allSub = [];
... ... @@ -244,6 +245,7 @@ const _getBreakingSort = (yhChannel) => {
cache: true
}).then((result) => {
if (result && result.code === 200) {
return _processBreakingSort(result.data);
} else {
logger.error('api app.sale.getBreakingSort code no 200');
... ... @@ -269,6 +271,7 @@ const getSearchData = (params, uid) => {
}
}),
_getUserProfile(uid).then((result) => {
if (result && result.code === 200) {
return result.data.vip_info ? result.data.vip_info : {};
} else {
... ...
... ... @@ -22,4 +22,4 @@
<div class="pagination-inner">
</div>
</div>
</div>
\ No newline at end of file
</div>
... ...
... ... @@ -19,4 +19,4 @@
{{/ list}}
</ul>
</div>
{{/data}}
\ No newline at end of file
{{/data}}
... ...
{{#data}}
{{> common/floor-header-more}}
<div class="fresh-only">
{{# bannerImage}}
{{# banner_image}}
<div class="fresh-swiper">
<a href="{{url}}">
<img class="lazy" data-original="{{image src 640 200}}">
</a>
</div>
{{/ bannerImage}}
{{/ banner_image}}
<div class="fresh-list-swiper">
<ul class="clearfix swiper-wrapper">
{{# list}}
<li class="swiper-slide">
<li class="swiper-slide">
<div class="img-box">
<a href="{{url}}">
<img class="swiper-lazy" data-src="{{image defaultImages 235 314}}" alt="">
<img class="swiper-lazy" data-src="{{image default_images 235 314}}" alt="">
</a>
<div class="swiper-lazy-preloader"></div>
</div>
<div class="fresh-info">
<p class="fresh-name"><a href="{{url}}">{{productName}}</a></p>
<p class="fresh-name"><a href="{{url}}">{{product_name}}</a></p>
<p class="price">
<span class="cur-price">¥{{salesPrice}}</span>
{{# marketPrice}}
<span class="cur-price">¥{{sales_price}}</span>
{{# market_price}}
<span class="old-price">¥{{.}}</span>
{{/marketPrice}}
{{/market_price}}
</p>
<span class="fresh-icon">新人价</span>
</div>
</li>
{{/ list}}
</ul>
</div>
</div>
</div>
{{/data}}
\ No newline at end of file
{{/data}}
... ...
... ... @@ -14,7 +14,7 @@
<p class="title">{{title}}</p>
<p class="time">
<span class="iconfont time-icon">&#xe603;</span>
<span>{{publishTime}}</span>
<span>{{publish_time}}</span>
</p>
</div>
</a>
... ...
... ... @@ -12,9 +12,9 @@
<h3 class="recommend-title">推荐搭配</h3>
<div class="recommend-swiper">
<ul class="recommend-list swiper-wrapper clearfix">
{{# recommendCollocation}}
{{# recommend_collocation}}
<li class="recommend-item swiper-slide"><a href="{{url}}"><img class="img" src="{{image src 140 140}}" alt="" /></a></li>
{{/ recommendCollocation}}
{{/ recommend_collocation}}
</ul>
</div>
</div>
... ...
... ... @@ -44,7 +44,7 @@
line-height: 1;
.sale-price {
display: block;
/*display: block;*/
margin-right: 8px;
color: #d9134f;
}
... ...
... ... @@ -134,7 +134,6 @@ exports.processProductList = (list, options) => {
if (options.showTags) {
product.tags = {};
product.tags.is_new = options.showNew && product.is_new === 'Y'; // 新品
product.tags.is_discount = options.showSale && product.is_discount === 'Y'; // 在售
product.tags.is_limited = product.is_limited === 'Y'; // 限量
... ... @@ -211,7 +210,7 @@ exports.processFilter = (list, options) => {
dataType: 'gender',
sortNum: '0'
},
groupSort: {
group_sort: {
name: '所有品类',
title: '品类',
dataId: 'relation_parameter',
... ... @@ -254,13 +253,12 @@ exports.processFilter = (list, options) => {
exclude: null // 需要排除的字段
}, options);
_.forEach(list, (item, key) => {
let classify = {
subs: []
};
if (key === 'group_sort' || !filtersType[key]) {
if (!filtersType[key]) {
return;
}
... ...
... ... @@ -49,7 +49,7 @@ module.exports = (list) => {
// 折扣专场
if (floor.discountActivity && floor.data && floor.data.list.length) {
_.map(floor.data.list, (item) => {
Object.assign(item, processTime(item.leftTime));
Object.assign(item, processTime(item.left_time));
});
}
... ...