Browse Source

修改友情链接和底部导航

Jing 1 month ago
parent
commit
83f547e1ba
2 changed files with 93 additions and 33 deletions
  1. 54 17
      src/views/tabbar/tabbar.vue
  2. 39 16
      src/views/website/blogroll.vue

+ 54 - 17
src/views/tabbar/tabbar.vue

@@ -1,5 +1,5 @@
 <template>
-    <!-- 广告位管理 -->
+    <!-- 底部导航 -->
     <div>
         <!-- 头部搜索框部分 -->
         <div class="title">
@@ -59,7 +59,7 @@
                                         <i class="el-icon-edit-outline"></i>
                                         编辑
                                     </div>
-                                    <div class="listLookBtn" @click="goLook(scope.row.id,scope.row)">
+                                    <div class="listLookBtn" @click="goLook(scope.row.id, scope.row)">
                                         <i class="el-icon-view"></i>
                                         查看
                                     </div>
@@ -153,9 +153,9 @@ export default {
 
             value: '',
 
-            
+
             activeid: "",  //活动id 
-            type:"",  //查看时需要传递的类型
+            type: "",  //查看时需要传递的类型
 
             // 分页相关
             page: 1,
@@ -189,14 +189,51 @@ export default {
         //1.列表和分页相关 start ------------------------------------------------------------>
         //1.1 开始请求列表信息方法
         getData() {
-            getFooterCategory({
-                page: this.page,
-                pageSize: this.pageSize
-            }).then(data => {
-                console.log(data);
-                this.tableData = data.data.rows
-                this.total = data.data.count
-            })
+            if (this.webSiteName_name && this.tabbarName) {
+                getFooterCategory({
+                    page: this.page,
+                    pageSize: this.pageSize,
+                    name: this.tabbarName,
+                    website_name: this.webSiteName_name, //网站名称
+                }).then(data => {
+                    console.log(data);
+                    this.tableData = data.data.rows
+                    this.total = data.data.count
+                })
+            } else if (this.webSiteName_name && !this.tabbarName) {
+                getFooterCategory({
+                    page: this.page,
+                    pageSize: this.pageSize,
+                    // name: this.tabbarName,
+                    website_name: this.webSiteName_name, //网站名称
+                }).then(data => {
+                    console.log(data);
+                    this.tableData = data.data.rows
+                    this.total = data.data.count
+                })
+            } else if (!this.webSiteName_name && this.tabbarName) {
+                getFooterCategory({
+                    page: this.page,
+                    pageSize: this.pageSize,
+                    name: this.tabbarName,
+                    // website_name: this.webSiteName_name, //网站名称
+                }).then(data => {
+                    console.log(data);
+                    this.tableData = data.data.rows
+                    this.total = data.data.count
+                })
+            } else {
+                getFooterCategory({
+                    page: this.page,
+                    pageSize: this.pageSize
+                }).then(data => {
+                    console.log(data);
+                    this.tableData = data.data.rows
+                    this.total = data.data.count
+                })
+            }
+
+
         },
 
         //1.2 删除内容
@@ -303,7 +340,7 @@ export default {
             this.dialogName = '编辑'
             this.activeid = id
             this.dialogTableVisible = true
-            this.disabled=true
+            this.disabled = true
             console.log(id, val);
             console.log("状态", val);
 
@@ -319,14 +356,14 @@ export default {
         },
 
         //2.0 查看
-        goLook(id,val) {
+        goLook(id, val) {
             this.activeid = id
-            this.type=val.type
+            this.type = val.type
             this.$router.push({
                 path: '/tabbarDetail',
                 query: {
                     id: this.activeid,
-                    type:this.type
+                    type: this.type
                 }
             })
         },
@@ -335,7 +372,7 @@ export default {
         addWebsite() {
             this.dialogTableVisible = true
             this.dialogName = "添加"
-            this.disabled=false
+            this.disabled = false
 
             //添加时清空回显回来的数据
             this.ruleForm.webName = '' //关联网站名称

+ 39 - 16
src/views/website/blogroll.vue

@@ -253,23 +253,46 @@ export default {
         //1.列表和分页相关 start ------------------------------------------------------------>
         //1.1 获取网站列表数据
         getData() {
-            getLinkList({
-                page: this.page,
-                pageSize: this.pageSize,
-            }).then(data => {
-                console.log(data);
-                this.tableData = data.data.rows
-                this.total = data.data.count
-                for (let item of this.tableData) {
-                    if (item.type == '1') {
-                        item.type = '图片'
-                    } else if (item.type == '2') {
-                        item.type = '文字'
-                    } else if (item.type == '3') {
-                        item.type = '底部'
+            if (this.siteName || this.webName) {
+                getLinkList({
+                    page: this.page,
+                    pageSize: this.pageSize,
+                    website_id: this.siteName,
+                    title: this.webName
+                }).then(data => {
+                    console.log(data);
+                    this.tableData = data.data.rows
+                    this.total = data.data.count
+                    for (let item of this.tableData) {
+                        if (item.type == '1') {
+                            item.type = '图片'
+                        } else if (item.type == '2') {
+                            item.type = '文字'
+                        } else if (item.type == '3') {
+                            item.type = '底部'
+                        }
                     }
-                }
-            })
+                })
+            } else {
+                getLinkList({
+                    page: this.page,
+                    pageSize: this.pageSize,
+                }).then(data => {
+                    console.log(data);
+                    this.tableData = data.data.rows
+                    this.total = data.data.count
+                    for (let item of this.tableData) {
+                        if (item.type == '1') {
+                            item.type = '图片'
+                        } else if (item.type == '2') {
+                            item.type = '文字'
+                        } else if (item.type == '3') {
+                            item.type = '底部'
+                        }
+                    }
+                })
+            }
+
         },
         //1.2 删除内容
         deleteRow(id, val) {