|
@@ -166,7 +166,7 @@ const App = {
|
|
console.log( _this.dialogDataArray)
|
|
console.log( _this.dialogDataArray)
|
|
_this.ruleForm.platName = _this.dialogDataArray[0].categoryName;
|
|
_this.ruleForm.platName = _this.dialogDataArray[0].categoryName;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
|
|
|
|
//栏目处理
|
|
//栏目处理
|
|
|
|
|
|
@@ -190,7 +190,7 @@ const App = {
|
|
|
|
|
|
//进入其他栏目页
|
|
//进入其他栏目页
|
|
if (('/template' + _this.columnList[i].categoryStyle + '/' == window.location.pathname) || (_this.columnList[i].categoryStyle == window.location.pathname.replace('index.html', ''))) {
|
|
if (('/template' + _this.columnList[i].categoryStyle + '/' == window.location.pathname) || (_this.columnList[i].categoryStyle == window.location.pathname.replace('index.html', ''))) {
|
|
- getSeoCommon()
|
|
|
|
|
|
+
|
|
|
|
|
|
if (window.location.href.indexOf("dup") && ('/template' + _this.columnList[i].categoryStyle + '/?dup=' + _this.columnList[i].sname == `${window.location.pathname}?dup=` + this.getQuery('dup'))) {
|
|
if (window.location.href.indexOf("dup") && ('/template' + _this.columnList[i].categoryStyle + '/?dup=' + _this.columnList[i].sname == `${window.location.pathname}?dup=` + this.getQuery('dup'))) {
|
|
if (_this.columnList[i].children.length > 0) {
|
|
if (_this.columnList[i].children.length > 0) {
|
|
@@ -204,6 +204,7 @@ const App = {
|
|
_this.getArticalData(_this.requestParams)
|
|
_this.getArticalData(_this.requestParams)
|
|
_this.columnImage = _this.columnList[i].imagePath;
|
|
_this.columnImage = _this.columnList[i].imagePath;
|
|
}
|
|
}
|
|
|
|
+ getSeoCommon()
|
|
|
|
|
|
}
|
|
}
|
|
if (window.location.href.indexOf("dup") == -1 && !_this.columnList[i].sname && ('/template' + _this.columnList[i].categoryStyle + '/' == window.location.pathname)) {
|
|
if (window.location.href.indexOf("dup") == -1 && !_this.columnList[i].sname && ('/template' + _this.columnList[i].categoryStyle + '/' == window.location.pathname)) {
|
|
@@ -218,6 +219,7 @@ const App = {
|
|
_this.getArticalData(_this.requestParams)
|
|
_this.getArticalData(_this.requestParams)
|
|
_this.columnImage = _this.columnList[i].imagePath;
|
|
_this.columnImage = _this.columnList[i].imagePath;
|
|
}
|
|
}
|
|
|
|
+ getSeoCommon()
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@@ -236,7 +238,6 @@ const App = {
|
|
// 进入详情页
|
|
// 进入详情页
|
|
if ('/template' + _this.columnList[i].categoryStyle + '/read.html' == window.location.pathname) {
|
|
if ('/template' + _this.columnList[i].categoryStyle + '/read.html' == window.location.pathname) {
|
|
getDetailCommon()
|
|
getDetailCommon()
|
|
- getSeoCommon()
|
|
|
|
}
|
|
}
|
|
|
|
|
|
function getDetailCommon() {
|
|
function getDetailCommon() {
|
|
@@ -252,11 +253,13 @@ const App = {
|
|
//产品详情时栏目高亮
|
|
//产品详情时栏目高亮
|
|
if(window.location.href.indexOf("dup") && ('/template' + _this.columnList[i].categoryStyle+ '/read.html' + '?dup=' + _this.columnList[i].sname == `${window.location.pathname}?dup=` + _this.getQuery('dup'))){
|
|
if(window.location.href.indexOf("dup") && ('/template' + _this.columnList[i].categoryStyle+ '/read.html' + '?dup=' + _this.columnList[i].sname == `${window.location.pathname}?dup=` + _this.getQuery('dup'))){
|
|
_this.currentPath = `/template${ _this.columnList[i].categoryStyle}/?dup=` + _this.getQuery('dup')
|
|
_this.currentPath = `/template${ _this.columnList[i].categoryStyle}/?dup=` + _this.getQuery('dup')
|
|
|
|
+ getSeoCommon()
|
|
}
|
|
}
|
|
|
|
|
|
if (window.location.href.indexOf("dup") == -1 && !_this.columnList[i].sname && ('/template' + _this.columnList[i].categoryStyle + '/read.html' == window.location.pathname)) {
|
|
if (window.location.href.indexOf("dup") == -1 && !_this.columnList[i].sname && ('/template' + _this.columnList[i].categoryStyle + '/read.html' == window.location.pathname)) {
|
|
|
|
|
|
_this.currentPath = `/template${ _this.columnList[i].categoryStyle}/`
|
|
_this.currentPath = `/template${ _this.columnList[i].categoryStyle}/`
|
|
|
|
+ getSeoCommon()
|
|
}
|
|
}
|
|
|
|
|
|
_this.modelType = _this.columnList[i].modelType; //栏目图片获取
|
|
_this.modelType = _this.columnList[i].modelType; //栏目图片获取
|
|
@@ -275,10 +278,6 @@ const App = {
|
|
$('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);
|
|
}
|
|
}
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
@@ -363,17 +362,21 @@ const App = {
|
|
window.addEventListener('scroll', lazyLoad)
|
|
window.addEventListener('scroll', lazyLoad)
|
|
// 3 定义页面滚动的处理函数
|
|
// 3 定义页面滚动的处理函数
|
|
function lazyLoad() {
|
|
function lazyLoad() {
|
|
- for (let i = 0; i < images.length; i++) {
|
|
|
|
- // isVisible是否该图片位于可视区域 返回true 或false
|
|
|
|
- if (isVisible(images[i])) {
|
|
|
|
- // 将元素的自定义属性 data-src 赋值给元素的 src 属性
|
|
|
|
- // dataset.src 此为元素的自定义属性 data-src
|
|
|
|
- images[i].src = images[i].dataset.src // 等价于:img.setAttribute('src', img.getAttribute('data-src'))
|
|
|
|
- // 防止重复被遍历 加载完之后 删除元素不再加载
|
|
|
|
- images.splice(i, 1)
|
|
|
|
- i--
|
|
|
|
|
|
+ for (let i = 0; i < images.length; i++) {
|
|
|
|
+ // isVisible是否该图片位于可视区域 返回true 或false
|
|
|
|
+ if (isVisible(images[i])) {
|
|
|
|
+ // 将元素的自定义属性 data-src 赋值给元素的 src 属性
|
|
|
|
+ // dataset.src 此为元素的自定义属性 data-src
|
|
|
|
+ if(images[i].dataset.src){
|
|
|
|
+ images[i].src = images[i].dataset.src // 等价于:img.setAttribute('src', img.getAttribute('data-src'))
|
|
|
|
+ }
|
|
|
|
+ // 防止重复被遍历 加载完之后 删除元素不再加载
|
|
|
|
+ images.splice(i, 1)
|
|
|
|
+ i--
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|
|
lazyLoad()
|
|
lazyLoad()
|
|
// 4 可视区域判断函数
|
|
// 4 可视区域判断函数
|