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
9cb531d5
Commit
9cb531d5
authored
Feb 08, 2020
by
yanju
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'xue' into 'master'
接口修改 See merge request pigbigbig/beyond-clouds-front!32
parents
b588fe03
26df8161
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
82 additions
and
36 deletions
+82
-36
components/pc/projectCard.vue
+2
-1
pages/blog/index.vue
+22
-15
pages/blog/release/index.vue
+31
-11
pages/project/index.vue
+27
-9
No files found.
components/pc/projectCard.vue
View file @
9cb531d5
...
...
@@ -249,7 +249,8 @@
.project-card__right
{
margin-left
:
12
*$
length
;
img{
max-width
:
280
*$
length
;
max-width
:
150
*$
length
;
max-height
:
93
*$
length
;
border-radius
:
4
*$
length
;
height
:
auto
;
@extend
%animate-transition;
...
...
pages/blog/index.vue
View file @
9cb531d5
...
...
@@ -14,11 +14,11 @@
:title=
"labelTitle"
>
<
project-card
v-for=
"(val,index) in blogList"
:info=
"val"
></project
-card>
<
blog-card
v-for=
"(val,index) in blogList"
:key=
"val.blogId"
:info=
"val"
></blog
-card>
</card-container>
<div
class=
"pagination"
>
<pagination
style=
"margin: 0 auto;"
pages=
"13
"
v-on:listenPageChange=
"changePage"
></pagination>
<pagination
style=
"margin: 0 auto;"
:pages=
"pages
"
v-on:listenPageChange=
"changePage"
></pagination>
</div>
</div>
<div
class=
"blog-container__right"
>
...
...
@@ -45,26 +45,20 @@
<
script
>
import
NavWrap
from
"../../components/pc/nav/navWrap"
;
import
CardContainer
from
"../../components/pc/cardContainer"
;
import
ProjectCard
from
"../../components/pc/projectCard"
;
import
Pagination
from
"../../components/pc/pagination"
;
import
config
from
'../../action/config'
;
import
BlogCard
from
"../../components/pc/projectCard"
;
export
default
{
async
asyncData
({
$axios
})
{
const
blogList
=
await
$axios
.
$get
(
config
.
api
.
get
.
Blog
.
list
,{
params
:{
page
:
1
,
size
:
6
,
}
});
return
{
blogList
:
blogList
.
data
.
dataList
}
},
components
:
{
Pagination
,
ProjectCard
,
CardContainer
,
NavWrap
},
components
:
{
Pagination
,
CardContainer
,
NavWrap
,
BlogCard
},
data
(){
return
{
blogList
:[],
currentPage
:
1
,
pages
:
1
,
list
:
[
{
label
:
'全部类型'
,
address
:
'/blog'
,
...
...
@@ -108,11 +102,24 @@ export default {
},
methods
:
{
dataGetBlogList
(
currentPage
){
this
.
$axios
.
$get
(
config
.
api
.
get
.
Blog
.
list
,{
params
:{
page
:
currentPage
,
size
:
7
,
}
}).
then
((
response
)
=>
{
this
.
blogList
=
response
.
data
.
dataList
;
this
.
pages
=
response
.
data
.
totalPage
;
})
},
toRelease
(){
this
.
$router
.
push
(
'/blog/release'
)
},
changePage
(
currentPage
){
//返回页数 请求新的数据
this
.
dataGetBlogList
(
currentPage
)
}
}
}
...
...
pages/blog/release/index.vue
View file @
9cb531d5
...
...
@@ -8,7 +8,7 @@
>
<div
class=
"blog-release_List"
v-for=
"val in blogList"
:key=
"val.blogId"
:info=
"val"
>
<div
style=
"width: 60%"
><p
@
click=
"toDetail"
>
{{
val
.
blogTitle
}}
</p></div>
<
p
@
click=
"toDetail"
style=
"color: #999999"
>
{{
val
.
category
}}
</p
>
<
div
class=
"blog-release_List_r"
@
click=
"toDetail"
>
{{
val
.
category
}}
</div
>
</div>
</card-container>
<card-container
...
...
@@ -104,7 +104,7 @@
<div
class=
"blog-release__footer"
>
<p
class=
"footer__left"
>
上传封面
<img
:src=
"imgSrc"
alt=
""
>
<input
type=
"file"
@
change=
"
e=>changeToUploadCover(e)"
placeholder=
"上传项目封面图
"
>
<input
type=
"file"
@
change=
"
changeToUploadCover(e)"
placeholder=
"上传项目封面图"
accept=
"image/png,image/gif,image/jpeg
"
>
</p>
<div
class=
"footer__right"
>
<p>
已自动存为草稿
</p>
...
...
@@ -127,7 +127,7 @@
const
blogList
=
await
$axios
.
$get
(
config
.
api
.
get
.
Blog
.
myList
,{
params
:{
page
:
1
,
size
:
8
,
size
:
12
,
}
});
...
...
@@ -136,7 +136,6 @@
components
:
{
SelectCard
,
CardContainer
},
data
()
{
return
{
markdownOption
:
{
bold
:
true
,
// 粗体
italic
:
true
,
// 斜体
...
...
@@ -174,6 +173,8 @@
imgSrc
:
''
,
lastSaveTime
:
new
Date
(),
blogClass
:
''
,
originLink
:
''
,
blogAbstract
:
''
,
questionClass
:
''
,
classList
:
[
'web'
,
'java'
,
'javascript'
]
}
...
...
@@ -223,10 +224,21 @@
viewPrivileges
:
this
.
way
//1公开,0私有
}).
then
((
response
)
=>
{
//处理response
console
.
log
(
response
)
if
(
response
.
code
===
0
)
{
this
.
$message
({
type
:
'success'
,
message
:
'提交成功!'
});
}
else
{
this
.
$message
({
message
:
"提交失败 "
+
response
.
data
.
errMsg
,
type
:
'error'
})
}
})
},
imgAdd
(
pos
,
file
)
{
//添加图片,pos为位置
// 第一步.将图片上传到服务器.
...
...
@@ -243,6 +255,7 @@
* $vm 指为mavonEditor实例,可以通过如下两种方式获取
* 1. 通过引入对象获取: `import {mavonEditor} from ...` 等方式引入后,`$vm`为`mavonEditor`
* 2. 通过$refs获取: html声明ref : `<mavon-editor ref=md ></mavon-editor>,`$vm`为 `this.$refs.md`
*
*/
$vm
.
$img2Url
(
pos
,
url
);
})
...
...
@@ -251,6 +264,10 @@
console
.
log
(
pos
);
console
.
log
(
url
);
},
changeToUploadCover
(
e
){
console
.
log
(
e
);
this
.
imgSrc
=
'http://i1.sinaimg.cn/ent/d/2008-06-04/U105P28T3D2048907F326DT20080604225106.jpg'
;
},
save
()
{
//保存文章内容
},
...
...
@@ -260,14 +277,13 @@
this
.
lastSaveTime
=
now
;
}
},
changeToUploadCover
(
e
){
console
.
log
(
e
);
this
.
imgSrc
=
'http://i1.sinaimg.cn/ent/d/2008-06-04/U105P28T3D2048907F326DT20080604225106.jpg'
;
},
readScreen
(
boolean
,
str
){
// 预览
this
.
zIndex
=
8000
}
}
},
}
</
script
>
...
...
@@ -290,11 +306,15 @@
white-space
:
nowrap
;
text-overflow
:
ellipsis
;
}
.blog-release_List_r
{
color
:
#999999
}
:hover
{
color
:
#00AAE6
;
cursor
:
pointer
}
}
}
.blog-release-container__r
{
.blog-release
{
...
...
pages/project/index.vue
View file @
9cb531d5
...
...
@@ -14,12 +14,12 @@
:title=
"labelTitle"
>
<project-card
v-for=
"(val,index) in projectList"
:info=
"val"
></project-card>
<project-card
v-for=
"(val,index) in projectList"
:
key=
"val.projectId"
:
info=
"val"
></project-card>
</card-container>
<div
class=
"pagination"
>
<pagination
style=
"margin: 0 auto;"
pages=
"13
"
v-on:listenPageChange=
"changePage"
></pagination>
<pagination
style=
"margin: 0 auto;"
:pages=
"pages
"
v-on:listenPageChange=
"changePage"
></pagination>
</div>
</div>
<div
class=
"project-container__right"
>
...
...
@@ -54,18 +54,18 @@ import config from '../../action/config';
export
default
{
async
asyncData
({
$axios
})
{
/*
async asyncData ({ $axios }) {
const projectList = await $axios.$get(config.api.get.Project.list,{
params:{
page
:
1
,
page:
currentpage
,
size:6,
}
});
return
{
projectList
:
projectList
.
data
.
dataList
}
},
return {projectList:projectList.data.dataList,pages:projectList.data.totalPage}
},*/
components
:
{
Pagination
,
ProjectCard
,
CardContainer
,
NavWrap
},
data
(){
...
...
@@ -132,7 +132,10 @@ export default {
}
]
}
]
],
projectList
:[],
currentPage
:
1
,
pages
:
1
,
}
},
created
()
{
...
...
@@ -157,9 +160,24 @@ export default {
toRelease
(){
this
.
$router
.
push
(
'/project/release'
)
},
dataGetProjectList
(
currentPage
){
this
.
$axios
.
$get
(
config
.
api
.
get
.
Project
.
list
,{
params
:{
page
:
currentPage
,
size
:
7
}
}).
then
((
response
)
=>
{
this
.
projectList
=
response
.
data
.
dataList
;
this
.
pages
=
response
.
data
.
totalPage
;
})
},
changePage
(
currentPage
){
//返回页数 请求新的数据
}
this
.
dataGetProjectList
(
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