Authored by 沈志敏

fix bug

... ... @@ -6,12 +6,10 @@ const exchangeModel = require('../models/exchange');
const exchange = {
exchange(req, res) {
const view = {
res.render('exchange', {
module: 'me',
page: 'exchange'
};
res.render('exchange', view);
});
},
// 订单 可换货商品列表
... ...
... ... @@ -95,7 +95,7 @@ const refund = {
refundOrders(req, res) {
res.render('refund-order', {
module: 'me',
page: 'return'
page: 'refund-order'
});
},
... ...
... ... @@ -46,10 +46,10 @@ router.post('/me/del-favdel', favorite.deletefav); // 个人中心 - 收藏商
// 退换货
router.get('/me/return', refund.refundOrders); // 退换货 - 订单列表
router.get('/me/return/getOrderList', refund.getRefundOrders); // 退换货 - 获取订单列表数据
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); // 退换货 - 获取订单列表数据
// 退货申请
router.get('/me/return/refund', refund.refund); // 退货申请
... ...
<div class="order-detail" id="order-detail">
<order-detail></order-detail>
<input type="hidden" id="order-code" value="{{orderCode}}">
</div>
\ No newline at end of file
<order-detail order_code="{{orderCode}}"></order-detail>
</div>
... ...
const yoho = require('yoho');
const interceptClick = require('common/intercept-click');
const Modal = require('common/modal');
const getImgHost = function(url, bucket = 'goodsimg') {
let urlArr = url.split('/'),
... ... @@ -34,8 +36,57 @@ const getImgUrl = function(src, width = 300, height = 300, mode = 2) {
}) : '';
};
// 退换货 申请 成功, 打开 modal
const applySuccuss = function(type, applyId) {
yoho.store.set('orderDetail', true);
const config = {
exchange: {
name: '换货',
detailUrl: `/me/return/exchange/detail/${applyId}`
},
refund: {
name: '退货',
detailUrl: `/me/return/refund/detail/${applyId}`
}
};
const kind = config[type];
const goStatusPage = function() {
const header = Object.assign({}, interceptClick.defaultTitleMap[1]);
header.left.action = location.origin + '/me/return';
header.title.des = `${kind.name}状态`;
return yoho.goNewPage({
header: header,
url: location.origin + kind.detailUrl,
backThrough: '1'
});
};
const modal = new Modal({
styleClass: 'return-success-modal',
text: `${kind.name}申请已提交,请等待审核.....`,
buttons: [{
text: '返回订单',
handler: function() {
this.hide();
yoho.goBack();
}
}, {
text: '查看进度',
handler: function() {
this.hide();
goStatusPage();
}
}]
});
modal.show();
};
module.exports = {
getImgHost,
getImgUrl,
applySuccuss,
visibilitychange
};
... ...
... ... @@ -15,9 +15,6 @@ require('common/count-down');
yoho.ready(() => {
new Vue({
el: '#order-detail',
data: {
orderCode: document.getElementById('order-code').value
},
components: {
OrderDetail
}
... ...
const yoho = require('yoho');
const interceptClick = require('common/intercept-click');
const Modal = require('common/modal');
// 退换货 申请 成功, 打开 modal
exports.applySuccuss = function(type, applyId) {
let config = {
exchange: {
name: '换货',
detailUrl: `/me/return/exchange/detail/${applyId}`
},
refund: {
name: '退货',
detailUrl: `/me/return/refund/detail/${applyId}`
}
};
let kind = config[type];
let goStatusPage = function() {
let header = Object.assign({}, interceptClick.defaultTitleMap[1]);
header.left.action = location.origin + '/me/return';
header.title.des = `${kind.name}状态`;
return yoho.goNewPage({
header: header,
url: location.origin + kind.detailUrl,
backThrough: '1'
});
};
const modal = new Modal({
styleClass: 'return-success-modal',
text: `${kind.name}申请已提交,请等待审核.....`,
buttons: [{
text: '返回订单',
handler: function() {
this.hide();
yoho.goBack();
}
}, {
text: '查看进度',
handler: function() {
this.hide();
goStatusPage();
}
}]
});
modal.show();
};
... ... @@ -38,8 +38,8 @@
const tip = require('common/tip');
const bus = require('common/vue-bus');
const Modal = require('common/modal');
const returnUtil = require('common/util');
const yoho = require('yoho');
const returnUtil = require('me/return/util');
const productList = require('me/return/list.vue');
const featureSelector = require('component/product/feature-selector.vue');
... ... @@ -300,12 +300,12 @@
body {
background-color: #f6f6f6;
}
.exchange-info {
margin: 30px 0;
background-color: #fff;
}
.exchange-address {
.consignee {
font-size: 32px;
... ... @@ -317,7 +317,7 @@
color: #b0b0b0;
}
}
.exchange-mode {
font-size: 34px;
.icon,
... ...
... ... @@ -72,6 +72,7 @@
const genderSelect = require('common/select');
module.exports = {
props: ['order_code'],
data() {
return {
show: false,
... ... @@ -90,6 +91,12 @@
interceptClick.intercept('/me/service');
return false;
});
document.addEventListener('visibilitychange', () => {
if (!document.hidden && yoho.store.get('orderDetail')) {
this.reload();
}
});
},
methods: {
updateNavBar() {
... ... @@ -111,10 +118,12 @@
this.getOrderData();
},
getOrderData() {
yoho.store.remove('orderDetail');
$.ajax({
url: '/me/get-order',
data: {
orderCode: this.$parent.$data.orderCode
orderCode: this.order_code
}
}).then(result => {
if (result.code === 200) {
... ...
... ... @@ -52,10 +52,10 @@
const $ = require('jquery');
const qs = require('yoho-qs');
const modal = require('common/modal');
const returnUtil = require('common/util');
const yoho = require('yoho');
const productList = require('me/return/list.vue');
const reasonConfig = require('me/return/reason');
const returnUtil = require('me/return/util');
module.exports = {
data() {
... ... @@ -156,7 +156,7 @@
const self = this;
if (!this.checkSubmitData()) {
modal.alert('请填写完整退货信息');
modal.alert('请填写完整退货信息');
}
$.ajax({
method: 'POST',
... ...