Showing
5 changed files
with
51 additions
and
23 deletions
@@ -55,10 +55,24 @@ const refund = { | @@ -55,10 +55,24 @@ const refund = { | ||
55 | return res.json(data); | 55 | return res.json(data); |
56 | }).catch(next); | 56 | }).catch(next); |
57 | }, | 57 | }, |
58 | - status(req, res) { | 58 | + refundStatus(req, res) { |
59 | + const applyId = req.params.applyId; | ||
60 | + | ||
61 | + res.render('status', { | ||
62 | + module: 'me', | ||
63 | + page: 'status', | ||
64 | + applyId: applyId, | ||
65 | + type: 'refund' | ||
66 | + }); | ||
67 | + }, | ||
68 | + exchangeStatus(req, res) { | ||
69 | + const applyId = req.params.applyId; | ||
70 | + | ||
59 | res.render('status', { | 71 | res.render('status', { |
60 | module: 'me', | 72 | module: 'me', |
61 | - page: 'status' | 73 | + page: 'status', |
74 | + applyId: applyId, | ||
75 | + type: 'exchange' | ||
62 | }); | 76 | }); |
63 | }, | 77 | }, |
64 | statusDetail(req, res, next) { | 78 | statusDetail(req, res, next) { |
@@ -42,8 +42,9 @@ router.post('/me/del-favdel', favorite.deletefav); // 个人中心 - 收藏商 | @@ -42,8 +42,9 @@ router.post('/me/del-favdel', favorite.deletefav); // 个人中心 - 收藏商 | ||
42 | 42 | ||
43 | // 退换货 | 43 | // 退换货 |
44 | router.get('/me/return', refund.refundOrders); // 退换货 - 订单列表 | 44 | router.get('/me/return', refund.refundOrders); // 退换货 - 订单列表 |
45 | -router.get('/me/status', refund.status); // 退换货 - 状态 | ||
46 | -router.get('/me/status-detail', refund.statusDetail); // 退换货 - 状态详细信息 | 45 | +router.get('/me/return/refund/detail/:applyId', refund.refundStatus); // 退换货 - 退货状态 |
46 | +router.get('/me/return/exchange/detail/:applyId', refund.exchangeStatus); // 退换货 - 换货状态 | ||
47 | +router.get('/me/return/status-detail', refund.statusDetail); // 退换货 - 状态详细信息 | ||
47 | router.get('/me/return/getOrderList', refund.getRefundOrders); // 退换货 - 获取订单列表数据 | 48 | router.get('/me/return/getOrderList', refund.getRefundOrders); // 退换货 - 获取订单列表数据 |
48 | 49 | ||
49 | // 退货申请 | 50 | // 退货申请 |
@@ -132,18 +132,15 @@ const matchHeader = (url) => { | @@ -132,18 +132,15 @@ const matchHeader = (url) => { | ||
132 | return header; | 132 | return header; |
133 | } | 133 | } |
134 | 134 | ||
135 | - if (/\/me\/status$/.test(path)) { | ||
136 | - let des = ''; | ||
137 | - let u = url.split('?')[1]; | 135 | + if (/\/me\/return\/refund\/detail/.test(path)) { |
136 | + header = titleMap[1]; | ||
137 | + header.title.des = '退货状态'; | ||
138 | + return header; | ||
139 | + } | ||
138 | 140 | ||
139 | - u = parse(u); | ||
140 | - if (u.type === 'refund') { | ||
141 | - des = '退货状态'; | ||
142 | - } else if (u.type === 'exchange') { | ||
143 | - des = '换货状态'; | ||
144 | - } | 141 | + if (/\/me\/return\/exchange\/detail/.test(path)) { |
145 | header = titleMap[1]; | 142 | header = titleMap[1]; |
146 | - header.title.des = des; | 143 | + header.title.des = '换货状态'; |
147 | return header; | 144 | return header; |
148 | } | 145 | } |
149 | 146 |
@@ -30,7 +30,7 @@ | @@ -30,7 +30,7 @@ | ||
30 | </div> | 30 | </div> |
31 | <div v-if="(detail.deliveryTpye === '10' || type ==='refund') && detail.status == 10" | 31 | <div v-if="(detail.deliveryTpye === '10' || type ==='refund') && detail.status == 10" |
32 | class="logistics"> | 32 | class="logistics"> |
33 | - <a href="/me/return/logistics?applyid={{orderCode}}">填写商品寄回的快递信息</a> | 33 | + <a href="/me/return/logistics?applyid={{applyid}}">填写商品寄回的快递信息</a> |
34 | </div> | 34 | </div> |
35 | </div> | 35 | </div> |
36 | <div class="exchange-details"> | 36 | <div class="exchange-details"> |
@@ -108,12 +108,12 @@ | @@ -108,12 +108,12 @@ | ||
108 | <script> | 108 | <script> |
109 | const $ = require('jquery'); | 109 | const $ = require('jquery'); |
110 | const util = require('common/util'); | 110 | const util = require('common/util'); |
111 | - const qs = require('yoho-qs'); | 111 | + const yoho = require('yoho'); |
112 | 112 | ||
113 | module.exports = { | 113 | module.exports = { |
114 | + props: ['applyid', 'type'], | ||
114 | data() { | 115 | data() { |
115 | return { | 116 | return { |
116 | - type: qs.type || '', | ||
117 | orderCode: '', | 117 | orderCode: '', |
118 | detail: {} | 118 | detail: {} |
119 | }; | 119 | }; |
@@ -141,8 +141,24 @@ | @@ -141,8 +141,24 @@ | ||
141 | } | 141 | } |
142 | }).then(function(data) { | 142 | }).then(function(data) { |
143 | if (data.code === 200) { | 143 | if (data.code === 200) { |
144 | - //todo | ||
145 | - | 144 | + if (yoho.isApp) { |
145 | + const url = '/me/return'; | ||
146 | + yoho.goNewPage({ | ||
147 | + header: { | ||
148 | + headerid: '1', | ||
149 | + left: { | ||
150 | + action: '' | ||
151 | + }, | ||
152 | + title: { | ||
153 | + des: '退/换货', | ||
154 | + action: '' | ||
155 | + } | ||
156 | + }, | ||
157 | + url: location.origin + url | ||
158 | + }); | ||
159 | + } else { | ||
160 | + location.href = url; | ||
161 | + } | ||
146 | } else if (data.code === 400) { | 162 | } else if (data.code === 400) { |
147 | tip(data.message); | 163 | tip(data.message); |
148 | } else { | 164 | } else { |
@@ -155,10 +171,10 @@ | @@ -155,10 +171,10 @@ | ||
155 | let _this = this; | 171 | let _this = this; |
156 | 172 | ||
157 | $.ajax({ | 173 | $.ajax({ |
158 | - url: '/me/status-detail', | 174 | + url: '/me/return/status-detail', |
159 | data: { | 175 | data: { |
160 | - applyid: qs.applyid || '', | ||
161 | - type: qs.type || '' | 176 | + applyid: this.applyid, |
177 | + type: this.type | ||
162 | } | 178 | } |
163 | }).then(res => { | 179 | }).then(res => { |
164 | if (res.data) { | 180 | if (res.data) { |
-
Please register or login to post a comment