Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
beyond-clouds-front
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
beyond-clouds-front
Commits
a583634b
Commit
a583634b
authored
Feb 14, 2020
by
yanju
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完善首页 修复项目 博客 问答页多次请求数据
parent
ebb9a65c
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
148 additions
and
33 deletions
+148
-33
action/config.js
+2
-0
pages/answer/index.vue
+0
-6
pages/blog/index.vue
+0
-1
pages/index.vue
+135
-24
pages/project/index.vue
+11
-2
No files found.
action/config.js
View file @
a583634b
...
@@ -48,6 +48,8 @@ export default {
...
@@ -48,6 +48,8 @@ export default {
otherFollowing
:
'/api/user/'
,
//获取ta的关注(列表) +{userId}/follower
otherFollowing
:
'/api/user/'
,
//获取ta的关注(列表) +{userId}/follower
blacklist
:
'/api/my/blacklist/'
,
//获取黑名单 +{userId}
blacklist
:
'/api/my/blacklist/'
,
//获取黑名单 +{userId}
hotBloggers
:
'/api/user/hotBloggers'
,
//热门博主
hotBloggers
:
'/api/user/hotBloggers'
,
//热门博主
elites
:
'/api/user/elites'
,
//社区精英
active
:
'/api/user/actives'
,
//活跃用户
},
},
Authentication
:{
Authentication
:{
...
...
pages/answer/index.vue
View file @
a583634b
...
@@ -95,15 +95,9 @@ export default {
...
@@ -95,15 +95,9 @@ export default {
this
.
getLabelTitle
();
this
.
getLabelTitle
();
this
.
dataGetQuestionCategory
();
this
.
dataGetQuestionCategory
();
},
},
/*computed: {
labelTitle: function () {
return this.$route.query.id
}
},*/
watch
:{
watch
:{
$route
(){
$route
(){
this
.
restartPagination
();
this
.
restartPagination
();
this
.
dataGetQuestionList
(
1
);
this
.
getLabelTitle
()
this
.
getLabelTitle
()
}
}
},
},
...
...
pages/blog/index.vue
View file @
a583634b
...
@@ -100,7 +100,6 @@ export default {
...
@@ -100,7 +100,6 @@ export default {
watch
:
{
watch
:
{
$route
:
function
()
{
$route
:
function
()
{
this
.
restartPagination
();
this
.
restartPagination
();
this
.
dataGetBlogList
(
1
);
this
.
getLabelTitle
();
this
.
getLabelTitle
();
}
}
},
},
...
...
pages/index.vue
View file @
a583634b
...
@@ -10,18 +10,29 @@
...
@@ -10,18 +10,29 @@
</card-container>
</card-container>
</div>
</div>
<div
class=
"home-container__r"
>
<div
class=
"home-container__r"
>
<card-container
style=
"margin-top: 40px"
title=
"最新资讯"
label=
"换一换"
more=
"更多"
:clickToGetMore=
"()=>changeRoute('/blog')"
>
<card-container
style=
"margin-top: 40px"
title=
"最新资讯"
label=
"换一换"
more=
"更多"
@
listenCardConMore=
"changeRoute('/news')"
>
<div
class=
"information-wrap"
v-for=
"(val,index) in newsList"
:key=
"val.contentId"
>
<p
class=
"information-time"
>
{{
dateConvert
(
val
.
createTime
)
}}
</p>
<p
class=
"information-content"
>
{{
val
.
title
}}
</p>
</div>
</card-container>
</card-container>
<card-container
style=
"margin-top: 16px"
title=
"话题热搜榜"
label=
"实时更新"
more=
"更多"
>
<card-container
style=
"margin-top: 16px"
title=
"话题热搜榜"
label=
"实时更新"
more=
"更多"
@
listenCardConMore=
"changeRoute('/topic')"
>
<nuxt-link
tag=
"div"
:to=
"'/topic/detail/'+val.topicName"
class=
"topic-content__c"
v-for=
"(val,index) in topicList"
:key=
"val.topicId"
>
<p>
#
{{
val
.
topicName
}}
#
</p>
<h6>
{{
val
.
referenceCount
}}
</h6>
</nuxt-link>
</card-container>
</card-container>
<card-container
style=
"margin-top: 16px"
title=
"社区精英"
label=
"换一换"
more=
"更多"
>
</card-container>
<card-container
style=
"margin-top: 16px"
title=
"推荐问答"
label=
"换一换"
more=
"更多"
>
<card-container
style=
"margin-top: 16px"
title=
"社区精英"
label=
"换一换"
>
<user-card
style=
"padding-bottom: 2px;padding-top: 2px"
v-for=
"(val,index) in elitesList"
:key=
"val.userId"
:info=
"val"
></user-card>
</card-container>
<card-container
style=
"margin-top: 16px"
title=
"热门问答"
label=
"换一换"
more=
"更多"
@
listenCardConMore=
"changeRoute('/answer')"
>
<nuxt-link
tag=
"div"
:to=
"'/topic/detail/'+val.questionId"
class=
"topic-content__c"
v-for=
"(val,index) in answerList"
:key=
"val.questionId"
>
<p>
{{
val
.
questionTitle
}}
</p>
<h6>
{{
val
.
replyNumber
}}
</h6>
</nuxt-link>
</card-container>
</card-container>
</div>
</div>
...
@@ -35,6 +46,8 @@
...
@@ -35,6 +46,8 @@
import
CardContainer
from
'../components/pc/cardContainer'
;
import
CardContainer
from
'../components/pc/cardContainer'
;
import
ProjectCard
from
'../components/pc/projectCard'
;
import
ProjectCard
from
'../components/pc/projectCard'
;
import
config
from
'../action/config'
;
import
config
from
'../action/config'
;
import
UserCard
from
'../components/pc/userCard2'
import
{
dateConvert
}
from
'../action/utils/dataConvert'
export
default
{
export
default
{
...
@@ -43,14 +56,14 @@
...
@@ -43,14 +56,14 @@
let
blogList
=
await
$axios
.
$get
(
config
.
api
.
get
.
Blog
.
list
,{
let
blogList
=
await
$axios
.
$get
(
config
.
api
.
get
.
Blog
.
list
,{
params
:{
params
:{
page
:
1
,
page
:
1
,
size
:
3
,
size
:
5
,
}
}
});
});
let
projectList
=
await
$axios
.
$get
(
config
.
api
.
get
.
Project
.
list
,{
let
projectList
=
await
$axios
.
$get
(
config
.
api
.
get
.
Project
.
list
,{
params
:{
params
:{
page
:
1
,
page
:
1
,
size
:
3
,
size
:
5
,
}
}
});
});
...
@@ -68,31 +81,76 @@
...
@@ -68,31 +81,76 @@
'https://yundingweb.oss-cn-beijing.aliyuncs.com/yunding/20190828/161fecb3d8b441c5b340319c62508513-file'
,
'https://yundingweb.oss-cn-beijing.aliyuncs.com/yunding/20190828/161fecb3d8b441c5b340319c62508513-file'
,
'https://s2.ax1x.com/2020/01/13/lHpvY4.png'
,
'https://s2.ax1x.com/2020/01/13/lHpvY4.png'
,
],
],
elitesList
:[],
answerList
:[],
topicList
:[],
newsList
:[],
}
}
},
},
components
:{
created
()
{
this
.
dataGetHotBloggersList
();
CardContainer
,
Banner
,
ProjectCard
this
.
dataGetHotAnswerList
();
this
.
dataGetHotTopicList
();
this
.
dataGetNewsList
();
},
components
:{
CardContainer
,
Banner
,
ProjectCard
,
UserCard
},
},
methods
:{
methods
:{
changeRoute
(
r
){
changeRoute
(
r
){
return
this
.
$router
.
push
(
r
);
return
this
.
$router
.
push
(
r
);
},
},
showAlert
(){
dateConvert
(
time
)
{
// $alert 使用方法
return
dateConvert
(
time
);
this
.
$alert
(
'确认清空消息列表?'
,
''
,
{
},
confirmButtonText
:
'确定'
,
// callback: action => {
dataGetHotBloggersList
()
{
// this.$message({
let
params
=
{
// type: 'info',
page
:
1
,
// message: `action: ${ action }`,
size
:
5
// confirmButtonPosition: 'left',
};
// });
this
.
$axios
.
$get
(
config
.
api
.
get
.
User
.
elites
,{
params
:
params
})
// }
.
then
((
response
)
=>
{
this
.
elitesList
=
response
.
data
.
dataList
;
});
},
dataGetHotAnswerList
()
{
let
params
=
{
page
:
1
,
size
:
10
};
this
.
$axios
.
$get
(
config
.
api
.
get
.
Question
.
hotList
,{
params
:
params
})
.
then
((
response
)
=>
{
this
.
answerList
=
response
.
data
.
dataList
;
});
},
dataGetHotTopicList
()
{
let
params
=
{
page
:
1
,
size
:
10
};
this
.
$axios
.
$get
(
config
.
api
.
get
.
Topic
.
hotSearch
,{
params
:
params
})
.
then
((
response
)
=>
{
this
.
topicList
=
response
.
data
.
dataList
;
});
});
},
},
dataGetNewsList
()
{
let
params
=
{
page
:
1
,
size
:
5
,
type
:
1
};
this
.
$axios
.
$get
(
config
.
api
.
get
.
Content
.
list
+
'/13/contents'
,
{
params
:
params
}).
then
((
response
)
=>
{
this
.
newsList
=
response
.
data
.
dataList
;
})
},
},
},
mounted
(){
mounted
(){
}
}
...
@@ -113,6 +171,59 @@
...
@@ -113,6 +171,59 @@
.home-container__r
{
.home-container__r
{
overflow
:
hidden
;
overflow
:
hidden
;
width
:
302
*$
length
;
width
:
302
*$
length
;
.topic-content__c{
@extend
%flex-row-spb;
@extend
%cursorPointer;
padding
:
0
16
*$
length
;
box-sizing
:
border-box
;
margin-top
:
20
*$
length
;
p{
width
:
190
*$
length
;
@include
fontStyle(12,16,500,#333,left);
@extend
%nowrap;
@extend
%animate-transition;
&:hover{
color
:
#00AAE6
}
}
h6
{
@include
fontStyle(12,16,500,#ccc,left);
@extend
%nowrap;
}
}
.information-wrap
{
padding
:
12
*$
length
16
*$
length
0
;
box-sizing
:
border-box
;
width
:
302
*$
length
;
&:hover{
.information-time{
color
:
rgba
(
0
,
170
,
230
,
.6
);
}
.information-content
{
color
:
rgba
(
0
,
170
,
230
,
1
);
}
}
.information-time
{
@extend
%cursorPointer;
@include
fontStyle(12,
16,
500,
#CCC,
left);
@extend
%animate-transition;
@extend
%nowrap;
}
.information-content
{
width
:
100%
;
overflow
:
hidden
;
margin-top
:
3
*$
length
;
@extend
%nowrap;
@extend
%cursorPointer;
@extend
%animate-transition;
@include
fontStyle(14,
19,
500,
#333,
left);
}
}
}
}
}
}
</
style
>
</
style
>
pages/project/index.vue
View file @
a583634b
...
@@ -78,6 +78,13 @@ export default {
...
@@ -78,6 +78,13 @@ export default {
}
}
},
},
created
()
{
created
()
{
if
(
this
.
$route
.
query
.
type
){
this
.
dataGetProjectCategory
();
this
.
dataGetHotProjectList
();
this
.
getLabelTitle
();
}
else
{
this
.
$router
.
replace
({
this
.
$router
.
replace
({
path
:
'/project'
,
path
:
'/project'
,
query
:
{
query
:
{
...
@@ -87,12 +94,14 @@ export default {
...
@@ -87,12 +94,14 @@ export default {
this
.
dataGetProjectCategory
();
this
.
dataGetProjectCategory
();
this
.
dataGetHotProjectList
();
this
.
dataGetHotProjectList
();
this
.
getLabelTitle
();
this
.
getLabelTitle
();
}
},
},
watch
:{
watch
:{
$route
(){
$route
(){
this
.
restartPagination
();
this
.
restartPagination
();
this
.
dataGetProjectList
(
1
);
this
.
getLabelTitle
()
this
.
getLabelTitle
()
}
}
},
},
...
@@ -129,7 +138,7 @@ export default {
...
@@ -129,7 +138,7 @@ export default {
page
:
1
,
page
:
1
,
size
:
5
size
:
5
};
};
this
.
$axios
.
$get
(
config
.
api
.
get
.
Project
.
l
ist
,{
params
:
params
}).
then
((
response
)
=>
{
this
.
$axios
.
$get
(
config
.
api
.
get
.
Project
.
hotL
ist
,{
params
:
params
}).
then
((
response
)
=>
{
this
.
hotProjectList
=
response
.
data
.
dataList
;
this
.
hotProjectList
=
response
.
data
.
dataList
;
})
})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment