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
23123278
Commit
23123278
authored
Mar 25, 2020
by
yanju
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'xue' into 'master'
话题详情完成 See merge request
!32
parents
64881725
32eb0eef
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
296 additions
and
69 deletions
+296
-69
components/moblie/dataCard.vue
+136
-69
pages/topic/detail/_id.vue
+160
-0
No files found.
components/moblie/dataCard.vue
View file @
23123278
<
template
>
<
template
>
<yun-div
:width-v=
"750"
:height-v=
"100"
:padding-v=
"[34,0,40]"
:margin-v=
"[0,'auto']"
bg-color-v=
"#fff"
:paddingV =
[paddingL]
:extend-style=
"
{boxSizing:'border-box'}"
:flex-v="['row','space-between','center']"
slot="card"
>
<yun-div
<yun-div
:
width-v=
"75
0"
:
ske-w=
"12
0"
:
height-v=
"100
"
:
font-style=
"[30,36,400,'black','left']
"
:padding-v=
"[34,0,40]"
>
:margin-v=
"[0,'auto']"
{{
title
}}
bg-color-v=
"#fff"
</yun-div>
:paddingV =
[paddingL]
<yun-div
:
extend-style=
"
{boxSizing:'border-box'}
"
:
ske-w=
"100
"
:f
lex-v="['row','space-between','center
']"
:f
ont-style=
"[30,36,400,'#999999','left
']"
slot="card
"
:flex-v=
"['row','flex-start','center']
"
>
>
<yun-div
<yun-div
:ske-w=
"120"
v-if=
"cardType===1"
:font-style=
"[30,36,400,'black','left']"
:no-wrap=
"true"
:extend-style=
"
{maxWidth: commonReturnFlexedLength(450)}"
>
>
{{
title
}}
{{
right
}}
</yun-div>
</yun-div>
<yun-div
<yun-div
:ske-w=
"100"
v-if=
"cardType===3"
:font-style=
"[30,36,400,'#999999','left']"
:width-v=
"32"
:flex-v=
"['row','flex-start','center']"
:height-v=
"32"
:border-r=
"['50%']"
:show-ske=
"false"
bg-color-v=
"#FF4A4A"
:font-style=
"[20,36,400,'white','left']"
:flex-v=
"['row','center','center']"
>
>
<yun-div
{{
right
}}
v-if=
"cardType===1"
:no-wrap=
"true"
:extend-style=
"
{maxWidth: commonReturnFlexedLength(450)}"
>
{{
right
}}
</yun-div>
<yun-div
v-if=
"cardType===3"
:width-v=
"32"
:height-v=
"32"
:border-r=
"['50%']"
:show-ske=
"false"
bg-color-v=
"#FF4A4A"
:font-style=
"[20,36,400,'white','left']"
:flex-v=
"['row','center','center']"
>
{{
right
}}
</yun-div>
<yun-img
v-if=
"cardType===2"
:width-v=
"66"
:height-v=
"66"
:ske-h=
"66"
:ske-w=
"66"
:border-r=
"[50,50,50,50]"
:src=
userAvatar
>
</yun-img>
<yun-icon
:style=
"
{marginLeft:commonReturnFlexedLength(15)}"
name="left_arrow"
v-tap="dataChange"
>
</yun-icon>
</yun-div>
</yun-div>
<!--修改信息弹出框-->
<yun-img
<yun-dialog
v-if=
"cardType===2"
v-if=
"this.change"
:width-v=
"66"
title=
"修改"
:height-v=
"66"
:value=
"true"
:ske-h=
"66"
:btns=
"slotDialog.btns"
:ske-w=
"66"
:border-r=
"[50,50,50,50]"
:src=
userAvatar
>
>
<yun-div
</yun-img>
<yun-icon
:style=
"
{marginLeft:commonReturnFlexedLength(15)}"
name="left_arrow"
v-tap="dataChange"
>
</yun-icon>
</yun-div>
<!--修改信息弹出框-->
<yun-dialog
v-if=
"this.change"
title=
"修改"
:value=
"true"
:btns=
"slotDialog.btns"
>
<yun-div
:width-v=
"464"
:margin-v=
"[0,'auto']"
slot=
"header"
>
<yun-input
:width-v=
"464"
:width-v=
"464"
:margin-v=
"[0,'auto']"
:height-v=
"72"
slot=
"header"
>
:border-v=
"[6]"
<yun-input
:width-v=
"464"
:height-v=
"72"
:border-v=
"[6]"
placeholder=
"输入新昵称"
:show-icon=
"false"
>
</yun-input>
</yun-div>
</yun-dialog>
</yun-div>
:show-icon=
"false"
v-model=
"public"
>
</yun-input>
</yun-div>
</yun-dialog>
</yun-div>
...
@@ -102,7 +103,9 @@
...
@@ -102,7 +103,9 @@
},
},
data
(){
data
(){
return
{
return
{
public
:
''
,
change
:
false
,
change
:
false
,
rightNow
:
''
,
slotDialog
:
{
slotDialog
:
{
open
:
true
,
open
:
true
,
btns
:
[
btns
:
[
...
@@ -114,6 +117,14 @@
...
@@ -114,6 +117,14 @@
handler
:
this
.
dataPostRemarks
,
handler
:
this
.
dataPostRemarks
,
},
},
],
],
gender
:
''
,
mobile
:
''
,
email
:
''
,
signature
:
''
,
nickName
:
null
,
qqNumber
:
null
,
wxNumber
:
null
,
birthday
:
''
,
},
},
}
}
...
@@ -121,8 +132,64 @@
...
@@ -121,8 +132,64 @@
methods
:{
methods
:{
dataChange
(){
dataChange
(){
this
.
change
=
true
;
this
.
change
=
true
;
this
.
rightNow
=
this
.
right
;
console
.
log
(
this
.
rightNow
);
},
dataPostRemarks
()
{
if
(
this
.
title
===
"昵称"
)
{
this
.
$axios
.
$put
(
config
.
api
.
put
.
User
.
reviseInfo
,
{
nickName
:
this
.
public
}).
then
((
response
)
=>
{
this
.
$message
({
type
:
'success'
,
message
:
'修改成功'
})
})
}
if
(
this
.
title
===
"生日"
)
{
this
.
$axios
.
$put
(
config
.
api
.
put
.
User
.
reviseInfo
,
{
birthday
:
this
.
public
}).
then
((
response
)
=>
{
this
.
$message
({
type
:
'success'
,
message
:
'修改成功'
})
})
}
if
(
this
.
title
===
"QQ号"
)
{
this
.
$axios
.
$put
(
config
.
api
.
put
.
User
.
reviseInfo
,
{
qqNumber
:
this
.
public
}).
then
((
response
)
=>
{
this
.
$message
({
type
:
'success'
,
message
:
'修改成功'
})
})
}
if
(
this
.
title
===
"微信号"
)
{
this
.
$axios
.
$put
(
config
.
api
.
put
.
User
.
reviseInfo
,
{
wxNumber
:
this
.
public
}).
then
((
response
)
=>
{
this
.
$message
({
type
:
'success'
,
message
:
'修改成功'
})
})
}
if
(
this
.
title
===
"手机号"
)
{
this
.
$axios
.
$put
(
config
.
api
.
put
.
User
.
reviseInfo
,
{
wxNumber
:
this
.
public
}).
then
((
response
)
=>
{
this
.
$message
({
type
:
'success'
,
message
:
'修改成功'
})
})
}
}
}
}
}
}
}
...
...
pages/topic/detail/_id.vue
View file @
23123278
<
template
>
<
template
>
<yun-div>
<topic-card
:info=
"detail"
></topic-card>
<Nav
:show-right=
"false"
:path=
"path"
:nav-list=
"navList"
></Nav>
<dynamic-card
v-for=
"(val,index) in postList"
:key=
"val.postId"
:info=
"val"
></dynamic-card>
<scroll-loading
ref=
"pagination"
:pages=
"pages"
v-on:changePage=
"changePage"
></scroll-loading>
</yun-div>
</
template
>
</
template
>
<
script
>
<
script
>
import
topicCard
from
'../../../components/moblie/topicCard'
;
import
Nav
from
'../../../components/moblie/nav'
;
import
config
from
'../../../action/config'
;
import
dynamicCard
from
'../../../components/moblie/dynamicCard'
;
import
ScrollLoading
from
'../../../components/moblie/scrollLoading'
;
export
default
{
export
default
{
async
asyncData
({
$axios
,
params
}){
let
detail
=
await
$axios
.
$get
(
config
.
api
.
get
.
Topic
.
detail
+
params
.
id
);
return
{
detail
:
detail
.
data
}
},
data
(){
return
{
path
:
`/topic/detail/
${
this
.
$route
.
params
.
id
}
`
,
navList
:
[
{
label
:
'最新'
,
id
:
'new'
},
{
label
:
'推荐'
,
id
:
'recommends'
},
{
label
:
'文字'
,
id
:
'word'
},
{
label
:
'视频'
,
id
:
'video'
},
{
label
:
'图片'
,
id
:
'picture'
}
],
detail
:{},
postList
:[],
name
:
''
,
pages
:
1
,
}
},
components
:{
topicCard
,
Nav
,
dynamicCard
,
ScrollLoading
},
created
()
{
this
.
id
=
this
.
$route
.
params
.
id
;
if
(
this
.
$route
.
query
.
type
)
{
}
else
{
this
.
$router
.
replace
({
path
:
`/topic/detail/
${
this
.
id
}
`
,
query
:
{
type
:
'new'
}
})
}
},
watch
:{
$route
(
val
){
if
(
val
.
query
.
type
)
{
}
else
{
this
.
$router
.
replace
({
path
:
`/topic/detail/
${
this
.
id
}
`
,
query
:
{
type
:
'new'
}
})
}
this
.
restartPagination
();
}
},
methods
:{
restartPagination
(){
if
(
process
.
browser
){
this
.
postList
=
[];
this
.
pages
=
1
;
this
.
$refs
.
pagination
.
setCurrentPage
(
1
)
}
},
handleResponse
(
currentPage
,
response
){
if
(
currentPage
===
1
){
this
.
postList
=
response
.
data
.
dataList
;
this
.
pages
=
response
.
data
.
totalPage
;
}
else
{
response
.
data
.
dataList
.
map
((
val
,
index
)
=>
{
this
.
postList
.
push
(
val
)
});
this
.
pages
=
response
.
data
.
totalPage
;
}
},
dataGetDynamicList
(
currentPage
){
let
params
=
{
page
:
currentPage
,
size
:
12
};
if
(
this
.
$route
.
query
.
type
&&
this
.
$route
.
query
.
type
===
'new'
)
{
this
.
$axios
.
$get
(
config
.
api
.
get
.
Topic
.
postList
+
this
.
detail
.
topicName
+
'/posts'
,
{
params
:
params
}).
then
((
response
)
=>
{
console
.
log
(
response
);
this
.
handleResponse
(
currentPage
,
response
)
})
}
if
(
this
.
$route
.
query
.
type
&&
this
.
$route
.
query
.
type
===
'recommends'
){
this
.
$axios
.
$get
(
config
.
api
.
get
.
Topic
.
recommendsPost
+
this
.
detail
.
topicName
+
'/post/recommends'
,{
params
:
params
}).
then
((
response
)
=>
{
this
.
handleResponse
(
currentPage
,
response
)
})
}
if
(
this
.
$route
.
query
.
type
&&
this
.
$route
.
query
.
type
===
'word'
)
{
params
.
type
=
0
;
this
.
$axios
.
$get
(
config
.
api
.
get
.
Topic
.
postList
+
this
.
detail
.
topicName
+
'/posts'
,
{
params
:
params
}).
then
((
response
)
=>
{
this
.
handleResponse
(
currentPage
,
response
)
})
}
if
(
this
.
$route
.
query
.
type
&&
this
.
$route
.
query
.
type
===
'video'
)
{
params
.
type
=
1
;
this
.
$axios
.
$get
(
config
.
api
.
get
.
Topic
.
postList
+
this
.
detail
.
topicName
+
'/posts'
,
{
params
:
params
}).
then
((
response
)
=>
{
this
.
handleResponse
(
currentPage
,
response
)
})
}
if
(
this
.
$route
.
query
.
type
&&
this
.
$route
.
query
.
type
===
'picture'
)
{
params
.
type
=
2
;
this
.
$axios
.
$get
(
config
.
api
.
get
.
Topic
.
postList
+
this
.
detail
.
topicName
+
'/posts'
,
{
params
:
params
}).
then
((
response
)
=>
{
this
.
handleResponse
(
currentPage
,
response
)
})
}
},
changePage
(
currentPage
){
//返回页数 请求新的数据
this
.
dataGetDynamicList
(
currentPage
)
},
}
}
}
</
script
>
</
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