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

View File

@ -2,11 +2,12 @@
<div class="recommend"> <div class="recommend">
<!-- 热门版块 --> <!-- 热门版块 -->
<div class="hot-box"> <div class="hot-box">
<div class="hot-label" :class="{ 'active': hotActive == index }" v-for="(item, index) in list" :key="index" <div class="hot-label" :class="{ 'active': hotActive == index }" v-for="(item, index) in hotList" :key="index"
@click="hotLabelClick(index)">{{ item.label }}</div> @click="hotLabelClick(index, item.fid)">{{ item.name }}</div>
</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> <section>
<template v-if="list.length == 0"> <template v-if="list.length == 0">
<index-list></index-list> <index-list></index-list>
@ -26,28 +27,33 @@ export default {
data() { data() {
return { return {
hotActive: -1,// hotActive: -1,//
list: [ hotList: [],
{ list: [],
label: "香港留学" fid: 0, // id
}, plate: {
{ stairname: "",//
label: "香港留学" subsectionsname: "",//
}, },
{ }
label: "香港留学" },
},
{ watch: {
label: "香港留学" "$parent.recommend": {
} handler(newV, oldV) {
] console.log(newV);
this.hotList = newV
},
immediate: true
} }
}, },
mounted() { mounted() {
console.log(this.$parent); console.log(this.$parent.recommend);
}, },
methods: { methods: {
hotLabelClick(index) { hotLabelClick(index, fid) {
console.log(fid);
this.fid = fid
this.hotActive = index this.hotActive = index
} }
}, },

View File

@ -108,9 +108,11 @@ export default {
let kw = this.kw let kw = this.kw
if (!kw) return if (!kw) return
this.page = 1 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 })
}, },
// //