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/securityStaff/exhibition.vue | 27 ++++
pages/message/message.vue | 39 ++++++
components/contacts/contacts.vue | 3
components/submit/submit.vue | 3
pages.json | 56 ++++----
pages/dispatch/dispatch.vue | 42 ++++++
pages/examine/examine.vue | 38 ++++++
pages/company/company.vue | 39 +++++-
pages/report/report.vue | 43 ++++++
pages/groupChat/groupChat.vue | 30 +++-
10 files changed, 259 insertions(+), 61 deletions(-)
diff --git a/components/contacts/contacts.vue b/components/contacts/contacts.vue
index 8d8c7e2..b9dafa2 100644
--- a/components/contacts/contacts.vue
+++ b/components/contacts/contacts.vue
@@ -77,7 +77,8 @@
var datas = this.Pdata;
//alert(datas.name)
uni.navigateTo({
- url: '/pages/groupChat/chating?chatID=' + datas.recipientId.toString()
+ url: '/pages/groupChat/chating?chatID=' + datas.recipientId.toString() + '&data=' + JSON.stringify(
+ datas)
});
},
QZchating() {
diff --git a/components/submit/submit.vue b/components/submit/submit.vue
index 68266b2..918e8a1 100644
--- a/components/submit/submit.vue
+++ b/components/submit/submit.vue
@@ -89,6 +89,9 @@
pageY: 0,
};
},
+ mounted() {
+ console.log(this.callname,1111)
+ },
components: {
emoji,
},
diff --git a/pages.json b/pages.json
index 12dc4a3..cae1ad4 100644
--- a/pages.json
+++ b/pages.json
@@ -67,7 +67,7 @@
"path": "pages/groupChat/groupChat",
"style": {
"navigationBarTitleText": "聊天室",
- "enablePullDownRefresh": false,
+ "enablePullDownRefresh": true,
"navigationStyle": "custom"
}
},
@@ -88,24 +88,24 @@
}
},
{
- "path" : "pages/groupChat/friendrequest",
- "style" : {
- "navigationStyle" : "custom"
- }
+ "path": "pages/groupChat/friendrequest",
+ "style": {
+ "navigationStyle": "custom"
+ }
},
{
- "path" : "pages/groupChat/addFriend",
- "style" : {
- "navigationStyle" : "custom"
- }
+ "path": "pages/groupChat/addFriend",
+ "style": {
+ "navigationStyle": "custom"
+ }
},
{
"path": "pages/securityStaff/exhibition",
"style": {
"navigationBarTitleText": "保安管理",
- "enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#0BB9C8",
- "navigationBarTextStyle": "white"
+ "navigationBarTextStyle": "white",
+ "enablePullDownRefresh": true
}
},
{
@@ -120,9 +120,9 @@
"path": "pages/company/company",
"style": {
"navigationBarTitleText": "服务单位",
- "enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#0BB9C8",
- "navigationBarTextStyle": "white"
+ "navigationBarTextStyle": "white",
+ "enablePullDownRefresh": true
}
},
{
@@ -138,10 +138,10 @@
"path": "pages/report/report",
"style": {
"navigationBarTitleText": "工作汇报",
- "enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#0BB9C8",
"navigationBarTextStyle": "white",
- "navigationStyle": "custom"
+ "navigationStyle": "custom",
+ "enablePullDownRefresh": true
}
},
{
@@ -175,7 +175,7 @@
"path": "pages/dispatch/dispatch",
"style": {
"navigationBarTitleText": "调度指令",
- "enablePullDownRefresh": false,
+ "enablePullDownRefresh": true,
"navigationBarBackgroundColor": "#0BB9C8",
"navigationBarTextStyle": "white",
"navigationStyle": "custom"
@@ -203,7 +203,7 @@
"path": "pages/message/message",
"style": {
"navigationBarTitleText": "通知通告",
- "enablePullDownRefresh": false,
+ "enablePullDownRefresh": true,
"navigationBarBackgroundColor": "#0BB9C8",
"navigationBarTextStyle": "white",
"navigationStyle": "custom"
@@ -231,7 +231,7 @@
"path": "pages/examine/examine",
"style": {
"navigationBarTitleText": "现场检查",
- "enablePullDownRefresh": false,
+ "enablePullDownRefresh": true,
"navigationBarBackgroundColor": "#0BB9C8",
"navigationBarTextStyle": "white",
"navigationStyle": "custom"
@@ -390,18 +390,16 @@
"navigationStyle": "custom"
// "enablePullDownRefresh": false
}
+ }, {
+ "path": "pages/groupChat/newGroup/newGroup",
+ "style": {
+ "navigationBarTitleText": "新建群组",
+ "navigationBarBackgroundColor": "#0BB9C8",
+ "navigationBarTextStyle": "white"
+ }
+
}
- ,{
- "path" : "pages/groupChat/newGroup/newGroup",
- "style" :
- {
- "navigationBarTitleText": "新建群组",
- "navigationBarBackgroundColor": "#0BB9C8",
- "navigationBarTextStyle": "white"
- }
-
- }
- ],
+ ],
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "",
diff --git a/pages/company/company.vue b/pages/company/company.vue
index dc46b90..4070ef3 100644
--- a/pages/company/company.vue
+++ b/pages/company/company.vue
@@ -41,7 +41,9 @@
keyValue: '',
pagelist: 0,
pages: 0,
- flag: true
+ flag: true,
+
+ pullDown: false
};
},
onLoad() {
@@ -63,6 +65,20 @@
},
+
+ onPullDownRefresh: function() {
+ this.pullDown = true;
+ this.pagelist = 0;
+ this.pages = 0;
+ this.flag = true;
+ this.dataList = [];
+ this.newsList = [];
+ this.status = 'loading';
+ this.keyValue = '';
+ setTimeout(() => {this.getCompany();}, 1000)
+
+ },
+
mounted() {
this.getCompany();
},
@@ -89,6 +105,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
@@ -100,13 +121,13 @@
that.dataList.push(item)
})
}
-
+
if (that.pagelist == that.pages) {
that.flag = false
that.status = 'nomore';
return
}
-
+
}
});
},
@@ -122,7 +143,7 @@
return
} else {
that.newsList = [];
-
+
uni.request({
url: that.$store.state.piAPI + "/information/page",
method: "get",
@@ -132,16 +153,16 @@
enterprisename: str
},
success: (res) => {
-
+
var resdata = res.data.data.records;
-
+
resdata.forEach(item => {
that.newsList.push(item)
})
-
+
}
});
-
+
that.flag = false
that.status = 'nomore';
}
@@ -210,7 +231,7 @@
.inTmain {}
.msg {
- height: 72rpx;
+ height: 74rpx;
line-height: 72rpx;
text-align: center;
color: #999;
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;
diff --git a/pages/examine/examine.vue b/pages/examine/examine.vue
index a021c78..7d30c91 100644
--- a/pages/examine/examine.vue
+++ b/pages/examine/examine.vue
@@ -151,6 +151,8 @@
pages: 0,
flag: true,
+ pullDown: false
+
};
},
onLoad() {
@@ -174,6 +176,28 @@
}
}, 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();
},
@@ -200,6 +224,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
@@ -244,6 +273,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
@@ -401,8 +435,8 @@
width: 100%;
max-height: 100vh;
-
-
+
+
.head {
position: relative;
diff --git a/pages/groupChat/groupChat.vue b/pages/groupChat/groupChat.vue
index 3166af6..b3696b3 100644
--- a/pages/groupChat/groupChat.vue
+++ b/pages/groupChat/groupChat.vue
@@ -6,8 +6,8 @@
<view style="height:205rpx;"></view>
<view class="tab" style="position: fixed;top: 0;width: 100%;height: 205rpx;z-index: 100;">
- <u-navbar style="position: relative;" :is-fixed="false" :border-bottom="false" :is-back="false"
- title="好友" :background="{ background: '#0BB9C8' }" title-color="#fff">
+ <u-navbar style="position: relative;" :is-fixed="false" :border-bottom="false" :is-back="false" title="好友"
+ :background="{ background: '#0BB9C8' }" title-color="#fff">
<u-icon @click="addFriend" slot="right" class="message-icon" mode="widthFix" name="plus" color="#fff">
</u-icon>
<!-- <image src="../../static/add.png" ></image> -->
@@ -15,7 +15,7 @@
<u-tabs :list="list" :is-scroll="false" :current="current" active-color="#14B9C8" inactive-color="#595959"
height="100" @change="change" style="background-color:rgba(255,255,255,0.8); "></u-tabs>
</view>
-
+
<swiper id="swiperBoxPeo" :style="{ height: swiperHeight + 'px' }" :current="current" @change="tabsChange">
<swiper-item class="swiper-item" v-for="(item, indexs) in list" :key="indexs">
<view v-if="indexs == 0" class="main">
@@ -81,7 +81,7 @@
</view>
</swiper-item>
</swiper>
-
+
</view>
</template>
@@ -140,14 +140,23 @@
query
.select('#swiperBoxPeo')
.boundingClientRect(data => {
-
+
that.swiperHeight = safeArea.bottom - data.top;
-
+
})
.exec();
}
});
},
+
+ onPullDownRefresh: function() {
+
+ setTimeout(() => {
+ this.getdataList()
+ }, 1000)
+
+ },
+
methods: {
change(index) {
this.current = index;
@@ -185,6 +194,8 @@
}
}
that.dataListP = resdata;
+
+ uni.stopPullDownRefresh();
}
});
} else if (this.current == 1) {
@@ -204,6 +215,8 @@
}
that.dataListTXL = resdata;
+
+ uni.stopPullDownRefresh();
}
})
} else if (this.current == 2) {
@@ -223,6 +236,8 @@
}
}
that.dataListQZ = resdata;
+
+ uni.stopPullDownRefresh();
}
});
}
@@ -358,6 +373,7 @@
.m-main {
box-sizing: border-box;
+
.main {
padding: 0 16px;
}
@@ -479,7 +495,7 @@
}
}
}
-
+
.swiper-item {
overflow-y: auto !important;
}
diff --git a/pages/message/message.vue b/pages/message/message.vue
index 253e794..17775b6 100644
--- a/pages/message/message.vue
+++ b/pages/message/message.vue
@@ -141,7 +141,8 @@
pagelist: 0,
pages: 0,
flag: true,
-
+
+ pullDown: false
};
},
onLoad() {
@@ -165,6 +166,28 @@
}
}, 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();
},
@@ -193,6 +216,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
@@ -239,6 +267,11 @@
var resdata = res.data.data.records;
+ if (this.pullDown == true) {
+ this.pullDown = false;
+ uni.stopPullDownRefresh();
+ }
+
if (resdata.length == 0) {
that.flag = false
that.status = 'nomore';
@@ -263,9 +296,9 @@
var reg1 = /<\/?p[^>]*>/g;
item.content = item.content.replace(reg1, '');
-
+
var reg2 = /[ ]/g;
-
+
item.content = item.content.replace(reg2, '');
console.log(item)
diff --git a/pages/report/report.vue b/pages/report/report.vue
index d477571..6ea87ee 100644
--- a/pages/report/report.vue
+++ b/pages/report/report.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">
@@ -144,6 +145,8 @@
pages: 0,
flag: true,
+ pullDown: false
+
};
},
onLoad() {
@@ -167,6 +170,26 @@
}
}, 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();
},
@@ -194,6 +217,11 @@
that.pages = res.data.data.pages;
var resdata = res.data.data.records;
+
+ if (that.pullDown == true) {
+ that.pullDown = false;
+ uni.stopPullDownRefresh();
+ }
if (resdata.length == 0) {
that.flag = false
@@ -238,6 +266,11 @@
that.pages = res.data.data.pages;
var resdata = res.data.data.records;
+
+ if (that.pullDown == true) {
+ that.pullDown = false;
+ uni.stopPullDownRefresh();
+ }
if (resdata.length == 0) {
that.flag = false
@@ -255,6 +288,8 @@
that.status = 'nomore';
return
}
+
+
}
});
@@ -391,8 +426,8 @@
width: 100%;
max-height: 100vh;
-
-
+
+
.head {
position: relative;
diff --git a/pages/securityStaff/exhibition.vue b/pages/securityStaff/exhibition.vue
index a855490..60944eb 100644
--- a/pages/securityStaff/exhibition.vue
+++ b/pages/securityStaff/exhibition.vue
@@ -41,7 +41,9 @@
keyValue: '',
pagelist: 0,
pages: 0,
- flag: true
+ flag: true,
+
+ pullDown: false
};
},
onLoad() {
@@ -63,6 +65,22 @@
},
+
+ onPullDownRefresh: function() {
+ this.pullDown = true;
+ this.pagelist = 0;
+ this.pages = 0;
+ this.flag = true;
+ this.dataList = [];
+ this.newsList = [];
+ this.status = 'loading';
+ this.keyValue = '';
+ setTimeout(() => {
+ this.getCompany();
+ }, 1000)
+
+ },
+
mounted() {
this.getCompany();
},
@@ -89,6 +107,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
@@ -100,7 +123,7 @@
that.dataList.push(item)
})
}
-
+
if (that.pagelist == that.pages) {
that.flag = false
that.status = 'nomore';
--
Gitblit v1.9.3