wangfukang 1 month ago
parent
commit
a0cbb32ed0
  1. 46
      package1/group/groupBuySingle.vue

46
package1/group/groupBuySingle.vue

@ -630,7 +630,7 @@
const sysInfo = uni.getSystemInfoSync();
const bottomBarPx = Math.round(80 * sysInfo.windowWidth / 375);
const h = sysInfo.windowHeight - this.navBarHeight - bottomBarPx;
return 'display:flex;position:fixed;left:0;top:' + this.navBarHeight + 'px;width:100%;height:' + h + 'px;z-index:50;background:#F5F8F5;padding:0 2.5%;box-sizing:border-box;';
return 'display:flex;position:fixed;left:0;top:' + this.navBarHeight + 'px;width:95%;margin:0 auto;right:0;height:' + h + 'px;z-index:50;background:#F5F8F5;box-sizing:border-box;';
} else {
return 'display:flex;height:72%;margin-top:20rpx;';
}
@ -731,10 +731,18 @@
this.lastScrollTop = e.scrollTop;
// container
const stickyThreshold = this.containerOriginalTop - this.navBarHeight;
if (e.scrollTop >= stickyThreshold && stickyThreshold > 0) {
if (stickyThreshold <= 0) return;
if (e.scrollTop >= stickyThreshold) {
if (!this.isContainerSticky) {
this.isContainerSticky = true;
}
//
if (e.scrollTop > stickyThreshold + 5) {
uni.pageScrollTo({
scrollTop: stickyThreshold,
duration: 0
});
}
} else {
if (this.isContainerSticky) {
this.isContainerSticky = false;
@ -887,32 +895,46 @@
}
const selectedCategory = this.menuList[index];
// ""id
// ""idtuijian
if (!selectedCategory.id && selectedCategory.id !== 0) {
this.goodsListScrollTop = 0;
this.$nextTick(() => {
this.goodsListScrollTop = 0;
});
} else {
// scroll-into-view
setTimeout(() => { this.isSwitching = false; }, 300);
this.$forceUpdate();
return;
}
//
const doScrollToCategory = () => {
const targetId = 'category-' + selectedCategory.id;
// id
this.scrollIntoViewId = '';
this.$nextTick(() => {
this.isAutoScrolling = true;
this.scrollIntoViewId = targetId;
//
setTimeout(() => {
this.isAutoScrolling = false;
this.isSwitching = false;
}, 500);
});
return;
};
//
if (!this.isContainerSticky) {
const stickyThreshold = this.containerOriginalTop - this.navBarHeight;
uni.pageScrollTo({
scrollTop: stickyThreshold,
duration: 200,
complete: () => {
setTimeout(() => {
doScrollToCategory();
}, 250);
}
});
} else {
doScrollToCategory();
}
setTimeout(() => {
this.isSwitching = false;
}, 300);
this.$forceUpdate();
},
openOrderWait(item){

Loading…
Cancel
Save