Authored by 沈志敏

退换货状态

... ... @@ -55,10 +55,24 @@ const refund = {
return res.json(data);
}).catch(next);
},
status(req, res) {
refundStatus(req, res) {
const applyId = req.params.applyId;
res.render('status', {
module: 'me',
page: 'status',
applyId: applyId,
type: 'refund'
});
},
exchangeStatus(req, res) {
const applyId = req.params.applyId;
res.render('status', {
module: 'me',
page: 'status'
page: 'status',
applyId: applyId,
type: 'exchange'
});
},
statusDetail(req, res, next) {
... ...
... ... @@ -42,8 +42,9 @@ router.post('/me/del-favdel', favorite.deletefav); // 个人中心 - 收藏商
// 退换货
router.get('/me/return', refund.refundOrders); // 退换货 - 订单列表
router.get('/me/status', refund.status); // 退换货 - 状态
router.get('/me/status-detail', refund.statusDetail); // 退换货 - 状态详细信息
router.get('/me/return/refund/detail/:applyId', refund.refundStatus); // 退换货 - 退货状态
router.get('/me/return/exchange/detail/:applyId', refund.exchangeStatus); // 退换货 - 换货状态
router.get('/me/return/status-detail', refund.statusDetail); // 退换货 - 状态详细信息
router.get('/me/return/getOrderList', refund.getRefundOrders); // 退换货 - 获取订单列表数据
// 退货申请
... ...
<div class="status" id="status">
<status></status>
<status :applyid="{{applyId}}" :type="{{type}}"></status>
</div>
... ...
... ... @@ -132,18 +132,15 @@ const matchHeader = (url) => {
return header;
}
if (/\/me\/status$/.test(path)) {
let des = '';
let u = url.split('?')[1];
if (/\/me\/return\/refund\/detail/.test(path)) {
header = titleMap[1];
header.title.des = '退货状态';
return header;
}
u = parse(u);
if (u.type === 'refund') {
des = '退货状态';
} else if (u.type === 'exchange') {
des = '换货状态';
}
if (/\/me\/return\/exchange\/detail/.test(path)) {
header = titleMap[1];
header.title.des = des;
header.title.des = '换货状态';
return header;
}
... ...
... ... @@ -30,7 +30,7 @@
</div>
<div v-if="(detail.deliveryTpye === '10' || type ==='refund') && detail.status == 10"
class="logistics">
<a href="/me/return/logistics?applyid={{orderCode}}">填写商品寄回的快递信息</a>
<a href="/me/return/logistics?applyid={{applyid}}">填写商品寄回的快递信息</a>
</div>
</div>
<div class="exchange-details">
... ... @@ -108,12 +108,12 @@
<script>
const $ = require('jquery');
const util = require('common/util');
const qs = require('yoho-qs');
const yoho = require('yoho');
module.exports = {
props: ['applyid', 'type'],
data() {
return {
type: qs.type || '',
orderCode: '',
detail: {}
};
... ... @@ -141,8 +141,24 @@
}
}).then(function(data) {
if (data.code === 200) {
//todo
if (yoho.isApp) {
const url = '/me/return';
yoho.goNewPage({
header: {
headerid: '1',
left: {
action: ''
},
title: {
des: '退/换货',
action: ''
}
},
url: location.origin + url
});
} else {
location.href = url;
}
} else if (data.code === 400) {
tip(data.message);
} else {
... ... @@ -155,10 +171,10 @@
let _this = this;
$.ajax({
url: '/me/status-detail',
url: '/me/return/status-detail',
data: {
applyid: qs.applyid || '',
type: qs.type || ''
applyid: this.applyid,
type: this.type
}
}).then(res => {
if (res.data) {
... ...