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;
+ }
}