Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohobuywap-node
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
Jian Shi
8 years ago
Commit
a288c611e42e2c8953dec85cfc2493c872293ae0
1 parent
a33925b6
我的收藏商品过滤脏数据
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
12 deletions
apps/home/models/favorite.js
apps/home/models/favorite.js
View file @
a288c61
/**
* 个人中心我的收藏
* @author: zxr<xiaoru.zhang@yoho.cn>
* @date: 2016/08/16
*/
* 个人中心我的收藏
* @author: zxr<xiaoru.zhang@yoho.cn>
* @date: 2016/08/16
*/
'use strict'
;
...
...
@@ -41,8 +41,10 @@ const favProduct = (uid, page, limit) => {
}
if
(
page
<=
list
.
data
.
pageTotal
)
{
_
.
forEach
(
list
.
data
.
productList
,
function
(
val
)
{
list
.
data
.
productList
=
_
.
filter
(
list
.
data
.
productList
,
function
(
n
)
{
return
n
.
productSkn
>
0
;
});
_
.
forEach
(
list
.
data
.
productList
,
function
(
val
)
{
let
obj
=
{};
// if (empty(val.productSkn)) {
...
...
@@ -143,7 +145,7 @@ const favfavBrand = (uid, page, limit) => {
if
(
page
<=
list
.
data
.
pageTotal
)
{
_
.
forEach
(
list
.
data
.
brandList
,
function
(
val
)
{
_
.
forEach
(
list
.
data
.
brandList
,
function
(
val
)
{
let
obj
=
{
productList
:
[]
};
...
...
@@ -173,10 +175,10 @@ const favfavBrand = (uid, page, limit) => {
update
:
val
.
newProductNum
});
_
.
forEach
(
val
.
newProduct
,
function
(
data
,
key
)
{
_
.
forEach
(
val
.
newProduct
,
function
(
data
,
key
)
{
obj
.
productList
.
push
({
link
:
'/product/pro_'
+
data
.
productId
+
'_'
+
data
.
goods
[
0
].
id
+
'/'
+
data
.
cnAlphabet
+
'.html'
,
data
.
goods
[
0
].
id
+
'/'
+
data
.
cnAlphabet
+
'.html'
,
imgUrl
:
data
.
defaultImages
,
price
:
'¥'
+
Number
(
data
.
marketPrice
).
toFixed
(
2
),
discount
:
data
.
marketPrice
>
data
.
salesPrice
?
'¥'
+
Number
(
data
.
salesPrice
).
toFixed
(
2
)
:
false
,
...
...
@@ -212,14 +214,14 @@ const favoriteDelete = (uid, type, favId) => {
};
const
index
=
(
uid
,
page
,
limit
,
isbrand
)
=>
{
if
(
isbrand
)
{
return
favfavBrand
(
uid
,
page
,
limit
).
then
(
result
=>
{
return
favfavBrand
(
uid
,
page
,
limit
).
then
(
result
=>
{
if
(
result
.
total
===
0
)
{
result
=
{
nobrandData
:
1
};
result
=
{
nobrandData
:
1
};
}
return
result
;
});
}
else
{
return
favProduct
(
uid
,
page
,
limit
).
then
(
result
=>
{
return
favProduct
(
uid
,
page
,
limit
).
then
(
result
=>
{
if
(
result
.
total
===
0
)
{
result
=
{
noproductData
:
1
};
}
...
...
Please
register
or
login
to post a comment