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
hongweigao
8 years ago
Commit
ee63683fd78e870d5253692706a96c6b0e40b2da
1 parent
30d20d30
'退货详情、换货详情'
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
117 additions
and
15 deletions
apps/home/controllers/returns.js
apps/home/models/returns-api.js
apps/home/models/returns.js
apps/home/router.js
public/scss/home/_index.css
public/scss/home/_returns-detail.css
public/scss/home/_returns-save.css
apps/home/controllers/returns.js
View file @
ee63683
...
...
@@ -38,14 +38,36 @@ const refundApply = (req, res, next) => {
};
/*
我的订单-退货申请
页
我的退换货-退货详情
页
*/
const
refundDetail
=
(
req
,
res
,
next
)
=>
{
const
code
=
req
.
query
.
id
;
const
uid
=
req
.
user
.
uid
;
let
resData
=
{
module
:
'home'
,
page
:
'returns'
};
returnsModel
.
getRefundDetail
(
code
,
uid
).
then
(
result
=>
{
res
.
render
(
'returns/returns-detail'
,
result
);
Object
.
assign
(
resData
,
result
);
res
.
render
(
'returns/returns-detail'
,
resData
);
}).
catch
(
next
);
};
/*
* 我的退换货-换货详情页
*/
const
exchangeDetail
=
(
req
,
res
,
next
)
=>
{
const
code
=
req
.
query
.
id
;
const
uid
=
req
.
user
.
uid
;
let
resData
=
{
module
:
'home'
,
page
:
'returns'
};
returnsModel
.
getChangeDetail
(
code
,
uid
).
then
(
result
=>
{
Object
.
assign
(
resData
,
result
);
res
.
render
(
'returns/returns-detail'
,
resData
);
}).
catch
(
next
);
};
...
...
@@ -65,5 +87,6 @@ module.exports = {
index
,
refundApply
,
refundDetail
,
exchangeApply
exchangeApply
,
exchangeDetail
};
...
...
apps/home/models/returns-api.js
View file @
ee63683
...
...
@@ -19,7 +19,7 @@ const getRefundGoodsAsync = (orderCode, uid) => {
};
/**
* 获取退货
订单信息
* 获取退货
详情
*/
const
getRefundDetailAsync
=
(
id
,
uid
)
=>
{
return
api
.
get
(
''
,
{
...
...
@@ -30,6 +30,17 @@ const getRefundDetailAsync = (id, uid) => {
};
/**
* 获取换货详情
*/
const
getChangeDetailAsync
=
(
id
,
uid
)
=>
{
return
api
.
get
(
''
,
{
method
:
'app.change.detail'
,
id
:
id
,
uid
:
uid
},
{
code
:
200
});
};
/**
* 获取订单换货信息
*/
const
getExchangeGoodsAsync
=
(
orderCode
,
uid
)
=>
{
...
...
@@ -63,6 +74,7 @@ module.exports = {
getRefundGoodsAsync
,
getRefundDetailAsync
,
getExchangeGoodsAsync
,
getChangeDetailAsync
,
getProductDataAsync
,
getExpressCompanyAsync
};
...
...
apps/home/models/returns.js
View file @
ee63683
...
...
@@ -230,6 +230,12 @@ const getOrderRefund = (orderCode, uid) => {
return
co
(
process
)();
};
/**
* 获取退货详情页数据
* @param $uid
* @param $id
* @return array|mixed
*/
const
getRefundDetail
=
(
applyId
,
uid
)
=>
{
let
process
=
function
*
()
{
let
resData
=
{};
...
...
@@ -276,6 +282,66 @@ const getRefundDetail = (applyId, uid) => {
}
if
(
result
[
1
].
data
&&
resData
.
detail
)
{
_
.
set
(
resData
,
'detail.expressList'
,
_
.
toArray
(
result
[
1
].
data
.
E
));
}
return
resData
;
};
return
co
(
process
)();
};
/**
* 获取换货详情页数据
* @param $uid
* @param $id
* @return array|mixed
*/
const
getChangeDetail
=
(
applyId
,
uid
)
=>
{
let
process
=
function
*
()
{
let
resData
=
{};
let
result
=
yield
Promise
.
all
([
returnAPI
.
getChangeDetailAsync
(
applyId
,
uid
),
returnAPI
.
getExpressCompanyAsync
()
]);
if
(
result
[
0
].
data
)
{
let
data
=
result
[
0
].
data
;
let
detail
=
{
isChange
:
true
,
returnId
:
applyId
,
orderNum
:
data
.
source_order_code
,
nowStatus
:
data
.
status_name
,
applyTime
:
data
.
create_time
,
goods
:
setDetailGoods
(
data
.
goods_list
)
};
if
(
+
data
.
status
!==
0
&&
+
data
.
delivery_tpye
!==
20
)
{
detail
.
express
=
{
id
:
_
.
get
(
data
,
'notice.express_id'
,
''
),
company
:
_
.
get
(
data
,
'notice.express_company'
,
''
),
number
:
_
.
get
(
data
,
'notice.express_number'
,
''
),
expressDeadLine
:
_
.
get
(
data
,
'notice.date'
,
''
)
};
}
detail
.
statusList
=
[];
_
.
forEach
(
data
.
statusList
,
value
=>
{
detail
.
statusList
.
push
({
name
:
value
.
name
,
act
:
value
.
act
===
'Y'
});
});
if
(
data
.
canCancel
===
'Y'
)
{
detail
.
canCancelUrl
=
'/home/returns/cancelChange'
;
}
resData
.
detail
=
detail
;
}
if
(
result
[
1
].
data
&&
resData
.
detail
)
{
_
.
set
(
resData
,
'detail.expressList'
,
_
.
toArray
(
result
[
1
].
data
));
}
...
...
@@ -399,5 +465,6 @@ module.exports = {
getReturnsList
,
getOrderRefund
,
getRefundDetail
,
getChangeDetail
,
getOrderExchange
};
...
...
apps/home/router.js
View file @
ee63683
...
...
@@ -207,9 +207,10 @@ router.get('/message/pickCoupon', messageController.pickCoupon);
// 我的退/换货
router
.
get
(
'/returns'
,
[
getCommonHeader
,
getHomeNav
],
returnsController
.
index
);
router
.
get
(
'/refund/apply'
,
[
getCommonHeader
,
getHomeNav
],
returnsController
.
refundApply
);
router
.
get
(
'/re
fund/d
etail'
,
[
getCommonHeader
,
getHomeNav
],
returnsController
.
refundDetail
);
router
.
get
(
'/re
turns/refundD
etail'
,
[
getCommonHeader
,
getHomeNav
],
returnsController
.
refundDetail
);
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/success'
,
returnsController
.
index
);
// router.get('/index', [getCommonHeader, getHomeNav], IndexController.index);
...
...
public/scss/home/_index.css
View file @
ee63683
...
...
@@ -265,6 +265,5 @@
@import
"coupons"
;
@import
"favorite"
;
@import
"user-info"
;
/*
@import "returns-detail";
@import
"returns-detail"
;
@import
"returns-save"
;
*/
...
...
public/scss/home/_returns-detail.css
View file @
ee63683
...
...
@@ -2,7 +2,7 @@
font-size
:
12px
;
.returns-detail
.title
{
background-image
:
resolve
(
/
home
/
returns
.
png
);
background-image
:
resolve
(
home
/
returns
.
png
);
}
.order-info
{
...
...
@@ -18,7 +18,7 @@
margin
:
40px
auto
;
height
:
40px
;
width
:
560px
;
background
:
resolve
(
/
home
/
exchange-bg
.
png
)
no-repeat
top
center
;
background
:
resolve
(
home
/
exchange-bg
.
png
)
no-repeat
top
center
;
li
{
width
:
112px
;
...
...
@@ -27,7 +27,7 @@
float
:
left
;
}
.act
{
background
:
resolve
(
/
home
/
detail-act
.
png
)
no-repeat
top
center
background
:
resolve
(
home
/
detail-act
.
png
)
no-repeat
top
center
}
}
.detail-container
{
...
...
@@ -37,7 +37,7 @@
height
:
21px
;
line-height
:
21px
;
padding-left
:
23px
;
background
:
resolve
(
/
img
/
home
/
complaint-icon
.
png
)
no-repeat
5px
5px
#efefef
;
background
:
resolve
(
home
/
complaint-icon
.
png
)
no-repeat
5px
5px
#efefef
;
border
:
1px
#e6e6e6
solid
;
font-size
:
12px
;
color
:
#333
;
...
...
@@ -102,4 +102,4 @@
display
:
none
;
}
}
}
\ No newline at end of file
}
...
...
public/scss/home/_returns-save.css
View file @
ee63683
.save-returns-page
{
.title
{
background-image
:
resolve
(
/
home
/
refund-apply
.
png
);
background-image
:
resolve
(
home
/
refund-apply
.
png
);
}
.exchange
.title
{
background-image
:
resolve
(
/
home
/
exchange-apply
.
png
);
background-image
:
resolve
(
home
/
exchange-apply
.
png
);
}
.save-container
{
padding
:
10px
;
...
...
@@ -75,4 +75,4 @@
}
}
}
}
\ No newline at end of file
}
...
...
Please
register
or
login
to post a comment