Commit 2658684e authored by 刘用法's avatar 刘用法

首页推荐订单翻页

parent 481248dc
...@@ -32,10 +32,10 @@ ...@@ -32,10 +32,10 @@
<style lang="scss" scoped> <style lang="scss" scoped>
.content { .content {
height: 100vh; // height: 100vh;
background-color: #f4f5f7; background-color: #f4f5f7;
padding: 0rpx 30rpx 0 30rpx; padding: 0rpx 30rpx 0 30rpx;
overflow-y: auto; // overflow-y: auto;
&.fixed { &.fixed {
height: 100vh; height: 100vh;
display: flex; display: flex;
......
<template> <template>
<TabBarPage title="充电桩自营平台"> <scroll-view scroll-y style="margin-bottom: 20rpx;height: 100vh;" @scrolltolower="reachBottom"
scroll-anchoring scroll-y="true" refresher-enabled="true" :refresher-triggered="triggered" :refresher-threshold="100"
refresher-background="#F4F5F7" @refresherpulling="triggered = true" @refresherrefresh="onRefresh"
@refresherrestore="onRestore" @refresherabort="onAbort">
<TabBarPage title="充电桩自营平台">
<image class="banner-image" :src="bannerImage"></image> <image class="banner-image" :src="bannerImage"></image>
<view class="msg-view"> <view class="msg-view">
...@@ -62,7 +66,8 @@ ...@@ -62,7 +66,8 @@
<view class="bottom-text">我也是有底线哒</view> <view class="bottom-text">我也是有底线哒</view>
<view class="bottom-line-view"></view> <view class="bottom-line-view"></view>
</view> </view>
</TabBarPage> </TabBarPage>
</scroll-view>
</template> </template>
<script> <script>
...@@ -95,7 +100,9 @@ ...@@ -95,7 +100,9 @@
token: "", token: "",
pageNumber: 0, pageNumber: 0,
pageSize: 100, pageSize: 100,
}, },
triggered: false,
_freshing: false,
}; };
}, },
watch: { watch: {
...@@ -131,7 +138,8 @@ ...@@ -131,7 +138,8 @@
return process.uniEnv.qn_base_url + 'weiruzhu.png' return process.uniEnv.qn_base_url + 'weiruzhu.png'
}, },
}, },
onLoad() { onLoad() {
this._freshing = false;
this.getOrderCount() this.getOrderCount()
}, },
onShow() { onShow() {
...@@ -140,17 +148,17 @@ ...@@ -140,17 +148,17 @@
this.initSettleInfo(); this.initSettleInfo();
} }
}, },
onPullDownRefresh() { // onPullDownRefresh() {
console.log('------下拉刷新------') // console.log('------下拉刷新------')
// 下拉刷洗 // // 下拉刷洗
this.initSettleInfo() // this.initSettleInfo()
}, // },
onReachBottom() { // onReachBottom() {
console.log('----------底部-------------', this.currentLoadStatus) // console.log('----------底部-------------', this.currentLoadStatus)
if (this.currentLoadStatus != 'loadmore') return // if (this.currentLoadStatus != 'loadmore') return
this.currentLoadStatus == 'loading' // this.currentLoadStatus == 'loading'
this.loadOrderList() // this.loadOrderList()
}, // },
// onPageScroll(obj) { // onPageScroll(obj) {
// console.log('---------scroll---------', obj) // console.log('---------scroll---------', obj)
// }, // },
...@@ -212,6 +220,8 @@ ...@@ -212,6 +220,8 @@
self.$u.api.listByRecommendOrder(self.search).then((res) => { self.$u.api.listByRecommendOrder(self.search).then((res) => {
uni.stopPullDownRefresh() // 结束下拉刷新 uni.stopPullDownRefresh() // 结束下拉刷新
self.loadedOrder = true self.loadedOrder = true
self.triggered = false;
self._freshing = false;
/*↓↓↓↓↓↓↓↓↓↓测试数据↓↓↓↓↓↓↓↓↓↓*/ /*↓↓↓↓↓↓↓↓↓↓测试数据↓↓↓↓↓↓↓↓↓↓*/
// if (res.data.list) { // if (res.data.list) {
// if (res.data.list.length == 0 && res.data.total > 0) { // if (res.data.list.length == 0 && res.data.total > 0) {
...@@ -262,12 +272,27 @@ ...@@ -262,12 +272,27 @@
onRestore() { onRestore() {
this.triggered = "restore"; this.triggered = "restore";
}, },
// reachBottom() { reachBottom() {
// console.log(this.currentLoadStatus) console.log(this.currentLoadStatus)
// if (this.currentLoadStatus != 'loadmore') return if (this.currentLoadStatus != 'loadmore') return
// this.currentLoadStatus == 'loading' this.currentLoadStatus == 'loading'
// this.loadOrderList() this.loadOrderList()
// }, },
onPulling(e) {
console.log("onpulling", e);
},
onRefresh() {
if (this._freshing) return;
this._freshing = true;
this.initSettleInfo()
},
onRestore() {
this.triggered = 'restore'; // 需要重置
console.log("onRestore");
},
onAbort() {
console.log("onAbort");
},
// clickSwiper(index) {}, // clickSwiper(index) {},
handleScroll() { handleScroll() {
console.log("-----scroll-------"); console.log("-----scroll-------");
...@@ -342,7 +367,7 @@ ...@@ -342,7 +367,7 @@
.banner-image { .banner-image {
width: 730rpx; width: 730rpx;
height: 280rpx; height: 280rpx;
margin-left: -14rpx; margin-left: -16rpx;
} }
.msg-view { .msg-view {
...@@ -468,7 +493,6 @@ ...@@ -468,7 +493,6 @@
.order-item-view { .order-item-view {
background-color: #F4F5F7; background-color: #F4F5F7;
border-radius: 12rpx; border-radius: 12rpx;
margin-bottom: 20rpx;
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment