Commit 26ed7262 authored by anxixi's avatar anxixi

文章开发

parent 9d4ede8b
......@@ -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;
......
......@@ -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: "industryActive"
name: "newsArticle"
}, {
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){
......
......@@ -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/detail.vue'],resolve)
other:resolve=>require(['views/conmanagementpage/contentall.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)
}
}
......
......@@ -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
......@@ -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);
......
......@@ -28,7 +28,9 @@
data() {
return {
value:true,
infoData:{},
infoData:{
settingStatementContent:''
},
}
},
methods: {
......@@ -38,7 +40,7 @@
}else{
this.infoData.isOpenComment = 0;
}
api.getSettingInfo(this.infoData).then(response => {
api.saveSettingInfo(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 == 1){
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>
......
......@@ -50,6 +50,7 @@
}else if(tab.name == 'third'){
this.$refs.childthree.searchContentClassify();
}else if(tab.name == 'fourth'){
this.$refs.childfour.settingAxios();
}
},
......
This diff is collapsed.
......@@ -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="expertVisible = false">取 消</el-button>
<el-button @click="addVisible = 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;
}
},
//添加专家
......
This diff is collapsed.
<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
<template>
<div>
<div class="content_right">
<p><span>&nbsp;</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>&nbsp;</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
......@@ -7,6 +7,11 @@ export default {
return api.fetchGet(baseUrl+"/index/getIndexCount");
},
//获取首页推荐文章信息
getIndexTopNArticle(params){
return api.fetchGet(baseUrl+"/index/getIndexTopNArticle");
},
//获取首页推荐公司展示信息
getCompanyInfoAxios(params){
return api.fetchGet(baseUrl+"/index/getIndexTopNBusiness");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment