Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohobuy-node
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
1
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
OF1706
8 years ago
Commit
8d4403f5d3ea9dc9facd52331302021062c79ef1
1 parent
ee63683f
cance refund and change
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
87 additions
and
6 deletions
apps/home/controllers/returns.js
apps/home/models/returns-api.js
apps/home/models/returns.js
apps/home/router.js
public/js/home/returns-detail.js
apps/home/controllers/returns.js
View file @
8d4403f
...
...
@@ -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
};
...
...
apps/home/models/returns-api.js
View file @
8d4403f
...
...
@@ -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
// 取消换货申请
};
...
...
apps/home/models/returns.js
View file @
8d4403f
...
...
@@ -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
// 取消换货申请
};
...
...
apps/home/router.js
View file @
8d4403f
...
...
@@ -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);
...
...
public/js/home/returns-detail.js
View file @
8d4403f
...
...
@@ -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
();
...
...
Please
register
or
login
to post a comment