Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
T
techbook
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
front-end-dev
techbook
Commits
548fcb9b
Commit
548fcb9b
authored
May 18, 2020
by
zhangyanni
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
4af60785
6299de14
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
1179 additions
and
45 deletions
+1179
-45
common.scss
public/css/common.scss
+12
-0
PageTop.vue
src/components/index/PageTop.vue
+7
-15
main.js
src/main.js
+1
-1
router.js
src/router.js
+12
-2
api.js
src/views/conmanagementpage/api/api.js
+25
-1
articleservice.vue
src/views/conmanagementpage/articleservice.vue
+1
-2
articlesettings.vue
src/views/conmanagementpage/articlesettings.vue
+28
-20
conmanagement.vue
src/views/conmanagementpage/conmanagement.vue
+1
-0
contentall.vue
src/views/conmanagementpage/contentall.vue
+294
-0
contentarticle.vue
src/views/conmanagementpage/contentarticle.vue
+17
-3
contentdetail.vue
src/views/conmanagementpage/contentdetail.vue
+410
-0
contentdetails.vue
src/views/conmanagementpage/contentdetails.vue
+35
-0
hotarticlepage.vue
src/views/conmanagementpage/hotarticlepage.vue
+190
-0
api.js
src/views/index/api/api.js
+5
-0
index.vue
src/views/index/pages/index.vue
+141
-1
No files found.
public/css/common.scss
View file @
548fcb9b
...
...
@@ -714,6 +714,10 @@ i {
padding
:
30px
0
;
}
}
.dialogWrap640
.el-dialog
{
width
:
640px
!
important
;
}
.dialogWrap500
.el-dialog
{
width
:
500px
;
min-height
:
246px
;
...
...
@@ -1319,6 +1323,14 @@ i {
color
:
#3a3a3a
;
}
//最新资讯
.content_tab
.el-tabs__item
{
color
:
#3F3F53
;
padding
:
0
10px
;
}
//表格
.tableList.el-table
.el-table__header
th
:nth-child
(
1
)
{
padding-left
:
15px
;
...
...
src/components/index/PageTop.vue
View file @
548fcb9b
...
...
@@ -11,14 +11,11 @@
<ul
class=
"navListLi"
>
<li
@
click
.
stop=
"handleClick(index)"
@
mouseenter=
"handleShowChildren(index)"
@
mouseout=
"handleHideChildren(index)"
:class=
"[currentIndex==index?'activeLi':'',
{'relative':index === 3}]"
v-for="(item,index) in list">
{{
$t
(
'topNav.'
+
item
.
name
)
}}
<div
class=
"childrenLi"
v-if=
"isShowChildren && index === 3"
@
mouseleave=
"handleIsHide"
>
<p
@
click=
"handleToIndustryFocus"
>
{{
$t
(
'topNav.professionfocusing'
)
}}
</p>
<p
@
click=
"handleToCase"
>
{{
$t
(
'topNav.cooperationcase'
)
}}
</p>
</div>
<!--
<div
class=
"childrenLi"
v-if=
"isShowChildren && index === 3"
@
mouseleave=
"handleIsHide"
>
-->
<!--
<p
@
click=
"handleToCase"
>
{{
$t
(
'topNav.cooperationcase'
)
}}
</p>
-->
<!--
</div>
-->
</li>
...
...
@@ -180,10 +177,10 @@
name
:
"findCustomer"
},
{
id
:
4
,
name
:
"
industryActiv
e"
name
:
"
newsArticl
e"
},
{
id
:
6
,
name
:
"
useHelp
"
name
:
"
cooperationcase
"
}],
currentIndex
:
this
.
publicFun
.
getCookie
(
"currentNav"
)
==
null
||
this
.
publicFun
.
getCookie
(
"currentNav"
)
==
undefined
||
this
.
publicFun
.
getCookie
(
"currentNav"
)
==
1
||
this
.
publicFun
.
getCookie
(
"currentNav"
)
==
2
?
0
:
this
.
publicFun
.
getCookie
(
"currentNav"
),
lang
:
this
.
$i18n
.
locale
,
...
...
@@ -226,14 +223,9 @@
}
this
.
currentIndex
=
index
;
this
.
publicFun
.
setUserInfoCookie
(
"currentNav"
,
index
);
// if((index==1||index==2)&&!this.userInfo) {
// this.$router.push('/login');
// }
// if(index==5) this.$router.push("/knowledge");
if
(
index
==
4
)
this
.
$router
.
push
(
"/useHelp"
);
if
(
index
==
4
)
this
.
$router
.
push
(
"/successfulcase"
);
if
(
index
==
3
)
this
.
$router
.
push
(
"/contentall"
);
if
(
index
==
0
)
this
.
$router
.
push
(
"/"
);
// if(index==4) this.$router.push("/successfulcase");
// if(index==3) this.$router.push("/lndustryfocus");
if
(
index
==
1
)
this
.
$router
.
push
(
"/seeprojectlist"
);
else
if
(
index
==
2
)
this
.
$router
.
push
(
"/bigBusiness/list"
);
if
(
index
!=
3
){
...
...
src/main.js
View file @
548fcb9b
...
...
@@ -170,7 +170,7 @@ router.beforeEach((to, from, next) => {
if
(
!
publicFun
.
getCookie
(
"userInfo"
)){
if
(
to
.
name
==
'dashboard'
||
to
.
name
==
'indexView'
||
to
.
name
==
'login'
||
to
.
name
==
'mobileLoginCmpt'
||
to
.
name
==
'emailLoginCmpt'
||
to
.
name
==
'mobileRegisterCmpt'
||
to
.
name
==
'emailRegisterCmpt'
||
to
.
name
==
'completeInfoCmpt'
||
to
.
name
==
'successCmpt'
||
to
.
name
==
'findPasswordCmpt'
||
to
.
name
==
'modifyPasswordCmpt'
||
to
.
name
==
'passSuccessCmpt'
||
to
.
name
==
'indexView'
||
to
.
name
==
"mobileIndex"
||
to
.
name
==
"mobileLogin"
||
to
.
name
==
"loginByPhone"
||
to
.
name
==
"loginByEmail"
||
to
.
name
==
"mobileRegister"
||
to
.
name
==
"duijieshareRequire"
||
to
.
name
==
"duijieshareProject"
||
to
.
name
==
"knowledgeList"
||
to
.
name
==
"knowledgeDetail"
||
to
.
name
==
'vip'
||
to
.
name
==
'vipList'
||
to
.
name
==
'loadEmail'
||
to
.
name
==
'openEmail'
||
to
.
name
==
"viewRequire"
||
to
.
name
==
"duijiephoneBusinessList"
||
to
.
name
==
"duijiephoneBusinessDetail"
||
to
.
name
==
"duijiephoneRequireDetail"
||
to
.
name
==
"bigBusinessList"
||
to
.
name
==
"bigBusinessDetail"
||
to
.
name
==
"requireDetail"
||
to
.
name
==
"mixSearch"
||
to
.
name
==
"activitylist"
||
to
.
name
==
"activitydetail"
||
to
.
name
==
"activitySearchResult"
||
to
.
name
==
"activityapplyForProject"
||
to
.
name
==
'wechatLogin'
||
to
.
name
==
'newPage'
||
to
.
name
==
'bindAccount'
||
to
.
name
==
'subjectsecondStage'
||
to
.
name
==
'subjectsecondStageDetail'
||
to
.
name
==
'subjectmasterComment'
||
to
.
name
==
'subjectmasterList'
||
to
.
name
==
'subjectmasterDetail'
||
to
.
name
==
'subjectfirstStage'
||
to
.
name
==
'subjectcommentMore'
||
to
.
name
==
'subjectList'
||
to
.
name
==
"subjectresultpage"
||
to
.
name
==
"mineIndex"
||
to
.
name
==
"subjectStage"
||
to
.
name
==
"articleList"
||
to
.
name
==
"articleDetail"
||
to
.
name
==
"mobileSearch"
){
}
else
{
if
(
to
.
path
==
'/tabconnect'
||
to
.
path
==
'/thirdStage'
||
to
.
path
==
'/questionfill'
||
to
.
path
==
'/questionfillpc'
||
to
.
path
==
'/casedetailschild'
||
to
.
path
==
'/lndustryfocuschild'
||
to
.
path
==
'/successfulcasechild'
||
to
.
path
==
'/projectdetails'
||
to
.
path
==
'/seeprojectlist'
||
to
.
path
==
'/projectlist'
||
to
.
path
==
'/viewproject'
||
to
.
path
==
'/templateMobile1'
||
to
.
path
==
'/knowledge'
||
to
.
path
==
'/knowledgedetails'
||
to
.
path
==
'/termserviceed'
||
to
.
path
==
'/privacypolicyed'
||
to
.
path
==
'/contactused'
||
to
.
path
==
'/aboutused'
||
to
.
path
==
'/casedetailsed'
||
to
.
path
==
'/lndustryfocused'
||
to
.
path
==
'/successfulcaseed'
||
to
.
path
==
'/usehelped'
||
to
.
path
==
'/useHelp'
||
to
.
path
==
'/reminder'
||
to
.
path
==
'/contactus'
||
to
.
path
==
'/privacypolicy'
||
to
.
path
==
'/termservice'
||
to
.
path
==
'/casedetails'
||
to
.
path
==
'/successfulcase'
||
to
.
path
==
'/lndustryfocus'
||
to
.
path
==
'/aboutus'
||
to
.
path
==
'/applicationnotice'
){
if
(
to
.
path
==
'/
contentall'
||
to
.
path
==
'/contentdetail'
||
to
.
path
==
'/
tabconnect'
||
to
.
path
==
'/thirdStage'
||
to
.
path
==
'/questionfill'
||
to
.
path
==
'/questionfillpc'
||
to
.
path
==
'/casedetailschild'
||
to
.
path
==
'/lndustryfocuschild'
||
to
.
path
==
'/successfulcasechild'
||
to
.
path
==
'/projectdetails'
||
to
.
path
==
'/seeprojectlist'
||
to
.
path
==
'/projectlist'
||
to
.
path
==
'/viewproject'
||
to
.
path
==
'/templateMobile1'
||
to
.
path
==
'/knowledge'
||
to
.
path
==
'/knowledgedetails'
||
to
.
path
==
'/termserviceed'
||
to
.
path
==
'/privacypolicyed'
||
to
.
path
==
'/contactused'
||
to
.
path
==
'/aboutused'
||
to
.
path
==
'/casedetailsed'
||
to
.
path
==
'/lndustryfocused'
||
to
.
path
==
'/successfulcaseed'
||
to
.
path
==
'/usehelped'
||
to
.
path
==
'/useHelp'
||
to
.
path
==
'/reminder'
||
to
.
path
==
'/contactus'
||
to
.
path
==
'/privacypolicy'
||
to
.
path
==
'/termservice'
||
to
.
path
==
'/casedetails'
||
to
.
path
==
'/successfulcase'
||
to
.
path
==
'/lndustryfocus'
||
to
.
path
==
'/aboutus'
||
to
.
path
==
'/applicationnotice'
){
}
else
{
if
(
to
.
path
==
'/projectlist'
||
to
.
path
==
'/phoneBusinessList'
){
...
...
src/router.js
View file @
548fcb9b
...
...
@@ -152,6 +152,16 @@ export default new Router({
component
:
resolve
=>
require
([
'views/cooperationcaseview/casedetails.vue'
],
resolve
),
meta
:
{
title
:
'合作案例详情'
}
},
{
path
:
'/contentall'
,
component
:
resolve
=>
require
([
'views/conmanagementpage/contentall.vue'
],
resolve
),
meta
:
{
title
:
'最新资讯'
}
},
{
path
:
'/contentdetail'
,
component
:
resolve
=>
require
([
'views/conmanagementpage/contentdetails.vue'
],
resolve
),
meta
:
{
title
:
'最新资讯详情'
}
},
// {
// path: '/knowledge',
// component: resolve => require(['views/knowledge/computer/computerlist.vue'], resolve),
...
...
@@ -1152,7 +1162,7 @@ export default new Router({
path
:
"/articleList"
,
components
:{
default
:
resolve
=>
require
([
'views/mobile/article/list.vue'
],
resolve
),
other
:
resolve
=>
require
([
'views/
mobile/article/detai
l.vue'
],
resolve
)
other
:
resolve
=>
require
([
'views/
conmanagementpage/contental
l.vue'
],
resolve
)
}
}
...
...
@@ -1184,7 +1194,7 @@ export default new Router({
path
:
"/articleDetail"
,
components
:{
default
:
resolve
=>
require
([
'views/mobile/article/detail.vue'
],
resolve
),
other
:
resolve
=>
require
([
'views/
mobile/article/list
.vue'
],
resolve
)
other
:
resolve
=>
require
([
'views/
conmanagementpage/contentdetails
.vue'
],
resolve
)
}
}
...
...
src/views/conmanagementpage/api/api.js
View file @
548fcb9b
...
...
@@ -159,5 +159,28 @@ export default {
selectContentList
(
params
)
{
return
api
.
fetchPost
(
'/business/content/selectContentList'
,
params
);
},
//热门文章
selectHotContent
()
{
return
api
.
fetchPost
(
'/business/content/selectHotContent'
);
},
//专家推荐
selectProfessorRecommendedContent
()
{
return
api
.
fetchPost
(
'/business/content/selectProfessorRecommendedContent'
);
},
//文章详情
selectContentById
(
params
)
{
return
api
.
fetchPost
(
'/business/content/selectContentById'
,
Qs
.
stringify
(
params
));
},
//查询文章评论
selectContentCommentsList
(
params
)
{
return
api
.
fetchPost
(
'/business/content/selectContentCommentsList'
,
params
);
},
//查询文章评论
addContentComments
(
params
)
{
return
api
.
fetchPost
(
'/business/content/addContentComments'
,
params
);
},
//文章点赞
addOrSubtractHot
(
params
)
{
return
api
.
fetchPost
(
'/business/content/addOrSubtractHot'
,
params
);
},
}
\ No newline at end of file
src/views/conmanagementpage/articleservice.vue
View file @
548fcb9b
...
...
@@ -53,7 +53,7 @@
<span
v-for=
"(item,index) in scope.row.channelList"
:key=
"index"
>
{{
item
}}
<i>
{{
scope
.
row
.
channelList
.
length
-
1
==
index
?
''
:
'、'
}}
</i></span>
</
template
>
</el-table-column>
<el-table-column
prop=
"
publish
Time"
label=
"发布时间"
align=
"center"
>
<el-table-column
prop=
"
created
Time"
label=
"发布时间"
align=
"center"
>
</el-table-column>
<el-table-column
prop=
"empName"
label=
"发布人"
align=
"center"
>
</el-table-column>
...
...
@@ -310,7 +310,6 @@
api
.
markContent
(
params
).
then
(
response
=>
{
if
(
response
.
code
==
0
)
{
this
.
$message
.
success
(
'操作成功'
);
this
.
cur_page
=
1
;
this
.
getsearchContents
();
}
else
{
this
.
$message
.
error
(
response
.
msg
);
...
...
src/views/conmanagementpage/articlesettings.vue
View file @
548fcb9b
...
...
@@ -28,17 +28,19 @@
data
()
{
return
{
value
:
true
,
infoData
:{},
infoData
:{
settingStatementContent
:
''
},
}
},
methods
:
{
getsaveSettingInfo
(){
if
(
this
.
value
){
this
.
infoData
.
isOpenComment
=
1
;
}
else
{
this
.
infoData
.
isOpenComment
=
0
;
}
else
{
this
.
infoData
.
isOpenComment
=
1
;
}
api
.
get
SettingInfo
(
this
.
infoData
).
then
(
response
=>
{
api
.
save
SettingInfo
(
this
.
infoData
).
then
(
response
=>
{
if
(
response
.
code
==
0
)
{
this
.
$message
.
success
(
'保存成功'
);
}
else
{
...
...
@@ -50,24 +52,30 @@
return
false
;
});
},
settingAxios
(){
api
.
getSettingInfo
().
then
(
response
=>
{
if
(
response
.
code
==
0
)
{
if
(
response
.
result
){
this
.
infoData
=
response
.
result
;
if
(
this
.
infoData
.
isOpenComment
==
0
){
this
.
value
=
true
;
}
else
{
this
.
value
=
false
;
}
}
}
else
{
this
.
$message
.
error
(
response
.
msg
);
}
})
.
catch
(
error
=>
{
console
.
log
(
"提交出错"
);
return
false
;
});
},
},
mounted
(){
api
.
getSettingInfo
().
then
(
response
=>
{
if
(
response
.
code
==
0
)
{
this
.
infoData
=
response
.
result
;
if
(
this
.
infoData
.
isOpenComment
==
1
){
this
.
value
=
true
;
}
else
{
this
.
value
=
false
;
}
}
else
{
this
.
$message
.
error
(
response
.
msg
);
}
})
.
catch
(
error
=>
{
console
.
log
(
"提交出错"
);
return
false
;
});
}
}
</
script
>
...
...
src/views/conmanagementpage/conmanagement.vue
View file @
548fcb9b
...
...
@@ -50,6 +50,7 @@
}
else
if
(
tab
.
name
==
'third'
){
this
.
$refs
.
childthree
.
searchContentClassify
();
}
else
if
(
tab
.
name
==
'fourth'
){
this
.
$refs
.
childfour
.
settingAxios
();
}
},
...
...
src/views/conmanagementpage/contentall.vue
0 → 100644
View file @
548fcb9b
<
template
>
<div
class=
"foutdiv"
>
<div
style=
"height: 200px;"
>
<img
src=
"../../assets/img/index/case@2x.png"
alt=
"图片"
style=
"width: 100%;height: 200px;"
>
</div>
<div
class=
"divclasschild"
>
<div
style=
"display: flex;"
>
<div
style=
"width: 100%;margin-right: 30px;"
>
<div
class=
"content_tab"
style=
"position: relative;"
>
<el-tabs
v-model=
"activeName"
@
tab-click=
"handleClick"
>
<el-tab-pane
v-for=
"(item,index) in channelListmax"
:key=
"index"
:label=
"item.channelName"
:name=
"item.channelId+''"
></el-tab-pane>
</el-tabs>
<p
style=
"position: absolute;top: 10px;right: 10px;color: #69697A;font-size: 14px;cursor: pointer;"
@
click=
"allclk"
>
<i
style=
"color: #69697A;font-size: 14px;"
class=
"iconfont icon-gengduo-2"
></i>
全部
</p>
</div>
<ul
class=
"infinite-list contentlist_ul"
v-infinite-scroll=
"load"
infinite-scroll-disabled=
"disabled"
>
<li
v-for=
"(item,index) in contentList"
:key=
"index"
class=
"infinite-list-item contentlist_li"
@
click=
"gocontentdetail(item)"
>
<div
v-if=
"item.contentCoverUrl || item.contentUrl"
>
<div>
<img
:src=
"item.contentCoverUrl?item.contentCoverUrl:item.contentUrl.split(',')[0]?item.contentUrl.split(',')[0]:''"
alt=
"图片"
style=
"border-radius: 3px; border:1px solid #DCDFF1; width: 200px;height: 114px;"
>
</div>
<div>
<div>
<p>
{{
item
.
contentTitle
}}
</p>
<div
class=
"state_code"
>
<p>
<span
style=
"color: #FF5D5D;"
v-if=
"item.codeList && item.codeList.indexOf('CT001') > -1"
>
置顶
</span>
<span
v-if=
"item.contentSourceType == 0"
>
原创
</span>
<span>
{{
item
.
contentBrowseStr
}}
阅读量
</span>
<span>
{{
item
.
publishDateStr
}}
</span>
<span
style=
"background: #F8F8F8;padding: 3px 10px;"
>
{{
item
.
classifyList
[
0
].
classifyName
}}
</span>
</p>
<p>
<i
class=
"iconfont icon-fenxiang"
></i>
</p>
</div>
</div>
</div>
</div>
<el-row
style=
"width: 100%;"
v-else
>
<div
style=
"width: 100%;"
>
<div
style=
"width: 100%;"
>
<p
style=
"font-size: 18px;font-weight: bold;color: #1A1A1E;margin-bottom: 5px;"
>
{{
item
.
contentTitle
}}
</p>
<p
style=
"color: #9197B4;margin-bottom: 20px;"
>
{{
item
.
contentValidity
}}
</p>
</div>
<div
class=
"isstate_code"
>
<p>
<span
style=
"color: #FF5D5D;"
v-if=
"item.codeList && item.codeList.indexOf('CT001') > -1"
>
置顶
</span>
<span
v-if=
"item.contentSourceType == 0"
>
原创
</span>
<span>
{{
item
.
contentBrowseStr
}}
阅读量
</span>
<span>
{{
item
.
publishDateStr
}}
</span>
<span
style=
"background: #F8F8F8;padding: 3px 10px;"
>
{{
item
.
classifyList
[
0
].
classifyName
}}
</span>
</p>
<p>
<i
class=
"iconfont icon-fenxiang"
></i>
</p>
</div>
</div>
</el-row>
</li>
</ul>
<p
style=
"color: #9197B4;margin-top: 40px;"
v-if=
"loading"
>
加载中...
</p>
<p
style=
"color: #9197B4;margin-top: 40px;"
v-if=
"!loading"
>
没有更多了
</p>
</div>
<div
style=
"width: 320px;"
>
<hotArticlepage></hotArticlepage>
</div>
</div>
</div>
<!--新增-->
<el-dialog
title=
"ddddd"
:visible
.
sync=
"expertVisible"
:append-to-body=
"true"
:close-on-click-modal=
"false"
class=
"dialogWrap500 dialogWrap640"
>
<div
style=
"margin: 0 auto;width: 80%;"
>
<el-button
@
click=
"channelel(item)"
v-for=
"(item,index) in channelList"
:key=
"index"
style=
"margin: 10px 0 0 10px"
size=
"mini"
>
{{
item
.
channelName
}}
</el-button>
</div>
</el-dialog>
</div>
</
template
>
<
script
>
import
api
from
"./api/api"
;
import
hotArticlepage
from
'./hotarticlepage'
export
default
{
name
:
"contentall"
,
data
()
{
return
{
activeName
:
''
,
count
:
100
,
channelList
:[],
channelListmax
:[],
cur_page
:
1
,
//页数
totalListResult
:
0
,
numberData
:
10
,
//设置个数
search
:{},
contentList
:[],
loading
:
false
,
pages
:
0
,
expertVisible
:
false
,
}
},
components
:{
hotArticlepage
},
computed
:
{
noMore
()
{
return
this
.
cur_page
==
this
.
pages
},
disabled
()
{
return
this
.
noMore
}
},
methods
:{
//点击全部
allclk
(){
this
.
expertVisible
=
true
;
},
//弹框显示
channelel
(
row
){
this
.
search
.
channelId
=
row
.
channelId
;
this
.
activeName
=
row
.
channelId
+
''
;
this
.
expertVisible
=
false
;
this
.
cur_page
=
1
;
this
.
getselectContentList
();
},
handleClick
(
row
){
this
.
search
.
channelId
=
row
.
name
;
this
.
cur_page
=
1
;
this
.
getselectContentList
();
},
load
()
{
if
(
this
.
cur_page
<=
this
.
pages
){
this
.
cur_page
++
;
this
.
getselectContentList
();
}
},
//频道
selectContentChannelList
(){
api
.
selectContentChannelList
().
then
(
response
=>
{
if
(
response
.
code
==
0
)
{
if
(
response
.
result
.
isRecommendChannel
){
response
.
result
.
baseContentChannelList
.
unshift
({
channelId
:
0
,
channelName
:
'推荐'
,
})
}
this
.
channelList
=
response
.
result
.
baseContentChannelList
;
for
(
let
i
in
this
.
channelList
){
if
(
this
.
channelListmax
.
length
<
9
){
this
.
channelListmax
.
push
(
this
.
channelList
[
i
]);
}
}
this
.
activeName
=
this
.
channelList
[
0
].
channelId
+
''
;
this
.
search
.
channelId
=
this
.
channelList
[
0
].
channelId
;
this
.
getselectContentList
();
}
else
{
this
.
$message
.
error
(
response
.
msg
);
}
})
.
catch
(
error
=>
{
console
.
log
(
"提交出错"
);
return
false
;
});
},
//文章列表
getselectContentList
(){
let
params
=
{
pagination
:
{
number
:
this
.
numberData
,
start
:
0
,
numberOfPages
:
this
.
cur_page
||
1
,
totalItemCount
:
0
},
search
:
this
.
search
,
};
this
.
loading
=
true
;
api
.
selectContentList
(
params
).
then
(
response
=>
{
if
(
response
.
code
==
0
)
{
if
(
this
.
cur_page
==
1
){
this
.
contentList
=
response
.
result
.
records
;
}
else
{
for
(
let
i
in
response
.
result
.
records
){
this
.
contentList
.
push
(
response
.
result
.
records
[
i
]);
}
}
this
.
pages
=
response
.
result
.
pages
;
this
.
totalListResult
=
response
.
result
.
total
;
this
.
loading
=
false
;
}
else
{
this
.
$message
.
error
(
response
.
msgCode
);
}
})
.
catch
(
error
=>
{
console
.
log
(
"提交出错"
);
return
false
;
});
},
//文章详情
gocontentdetail
(
row
){
this
.
$router
.
push
({
path
:
"/contentdetail"
,
query
:{
id
:
row
.
contentId
}});
},
},
mounted
()
{
this
.
selectContentChannelList
();
}
}
</
script
>
<
style
scoped
lang=
"scss"
>
.foutdiv
{
padding
:
60px
0
;
min-height
:
600px
;
background
:
#ffffff
;
}
.foutdivchild
{
min-height
:
600px
;
background
:
#ffffff
;
}
.divclasschild
{
margin
:
35px
120px
0
;
}
.contentlist_ul
{
>
li
:nth-child
(
1
)
{
>
div
{
padding
:
10px
0
25px
0
;
}
}
}
.state_code
{
display
:
flex
;
>
p
{
position
:
absolute
;
bottom
:
0px
;
color
:
#AAAAAA
;
>
span
{
margin-right
:
15px
;
}
}
>
p
:nth-child
(
1
)
{
left
:
0px
;
}
>
p
:nth-child
(
2
)
{
right
:
30px
;
}
}
.isstate_code
{
display
:
flex
;
>
p
{
color
:
#AAAAAA
;
>
span
{
margin-right
:
15px
;
}
}
>
p
:nth-child
(
1
)
{
width
:
100%
;
}
>
p
:nth-child
(
2
)
{
width
:
50px
;
}
}
.contentlist_li
{
border-bottom
:
1px
solid
#E9EAF3
;
>
div
{
width
:
100%
;
display
:
flex
;
padding
:
25px
0
;
>
div
:nth-child
(
1
)
{
text-align
:
left
;
}
>
div
:nth-child
(
2
)
{
width
:
100%
;
>
div
{
text-align
:
left
;
position
:
relative
;
height
:
110px
;
margin-left
:
30px
;
>
p
{
font-size
:
18px
;
font-weight
:
bold
;
color
:
#1A1A1E
;
padding-top
:
5px
;
}
}
}
}
}
</
style
>
\ No newline at end of file
src/views/conmanagementpage/contentarticle.vue
View file @
548fcb9b
...
...
@@ -47,7 +47,7 @@
<div
v-show=
"false"
v-html=
"contentDiv"
id=
"content1"
></div>
</el-form-item>
<el-form-item
label=
"活动封面:"
prop=
"contentCoverUrl"
ref=
"formimg"
style=
"width: 100%;"
>
<el-checkbox
@
change=
"coverchange(formData.firstPic)"
v-model=
"formData.firstPic"
>
选取文中图片作为封面图
</el-checkbox>
<el-checkbox
@
change=
"coverchange(formData.firstPic)"
v-model=
"formData.firstPic
==1?true:false
"
>
选取文中图片作为封面图
</el-checkbox>
<p
class=
"imgTitle"
>
封面图只支持PNG、JPG、jpeg格式,最大支持400K;建议图片尺寸500x400
</p>
<div
class=
"uploadImg"
>
<up-img
:actionUrl=
"'/base/upload/uploadOriginalImg'"
@
dataEvent=
"uploadimg"
:channelPic=
"formData.contentCoverUrl"
:upmax=
"0.4"
></up-img>
...
...
@@ -224,7 +224,7 @@
</el-form>
<el-row
style=
"padding-top: 20px;text-align: center"
>
<el-button
type=
"primary"
@
click=
"addexpert"
>
保存
</el-button>
<el-button
@
click=
"
expert
Visible = false"
>
取 消
</el-button>
<el-button
@
click=
"
add
Visible = false"
>
取 消
</el-button>
</el-row>
</el-dialog>
...
...
@@ -254,7 +254,7 @@
channelIds
:[],
classifyIds
:[],
contentChoose
:[],
firstPic
:
true
,
firstPic
:
1
,
isCover
:
0
,
isOpenComment
:
0
,
dataKeywordList
:[],
...
...
@@ -330,6 +330,19 @@
this
.
$message
.
error
(
'请输入文章来源'
)
return
}
//
if
(
this
.
$route
.
query
.
contentId
){
if
(
this
.
formData
.
isRecommended
==
1
&&
!
this
.
formData
.
contentProfessor
){
this
.
$message
.
error
(
'请选择专家'
)
return
}
}
else
{
if
(
this
.
formData
.
isRecommended
==
1
&&
!
this
.
objfessorData
.
empName
){
this
.
$message
.
error
(
'请选择专家'
)
return
}
}
if
(
this
.
formData
.
keywordList
&&
this
.
formData
.
contentLabels
){
if
(
this
.
formData
.
keywordList
.
length
+
this
.
formData
.
contentLabels
.
length
>
10
){
this
.
$message
.
error
(
'标签最多10个'
)
...
...
@@ -567,6 +580,7 @@
recommendedchange
(
val
){
if
(
val
==
0
){
this
.
objfessorData
=
{};
this
.
formData
.
contentProfessor
=
null
;
}
},
//添加专家
...
...
src/views/conmanagementpage/contentdetail.vue
0 → 100644
View file @
548fcb9b
<
template
>
<div
class=
"foutdiv"
>
<div
class=
"divclasschild"
style=
"display: flex"
>
<div
style=
"width: 100%;margin-right: 30px;"
>
<div>
<h2
style=
"color:#1A1A1E;line-height: 40px;margin-bottom: 40px;"
>
{{
contentData
.
contentTitle
}}
</h2>
<p
class=
"rolespan"
>
<span
v-if=
"contentData.contentSourceType == 0"
style=
"color:#FF5D5D;"
>
原创
</span>
<span>
{{
contentData
.
publishDateStr
}}
</span>
<span>
{{
contentData
.
contentBrowseStr
}}
阅读量
</span>
<span
v-if=
"contentData.isRecommended == 1&&contentData.professorList>0"
>
推荐人:
<span
v-if=
"contentData.professorList&&contentData.professorList[0]"
>
<img
v-if=
"contentData.professorList[0].empLogo"
:src=
"contentData.professorList[0].empLogo"
style=
"border-radius: 50%; border:1px solid #DCDFF1; width: 30px;height: 30px;"
>
</span>
{{
contentData
.
professorList
[
0
].
empName
}}
</span>
</p>
<div
v-html=
"contentData.contentDetail"
style=
"padding-top: 20px;"
></div>
<div
style=
"display: flex;padding: 30px 0;"
>
<div
style=
"width: 100%;"
>
<p
v-if=
"contentData.contentSource"
>
来源:
{{
contentData
.
contentSource
}}
</p>
<p
v-if=
"contentData.originalUrl"
>
来源地址:
{{
contentData
.
originalUrl
}}
</p>
</div>
<div
style=
"width: 100px;"
class=
"content_hotStr"
>
<p
@
click=
"getaddOrSubtractHot(false)"
><i
style=
"color:#9197B4;"
class=
"iconfont icon-zan1"
></i>
{{
contentData
.
contentHotStr
}}
</p>
</div>
</div>
<div
class=
"statement"
v-if=
"settingStatementContent"
>
<p>
免责声明:
</p>
{{
settingStatementContent
}}
</div>
<div
class=
"content_right"
>
<p><span>
</span>
评论
<i>
(
{{
totalStrdto
.
totalStr
}}
)
</i></p>
<div>
<div
style=
"width: 50px;"
>
<img
v-if=
"contentData.contentCoverUrl"
:src=
"contentData.contentCoverUrl"
>
<img
v-else
src=
"../../assets/img/defaultlogo.png"
>
</div>
<div
style=
"width: 100%;margin-left: 20px;position: relative;"
>
<el-input
type=
"textarea"
:rows=
"6"
placeholder=
"写下您的评论"
maxlength=
"1000"
resize=
"none"
v-model=
"textarea"
></el-input>
<el-button
style=
"position: absolute;right: 5px;bottom: 5px;"
type=
"primary"
size=
"small"
@
click=
"comments(contentData,true)"
>
发布评论
</el-button>
</div>
</div>
<div
v-for=
"(item,index) in commentsList"
:key=
"index"
>
<div
style=
"width: 50px;"
>
<div
style=
"position: relative;"
>
<img
v-if=
"item.empLogo"
:src=
"item.empLogo"
style=
"border-radius: 50%; border:1px solid #DCDFF1; width: 50px;height: 50px;"
>
<img
v-else
src=
"../../assets/img/defaultlogo.png"
style=
"border-radius: 50%; border:1px solid #DCDFF1; width: 50px;height: 50px;"
>
<img
v-if=
"item.isProfessor==1"
src=
"../../assets/img/proFeedBack/vip.png"
alt=
""
style=
"position: absolute;right: 0px;bottom: 0px;width: 15px;"
>
</div>
</div>
<div
class=
"paragraph"
>
<p>
{{
item
.
empName
}}
</p>
<p
v-html=
"analyzeEmoji(item.commentsContent)"
>
{{
item
.
commentsContent
}}
</p>
<div
class=
"comments_content"
v-if=
"item.childFirstList&&item.childFirstList.length>0"
>
<p
v-for=
"(items,index) in item.childFirstList"
style=
"line-height: 28px;"
@
click=
"clkreply(item),childuser=items"
>
<i
v-if=
"items.commentsReplyId"
>
<span
style=
"color:#5D78FF;"
>
{{
items
.
nickName
}}
<i
style=
"color:#3F3F53;padding: 0 3px;"
>
回复
</i>
</span>
<span
style=
"color:#5D78FF;"
>
{{
items
.
replyNickName
}}
:
</span>
</i>
<i
@
click=
"clkreply(item),childuser=items"
v-else
>
<span
style=
"color:#5D78FF;"
>
{{
items
.
nickName
}}
:
</span>
</i>
<span
v-html=
"analyzeEmoji(items.commentsContent)"
>
{{
items
.
commentsContent
}}
</span>
</p>
</div>
<div
style=
"width: 100%;position: relative;margin-bottom: 20px;"
v-if=
"item.isreply"
>
<el-input
type=
"textarea"
:rows=
"6"
placeholder=
"写下您回复的内容"
maxlength=
"1000"
resize=
"none"
v-model=
"usertextarea"
></el-input>
<el-button
style=
"position: absolute;right: 5px;bottom: 5px;"
type=
"primary"
size=
"small"
@
click=
"comments(item)"
>
回复
</el-button>
</div>
<div
class=
"operation"
>
<p>
{{
item
.
createdTimeStr
}}
</p>
<p>
<span><i
class=
"iconfont icon-guzhangtousu"
></i>
举报
</span>
<span
style=
"margin: 0 30px;"
@
click=
"clkreply(item,true)"
><i
class=
"iconfont icon-pinglun"
></i>
评论
</span>
<span
@
click=
"getaddOrSubtractHot(item)"
><i
class=
"iconfont icon-zan1"
></i>
{{
item
.
likeNumber
==
0
?
'赞'
:
item
.
likeNumber
}}
</span>
</p>
</div>
</div>
</div>
<div
@
click=
"totalStrdto.pages==cur_page||totalStrdto.pages==0?'':addclkreply()"
>
<p
class=
"addclkreply"
>
<span
v-if=
"totalStrdto.pages==cur_page||totalStrdto.pages==0"
>
暂无更多评论
</span>
<span
v-else
>
查看更多评论
<i
style=
"color: #5D78FF;"
class=
"iconfont icon-xiala"
></i></span>
</p>
</div>
</div>
</div>
</div>
<div
style=
"width: 320px;"
>
<hotArticlepage></hotArticlepage>
</div>
</div>
</div>
</
template
>
<
script
>
import
api
from
"./api/api"
;
import
hotArticlepage
from
"./hotarticlepage"
;
export
default
{
name
:
"contentdetail"
,
components
:{
hotArticlepage
},
data
()
{
return
{
contentData
:{
baseContentSetting
:{},
},
textarea
:
''
,
usertextarea
:
''
,
cur_page
:
1
,
//页数
totalListResult
:
0
,
numberData
:
10
,
//设置个数
commentsList
:[],
childuser
:
null
,
totalStrdto
:{
totalStr
:
0
},
settingStatementContent
:
null
,
}
},
methods
:{
//文章内容
selectContentById
(){
api
.
selectContentById
({
contentId
:
this
.
$route
.
query
.
id
}).
then
(
response
=>
{
if
(
response
.
code
==
0
)
{
this
.
contentData
=
response
.
result
;
if
(
response
.
result
.
baseContentSetting
.
settingStatementContent
){
this
.
settingStatementContent
=
response
.
result
.
baseContentSetting
.
settingStatementContent
;
}
}
else
{
this
.
$message
.
error
(
response
.
msg
);
}
})
.
catch
(
error
=>
{
console
.
log
(
"提交出错"
);
return
false
;
});
},
//文章点赞
getaddOrSubtractHot
(
row
){
let
params
=
{
contentId
:
this
.
$route
.
query
.
id
,
addOrSubtractHot
:
row
?
!
row
.
isHasHot
:
!
this
.
contentData
.
isHasHot
,
commentsId
:
row
.
id
?
row
.
id
:
undefined
,
};
api
.
addOrSubtractHot
(
params
).
then
(
response
=>
{
if
(
response
.
code
==
0
)
{
if
(
row
){
row
.
likeNumber
=
response
.
result
;
row
.
isHasHot
=
!
row
.
isHasHot
;
}
else
{
this
.
selectContentById
();
}
}
else
{
this
.
$message
.
error
(
response
.
msg
);
}
})
.
catch
(
error
=>
{
console
.
log
(
"提交出错"
);
return
false
;
});
},
// 评论翻页
addclkreply
(){
++
this
.
cur_page
this
.
getselectContentCommentsList
();
},
//评论
getselectContentCommentsList
(){
let
params
=
{
pagination
:
{
number
:
this
.
numberData
,
start
:
0
,
numberOfPages
:
this
.
cur_page
||
1
,
totalItemCount
:
0
},
search
:
{
contentId
:
this
.
$route
.
query
.
id
},
sort
:
{}
};
api
.
selectContentCommentsList
(
params
).
then
(
response
=>
{
if
(
response
.
code
==
0
)
{
if
(
this
.
cur_page
==
1
){
this
.
commentsList
=
[];
}
response
.
result
.
records
.
forEach
((
item
)
=>
{
item
.
isreply
=
false
;
});
this
.
totalStrdto
=
response
.
result
;
if
(
response
.
result
.
records
){
for
(
let
i
in
response
.
result
.
records
){
this
.
commentsList
.
push
(
response
.
result
.
records
[
i
]);
}
}
}
else
{
this
.
$message
.
error
(
response
.
msg
);
}
})
.
catch
(
error
=>
{
console
.
log
(
"提交出错"
);
return
false
;
});
},
//回复评论
clkreply
(
row
){
this
.
commentsList
.
forEach
((
item
)
=>
{
item
.
isreply
=
false
;
});
row
.
isreply
=
true
;
},
//回复
comments
(
row
,
state
){
let
params
=
{};
if
(
state
){
params
=
{
commentsContent
:
this
.
textarea
,
contentId
:
this
.
$route
.
query
.
id
,
};
}
else
{
if
(
this
.
childuser
){
params
=
{
commentsContent
:
this
.
usertextarea
,
contentId
:
row
.
contentId
,
id
:
row
.
id
,
commentsReplyId
:
this
.
childuser
.
id
,
replyBy
:
this
.
childuser
.
createdBy
,
};
}
else
{
params
=
{
commentsContent
:
this
.
usertextarea
,
contentId
:
row
.
contentId
,
id
:
row
.
id
,
commentsReplyId
:
row
.
commentsReplyId
,
};
}
}
api
.
addContentComments
(
params
).
then
(
response
=>
{
if
(
response
.
code
==
0
)
{
this
.
childuser
=
null
;
this
.
textarea
=
''
;
this
.
usertextarea
=
''
;
this
.
cur_page
=
1
;
this
.
getselectContentCommentsList
();
}
else
{
this
.
$message
.
error
(
response
.
msgCode
);
}
})
.
catch
(
error
=>
{
console
.
log
(
"提交出错"
);
return
false
;
});
},
//转义表情
analyzeEmoji
:
function
(
cont
){
//编译表情替换成图片展示出来
var
pattern1
=
/
\[[\u
4e00-
\u
9fa5
]
+
\]
/g
;
var
pattern2
=
/
\[[\u
4e00-
\u
9fa5
]
+
\]
/
;
var
content
=
cont
.
match
(
pattern1
);
var
str
=
cont
;
if
(
content
){
for
(
var
i
=
0
;
i
<
content
.
length
;
i
++
){
for
(
var
j
=
0
;
j
<
this
.
publicFun
.
OwOlist
.
length
;
j
++
){
if
(
"["
+
this
.
publicFun
.
OwOlist
[
j
].
title
+
"]"
==
content
[
i
]){
var
src
=
this
.
publicFun
.
OwOlist
[
j
].
url
;
break
;
}
}
var
s
=
require
(
"../../assets/img/face/"
+
src
)
var
imoj
=
"<img src='"
+
s
+
"' style='margin:0 .02rem;width: 22px;height: 22px;'/>"
str
=
str
.
replace
(
pattern2
,
imoj
);
}
}
return
str
;
},
},
mounted
()
{
this
.
selectContentById
();
this
.
getselectContentCommentsList
();
}
}
</
script
>
<
style
scoped
lang=
"scss"
>
.content_right
{
text-align
:
left
;
>
p
{
line-height
:
48px
;
color
:
#3F3F53
;
font-size
:
16px
;
font-weight
:
bold
;
border-bottom
:
1px
solid
#E8EAF3
;
>
span
{
border-left
:
2px
solid
#5D78FF
;
margin-right
:
10px
;
}
>
i
{
line-height
:
48px
;
color
:
#69697A
;
font-size
:
14px
;
}
}
}
.foutdiv
{
padding
:
60px
0
;
min-height
:
600px
;
background
:
#ffffff
;
text-align
:
left
;
}
.divclasschild
{
margin
:
35px
120px
0
;
}
.rolespan
{
border-bottom
:
1px
solid
#E8EAF3
;
padding-bottom
:
25px
;
>
span
{
margin-right
:
20px
;
}
}
.content_hotStr
{
>
p
{
background
:
#F0F1F6
;
text-align
:
center
;
padding
:
5px
10px
;
color
:
#9197B4
;
border-radius
:
3px
;
cursor
:
pointer
;
}
}
.statement
{
border-radius
:
3px
;
border
:
1px
solid
#E8EAF3
;
padding
:
15px
;
line-height
:
26px
;
margin-bottom
:
30px
;
}
.content_right
{
>
div
{
display
:
flex
;
margin
:
20px
0
;
>
div
{
>
img
{
border-radius
:
50%
;
border
:
1px
solid
#DCDFF1
;
width
:
50px
;
height
:
50px
;
}
}
}
}
.comments_content
{
background
:
#F6F6F6
;
width
:
100%
;
padding
:
20px
;
font-size
:
12px
;
margin-bottom
:
20px
;
}
.paragraph
{
width
:
100%
;
margin-left
:
20px
;
position
:
relative
;
border-bottom
:
1px
solid
#E9EAF3
;
padding-bottom
:
20px
;
>
p
:nth-child
(
1
)
{
line-height
:
20px
;
margin-bottom
:
10px
;
color
:
#3F3F53
;
}
>
p
:nth-child
(
2
)
{
line-height
:
24px
;
margin-bottom
:
15px
;
color
:
#3F3F53
;
}
}
.operation
{
width
:
100%
;
display
:
flex
;
color
:
#9197B4
;
>
p
:nth-child
(
1
)
{
width
:
50%
;
text-align
:
left
;
}
>
p
:nth-child
(
2
)
{
width
:
50%
;
text-align
:
right
;
>
span
{
cursor
:
pointer
;
}
}
}
.addclkreply
{
width
:
100%
;
background
:
#F0F1F6
;
line-height
:
40px
;
text-align
:
center
;
font-weight
:
normal
;
cursor
:
pointer
;
>
span
{
color
:
#5D78FF
;
}
}
</
style
>
\ No newline at end of file
src/views/conmanagementpage/contentdetails.vue
0 → 100644
View file @
548fcb9b
<
template
>
<div>
<contentdetail
v-if=
'showNum/2 === 0'
:key=
'showNum'
></contentdetail>
<contentdetail
v-else
:key=
'showNum'
></contentdetail>
</div>
</
template
>
<
script
>
import
contentdetail
from
'./contentdetail'
;
export
default
{
name
:
"projectrelease"
,
components
:
{
contentdetail
},
data
()
{
return
{
showNum
:
2
}
},
methods
:{
fetchData
(){
++
this
.
showNum
}
},
watch
:
{
// 监听路由变化,当路由发生变化的时候,重新加载子组件,通过v-if来判断,记得加key值,这样vue就会重新渲染页面
'$route'
:
'fetchData'
}
}
</
script
>
<
style
scoped
>
</
style
>
\ No newline at end of file
src/views/conmanagementpage/hotarticlepage.vue
0 → 100644
View file @
548fcb9b
<
template
>
<div>
<div
class=
"content_right"
>
<p><span>
</span>
热门文章
</p>
<div
class=
"hto_content"
>
<div
style=
"cursor: pointer;"
v-for=
"(item,index) in hotlist"
:key=
"index"
@
click=
"gocontent(item)"
>
<p><img
:src=
"item.contentCoverUrl?item.contentCoverUrl:item.contentUrl.split(',')[0]?item.contentUrl.split(',')[0]:''"
alt=
"图片"
></p>
<p>
{{
item
.
contentTitle
}}
</p>
</div>
</div>
</div>
<div
class=
"content_right"
>
<p><span>
</span>
专家推荐
</p>
<div
class=
"content_view0"
v-if=
"isview == 0"
>
<ul>
<li
style=
"cursor: pointer;"
v-for=
"(item,index) in recommendedlist"
:key=
"index"
@
click=
"gocontent(item)"
>
{{
item
.
contentTitle
}}
</li>
</ul>
</div>
<div
class=
"content_view2 content_view1"
v-if=
"isview == 1"
>
<div>
<p
style=
"cursor: pointer;"
v-if=
"index == 0"
v-for=
"(item,index) in recommendedlist"
:key=
"index"
@
click=
"gocontent(item)"
>
<img
style=
"width: 320px;height: 180px;"
:src=
"item.contentCoverUrl"
>
<span>
{{
item
.
contentTitle
}}
</span>
</p>
</div>
<div
class=
"content_view0"
>
<ul>
<li
style=
"cursor: pointer;"
v-if=
"index > 0"
v-for=
"(item,index) in recommendedlist"
:key=
"index"
@
click=
"gocontent(item)"
>
{{
item
.
contentTitle
}}
</li>
</ul>
</div>
</div>
<div
class=
"content_view2"
v-if=
"isview == 2"
>
<div>
<p
style=
"cursor: pointer;"
v-if=
"index
<
=
1
"
v-for=
"(item,index) in recommendedlist"
:key=
"index"
@
click=
"gocontent(item)"
>
<img
:src=
"item.contentCoverUrl"
>
<span>
{{
item
.
contentTitle
}}
</span>
</p>
</div>
<div
class=
"content_view0"
>
<ul>
<li
style=
"cursor: pointer;"
v-if=
"index >= 1"
v-for=
"(item,index) in recommendedlist"
:key=
"index"
@
click=
"gocontent(item)"
>
{{
item
.
contentTitle
}}
</li>
</ul>
</div>
</div>
</div>
</div>
</
template
>
<
script
>
import
api
from
"./api/api"
;
export
default
{
name
:
"hotarticlepage"
,
data
()
{
return
{
hotlist
:[],
recommendedlist
:[],
isview
:
0
,
}
},
methods
:{
getselectHotContent
(){
api
.
selectHotContent
().
then
(
response
=>
{
if
(
response
.
code
==
0
)
{
this
.
hotlist
=
response
.
result
;
}
else
{
this
.
$message
.
error
(
response
.
msgCode
);
}
})
.
catch
(
error
=>
{
console
.
log
(
"提交出错"
);
return
false
;
});
},
selectProfessorRecommendedContent
(){
api
.
selectProfessorRecommendedContent
().
then
(
response
=>
{
if
(
response
.
code
==
0
)
{
let
num
=
0
;
for
(
let
i
in
response
.
result
){
if
(
response
.
result
[
i
].
contentCoverUrl
||
response
.
result
[
i
].
contentUrl
){
this
.
recommendedlist
.
push
(
response
.
result
[
i
]);
num
++
}
else
{
this
.
recommendedlist
.
push
(
response
.
result
[
i
]);
}
};
if
(
num
==
1
){
this
.
isview
=
1
;
}
else
if
(
num
>=
2
){
this
.
isview
=
2
;
}
else
if
(
num
==
0
){
this
.
isview
=
0
;
}
}
else
{
this
.
$message
.
error
(
response
.
msgCode
);
}
})
.
catch
(
error
=>
{
console
.
log
(
"提交出错"
);
return
false
;
});
},
gocontent
(
row
){
this
.
$router
.
push
({
path
:
"/contentdetail"
,
query
:{
id
:
row
.
contentId
}});
},
},
mounted
()
{
this
.
getselectHotContent
();
this
.
selectProfessorRecommendedContent
();
}
}
</
script
>
<
style
scoped
lang=
"scss"
>
.content_right
{
width
:
320px
;
text-align
:
left
;
>
p
{
line-height
:
38px
;
color
:
#3F3F53
;
font-size
:
16px
;
font-weight
:
bold
;
border-bottom
:
2px
solid
#E8EAF3
;
>
span
{
border-left
:
2px
solid
#5D78FF
;
margin-right
:
10px
;
}
}
}
.hto_content
{
>
div
{
display
:
flex
;
margin
:
20px
0
;
>
p
:nth-child
(
1
)
{
margin-right
:
15px
;
>
img
{
border-radius
:
3px
;
border
:
1px
solid
#DCDFF1
;
width
:
80px
;
height
:
56px
;
}
}
>
p
{
font-size
:
14px
;
color
:
#1A1A1E
;
line-height
:
24px
;
}
}
}
.content_view0
{
margin
:
10px
0
10px
30px
;
>
ul
{
>
li
{
color
:
#1A1A1E
;
line-height
:
24px
;
list-style
:
disc
;
font-size
:
14px
;
}
}
}
.content_view2
{
>
div
:nth-child
(
1
)
{
display
:
flex
;
padding-top
:
20px
;
>
p
{
position
:
relative
;
>
img
{
border-radius
:
3px
;
border
:
1px
solid
#DCDFF1
;
width
:
150px
;
height
:
85px
;
}
>
span
{
position
:
absolute
;
left
:
0
;
bottom
:
0px
;
width
:
100%
;
line-height
:
24px
;
padding-left
:
5px
;
color
:
#FFFFFF
;
background
:rgba
(
0
,
0
,
0
,
0
.5
)
;
}
}
>
p
:nth-child
(
1
)
{
margin-right
:
20px
;
}
}
}
</
style
>
\ No newline at end of file
src/views/index/api/api.js
View file @
548fcb9b
...
...
@@ -7,6 +7,11 @@ export default {
return
api
.
fetchGet
(
baseUrl
+
"/index/getIndexCount"
);
},
//获取首页推荐文章信息
getIndexTopNArticle
(
params
){
return
api
.
fetchGet
(
baseUrl
+
"/index/getIndexTopNArticle?count="
+
params
);
},
//获取首页推荐公司展示信息
getCompanyInfoAxios
(
params
){
return
api
.
fetchGet
(
baseUrl
+
"/index/getIndexTopNBusiness"
);
...
...
src/views/index/pages/index.vue
View file @
548fcb9b
...
...
@@ -78,6 +78,58 @@
</div>
</div>
<div
class=
"tabWrapper"
>
<div
class=
"topUpdateTitle"
>
<h4>
{{
$t
(
"topNav.newsArticle"
)
}}
</h4>
<div
class=
"borderBottom40px"
></div>
<span
class=
"lookmoreBtn"
@
click=
"handleMore(6)"
>
{{
$t
(
"indexCount.lookMore"
)
}}
>
</span>
</div>
<div>
<ul
class=
"contentlist_ul"
>
<li
class=
"contentlist_li"
v-for=
"(item,index) in articleList"
:key=
"index"
@
click=
"gocontentdetail(item)"
>
<div
v-if=
"item.contentCoverUrl || item.contentUrl"
>
<div>
<img
:src=
"item.contentCoverUrl?item.contentCoverUrl:item.contentUrl.split(',')[0]?item.contentUrl.split(',')[0]:''"
alt=
"图片"
style=
"border-radius: 3px; border:1px solid #DCDFF1; width: 200px;height: 114px;"
>
</div>
<div>
<div>
<p>
{{
item
.
contentTitle
}}
</p>
<div
class=
"state_code"
>
<p>
<span
style=
"color: #FF5D5D;"
v-if=
"item.codeList && item.codeList.indexOf('CT001') > -1"
>
置顶
</span>
<span
v-if=
"item.contentSourceType == 0"
>
原创
</span>
<span>
{{
item
.
contentBrowseStr
}}
阅读量
</span>
<span>
{{
item
.
publishDateStr
}}
</span>
<span
style=
"background: #F8F8F8;padding: 3px 10px;"
>
{{
item
.
classifyList
[
0
].
classifyName
}}
</span>
</p>
</div>
</div>
</div>
</div>
<el-row
style=
"width: 100%;"
v-else
>
<div
style=
"width: 100%;"
>
<div
style=
"width: 100%;"
>
<p
style=
"font-size: 18px;font-weight: bold;color: #1A1A1E;margin-bottom: 5px;"
>
{{
item
.
contentTitle
}}
</p>
<p
style=
"color: #9197B4;margin-bottom: 20px;"
>
{{
item
.
contentValidity
}}
</p>
</div>
<div
class=
"isstate_code"
>
<p>
<span
style=
"color: #FF5D5D;"
v-if=
"item.codeList && item.codeList.indexOf('CT001') > -1"
>
置顶
</span>
<span
v-if=
"item.contentSourceType == 0"
>
原创
</span>
<span>
{{
item
.
contentBrowseStr
}}
阅读量
</span>
<span>
{{
item
.
publishDateStr
}}
</span>
<span
style=
"background: #F8F8F8;padding: 3px 10px;"
>
{{
item
.
classifyList
[
0
].
classifyName
}}
</span>
</p>
</div>
</div>
</el-row>
</li>
</ul>
</div>
</div>
<div
class=
"tabWrapper"
>
<div
class=
"topUpdateTitle"
>
<h4>
{{
$t
(
"indexCount.businessRequire"
)
}}
</h4>
...
...
@@ -358,6 +410,7 @@
projectInfo
:[],
companyInfo
:[],
caseInfo
:[],
articleList
:[],
lang
:
this
.
$i18n
.
locale
==
"zh-CN"
?
1
:
2
,
friendlyLink
:[{
id
:
1
,
...
...
@@ -378,7 +431,10 @@
};
},
methods
:
{
//文章详情
gocontentdetail
(
row
){
this
.
$router
.
push
({
path
:
"/contentdetail"
,
query
:{
id
:
row
.
contentId
}});
},
//去详情
handleRowClick
(
data
){
this
.
$router
.
push
({
path
:
"/bigBusiness/detail"
,
query
:{
id
:
data
.
businessId
}})
...
...
@@ -437,6 +493,19 @@
})
},
//获取推荐文章
getIndexTopNArticle
(){
api
.
getIndexTopNArticle
(
4
).
then
((
res
)
=>
{
if
(
res
.
code
==
0
){
this
.
articleList
=
res
.
result
;
}
else
{
that
.
$message
.
error
(
res
.
msg
);
}
}).
catch
((
err
)
=>
{
that
.
$message
.
error
(
err
);
})
},
//获取推荐项目
getProjectInfoData
(){
let
that
=
this
;
...
...
@@ -539,6 +608,7 @@
//查看更多
handleMore
(
data
){
if
(
data
==
1
)
this
.
$router
.
push
(
"/bigBusiness/list"
);
else
if
(
data
==
6
)
this
.
$router
.
push
(
"/contentall"
);
else
if
(
data
==
2
)
this
.
$router
.
push
(
"/seeprojectlist"
);
else
{
globalMsg
.
$emit
(
'sendIndex'
,
4
);
...
...
@@ -571,6 +641,7 @@
this
.
getCountData
();
this
.
getActiveInfoData
();
this
.
getBusinessInfoData
();
this
.
getIndexTopNArticle
();
// this.getCaseData();
}
}
...
...
@@ -846,4 +917,73 @@
}
}
}
.contentlist_ul
{
text-align
:
left
;
display
:
flex
;
flex-wrap
:
wrap
;
>
li
{
width
:
50%
;
cursor
:
pointer
;
}
}
.contentlist_li
{
>
div
{
width
:
100%
;
display
:
flex
;
padding
:
25px
0
;
>
div
:nth-child
(
1
)
{
text-align
:
left
;
}
>
div
:nth-child
(
2
)
{
width
:
100%
;
>
div
{
text-align
:
left
;
position
:
relative
;
height
:
110px
;
margin-left
:
30px
;
>
p
{
font-size
:
18px
;
font-weight
:
bold
;
color
:
#1A1A1E
;
padding-top
:
5px
;
}
}
}
}
}
.state_code
{
display
:
flex
;
>
p
{
position
:
absolute
;
bottom
:
0px
;
color
:
#AAAAAA
;
>
span
{
margin-right
:
15px
;
}
}
>
p
:nth-child
(
1
)
{
left
:
0px
;
}
>
p
:nth-child
(
2
)
{
right
:
30px
;
}
}
.isstate_code
{
display
:
flex
;
>
p
{
color
:
#AAAAAA
;
>
span
{
margin-right
:
15px
;
}
}
>
p
:nth-child
(
1
)
{
width
:
100%
;
}
>
p
:nth-child
(
2
)
{
width
:
50px
;
}
}
</
style
>
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