Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
beyond-clouds-frontM
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
云深项目组
beyond-clouds-frontM
Commits
f7539dec
Commit
f7539dec
authored
Mar 23, 2020
by
高浩杰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完成他人主页的展示
parent
88b46689
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
265 additions
and
21 deletions
+265
-21
components/moblie/nav.vue
+1
-1
pages/u/_id/_select.vue
+264
-20
No files found.
components/moblie/nav.vue
View file @
f7539dec
...
...
@@ -16,7 +16,7 @@
:height-v=
"96"
:flex-v=
"['row','flex-start','flex-start']"
:font-style=
"[28,36,400,'#999','left']"
:extend-style=
"
{overflowX: 'scroll'}"
:extend-style=
"
{overflowX: 'scroll'
, marginRight: showRight ? 0 : commonReturnFlexedLength(40)
}"
>
<yun-div
:no-flex-shrink=
"true"
...
...
pages/u/_id/_select.vue
View file @
f7539dec
...
...
@@ -3,11 +3,43 @@
<yun-div
:margin-v=
"[0,0,20]"
>
<user-card-big></user-card-big>
</yun-div>
<Nav
:show-right=
"false"
:nav-list=
"navList"
:path=
"path"
></Nav>
<project-card></project-card>
<project-card></project-card>
<project-card></project-card>
<project-card></project-card>
<Nav
:show-right=
"false"
:nav-list=
"navList"
></Nav>
<yun-div
v-if=
"rightList.length > 0"
>
<yun-div
v-if=
"selected==='blog'|| selected ==='project'"
>
<project-card
v-for=
"(val,index) in rightList"
:info=
"val"
:key=
"val.contentId"
></project-card>
</yun-div>
<yun-div
v-else-if=
"selected==='answer'|| selected ==='myReply'"
>
<answer-card
v-for=
"(val,index) in rightList"
:info=
"val"
:key=
"val.questionId"
></answer-card>
</yun-div>
<yun-div
v-else-if=
"selected==='dynamic'"
>
<dynamic-card
v-for=
"(val,index) in rightList"
:key=
"val.postId"
:info=
"val"
></dynamic-card>
</yun-div>
<yun-div
v-else-if=
"selected==='topic'"
>
<topic-card></topic-card>
</yun-div>
<yun-div
v-if=
"selected==='following' || selected === 'fans'"
>
<user-card-x
v-for=
"(val,index) in rightList"
:info=
"val"
:key=
"val.userId"
></user-card-x>
</yun-div>
<scroll-loading
ref=
"pagination"
:pages=
"pages"
v-on:changePage=
"changePage"
></scroll-loading>
</yun-div>
<empty-card
v-else
></empty-card>
</yun-div>
</
template
>
...
...
@@ -16,49 +48,261 @@ import UserCardBig from "../../../components/moblie/userCardBig";
import
commonMixin
from
"../../../components/moblie/commonMixin"
;
import
Nav
from
"../../../components/moblie/nav"
;
import
ProjectCard
from
"../../../components/moblie/projectCard"
;
import
ScrollLoading
from
"../../../components/moblie/scrollLoading"
;
import
EmptyCard
from
"../../../components/moblie/emptyCard"
;
import
AnswerCard
from
'../../../components/moblie/answerCard'
import
DynamicCard
from
'../../../components/moblie/dynamicCard'
import
config
from
"../../../action/config"
;
import
TopicCard
from
"../../../components/moblie/topicCard"
;
import
UserCardX
from
"../../../components/moblie/userCardX"
;
export
default
{
mixins
:
[
commonMixin
],
components
:
{
ProjectCard
,
Nav
,
UserCardBig
},
components
:
{
UserCardX
,
TopicCard
,
EmptyCard
,
ProjectCard
,
Nav
,
UserCardBig
,
ScrollLoading
,
AnswerCard
,
DynamicCard
},
async
asyncData
({
$axios
,
params
})
{
//获取他人的资料
let
infoResponse
=
await
$axios
.
$get
(
config
.
api
.
get
.
User
.
otherInfo
+
params
.
id
+
'/baseinfo'
);
return
{
...
infoResponse
.
data
}
},
data
()
{
return
{
// 获取用户id
id
:
12
,
number
:
32
id
:
0
,
rightList
:
[],
pages
:
1
,
selected
:
''
}
},
computed
:
{
navList
:
function
()
{
return
[
{
label
:
`项目·
${
this
.
number
}
`
,
id
:
'project'
label
:
`项目 ·
${
this
.
statistics
.
projectNum
}
`
,
path
:
`/u/
${
this
.
id
}
/project`
},
{
label
:
`博客 ·
${
this
.
statistics
.
blogNum
}
`
,
path
:
`/u/
${
this
.
id
}
/blog`
},
{
label
:
`提问 ·
${
this
.
statistics
.
questionNum
}
`
,
path
:
`/u/
${
this
.
id
}
/answer`
},
{
label
:
`
博客·
${
this
.
number
}
`
,
id
:
'blog'
label
:
`
回答 ·
${
this
.
statistics
.
questionReplyNum
}
`
,
path
:
`/u/
${
this
.
id
}
/myReply`
},
{
label
:
`
提问·
${
this
.
number
}
`
,
id
:
'answer'
label
:
`
动态
`
,
path
:
`/u/
${
this
.
id
}
/dynamic`
},
{
label
:
`
回答·
${
this
.
number
}
`
,
id
:
'myAnswer'
label
:
`
话题
`
,
path
:
`/u/
${
this
.
id
}
/topic`
},
{
label
:
`
动态·
${
this
.
number
}
`
,
id
:
'dynamic'
label
:
`
关注 ·
${
this
.
statistics
.
followedNum
}
`
,
path
:
`/u/
${
this
.
id
}
/following`
},
{
label
:
`
话题·
${
this
.
number
}
`
,
id
:
'topic'
label
:
`
粉丝 ·
${
this
.
statistics
.
fansNum
}
`
,
path
:
`/u/
${
this
.
id
}
/fans`
},
]
},
path
:
function
()
{
return
`/u/
${
this
.
id
}
`
}
},
watch
:
{
$route
(
val
){
this
.
selected
=
this
.
$route
.
params
.
select
;
this
.
restartPagination
();
},
},
created
()
{
this
.
selected
=
this
.
$route
.
params
.
select
;
this
.
id
=
this
.
$route
.
params
.
id
this
.
changePage
(
1
)
},
methods
:
{
restartPagination
(){
if
(
process
.
browser
){
this
.
rightList
=
[];
this
.
pages
=
1
;
this
.
$refs
.
pagination
.
setCurrentPage
(
1
)
}
},
handleResponse
(
currentPage
,
response
){
if
(
currentPage
===
1
){
this
.
rightList
=
response
.
data
.
dataList
;
this
.
pages
=
response
.
data
.
totalPage
;
}
else
{
response
.
data
.
dataList
.
map
((
val
,
index
)
=>
{
this
.
rightList
.
push
(
val
)
});
this
.
pages
=
response
.
data
.
totalPage
;
}
},
//获取动态list
dataGetDynamic
(
currentPage
){
let
userId
=
this
.
$route
.
params
.
id
;
this
.
$axios
.
$get
(
config
.
api
.
get
.
Post
.
otherList
+
userId
+
'/posts'
,
{
params
:
{
page
:
currentPage
,
size
:
10
}
}).
then
((
response
)
=>
{
console
.
log
(
response
);
this
.
handleResponse
(
currentPage
,
response
)
})
},
//获取创建的问题list
dataGetMyCreateAnswer
(
currentPage
){
if
(
this
.
statistics
.
questionNum
===
0
)
return
;
let
userId
=
this
.
$route
.
params
.
id
;
this
.
$axios
.
$get
(
config
.
api
.
get
.
Question
.
otherCreated
+
userId
+
'/questions'
,{
params
:{
page
:
currentPage
,
size
:
10
}
}).
then
((
response
)
=>
{
console
.
log
(
response
);
this
.
handleResponse
(
currentPage
,
response
)
})
},
//获取回答的问题list
dataGetNoticeAnswer
(
currentPage
){
if
(
this
.
statistics
.
questionReplyNum
===
0
)
return
;
let
userId
=
this
.
$route
.
params
.
id
;
this
.
$axios
.
$get
(
config
.
api
.
get
.
Question
.
otherParticipated
+
userId
+
'/question/participated'
,{
params
:{
page
:
currentPage
,
size
:
10
}
}).
then
((
response
)
=>
{
console
.
log
(
response
);
this
.
handleResponse
(
currentPage
,
response
)
})
},
//获取我的项目list
dataGetProject
(
currentPage
){
if
(
this
.
statistics
.
projectNum
===
0
)
return
;
let
userId
=
this
.
$route
.
params
.
id
;
this
.
$axios
.
$get
(
config
.
api
.
get
.
Project
.
otherList
+
userId
+
'/projects'
,
{
params
:
{
page
:
currentPage
,
size
:
10
}
}).
then
((
response
)
=>
{
console
.
log
(
response
);
this
.
handleResponse
(
currentPage
,
response
)
})
},
//获取我的博客list
dataGetBlog
(
currentPage
){
if
(
this
.
statistics
.
blogNum
===
0
)
return
;
let
userId
=
this
.
$route
.
params
.
id
;
this
.
$axios
.
$get
(
config
.
api
.
get
.
Blog
.
otherList
+
userId
+
'/blogs'
,
{
params
:
{
page
:
currentPage
,
size
:
10
}
}).
then
((
response
)
=>
{
console
.
log
(
response
);
this
.
handleResponse
(
currentPage
,
response
)
})
},
dataGetMyAnswer
(
currentPage
){
this
.
$axios
.
$get
(
config
.
api
.
get
.
Question
.
myCreated
,{
params
:{
page
:
currentPage
,
size
:
10
}
}).
then
((
response
)
=>
{
console
.
log
(
response
);
this
.
handleResponse
(
currentPage
,
response
)
})
},
//获取他人的粉丝
dataGetFans
(
currentPage
){
let
userId
=
this
.
$route
.
params
.
id
;
this
.
$axios
.
$get
(
config
.
api
.
get
.
User
.
otherFans
+
userId
+
'/fans'
,{
params
:{
page
:
currentPage
,
size
:
10
}
}).
then
((
response
)
=>
{
if
(
response
.
code
===
0
){
console
.
log
(
response
);
this
.
handleResponse
(
currentPage
,
response
)
}
})
},
//获取他人的关注
dataGetFollowing
(
currentPage
){
let
userId
=
this
.
$route
.
params
.
id
;
this
.
$axios
.
$get
(
config
.
api
.
get
.
User
.
otherFollowing
+
userId
+
'/follower'
,{
params
:{
page
:
currentPage
,
size
:
10
}
}).
then
((
response
)
=>
{
if
(
response
.
code
===
0
){
console
.
log
(
response
);
this
.
handleResponse
(
currentPage
,
response
)
}
})
},
changePage
(
currentPage
){
//返回页数 请求新的数据
if
(
this
.
selected
===
'project'
){
this
.
dataGetProject
(
currentPage
)
}
if
(
this
.
selected
===
'blog'
){
this
.
dataGetBlog
(
currentPage
)
}
if
(
this
.
selected
===
'myReply'
)
{
this
.
dataGetNoticeAnswer
(
currentPage
)
}
if
(
this
.
selected
===
'answer'
){
this
.
dataGetMyCreateAnswer
(
currentPage
)
}
if
(
this
.
selected
===
'dynamic'
){
this
.
dataGetDynamic
(
currentPage
)
}
if
(
this
.
selected
===
'fans'
){
this
.
dataGetFans
(
currentPage
)
}
if
(
this
.
selected
===
'following'
){
this
.
dataGetFollowing
(
currentPage
)
}
}
},
}
</
script
>
...
...
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