4.6接接口,差点评
This commit is contained in:
@@ -71,8 +71,8 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="list wid1200 flexflex" v-show="tabState == 'fav'" ref="gridContainer">
|
<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 class="item" v-for="(item, index) in favData['list']" :key="item.id">
|
||||||
<div v-if="item.typetype == 'apartmentroomfav'" class="apartment-item">
|
<div v-if="item.typetype == 'apartmentroomfav'" class="apartment-item" @click="goApartmentDetail(item)">
|
||||||
<div class="apartment-top flexacenter">
|
<div class="apartment-top flexacenter">
|
||||||
<img class="icon" src="@/assets/img/publicImage/apartment-icon.png" />
|
<img class="icon" src="@/assets/img/publicImage/apartment-icon.png" />
|
||||||
<img class="title" src="@/assets/img/publicImage/apartment-title.png" />
|
<img class="title" src="@/assets/img/publicImage/apartment-title.png" />
|
||||||
@@ -113,7 +113,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</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">
|
<div class="apartment-top flexacenter">
|
||||||
<img class="icon" src="@/assets/img/publicImage/apartment-icon.png" />
|
<img class="icon" src="@/assets/img/publicImage/apartment-icon.png" />
|
||||||
<img class="title" src="@/assets/img/publicImage/apartment-title.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 choosingIdentity from "@/components/edit/choosingIdentity.vue";
|
||||||
import backToTop from "@/components/public/backToTop.vue";
|
import backToTop from "@/components/public/backToTop.vue";
|
||||||
import authenticationInfo from "@/components/seachModule/authenticationInfo.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 { ref, reactive, onMounted, onUnmounted, getCurrentInstance, nextTick, pushScopeId } from "vue";
|
||||||
import { useRoute, useRouter } from "vue-router";
|
import { useRoute, useRouter } from "vue-router";
|
||||||
@@ -242,6 +243,7 @@ onMounted(() => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
init();
|
init();
|
||||||
|
console.log("onMounted");
|
||||||
|
|
||||||
window.addEventListener("scroll", handleScroll);
|
window.addEventListener("scroll", handleScroll);
|
||||||
});
|
});
|
||||||
@@ -364,6 +366,7 @@ const getFavData = () => {
|
|||||||
newItem.typetype = item.type;
|
newItem.typetype = item.type;
|
||||||
newItem.token = item.token;
|
newItem.token = item.token;
|
||||||
if (newItem.typetype === "apartmentcollection" && typeof newItem.tags === "string") newItem.tags = newItem.tags.split(",");
|
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;
|
return newItem;
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -371,6 +374,8 @@ const getFavData = () => {
|
|||||||
favData.value["list"] = favData.value["list"].concat(list || []);
|
favData.value["list"] = favData.value["list"].concat(list || []);
|
||||||
favData.value["limit"] = data["limit"];
|
favData.value["limit"] = data["limit"];
|
||||||
|
|
||||||
|
count.value["fav"] = data["count"];
|
||||||
|
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
masonryInstance.reloadItems();
|
masonryInstance.reloadItems();
|
||||||
masonryInstance.layout();
|
masonryInstance.layout();
|
||||||
@@ -443,12 +448,14 @@ const refillData = (index) => {
|
|||||||
})
|
})
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res.code != 200) return;
|
if (res.code != 200) return;
|
||||||
|
let data = res.data;
|
||||||
let list = data.data || [];
|
let list = data.data || [];
|
||||||
list = list.map((item) => {
|
list = list.map((item) => {
|
||||||
const newItem = item.data ? { ...item.data } : { ...item };
|
const newItem = item.data ? { ...item.data } : { ...item };
|
||||||
newItem.typetype = item.type;
|
newItem.typetype = item.type;
|
||||||
newItem.token = item.token;
|
newItem.token = item.token;
|
||||||
if (newItem.typetype === "apartmentcollection" && typeof newItem.tags === "string") newItem.tags = newItem.tags.split(",");
|
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;
|
return newItem;
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -491,6 +498,8 @@ const handleDelete = (index, status) => {
|
|||||||
|
|
||||||
// 监听滚动到底部
|
// 监听滚动到底部
|
||||||
const handleScroll = () => {
|
const handleScroll = () => {
|
||||||
|
console.log("handleScroll");
|
||||||
|
|
||||||
if (!user.value["uid"]) return;
|
if (!user.value["uid"]) return;
|
||||||
const scrollHeight = document.documentElement.scrollHeight;
|
const scrollHeight = document.documentElement.scrollHeight;
|
||||||
const clientHeight = document.documentElement.clientHeight;
|
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(() => {
|
onUnmounted(() => {
|
||||||
window.removeEventListener("scroll", handleScroll);
|
window.removeEventListener("scroll", handleScroll);
|
||||||
|
|||||||
Reference in New Issue
Block a user