Authored by OF1706

cance refund and change

... ... @@ -83,10 +83,37 @@ const exchangeApply = (req, res, next) => {
}).catch(next);
};
/**
* 取消退货申请
*/
const cancelRefund = (req, res, next) => {
const id = req.body.id;
const uid = req.user.uid;
returnsModel.getCancelRefund(id, uid).then(result => {
res.send(result);
}).catch(next);
};
/**
* 取消换货申请
*/
const cancelChange = (req, res, next) => {
const id = req.body.id;
const uid = req.user.uid;
returnsModel.getCancelChange(id, uid).then(result => {
res.send(result);
}).catch(next);
};
module.exports = {
index,
refundApply,
refundDetail,
exchangeApply,
exchangeDetail
exchangeDetail,
cancelRefund,
cancelChange
};
... ...
... ... @@ -70,11 +70,47 @@ const getExpressCompanyAsync = () => {
}, {code: 200});
};
/**
* 取消退货申请
* @param $id
* @param $uid
* @return mixed
*/
const cancelRefundAsync = (id, uid) =>{
let options = {
method: 'app.refund.cancel',
id: id,
uid: uid
};
return api.get('', options);
};
/**
* 取消换货申请
* @param $id
* @param $uid
* @return mixed
*/
const cancelChangeAsync = (id, uid) =>{
let options = {
method: 'app.change.cancel',
id: id,
uid: uid
};
return api.get('', options);
};
module.exports = {
getRefundGoodsAsync,
getRefundDetailAsync,
getExchangeGoodsAsync,
getChangeDetailAsync,
getProductDataAsync,
getExpressCompanyAsync
getExpressCompanyAsync,
cancelRefundAsync, // 取消退货申请
cancelChangeAsync // 取消换货申请
};
... ...
... ... @@ -461,10 +461,24 @@ const getOrderExchange = (orderCode, uid) => {
return co(process)();
};
const getCancelRefund = (id, uid) => {
return returnAPI.cancelRefundAsync(id, uid).then((result) => {
return result;
});
};
const getCancelChange = (id, uid) => {
return returnAPI.cancelChangeAsync(id, uid).then((result) => {
return result;
});
};
module.exports = {
getReturnsList,
getOrderRefund,
getRefundDetail,
getChangeDetail,
getOrderExchange
getOrderExchange,
getCancelRefund, // 取消退货申请
getCancelChange // 取消换货申请
};
... ...
... ... @@ -211,6 +211,8 @@ router.get('/returns/refundDetail', [getCommonHeader, getHomeNav], returnsContro
router.get('/exchange/apply', [getCommonHeader, getHomeNav], returnsController.exchangeApply);
router.get('/exchange/detail', [getCommonHeader, getHomeNav], returnsController.refundDetail);
router.get('/returns/exchangeDetail', [getCommonHeader, getHomeNav], returnsController.exchangeDetail);
router.get('/returns/cancelRefund', [getCommonHeader, getHomeNav], returnsController.cancelRefund);// 取消退货
router.post('/returns/cancelChange', [getCommonHeader, getHomeNav], returnsController.cancelChange);// 取消退货
router.get('/returns/success', returnsController.index);
// router.get('/index', [getCommonHeader, getHomeNav], IndexController.index);
... ...
... ... @@ -97,9 +97,10 @@ function sendExpressCode() {
}
function cancelApply(id, url) {
var template = Handlebars.compile(cancelApplyDialog);
var html = template({messageIcon: 'icon-warn', messageTitle: '取消申请', messageSummary: '您确定要请取消申请吗?'});
var options = {
var template = Handlebars.compile(cancelApplyDialog); //eslint-disable-line
var html = template({messageIcon: 'icon-warn', messageTitle: '取消申请', messageSummary: '您确定要请取消申请吗?'}); //eslint-disable-line
var options = { //eslint-disable-line
mask: true,
btns: [
{
... ... @@ -160,6 +161,7 @@ $('#submit-btn').click(function() {
sendExpressCode();
});
// 取消退换货
$('.cancel-trigger').click(function() {
active = cancelApply($(this).data('id'), $(this).data('url'));
active.show();
... ...