Authored by hongweigao

Merge branch 'feature/return' of http://git.yoho.cn/fe/yohobuy-node into feature/return

... ... @@ -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 // 取消换货申请
};
... ...
... ... @@ -82,7 +82,7 @@ const getExpressCompany = (expressList) => {
data = _.flatten(data);
return data;
}
};
/**
* 退换货列表页数据
... ... @@ -487,10 +487,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 // 取消换货申请
};
... ...
... ... @@ -81,6 +81,8 @@ router.get('/returns/refundDetail', tabsMiddleware.getCommonHeader, returnsContr
router.get('/returns/exchangerequest', tabsMiddleware.getCommonHeader, returnsController.exchangeApply);
router.get('/exchange/detail', tabsMiddleware.getCommonHeader, returnsController.refundDetail);
router.get('/returns/exchangeDetail', tabsMiddleware.getCommonHeader, returnsController.exchangeDetail);
router.get('/returns/cancelRefund', tabsMiddleware.getCommonHeader, returnsController.cancelRefund);// 取消退货
router.post('/returns/cancelChange', tabsMiddleware.getCommonHeader, returnsController.cancelChange);// 取消退货
router.get('/returns/success', returnsController.index);
// router.get('/index', [tabsMiddleware.getCommonHeader, tabsMiddleware.getHomeNav], IndexController.index);
... ...

5.2 KB | W: | H:

2.8 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

11.4 KB | W: | H:

1.88 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
... ... @@ -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();
... ...