no message

This commit is contained in:
xiaoronghao 2023-04-07 19:05:21 +08:00
parent 9e678d108c
commit 1d244c56e5
3 changed files with 34 additions and 34 deletions

View File

@ -84,7 +84,7 @@ export default {
if (twofid) this.twofid = twofid
if (invitationPage) this.invitationPage = Number(invitationPage)
if (Number(onefid) > 0) this.a()
if (Number(onefid) > 0) this.handQuery()
if (Number(twofid) > 0) this.getInvitationList()
@ -92,18 +92,15 @@ export default {
},
methods: {
a() {
// query
handQuery() {
if (this.list.length >= 2) {
let list = this.list
list.forEach((el, index) => {
// console.log(this.twofid);
if (el.fid == this.onefid) this.allActive = index
if (this.twofid) {
el.data.forEach((element, i) => {
console.log(element, i);
if (element.fid == this.twofid) {
this.plate = {
stairname: el.name,
@ -116,11 +113,9 @@ export default {
})
console.log(this.onefid, "onefidonefid");
} else {
setTimeout(() => {
this.a()
this.handQuery()
}, 500)
}
@ -132,10 +127,7 @@ export default {
allClick(index, fid) {
this.allActive = index
const params = new URLSearchParams(window.location.search);
params.set('onefid', fid);
const newUrl = window.location.pathname + '?' + params.toString();
window.history.pushState({}, '', newUrl);
this.$updateURLSearchParams({ onefid: fid })
},
//

View File

@ -2,11 +2,12 @@
<div class="recommend">
<!-- 热门版块 -->
<div class="hot-box">
<div class="hot-label" :class="{ 'active': hotActive == index }" v-for="(item, index) in list" :key="index"
@click="hotLabelClick(index)">{{ item.label }}</div>
<div class="hot-label" :class="{ 'active': hotActive == index }" v-for="(item, index) in hotList" :key="index"
@click="hotLabelClick(index, item.fid)">{{ item.name }}</div>
</div>
<!-- 路径 -->
<plate-navigation stairname="香港澳门台湾" subsectionsname="SAT、AP考试、海外本科申…"></plate-navigation>
<plate-navigation v-if="fid != 0" :stairname="plate.subsectionsname"
:subsectionsname="plate.subsectionsname"></plate-navigation>
<section>
<template v-if="list.length == 0">
<index-list></index-list>
@ -26,28 +27,33 @@ export default {
data() {
return {
hotActive: -1,//
list: [
{
label: "香港留学"
},
{
label: "香港留学"
},
{
label: "香港留学"
},
{
label: "香港留学"
}
]
hotList: [],
list: [],
fid: 0, // id
plate: {
stairname: "",//
subsectionsname: "",//
},
}
},
watch: {
"$parent.recommend": {
handler(newV, oldV) {
console.log(newV);
this.hotList = newV
},
immediate: true
}
},
mounted() {
console.log(this.$parent);
console.log(this.$parent.recommend);
},
methods: {
hotLabelClick(index) {
hotLabelClick(index, fid) {
console.log(fid);
this.fid = fid
this.hotActive = index
}
},

View File

@ -108,9 +108,11 @@ export default {
let kw = this.kw
if (!kw) return
this.page = 1
this.getSearchResult()
this.$updateURLSearchParams({ kw: this.kw, page: this.page })
this.$router.push({ path: `/searchResult`, query: { kw: this.kw, page: this.page } })
// this.getSearchResult()
// this.$updateURLSearchParams({ kw: this.kw, page: this.page })
},
//