Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yoho-blk
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
1
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
石坚
9 years ago
Commit
e2997034106e7a624c264f042d21ffa5e597f3e7
1 parent
989aaace
master
...
develop
feature/catch
feature/docker
feature/login-msg
feature/login-ua-ip
feature/removCamel
feature/safe-bug
feature/sessionKey
feature/setting
feature/vip
feature/webpack2
feature/wsl5.3
gray
release/2.0
release/fontBack2.0
个人中心 订单和收藏 修改
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
63 additions
and
83 deletions
apps/me/controllers/currency.js
apps/me/models/order.js
apps/me/views/partial/order/detail/goods-list.hbs
apps/me/views/partial/order/detail/info-box.hbs
apps/me/views/partial/order/detail/order-status.hbs
apps/me/views/partial/order/good-info.hbs
apps/me/views/partial/order/goods-box.hbs
apps/me/views/partial/order/order-header.hbs
apps/me/views/partial/order/table-body.hbs
package.json
apps/me/controllers/currency.js
View file @
e299703
...
...
@@ -61,25 +61,6 @@ const index = (req, res, next) => {
beginTime
:
beginTime
};
}
console
.
log
(
JSON
.
stringify
({
module
:
'me'
,
page
:
'currency'
,
isMe
:
true
,
content
:
{
nav
:
mcHandler
.
getMeCrumb
(
'我的有货币'
),
navigation
:
mcHandler
.
getSideMenu
(
'我的有货币'
),
banner
:
thumb
,
currency
:
true
,
tabs
:
result
[
0
].
list
.
tabs
,
title
:
'我的有货币'
,
currentYear
:
new
Date
().
getFullYear
(),
data
:
result
[
0
].
list
.
coinList
,
paginationOpts
:
result
[
0
].
list
.
paginationOpts
,
num
:
result
[
0
].
num
.
data
,
selects
:
result
[
0
].
list
.
selects
,
total
:
result
[
0
].
list
.
total
?
result
[
0
].
list
.
total
:
0
}
}));
res
.
display
(
'index'
,
{
module
:
'me'
,
page
:
'currency'
,
...
...
apps/me/models/order.js
View file @
e299703
...
...
@@ -7,7 +7,6 @@
'use strict'
;
const
api
=
global
.
yoho
.
API
;
const
camelCase
=
global
.
yoho
.
camelCase
;
const
moment
=
require
(
'moment'
);
const
helpers
=
global
.
yoho
.
helpers
;
...
...
@@ -240,31 +239,31 @@ const _getUserOrder = (uid, type, page) => {
if
(
result
&&
result
.
data
)
{
orderList
=
camelCase
(
result
.
data
.
order_list
);
orderList
=
result
.
data
.
order_list
;
//
camelCase(result.data.order_list);
total
=
result
.
data
.
total
;
curPage
=
result
.
data
.
page
;
}
orderList
.
forEach
(
item
=>
{
const
ot
=
parseInt
(
item
.
order
T
ype
,
10
);
const
ot
=
parseInt
(
item
.
order
_t
ype
,
10
);
const
st
=
parseInt
(
item
.
status
,
10
);
let
hasRefund
=
false
;
let
canRefund
=
false
;
item
.
orderGoods
.
forEach
(
good
=>
{
let
cnAlphabet
=
good
.
cnAlphabet
?
good
.
cnAlphabet
:
''
;
item
.
order_goods
.
forEach
(
good
=>
{
let
cnAlphabet
=
good
.
cn_alphabet
?
good
.
cn_alphabet
:
''
;
good
.
goodUrl
=
helpers
.
urlFormat
(
`
/
product
/
pro_$
{
good
.
product
Id
}
_$
{
good
.
goodsI
d
}
/${cnAlphabet}.html`
)
;
good
.
goodUrl
=
helpers
.
urlFormat
(
`
/
product
/
pro_$
{
good
.
product
_id
}
_$
{
good
.
goods_i
d
}
/${cnAlphabet}.html`
)
;
// 判断该订单是否有换货商品
if
(
good
.
refund
N
um
)
{
if
(
good
.
refund
_n
um
)
{
hasRefund
=
true
;
good
.
changed
=
true
;
good
.
returnUrl
=
helpers
.
urlFormat
(
'/me/return'
);
}
// 判断该订单是否可以退换货
if
(
parseInt
(
good
.
buy
Number
,
10
)
!==
parseInt
(
good
.
refundN
um
,
10
))
{
if
(
parseInt
(
good
.
buy
_number
,
10
)
!==
parseInt
(
good
.
refund_n
um
,
10
))
{
canRefund
=
true
;
}
});
...
...
@@ -274,10 +273,10 @@ const _getUserOrder = (uid, type, page) => {
item
.
hideChange
=
!
canRefund
;
// 转换订单创建时间
item
.
create
Time
=
_convertUnixTime
(
item
.
createT
ime
);
item
.
create
_time
=
_convertUnixTime
(
item
.
create_t
ime
);
// 没有取消订单并且状态为0的时候显示付款按钮
if
(
item
.
is
C
ancel
===
'N'
&&
if
(
item
.
is
_c
ancel
===
'N'
&&
st
===
0
)
{
item
.
showPayButton
=
true
;
}
...
...
@@ -293,15 +292,15 @@ const _getUserOrder = (uid, type, page) => {
item
.
showGetBtn
=
statusMap
[
st
].
showGetBtn
;
// 在线支付和货到付款有按钮的差异
item
.
isOnlinePaid
=
parseInt
(
item
.
payment
T
ype
,
10
)
===
1
;
item
.
isOnlinePaid
=
parseInt
(
item
.
payment
_t
ype
,
10
)
===
1
;
item
.
isRefundOrder
=
ot
===
7
;
if
(
parseInt
(
item
.
pay
L
efttime
,
10
)
!==
0
)
{
if
(
parseInt
(
item
.
pay
_l
efttime
,
10
)
!==
0
)
{
item
.
showLeftTime
=
true
;
}
if
(
item
.
is
C
ancel
===
'Y'
)
{
if
(
item
.
is
_c
ancel
===
'Y'
)
{
item
.
showBuyBtn
=
true
;
item
.
statusStr
=
'已取消'
;
}
else
if
(
item
.
isOnlinePaid
)
{
...
...
@@ -309,17 +308,17 @@ const _getUserOrder = (uid, type, page) => {
}
item
.
payUrl
=
helpers
.
urlFormat
(
'/shopping/pay/online'
,
{
code
:
item
.
order
C
ode
code
:
item
.
order
_c
ode
});
item
.
refundUrl
=
helpers
.
urlFormat
(
'/me/return/refund/'
,
{
orderCode
:
item
.
order
C
ode
orderCode
:
item
.
order
_c
ode
});
item
.
exchangeUrl
=
helpers
.
urlFormat
(
'/me/return/exchange/'
,
{
orderCode
:
item
.
order
C
ode
orderCode
:
item
.
order
_c
ode
});
item
.
detailUrl
=
helpers
.
urlFormat
(
'/me/order/detail/'
,
{
orderCode
:
item
.
order
C
ode
orderCode
:
item
.
order
_c
ode
});
});
...
...
@@ -485,8 +484,8 @@ const getOrderData = (uid, type, page) => {
*/
const
getOrderDetail
=
(
uid
,
code
)
=>
{
return
api
.
all
([
_getDetail
(
uid
,
code
),
getExpressInfo
(
uid
,
code
)]).
then
(
result
=>
{
const
detail
=
result
[
0
]
&&
camelCase
(
result
[
0
].
data
);
const
express
=
result
[
1
]
&&
camelCase
(
result
[
1
].
data
);
const
detail
=
result
[
0
]
&&
result
[
0
].
data
;
// camelCase(result[0].data);
const
express
=
result
[
1
]
&&
result
[
1
].
data
;
// camelCase(result[1].data);
const
st
=
parseInt
(
detail
.
status
,
10
);
...
...
@@ -496,25 +495,25 @@ const getOrderDetail = (uid, code) => {
let
btns
=
[];
detail
.
orderGoods
.
forEach
(
good
=>
{
let
cnAlphabet
=
good
.
cnAlphabet
?
good
.
cnAlphabet
:
''
;
detail
.
order_goods
.
forEach
(
good
=>
{
let
cnAlphabet
=
good
.
cn_alphabet
?
good
.
cn_alphabet
:
''
;
good
.
goodUrl
=
helpers
.
urlFormat
(
`
/
product
/
pro_$
{
good
.
product
Id
}
_$
{
good
.
goodsI
d
}
/${cnAlphabet}.html`
)
;
good
.
goodUrl
=
helpers
.
urlFormat
(
`
/
product
/
pro_$
{
good
.
product
_id
}
_$
{
good
.
goods_i
d
}
/${cnAlphabet}.html`
)
;
});
detail
.
create
Time
=
_convertUnixTime
(
detail
.
createT
ime
);
detail
.
create
_time
=
_convertUnixTime
(
detail
.
create_t
ime
);
if
(
detail
.
is
C
ancel
===
'N'
&&
if
(
detail
.
is
_c
ancel
===
'N'
&&
st
===
0
&&
parseInt
(
detail
.
pay
L
efttime
,
10
)
!==
0
)
{
parseInt
(
detail
.
pay
_l
efttime
,
10
)
!==
0
)
{
detail
.
showLeftTime
=
true
;
}
if
(
st
!==
0
&&
detail
.
is
C
ancel
!==
'Y'
)
{
if
(
st
!==
0
&&
detail
.
is
_c
ancel
!==
'Y'
)
{
detail
.
showPaid
=
true
;
}
if
(
detail
.
is
C
ancel
!==
'Y'
)
{
if
(
detail
.
is
_c
ancel
!==
'Y'
)
{
detail
.
steps
=
_getStepByOrderStatus
(
st
);
statusMap
[
st
].
btns
.
forEach
(
function
(
btn
)
{
...
...
@@ -531,15 +530,15 @@ const getOrderDetail = (uid, code) => {
}
});
if
(
detail
.
can
UpdateDeliveryA
ddress
===
'N'
)
{
if
(
detail
.
can
_update_delivery_a
ddress
===
'N'
)
{
_
.
remove
(
detail
.
btns
,
btn
=>
{
return
btn
.
isEditBtn
;
});
}
if
(
parseInt
(
detail
.
payment
T
ype
,
10
)
===
2
&&
if
(
parseInt
(
detail
.
payment
_t
ype
,
10
)
===
2
&&
(
statusMap
[
st
].
valueStr
===
'备货中'
||
detail
.
status
S
tr
===
'备货中'
))
{
detail
.
status
_s
tr
===
'备货中'
))
{
detail
.
btns
=
btnMap
.
special
;
}
else
{
detail
.
statusStr
=
statusMap
[
st
].
valueStr
;
...
...
@@ -553,12 +552,12 @@ const getOrderDetail = (uid, code) => {
detail
.
invoice
=
false
;
}
detail
.
paymentTypeStr
=
paymentTypeStr
[
detail
.
payment
T
ype
];
detail
.
paymentTypeStr
=
paymentTypeStr
[
detail
.
payment
_t
ype
];
detail
.
allAddress
=
detail
.
area
+
detail
.
address
;
detail
.
expressInfo
=
express
;
detail
.
expressInfo
.
addressList
=
_convertAddress
(
express
.
express
Detail
,
detail
.
createT
ime
);
detail
.
expressInfo
.
addressList
=
_convertAddress
(
express
.
express
_detail
,
detail
.
create_t
ime
);
return
{
orderDetail
:
Object
.
assign
(
basicData
,
detail
)
...
...
apps/me/views/partial/order/detail/goods-list.hbs
View file @
e299703
<div
class=
"goods-list info-box"
>
<h4
class=
"status-title"
>
商品清单
</h4>
{{#
isY
is
MultiP
ackage
}}
{{#
isY
is
_multi_p
ackage
}}
<div
class=
"multi-package-row"
>
温馨提示:您购买的商品
<em
class=
"blue"
>
分属不同仓库
</em>
,需要调拨,将被拆分成多个包裹送达
<span
class=
"iconfont show-package"
>

</span>
...
...
@@ -36,15 +36,15 @@
</div>
<div
class=
"payment-info info-box"
>
{{#
promotion
F
ormulas
}}
{{#
promotion
_f
ormulas
}}
<p>
<span
class=
"tip"
>
{{
promotion
}}
:
</span>
<span
class=
"amount"
>
{{
promotion
A
mount
}}
</span>
<span
class=
"amount"
>
{{
promotion
_a
mount
}}
</span>
</p>
{{/
promotion
F
ormulas
}}
{{/
promotion
_f
ormulas
}}
<p
class=
"payment-amount"
>
<span
class=
"tip"
>
实付金额:
</span>
<span
class=
"amount"
>
¥
{{
p
aymentA
mount
}}
</span>
<span
class=
"amount"
>
¥
{{
p
romotion_a
mount
}}
</span>
</p>
{{#if
showPaid
}}
<p
class=
"paid"
>
...
...
apps/me/views/partial/order/detail/info-box.hbs
View file @
e299703
<div
class=
"user-info info-box"
data-area=
"
{{
area
C
ode
}}
"
>
<div
class=
"user-info info-box"
data-area=
"
{{
area
_c
ode
}}
"
>
<h4
class=
"status-title"
>
收货人信息
</h4>
<p
class=
"text user-name-sel"
data-name=
"
{{
user
Name
}}
"
>
收货人:
{{
userN
ame
}}
</p>
<p
class=
"text user-name-sel"
data-name=
"
{{
user
_name
}}
"
>
收货人:
{{
user_n
ame
}}
</p>
<p
class=
"text user-addr-sel"
data-address=
"
{{
address
}}
"
>
收货地址:
{{
allAddress
}}
</p>
<p
class=
"text user-mo-sel"
data-mobile=
"
{{
mobile
}}
"
>
联系电话:
{{
mobile
}}
</p>
<p
class=
"text user-ph-sel hide"
data-phone=
"
{{
phone
}}
"
>
联系电话:
{{
phone
}}
</p>
...
...
@@ -9,10 +9,10 @@
<div
class=
"info-box"
>
<h4
class=
"status-title"
>
支付及配送方式
</h4>
<p
class=
"text"
>
支付类型:
{{
paymentTypeStr
}}
</p>
{{#if
paymentName
}}
<p
class=
"text"
>
支付方式:
{{
paymentName
}}
</p>
{{#if
payment_name
}}
<p
class=
"text"
>
支付方式:
{{
payment_name
}}
</p>
{{/if}}
<p
class=
"text"
>
送货时间:
{{
delivery
T
ime
}}
</p>
<p
class=
"text"
>
送货时间:
{{
delivery
_t
ime
}}
</p>
</div>
<div
class=
"info-box"
>
...
...
apps/me/views/partial/order/detail/order-status.hbs
View file @
e299703
<div
class=
"order-status order"
data-code=
"
{{
order
C
ode
}}
"
data-codem=
"
{{
orderCodeM
}}
"
>
<div
class=
"order-status order"
data-code=
"
{{
order
_c
ode
}}
"
data-codem=
"
{{
orderCodeM
}}
"
>
<div
class=
"basic"
>
<p>
订单号:
{{
orderCode
}}
</p>
<p>
订单状态:
{{
statusStr
}}
</p>
<p>
订单号:
{{
order_code
}}
</p>
<p>
订单状态:
{{
status_str
}}
</p>
<div
class=
"edit-btns hide-when-invalid"
>
<ul>
{{#
btns
}}
...
...
@@ -23,7 +23,7 @@
<div
class=
"time"
>
<span>
剩余支付时间:
</span>
<span
class=
"iconfont hide-when-invalid"
>

</span>
<p
class=
"left-time"
data-left=
{{
pay
L
efttime
}}
>
</p
>
<p
class=
"left-time"
data-left=
{{
pay
_l
efttime
}}
>
</p
>
<span
class=
"tip hide-when-invalid"
>
(逾期订单将自动取消)
</span>
</div>
{{/if}}
...
...
@@ -35,7 +35,7 @@
<li
class=
"
{{#if
@first
}}
first
{{/if}}
{{#if
@last
}}
last
{{/if}}
{{#if
isActive
}}
active
{{/if}}
{{#if
isLastActive
}}
last-active
{{/if}}
"
>
{{
stepStr
}}
</li>
{{/
steps
}}
</ul>
<p>
{{
create
T
ime
}}
</p>
<p>
{{
create
_t
ime
}}
</p>
</div>
{{/if}}
</div>
...
...
apps/me/views/partial/order/good-info.hbs
View file @
e299703
<div
class=
"good-info
{{#if
@last
}}
last
{{/if}}
"
>
<a
href=
"
{{
https
goodUrl
}}
"
target=
"_blank"
>
<img
src=
"
{{
image
goods
I
mage
65
90
}}
"
>
<img
src=
"
{{
image
goods
_i
mage
65
90
}}
"
>
</a>
<div
class=
"detail"
>
<a
href=
"
{{
https
goodUrl
}}
"
target=
"_blank"
>
<p
class=
"with-bottom-space good-name-text"
>
{{
product
N
ame
}}
</p>
<p
class=
"with-bottom-space good-name-text"
>
{{
product
_n
ame
}}
</p>
</a>
<span
class=
"with-space"
>
颜色:
{{
color
N
ame
}}
</span>
<span
class=
"with-space"
>
颜色:
{{
color
_n
ame
}}
</span>
<span>
尺码:
<span
class=
"bold"
>
{{
size
N
ame
}}
</span>
<span
class=
"bold"
>
{{
size
_n
ame
}}
</span>
</span>
{{#if
buyNumber
}}
<p
class=
"bold buy-number"
><span
class=
"iconfont"
>

</span>
{{
buyNumber
}}
</p>
{{#if
buy_number
}}
<p
class=
"bold buy-number"
><span
class=
"iconfont"
>

</span>
{{
buy_number
}}
</p>
{{/if}}
</div>
</div>
...
...
apps/me/views/partial/order/goods-box.hbs
View file @
e299703
<div
class=
"goods-container special-border
{{#if
hidePrice
}}
no-price
{{/if}}
"
>
{{#
order
G
oods
}}
{{#
order
_g
oods
}}
{{>
order
/
good-info
}}
{{#
unless
hidePrice
}}
<div
class=
"sub-column right-border bold"
>
<p
class=
"
{{#if
@last
}}
last
{{/if}}
"
>
¥
{{
goods
P
rice
}}
¥
{{
goods
_p
rice
}}
{{#if
changed
}}
<a
href=
"
{{
https
returnUrl
}}
"
>
<span
class=
"btn white change-tag"
>
已退换
</span>
...
...
@@ -13,11 +13,11 @@
</p>
</div>
<div
class=
"sub-column right-border special-column bold"
>
<p
class=
"bold"
>
{{
buy
N
umber
}}
</p>
<p
class=
"bold"
>
{{
buy
_n
umber
}}
</p>
</div>
<div
class=
"sub-column special-column bold"
>
<p
class=
"bold"
>
¥
{{
goods
A
mount
}}
</p>
<p
class=
"bold"
>
¥
{{
goods
_a
mount
}}
</p>
</div>
{{/
unless
}}
{{/
order
G
oods
}}
{{/
order
_g
oods
}}
</div>
...
...
apps/me/views/partial/order/order-header.hbs
View file @
e299703
<ul
class=
"header"
>
<li
class=
"content"
>
下单时间:
{{
createTime
}}
</li>
<li
class=
"content"
>
订单编号:
{{
orderCode
}}
</li>
<li
class=
"content"
>
下单时间:
{{
create_time
}}
</li>
<li
class=
"content"
>
订单编号:
{{
order_code
}}
</li>
{{#if
showMobile
}}
<li
class=
"content"
><span
class=
"iconfont"
>

</span>
手机订单
</li>
{{/if}}
...
...
apps/me/views/partial/order/table-body.hbs
View file @
e299703
<div
class=
"table table-body
{{#
unless
orderList
}}
empty
{{/
unless
}}
"
>
{{#if
orderList
}}
{{#
orderList
}}
<div
class=
"order"
data-code=
"
{{
order
C
ode
}}
"
>
<div
class=
"order"
data-code=
"
{{
order
_c
ode
}}
"
>
{{>
order
/
order-header
}}
<div
class=
"table-body"
>
{{>
order
/
goods-box
}}
<div
class=
"common-column special-border"
>
<p
class=
"bold"
>
¥
{{
amount
}}
</p>
<p
class=
"subtext no-pointer"
>
{{
payment
TypeS
tr
}}
</p>
<p
class=
"subtext no-pointer"
>
{{
payment
_type_s
tr
}}
</p>
{{#if
isRefundOrder
}}
<p
class=
"subtext refund-tag"
>
换货订单
</p>
{{/if}}
...
...
@@ -23,7 +23,7 @@
<div
class=
"pay-operation
{{#
unless
showLeftTime
}}
marginhack
{{/
unless
}}
"
>
{{#if
isOnlinePaid
}}
{{#if
showLeftTime
}}
<span
class=
"iconfont hide-when-invalid"
>

</span><p
class=
"left-time"
data-left=
"
{{
pay
L
efttime
}}
"
></p>
<span
class=
"iconfont hide-when-invalid"
>

</span><p
class=
"left-time"
data-left=
"
{{
pay
_l
efttime
}}
"
></p>
{{/if}}
<a
href=
"
{{
https
payUrl
}}
"
>
<span
class=
"btn red hide-when-invalid "
>
立即付款
</span>
...
...
package.json
View file @
e299703
...
...
@@ -63,7 +63,7 @@
"winston"
:
"^2.2.0"
,
"winston-daily-rotate-file"
:
"^1.1.4"
,
"xss"
:
"^0.2.13"
,
"yoho-node-lib"
:
"0.0.5
0
"
"yoho-node-lib"
:
"0.0.5
1
"
},
"devDependencies"
:
{
"autoprefixer"
:
"^6.3.6"
,
...
...
Please
register
or
login
to post a comment