4.6接接口,差点评

This commit is contained in:
DESKTOP-RQ919RC\Pc
2025-05-15 19:05:40 +08:00
parent d3d3542822
commit 0946bddb11

View File

@@ -71,8 +71,8 @@
</div>
<div class="list wid1200 flexflex" v-show="tabState == 'fav'" ref="gridContainer">
<div class="item" v-for="(item, index) in favData['list']" :key="item.id" @click="goApartmentDetail(item)">
<div v-if="item.typetype == 'apartmentroomfav'" class="apartment-item">
<div class="item" v-for="(item, index) in favData['list']" :key="item.id">
<div v-if="item.typetype == 'apartmentroomfav'" class="apartment-item" @click="goApartmentDetail(item)">
<div class="apartment-top flexacenter">
<img class="icon" src="@/assets/img/publicImage/apartment-icon.png" />
<img class="title" src="@/assets/img/publicImage/apartment-title.png" />
@@ -113,7 +113,7 @@
</div>
</div>
</div>
<div v-else-if="item.typetype == 'apartmentcollection'" class="apartment-item">
<div v-else-if="item.typetype == 'apartmentcollection'" class="apartment-item" @click="goApartmentDetail(item)">
<div class="apartment-top flexacenter">
<img class="icon" src="@/assets/img/publicImage/apartment-icon.png" />
<img class="title" src="@/assets/img/publicImage/apartment-title.png" />
@@ -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);