|
@@ -24,8 +24,11 @@ var app = new Vue({
|
|
|
columnList: [],
|
|
|
currentPath: '',
|
|
|
articalArray: [], //详情数组
|
|
|
+ articalArrayRelated: [], //相关新闻
|
|
|
columnTypes: [], //栏目类型
|
|
|
|
|
|
+
|
|
|
+
|
|
|
// 公共弹框
|
|
|
centerDialogVisible: false,
|
|
|
dialogDataArray:[],
|
|
@@ -72,11 +75,17 @@ var app = new Vue({
|
|
|
// 新闻
|
|
|
news: [],
|
|
|
goPage: 1,
|
|
|
- one_page_size: 9,
|
|
|
- currentPageNum: 1,
|
|
|
totalPageNum: 1,
|
|
|
- totalPageSzie: 4,
|
|
|
+ totalPageSzie: 1,
|
|
|
loading: true,
|
|
|
+ categoryid:0,
|
|
|
+ requestParams:{
|
|
|
+ categoryid: this.id,
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 9,
|
|
|
+ title: ''
|
|
|
+
|
|
|
+ },
|
|
|
|
|
|
|
|
|
//解决方案旧
|
|
@@ -86,7 +95,7 @@ var app = new Vue({
|
|
|
previousInfo: {},
|
|
|
nextInfo: {},
|
|
|
relativeArr: [],
|
|
|
- ariticle_id: 0,
|
|
|
+ // ariticle_id: 0,
|
|
|
},
|
|
|
|
|
|
computed: {
|
|
@@ -105,8 +114,10 @@ var app = new Vue({
|
|
|
|
|
|
},
|
|
|
created: function () {
|
|
|
- this.ariticle_id = this.getQuery('id')
|
|
|
- this.title = this.getQuery('title') ? this.getQuery('title') : ''
|
|
|
+ this.requestParams.categoryid = this.getQuery('id') ? this.getQuery('id') : ''
|
|
|
+
|
|
|
+ // this.ariticle_id = this.getQuery('id')
|
|
|
+ this.requestParams.title = this.getQuery('title') ? this.getQuery('title') : ''
|
|
|
|
|
|
},
|
|
|
mounted: function () {
|
|
@@ -144,6 +155,8 @@ var app = new Vue({
|
|
|
}
|
|
|
if (res.data[i].categoryName == '产品服务' && window.location.pathname == '/product/read.html') {
|
|
|
_this.currentPath = '/product/index.html' //产品详情时栏目高亮
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
if (res.data[i].categoryName == '解决方案') {
|
|
|
_this.dialogDataArray=(res.data[i].children)
|
|
@@ -152,6 +165,14 @@ var app = new Vue({
|
|
|
|
|
|
if (res.data[i].categoryName == '新闻动态' && window.location.pathname == '/news/read.html') {
|
|
|
_this.currentPath = '/news/index.html' //新闻详情时栏目高亮
|
|
|
+
|
|
|
+ //获取相关新闻数据
|
|
|
+ setTimeout(()=>{
|
|
|
+ _this.requestParams.title=''
|
|
|
+ _this.getArticalData( _this.requestParams,1)
|
|
|
+ },1)
|
|
|
+
|
|
|
+
|
|
|
//新闻详情旧
|
|
|
jQuery.ajax({
|
|
|
type: 'POST',
|
|
@@ -180,7 +201,9 @@ var app = new Vue({
|
|
|
}
|
|
|
if (res.data[i].categoryName == '关于永天' && window.location.pathname.indexOf('about') > -1) {
|
|
|
_this.columnTypes = res.data[i].children
|
|
|
- _this.getArticalData(_this.getQuery('id'))
|
|
|
+ _this.requestParams.categoryid=_this.getQuery('id')
|
|
|
+ console.log(_this.requestParams)
|
|
|
+ _this.getArticalData(_this.requestParams)
|
|
|
|
|
|
//关于永天旧
|
|
|
$.ajax({
|
|
@@ -198,8 +221,8 @@ var app = new Vue({
|
|
|
if (res.data[i].children.length > 0) {
|
|
|
if (res.data[i].categoryName == '解决方案' && window.location.pathname.indexOf('solution') > -1) {
|
|
|
_this.columnTypes = res.data[i].children
|
|
|
- _this.id = (_this.getQuery('isTwo') == 1) ? _this.getQuery('id') : _this.columnTypes[0].id;
|
|
|
- _this.getArticalData(_this.id)
|
|
|
+ _this.requestParams.categoryid = (_this.getQuery('isTwo') == 1) ? _this.getQuery('id') : _this.columnTypes[0].id;
|
|
|
+ _this.getArticalData(_this.requestParams)
|
|
|
|
|
|
//解决方案旧
|
|
|
$.ajax({
|
|
@@ -216,13 +239,15 @@ var app = new Vue({
|
|
|
}
|
|
|
if (res.data[i].categoryName == '新闻动态' && window.location.pathname.indexOf('news') > -1) {
|
|
|
_this.columnTypes = res.data[i].children
|
|
|
- _this.id = (_this.getQuery('isTwo') == 1) ? _this.getQuery('id') : _this.columnTypes[0].id;
|
|
|
- _this.getArticalData(_this.id)
|
|
|
+ _this.requestParams.categoryid = (_this.getQuery('isTwo') == 1) ? _this.getQuery('id') : _this.columnTypes[0].id;
|
|
|
+ _this.getArticalData(_this.requestParams)
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
if (res.data[i].categoryName == '产品服务' && window.location.pathname.indexOf('product') > -1) {
|
|
|
_this.columnTypes = res.data[i].children
|
|
|
- _this.id = (_this.getQuery('isTwo') == 1) ? _this.getQuery('id') : _this.columnTypes[0].id;
|
|
|
- _this.getArticalData(_this.id)
|
|
|
+ _this.requestParams.categoryid = (_this.getQuery('isTwo') == 1) ? _this.getQuery('id') : _this.columnTypes[0].id;
|
|
|
+ _this.getArticalData(_this.requestParams)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -230,26 +255,35 @@ var app = new Vue({
|
|
|
},
|
|
|
|
|
|
//获取内容
|
|
|
- getArticalData(param) {
|
|
|
+ getArticalData(requestParams,type) {
|
|
|
$.ajax({
|
|
|
type: 'GET',
|
|
|
dataType: 'json',
|
|
|
url: window.FQDN2 + 'siteArticle/siteArticleList',
|
|
|
- data: {
|
|
|
- categoryid: param,
|
|
|
- pageNum: _this.currentPageNum,
|
|
|
- pageSize: _this.one_page_size,
|
|
|
- title: _this.title
|
|
|
- }
|
|
|
+ data: requestParams
|
|
|
}).done(function (res) {
|
|
|
- var aa = res.data.records;
|
|
|
+
|
|
|
+
|
|
|
+ var aa
|
|
|
+ var bb
|
|
|
+
|
|
|
+ if(type==1){
|
|
|
+ bb=res.data.records
|
|
|
+ }else{
|
|
|
+ aa= res.data.records;
|
|
|
+ aa.sort(_this.compare("lmtitle"))
|
|
|
+ _this.articalArray = aa;
|
|
|
+ }
|
|
|
|
|
|
- aa.sort(_this.compare("lmtitle"))
|
|
|
+ if(bb){
|
|
|
+ _this.articalArrayRelated =bb.filter(obj => obj.id != _this.articalArray[0].id);
|
|
|
+ console.log(_this.articalArrayRelated)
|
|
|
+ }
|
|
|
_this.loading = false;
|
|
|
- _this.articalArray = aa;
|
|
|
_this.totalPageSzie = res.data.total
|
|
|
_this.totalPageNum = Math.ceil(res.data.total / res.data.size);
|
|
|
- console.log(aa)
|
|
|
+
|
|
|
+
|
|
|
|
|
|
}).fail(function (err) {});
|
|
|
|
|
@@ -257,31 +291,31 @@ var app = new Vue({
|
|
|
|
|
|
//类型点击
|
|
|
facilityClick(e, item) {
|
|
|
- this.id = item.id
|
|
|
- this.getArticalData(item.id)
|
|
|
- this.currentPageNum = 1
|
|
|
- // console.log(item.id)
|
|
|
+ this.requestParams.categoryid = item.id
|
|
|
+ this.requestParams.pageNum = 1
|
|
|
+ this.getArticalData(this.requestParams)
|
|
|
+
|
|
|
},
|
|
|
|
|
|
|
|
|
// 分页
|
|
|
oneInnerBox: function (param) {
|
|
|
- window.location = "./read.html?id=" + param.categoryid + '&title=' + param.title;
|
|
|
+ window.location = "./read.html?id=" + param.categoryid + "&title=" + param.title+ "&isTwo=1";
|
|
|
// window.location = "./read.html?id=154"
|
|
|
|
|
|
},
|
|
|
enterPage: function (res) {
|
|
|
if (this.goPage >= 1 && this.goPage <= this.totalPageNum) {
|
|
|
- this.currentPageNum = this.goPage
|
|
|
- this.getArticalData(this.id)
|
|
|
+ this.requestParams.pageNum = this.goPage
|
|
|
+ this.getArticalData(this.requestParams)
|
|
|
} else {
|
|
|
this.goPage = 1
|
|
|
alert('输入页数有误!')
|
|
|
}
|
|
|
},
|
|
|
currentChange: function (res) {
|
|
|
- this.currentPageNum = res
|
|
|
- this.getArticalData(this.id)
|
|
|
+ this.requestParams.pageNum = res
|
|
|
+ this.getArticalData(this.requestParams)
|
|
|
},
|
|
|
|
|
|
|