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
b027b505
Commit
b027b505
authored
Feb 13, 2020
by
yanju
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'xue' into 'master'
问答展示分类 See merge request pigbigbig/beyond-clouds-front!61
parents
5feebf8d
557c7af9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
26 deletions
+48
-26
pages/answer/index.vue
+48
-26
No files found.
pages/answer/index.vue
View file @
b027b505
...
...
@@ -15,7 +15,7 @@
<answer-card
card-type=
"2"
v-for=
"(val,index) in QuestionList"
:info=
"val"
:key=
"val.questionId"
></answer-card>
</card-container>
<div
class=
"pagination"
>
<pagination
style=
"margin: 0 auto;"
:pages=
"pages"
v-on:listenPageChange=
"changePage"
></pagination>
<pagination
style=
"margin: 0 auto;"
:pages=
"pages"
ref=
"pagination"
v-on:listenPageChange=
"changePage"
></pagination>
</div>
</div>
<div
class=
"answer-container__right"
>
...
...
@@ -73,43 +73,39 @@ export default {
return
{
list
:
[
{
label
:
'
热门推荐
'
,
label
:
'
全部项目
'
,
address
:
'/answer'
,
id
:
'热门推荐
'
type
:
'all
'
},
{
label
:
'职业生涯'
,
address
:
'/answer'
,
id
:
'职业生涯'
},
{
label
:
'项目讨论'
,
address
:
'/answer'
,
id
:
'项目讨论'
},
{
label
:
'职场经验'
,
address
:
'/answer'
,
id
:
'职场经验'
}
],
pages
:
1
,
QuestionList
:[],
labelTitle
:
''
,
}
},
created
()
{
this
.
$router
.
replace
({
path
:
'/answer'
,
query
:
{
id
:
'热门推荐
'
type
:
'all
'
}
});
this
.
getLabelTitle
();
this
.
dataGetQuestionCategory
();
},
computed
:
{
/*
computed: {
labelTitle: function () {
return this.$route.query.id
}
},*/
watch
:{
$route
(){
this
.
restartPagination
();
this
.
dataGetQuestionList
(
1
);
this
.
getLabelTitle
()
}
},
methods
:
{
toRelease
(){
this
.
$router
.
push
(
'/answer/release'
);
...
...
@@ -117,14 +113,40 @@ export default {
search
(){
this
.
$router
.
push
(
'/search/answer'
);
},
restartPagination
(){
if
(
process
.
browser
){
this
.
$refs
.
pagination
.
setCurrentPage
(
1
)
}
},
getLabelTitle
(){
let
type
=
this
.
$route
.
query
.
type
;
this
.
list
.
map
((
val
,
index
)
=>
{
if
(
val
.
type
===
type
){
this
.
labelTitle
=
val
.
label
}
})
},
dataGetQuestionCategory
(){
this
.
$axios
.
$get
(
config
.
api
.
get
.
QuestionCategory
.
list
).
then
((
response
)
=>
{
response
.
data
.
map
((
val
,
index
)
=>
{
this
.
list
.
push
({
label
:
val
.
category
,
address
:
'/answer'
,
type
:
val
.
categoryId
})
})
})
},
dataGetQuestionList
(
currentPage
){
this
.
$axios
.
$get
(
config
.
api
.
get
.
Question
.
list
,{
params
:{
page
:
currentPage
,
size
:
10
,
}
}).
then
((
response
)
=>
{
let
params
=
{
page
:
currentPage
,
size
:
7
};
if
(
this
.
$route
.
query
.
type
&&
this
.
$route
.
query
.
type
!==
'all'
){
params
.
categoryId
=
this
.
$route
.
query
.
type
}
this
.
$axios
.
$get
(
config
.
api
.
get
.
Question
.
list
,{
params
:
params
}).
then
((
response
)
=>
{
this
.
QuestionList
=
response
.
data
.
dataList
;
this
.
pages
=
response
.
data
.
totalPage
;
})
...
...
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