|
@@ -4,7 +4,7 @@ import dialogCom from '/assets/js/component/dialogCom.js'
|
|
import loadingCom from '/assets/js/component/loadingCom.js'
|
|
import loadingCom from '/assets/js/component/loadingCom.js'
|
|
import headerCom from '/assets/js/component/headerCom.js'
|
|
import headerCom from '/assets/js/component/headerCom.js'
|
|
|
|
|
|
-var AboutKeyWrds='';
|
|
|
|
|
|
+var AboutKeyWrds = '';
|
|
|
|
|
|
var app = new Vue({
|
|
var app = new Vue({
|
|
el: '#app',
|
|
el: '#app',
|
|
@@ -20,22 +20,21 @@ var app = new Vue({
|
|
|
|
|
|
//公共
|
|
//公共
|
|
id: null,
|
|
id: null,
|
|
- columnList: [
|
|
|
|
- ],
|
|
|
|
|
|
+ columnList: [],
|
|
requestParams: { //内容接口请求参数
|
|
requestParams: { //内容接口请求参数
|
|
categoryid: 0,
|
|
categoryid: 0,
|
|
pageNum: 1,
|
|
pageNum: 1,
|
|
pageSize: 9,
|
|
pageSize: 9,
|
|
title: '',
|
|
title: '',
|
|
- order:'sortindex',
|
|
|
|
- articleid:0,
|
|
|
|
|
|
+ order: 'sortindex',
|
|
|
|
+ articleid: 0,
|
|
},
|
|
},
|
|
currentPath: '',
|
|
currentPath: '',
|
|
articalArray: [], //详情数组
|
|
articalArray: [], //详情数组
|
|
articalArrayRelated: [], //相关推荐
|
|
articalArrayRelated: [], //相关推荐
|
|
columnTypes: [], //栏目类型
|
|
columnTypes: [], //栏目类型
|
|
- colL:0,
|
|
|
|
- modelType:1,
|
|
|
|
|
|
+ colL: 0,
|
|
|
|
+ modelType: 1,
|
|
columnImage: '', //栏目图片
|
|
columnImage: '', //栏目图片
|
|
|
|
|
|
// 公共弹框
|
|
// 公共弹框
|
|
@@ -96,85 +95,106 @@ var app = new Vue({
|
|
this.requestParams.articleid = this.getQuery('articleid') ? this.getQuery('articleid') : ''
|
|
this.requestParams.articleid = this.getQuery('articleid') ? this.getQuery('articleid') : ''
|
|
},
|
|
},
|
|
mounted: function () {
|
|
mounted: function () {
|
|
-
|
|
|
|
|
|
+
|
|
this.getColumnData()
|
|
this.getColumnData()
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
|
|
//获取栏目数据
|
|
//获取栏目数据
|
|
getColumnData() {
|
|
getColumnData() {
|
|
- var _this = this;
|
|
|
|
- if(!localStorage.getItem('storeColumnList')||window.location.pathname == '/index.html'||window.location.pathname == '/'){
|
|
|
|
|
|
+ var _this = this;
|
|
|
|
+ if (!localStorage.getItem('storeColumnList') || window.location.pathname == '/index.html' || window.location.pathname == '/') {
|
|
$.ajax({
|
|
$.ajax({
|
|
type: 'get',
|
|
type: 'get',
|
|
dataType: 'json',
|
|
dataType: 'json',
|
|
url: window.FQDN2 + 'siteCategory/siteCategoryList',
|
|
url: window.FQDN2 + 'siteCategory/siteCategoryList',
|
|
}).done(function (res) {
|
|
}).done(function (res) {
|
|
_this.columnList = res.data;
|
|
_this.columnList = res.data;
|
|
- let expires = Date.now() + 1000 * 60* 30 ; //半小时过期时间
|
|
|
|
- localStorage.setItem('storeColumnList', JSON.stringify({data: _this.columnList, expires}));
|
|
|
|
- _this.loading=false
|
|
|
|
|
|
+ let expires = Date.now() + 1000 * 60 * 30; //半小时过期时间
|
|
|
|
+ localStorage.setItem('storeColumnList', JSON.stringify({
|
|
|
|
+ data: _this.columnList,
|
|
|
|
+ expires
|
|
|
|
+ }));
|
|
|
|
+ _this.loading = false
|
|
_this.currentPath = window.location.pathname;
|
|
_this.currentPath = window.location.pathname;
|
|
_this.handleColumnData()
|
|
_this.handleColumnData()
|
|
})
|
|
})
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
console.log(JSON.parse(localStorage.getItem('storeColumnList')))
|
|
console.log(JSON.parse(localStorage.getItem('storeColumnList')))
|
|
this.loading = false;
|
|
this.loading = false;
|
|
- this.handleColumnData()
|
|
|
|
|
|
+ this.handleColumnData()
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
|
|
|
|
- handleColumnData(){
|
|
|
|
|
|
+ handleColumnData() {
|
|
this.currentPath = window.location.pathname;
|
|
this.currentPath = window.location.pathname;
|
|
- this.columnList=JSON.parse(localStorage.getItem('storeColumnList')).data;
|
|
|
|
- console.log( JSON.parse(localStorage.getItem('storeColumnList')))
|
|
|
|
- console.log( Date.now())
|
|
|
|
|
|
+ this.columnList = JSON.parse(localStorage.getItem('storeColumnList')).data;
|
|
|
|
+ this.requestParams.categoryid = this.columnList[0].id
|
|
|
|
+ console.log(JSON.parse(localStorage.getItem('storeColumnList')))
|
|
|
|
+ console.log(Date.now())
|
|
|
|
|
|
// 读取并检查是否过期
|
|
// 读取并检查是否过期
|
|
- if ( JSON.parse(localStorage.getItem('storeColumnList')).expires < Date.now()) {
|
|
|
|
- localStorage.removeItem('storeColumnList');
|
|
|
|
|
|
+ if (JSON.parse(localStorage.getItem('storeColumnList')).expires < Date.now()) {
|
|
|
|
+ localStorage.removeItem('storeColumnList');
|
|
} else {
|
|
} else {
|
|
- console.log( this.columnList);
|
|
|
|
|
|
+ console.log(this.columnList);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
|
|
- var _this=this;
|
|
|
|
|
|
+
|
|
|
|
+ var _this = this;
|
|
|
|
+
|
|
for (let i = 0; i < _this.columnList.length; i++) {
|
|
for (let i = 0; i < _this.columnList.length; i++) {
|
|
|
|
|
|
- //栏目处理
|
|
|
|
- if (_this.columnList[i].sname == window.location.pathname) {
|
|
|
|
|
|
+ //栏目处理
|
|
|
|
|
|
- //进入当前栏目页
|
|
|
|
|
|
+ //进入首页
|
|
|
|
+ if (_this.columnList[i].sname == '/index.html' && (window.location.pathname == '/'||window.location.pathname == '')) {
|
|
|
|
+ getSeoCommon()
|
|
|
|
|
|
|
|
+ _this.modelType = _this.columnList[0].modelType;
|
|
|
|
+ _this.columnImage = _this.columnList[0].imagePath;
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ if (_this.modelType == 2) {
|
|
|
|
+ document.getElementById("videoPlay").src = _this.columnImage; //url为你需要播放的视频地址
|
|
|
|
+ document.getElementById("videoPlay").setAttribute('poster', '/assets/img/banner/111.png');
|
|
|
|
+ }
|
|
|
|
+ }, 100)
|
|
|
|
+ _this.getArticalData(_this.requestParams)
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ //进入其他栏目页
|
|
|
|
+ if ((_this.columnList[i].sname == window.location.pathname)) {
|
|
getSeoCommon()
|
|
getSeoCommon()
|
|
-
|
|
|
|
- _this.columnTypes = _this.columnList[i].children
|
|
|
|
- _this.colL= _this.columnTypes.childten;
|
|
|
|
|
|
+
|
|
|
|
+ _this.columnTypes = _this.columnList[i].children
|
|
|
|
+ _this.colL = _this.columnTypes.childten;
|
|
if (_this.columnList[i].children.length > 0) {
|
|
if (_this.columnList[i].children.length > 0) {
|
|
_this.requestParams.categoryid = (_this.getQuery('isUrlId') == 1) ? _this.getQuery('id') : _this.columnTypes[0].id;
|
|
_this.requestParams.categoryid = (_this.getQuery('isUrlId') == 1) ? _this.getQuery('id') : _this.columnTypes[0].id;
|
|
} else {
|
|
} else {
|
|
var objData = _this.columnList.filter(obj => obj.sname == window.location.pathname);
|
|
var objData = _this.columnList.filter(obj => obj.sname == window.location.pathname);
|
|
- _this.requestParams.categoryid=objData[0].id
|
|
|
|
|
|
+ _this.requestParams.categoryid = objData[0].id
|
|
|
|
+
|
|
}
|
|
}
|
|
- _this.getArticalData(_this.requestParams)
|
|
|
|
- _this.modelType = _this.columnList[i].modelType;
|
|
|
|
- _this.columnImage = _this.columnList[i].imagePath;
|
|
|
|
- setTimeout(()=>{
|
|
|
|
- if(_this.modelType==2){
|
|
|
|
|
|
+ _this.getArticalData(_this.requestParams)
|
|
|
|
+ _this.modelType = _this.columnList[i].modelType;
|
|
|
|
+ _this.columnImage = _this.columnList[i].imagePath;
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ if (_this.modelType == 2) {
|
|
document.getElementById("videoPlay").src = _this.columnImage; //url为你需要播放的视频地址
|
|
document.getElementById("videoPlay").src = _this.columnImage; //url为你需要播放的视频地址
|
|
document.getElementById("videoPlay").setAttribute('poster', '/assets/img/banner/111.png');
|
|
document.getElementById("videoPlay").setAttribute('poster', '/assets/img/banner/111.png');
|
|
}
|
|
}
|
|
- },100)
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- } else {
|
|
|
|
|
|
+ }, 100)
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ } else {
|
|
|
|
+
|
|
|
|
+
|
|
|
|
|
|
// 进入详情页
|
|
// 进入详情页
|
|
if (_this.columnList[i].sname == '/product/index.html' && window.location.pathname == '/product/read.html') {
|
|
if (_this.columnList[i].sname == '/product/index.html' && window.location.pathname == '/product/read.html') {
|
|
-
|
|
|
|
|
|
+
|
|
getDetailCommon()
|
|
getDetailCommon()
|
|
getSeoCommon()
|
|
getSeoCommon()
|
|
}
|
|
}
|
|
@@ -187,7 +207,7 @@ var app = new Vue({
|
|
getSeoCommon()
|
|
getSeoCommon()
|
|
}
|
|
}
|
|
|
|
|
|
- function getDetailCommon(){
|
|
|
|
|
|
+ function getDetailCommon() {
|
|
//获取内容详情
|
|
//获取内容详情
|
|
_this.getArticalData(_this.requestParams)
|
|
_this.getArticalData(_this.requestParams)
|
|
//获取详情相关数据
|
|
//获取详情相关数据
|
|
@@ -199,33 +219,22 @@ var app = new Vue({
|
|
_this.currentPath = _this.columnList[i].sname //产品详情时栏目高亮
|
|
_this.currentPath = _this.columnList[i].sname //产品详情时栏目高亮
|
|
_this.modelType = _this.columnList[i].modelType; //栏目图片获取
|
|
_this.modelType = _this.columnList[i].modelType; //栏目图片获取
|
|
_this.columnImage = _this.columnList[i].imagePath; //栏目图片获取
|
|
_this.columnImage = _this.columnList[i].imagePath; //栏目图片获取
|
|
- setTimeout(()=>{
|
|
|
|
- if(_this.modelType==2){
|
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ if (_this.modelType == 2) {
|
|
document.getElementById("videoPlay").src = _this.columnImage; //url为你需要播放的视频地址
|
|
document.getElementById("videoPlay").src = _this.columnImage; //url为你需要播放的视频地址
|
|
document.getElementById("videoPlay").setAttribute('poster', '/assets/img/banner/111.png');
|
|
document.getElementById("videoPlay").setAttribute('poster', '/assets/img/banner/111.png');
|
|
}
|
|
}
|
|
- },100)
|
|
|
|
|
|
+ }, 100)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- function getSeoCommon(){
|
|
|
|
|
|
+
|
|
|
|
+ function getSeoCommon() {
|
|
$('title').text(_this.columnList[i].categoryName);
|
|
$('title').text(_this.columnList[i].categoryName);
|
|
$('meta[name="description"]').attr('content', _this.columnList[i].metadescription);
|
|
$('meta[name="description"]').attr('content', _this.columnList[i].metadescription);
|
|
- $('meta[name="keywords"]').attr('content',_this.columnList[i].metakeywords);
|
|
|
|
|
|
+ $('meta[name="keywords"]').attr('content', _this.columnList[i].metakeywords);
|
|
}
|
|
}
|
|
|
|
|
|
- //首页旧
|
|
|
|
-
|
|
|
|
- if (_this.columnList[i].sname == '/index.html' && (window.location.pathname == '/index.html'||window.location.pathname == '/')) {
|
|
|
|
- jQuery.ajax({
|
|
|
|
- type: 'POST',
|
|
|
|
- dataType: 'json',
|
|
|
|
- url: window.FQDN + 'Index/index',
|
|
|
|
- }).done(function (res) {
|
|
|
|
- // _this.loading = false;
|
|
|
|
- _this.homeList = res
|
|
|
|
- _this.status = true
|
|
|
|
- }).fail(function (err) {});
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
|
|
|
|
// 获取反馈弹框类型数据
|
|
// 获取反馈弹框类型数据
|
|
if (_this.columnList[i].sname == '/solution/index.html') {
|
|
if (_this.columnList[i].sname == '/solution/index.html') {
|
|
@@ -237,8 +246,8 @@ var app = new Vue({
|
|
|
|
|
|
//获取内容
|
|
//获取内容
|
|
getArticalData(requestParams, type) {
|
|
getArticalData(requestParams, type) {
|
|
- var _this=this
|
|
|
|
- if( window.location.pathname == '/news/index.html'){
|
|
|
|
|
|
+ var _this = this
|
|
|
|
+ if (window.location.pathname == '/news/index.html') {
|
|
_this.requestParams.order = ''
|
|
_this.requestParams.order = ''
|
|
}
|
|
}
|
|
|
|
|
|
@@ -250,11 +259,11 @@ var app = new Vue({
|
|
}).done(function (res) {
|
|
}).done(function (res) {
|
|
var aa
|
|
var aa
|
|
var bb
|
|
var bb
|
|
-
|
|
|
|
- if(type==1){
|
|
|
|
- bb=res.data.records
|
|
|
|
- }else{
|
|
|
|
- aa= res.data.records;
|
|
|
|
|
|
+
|
|
|
|
+ if (type == 1) {
|
|
|
|
+ bb = res.data.records
|
|
|
|
+ } else {
|
|
|
|
+ aa = res.data.records;
|
|
// aa.sort(_this.compare("sortindex"))
|
|
// aa.sort(_this.compare("sortindex"))
|
|
_this.articalArray = aa;
|
|
_this.articalArray = aa;
|
|
}
|
|
}
|
|
@@ -298,18 +307,18 @@ var app = new Vue({
|
|
},
|
|
},
|
|
|
|
|
|
//申请试用
|
|
//申请试用
|
|
- goApply:function(){
|
|
|
|
- this.centerDialogVisible=true
|
|
|
|
|
|
+ goApply: function () {
|
|
|
|
+ this.centerDialogVisible = true
|
|
|
|
|
|
},
|
|
},
|
|
|
|
|
|
//弹框显示隐藏(子组件向父组件传值)
|
|
//弹框显示隐藏(子组件向父组件传值)
|
|
- handleChildEvent:function(value) {
|
|
|
|
|
|
+ handleChildEvent: function (value) {
|
|
this.centerDialogVisible = value; // 处理从子组件接收到的数据
|
|
this.centerDialogVisible = value; // 处理从子组件接收到的数据
|
|
},
|
|
},
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
|
|
// 排序
|
|
// 排序
|
|
compare(property) {
|
|
compare(property) {
|