a1300399510@qq.com 提交于 2023/04/03 -11:20:01

This commit is contained in:
XiaoMo 2023-04-03 11:20:10 +08:00
parent a71930c282
commit 89d304c584
2 changed files with 31 additions and 52 deletions

View File

@ -9,7 +9,8 @@ import { skipUrl, pageStop, pageMove, goTologin } from "@/utils/common.js"
//1. 创建新的axios实例 //1. 创建新的axios实例
axios.defaults.withCredentials = true axios.defaults.withCredentials = true
axios.defaults.emulateJSON = 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); console.log("baseURL",baseURL);
const service = axios.create({ const service = axios.create({
baseURL, baseURL,

View File

@ -3,17 +3,17 @@
<!-- 左选项 --> <!-- 左选项 -->
<div class="allSections-left"> <div class="allSections-left">
<span v-for="(item, index) in list" :class="{ 'active': index == allActive }" :key="index" <span v-for="(item, index) in list" :class="{ 'active': index == allActive }" :key="index"
@click="allClick(index)">{{ item.title }}</span> @click="allClick(index)">{{ item.name }}</span>
</div> </div>
<!-- 右选项 --> <!-- 右选项 -->
<div class="allSections-right"> <div class="allSections-right">
<div class="allSections-right-item" v-for="(i, k) in starList" :key="k"> <div class="allSections-right-item" v-for="(i, k) in list[allActive].data" :key="k">
<div class="item-content"> <div class="item-content">
<div class="item-title">{{ i.title }}</div> <div class="item-title">{{ i.name }}</div>
<div class="item-text">{{ i.text }}</div> <div class="item-text" v-html="i.description"></div>
</div> </div>
<div class="item-star" @click="starClick(k)"> <div class="item-star" @click="starClick(k)">
<img v-if="!showStar[k].checked" src="~assets/img/allSections/nullStar.png" alt="空星"> <img v-if="!i.iscollection" src="~assets/img/allSections/nullStar.png" alt="空星">
<img v-else src="~assets/img/allSections/star.png" alt="实星"> <img v-else src="~assets/img/allSections/star.png" alt="实星">
</div> </div>
</div> </div>
@ -27,37 +27,7 @@ export default {
data() { data() {
return { return {
allActive: 0, allActive: 0,
showStar: [], list: [],
star: -1,
list: [
{
title: "2023招生官"
},
{
title: "香港澳门台湾留学版"
},
{
title: "美国留学版"
},
{
title: "加拿大留学版"
},
{
title: "英国留学版"
},
{
title: "欧洲留学版"
},
{
title: "欧洲留学版"
},
{
title: "欧洲留学版"
},
{
title: "欧洲留学版"
}
],
starList: [ starList: [
{ {
title: "2023招生季[你好 招生官]", title: "2023招生季[你好 招生官]",
@ -77,28 +47,36 @@ export default {
methods: { methods: {
allClick(index) { allClick(index) {
this.allActive = index this.allActive = index
console.log(index);
}, },
starClick(k) { starClick(k) {
this.star = k if (this.starList[k].checked) this.starList[k].checked = false
if (this.showStar[k].checked) { else this.starList[k].checked = true
this.showStar[k].checked = false
} else {
this.showStar[k].checked = true
}
console.log(this.showStar);
this.$forceUpdate() 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() { created() {
console.log("starList", this.starList); console.log("dfgkljdflkdfgj");
for (var i = 0; i < this.starList.length; i++) {
this.showStar.push({ ...this.starList[i], 'checked': false }) this.starList.forEach(el => {
} el.checked = false
console.log(this.showStar); })
// for (let i in this.showStar) {
// this.showStar[i].checked = false this.getAllForum()
// }
// https://forum.gter.net // https://forum.gter.net
} }