Merge branch 'feature/return' into develop
Showing
5 changed files
with
48 additions
and
27 deletions
@@ -80,7 +80,7 @@ const refundDetail = (req, res, next) => { | @@ -80,7 +80,7 @@ const refundDetail = (req, res, next) => { | ||
80 | 80 | ||
81 | const exchange = (req, res, next) => { | 81 | const exchange = (req, res, next) => { |
82 | const code = req.params.orderCode; | 82 | const code = req.params.orderCode; |
83 | - const uid = req.user.uid; | 83 | + const uid = req.user.uid || 8050882; |
84 | 84 | ||
85 | returns.getChangeGoodsList(code, uid).then(result => { | 85 | returns.getChangeGoodsList(code, uid).then(result => { |
86 | res.display('index', { | 86 | res.display('index', { |
@@ -56,27 +56,32 @@ const getUserReturn = (uid, page) => { | @@ -56,27 +56,32 @@ const getUserReturn = (uid, page) => { | ||
56 | 2: '换货' | 56 | 2: '换货' |
57 | }; | 57 | }; |
58 | 58 | ||
59 | - const data = camelCase(result.data); | 59 | + let data = {}; |
60 | + let paginationOpts = false; | ||
60 | 61 | ||
61 | - const paginationOpts = data.total > pageSize ? { | ||
62 | - paginationOpts: { | ||
63 | - total: data.total, | ||
64 | - page: data.page, | ||
65 | - limit: pageSize | ||
66 | - } | ||
67 | - } : false; | ||
68 | - | ||
69 | - data.list.forEach(item => { | ||
70 | - item.orderGoods = item.goods; | ||
71 | - item.createTime = item.orderCreateTime; | ||
72 | - item.hidePrice = true; | ||
73 | - item.showStatus = true; | ||
74 | - item.refundStr = refundStr[item.refundType]; | 62 | + if (result && result.data) { |
63 | + data = camelCase(result.data); | ||
75 | 64 | ||
76 | - item.orderGoods.forEach(it => { | ||
77 | - it.hidePrice = true; | 65 | + paginationOpts = data.total > pageSize ? { |
66 | + paginationOpts: { | ||
67 | + total: data.total, | ||
68 | + page: data.page, | ||
69 | + limit: pageSize | ||
70 | + } | ||
71 | + } : false; | ||
72 | + | ||
73 | + data.list.forEach(item => { | ||
74 | + item.orderGoods = item.goods; | ||
75 | + item.createTime = item.orderCreateTime; | ||
76 | + item.hidePrice = true; | ||
77 | + item.showStatus = true; | ||
78 | + item.refundStr = refundStr[item.refundType]; | ||
79 | + | ||
80 | + item.orderGoods.forEach(it => { | ||
81 | + it.hidePrice = true; | ||
82 | + }); | ||
78 | }); | 83 | }); |
79 | - }); | 84 | + } |
80 | 85 | ||
81 | return { | 86 | return { |
82 | returnsList: Object.assign(data, paginationOpts, basicData) | 87 | returnsList: Object.assign(data, paginationOpts, basicData) |
@@ -7,7 +7,7 @@ | @@ -7,7 +7,7 @@ | ||
7 | <ul class="header"> | 7 | <ul class="header"> |
8 | <li class="info">商品信息</li> | 8 | <li class="info">商品信息</li> |
9 | <li class="change-reason">换货原因</li> | 9 | <li class="change-reason">换货原因</li> |
10 | - <li class="change-num">换货数量</li> | 10 | + <li class="change-num hide">换货数量</li> |
11 | </ul> | 11 | </ul> |
12 | {{#goodsList}} | 12 | {{#goodsList}} |
13 | <div class="change-info-box"> | 13 | <div class="change-info-box"> |
@@ -284,7 +284,7 @@ function bindConfirmEvent() { | @@ -284,7 +284,7 @@ function bindConfirmEvent() { | ||
284 | changeData.consignee_name = $('#user').val(); | 284 | changeData.consignee_name = $('#user').val(); |
285 | changeData.address = $('#addr').val(); | 285 | changeData.address = $('#addr').val(); |
286 | changeData.mobile = $('#mob').val(); | 286 | changeData.mobile = $('#mob').val(); |
287 | - changeData.delivery_type = $('.change-type .type.active').data('type'); | 287 | + changeData.delivery_tpye = $('.change-type .type.active').data('type'); |
288 | 288 | ||
289 | submitChange(changeData); | 289 | submitChange(changeData); |
290 | }); | 290 | }); |
@@ -297,9 +297,11 @@ function initAddr() { | @@ -297,9 +297,11 @@ function initAddr() { | ||
297 | }); | 297 | }); |
298 | } | 298 | } |
299 | 299 | ||
300 | -getProductInfo(); | ||
301 | -bindSelectEvent(); | ||
302 | -bindTypeEvent(); | ||
303 | -bindCheckboxEvent(); | ||
304 | -bindConfirmEvent(); | ||
305 | -initAddr(); | 300 | +$(document).on('ready', function() { |
301 | + getProductInfo(); | ||
302 | + bindSelectEvent(); | ||
303 | + bindTypeEvent(); | ||
304 | + bindCheckboxEvent(); | ||
305 | + bindConfirmEvent(); | ||
306 | + initAddr(); | ||
307 | +}); |
@@ -2,6 +2,14 @@ | @@ -2,6 +2,14 @@ | ||
2 | .change-info-box { | 2 | .change-info-box { |
3 | margin-bottom: 20px; | 3 | margin-bottom: 20px; |
4 | border: 1px solid #f1f1f1; | 4 | border: 1px solid #f1f1f1; |
5 | + padding: 0 54px 20px; | ||
6 | + | ||
7 | + .left { | ||
8 | + &.left-title { | ||
9 | + width: auto; | ||
10 | + padding-left: 0; | ||
11 | + } | ||
12 | + } | ||
5 | } | 13 | } |
6 | 14 | ||
7 | &.change { | 15 | &.change { |
@@ -13,6 +21,12 @@ | @@ -13,6 +21,12 @@ | ||
13 | } | 21 | } |
14 | } | 22 | } |
15 | 23 | ||
24 | + .header { | ||
25 | + .info { | ||
26 | + width: 540px; | ||
27 | + } | ||
28 | + } | ||
29 | + | ||
16 | .box-title { | 30 | .box-title { |
17 | display: block; | 31 | display: block; |
18 | padding: 20px 0; | 32 | padding: 20px 0; |
-
Please register or login to post a comment