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

This commit is contained in:
XiaoMo 2023-04-03 11:40:10 +08:00
parent 89d304c584
commit 5a4bbd7df2

View File

@ -7,16 +7,17 @@
</div> </div>
<!-- 右选项 --> <!-- 右选项 -->
<div class="allSections-right"> <div class="allSections-right">
<div class="allSections-right-item" v-for="(i, k) in list[allActive].data" :key="k"> <div class="allSections-right-item" v-for="(i, k) in showList" :key="k">
<div class="item-content"> <div class="item-content">
<div class="item-title">{{ i.name }}</div> <div class="item-title">{{ i.name }}</div>
<div class="item-text" v-html="i.description"></div> <div v-if="i.description" 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="!i.iscollection" 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>
</div> </div>
</div> </div>
</template> </template>
@ -27,7 +28,9 @@ export default {
data() { data() {
return { return {
allActive: 0, allActive: 0,
list: [], list: [{
}],
starList: [ starList: [
{ {
title: "2023招生季[你好 招生官]", title: "2023招生季[你好 招生官]",
@ -41,7 +44,8 @@ export default {
title: "2023招生季[你好 招生官]", title: "2023招生季[你好 招生官]",
text: "[权威、官方]的第一手信息。" text: "[权威、官方]的第一手信息。"
} }
] ],
showList: []
} }
}, },
methods: { methods: {
@ -50,8 +54,8 @@ export default {
console.log(index); console.log(index);
}, },
starClick(k) { starClick(k) {
if (this.starList[k].checked) this.starList[k].checked = false // if (this.starList[k].checked) this.starList[k].checked = false
else this.starList[k].checked = true // else this.starList[k].checked = true
this.$forceUpdate() this.$forceUpdate()
}, },
@ -59,7 +63,6 @@ export default {
// //
getAllForum() { getAllForum() {
this.$http.post("/api/home/allForum").then((res) => { this.$http.post("/api/home/allForum").then((res) => {
console.log(res, "res");
if (res.code != 200) return; if (res.code != 200) return;
this.list = res.data this.list = res.data
}).catch(err => { }).catch(err => {
@ -67,15 +70,15 @@ export default {
}); });
} }
}, },
mounted() {
this.getAllForum()
},
created() { created() {
console.log("dfgkljdflkdfgj"); console.log("dfgkljdflkdfgj");
console.log(this.allActive);
this.starList.forEach(el => {
el.checked = false
})
this.getAllForum()
// https://forum.gter.net // https://forum.gter.net
@ -193,7 +196,8 @@ export default {
align-items: center; align-items: center;
img { img {
width: 20px; width: .48rem;
height: .46rem;
} }
} }