From 501e7180823c29e893d87efabd0e2b9a629bae40 Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Fri, 20 Aug 2021 17:25:09 +0800
Subject: [PATCH] 下拉刷新等
---
pages/dispatch/dispatch.vue | 42 ++++++++++++++++++++++++++++++++++++++----
1 files changed, 38 insertions(+), 4 deletions(-)
diff --git a/pages/dispatch/dispatch.vue b/pages/dispatch/dispatch.vue
index 3f0ecdc..c0c0018 100644
--- a/pages/dispatch/dispatch.vue
+++ b/pages/dispatch/dispatch.vue
@@ -59,8 +59,9 @@
<u-tabs :list="list" :is-scroll="false" :current="current" active-color="#14B9C8"
inactive-color="#595959" height="100" @change="change"></u-tabs>
- <u-search v-model='keyValue' placeholder='请输入指令内容' shape="round" class="u-search" input-align="center"
- height="70" @search='searchValue' @custom='searchValue' @clear='clearValue' @change='changeValue'>
+ <u-search v-model='keyValue' placeholder='请输入指令内容' shape="round" class="u-search"
+ input-align="center" height="70" @search='searchValue' @custom='searchValue' @clear='clearValue'
+ @change='changeValue'>
</u-search>
<view v-show="current == 0 && newsList.length > 0">
@@ -141,6 +142,8 @@
pages: 0,
flag: true,
+ pullDown: false
+
};
},
onLoad() {
@@ -163,6 +166,27 @@
that.getSend();
}
}, 1000);
+ },
+
+ onPullDownRefresh: function() {
+ var that = this;
+
+ this.pullDown = true;
+ this.pagelist = 0;
+ this.pages = 0;
+ this.flag = true;
+ this.dataList = [];
+ this.newsList = [];
+ this.status = 'loading';
+ this.keyValue = '';
+ setTimeout(() => {
+ if (that.current == 0) {
+ that.getReceive();
+ } else {
+ that.getSend();
+ }
+ }, 1000)
+
},
mounted() {
this.getReceive();
@@ -191,6 +215,11 @@
that.pages = res.data.data.pages;
var resdata = res.data.data.records;
+
+ if (this.pullDown == true) {
+ this.pullDown = false;
+ uni.stopPullDownRefresh();
+ }
if (resdata.length == 0) {
that.flag = false
@@ -234,6 +263,11 @@
that.pages = res.data.data.pages;
var resdata = res.data.data.records;
+
+ if (this.pullDown == true) {
+ this.pullDown = false;
+ uni.stopPullDownRefresh();
+ }
if (resdata.length == 0) {
that.flag = false
@@ -381,8 +415,8 @@
width: 100%;
max-height: 100vh;
-
-
+
+
.head {
position: relative;
--
Gitblit v1.9.3