From 89d304c584e3b87ac568582926b88bd8d231b56c Mon Sep 17 00:00:00 2001 From: XiaoMo Date: Mon, 3 Apr 2023 11:20:10 +0800 Subject: [PATCH] =?UTF-8?q?a1300399510@qq.com=20=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E4=BA=8E=202023/04/03=20-11:20:01?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/request.js | 3 +- src/views/index/allSections/AllSections.vue | 80 ++++++++------------- 2 files changed, 31 insertions(+), 52 deletions(-) diff --git a/src/utils/request.js b/src/utils/request.js index b8db22b..ed772ab 100755 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -9,7 +9,8 @@ import { skipUrl, pageStop, pageMove, goTologin } from "@/utils/common.js" //1. 创建新的axios实例, axios.defaults.withCredentials = true axios.defaults.emulateJSON = true -baseURL = "https://offer.gter.net/api" +// baseURL = "https://offer.gter.net/api" +baseURL = "https://forum.gter.net" console.log("baseURL",baseURL); const service = axios.create({ baseURL, diff --git a/src/views/index/allSections/AllSections.vue b/src/views/index/allSections/AllSections.vue index c90400d..e23ece2 100755 --- a/src/views/index/allSections/AllSections.vue +++ b/src/views/index/allSections/AllSections.vue @@ -3,17 +3,17 @@
{{ item.title }} + @click="allClick(index)">{{ item.name }}
-
+
-
{{ i.title }}
-
{{ i.text }}
+
{{ i.name }}
+
- 空星 + 空星 实星
@@ -27,37 +27,7 @@ export default { data() { return { allActive: 0, - showStar: [], - star: -1, - list: [ - { - title: "2023招生官" - }, - { - title: "香港澳门台湾留学版" - }, - { - title: "美国留学版" - }, - { - title: "加拿大留学版" - }, - { - title: "英国留学版" - }, - { - title: "欧洲留学版" - }, - { - title: "欧洲留学版" - }, - { - title: "欧洲留学版" - }, - { - title: "欧洲留学版" - } - ], + list: [], starList: [ { title: "2023招生季[你好 招生官]", @@ -77,28 +47,36 @@ export default { methods: { allClick(index) { this.allActive = index + console.log(index); }, starClick(k) { - this.star = k - if (this.showStar[k].checked) { - this.showStar[k].checked = false - } else { - this.showStar[k].checked = true - } + if (this.starList[k].checked) this.starList[k].checked = false + else this.starList[k].checked = true - console.log(this.showStar); this.$forceUpdate() + }, + + // 获取全部板块 + getAllForum() { + this.$http.post("/api/home/allForum").then((res) => { + console.log(res, "res"); + if (res.code != 200) return; + this.list = res.data + }).catch(err => { + this.$message.error(err.message) + }); } }, + created() { - console.log("starList", this.starList); - for (var i = 0; i < this.starList.length; i++) { - this.showStar.push({ ...this.starList[i], 'checked': false }) - } - console.log(this.showStar); - // for (let i in this.showStar) { - // this.showStar[i].checked = false - // } + console.log("dfgkljdflkdfgj"); + + this.starList.forEach(el => { + el.checked = false + }) + + this.getAllForum() + // https://forum.gter.net }