diff --git a/components/recommend/index.vue b/components/recommend/index.vue
index 4d510c0..cc26aa9 100644
--- a/components/recommend/index.vue
+++ b/components/recommend/index.vue
@@ -216,17 +216,17 @@
this.list = res.data.list;
setTimeout(() => {
this.$util.getDom(this, '.tabs', res => {
+ console.log(res.top);
+
// #ifdef APP
- this.tabsTop = res.top - 10;
+ this.tabsTop = res.top;
// #endif
// #ifdef H5
this.tabsTop = res.top;
// #endif
-
- console.log(this.tabsTop);
})
- }, 300)
+ }, 1000)
})
},
goDetail(item) {
diff --git a/pages.json b/pages.json
index 72e8341..c33f841 100644
--- a/pages.json
+++ b/pages.json
@@ -51,7 +51,7 @@
}, {
"path": "pages/whole_sale/index",
"style": {
- "enablePullDownRefresh": false,
+ "enablePullDownRefresh": true,
"navigationBarTitleText": "批发",
"navigationStyle": "custom"
}
@@ -388,14 +388,14 @@
"style": {
"navigationBarTitleText": "里海云仓",
"navigationStyle": "custom",
- "enablePullDownRefresh": false
+ "enablePullDownRefresh": true
}
},
{
"path": "market/market",
"style": {
"navigationBarTitleText": "供销云市场",
- "enablePullDownRefresh": false,
+ "enablePullDownRefresh": true,
"navigationStyle": "custom"
}
},
@@ -403,7 +403,7 @@
"path": "specialty/specialty",
"style": {
"navigationBarTitleText": "名优特产",
- "enablePullDownRefresh": false,
+ "enablePullDownRefresh": true,
"navigationStyle": "custom"
}
}
diff --git a/pages/cloud_warehouse/home/home.vue b/pages/cloud_warehouse/home/home.vue
index 7cef2b8..c46210a 100644
--- a/pages/cloud_warehouse/home/home.vue
+++ b/pages/cloud_warehouse/home/home.vue
@@ -1,3 +1,287 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{item.cate_name}}
+
+
+
+
+
+
+ 全部
+
+
+
+
+
+
+
+
+
+
+ {{item.cate_name}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{item.cate_name}}
-
-
-
-
-
-
- 全部
-
-
-
-
-
-
-
-
-
-
- {{item.cate_name}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/pages/cloud_warehouse/market/market.vue b/pages/cloud_warehouse/market/market.vue
index 3bc4c7a..20f11c8 100644
--- a/pages/cloud_warehouse/market/market.vue
+++ b/pages/cloud_warehouse/market/market.vue
@@ -1,5 +1,5 @@
-
+
+
+
@@ -67,55 +69,50 @@
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+ {{item.mer_name}}
+ 月销{{item.sales}}
-
-
- {{item.mer_name}}
- 月销{{item.sales}}
-
-
-
-
-
-
+
+
+
+
- {{item.service_score}}
- {{item.distance}}
- {{item.category_name}}
-
-
-
- {{item.service_phone}}
-
- {{item.mer_take_time[0]}}-{{item.mer_take_time[1]}}
-
-
-
- {{item.mer_address}}
+ {{item.service_score}}
+ {{item.distance}}
+ {{item.category_name}}
+
+
+
+ {{item.service_phone}}
+
+ {{item.mer_take_time[0]}}-{{item.mer_take_time[1]}}
+
+
+
+ {{item.mer_address}}
-
-
+
+
@@ -181,6 +178,7 @@
cate_change: 0,
goodsList: [],
isLoading: 0,
+ isScroll: false,
isShowAddress: false,
street: '定位中',
where: {
@@ -193,8 +191,7 @@
location: ''
},
wrapHeight: 300,
- scrollTop: 0,
- isTriggered: false
+ touchstarty: 0,
}
},
computed: {
@@ -206,6 +203,19 @@
hide_mer_status: '',
}, mapGetters(['viewColor', 'keyColor'])),
},
+
+ onPageScroll() {
+ uni.$emit('scroll');
+ },
+
+ onPullDownRefresh() {
+ this.storeMerchantList(true);
+ },
+
+ onReachBottom() {
+ this.storeMerchantList();
+ },
+
onLoad(option) {
let getAddress = uni.getStorageSync('getAddress');
let closeShow = uni.getStorageSync('closeShow');
@@ -221,39 +231,33 @@
this.merClassifly();
this.storeMerchantList();
},
- onPageScroll() {
- uni.$emit('scroll');
- },
+
methods: {
- // 下拉加载
- onPulling() {
- if (!this.isTriggered) {
- this.isTriggered = true;
- this.storeMerchantList(true);
- }
+
+ // 开始滑动
+ onTouchStart(e) {
+ this.touchstarty = e.touches[0].clientY;
},
- onRefresh(e) {
- this.isTriggered = true;
- },
-
- onScrollBottom(e) {
- this.storeMerchantList();
+ // 开始移动
+ onTouchMove(e) {
+ this.$nextTick(() => {
+ let deltaY = e.changedTouches[0].clientY - this.touchstarty;
+ if (deltaY <= 0) {
+ console.log("上滑")
+ this.wrapHeight = 0;
+ } else {
+ console.log('下滑');
+ this.wrapHeight = 300;
+ }
+ this.$forceUpdate();
+ })
},
onAllCategory() {
this.$refs.popup.open();
},
- onScroll(e) {
- if (this.scrollTop > e.target.scrollTop) { //上拉
- this.wrapHeight = 300;
- } else {
- this.wrapHeight = 0;
- }
- this.scrollTop = e.target.scrollTop;
- },
-
navTo(url) {
uni.navigateTo({
url: url,
@@ -279,12 +283,14 @@
this.$refs.popup && this.$refs.popup.close();
this.$forceUpdate();
},
+
// 进店
goStore(id) {
uni.navigateTo({
url: `/pages/store/home/index?id=${id}`
})
},
+
merClassifly() {
merClassifly().then(res => {
this.store_category = [{
@@ -294,6 +300,7 @@
}, ...res.data];
})
},
+
storeMerchantList(reLoad = false) {
if (reLoad) {
this.where.page = 1;
@@ -303,19 +310,21 @@
if (this.isLoading == -1) return;
this.isLoading = 1;
storeMerchantList(this.where).then(res => {
- this.isTriggered = false;
+ uni.stopPullDownRefresh();
this.goodsList = [...this.goodsList, ...res.data.list];
this.isLoading = 0;
if (res.data.list.length < this.where.limit) this.isLoading = -1;
this.where.page++;
}).catch(() => {
- this.isTriggered = false;
+ uni.stopPullDownRefresh();
})
},
+
closeShowAddress() {
this.isShowAddress = false;
uni.setStorageSync('closeShow', true);
},
+
// 选择位置
changeMap() {
uni.navigateTo({
@@ -347,6 +356,7 @@
}
})
},
+
getLocation() {
uni.getLocation({
type: 'gcj02',
@@ -403,7 +413,7 @@
})
}
})
- },
+ }
}
}
@@ -421,33 +431,33 @@
}
.wholeSale-header {
- position: sticky;
+ position: fixed;
top: 0;
z-index: 90;
- margin-bottom: 20rpx;
+ width: 100%;
background-color: #40AE36;
}
.wholeSale-section {
- position: sticky;
- top: calc(82rpx + var(--status-bar-height));
+ position: fixed;
+ z-index: 10;
+ top: calc(80rpx + var(--status-bar-height));
+ width: 100%;
padding: 0rpx 20rpx;
background-color: #fff;
transition: height .5s;
overflow: hidden;
- margin-bottom: 20rpx;
.wholeSale-nav {
display: flex;
align-items: center;
- margin-bottom: 40rpx;
+ padding: 20rpx 0;
.icon {
margin-right: 20rpx;
}
.search_content {
- // margin-bottom: 40rpx;
flex: 1;
height: 70rpx;
padding: 2px 2px 2px 21.05rpx;
diff --git a/pages/cloud_warehouse/specialty/specialty.vue b/pages/cloud_warehouse/specialty/specialty.vue
index 33beabb..f50087c 100644
--- a/pages/cloud_warehouse/specialty/specialty.vue
+++ b/pages/cloud_warehouse/specialty/specialty.vue
@@ -1,5 +1,5 @@
-
+
+
+
@@ -63,16 +65,10 @@
-
-
-
-
-
-
-
-
+
+
+
+
@@ -123,6 +119,7 @@
cate_change: 0,
cate_change_children: 0,
isLoading: 0,
+ isScroll: false,
where: {
page: 1,
limit: 20,
@@ -132,46 +129,52 @@
sale_type: 1, //1-零售, 2-批发
},
wrapHeight: 300,
- scrollTop: 0,
- isTriggered: true
+ touchstarty: 0
}
},
+
+ onPageScroll() {
+ uni.$emit('scroll');
+ },
+
+ onPullDownRefresh() {
+ this.getProductslist(true);
+ },
+
+ onReachBottom() {
+ this.getProductslist();
+ },
+
onLoad(option) {
this.getCategoryIndexList();
this.getProductslist(true);
},
- onPageScroll() {
- uni.$emit('scroll');
- },
+
methods: {
- // 下拉加载
- onPulling() {
- if (!this.isTriggered) {
- this.isTriggered = true;
- this.getProductslist(true);
- }
- },
- onRefresh(e) {
- this.isTriggered = true;
+ // 开始滑动
+ onTouchStart(e) {
+ this.touchstarty = e.touches[0].clientY;
},
- onScrollBottom(e) {
- this.getProductslist();
+ // 开始移动
+ onTouchMove(e) {
+ this.$nextTick(() => {
+ let deltaY = e.changedTouches[0].clientY - this.touchstarty;
+ if (deltaY <= 0) {
+ console.log("上滑")
+ this.wrapHeight = 0;
+ } else {
+ console.log('下滑');
+ this.wrapHeight = 300;
+ }
+ this.$forceUpdate();
+ })
},
onAllCategory() {
this.$refs.popup.open();
},
- onScroll(e) {
- if (this.scrollTop > e.target.scrollTop) { //上拉
- this.wrapHeight = 300;
- } else {
- this.wrapHeight = 0;
- }
- this.scrollTop = e.target.scrollTop;
- },
-
navTo(url) {
uni.navigateTo({
url: url,
@@ -241,13 +244,13 @@
if (this.isLoading == -1) return;
this.isLoading = 1;
getProductslist(this.where).then(res => {
- this.isTriggered = false;
+ uni.stopPullDownRefresh();
this.hostProduct = [...this.hostProduct, ...res.data.list];
this.where.page++;
this.isLoading = 0;
if (res.data.list.length < this.where.limit) this.isLoading = -1;
}).catch(() => {
- this.isTriggered = false;
+ uni.stopPullDownRefresh();
})
},
goDetail(item) {
@@ -282,27 +285,27 @@
.wholeSale {
.wholeSale-header {
- position: sticky;
+ position: fixed;
top: 0;
z-index: 90;
+ width: 100%;
background-color: #40AE36;
}
.wholeSale-section {
- position: sticky;
- top: calc(82rpx + var(--status-bar-height));
+ position: fixed;
+ top: calc(80rpx + var(--status-bar-height));
+ width: 100%;
padding: 0rpx 20rpx;
background-color: #fff;
transition: height .5s;
overflow: hidden;
- margin-bottom: 20rpx;
- padding-top: 20rpx;
- z-index: 20;
+ z-index: 89;
.wholeSale-nav {
display: flex;
align-items: center;
- margin-bottom: 40rpx;
+ padding: 20rpx 0;
.icon {
margin-right: 20rpx;
diff --git a/pages/index/index.vue b/pages/index/index.vue
index 76b93eb..0e55736 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -576,7 +576,7 @@
this.isScrolled = false
}
// 传入scrollTop值并触发所有easy-loadimage组件下的滚动监听事件
- uni.$emit('scroll');
+ uni.$emit('scroll', e);
if (e.scrollTop >= 100) {
uni.setTabBarItem({
@@ -662,6 +662,7 @@
that.isScrolled = res[0].top <= -60
})
})
+
this.isIndexClick = false;
if (this.isLogin) {
diff --git a/pages/whole_sale/index.vue b/pages/whole_sale/index.vue
index 1462006..ca6b182 100644
--- a/pages/whole_sale/index.vue
+++ b/pages/whole_sale/index.vue
@@ -1,207 +1,201 @@
-
+