This commit is contained in:
parent
acebf1a3ac
commit
aa324b5ceb
|
@ -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) {
|
||||
|
|
|
@ -142,9 +142,6 @@
|
|||
<view class="name u-line-2">{{item.store_name}}</view>
|
||||
<view class="tip u-line-1">
|
||||
<text>{{item.spec}}</text>
|
||||
<!-- <text>{{item.brand_name}}|</text> -->
|
||||
<!-- <text>{{item.class_name}}|</text> -->
|
||||
<!-- <text>{{item.unit_name}}</text> -->
|
||||
</view>
|
||||
</view>
|
||||
<view class="price-btn">
|
||||
|
@ -156,7 +153,7 @@
|
|||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view style="width: 100%;height: 350rpx;"></view>
|
||||
<view style="width: 100%;height: 470rpx;"></view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -222,7 +219,7 @@
|
|||
import useUserStore from "@/store/user";
|
||||
const userStore = useUserStore();
|
||||
const STORE_INFO = reactive({
|
||||
id: 4,
|
||||
id: 23,
|
||||
store_name: "农(特)产品直营店"
|
||||
})
|
||||
|
||||
|
@ -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,8 +613,8 @@
|
|||
}
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
const instance = getCurrentInstance(); // 获取组件实例
|
||||
|
||||
let instance; // 获取组件实例
|
||||
const getWXDom = () => {
|
||||
let query = uni.createSelectorQuery().in(instance).select("#drag_area");
|
||||
query.fields({
|
||||
|
@ -617,12 +622,17 @@
|
|||
scrollOffset: true,
|
||||
},
|
||||
(data) => {
|
||||
console.log(data)
|
||||
scoHeight = data.scrollHeight
|
||||
targetHeight.value = data.scrollHeight - data.height
|
||||
}
|
||||
).exec();
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
instance = getCurrentInstance(); // 获取组件实例
|
||||
setTimeout(() => {
|
||||
getWXDom()
|
||||
getWXDom(instance)
|
||||
}, 500)
|
||||
})
|
||||
</script>
|
||||
|
|
Loading…
Reference in New Issue