From 48324cd36f1ff787d91e2bac1b5205d666178bcf Mon Sep 17 00:00:00 2001 From: wenfp Date: Tue, 21 Apr 2026 23:58:58 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=95=86=E5=93=81=E5=AE=A2?= =?UTF-8?q?=E6=9C=8D=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/goods-detail/index.vue | 43 +++++++++++++++++++++++++++++--- 1 file changed, 39 insertions(+), 4 deletions(-) diff --git a/src/pages/goods-detail/index.vue b/src/pages/goods-detail/index.vue index ffe3210..59f4a9b 100644 --- a/src/pages/goods-detail/index.vue +++ b/src/pages/goods-detail/index.vue @@ -32,15 +32,20 @@
  • {{ lType.name }}
  • -
    +
    -
    没有更多了
    -
    暂无数据
    -
    查看更多
    +
    +
    没有更多了
    +
    暂无数据
    +
    查看更多
    +
    +
    + +
    @@ -81,16 +86,20 @@ import { swiper, swiperSlide } from "vue-awesome-swiper"; import { getGoodsDetail, getOrderCompare, hasLogin } from "@/api"; import SelectSpec from "./components/select-spec.vue"; import FillInformation from "./components/fill-information.vue"; +import ObserverInteraction from "@/util/ObserverInteraction"; +import CustomerService from "@/components/customer-service/index.vue"; export default { components: { swiper, swiperSlide, SelectSpec, + CustomerService, FillInformation, }, data() { return { + observer: null, result: "a", showAnyAmount: false, paddingBottom: 0, @@ -146,7 +155,22 @@ export default { mounted() { this.getGoodsDetail("common"); }, + beforeDestroy() { + this.observer.disconnect(); + }, methods: { + initObserver() { + this.observer = new ObserverInteraction(); + + // 3. 监听元素可见性 + this.observer.observeVisibility( + this.$refs.target, + () => { + this.loadMoreFn(); + }, + { threshold: 0.5 } + ); + }, backHome() { const { query } = this.$router.currentRoute; const name = query.temple_id === "1" ? "home" : "temple-home"; @@ -217,6 +241,7 @@ export default { await this.getPayRecords(this.lTypeId, 1); this.$nextTick(() => { this.paddingBottom = this.$refs.fixedBottom.getOffsetHeight() - 50; + this.initObserver(); }); this.wechatReady({ ...this.data.shareConfig, @@ -226,6 +251,7 @@ export default { // 获取更多感恩功德1 loadMoreFn() { this.page += 1; + if (this.noMore) return; this.getPayRecords(this.lTypeId, this.page); }, // 获取感恩功德 @@ -347,6 +373,9 @@ $lightWidth: 1.3rem; } } } + .paied_list { + flex: 1 1; + } } .swiper-container { background: #f5f5f5; @@ -515,5 +544,11 @@ $lightWidth: 1.3rem; } } } + + .customer-absolute { + position: absolute; + right: 0.3rem; + top: 0.28rem; + } }