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
zhangxiaoru
9 years ago
Commit
432e3f12cb0a823d7ef365e475e5ab548fe5dc37
1 parent
11364442
editorialpre
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
22 deletions
apps/editorial/models/editorial.js
apps/me/models/returns.js
public/js/editorial/detail.page.js
public/scss/me/favorite/_editorial.css
apps/editorial/models/editorial.js
View file @
432e3f1
...
...
@@ -461,24 +461,23 @@ const _getArticlePre = (id, appType) => {
id
:
id
,
app_type
:
appType
}).
then
((
result
)
=>
{
console
.
log
(
result
.
message
);
//console.log(result.message);
// result.code = 200;
// result.data = {
// articleIdPre: 34288,
// authorId: 589238
// }
if
(
result
&&
result
.
code
===
200
)
{
let
perArticle
=
{};
// let id = result.data.articleIdPre;
return
_getHeadData
(
result
.
data
.
articleIdPre
,
appType
).
then
((
list
)
=>
{
perArticle
.
href
=
`
$
{
config
.
siteUrl
}
/editorial/
$
{
result
.
data
.
articleIdPre
}.
html
`
;
_getHeadData
(
result
.
data
.
articleIdPre
,
appType
).
then
((
list
)
=>
{
console
.
log
(
list
);
perArticle
.
lastChapter
=
list
.
title
;
perArticle
.
href
=
`
$
{
config
.
siteUrl
}
/editorial/
$
{
result
.
data
.
articleIdPre
}.
html
`
;
}).
then
(()
=>
{
console
.
log
(
perArticle
);
return
perArticle
;
});
return
perArticle
;
}
else
{
logger
.
error
(
'In the previous is not 200'
);
return
{};
...
...
@@ -496,22 +495,24 @@ const _getArticleNext = (id, appType) => {
id
:
id
,
app_type
:
appType
}).
then
((
result
)
=>
{
console
.
log
(
result
)
// console.log(result);
// result.code = 200;
// result.data = {
// articleIdNext: 34288,
// authorId: 589238
// }
if
(
result
&&
result
.
code
===
200
)
{
let
nextArticle
=
{};
nextArticle
.
href
=
`
$
{
config
.
siteUrl
}
/editorial/
$
{
result
.
data
.
articleIdNext
}.
html
`
;
_getHeadData
(
result
.
data
.
articleIdNext
,
appType
).
then
((
list
)
=>
{
return
_getHeadData
(
result
.
data
.
articleIdNext
,
appType
).
then
((
list
)
=>
{
nextArticle
.
lastChapter
=
list
.
title
;
}).
then
(()
=>
{
nextArticle
.
href
=
`
$
{
config
.
siteUrl
}
/editorial/
$
{
result
.
data
.
articleIdNext
}.
html
`
;
nextArticle
.
nextChapter
=
list
.
title
;
return
nextArticle
;
});
return
nextArticle
;
})
}
else
{
logger
.
error
(
'The next article is not 200'
);
...
...
@@ -644,8 +645,8 @@ const getDetailData = (id, uid, udid, appType) => {
content
:
result
[
2
],
comment
:
result
[
3
],
brands
:
result
[
6
],
nextArticle
:
result
[
4
],
perArticle
:
result
[
5
]
nextArticle
:
result
[
5
],
perArticle
:
result
[
4
]
};
})();
};
...
...
apps/me/models/returns.js
View file @
432e3f1
...
...
@@ -156,7 +156,7 @@ const _calcStatusRate = (num, total) => {
*/
const
submitChange
=
(
data
,
uid
)
=>
{
return
returnsAPI
.
changeSubmitAsync
(
data
,
uid
).
then
(
result
=>
{
console
.
log
(
result
)
console
.
log
(
result
)
;
return
result
;
});
};
...
...
public/js/editorial/detail.page.js
View file @
432e3f1
...
...
@@ -19,7 +19,9 @@ var $commentList = $commentArea.find('.comments-wrap'),
_alert
=
dialog
.
Alert
,
tag
=
$
(
'#tags'
).
find
(
'li'
).
length
,
leng
=
$
(
'.goods'
).
find
(
'.good-info'
).
length
/
4
,
pag
=
0
;
pag
=
0
,
pre
=
$
(
'.chapter-left'
).
find
(
'a'
),
next
=
$
(
'.chapter-right'
).
find
(
'a'
);
require
(
'../plugins/share'
);
require
(
'../common/header'
);
...
...
@@ -231,3 +233,13 @@ $('.left').click(function() {
$goods
.
animate
({
left
:
'+=930px'
});
});
console
.
log
(
$
(
'.chapter-left'
).
find
(
'a'
).
text
().
length
)
if
(
pre
.
text
().
length
>
20
)
{
pre
.
text
(
pre
.
text
().
substring
(
0
,
19
)
+
'...'
);
}
if
(
next
.
text
().
length
>
20
)
{
next
.
text
(
next
.
text
().
substring
(
0
,
19
)
+
'...'
);
}
...
...
public/scss/me/favorite/_editorial.css
View file @
432e3f1
...
...
@@ -94,6 +94,8 @@
margin-top
:
10px
;
white-space
:
nowrap
;
text-overflow
:
ellipsis
;
height
:
18px
;
line-height
:
18px
;
}
}
...
...
Please
register
or
login
to post a comment