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
张孝茹
7 years ago
Commit
498a03c79bb7886ccb932a7b91885456acc9237f
1 parent
27660f19
data
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
14 deletions
apps/home/models/family.js
apps/home/models/family.js
View file @
498a03c
...
...
@@ -149,8 +149,9 @@ class familyModel extends global.yoho.BaseModel {
code
:
200
}).
then
((
result
)
=>
{
if
(
result
.
data
&&
result
.
data
.
mars
&&
result
.
data
.
mars
.
vipLevelList
.
length
>
0
)
{
_
.
forEach
(
result
.
data
.
mars
.
vipLevelList
,
function
(
val
)
{
if
(
result
.
data
&&
_
.
get
(
result
,
'data.mars'
,
''
)
&&
_
.
get
(
result
,
'data.mars.vipLevelList'
,
[]).
length
>
0
)
{
_
.
forEach
(
_
.
get
(
result
,
'data.mars.vipLevelList'
,
[]),
function
(
val
)
{
val
.
name
=
'Lv.'
+
val
.
level
;
});
}
...
...
@@ -402,16 +403,18 @@ class familyModel extends global.yoho.BaseModel {
let
list
=
[];
let
colorList
=
[];
if
(
result
&&
result
.
data
)
{
result
.
data
.
data
.
sort
(
function
(
a
,
b
)
{
if
(
result
&&
result
.
data
&&
result
.
code
===
200
)
{
let
integralData
=
_
.
get
(
result
,
'data'
,
{});
integralData
.
data
.
sort
(
function
(
a
,
b
)
{
return
b
.
proportion
-
a
.
proportion
;
});
if
(
_
.
get
(
result
.
data
,
'total'
,
0
)
)
{
if
(
integralData
.
total
)
{
chartsData
.
total
=
parseInt
(
result
.
data
.
total
,
10
)
<
99999
?
result
.
data
.
total
:
'99999+'
;
}
_
.
forEach
(
result
.
d
ata
.
data
,
function
(
data
)
{
_
.
forEach
(
integralD
ata
.
data
,
function
(
data
)
{
list
.
push
({
value
:
data
.
num
,
name
:
data
.
source
,
...
...
@@ -444,19 +447,20 @@ class familyModel extends global.yoho.BaseModel {
]).
then
((
result
)
=>
{
let
familyIndexData
=
{};
if
(
result
[
0
]
&&
result
[
0
].
data
)
{
if
(
result
[
0
]
&&
result
[
0
].
data
&&
_
.
get
(
result
,
'[0].code'
,
''
)
===
200
)
{
let
perInfo
=
_
.
get
(
result
,
'[0].data'
,
{});
if
(
result
[
0
].
data
.
headIco
)
{
if
(
perInfo
.
headIco
)
{
result
[
0
].
data
.
headIco
=
result
[
0
].
data
.
headIco
.
replace
(
'img01.yohomars.com'
,
'imgmars.yohobuy.com'
).
replace
(
'img02.yohomars.com'
,
'imgmars.yohobuy.com'
);
// eslint-disable-line
}
familyIndexData
=
_
.
assign
(
familyIndexData
,
{
head_ico
:
result
[
0
].
data
.
headIco
,
nickname
:
result
[
0
].
data
.
nickName
,
gender
:
parseInt
(
result
[
0
].
data
.
gender
,
10
),
birthday
:
result
[
0
].
data
.
birthday
?
moment
(
result
[
0
].
data
.
birthday
).
format
(
'MM-DD'
)
:
''
,
province
:
result
[
0
].
data
.
province
,
city
:
result
[
0
].
data
.
city
head_ico
:
perInfo
.
headIco
,
nickname
:
perInfo
.
nickName
,
gender
:
parseInt
(
perInfo
.
gender
,
10
),
birthday
:
perInfo
.
birthday
?
moment
(
perInfo
.
birthday
).
format
(
'MM-DD'
)
:
''
,
province
:
perInfo
.
province
,
city
:
perInfo
.
city
});
}
...
...
Please
register
or
login
to post a comment