no message
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
<Head>
|
||||
<Title>寄托面经</Title>
|
||||
</Head>
|
||||
<Header></Header>
|
||||
<TopHead></TopHead>
|
||||
<div class="search-result flexacenter" v-if="keyword">
|
||||
<div class="keyword flexacenter" @click="clearKeyword">{{ keyword }} <img class="keyword-icon" src="@/assets/img/cross-circle-icon.png" /></div>
|
||||
<div class="halving-line"></div>
|
||||
@@ -21,6 +21,9 @@
|
||||
|
||||
<script setup>
|
||||
import { ElMessage } from "element-plus"
|
||||
let isNeedLogin = inject("isNeedLogin")
|
||||
const goLogin = inject("goLogin")
|
||||
useHead({ script: [{ src: "https://app.gter.net/bottom?tpl=header&menukey=mj" }] })
|
||||
|
||||
const gridContainer = ref(null)
|
||||
let masonryInstance = null
|
||||
@@ -31,8 +34,6 @@ keyword.value = route.query["keyword"]
|
||||
|
||||
watchEffect(() => {
|
||||
if (keyword.value != route.query["keyword"]) {
|
||||
// keyword.value = route.query["keyword"]
|
||||
// console.log("keyword", keyword.value)
|
||||
list.value = []
|
||||
page.value = 1
|
||||
keyword.value = route.query["keyword"]
|
||||
@@ -52,6 +53,8 @@ onMounted(async () => {
|
||||
// masonryInstance.layout()
|
||||
|
||||
window.addEventListener("scroll", handleScroll)
|
||||
|
||||
getList()
|
||||
})
|
||||
|
||||
const handleScroll = () => {
|
||||
@@ -83,7 +86,6 @@ const getList = () => {
|
||||
})
|
||||
return
|
||||
}
|
||||
// console.log("res", res.code)
|
||||
let data = res.data
|
||||
// list.value = data.data
|
||||
|
||||
@@ -95,32 +97,33 @@ const getList = () => {
|
||||
count.value = data["count"]
|
||||
|
||||
nextTick(() => {
|
||||
masonryInstance.reloadItems()
|
||||
masonryInstance.layout()
|
||||
if (masonryInstance) {
|
||||
masonryInstance.reloadItems()
|
||||
masonryInstance.layout()
|
||||
}
|
||||
})
|
||||
})
|
||||
.finally(() => (loading = false))
|
||||
}
|
||||
|
||||
getList()
|
||||
|
||||
const handleLike = token => {
|
||||
if (isNeedLogin.value) {
|
||||
goLogin()
|
||||
return
|
||||
}
|
||||
|
||||
operateLikeHttp({ token }).then(res => {
|
||||
if (res.code != 200) return
|
||||
let data = res.data
|
||||
|
||||
list.value.forEach(element => {
|
||||
console.log(element, "element")
|
||||
if (element["token"] == token) {
|
||||
element["islike"] = data["status"]
|
||||
element["likenum"] = data["count"]
|
||||
}
|
||||
})
|
||||
|
||||
ElMessage({
|
||||
message: res.message,
|
||||
type: "success",
|
||||
})
|
||||
ElMessage.success(res.message)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -131,9 +134,8 @@ onUnmounted(() => {
|
||||
const router = useRouter()
|
||||
|
||||
// 清除搜索
|
||||
const clearKeyword = () => {
|
||||
router.push(`/index.html`)
|
||||
}
|
||||
// const clearKeyword = () => router.push(`/index.html`)
|
||||
const clearKeyword = () => goToURL(`/index.html`)
|
||||
|
||||
try {
|
||||
if (process.server) {
|
||||
@@ -182,7 +184,7 @@ try {
|
||||
}
|
||||
}
|
||||
.content {
|
||||
min-height: 540px;
|
||||
min-height: calc(100vh - 250px);
|
||||
width: 1200px;
|
||||
// height: 1000px;
|
||||
margin: 0 auto 93px;
|
||||
|
||||
Reference in New Issue
Block a user