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
yyq
2016-09-06 18:22:06 +0800
Commit
3438bd48e63d5073f44d997655307c8b4ca46d17
1 parent
89d1ea9f
refund detail translate
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
181 additions
and
79 deletions
apps/home/controllers/returns.js
apps/home/models/returns-api.js
apps/home/models/returns.js
apps/home/views/action/returns/returns-detail.phtml → apps/home/views/action/returns/returns-detail.hbs
apps/home/controllers/returns.js
View file @
3438bd4
...
...
@@ -39,7 +39,20 @@ const refundApply = (req, res, next) => {
}).
catch
(
next
);
};
/*
我的订单-退货申请页
*/
const
refundDetail
=
(
req
,
res
,
next
)
=>
{
const
code
=
req
.
query
.
id
;
const
uid
=
req
.
user
.
uid
;
returnsModel
.
getRefundDetail
(
code
,
uid
).
then
(
result
=>
{
res
.
render
(
'returns/returns-detail'
,
result
);
}).
catch
(
next
);
};
module
.
exports
=
{
index
,
refundApply
refundApply
,
refundDetail
};
...
...
apps/home/models/returns-api.js
View file @
3438bd4
...
...
@@ -7,6 +7,9 @@
const
api
=
global
.
yoho
.
API
;
/**
* 获取订单退货信息
*/
const
getRefundGoodsAsync
=
(
orderCode
,
uid
)
=>
{
return
api
.
get
(
''
,
{
method
:
'app.refund.goodsList'
,
...
...
@@ -15,6 +18,28 @@ const getRefundGoodsAsync = (orderCode, uid) => {
},
{
code
:
200
});
};
/**
* 获取退货订单信息
*/
const
getRefundDetailAsync
=
(
id
,
uid
)
=>
{
return
api
.
get
(
''
,
{
method
:
'app.refund.detail'
,
id
:
id
,
uid
:
uid
},
{
code
:
200
});
};
/**
* 快递公司列表
*/
const
getExpressCompanyAsync
=
()
=>
{
return
api
.
get
(
''
,
{
method
:
'app.express.getExpressCompany'
},
{
code
:
200
});
};
module
.
exports
=
{
getRefundGoodsAsync
getRefundGoodsAsync
,
getRefundDetailAsync
,
getExpressCompanyAsync
};
...
...
apps/home/models/returns.js
View file @
3438bd4
...
...
@@ -26,13 +26,25 @@ const RETURNS_EMPTY = '您没有退/换货订单';
const
REFUND_URI
=
'/home/returns/refundDetail'
;
const
EXCHANGE_URI
=
'/home/returns/exchangeDetail'
;
// 处理退换货商品链接
const
getProductUrlBySkc
=
(
pid
,
gid
,
cnAlphabet
)
=>
{
cnAlphabet
=
cnAlphabet
||
'cnalphabet'
;
return
helpers
.
urlFormat
(
`
/
product
/
pro_$
{
pid
}
_$
{
gid
}
/${cnAlphabet}.html`
,
{},
'item'
);
};
const
setDetailGoods
=
(
list
)
=>
{
let
resData
=
[];
_
.
forEach
(
list
,
value
=>
{
resData
.
push
({
name
:
value
.
product_name
||
''
,
reason
:
value
.
reason_name
});
});
return
resData
;
};
// 处理订单商品的数据
...
...
@@ -211,7 +223,63 @@ const getOrderRefund = (orderCode, uid) => {
return
co
(
process
)();
};
const
getRefundDetail
=
(
applyId
,
uid
)
=>
{
let
process
=
function
*
()
{
let
resData
=
{};
let
result
=
yield
Promise
.
all
([
returnAPI
.
getRefundDetailAsync
(
applyId
,
uid
),
returnAPI
.
getExpressCompanyAsync
()
]);
if
(
result
[
0
].
data
)
{
let
data
=
result
[
0
].
data
;
let
detail
=
{
isChange
:
false
,
returnId
:
applyId
,
orderNum
:
data
.
source_order_code
,
nowStatus
:
data
.
status_name
,
applyTime
:
data
.
create_time
,
payMode
:
data
.
source_payment_type_desc
||
''
,
backMode
:
data
.
return_amount_mode_name
||
''
,
goods
:
setDetailGoods
(
data
.
goods_list
)
};
if
(
+
data
.
status
!==
0
)
{
detail
.
express
=
{
id
:
_
.
get
(
data
,
'notice.express_id'
,
''
),
company
:
_
.
get
(
data
,
'notice.express_company'
,
''
),
number
:
_
.
get
(
data
,
'notice.express_number'
,
''
)
};
}
detail
.
statusList
=
[];
_
.
forEach
(
data
.
statusList
,
value
=>
{
detail
.
statusList
.
push
({
name
:
value
.
name
,
act
:
value
.
act
===
'Y'
});
});
if
(
data
.
canCancel
===
'Y'
)
{
detail
.
canCancelUrl
=
'/home/refund/cancel'
;
}
resData
.
detail
=
detail
;
}
if
(
result
[
1
].
data
&&
resData
.
detail
)
{
_
.
set
(
resData
,
'detail.expressList'
,
_
.
toArray
(
result
[
1
].
data
));
}
return
resData
;
};
return
co
(
process
)();
};
module
.
exports
=
{
getReturnsList
,
getOrderRefund
getOrderRefund
,
getRefundDetail
};
...
...
apps/home/views/action/returns/returns-detail.
phtml
→ apps/home/views/action/returns/returns-detail.
hbs
View file @
3438bd4
{
{>
layout/header
}
}
<div
class=
"detail-me-page me-page yoho-page clearfix"
>
{
{#
returns
}
}
{
{>
path
}
}
{{>
path
}}
{
{>
navigation
}
}
{{>
navigation
}}
<div
class=
"me-main"
>
<div
class=
"returns-detail block{{#if detail.isChange}} exchange-detail{{/if}}"
>
<h
2
class=
"title"
></h
2
>
{
{#
detail
}
}
<div
class=
"order-info"
>
订单编号:
{
{orderNum
}
}
<span>当前状态:
{
{nowStatus
}
}</span>
申请时间:
{
{applyTime
}
}
</div>
<div
class=
"visual-return-state"
>
<ul>
{
{#
statusList
}
}
<li
class=
"{{#if act}}act{{/if}}"
>
{
{name
}
}</li>
{
{/
statusList
}
}
</ul>
</div>
<div
class=
"detail-container"
>
{
{#
express
}
}
<h
2
>请填写寄回快递单号,以便我们查询</h
2
>
<div
class=
"courier-code{{#unless id}} in-edit{{/unless}}"
>
<div
class=
"me-main"
>
<div
class=
"returns-detail block
{{#if
detail
.
isChange
}}
exchange-detail
{{/if}}
"
>
<h2
class=
"title"
></h2>
{{#
detail
}}
<div
class=
"order-info"
>
订单编号:
{{
orderNum
}}
<span>
当前状态:
{{
nowStatus
}}
</span>
申请时间:
{{
applyTime
}}
</div>
<div
class=
"visual-return-state"
>
<ul>
{{#
statusList
}}
<li
class=
"
{{#if
act
}}
act
{{/if}}
"
>
{{
name
}}
</li>
{{/
statusList
}}
</ul>
</div>
<div
class=
"detail-container"
>
{{#
express
}}
<h2>
请填写寄回快递单号,以便我们查询
</h2>
<div
class=
"courier-code
{{#
unless
id
}}
in-edit
{{/
unless
}}
"
>
{{#
with
detail
}}
<ul
style=
"display: none;"
>
{{#
expressList
}}
<li
class=
"company-list"
data-id=
"
{{
id
}}
"
data-name=
"
{{
company_name
}}
"
></li>
{{/
expressList
}}
</ul>
{{/
with
}}
<p
class=
"express-edit-box"
>
<input
type=
"hidden"
id=
"express-old-id"
value=
"
{{
id
}}
"
>
{{#
with
detail
}}
<ul
style=
"display: none;"
>
<select
id=
"express-company"
>
<option
value=
"0"
>
选择快递公司
</option>
{{#
expressList
}}
<
li
class=
"company-list"
data-id=
"{{id}}"
data-name=
"{{company_name}}"
></li
>
<
option
value=
"
{{
id
}}
"
selected=
""
>
{{
company_name
}}
</option
>
{{/
expressList
}}
</
ul
>
</
select
>
{{/
with
}}
<p
class=
"express-edit-box"
>
<input
type=
"hidden"
id=
"express-old-id"
value=
"{{id}}"
>
{
{#with
detail
}
}
<select
id=
"express-company"
>
<option
value=
"0"
>选择快递公司</option>
{
{#
expressList
}
}
<option
value=
"{{id}}"
selected=
""
>
{
{company_name
}
}</option>
{
{/
expressList
}
}
</select>
{
{/with
}
}
<input
type=
"text"
id=
"express-number"
value=
"{{number}}"
placeholder=
"请填写快递单号"
>
<input
type=
"hidden"
id=
"return-id"
value=
"{{returnId}}"
>
<button
type=
"button"
id=
"submit-btn"
>确定</button>
</p>
<p
class=
"express-view-box"
>
<span>
{
{company
}
}
快递单号:
{
{number
}
}</span>
<button
type=
"button"
id=
"modify"
>修改</button>
</p>
</div>
{
{/
express
}
}
<h
2
>详细信息</h
2
>
<div
class=
"main-detail"
>
<table>
{
{#
goods
}
}
<tr>
<td
width=
"50%"
>商品名称:
{
{name
}
}</td>
<td>
<span
class=
"word-t"
>退</span><span
class=
"word-h"
>换</span>货原因:
{
{reason
}
}
</td>
</tr>
{
{/
goods
}
}
{
{#unless
isChange
}
}
<tr>
<td
colspan=
"2"
>支付方式:
{
{payMode
}
}</td>
</tr>
<tr>
<td
colspan=
"2"
>退款方式:
{
{backMode
}
}</td>
</tr>
{
{/unless
}
}
</table>
<div
class=
"refund-tips"
>
<span>注:请于完成后的
2
个工作日查询您的退款账户,以确认退款到账</span>
</div>
<input
type=
"text"
id=
"express-number"
value=
"
{{
number
}}
"
placeholder=
"请填写快递单号"
>
<input
type=
"hidden"
id=
"return-id"
value=
"
{{
returnId
}}
"
>
<button
type=
"button"
id=
"submit-btn"
>
确定
</button>
</p>
<p
class=
"express-view-box"
>
<span>
{{
company
}}
快递单号:
{{
number
}}
</span>
<button
type=
"button"
id=
"modify"
>
修改
</button>
</p>
</div>
{{/
express
}}
<h2>
详细信息
</h2>
<div
class=
"main-detail"
>
<table>
{{#
goods
}}
<tr>
<td
width=
"50%"
>
商品名称:
{{
name
}}
</td>
<td>
<span
class=
"word-t"
>
退
</span><span
class=
"word-h"
>
换
</span>
货原因:
{{
reason
}}
</td>
</tr>
{{/
goods
}}
{{#
unless
isChange
}}
<tr>
<td
colspan=
"2"
>
支付方式:
{{
payMode
}}
</td>
</tr>
<tr>
<td
colspan=
"2"
>
退款方式:
{{
backMode
}}
</td>
</tr>
{{/
unless
}}
</table>
<div
class=
"refund-tips"
>
<span>
注:请于完成后的2个工作日查询您的退款账户,以确认退款到账
</span>
</div>
</div>
{
{/
detail
}
}
</div>
{
{>
help-us
}
}
</div>
{{/
detail
}}
</div>
{
{/
returns
}
}
{{>
help-us
}}
</div>
</div>
{
{>
layout/footer
}
}
...
...
Please
register
or
login
to post a comment