a1300399510@qq.com 提交于 2023/04/03 -11:20:01
This commit is contained in:
parent
a71930c282
commit
89d304c584
@ -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,
|
||||
|
@ -3,17 +3,17 @@
|
||||
<!-- 左选项 -->
|
||||
<div class="allSections-left">
|
||||
<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 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-title">{{ i.title }}</div>
|
||||
<div class="item-text">{{ i.text }}</div>
|
||||
<div class="item-title">{{ i.name }}</div>
|
||||
<div class="item-text" v-html="i.description"></div>
|
||||
</div>
|
||||
<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="实星">
|
||||
</div>
|
||||
</div>
|
||||
@ -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
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user