From 0946bddb11258333455a9b82c98d1debdeba7543 Mon Sep 17 00:00:00 2001 From: "DESKTOP-RQ919RC\\Pc" <1300399510@qq.com> Date: Thu, 15 May 2025 19:05:40 +0800 Subject: [PATCH] =?UTF-8?q?4.6=E6=8E=A5=E6=8E=A5=E5=8F=A3=EF=BC=8C?= =?UTF-8?q?=E5=B7=AE=E7=82=B9=E8=AF=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/user.vue | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/views/user.vue b/src/views/user.vue index ce66dd7..08f000b 100644 --- a/src/views/user.vue +++ b/src/views/user.vue @@ -71,8 +71,8 @@
-
-
+
+
@@ -113,7 +113,7 @@
-
+
@@ -213,6 +213,7 @@ import emptyDuck from "@/components/public/empty-duck.vue"; import choosingIdentity from "@/components/edit/choosingIdentity.vue"; import backToTop from "@/components/public/backToTop.vue"; import authenticationInfo from "@/components/seachModule/authenticationInfo.vue"; +import { redirectToExternalWebsite } from '@/utils/util.js' import { ref, reactive, onMounted, onUnmounted, getCurrentInstance, nextTick, pushScopeId } from "vue"; import { useRoute, useRouter } from "vue-router"; @@ -242,6 +243,7 @@ onMounted(() => { }); init(); + console.log("onMounted"); window.addEventListener("scroll", handleScroll); }); @@ -364,6 +366,7 @@ const getFavData = () => { newItem.typetype = item.type; newItem.token = item.token; if (newItem.typetype === "apartmentcollection" && typeof newItem.tags === "string") newItem.tags = newItem.tags.split(","); + if (newItem.typetype === "apartmentcollection" && typeof newItem.hottags === "string") newItem.hottags = newItem.hottags.split(","); return newItem; }); @@ -371,6 +374,8 @@ const getFavData = () => { favData.value["list"] = favData.value["list"].concat(list || []); favData.value["limit"] = data["limit"]; + count.value["fav"] = data["count"]; + nextTick(() => { masonryInstance.reloadItems(); masonryInstance.layout(); @@ -443,12 +448,14 @@ const refillData = (index) => { }) .then((res) => { if (res.code != 200) return; + let data = res.data; let list = data.data || []; list = list.map((item) => { const newItem = item.data ? { ...item.data } : { ...item }; newItem.typetype = item.type; newItem.token = item.token; if (newItem.typetype === "apartmentcollection" && typeof newItem.tags === "string") newItem.tags = newItem.tags.split(","); + if (newItem.typetype === "apartmentcollection" && typeof newItem.hottags === "string") newItem.hottags = newItem.hottags.split(","); return newItem; }); @@ -491,6 +498,8 @@ const handleDelete = (index, status) => { // 监听滚动到底部 const handleScroll = () => { + console.log("handleScroll"); + if (!user.value["uid"]) return; const scrollHeight = document.documentElement.scrollHeight; const clientHeight = document.documentElement.clientHeight; @@ -502,7 +511,8 @@ const handleScroll = () => { }; // 跳转公寓详情页 -const goApartmentDetail = (item) => router.push(`/apartmentDetail?uniqid=${item.uniqid}`); +const goApartmentDetail = (item) => redirectToExternalWebsite(`/apartmentDetail?uniqid=${item.uniqid}`) + onUnmounted(() => { window.removeEventListener("scroll", handleScroll);