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
郝肖肖
8 years ago
Commit
e6a613b86e5d7036813604301148d8c3afa2ab2b
1 parent
8556f9fb
商品详情页,获取咨询加cache
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
20 deletions
apps/product/models/consult-comment.js
apps/product/models/consult-comment.js
View file @
e6a613b
...
...
@@ -20,7 +20,7 @@ const getCommonConsult = () => {
return
api
.
get
(
''
,
params
,
{
code
:
200
}).
then
(
result
=>
{
}
,
{
cache
:
true
}
).
then
(
result
=>
{
let
data
=
{};
if
(
result
.
data
)
{
...
...
@@ -37,24 +37,20 @@ const getCommonConsult = () => {
* @return {[object]}
*/
const
_formatConsultsList
=
(
data
)
=>
{
let
list
=
[];
if
(
data
.
length
)
{
_
.
forEach
(
data
,
(
value
)
=>
{
list
.
push
({
question
:
value
.
ask
,
time
:
value
.
ask_time
,
answer
:
value
.
answer
,
id
:
value
.
id
,
isLike
:
value
.
is_like
===
'Y'
,
like
:
_
.
toNumber
(
value
.
like
),
isUseful
:
value
.
is_useful
===
'Y'
,
useful
:
_
.
toNumber
(
value
.
useful
)
});
});
}
return
list
;
data
=
data
||
[];
return
data
.
map
(
function
(
value
)
{
return
{
question
:
value
.
ask
,
time
:
value
.
ask_time
,
answer
:
value
.
answer
,
id
:
value
.
id
,
isLike
:
value
.
is_like
===
'Y'
,
like
:
_
.
toNumber
(
value
.
like
),
isUseful
:
value
.
is_useful
===
'Y'
,
useful
:
_
.
toNumber
(
value
.
useful
)
};
});
};
/**
...
...
@@ -75,7 +71,7 @@ const getConsults = (id, page, limit, uid) => {
return
api
.
get
(
''
,
params
,
{
code
:
200
}).
then
(
result
=>
{
}
,
{
cache
:
true
}
).
then
(
result
=>
{
let
data
=
{};
if
(
result
&&
result
.
data
&&
result
.
data
.
list
)
{
...
...
Please
register
or
login
to post a comment