Selaa lähdekoodia

重复模板加参数

ming 1 vuosi sitten
vanhempi
commit
887dc034e3
2 muutettua tiedostoa jossa 10 lisäystä ja 24 poistoa
  1. 8 23
      assets/js/commonVue.js
  2. 2 1
      assets/js/component/headerCom.js

+ 8 - 23
assets/js/commonVue.js

@@ -156,7 +156,7 @@ const App = {
         //栏目处理  
 
         //进入首页
-        if (_this.columnList[i].sname == '/' && (window.location.pathname == '/'||window.location.pathname == ''||window.location.pathname == '/index.html')) {
+        if (_this.columnList[i].categoryStyle == '1' && (window.location.pathname == '/'||window.location.pathname == ''||window.location.pathname == '/index.html')) {
           getSeoCommon()
 
           this.requestParams.categoryid = this.columnList[0].id
@@ -172,9 +172,9 @@ 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()
           _this.columnTypes = _this.columnList[i].children
           _this.colL = _this.columnTypes.childten;
@@ -185,7 +185,7 @@ const App = {
             _this.requestParams.categoryid = objData[0].id
 
           }
-          _this.getArticalData(_this.requestParams)
+                    _this.getArticalData(_this.requestParams)
           _this.modelType = _this.columnList[i].modelType;
           _this.columnImage = _this.columnList[i].imagePath;
           setTimeout(() => {
@@ -199,27 +199,12 @@ const App = {
 
         } else {
 
-
+          // 进入详情页
           if('/template'+_this.columnList[i].categoryStyle+'/read.html'==window.location.pathname){
             getDetailCommon()
             getSeoCommon()
           }
-
-          // 进入详情页
-          // if (_this.columnList[i].categoryStyle == '2' && window.location.pathname == '/template2/read.html') {
-
-          //   getDetailCommon()
-          //   getSeoCommon()
-          // }
-          // if (_this.columnList[i].sname == '/3/' && window.location.pathname == '/template3/read.html') {
-          //   getDetailCommon()
-          //   getSeoCommon()
-          // }
-          // if (_this.columnList[i].sname == '/4/' && window.location.pathname == '/template4/read.html') {
-          //   getDetailCommon()
-          //   getSeoCommon()
-          // }
-
+          
           function getDetailCommon() {
             //获取内容详情
             _this.getArticalData(_this.requestParams)
@@ -250,7 +235,7 @@ const App = {
 
 
         // 获取反馈弹框类型数据
-        if (_this.columnList[i].sname == '/solution/') {
+        if (_this.columnList[i].categoryStyle == '2') {
           _this.dialogDataArray = (_this.columnList[i].children)
           _this.ruleForm.platName = _this.dialogDataArray[0].categoryName;
         }
@@ -260,7 +245,7 @@ const App = {
     //获取内容
     getArticalData(requestParams, type) {
       var _this = this
-      if (window.location.pathname == '/news/') {
+      if (window.location.pathname == '/template4/') {
         _this.requestParams.order = ''
       }
 

+ 2 - 1
assets/js/component/headerCom.js

@@ -17,7 +17,8 @@ export default {
                                 <ul v-if="todo">
                                     <li v-for="item in todo" :key="item.id" :class="
                                     currentone=='/template'+item.categoryStyle+'/'? 'active':''">
-                                        <a :href="item.categoryStyle==1?'/':'/template'+item.categoryStyle+'/'">{{item.categoryName}}</a>
+                                        <a  v-if="item.sname" :href="item.categoryStyle==1?'/?dup='+item.sname:'/template'+item.categoryStyle+'/?dup='+item.sname">{{item.categoryName}}</a>
+                                        <a  v-else :href="item.categoryStyle==1?'/':'/template'+item.categoryStyle+'/'">{{item.categoryName}}</a>
                                         <ul class="submenu">
                                             <li v-if="item.children" v-for="aa in item.children" :key="aa.id"><a
                                                     :href="'/template'+item.categoryStyle+'/?categoryid='+aa.id+'&isUrlId=1'"> <span