diff --git a/components/customTab.vue b/components/customTab.vue
index ef96390..3ce94ae 100644
--- a/components/customTab.vue
+++ b/components/customTab.vue
@@ -3,8 +3,7 @@
@@ -327,6 +320,9 @@
bigTypeDomInfo: null,
smallTypeDomInfo: null,
categoryWrapHeight: 0,
+ wrapHeight: 332,
+ isShowSmall: false,
+ scrollTop: 0,
}
},
computed: {
@@ -372,24 +368,49 @@
})
}
},
- onPullDownRefresh() {
- this.initData(true, true);
- },
- onReachBottom() {
- this.initData(false, true);
- },
- onReady() {
- // 获取dom信息
- // this.$util.getDom(this, '.category', (res) => {
- // this.bigTypeDomInfo = res;
- // this.categoryWrapHeight = res.height;
- // });
+ // onPullDownRefresh() {
+ // this.initData(true, true);
+ // },
+ // onReachBottom() {
+ // this.initData(false, true);
+ // },
+
+ watch: {
+ 'where.cate_pid'(newVal, oldVal) {
+ if (newVal && !oldVal) {
+ this.wrapHeight = this.tabsCurr == 2 ? 400 : (332 + 48);
+ this.isShowSmall = true;
+ }
+ if (!newVal && oldVal) {
+ this.wrapHeight = this.tabsCurr == 2 ? 400 : 332;
+ this.isShowSmall = false;
+ }
+ }
},
+
methods: {
onAllCategory() {
this.$refs.popup.open();
},
+ scrolltoupper() {
+ this.initData(true, true);
+ },
+
+ onScrollBottom(e) {
+ this.initData(false, true);
+ },
+
+ onScroll(e) {
+ if (this.scrollTop >= e.target.scrollTop) { //上拉
+ this.wrapHeight = this.tabsCurr == 2 ? 400 : 332;
+ if (this.where.cate_pid) this.wrapHeight = this.wrapHeight + 48;
+ } else {
+ this.wrapHeight = 0;
+ }
+ this.scrollTop = e.target.scrollTop;
+ },
+
initData(re = false, stop = false) {
if (!stop) this.getStoreCategory();
if (this.tabsCurr == 2 && this.subCurr == 1) this.storeMerchantList(re, stop);
@@ -460,6 +481,7 @@
this.cate_change = 0;
this.cate_change_children = 0;
if (this.tabsCurr != 2 || (this.tabsCurr == 2 && this.subCurr != 1)) this.where.mer_type = e;
+ this.wrapHeight = this.tabsCurr == 2 ? 400 : this.where.cate_pid ? (332 + 48) : 332;
this.initData(true);
},
changeCate(e) {
@@ -612,6 +634,10 @@
}
.wholeSale-header-search-wrap {
+ position: sticky;
+ top: calc(82rpx + var(--status-bar-height));
+ transition: height .5s;
+ overflow: hidden;
padding: 30rpx 20rpx 0;
background-color: #fff;
}
@@ -688,14 +714,9 @@
}
}
- .category_wrap {
- overflow: hidden;
- }
-
.category {
width: 100%;
overflow: auto;
- margin-bottom: 20rpx;
position: relative;
padding-right: 70rpx;
@@ -908,7 +929,6 @@
.goods_list {
.goods {
- // width: 690rpx;
height: 200rpx;
margin: 20rpx auto;
margin-top: 0;
diff --git a/static/images/loading.gif b/static/images/loading.gif
new file mode 100644
index 0000000..5e1f8fa
Binary files /dev/null and b/static/images/loading.gif differ