|
@@ -108,7 +108,7 @@ const App = {
|
|
//获取栏目数据
|
|
//获取栏目数据
|
|
getColumnData() {
|
|
getColumnData() {
|
|
var _this = this;
|
|
var _this = this;
|
|
- if (!localStorage.getItem('storeColumnList') || window.location.pathname == '/') {
|
|
|
|
|
|
+ if (!localStorage.getItem('storeColumnList') || window.location.pathname == '/'||window.location.pathname == '/index.html') {
|
|
$.ajax({
|
|
$.ajax({
|
|
type: 'get',
|
|
type: 'get',
|
|
dataType: 'json',
|
|
dataType: 'json',
|
|
@@ -138,7 +138,7 @@ const App = {
|
|
|
|
|
|
|
|
|
|
handleColumnData() {
|
|
handleColumnData() {
|
|
- this.currentPath = window.location.pathname;
|
|
|
|
|
|
+ this.currentPath = window.location.pathname;
|
|
this.columnList = JSON.parse(localStorage.getItem('storeColumnList')).data;
|
|
this.columnList = JSON.parse(localStorage.getItem('storeColumnList')).data;
|
|
|
|
|
|
// 读取并检查是否过期
|
|
// 读取并检查是否过期
|
|
@@ -155,7 +155,7 @@ const App = {
|
|
//栏目处理
|
|
//栏目处理
|
|
|
|
|
|
//进入首页
|
|
//进入首页
|
|
- if (_this.columnList[i].sname == '/index.html' && (window.location.pathname == '/'||window.location.pathname == '')) {
|
|
|
|
|
|
+ if (_this.columnList[i].sname == '/' && (window.location.pathname == '/'||window.location.pathname == ''||window.location.pathname == '/index.html')) {
|
|
getSeoCommon()
|
|
getSeoCommon()
|
|
|
|
|
|
this.requestParams.categoryid = this.columnList[0].id
|
|
this.requestParams.categoryid = this.columnList[0].id
|
|
@@ -171,15 +171,16 @@ const App = {
|
|
}
|
|
}
|
|
|
|
|
|
//进入其他栏目页
|
|
//进入其他栏目页
|
|
- if ((_this.columnList[i].sname == window.location.pathname)) {
|
|
|
|
|
|
+
|
|
|
|
+ if ((_this.columnList[i].sname == window.location.pathname)||(_this.columnList[i].sname == window.location.pathname.replace('index.html', ''))) {
|
|
getSeoCommon()
|
|
getSeoCommon()
|
|
-
|
|
|
|
|
|
+
|
|
_this.columnTypes = _this.columnList[i].children
|
|
_this.columnTypes = _this.columnList[i].children
|
|
_this.colL = _this.columnTypes.childten;
|
|
_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('categoryid') : _this.columnTypes[0].id;
|
|
_this.requestParams.categoryid = (_this.getQuery('isUrlId') == 1) ? _this.getQuery('categoryid') : _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.replace('index.html', ''));
|
|
_this.requestParams.categoryid = objData[0].id
|
|
_this.requestParams.categoryid = objData[0].id
|
|
|
|
|
|
}
|
|
}
|