diff --git a/config/app.js b/config/app.js
index ab2ac5f..85facca 100644
--- a/config/app.js
+++ b/config/app.js
@@ -1,8 +1,8 @@
let BASE_URL
import store from "@/store/user.js"
// 环境
-let env = "dev"
-// let env = "prod"
+// let env = "dev"
+let env = "prod"
// let env = "liu";
switch (env) {
diff --git a/pages/index/index.vue b/pages/index/index.vue
index f8b1536..cbaa954 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -142,9 +142,6 @@
{{item.store_name}}
{{item.spec}}
-
-
-
@@ -156,7 +153,7 @@
-
+
@@ -222,7 +219,7 @@
import useUserStore from "@/store/user";
const userStore = useUserStore();
const STORE_INFO = reactive({
- id: 4,
+ id: 23,
store_name: "农(特)产品直营店"
})
@@ -233,13 +230,13 @@
STORE_INFO[key] = data[key]
}
}
- getStoreInfo().then(res => {
- uni.setStorageSync("STORE_INFO", JSON.stringify(res.data));
- let data = res.data;
- for (let key in data) {
- STORE_INFO[key] = data[key]
- }
- })
+ getStoreInfo().then(res => {
+ uni.setStorageSync("STORE_INFO", JSON.stringify(res.data));
+ let data = res.data;
+ for (let key in data) {
+ STORE_INFO[key] = data[key]
+ }
+ })
}
getStoreInfoFn()
@@ -266,12 +263,16 @@
})
/*商品列表滚动隐藏头部导航 */
- const instance = getCurrentInstance(); // 获取组件实例
const targetHeight = ref(0)
+ let scoHeight = 0
const isScroll = ref(false)
let lastScollTop = 0
const hideHeadView = (e) => {
- if (e.detail.scrollTop <= 0 || e.detail.scrollTop >= targetHeight.value) return
+ if (e.detail.scrollTop < 100) return
+ console.log(e.detail.scrollTop, scoHeight, targetHeight.value)
+ // if (targetHeight.value < 200) return
+ if (e.detail.scrollTop <= 0 || e.detail.scrollTop > targetHeight.value)
+ return
isScroll.value = e.detail.scrollTop > lastScollTop
lastScollTop = e.detail.scrollTop
}
@@ -293,6 +294,8 @@
const leftActive = ref(0);
const changeTwo = (item, index) => {
+ isScroll.value = false;
+ getWXDom(instance)
leftActive.value = item.id;
show.value = 0;
goodClassThree.value = item?.children || [];
@@ -337,7 +340,7 @@
const where = ref({
page_no: 1,
- page_size: 25,
+ page_size: 10,
name: '',
order: '',
store_name: '',
@@ -375,6 +378,8 @@
// 商品列表触底
const loadMoreGood = () => {
+
+ getWXDom(instance)
getGoodList(true);
}
@@ -608,21 +613,26 @@
}
});
+
+ let instance; // 获取组件实例
+ const getWXDom = () => {
+ let query = uni.createSelectorQuery().in(instance).select("#drag_area");
+ query.fields({
+ size: true,
+ scrollOffset: true,
+ },
+ (data) => {
+ console.log(data)
+ scoHeight = data.scrollHeight
+ targetHeight.value = data.scrollHeight - data.height
+ }
+ ).exec();
+ }
+
onMounted(() => {
- const instance = getCurrentInstance(); // 获取组件实例
- const getWXDom = () => {
- let query = uni.createSelectorQuery().in(instance).select("#drag_area");
- query.fields({
- size: true,
- scrollOffset: true,
- },
- (data) => {
- targetHeight.value = data.scrollHeight - data.height
- }
- ).exec();
- }
+ instance = getCurrentInstance(); // 获取组件实例
setTimeout(() => {
- getWXDom()
+ getWXDom(instance)
}, 500)
})