Showing
5 changed files
with
63 additions
and
66 deletions
@@ -35,7 +35,7 @@ const _reviewStatus = (res, req, uid, status) => { | @@ -35,7 +35,7 @@ const _reviewStatus = (res, req, uid, status) => { | ||
35 | installmentOnly: { | 35 | installmentOnly: { |
36 | title: { | 36 | title: { |
37 | title: '分期专享', | 37 | title: '分期专享', |
38 | - moreUrl: helpers.appUrlFormat(req.originalUrl, 'go.instalmentlist', { | 38 | + more_url: helpers.appUrlFormat(req.originalUrl, 'go.instalmentlist', { |
39 | title: '分期专享' | 39 | title: '分期专享' |
40 | }) | 40 | }) |
41 | }, | 41 | }, |
@@ -101,7 +101,7 @@ const index = (req, res) => { | @@ -101,7 +101,7 @@ const index = (req, res) => { | ||
101 | let installmentOnly = { | 101 | let installmentOnly = { |
102 | title: { | 102 | title: { |
103 | title: '分期专享', | 103 | title: '分期专享', |
104 | - moreUrl: helpers.appUrlFormat(req.originalUrl, 'go.instalmentlist', { | 104 | + more_url: helpers.appUrlFormat(req.originalUrl, 'go.instalmentlist', { |
105 | title: '分期专享' | 105 | title: '分期专享' |
106 | }) | 106 | }) |
107 | }, | 107 | }, |
@@ -385,12 +385,12 @@ const orderList = (req, res) => { | @@ -385,12 +385,12 @@ const orderList = (req, res) => { | ||
385 | title: '我的分期订单', | 385 | title: '我的分期订单', |
386 | orders: ((()=> { | 386 | orders: ((()=> { |
387 | // 处理数据,订单只包含第一条物品纪录 | 387 | // 处理数据,订单只包含第一条物品纪录 |
388 | - var list = result.data ? result.data.orderList : []; | 388 | + var list = result.data ? result.data.order_list : []; |
389 | 389 | ||
390 | if (list) { | 390 | if (list) { |
391 | list.forEach((item)=> { | 391 | list.forEach((item)=> { |
392 | - item.orderGoods = [ | ||
393 | - item.orderGoods[0] | 392 | + item.order_goods = [ |
393 | + item.order_goods[0] | ||
394 | ]; | 394 | ]; |
395 | }); | 395 | }); |
396 | } | 396 | } |
@@ -422,16 +422,16 @@ const orderDetail = (req, res) => { | @@ -422,16 +422,16 @@ const orderDetail = (req, res) => { | ||
422 | order: (()=> { | 422 | order: (()=> { |
423 | let refundStatusCount = 0, completeStatusCount = 0, listCount = 0; | 423 | let refundStatusCount = 0, completeStatusCount = 0, listCount = 0; |
424 | 424 | ||
425 | - if (result && result.data && result.data.orderGoods) { | ||
426 | - result.data.orderGoods = [ | ||
427 | - result.data.orderGoods[0] | 425 | + if (result && result.data && result.data.order_goods) { |
426 | + result.data.order_goods = [ | ||
427 | + result.data.order_goods[0] | ||
428 | ]; | 428 | ]; |
429 | } | 429 | } |
430 | 430 | ||
431 | - if (result && result.data && result.data.packageList) { | ||
432 | - listCount = result.data.packageList.length; | 431 | + if (result && result.data && result.data.package_list) { |
432 | + listCount = result.data.package_list.length; | ||
433 | 433 | ||
434 | - result.data.packageList.forEach((item)=> { | 434 | + result.data.package_list.forEach((item)=> { |
435 | if (item.status === 2) { | 435 | if (item.status === 2) { |
436 | completeStatusCount++; | 436 | completeStatusCount++; |
437 | } else if (item.status === 4 || item.status === 5) { | 437 | } else if (item.status === 4 || item.status === 5) { |
@@ -12,7 +12,6 @@ const helpers = global.yoho.helpers; | @@ -12,7 +12,6 @@ const helpers = global.yoho.helpers; | ||
12 | const api = global.yoho.API; | 12 | const api = global.yoho.API; |
13 | const serviceAPI = global.yoho.ServiceAPI; | 13 | const serviceAPI = global.yoho.ServiceAPI; |
14 | const logger = global.yoho.logger; | 14 | const logger = global.yoho.logger; |
15 | -const camelCase = global.yoho.camelCase; | ||
16 | const API_TIMEOUT = 10000; | 15 | const API_TIMEOUT = 10000; |
17 | 16 | ||
18 | // 处理还款列表数据 | 17 | // 处理还款列表数据 |
@@ -278,7 +277,7 @@ const getSearchIntallment = (params) => { | @@ -278,7 +277,7 @@ const getSearchIntallment = (params) => { | ||
278 | 277 | ||
279 | _.forEach(goods, (data) => { | 278 | _.forEach(goods, (data) => { |
280 | data.url = helpers.appUrlFormat(data.url, 'go.productDetail', { | 279 | data.url = helpers.appUrlFormat(data.url, 'go.productDetail', { |
281 | - product_skn: data.productSkn | 280 | + product_skn: data.product_skn |
282 | }); | 281 | }); |
283 | }); | 282 | }); |
284 | 283 | ||
@@ -369,10 +368,10 @@ const getInstallmentOrders = (params) => { | @@ -369,10 +368,10 @@ const getInstallmentOrders = (params) => { | ||
369 | }, { | 368 | }, { |
370 | timeout: API_TIMEOUT | 369 | timeout: API_TIMEOUT |
371 | }).then((result) => { | 370 | }).then((result) => { |
372 | - return Promise.resolve(camelCase(result)); | 371 | + return Promise.resolve(result); |
373 | }); | 372 | }); |
374 | } else { | 373 | } else { |
375 | - return Promise.resolve(camelCase(response[method])); | 374 | + return Promise.resolve(response[method]); |
376 | } | 375 | } |
377 | }; | 376 | }; |
378 | 377 | ||
@@ -429,7 +428,7 @@ const getInstallmentOrderDetail = (params) => { | @@ -429,7 +428,7 @@ const getInstallmentOrderDetail = (params) => { | ||
429 | }, { | 428 | }, { |
430 | timeout: API_TIMEOUT | 429 | timeout: API_TIMEOUT |
431 | }).then((result)=> { | 430 | }).then((result)=> { |
432 | - return Promise.resolve(camelCase(result)); | 431 | + return Promise.resolve(result); |
433 | }); | 432 | }); |
434 | }; | 433 | }; |
435 | 434 | ||
@@ -450,7 +449,7 @@ const totalAmount = (params) => { | @@ -450,7 +449,7 @@ const totalAmount = (params) => { | ||
450 | }, { | 449 | }, { |
451 | timeout: API_TIMEOUT | 450 | timeout: API_TIMEOUT |
452 | }).then((result)=> { | 451 | }).then((result)=> { |
453 | - return Promise.resolve(camelCase(result)); | 452 | + return Promise.resolve(result); |
454 | }); | 453 | }); |
455 | }; | 454 | }; |
456 | 455 | ||
@@ -468,7 +467,7 @@ const checkVerifyCode = (uid, mobile, code) => { | @@ -468,7 +467,7 @@ const checkVerifyCode = (uid, mobile, code) => { | ||
468 | }, { | 467 | }, { |
469 | timeout: API_TIMEOUT | 468 | timeout: API_TIMEOUT |
470 | }).then((result)=> { | 469 | }).then((result)=> { |
471 | - return Promise.resolve(camelCase(result)); | 470 | + return Promise.resolve(result); |
472 | }); | 471 | }); |
473 | }; | 472 | }; |
474 | 473 |
1 | <div class="installment-order-page yoho-page"> | 1 | <div class="installment-order-page yoho-page"> |
2 | {{#order}} | 2 | {{#order}} |
3 | <div class="order-info"> | 3 | <div class="order-info"> |
4 | - {{#greaterThanZero refundedAmt}} | 4 | + {{#greaterThanZero refunded_amt}} |
5 | <div class="refund-text"> | 5 | <div class="refund-text"> |
6 | - 该订单已退款¥{{refundedAmt}} | 6 | + 该订单已退款¥{{refunded_amt}} |
7 | </div> | 7 | </div> |
8 | {{/greaterThanZero}} | 8 | {{/greaterThanZero}} |
9 | <div class="order-detail"> | 9 | <div class="order-detail"> |
10 | - {{#orderGoods}} | 10 | + {{#order_goods}} |
11 | <div class="image-box"> | 11 | <div class="image-box"> |
12 | - <img src="{{image goodsImage 90 120}}" alt="{{productName}}"> | 12 | + <img src="{{image goods_image 90 120}}" alt="{{product_name}}"> |
13 | </div> | 13 | </div> |
14 | <div class="info-box"> | 14 | <div class="info-box"> |
15 | - <h3>{{productName}}</h3> | ||
16 | - <h4>订单编号: {{../orderCode}}</h4> | ||
17 | - <div class="date-box">{{../createTime}}</div> | 15 | + <h3>{{product_name}}</h3> |
16 | + <h4>订单编号: {{../order_code}}</h4> | ||
17 | + <div class="date-box">{{../create_time}}</div> | ||
18 | </div> | 18 | </div> |
19 | - {{/orderGoods}} | 19 | + {{/order_goods}} |
20 | </div> | 20 | </div> |
21 | 21 | ||
22 | <div class="installment-summary"> | 22 | <div class="installment-summary"> |
23 | 23 | ||
24 | <div class="installment-box"> | 24 | <div class="installment-box"> |
25 | <div>分期本金</div> | 25 | <div>分期本金</div> |
26 | - <div>¥{{avgPrincipalAmt}}</div> | 26 | + <div>¥{{avg_principal_amt}}</div> |
27 | </div> | 27 | </div> |
28 | 28 | ||
29 | <div class="installment-box"> | 29 | <div class="installment-box"> |
30 | <div>分期手续费</div> | 30 | <div>分期手续费</div> |
31 | - <div>¥{{avgFeeAmt}}</div> | 31 | + <div>¥{{avg_fee_amt}}</div> |
32 | </div> | 32 | </div> |
33 | 33 | ||
34 | <div class="installment-box"> | 34 | <div class="installment-box"> |
35 | <div>分期总应还</div> | 35 | <div>分期总应还</div> |
36 | - <div>¥{{totalAmt}}</div> | 36 | + <div>¥{{total_amt}}</div> |
37 | </div> | 37 | </div> |
38 | </div> | 38 | </div> |
39 | </div> | 39 | </div> |
40 | - <div class="detail-list-container {{#greaterThanZero refundedAmt}}refunded-list{{/greaterThanZero}}"> | 40 | + <div class="detail-list-container {{#greaterThanZero refunded_amt}}refunded-list{{/greaterThanZero}}"> |
41 | <ul class="installment-list repay-list"> | 41 | <ul class="installment-list repay-list"> |
42 | - {{#each packageList}} | 42 | + {{#each package_list}} |
43 | <li> | 43 | <li> |
44 | {{#isPaymentIncomplete status}} | 44 | {{#isPaymentIncomplete status}} |
45 | <input id="sort-{{@index}}" type="checkbox" | 45 | <input id="sort-{{@index}}" type="checkbox" |
46 | class="installment-check-btn installment-term" | 46 | class="installment-check-btn installment-term" |
47 | - data-order-code="{{../orderCode}}" | ||
48 | - data-curr-amt="{{currAmt}}" | ||
49 | - data-sort-id="{{sortId}}" | ||
50 | - data-fee="{{currFeeAmt}}" | ||
51 | - data-delay-fee="{{currDealyFeeAmt}}" | ||
52 | - data-amount="{{currPrincipalAmt}}"/> | 47 | + data-order-code="{{../order_code}}" |
48 | + data-curr-amt="{{curr_amt}}" | ||
49 | + data-sort-id="{{sort_id}}" | ||
50 | + data-fee="{{curr_fee_amt}}" | ||
51 | + data-delay-fee="{{curr_dealy_fee_amt}}" | ||
52 | + data-amount="{{curr_principal_amt}}"/> | ||
53 | {{/isPaymentIncomplete}} | 53 | {{/isPaymentIncomplete}} |
54 | <label for="sort-{{@index}}"> | 54 | <label for="sort-{{@index}}"> |
55 | {{#isPaymentComplete status}} | 55 | {{#isPaymentComplete status}} |
56 | - <span class="detail-index">{{sortId}}.</span> | 56 | + <span class="detail-index">{{sort_id}}.</span> |
57 | {{/isPaymentComplete}} | 57 | {{/isPaymentComplete}} |
58 | 58 | ||
59 | - <span class="amount">¥{{currAmt}}</span> | 59 | + <span class="amount">¥{{curr_amt}}</span> |
60 | <div class="fee"> | 60 | <div class="fee"> |
61 | - {{currDate}} | ||
62 | - 本金:¥{{currPrincipalAmt}} | 61 | + {{curr_date}} |
62 | + 本金:¥{{curr_principal_amt}} | ||
63 | 63 | ||
64 | - {{#if currFeeAmt}} | ||
65 | - 手续费:¥{{currFeeAmt}} | 64 | + {{#if curr_fee_amt}} |
65 | + 手续费:¥{{curr_fee_amt}} | ||
66 | {{/if}} | 66 | {{/if}} |
67 | 67 | ||
68 | - {{#greaterThanZero currDealyFeeAmt}} | ||
69 | - 逾期服务费:¥{{currDealyFeeAmt}} | 68 | + {{#greaterThanZero curr_dealy_fee_amt}} |
69 | + 逾期服务费:¥{{curr_dealy_fee_amt}} | ||
70 | {{/greaterThanZero}} | 70 | {{/greaterThanZero}} |
71 | </div> | 71 | </div> |
72 | <div class="status"> | 72 | <div class="status"> |
1 | {{#if orders}} | 1 | {{#if orders}} |
2 | {{#each orders}} | 2 | {{#each orders}} |
3 | <li> | 3 | <li> |
4 | - <a href="/home/installment/order/{{orderCode}}"> | ||
5 | - {{#orderGoods}} | 4 | + <a href="/home/installment/order/{{order_code}}"> |
5 | + {{#order_goods}} | ||
6 | <div class="image-box"> | 6 | <div class="image-box"> |
7 | - <img src="{{image goodsImage 90 120}}" alt="{{productName}}"/> | 7 | + <img src="{{image goods_image 90 120}}" alt="{{product_name}}"/> |
8 | </div> | 8 | </div> |
9 | <div class="title-box"> | 9 | <div class="title-box"> |
10 | - <div class="product-name">{{productName}}</div> | ||
11 | - <div class="date-box">{{../createTime}}</div> | 10 | + <div class="product-name">{{product_name}}</div> |
11 | + <div class="date-box">{{../create_time}}</div> | ||
12 | </div> | 12 | </div> |
13 | - {{/orderGoods}} | 13 | + {{/order_goods}} |
14 | </a> | 14 | </a> |
15 | 15 | ||
16 | <div class="right-box"> | 16 | <div class="right-box"> |
17 | <div class="amount">¥{{amount}}</div> | 17 | <div class="amount">¥{{amount}}</div> |
18 | - <div class="status">{{installStatus}}</div> | 18 | + <div class="status">{{install_status}}</div> |
19 | </div> | 19 | </div> |
20 | <div class="clearfix"></div> | 20 | <div class="clearfix"></div> |
21 | </li> | 21 | </li> |
1 | 'use strict'; | 1 | 'use strict'; |
2 | require('../app'); | 2 | require('../app'); |
3 | const _ = require('lodash'); | 3 | const _ = require('lodash'); |
4 | -const camelCase = global.yoho.camelCase; | ||
5 | const helpers = global.yoho.helpers; | 4 | const helpers = global.yoho.helpers; |
6 | 5 | ||
7 | /** | 6 | /** |
@@ -180,7 +179,7 @@ exports.processFilter = (list, options) => { | @@ -180,7 +179,7 @@ exports.processFilter = (list, options) => { | ||
180 | name: '所有品牌', | 179 | name: '所有品牌', |
181 | title: '品牌', | 180 | title: '品牌', |
182 | dataId: 'id', | 181 | dataId: 'id', |
183 | - subsName: 'brandName', | 182 | + subsName: 'brand_name', |
184 | firstSub: 0, | 183 | firstSub: 0, |
185 | dataType: 'brand', | 184 | dataType: 'brand', |
186 | sortNum: '2' | 185 | sortNum: '2' |
@@ -188,8 +187,8 @@ exports.processFilter = (list, options) => { | @@ -188,8 +187,8 @@ exports.processFilter = (list, options) => { | ||
188 | color: { | 187 | color: { |
189 | name: '所有颜色', | 188 | name: '所有颜色', |
190 | title: '颜色', | 189 | title: '颜色', |
191 | - dataId: 'colorId', | ||
192 | - subsName: 'colorName', | 190 | + dataId: 'color_id', |
191 | + subsName: 'color_name', | ||
193 | firstSub: 0, | 192 | firstSub: 0, |
194 | dataType: 'color', | 193 | dataType: 'color', |
195 | sortNum: '4' | 194 | sortNum: '4' |
@@ -212,11 +211,11 @@ exports.processFilter = (list, options) => { | @@ -212,11 +211,11 @@ exports.processFilter = (list, options) => { | ||
212 | dataType: 'gender', | 211 | dataType: 'gender', |
213 | sortNum: '0' | 212 | sortNum: '0' |
214 | }, | 213 | }, |
215 | - groupSort: { | 214 | + group_sort: { |
216 | name: '所有品类', | 215 | name: '所有品类', |
217 | title: '品类', | 216 | title: '品类', |
218 | - dataId: 'relationParameter', | ||
219 | - subsName: 'categoryName', | 217 | + dataId: 'relation_parameter', |
218 | + subsName: 'category_name', | ||
220 | firstSub: 0, | 219 | firstSub: 0, |
221 | dataType: 'sort', | 220 | dataType: 'sort', |
222 | sortNum: '3' | 221 | sortNum: '3' |
@@ -233,8 +232,8 @@ exports.processFilter = (list, options) => { | @@ -233,8 +232,8 @@ exports.processFilter = (list, options) => { | ||
233 | size: { | 232 | size: { |
234 | name: '所有尺码', | 233 | name: '所有尺码', |
235 | title: '尺码', | 234 | title: '尺码', |
236 | - dataId: 'sizeId', | ||
237 | - subsName: 'sizeName', | 235 | + dataId: 'size_id', |
236 | + subsName: 'size_name', | ||
238 | firstSub: 0, | 237 | firstSub: 0, |
239 | dataType: 'size', | 238 | dataType: 'size', |
240 | sortNum: '5' | 239 | sortNum: '5' |
@@ -254,18 +253,17 @@ exports.processFilter = (list, options) => { | @@ -254,18 +253,17 @@ exports.processFilter = (list, options) => { | ||
254 | gender: '1,2,3', // 默认选择的性别,默认1,2,3表示所有 | 253 | gender: '1,2,3', // 默认选择的性别,默认1,2,3表示所有 |
255 | exclude: null // 需要排除的字段 | 254 | exclude: null // 需要排除的字段 |
256 | }, options); | 255 | }, options); |
257 | - list = camelCase(list); | ||
258 | 256 | ||
259 | _.forEach(list, (item, key) => { | 257 | _.forEach(list, (item, key) => { |
260 | let classify = { | 258 | let classify = { |
261 | subs: [] | 259 | subs: [] |
262 | }; | 260 | }; |
263 | 261 | ||
264 | - if (key === 'group_sort' || !filtersType[key]) { | 262 | + if (!filtersType[key]) { |
265 | return; | 263 | return; |
266 | } | 264 | } |
267 | 265 | ||
268 | - if ((options.hideSize && key === 'size') || (options.hideSort && key === 'groupSort')) { | 266 | + if ((options.hideSize && key === 'size') || (options.hideSort && key === 'group_sort')) { |
269 | return; | 267 | return; |
270 | } | 268 | } |
271 | 269 | ||
@@ -293,8 +291,8 @@ exports.processFilter = (list, options) => { | @@ -293,8 +291,8 @@ exports.processFilter = (list, options) => { | ||
293 | subs.dataId = sub._key; | 291 | subs.dataId = sub._key; |
294 | } else if (filtersType[key].dataId === 'key') { | 292 | } else if (filtersType[key].dataId === 'key') { |
295 | subs.dataId = index; | 293 | subs.dataId = index; |
296 | - } else if (filtersType[key].dataId === 'relationParameter') { | ||
297 | - subs.dataId = sub.relationParameter['sort']; // eslint-disable-line | 294 | + } else if (filtersType[key].dataId === 'relation_parameter') { |
295 | + subs.dataId = sub.relation_parameter['sort']; // eslint-disable-line | ||
298 | } else { | 296 | } else { |
299 | subs.dataId = sub[filtersType[key].dataId]; | 297 | subs.dataId = sub[filtersType[key].dataId]; |
300 | } | 298 | } |
-
Please register or login to post a comment