no message
This commit is contained in:
parent
9e678d108c
commit
1d244c56e5
@ -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);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// 点击收藏
|
// 点击收藏
|
||||||
|
@ -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
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -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 })
|
||||||
},
|
},
|
||||||
|
|
||||||
// 获取搜索结果数据
|
// 获取搜索结果数据
|
||||||
|
Loading…
x
Reference in New Issue
Block a user