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
htoooth
8 years ago
Commit
e6d0019acd92f59fccd8a76b43f2b2a54b295916
1 parent
18f42f58
fix css
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
22 deletions
apps/home/models/favorite-service.js
apps/home/models/orders-service.js
apps/home/models/pager.js
apps/home/views/action/favorite.hbs
apps/home/models/favorite-service.js
View file @
e6d0019
...
...
@@ -52,20 +52,6 @@ const _getSortInfo = (categoryList, sort)=> {
return
result
;
};
const
_getPager
=
(
page
,
total
,
totalPage
)
=>
{
let
result
=
{};
if
(
page
&&
total
&&
totalPage
)
{
result
=
{
count
:
total
,
curPage
:
page
,
totalPages
:
totalPage
,
hasCheckAll
:
true
};
}
return
result
;
};
const
getGoodsInfo
=
(
data
,
page
,
limit
)
=>
{
let
result
=
data
.
slice
((
page
-
1
)
*
limit
,
page
*
limit
).
map
((
item
)
=>
{
return
{
...
...
@@ -196,7 +182,7 @@ const favoriteProductListAsync = (uid, page, limit, selectedSort, subscribe, red
page
=
page
>
pageTotal
?
pageTotal
:
page
;
result
.
goods
=
getGoodsInfo
(
productList
,
page
,
limit
);
result
.
pager
=
pager
(
total
,
query
);
result
.
pager
=
pager
(
total
,
Object
.
assign
(
query
,
{
hasCheckAll
:
true
})
);
result
.
pager
.
hasCheckAll
=
true
;
return
result
;
...
...
@@ -237,7 +223,7 @@ const favoriteBrandListAsync = (uid, page, limit, type)=> {
let
total
=
brand
.
data
.
total
||
0
;
page
=
brand
.
data
.
page
||
0
;
result
.
pager
=
pager
(
total
,
{
page
,
limit
,
type
});
result
.
pager
=
pager
(
total
,
{
page
,
limit
,
type
,
hasCheckAll
:
true
});
return
result
;
})();
};
...
...
@@ -260,7 +246,7 @@ const favoriteArticleListAsync = (uid, udid, page, limit, type)=> {
let
total
=
articles
.
data
.
total
||
0
;
result
.
pager
=
pager
(
total
,
{
page
,
limit
,
type
});
result
.
pager
=
pager
(
total
,
{
page
,
limit
,
type
,
hasCheckAll
:
true
});
if
(
_
.
isEmpty
(
result
.
articles
))
{
result
.
articles
=
{
...
...
apps/home/models/orders-service.js
View file @
e6d0019
...
...
@@ -694,7 +694,7 @@ const _getOrderDetail = co(function * (uid, orderId) {
receiver
:
orderDetail
.
user_name
,
address
:
orderDetail
.
area
+
orderDetail
.
address
,
phone
:
_
.
fill
(
orderDetail
.
mobile
.
split
(
''
),
'*'
,
3
,
4
).
join
(
''
)
+
(
orderDetail
.
phone
?
','
+
_
.
fill
(
orderDetail
.
phone
.
split
(
''
),
'*'
,
3
,
5
).
join
(
''
)
:
''
)
(
orderDetail
.
phone
?
','
+
_
.
fill
(
orderDetail
.
phone
.
split
(
''
),
'*'
,
3
,
5
).
join
(
''
)
:
''
)
};
detail
.
editInfo
=
{
...
...
@@ -744,7 +744,7 @@ const _getOrderDetail = co(function * (uid, orderId) {
// 发票
if
(
orderDetail
.
invoice
)
{
detail
.
invoiceMode
=
true
;
detail
.
invoiceType
=
_
.
get
(
orderDetail
,
'invoice.type'
)
===
2
?
'电子发票'
:
'纸质发票'
;
detail
.
invoiceType
=
(
+
_
.
get
(
orderDetail
,
'invoice.type'
,
0
)
)
===
2
?
'电子发票'
:
'纸质发票'
;
detail
.
showInvoice
=
_
.
get
(
orderDetail
,
'invoice.showInvoice'
);
detail
.
pdfUrl
=
detail
.
showInvoice
?
_
.
get
(
orderDetail
,
'invoice.pdfUrl'
)
:
''
;
detail
.
title
=
_
.
get
(
orderDetail
,
'invoice.title'
)
||
''
;
...
...
@@ -754,9 +754,9 @@ const _getOrderDetail = co(function * (uid, orderId) {
detail
.
totalYoho
=
orderDetail
.
yoho_give_coin
;
detail
.
yohoCoinUrl
=
helpers
.
urlFormat
(
'/help/detail'
,
{
id
:
105
});
// 有货币介绍
detail
.
remark
=
orderDetail
.
remark
;
detail
.
operation
=
_getOrderDetailOp
(
orderDetail
.
order_cde
,
orderDetail
.
payment
,
+
orderDetail
.
status
,
detail
.
operation
=
_getOrderDetailOp
(
orderDetail
.
order_cde
,
+
orderDetail
.
payment
,
+
orderDetail
.
status
,
orderDetail
.
is_cancel
,
orderDetail
.
payment_status
,
orderDetail
.
payment_type
,
orderDetail
.
order_type
,
orderDetail
.
attribute
,
orderDetail
.
refund_status
);
+
orderDetail
.
order_type
,
+
orderDetail
.
attribute
,
+
orderDetail
.
refund_status
);
detail
.
packageTitle
=
orderDetail
.
package_title
;
detail
.
packages
=
_getPackageInfo
(
orderDetail
);
...
...
apps/home/models/pager.js
View file @
e6d0019
...
...
@@ -66,6 +66,11 @@ exports.handlePagerData = (total, params) => {
return
result
;
}
if
(
params
.
hasCheckAll
)
{
result
.
hasCheckAll
=
true
;
delete
params
.
hasCheckAll
;
}
// 页码临时数据
let
pages
=
[];
...
...
apps/home/views/action/favorite.hbs
View file @
e6d0019
...
...
@@ -17,7 +17,6 @@
{{>
favorite
/
article
}}
</div>
{{/
meFavorite
}}
{{>
help-us
}}
</div>
{{>
favorite
/
price-notice
}}
...
...
Please
register
or
login
to post a comment