Authored by 王水玲

camelCase 命名方式修改

... ... @@ -35,7 +35,7 @@ const _reviewStatus = (res, req, uid, status) => {
installmentOnly: {
title: {
title: '分期专享',
moreUrl: helpers.appUrlFormat(req.originalUrl, 'go.instalmentlist', {
more_url: helpers.appUrlFormat(req.originalUrl, 'go.instalmentlist', {
title: '分期专享'
})
},
... ... @@ -101,7 +101,7 @@ const index = (req, res) => {
let installmentOnly = {
title: {
title: '分期专享',
moreUrl: helpers.appUrlFormat(req.originalUrl, 'go.instalmentlist', {
more_url: helpers.appUrlFormat(req.originalUrl, 'go.instalmentlist', {
title: '分期专享'
})
},
... ... @@ -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>
... ...
'use strict';
require('../app');
const _ = require('lodash');
const camelCase = global.yoho.camelCase;
const helpers = global.yoho.helpers;
/**
... ... @@ -180,7 +179,7 @@ exports.processFilter = (list, options) => {
name: '所有品牌',
title: '品牌',
dataId: 'id',
subsName: 'brandName',
subsName: 'brand_name',
firstSub: 0,
dataType: 'brand',
sortNum: '2'
... ... @@ -188,8 +187,8 @@ exports.processFilter = (list, options) => {
color: {
name: '所有颜色',
title: '颜色',
dataId: 'colorId',
subsName: 'colorName',
dataId: 'color_id',
subsName: 'color_name',
firstSub: 0,
dataType: 'color',
sortNum: '4'
... ... @@ -212,11 +211,11 @@ exports.processFilter = (list, options) => {
dataType: 'gender',
sortNum: '0'
},
groupSort: {
group_sort: {
name: '所有品类',
title: '品类',
dataId: 'relationParameter',
subsName: 'categoryName',
dataId: 'relation_parameter',
subsName: 'category_name',
firstSub: 0,
dataType: 'sort',
sortNum: '3'
... ... @@ -233,8 +232,8 @@ exports.processFilter = (list, options) => {
size: {
name: '所有尺码',
title: '尺码',
dataId: 'sizeId',
subsName: 'sizeName',
dataId: 'size_id',
subsName: 'size_name',
firstSub: 0,
dataType: 'size',
sortNum: '5'
... ... @@ -254,18 +253,17 @@ exports.processFilter = (list, options) => {
gender: '1,2,3', // 默认选择的性别,默认1,2,3表示所有
exclude: null // 需要排除的字段
}, options);
list = camelCase(list);
_.forEach(list, (item, key) => {
let classify = {
subs: []
};
if (key === 'group_sort' || !filtersType[key]) {
if (!filtersType[key]) {
return;
}
if ((options.hideSize && key === 'size') || (options.hideSort && key === 'groupSort')) {
if ((options.hideSize && key === 'size') || (options.hideSort && key === 'group_sort')) {
return;
}
... ... @@ -293,8 +291,8 @@ exports.processFilter = (list, options) => {
subs.dataId = sub._key;
} else if (filtersType[key].dataId === 'key') {
subs.dataId = index;
} else if (filtersType[key].dataId === 'relationParameter') {
subs.dataId = sub.relationParameter['sort']; // eslint-disable-line
} else if (filtersType[key].dataId === 'relation_parameter') {
subs.dataId = sub.relation_parameter['sort']; // eslint-disable-line
} else {
subs.dataId = sub[filtersType[key].dataId];
}
... ...