Parcourir la source

权限管理 站点管理 现场档案等分页

ming il y a 3 ans
Parent
commit
5f1fb99263

+ 1 - 1
common/common.scss

@@ -174,7 +174,7 @@ radio,checkbox {
 	margin-top:100rpx;
 	width: 100%;
 	height: calc(100% - 100rpx);
-	overflow: scroll
+	// overflow: scroll
 }
 
 .site-items .site-tit {

+ 4 - 2
pages.json

@@ -224,7 +224,8 @@
 			"path": "pages/siteManage/siteManage",
 			"style": {
 				"navigationBarTitleText": "站点管理",
-				"enablePullDownRefresh": false
+				"enablePullDownRefresh": false,
+				"onReachBottomDistance":100 //距离底部多远时触发 单位px
 			}
 
 		}, {
@@ -311,7 +312,8 @@
 			"path": "pages/authManage/authManage",
 			"style": {
 				"navigationBarTitleText": "权限管理",
-				"enablePullDownRefresh": false
+				"enablePullDownRefresh": false,
+				"onReachBottomDistance":100 //距离底部多远时触发 单位px
 			}
 
 		}, {

+ 57 - 12
pages/authManage/authManage.vue

@@ -35,15 +35,26 @@
 				</view>
 			</view>
 			<view v-if="!authList.length&&authListRes==1" class="text-center margin-top"> 暂无数据</view>
+			<view v-show="isLoadMore&&this.currentPage>1">
+				<uni-load-more :status="loadStatus"></uni-load-more>
+			</view>
 		</view>
 
 		<!-- 权限管理end-->
 
 
 		<!-- 新增按钮start -->
-		<view class="plus">
-			<image src="../../static/plus.png" style="width:100rpx;height:100rpx" @tap="goAddPage(type)"></image>
+		<view style="width: 100%;
+    position: fixed;
+    bottom: 0px;
+    right: 0px;
+    height: 64px;
+    background: #fff;">
+			<view class="plus">
+				<image src="../../static/plus.png" style="width:100rpx;height:100rpx" @tap="goAddPage(type)"></image>
+			</view>
 		</view>
+		
 		<!-- 新增按钮end -->
 	</view>
 
@@ -67,17 +78,43 @@
 				csListArrl: [],
 				//左滑默认宽度
 				delBtnWidth: 160,
-				flag: false
+				flag: false,
+				
+				currentPage: 1,
+				size: 10,
+				loadStatus: 'loading', //加载样式:more-加载前样式,loading-加载中样式,nomore-没有数据样式
+				isLoadMore: false, //是否加载中
 
 
 			};
 		},
+		onReachBottom() { //上拉触底函数
+			if (!this.isLoadMore) { //此处判断,上锁,防止重复请求
+				this.isLoadMore = true
+				this.currentPage += 1;
+				this.loadData()
+			}
+		},
 
 		onLoad: function(option) {
-			this.getAuthData()
+			this.loadData()
 		},
 		methods: {
 			
+			searchAuthList() {
+				this.currentPage = 1;
+				this.loadData()
+				
+			},
+			loadData(){
+				this.getAuthData({
+					"phone": this.phoneNumber,
+					currentPage: this.currentPage,
+					size: this.size,
+				})
+				
+			},
+			
 			EditItem(item){
 				uni.navigateTo({
 					url: '/pages/authAdd/authAdd?phone='+item.phone+'',
@@ -112,7 +149,7 @@
 					alert('删除失败');
 					return;
 				}
-				this.getAuthData()
+				this.loadData()
 				
 				return res;
 			},
@@ -125,15 +162,23 @@
 					data: ming
 				})
 				this.authListRes = 1;
-				this.authList = res.data.data
-				console.log(res.data.data);
+				if (res.data.total) {
+					this.authList = this.authList.concat(res.data.data)
+					if (res.data.data.length < this.size) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
+						this.isLoadMore = true
+						this.loadStatus = 'nomore'
+					} else {
+						this.isLoadMore = false
+					}
+				} else {
+					this.isLoadMore = true
+					this.loadStatus = 'nomore'
+				}
+				// this.authList = res.data.data
+				// console.log(res.data.data);
 			},
 
-			searchAuthList() {
-				this.getAuthData({
-					"phone": this.phoneNumber
-				})
-			},
+			
 
 
 

+ 8 - 2
pages/siteArchive/siteArchive.vue

@@ -89,23 +89,29 @@
 			if (!this.isLoadMore) { //此处判断,上锁,防止重复请求
 				this.isLoadMore = true
 				this.currentPage += 1;
-				this.searchData()
+				this.loadData()
 			}
 		},
 		onLoad: function(option) {
 
-			this.searchData();
+			this.loadData()
 
 		},
 
 		methods: {
 
 			searchData() {
+				this.currentPage=1,
+				this.loadData()
+				
+			},
+			loadData(){
 				this.getDataList({
 					"site_name": this.siteName,
 					currentPage: this.currentPage,
 					size: this.size,
 				})
+				
 			},
 
 			InputFocus(e) {

+ 7 - 3
pages/siteList/siteList.vue

@@ -131,11 +131,11 @@
 			if (!this.isLoadMore) { //此处判断,上锁,防止重复请求
 				this.isLoadMore = true
 				this.currentPage += 1;
-				this.searchData()
+				this.loadData()
 			}
 		},
 		onLoad() {
-			this.searchData();
+			this.loadData();
 			this.getRoutrBox()
 		},
 
@@ -182,7 +182,11 @@
 
 
 			searchData() {
-				this.currentPage=1
+				this.currentPage=1,
+				this.loadData()
+				
+			},
+			loadData(){
 				this.getSiteList({
 					"siteName": this.siteName,
 					"route_name": this.formMess.siteName,

+ 55 - 13
pages/siteManage/siteManage.vue

@@ -30,7 +30,7 @@
 		<!-- 筛选框end -->
 
 		<!-- 站点列表start -->
-		<view class="site-items" style="margin-top:0;height: calc(100vh - 380rpx);">
+		<view class="site-items" style="margin-top:0;height: calc(100vh - 380rpx)">
 			<view class="cu-list menu-avatar">
 				<view class="cu-item" :class="modalName=='move-box-'+ index?'move-cur':''"
 					v-for="(item,index) in siteList" :key="index" @touchstart="ListTouchStart"
@@ -54,13 +54,24 @@
 				</view>
 			</view>
 			<view v-if="!siteList.length&&siteListRes==1" class="text-center margin-top"> 暂无数据</view>
+			<view v-show="isLoadMore&&this.currentPage>1">
+				<uni-load-more :status="loadStatus"></uni-load-more>
+			</view>
 		</view>
 		<!-- 站点列表end -->
 
 		<!-- 新增按钮start -->
-		<view class="plus">
-			<image src="../../static/plus.png" style="width:100rpx;height:100rpx" @tap="goAddPage()"></image>
+		<view style="width: 100%;
+    position: fixed;
+    bottom: 0px;
+    right: 0px;
+    height: 64px;
+    background: #fff;">
+			<view class="plus">
+				<image src="../../static/plus.png" style="width:100rpx;height:100rpx" @tap="goAddPage()"></image>
+			</view>
 		</view>
+		
 		<!-- 新增按钮end -->
 	</view>
 
@@ -96,19 +107,45 @@
 
 				siteItemDataOrigin: [],
 				siteItemData: [],
+				
+				currentPage: 1,
+				size: 10,
+				loadStatus: 'loading', //加载样式:more-加载前样式,loading-加载中样式,nomore-没有数据样式
+				isLoadMore: false, //是否加载中
 
 			};
 		},
+		onReachBottom() { //上拉触底函数
+			if (!this.isLoadMore) { //此处判断,上锁,防止重复请求
+				this.isLoadMore = true
+				this.currentPage += 1;
+				this.loadData()
+			}
+		},
 
 		onLoad: function(option) {
 
 			//站点列表渲染
-			this.getSiteList()
+			this.loadData()
 			this.getRoutrBox()
 
 		},
 
 		methods: {
+			
+			//筛选
+			searchSiteList() {
+				this.currentPage = 1;
+				this.loadData()
+			},
+			loadData(){
+				this.getSiteList({
+					"siteName": this.siteName,
+					"route_name": this.formMess.siteName,
+					currentPage: this.currentPage,
+					size: this.size,
+				})
+			},
 
 			//线路名称下拉数据请求
 			async getRoutrBox(params = {}) {
@@ -147,13 +184,7 @@
 					-1);
 			},
 
-			//筛选
-			searchSiteList() {
-				this.getSiteList({
-					"siteName": this.siteName,
-					"route_name": this.formMess.siteName
-				})
-			},
+			
 
 			//编辑
 			editItem(item) {
@@ -235,8 +266,19 @@
 					data: ming
 				})
 				this.siteListRes = 1;
-				this.siteList = res.data.data
-				console.log(res.data.data);
+				
+				if (res.data.total) {
+					this.siteList = this.siteList.concat(res.data.data)
+					if (res.data.data.length < this.size) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
+						this.isLoadMore = true
+						this.loadStatus = 'nomore'
+					} else {
+						this.isLoadMore = false
+					}
+				} else {
+					this.isLoadMore = true
+					this.loadStatus = 'nomore'
+				}
 			},
 
 			// 新增跳转