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
fc8cb7c7
Commit
fc8cb7c7
authored
Feb 14, 2020
by
yanju
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
话题详情动态获取
parent
58c5970b
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
152 additions
and
55 deletions
+152
-55
components/pc/pagination.vue
+0
-3
components/pc/releaseCard.vue
+4
-4
components/pc/userCard2.vue
+0
-1
pages/answer/detail/_id.vue
+18
-3
pages/index.vue
+3
-3
pages/topic/detail/_name.vue
+127
-41
No files found.
components/pc/pagination.vue
View file @
fc8cb7c7
...
...
@@ -97,9 +97,7 @@
setCurrentPage
(
n
){
this
.
currentPage
=
1
;
this
.
paginationState
=
'loading'
this
.
$emit
(
config
.
event
.
listenPageChange
,
1
)
},
getElementToPageTop
(
el
)
{
...
...
@@ -122,7 +120,6 @@
}
}
else
{
// this.paginationState = 'complete';
}
}
...
...
components/pc/releaseCard.vue
View file @
fc8cb7c7
...
...
@@ -71,10 +71,10 @@
</div>
<div
class=
"bottom__r"
>
<div
class=
"select-box"
>
<p>
公开
</p
>
<yun-icon
name=
"down_arrow"
size=
"6px"
color=
"#999"
pb=
"1px"
></yun-icon
>
</div
>
<!--
<div
class=
"select-box"
>
--
>
<!--
<p>
公开
</p>
--
>
<!--
<yun-icon
name=
"down_arrow"
size=
"6px"
color=
"#999"
pb=
"1px"
></yun-icon>
--
>
<!--
</div>
--
>
<p
class=
"send-box"
@
click=
"dataPostContent"
>
发布
...
...
components/pc/userCard2.vue
View file @
fc8cb7c7
...
...
@@ -83,7 +83,6 @@
this
.
followLoading
=
true
;
this
.
$axios
.
$get
(
config
.
api
.
get
.
User
.
otherInfo
+
this
.
id
+
'/baseinfo'
).
then
((
response
)
=>
{
if
(
response
.
code
===
0
){
console
.
log
(
this
.
followLoading
);
let
data
=
response
.
data
;
this
.
userId
=
response
.
userId
;
this
.
nickName
=
data
.
nickName
;
...
...
pages/answer/detail/_id.vue
View file @
fc8cb7c7
...
...
@@ -73,7 +73,11 @@
</div>
<div
class=
"detail-container__right"
>
<user-card
:isFollow=
"articleDetail.followedAuthor"
:userId=
"articleDetail.userId"
></user-card>
<card-container
style=
"margin-top:16px"
title=
"相关推荐"
label=
"换一换"
more=
"更多"
>
<card-container
style=
"margin-top:16px"
title=
"相关推荐"
label=
"换一换"
more=
"更多"
v-if=
"answerList.length>0"
>
<nuxt-link
tag=
"div"
:to=
"'/answer/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>
</div>
<div
class=
"article-option"
>
...
...
@@ -133,11 +137,12 @@
return
{
commentContent
:
''
,
commentList
:[],
answerList
:[],
}
},
created
(){
this
.
dataGetReAnswerList
();
globalBus
.
$emit
(
config
.
event
.
listenDetailInfo
,
this
.
articleDetail
.
questionTitle
,
'answer'
)
},
...
...
@@ -157,7 +162,17 @@
})
}
}
},
dataGetReAnswerList
()
{
let
params
=
{
page
:
1
,
size
:
5
};
this
.
$axios
.
$get
(
config
.
api
.
get
.
Question
.
recommendsList
+
this
.
articleDetail
.
questionId
+
'/recommends'
,{
params
:
params
})
.
then
((
response
)
=>
{
this
.
answerList
=
response
.
data
.
dataList
;
});
},
},
components
:{
...
...
pages/index.vue
View file @
fc8cb7c7
...
...
@@ -24,12 +24,12 @@
</card-container>
<card-container
style=
"margin-top: 16px"
title=
"社区精英"
label=
"换一换"
>
<card-container
style=
"margin-top: 16px
;padding-bottom:15px
"
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"
>
<nuxt-link
tag=
"div"
:to=
"'/
answer
/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>
...
...
@@ -216,7 +216,7 @@
.information-content
{
width
:
100%
;
overflow
:
hidden
;
margin-top
:
3
*$
length
;
margin-top
:
5
*$
length
;
@extend
%nowrap;
@extend
%cursorPointer;
@extend
%animate-transition;
...
...
pages/topic/detail/_name.vue
View file @
fc8cb7c7
...
...
@@ -29,9 +29,9 @@
></nav-wrap>
</div>
<div
class=
"__right"
>
<release-card
:initWord=
"$route.params.name"
@
listenReleaseState=
"
dataGetDynamic(1
)"
></release-card>
<social-card
@
listenSocialCardState=
"
dataGetDynamic(1
)"
v-for=
"(val,index) in postList"
:key=
"val.postId"
:info=
"val"
></social-card>
<pagination
:paginationReset=
"paginationReset"
:paginationState=
"paginationState"
:type=
"2"
key=
"container5"
style=
"margin:20px auto;"
:pages=
"pages"
v-on:listenPageChange=
"changePage"
></pagination>
<release-card
:initWord=
"$route.params.name"
@
listenReleaseState=
"
restartPagination(
)"
></release-card>
<social-card
@
listenSocialCardState=
"
restartPagination(
)"
v-for=
"(val,index) in postList"
:key=
"val.postId"
:info=
"val"
></social-card>
<pagination
ref=
"pagination"
:paginationState=
"paginationState"
:type=
"2"
key=
"container5"
style=
"margin:20px auto;"
:pages=
"pages"
v-on:listenPageChange=
"changePage"
></pagination>
</div>
</div>
...
...
@@ -48,10 +48,8 @@
<card-container
title=
"活跃用户"
label=
"换一换"
more=
"更多"
width=
"302px"
style=
"margin-top: 16px"
style=
"margin-top: 16px
;padding-bottom: 15px
"
v-if=
"userList.length>0"
>
<user-card
style=
"padding-bottom: 2px;padding-top: 2px"
v-for=
"(val,index) in userList"
:key=
"val.userId"
:info=
"val"
></user-card>
...
...
@@ -81,44 +79,26 @@
return
{
list
:
[
{
label
:
'
推荐
'
,
label
:
'
最新
'
,
address
:
this
.
$route
.
path
,
type
:
'
推荐
'
type
:
'
new
'
},
{
label
:
'热门'
,
address
:
this
.
$route
.
path
,
type
:
'热门'
},
{
label
:
'关注'
,
address
:
this
.
$route
.
path
,
type
:
'关注'
},
{
label
:
'我的'
,
address
:
this
.
$route
.
path
,
type
:
'我的'
},
{
label
:
'文字'
,
address
:
this
.
$route
.
path
,
type
:
'
文字
'
type
:
'
word
'
},
{
label
:
'视频'
,
address
:
this
.
$route
.
path
,
type
:
'
视频
'
type
:
'
video
'
},
{
label
:
'图片'
,
address
:
this
.
$route
.
path
,
type
:
'
图片
'
type
:
'
picture
'
}
],
topicCardInfo
:{},
...
...
@@ -136,10 +116,12 @@
created
()
{
let
name
=
this
.
$route
.
params
.
name
;
this
.
dataGetTopicInfo
(
name
);
this
.
dataGetUsers
();
this
.
$router
.
replace
({
path
:
this
.
$route
.
path
,
query
:
{
type
:
'
推荐
'
type
:
'
new
'
}
});
...
...
@@ -164,7 +146,9 @@
this
.
dataGetSearchTopic
(
val
)
this
.
showHideCard
=
true
;
},
$route
(){
this
.
restartPagination
();
}
},
methods
:{
...
...
@@ -175,46 +159,148 @@
}
}).
then
((
response
)
=>
{
this
.
topicCardInfo
=
response
.
data
;
this
.
dataGetUsers
(
response
.
data
.
topicId
);
})
},
dataGetDynamic
(
currentPage
){
restartPagination
(){
this
.
postList
=
[];
this
.
pages
=
1
;
if
(
process
.
browser
){
this
.
$refs
.
pagination
.
setCurrentPage
(
1
)
}
},
dataGetNewDynamic
(
currentPage
){
this
.
paginationState
=
'loading'
;
let
name
=
this
.
$route
.
params
.
name
;
this
.
$axios
.
$get
(
config
.
api
.
get
.
Topic
.
postList
+
name
+
'/posts'
,{
params
:{
page
:
currentPage
,
size
:
10
}
}).
then
((
response
)
=>
{
this
.
paginationState
=
'over'
;
if
(
currentPage
===
1
){
this
.
postList
=
response
.
data
.
dataList
;
this
.
pages
=
response
.
data
.
totalPage
;
}
else
{
let
list
=
response
.
data
.
dataList
;
for
(
let
i
=
0
;
i
<
list
.
length
;
i
++
){
this
.
postList
.
push
(
list
[
i
]);
}
this
.
pages
=
response
.
data
.
totalPage
;
}
})
},
dataGetWordDynamic
(
currentPage
){
this
.
paginationState
=
'loading'
;
let
name
=
this
.
$route
.
params
.
name
;
this
.
$axios
.
$get
(
config
.
api
.
get
.
Topic
.
postList
+
name
+
'/posts'
,{
params
:{
page
:
currentPage
,
size
:
10
,
type
:
0
}
}).
then
((
response
)
=>
{
this
.
paginationState
=
'over'
;
if
(
currentPage
===
1
){
this
.
postList
=
response
.
data
.
dataList
;
this
.
pages
=
response
.
data
.
totalPage
;
}
else
{
let
list
=
response
.
data
.
dataList
;
for
(
let
i
=
0
;
i
<
list
.
length
;
i
++
){
this
.
postList
.
push
(
list
[
i
]);
}
this
.
pages
=
response
.
data
.
totalPage
;
}
})
},
dataGetVideoDynamic
(
currentPage
){
this
.
paginationState
=
'loading'
;
let
name
=
this
.
$route
.
params
.
name
;
this
.
$axios
.
$get
(
config
.
api
.
get
.
Topic
.
detail
+
name
+
'/posts'
,{
this
.
$axios
.
$get
(
config
.
api
.
get
.
Topic
.
postList
+
name
+
'/posts'
,{
params
:{
page
:
currentPage
,
size
:
10
,
type
:
1
}
}).
then
((
response
)
=>
{
this
.
paginationState
=
'over'
;
if
(
currentPage
===
1
){
this
.
postList
=
response
.
data
.
dataList
;
this
.
pages
=
response
.
data
.
totalPage
;
this
.
paginationReset
=
true
;
}
else
{
let
list
=
response
.
data
.
dataList
;
for
(
let
i
=
0
;
i
<
list
.
length
;
i
++
){
this
.
postList
.
push
(
list
[
i
]);
}
this
.
paginationReset
=
false
;
this
.
pages
=
response
.
data
.
totalPage
;
}
})
},
dataGetPictureDynamic
(
currentPage
){
this
.
paginationState
=
'loading'
;
let
name
=
this
.
$route
.
params
.
name
;
this
.
$axios
.
$get
(
config
.
api
.
get
.
Topic
.
postList
+
name
+
'/posts'
,{
params
:{
page
:
currentPage
,
size
:
10
,
type
:
2
}
}).
then
((
response
)
=>
{
this
.
paginationState
=
'over'
;
if
(
currentPage
===
1
){
this
.
postList
=
response
.
data
.
dataList
;
this
.
pages
=
response
.
data
.
totalPage
;
}
else
{
let
list
=
response
.
data
.
dataList
;
for
(
let
i
=
0
;
i
<
list
.
length
;
i
++
){
this
.
postList
.
push
(
list
[
i
]);
}
this
.
pages
=
response
.
data
.
totalPage
;
}
})
},
changePage
(
currentPage
){
//返回页数 请求新的数据
this
.
dataGetDynamic
(
currentPage
);
},
let
type
=
this
.
$route
.
query
.
type
;
if
(
type
===
'new'
){
this
.
dataGetNewDynamic
(
currentPage
);
}
if
(
type
===
'word'
){
this
.
dataGetWordDynamic
(
currentPage
);
}
if
(
type
===
'video'
){
this
.
dataGetPictureDynamic
(
currentPage
);
}
if
(
type
===
'picture'
){
this
.
dataGetVideoDynamic
(
currentPage
);
}
dataGetUsers
(
id
){
this
.
$axios
.
$get
(
config
.
api
.
get
.
Topic
.
topicFollowerList
+
id
+
'/follower'
,{
},
dataGetUsers
(){
this
.
$axios
.
$get
(
config
.
api
.
get
.
User
.
active
,{
params
:{
page
:
1
,
size
:
10
size
:
5
}
}).
then
((
response
)
=>
{
this
.
userList
=
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