浏览代码

bug修复

ming 3 年之前
父节点
当前提交
561cebdb68
共有 4 个文件被更改,包括 391 次插入49 次删除
  1. 2 2
      manifest.json
  2. 2 2
      pages/login/login.vue
  3. 82 45
      pages/processList/processList.vue
  4. 305 0
      pages/processList/processList1.vue

+ 2 - 2
manifest.json

@@ -129,7 +129,7 @@
         "title" : "智慧消防",
         "router" : {
             "mode" : "hash",
-            "base" : ""
+            "base" : "/work/"
         },
         "devServer" : {
             // "https" : true,
@@ -144,7 +144,7 @@
                 }
             }
         },
-        "domain" : "https://qhome.usky.cn/work",
+        "domain" : "https://qhome.usky.cn",
         "sdkConfigs" : {
             "maps" : {}
         },

+ 2 - 2
pages/login/login.vue

@@ -76,7 +76,7 @@
 					});
 					return
 				}
-				if (!/^1[345678]\d{9}$/.test(this.phone)) {
+				if (!/^1(?:3\d|4[4-9]|5[0-35-9]|6[67]|7[013-8]|8\d|9\d)\d{8}$/.test(this.phone)) {
 					uni.showToast({
 						title: "请输入正确的手机号码...",
 						icon: "none"
@@ -115,7 +115,7 @@
 					});
 					return
 				}
-				if (!/^1[345678]\d{9}$/.test(this.phone)) {
+				if (!/^1(?:3\d|4[4-9]|5[0-35-9]|6[67]|7[013-8]|8\d|9\d)\d{8}$/.test(this.phone)) {
 					uni.showToast({
 						title: "请输入正确的手机号码...",
 						icon: "none"

+ 82 - 45
pages/processList/processList.vue

@@ -8,13 +8,13 @@
 					<!-- <view v-if="TabCur==index" class="cu-tag badge">
 						<block class="cu-tag badge">{{TabCur? porcessedList.length:alarm_count}} </block>
 					</view> -->
-					
-					
+
+
 					<view v-if="TabCur==index&&!TabCur" class="cu-tag badge">
 						<block class="cu-tag badge">{{alarm_count}} </block>
 					</view>
-					
-					
+
+
 					{{item}}
 				</view>
 			</scroll-view>
@@ -26,7 +26,7 @@
 
 					<view class="cu-item" v-for="(item,index) in unporcessList" :key="index">
 						<view class="cu-avatar lg">
-							<image class="image-bg" src="/static/process-icon.png"/>
+							<image class="image-bg" src="/static/process-icon.png" />
 						</view>
 						<view class="content">
 							<view class="pro-title">
@@ -53,7 +53,7 @@
 				<view class="cu-list menu-avatar ">
 					<view class="cu-item" v-for="(item,index) in porcessedList" :key="index">
 						<view class="cu-avatar lg">
-							<image class="image-bg" src="/static/processed-icon.png"/>
+							<image class="image-bg" src="/static/processed-icon.png" />
 						</view>
 						<view class="content">
 							<view class="pro-title">
@@ -74,7 +74,9 @@
 				</view>
 			</view>
 		</block>
-
+		<view v-show="isLoadMore">
+			<uni-load-more :status="loadStatus"></uni-load-more>
+		</view>
 	</view>
 </template>
 
@@ -93,34 +95,45 @@
 				CustomBar: this.CustomBar,
 				TabCur: 0,
 				tabNav: ['未处理', '已处理'],
-				alarm_count:'',
-				alarm_count1:''
+				alarm_count: '',
+				alarm_count1: '',
+
+				page: 1,
+				pageSize: 10,
+				loadStatus: 'loading', //加载样式:more-加载前样式,loading-加载中样式,nomore-没有数据样式
+				isLoadMore: false, //是否加载中
 
 
 			};
 		},
-		
-		  onPullDownRefresh() {
-		        console.log('refresh--上拉刷新');
-				// this.getProcessData()
-				
-		        setTimeout(function () {
-		            uni.stopPullDownRefresh();
-		        }, 100);
-		    },
+
+		onPullDownRefresh() {
+			console.log('refresh--上拉刷新');
+			this.getProcessData(0);
+			this.page=1
+
+			setTimeout(function() {
+				uni.stopPullDownRefresh();
+			}, 100);
+		},
+
+		onReachBottom() { //上拉触底函数
+			if (!this.isLoadMore) { //此处判断,上锁,防止重复请求
+				this.isLoadMore = true
+				this.page += 1
+				this.getProcessData(0);
+			}
+		},
+
 
 		onLoad: function(option) {
-			
-			setTimeout(function () {
-			            console.log('start pulldown');
-			        }, 1000);
-			        uni.startPullDownRefresh();
 
-			this.getProcessData({
-				"company_code": uni.getStorageSync('selectedCode'),
-				"type": option.type,
-				"processing_status": 0
-			}, 0);
+			setTimeout(function() {
+				console.log('start pulldown');
+			}, 1000);
+			uni.startPullDownRefresh();
+
+			this.getProcessData(0);
 
 
 			this.companyCode = option.companyCode;
@@ -176,7 +189,7 @@
 		onNavigationBarButtonTap(e) {
 			console.log(e)
 			uni.navigateTo({
-				url: './export/export?type='+this.type,
+				url: './export/export?type=' + this.type,
 				success: res => {},
 				fail: () => {},
 				complete: () => {}
@@ -184,30 +197,54 @@
 		},
 		methods: {
 
-			async getProcessData(params = {}, whichTab) {
+			async getProcessData(whichTab) {
 				const res = await this.$myRequest({
 					url: 'ComprehensiveAlarm/getIntegratedAlarmList',
-					data: params,
+					data: {
+						"company_code": uni.getStorageSync('selectedCode'),
+						"type": 1, //aa写活
+						"processing_status": 0,
+						"page": this.page,
+						"pageSize": this.pageSize,
+					},
 					showLoading: true
 				})
-				this.unporcessList = res.data.data;
-				// this.alarm_count=res.data.alarm_count
 
-				if (whichTab == 0) {
+				if (res.data.alarm_count) {
+
 					this.unporcessList = res.data.data;
-					this.alarm_count=parseInt(res.data.alarm_count)
-					
+
+					if (whichTab == 0) {
+						this.unporcessList = res.data.data;
+						this.alarm_count = parseInt(res.data.alarm_count)
+
+					} else {
+						this.porcessedList = res.data.data;
+						this.alarm_count1 = parseInt(res.data.alarm_count)
+					}
+
+
+					if (res.data.alarm_count < this.pageSize) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
+						this.isLoadMore = true
+						this.loadStatus = 'nomore'
+					} else {
+						this.isLoadMore = false
+					}
 				} else {
-					this.porcessedList = res.data.data;
-					this.alarm_count1=parseInt(res.data.alarm_count)
+					this.isLoadMore = true
+					this.loadStatus = 'nomore'
 				}
+
+
+
+
 			},
 
 			tabSelect(e) {
-				this.unporcessList=[],
-				this.porcessedList=[],
+				this.unporcessList = [],
+					this.porcessedList = [],
 
-				console.log(e.currentTarget);
+					console.log(e.currentTarget);
 				this.TabCur = e.currentTarget.dataset.id;
 				this.scrollLeft = (e.currentTarget.dataset.id - 1) * 60;
 
@@ -220,10 +257,10 @@
 
 			// 页面跳转
 			goUnprocessDetail(item) {
-					uni.navigateTo({
-						url: '/pages/unprocessDetail/unprocessDetail?id=' + item
-							.id + '&type=' + this.type,
-					});
+				uni.navigateTo({
+					url: '/pages/unprocessDetail/unprocessDetail?id=' + item
+						.id + '&type=' + this.type,
+				});
 			},
 
 			goProcessedDetail(item) {

+ 305 - 0
pages/processList/processList1.vue

@@ -0,0 +1,305 @@
+<template>
+	<view class="processWrapper ">
+		<view style="height:98rpx"></view>
+		<view class="ding">
+			<scroll-view scroll-x class="bg-white nav text-center">
+				<view class="cu-item" :class="index==TabCur?'text-blue cur':''" v-for="(item,index) in tabNav"
+					:key="index" @tap="tabSelect" :data-id="index">
+					<!-- <view v-if="TabCur==index" class="cu-tag badge">
+						<block class="cu-tag badge">{{TabCur? porcessedList.length:alarm_count}} </block>
+					</view> -->
+
+
+					<view v-if="TabCur==index&&!TabCur" class="cu-tag badge">
+						<block class="cu-tag badge">{{alarm_count}} </block>
+					</view>
+
+
+					{{item}}
+				</view>
+			</scroll-view>
+		</view>
+
+		<block v-if="TabCur==0">
+			<view class="processList">
+				<view class="cu-list menu-avatar">
+
+					<view class="cu-item" v-for="(item,index) in unporcessList" :key="index">
+						<view class="cu-avatar lg">
+							<image class="image-bg" src="/static/process-icon.png" />
+						</view>
+						<view class="content">
+							<view class="pro-title">
+								<view class="cut">{{item.owner_name}}</view>
+							</view>
+							<view class="pro-des  ">
+								<view class="text-cut">
+									{{item.unitinfo}}
+								</view>
+							</view>
+							<view class="pro-date ">{{item.time}}</view>
+						</view>
+						<view class="action" style="z-index:99">
+							<view class="unProcess" @tap="goUnprocessDetail(item)">未处理</view>
+						</view>
+					</view>
+					<view class=" text-center margin-top" v-if="alarm_count === 0">暂无数据...</view>
+				</view>
+			</view>
+		</block>
+
+		<block v-if="TabCur==1">
+			<view class="processList">
+				<view class="cu-list menu-avatar ">
+					<view class="cu-item" v-for="(item,index) in porcessedList" :key="index">
+						<view class="cu-avatar lg">
+							<image class="image-bg" src="/static/processed-icon.png" />
+						</view>
+						<view class="content">
+							<view class="pro-title">
+								<view class="cut">{{item.owner_name}}</view>
+							</view>
+							<view class="pro-des  ">
+								<view class="text-cut">
+									{{item.unitinfo}}
+								</view>
+							</view>
+							<view class="pro-date ">{{item.time}}</view>
+						</view>
+						<view class="action" style="z-index:99">
+							<view class="processed" @tap="goProcessedDetail(item)">已处理</view>
+						</view>
+					</view>
+					<view class="text-center margin-top" v-if="alarm_count1 === 0">暂无数据...</view>
+				</view>
+			</view>
+		</block>
+
+	</view>
+</template>
+
+<script>
+	import json from '../../data/json.js';
+	export default {
+		data() {
+			return {
+				unporcessList: [],
+				porcessedList: [],
+
+				type: '0',
+				modalName: null,
+				listTouchStart: 0,
+				listTouchDirection: null,
+				CustomBar: this.CustomBar,
+				TabCur: 0,
+				tabNav: ['未处理', '已处理'],
+				alarm_count: '',
+				alarm_count1: '',
+
+
+				page: 1,
+				pagesize: 10,
+				loadStatus: 'loading', //加载样式:more-加载前样式,loading-加载中样式,nomore-没有数据样式
+				isLoadMore: false, //是否加载中
+
+
+			};
+		},
+
+		// onPullDownRefresh() {
+		// 	console.log('refresh--上拉刷新');
+		// 	// this.getProcessData()
+
+		// 	setTimeout(function() {
+		// 		uni.stopPullDownRefresh();
+		// 	}, 100);
+		// },
+
+		onReachBottom() { //上拉触底函数
+			if (!this.isLoadMore) { //此处判断,上锁,防止重复请求
+				this.isLoadMore = true
+				this.page += 1
+				// this.getProcessData({
+				// 	"company_code": uni.getStorageSync('selectedCode'),
+				// 	"type": option.type,
+				// 	"processing_status": 0
+				// }, 0);
+
+			}
+		},
+
+
+		onLoad: function(option) {
+
+			setTimeout(function() {
+				console.log('start pulldown');
+			}, 1000);
+			uni.startPullDownRefresh();
+
+			this.getProcessData({
+				"company_code": uni.getStorageSync('selectedCode'),
+				"type": option.type,
+				"processing_status": 0
+			}, 0);
+
+
+			this.companyCode = option.companyCode;
+			this.processingStatus = 1
+
+			this.type = option.type;
+
+			let url = "";
+			switch (parseInt(option.type)) {
+				case 1:
+					url = "报警主机"
+					break;
+				case 2:
+					url = "水系统"
+					break;
+				case 4:
+					url = "消防栓监测"
+					break;
+				case 6:
+					url = "RTU测控终端"
+					break;
+				case 7:
+					url = "电气火灾"
+					break;
+				case 16:
+					url = "视频告警"
+					break;
+				case 17:
+					url = "电梯报警"
+					break;
+				case 128:
+					url = "井盖监测"
+					break;
+				case 129:
+					url = "地磁"
+					break;
+				case 130:
+					url = "门磁"
+					break;
+				case 131:
+					url = "可燃气体"
+					break;
+				default:
+					break;
+			}
+			uni.setNavigationBarTitle({
+				title: url
+			});
+
+
+		},
+
+		onNavigationBarButtonTap(e) {
+			console.log(e)
+			uni.navigateTo({
+				url: './export/export?type=' + this.type,
+				success: res => {},
+				fail: () => {},
+				complete: () => {}
+			});
+		},
+		methods: {
+
+			async getProcessData(params = {}, whichTab) {
+				const res = await this.$myRequest({
+					url: 'ComprehensiveAlarm/getIntegratedAlarmList',
+					data: params,
+					showLoading: true
+				})
+				if (res.data.data.list) {
+
+					this.unporcessList = res.data.data;
+					if (res.data.data.list.length < this.pagesize) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
+						this.isLoadMore = true
+						this.loadStatus = 'nomore'
+					} else {
+						this.isLoadMore = false
+					}
+
+
+					this.unporcessList = res.data.data;
+					// this.alarm_count=res.data.alarm_count
+
+
+				} else {
+					this.isLoadMore = true
+					this.loadStatus = 'nomore'
+
+				}
+
+
+
+				if (whichTab == 0) {
+					this.unporcessList = res.data.data;
+					this.alarm_count = parseInt(res.data.alarm_count)
+
+				} else {
+					this.porcessedList = res.data.data;
+					this.alarm_count1 = parseInt(res.data.alarm_count)
+				}
+			},
+
+			tabSelect(e) {
+				this.unporcessList = [],
+					this.porcessedList = [],
+
+					console.log(e.currentTarget);
+				this.TabCur = e.currentTarget.dataset.id;
+				this.scrollLeft = (e.currentTarget.dataset.id - 1) * 60;
+
+				this.getProcessData({
+					"company_code": uni.getStorageSync('selectedCode'),
+					"type": this.type,
+					"processing_status": e.currentTarget.dataset.id
+				}, this.TabCur);
+			},
+
+			// 页面跳转
+			goUnprocessDetail(item) {
+				uni.navigateTo({
+					url: '/pages/unprocessDetail/unprocessDetail?id=' + item
+						.id + '&type=' + this.type,
+				});
+			},
+
+			goProcessedDetail(item) {
+				uni.navigateTo({
+					url: '/pages/processedDetail/processedDetail?id=' + item.id + '&type=' + item.type,
+					success: res => {},
+					fail: () => {},
+					complete: () => {}
+				});
+			},
+
+
+		}
+	}
+</script>
+
+<style lang="scss">
+	//已处理未处理消息个数样式
+	.nav .cu-item.cur {
+		position: relative;
+		border-bottom: 8rpx solid;
+	}
+
+	.cu-tag.badge {
+		top: 14rpx;
+		right: 96rpx;
+	}
+
+	.nav .cu-item {
+		width: 50%;
+		margin: 0;
+
+		.text-blue,
+		.line-blue,
+		.lines-blue {
+			color: #4274E7
+		}
+	}
+</style>