浏览代码

设置权限管理 站点管理 登录和首页初始化对接

ming 4 年之前
父节点
当前提交
a9f87d79a5

+ 2 - 2
colorui/main.css

@@ -1261,14 +1261,14 @@ button.cuIcon.lg {
 	margin-top: 10upx
 }
 
-.cu-list.menu-avatar.comment>.cu-item .content {
+.cu-list.menu-avatar.comment .cu-item .content {
 	position: relative;
 	left: 0;
 	width: auto;
 	flex: 1;
 }
 
-.cu-list.menu-avatar.comment>.cu-item {
+.cu-list.menu-avatar.comment .cu-item {
 	padding: 30upx 30upx 30upx 120upx;
 	height: auto
 }

+ 27 - 0
pages.json

@@ -295,6 +295,33 @@
             
         }
 		
+        ,{
+            "path" : "pages/authManage/authManage",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "权限管理",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+        ,{
+            "path" : "pages/authAdd/authAdd",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "权限新增",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+        ,{
+            "path" : "pages/siteAdd/siteAdd",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "站点新增",
+                "enablePullDownRefresh": false
+            }
+            
+        }
     ],
 	"globalStyle": {
 		"navigationBarTextStyle": "black",

+ 4 - 5
pages/add/add.vue

@@ -78,7 +78,7 @@
 				<button class="bg-blue round  margin-top">提 交 </button>
 			</view>
 		</form>
-
+		<!-- 权限管理 start -->
 		<form action="" v-else>
 			<view class="form-item margin-top">
 				<view class="title">
@@ -132,11 +132,12 @@
 				<button class="bg-blue round  margin-top" form-type="submit">提 交 </button>
 			</view>
 		</form>
+		<!-- 权限管理 end -->
 	</view>
 </template>
 
 <script>
-	var graceChecker = require("../../common/graceChecker.js");
+	// var graceChecker = require("../../common/graceChecker.js");
 	// import add from '../../common/select.js';
 	export default {
 
@@ -161,9 +162,7 @@
 				siteItemDataOrigin: ["站点一", "站点二", "站点三", "站点四", "站点五", "站点六"],
 				// newDataList: [],
 
-				selectedData: [],
-				// 站点多选下拉 end
-				
+				selectedData: [],
 				siteItemData: ["站点一", "站点二", "站点三", "站点四", "站点五", "站点六"],
 				
 			}

+ 7 - 3
pages/deviceManage/deviceDetail/deviceDetail.vue

@@ -87,7 +87,8 @@
 			async getDeviceDetail(ming={}) {
 				const res= await this.$myRequest({
 					url:'OperationMonitoring/getMonitoringScreen',
-					data:ming
+					data:ming,
+					showLoading:true
 				})
 				console.log(res.data.data[0])
 				this.deviceDetail=res.data.data[0]
@@ -109,14 +110,17 @@
 		height: 100%;
 		background-color: #000033;
 		background-image: url(../../../static/device-bg.png);
-		background-position: center 60%;
+		background-position: center center;
 		background-size: cover;
 		position: relative;
 
 		.device-items {
 			font-family: FANDOLFANG-REGULAR;
 			margin-top: 150rpx;
-			color: #fff;
+			color: #fff;
+			.device-item text{
+				vertical-align:top
+			}
 
 			.device-item text:first-child {
 				width: 50rpx;

+ 2 - 1
pages/deviceManage/deviceManage.vue

@@ -43,7 +43,8 @@
 			async getDeviceManage(ming={}) {
 				const res= await this.$myRequest({
 					url:'OperationMonitoring/getDeviceList',
-					data:ming
+					data:ming,
+					showLoading:true
 				})
 				console.log(res.data.data)
 				this.deviceData=res.data.data

+ 25 - 4
pages/index/index.vue

@@ -143,7 +143,12 @@
 			}
 		},
 
-		onLoad() {
+		onLoad() {
+			
+			
+			this.getPageAuthorization()
+			
+			
 			this.hackReset = false;
 			this.$nextTick(() => {
 				this.hackReset = true;
@@ -151,13 +156,29 @@
 			this.getData();
 			this.getSearchList();
 		},
-		methods: {
+		methods: {
+			//首页初始化授权
+			async getPageAuthorization() {
+				const res = await this.$myRequest({
+					url: 'Com/getPageAuthorization',
+				})
+				alert(res.data.flag)
+				console.log('res.data'); 
+				console.log(res.data); 
+		
+				if(res.data.flag==3000){
+					uni.navigateTo({
+						url: '/pages/login/login',
+					});
+				}
+		
+			},
 
 			async getData() {
 				const res = await this.$myRequest({
-					url: 'Index/getDataStatistics',
+					url: 'Index/getDataStatistics',
+					showLoading:true
 				})
-				console.log(res.data.data);
 				this.staticData = res.data.data[0]
 			},
 

+ 106 - 47
pages/login/login.vue

@@ -8,56 +8,23 @@
 		<form class="padding-lg flex flex-direction">
 			<view class="login-box shadow ">
 				<view class="phone-box">
-					<input type="text" placeholder="13636363636" onfocus="this.placeholder=''">
+					<input type="text" placeholder="请输入手机号码" onfocus="this.placeholder=''"  v-model="phone">
 					<span class="icon iconfont left-icon">&#xe64f;</span>
 					<span class="icon iconfont right-icon">&#xe610;</span>
 				</view>
 				<view class="password-box">
-					<input type="text" placeholder="请输入验证码">
+					<input type="text" placeholder="请输入验证码" v-model="verify">
 					<text class="icon iconfont left-icon">&#xe86a;</text>
-					<view class="right-icon verify">获取验证码</view>
+					<view class="right-icon verify" @click="getVerifyCode">获取验证码</view>
 				</view>
 
-				<view class="btn-area">
-					<navigator open-type="switchTab" url="/pages/index/index" hover-class="navigator-hover">
-						<button class="submit">提 交 </button>
-					</navigator>
+				<view class="btn-area">
+						<button class="submit" @click="submitRes">提 交 </button>
 				</view>
 			</view>
 		</form>
 
-		<view class="box ">
-			<view class="cu-bar tabbar bg-white">
-				<view class="action"  data-cur="login">
-					<view class="cuIcon-cu-image">
-						<span class="icon iconfont">&#xe64e;</span>
-					</view>
-					<view class="text-green">主页</view>
-				</view>
-				<view class="action">
-					<view class="cuIcon-cu-image">
-						<span class="icon iconfont">&#xe606;</span>
-
-					</view>
-					<view class="text-gray">消息</view>
-				</view>
-				<view class="action">
-					<view class="cuIcon-cu-image">
-						<span class="icon iconfont">&#xe858;</span>
-						<view class="cu-tag badge">99</view>
-					</view>
-					<view class="text-gray">分析</view>
-				</view>
-				<view class="action">
-					<view class="cuIcon-cu-image">
-						<span class="icon iconfont">&#xe606;</span>
-						<view class="cu-tag badge"></view>
-					</view>
-					<view class="text-gray">设置</view>
-				</view>
-			</view>
-
-		</view>
+		
 	</view>
 
 
@@ -67,9 +34,13 @@
 <script>
 	export default {
 		data() {
-			return {
-				title: 'Hello222',
-				InputBottom: 0
+			return {
+				phone:'',
+				verify:'',
+				VerificationCodeOne:''
+				
+				
+				
 			}
 		},
 		onLoad() {
@@ -80,14 +51,102 @@
 			})
 			uni.setNavigationBarTitle({
 				title: '登录'
-			});
+			});
+			
+			
+			this.getLoginAuthorize()
 
 
 		},
-		methods: {
-
-
-
+		methods: {
+			
+			
+			//短信验证码验证
+			getVerifyCode(){
+				if(!this.phone){
+					uni.showToast({
+						title: "请输入手机号码...",
+						icon:"none"
+					});
+					
+				}else if (!/^1[345678]\d{9}$/.test(this.phone)){
+					uni.showToast({
+						title: "请输入正确的手机号码...",
+						icon:"none"
+					});
+				 }else{
+					 this.getVerifyData({"phone":this.phone})
+				 }
+				
+			},
+			async getVerifyData(ming = {}) {
+				const res = await this.$myRequest({
+					url: 'Login/getVerificationCode',
+					data:ming
+				})
+				console.log('res.data')    
+				console.log(res.data)
+				console.log(eval('(' + res.data + ')'))
+				
+				
+				 // this.VerificationCodeOne=eval('(' + res.data + ')').data[0].VerificationCode
+			},
+			
+			// 登录提交按钮
+			submitRes(){
+				if(!this.phone){
+					uni.showToast({
+						title: "请输入手机号码...",
+						icon:"none"
+					});
+					return
+					
+				}
+				if (!/^1[345678]\d{9}$/.test(this.phone)){
+					uni.showToast({
+						title: "请输入正确的手机号码...",
+						icon:"none"
+					});
+					return
+				 }
+				if (!this.verify){
+					uni.showToast({
+						title: "请输入验证码...",
+						icon:"none"
+					});
+					return
+				 }
+
+			    this.getData({"phone":this.phone,"VerificationCode":this.verify,"VerificationCodeOne":this.VerificationCodeOne})
+				 
+				
+				
+			},
+			async getData(ming = {}) {
+				const res = await this.$myRequest({
+					url: 'Login/setSignUp',
+					data:ming
+				})
+				console.log(res)
+				console.log(res.data.flag)
+				if(res.data.flag==true){
+					alert(1)
+					uni.switchTab({
+					    url: '/pages/index/index'
+					});
+					
+				}
+			},
+			
+			//登录页初始化
+			async getLoginAuthorize() {
+				const res = await this.$myRequest({
+					url: 'Login/getLoginAuthorize',
+				})
+				// console.log('res')
+				// console.log(res)
+				
+			},
 
 
 		}

+ 145 - 143
pages/processList/processList.vue

@@ -5,8 +5,8 @@
 			<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?alarmUntreatedCount1:alarmUntreatedCount}}  </block>
+					<view v-if="TabCur==index" class="cu-tag badge">
+						<block class="cu-tag badge">{{TabCur?alarmUntreatedCount1:alarmUntreatedCount}} </block>
 					</view>
 					{{item}}
 				</view>
@@ -14,58 +14,69 @@
 		</view>
 
 		<block v-if="TabCur==0">
-			<view class="processList">
-				<!-- {{alarmUntreatedCount}} -->
-				<view class="cu-list menu-avatar"  >
-					<view class="cu-item" v-if="alarmUntreatedCount !=0" v-for="(item,index) in unporcessList" :key="item.id">
-						<view class="cu-avatar lg" style="background-image:url(../../static/process-icon.png);"></view>
-						<view class="content">
-							<view class="pro-title">
-								<view class="cut">{{item.measName}}</view>
-							</view>
-							<view class="pro-des  ">
-								<view class="text-cut">
-									{{item.digitalValue!=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" style="background-image:url(../../static/process-icon.png);"></view>
+							<view class="content">
+								<view class="pro-title">
+									<view class="cut">{{item.measName}}</view>
 								</view>
+								<view class="pro-des  ">
+									<view class="text-cut">
+										{{item.digitalValue!=0?"动作":"复归"}}
+									</view>
+								</view>
+								<view class="pro-date ">{{item.soeTime}}</view>
+							</view>
+							<view class="action" style="z-index:99">
+								<view class="unProcess" v-if="type==1" @tap="goUnprocessDetail(item.id)">未处理</view>
+								<view class="unProcess" v-else @tap="goVideoUnprocessDetail(item.id)">未处理</view>
 							</view>
-							<view class="pro-date ">{{item.soeTime}}</view>
-						</view>
-						<view class="action" style="z-index:99">
-							<view class="unProcess" v-if="type==1" @tap="goUnprocessDetail(item.id)">未处理</view>
-							<view class="unProcess" v-else @tap="goVideoUnprocessDetail(item.id)">未处理</view>
-						</view>
+						</view>
+						<view class=" text-center margin-top" v-if="alarmUntreatedCount === 0">暂无数据...</view>
 					</view>
-					<view class="cu-item" v-else>暂无数据</view>
-				</view>
-			
+
+				
+				
+					
+				
+
 			</view>
 		</block>
 		<block v-if="TabCur==1">
-			<view class="processList">
-				<!-- {{alarmUntreatedCount1}} -->
-				<view class="cu-list menu-avatar " >
-					<view class="cu-item" v-if="alarmUntreatedCount1 != 0" v-for="(item,index) in porcessedList" :key="index">
-						<view class="cu-avatar lg" style="background-image:url(../../static/processed-icon.png);"></view>
-						<view class="content">
-							<view class="pro-title">
-								<view class="cut">{{item.measName}}</view>
-							</view>
-							<view class="pro-des  ">
-								<view class="text-cut">
-									{{item.digitalValue!=0?"动作":"复归"}}
-								</view>
-							</view>
-							<view class="pro-date ">{{item.soeTime}}</view>
-						</view>
-						<view class="action" style="z-index:99">
-							<view class="processed" v-if="type==1" @tap="goProcessedDetail(item.id)">已处理</view>
-							<view class="processed" v-else @tap="goVideoProcessedDetail(item.id)">已处理</view>
-						</view>
+			<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" style="background-image:url(../../static/processed-icon.png);"></view>
+							<view class="content">
+								<view class="pro-title">
+									<view class="cut">{{item.measName}}</view>
+								</view>
+								<view class="pro-des  ">
+									<view class="text-cut">
+										{{item.digitalValue!=0?"动作":"复归"}}
+									</view>
+								</view>
+								<view class="pro-date ">{{item.soeTime}}</view>
+							</view>
+							<view class="action" style="z-index:99">
+								<view class="processed" v-if="type==1" @tap="goProcessedDetail(item.id)">已处理</view>
+								<view class="processed" v-else @tap="goVideoProcessedDetail(item.id)">已处理</view>
+							</view>
+						</view>
+						<view class="text-center margin-top" v-if="alarmUntreatedCount1 === 0">暂无数据...</view>
 					</view>
-					<view class="cu-item"   v-else>暂无数据...</view>
-				</view>
+
 				
-				
+					
+			
+
+
 			</view>
 		</block>
 
@@ -77,132 +88,123 @@
 	export default {
 		data() {
 			return {
-				// unporcessList: json.unprocessList,
-				unporcessList:[],
-				porcessedList:[],
-			
-
+				// unporcessList: json.unprocessList,
+				unporcessList: [],
+				porcessedList: [],
 				type: '0',
 				modalName: null,
 				listTouchStart: 0,
 				listTouchDirection: null,
 				CustomBar: this.CustomBar,
 				TabCur: 0,
-				tabNav: ['未处理', '已处理'],
-				companyCode:'',
-				alarmUntreatedCount:0,
-				alarmUntreatedCount1:0,
-				processingStatus:''
+				tabNav: ['未处理', '已处理'],
+				companyCode: '',
+				alarmUntreatedCount: '',
+				alarmUntreatedCount1: '',
+				processingStatus: '',
+		
 			};
 		},
-		onLoad: function(option) {
-			
-			console.log(option.type); 
-			console.log(option.companyCode); 
-			if (option.type == 1) {
-				uni.setNavigationBarTitle({
-					title: '电力检测'
-				});
-			} else {
-				uni.setNavigationBarTitle({
-					title: '视频告警'
-				});
-			}
-			this.getProcessData({"companyCode":option.companyCode,"type":option.type,"processingStatus":"0"},0);
+		onLoad: function(option) {
+
+			console.log(option.type);
+			console.log(option.companyCode);
+			if (option.type == 1) {
+				uni.setNavigationBarTitle({
+					title: '电力检测'
+				});
+			} else {
+				uni.setNavigationBarTitle({
+					title: '视频告警'
+				});
+			}
+			this.getProcessData({
+				"companyCode": option.companyCode,
+				"type": option.type,
+				"processingStatus": "0"
+			}, 0);
 			console.log('onload里')
-			
-			this.companyCode = option.companyCode;
-			this.processingStatus=1
-			this.type = option.type;
+
+			this.companyCode = option.companyCode;
+			this.processingStatus = 1
+			this.type = option.type;
 		},
-		methods: {
-			
-			
-			
-			
-			
-			async getProcessData(ming={},whichTab) {
-				
-				
-				// uni.request({
-				//     url: 'https://iot.usky.cn/USKYOF/USKYOF.php/Home/IntegratedAlarm/getElectricAlarmUntreated',
-				// 	data:ming,
-				//     success: (res) => {
-				//         console.log(res.data);
-						
-				// 		if(whichTab == 0){
-				// 			this.unporcessList=res.data.data;
-				// 			this.alarmUntreatedCount=res.data.alarmUntreatedCount
-				// 		}else{
-				// 			this.porcessedList=res.data.data;
-				// 			this.alarmUntreatedCount1=res.data.alarmUntreatedCount
-							
-				// 		}
-				//     }
-				// });
-				
-				
-				
-				const res= await this.$myRequest({
-					url:'IntegratedAlarm/getElectricAlarmUntreated',
-					data:ming,
-					
-				})
-				
-				if(whichTab == 0){
-					this.unporcessList=res.data.data;
-					this.alarmUntreatedCount=res.data.alarmUntreatedCount
-				}else{
-					this.porcessedList=res.data.data;
-					this.alarmUntreatedCount1=res.data.alarmUntreatedCount
-					
-				}
-				
-				
-				//   console.log(res.data)
-			},
-
-			tabSelect(e) {
-				
-				console.log(e.currentTarget);
-				this.TabCur = e.currentTarget.dataset.id;
-				this.scrollLeft = (e.currentTarget.dataset.id - 1) * 60;
-				
-				this.getProcessData({"companyCode":this.companyCode,"type":this.type,"processingStatus":e.currentTarget.dataset.id},this.TabCur);
-				
-			
-			
+		methods: {
+
+
+
+
+
+			async getProcessData(ming = {}, whichTab) {
+				const res = await this.$myRequest({
+					url: 'IntegratedAlarm/getElectricAlarmUntreated',
+					data: ming,
+					showLoading:true
+
+				})
+
+				if (whichTab == 0) {
+					this.unporcessList = res.data.data;
+					this.alarmUntreatedCount = parseInt(res.data.alarmUntreatedCount)
+				} else {
+					this.porcessedList = res.data.data;
+					this.alarmUntreatedCount1 = parseInt(res.data.alarmUntreatedCount)
+
+				}
+
+
+				//   console.log(res.data)
+			},
+
+			tabSelect(e) {
+
+				console.log(e.currentTarget);
+				this.TabCur = e.currentTarget.dataset.id;
+				this.scrollLeft = (e.currentTarget.dataset.id - 1) * 60;
+
+				this.getProcessData({
+					"companyCode": this.companyCode,
+					"type": this.type,
+					"processingStatus": e.currentTarget.dataset.id
+				}, this.TabCur);
+
+
+
 			},
 
 			// 页面跳转
 			goUnprocessDetail(id) {
 				uni.navigateTo({
-					url: '/pages/unprocessDetail/unprocessDetail?companyCode='+this.companyCode+'&processingStatus=0&id='+id+'&type=1',
+					url: '/pages/unprocessDetail/unprocessDetail?companyCode=' + this.companyCode + '&processingStatus=0&id=' + id +
+						'&type=1',
+					success: res => {},
+					fail: () => {},
+					complete: () => {}
+				});
+			},
+			goVideoUnprocessDetail(id) {
+				uni.navigateTo({
+					url: '/pages/unprocessDetail/unprocessDetail?companyCode=' + this.companyCode + '&processingStatus=0&id=' + id +
+						'&type=2',
 					success: res => {},
 					fail: () => {},
 					complete: () => {}
 				});
-			},
-			goVideoUnprocessDetail(id) {
-				uni.navigateTo({
-					url: '/pages/unprocessDetail/unprocessDetail?companyCode='+this.companyCode+'&processingStatus=0&id='+id+'&type=2',
-					success: res => {},
-					fail: () => {},
-					complete: () => {}
-				});
 			},
 			goProcessedDetail(id) {
 				uni.navigateTo({
-					url: '/pages/processedDetail/processedDetail?companyCode='+this.companyCode+'&processingStatus='+this.processingStatus+'&id='+id+'&type=1',
+					url: '/pages/processedDetail/processedDetail?companyCode=' + this.companyCode + '&processingStatus=' + this.processingStatus +
+						'&id=' + id + '&type=1',
 					success: res => {},
 					fail: () => {},
 					complete: () => {}
 				});
 			},
-			
+
 			goVideoProcessedDetail(id) {
 				uni.navigateTo({
-					url: '/pages/processedDetail/processedDetail?companyCode='+this.companyCode+'&processingStatus='+this.processingStatus+'&id='+id+'&type=2',
+					url: '/pages/processedDetail/processedDetail?companyCode=' + this.companyCode + '&processingStatus=' + this.processingStatus +
+						'&id=' + id + '&type=2',
 					success: res => {},
 					fail: () => {},
 					complete: () => {}

+ 1 - 1
pages/setting/setting.vue

@@ -82,7 +82,7 @@
 			},
 			goAuthManage() {
 				uni.navigateTo({
-					url: '/pages/siteManage/siteManage?type=3',
+					url: '/pages/authManage/authManage',
 					success: res => {},
 					fail: () => {},
 					complete: () => {}

+ 1 - 0
pages/siteList/siteList.vue

@@ -107,6 +107,7 @@
 			async getSiteList() {
 				const res= await this.$myRequest({
 					url:'OperationMonitoring/getSiteList',
+					showLoading:true
 				})
 				console.log(res.data.data)
 				this.siteListData=res.data.data

+ 1 - 0
pages/siteListAlarming/siteListAlarming.vue

@@ -44,6 +44,7 @@
 			async getSiteList() {
 				const res= await this.$myRequest({
 					url:'IntegratedAlarm/getSiteList',
+					showLoading:true
 				})
 				console.log(res.data.data)
 				this.siteListData=res.data.data

+ 111 - 62
pages/siteManage/siteManage.vue

@@ -5,48 +5,45 @@
 			<view class="cu-bar search bg-gray filter-section">
 				<view class="search-form round bg-white">
 					<text class="cuIcon-search"></text>
-					<input class="" @focus="InputFocus" @blur="InputBlur" :adjust-position="false" type="text" placeholder="请输入站点名称"
-					 confirm-type="search"></input>
+					<input class=""  type="text" placeholder="请输入站点名称"
+					 confirm-type="search" v-model="siteName"></input>
 				</view>
 				<view class="action">
-					<button class="cu-btn bg-blue round">查询</button>
+					<button class="cu-btn bg-blue round" @click="searchSiteList">查询</button>
 				</view>
 			</view>
 		</view>
 		<!-- 筛选框end -->
 
-		<!-- 列表start -->
+		<!-- 站点列表start -->
 		<view class="site-items">
-
 			<view class="cu-list menu-avatar">
-				<view class="cu-item" :class="modalName=='move-box-'+ index?'move-cur':''" v-for="(item,index) in siteListData"
-				 :key="index" @touchstart="ListTouchStart" @touchmove="ListTouchMove" @touchend="ListTouchEnd" :data-target="'move-box-' + index">
+				<view class="cu-item" :class="modalName=='move-box-'+ index?'move-cur':''" v-for="(item,index) in siteList" :key="index"
+				 @touchstart="ListTouchStart" @touchmove="ListTouchMove" @touchend="ListTouchEnd" :data-target="'move-box-' + index">
 					<view class="cu-avatar round lg" style="background-image: url(../../static/site-icon.png);"></view>
-					<view class="content" @tap="goDeviceManage"  v-if="type==1">
+
+					<view class="content">
 						<view class="text-grey site-tit">{{item.siteName}}</view>
-					</view>
-					<view class="content" v-else>
-						<view class="text-grey site-tit">{{item.siteName}}</view>
 					</view>
-					
+
 					<view class="nav-right num">
 						<view class="text-grey text-xs">
-							<image src="../../static/nav-icon.png" style="width:25rpx;height:25rpx;margin-right:26rpx"></image>
+							<image @click="mapLocation(item)" src="../../static/nav-icon.png" style="width:25rpx;height:25rpx;margin-right:26rpx"></image>
 						</view>
 					</view>
 					<view class="move">
-						<view class="bg-grey">编辑</view>
-						<view class="bg-red">删除</view>
+						<view class="bg-grey" @click.stop="editItem(item)">编辑</view>
+						<view class="bg-red" @click.stop="deleteItem(item)">删除</view>
 					</view>
 				</view>
 			</view>
+			<view v-if="!siteList.length&&siteListRes==1" class="text-center margin-top"> 暂无数据</view>
+		</view>
+		<!-- 站点列表end -->
 
-		</view>
-		<!-- 列表end
-		
 		<!-- 新增按钮start -->
 		<view class="plus">
-			<image src="../../static/plus.png" style="width:125rpx;height:125rpx"  @tap="goAddPage(type)"></image>
+			<image src="../../static/plus.png" style="width:125rpx;height:125rpx" @tap="goAddPage()"></image>
 		</view>
 		<!-- 新增按钮end -->
 	</view>
@@ -54,69 +51,121 @@
 </template>
 
 <script>
-	import json from '../../data/json.js';
-
 	export default {
 		data() {
 			return {
-				type: '0',
-				siteListData: json.siteListData,
 				modalName: null,
 				listTouchStart: 0,
 				listTouchDirection: null,
-				CustomBar: this.CustomBar,
-				csListArrl: [],
-				//左滑默认宽度
-				delBtnWidth: 160,
+
+				siteName: '',
+				siteList: [],
+				siteListRes: 0,
 			};
 		},
 
-		onLoad: function(option) {
-			console.log(option.type); //打印出上个页面传递的参数。
-			this.type = option.type;
-			if (option.type == 1) {
-				uni.setNavigationBarTitle({
-					title: '站点管理'
-				});
-			} else if (option.type == 2) {
-				uni.setNavigationBarTitle({
-					title: '设备管理'
+		onLoad: function(option) {
+			
+			//站点列表渲染
+			this.getSiteList()
+			
+		},
+		
+		methods: {
+			//筛选
+			searchSiteList() {
+				this.getSiteList({
+					"siteName": this.siteName
+				})
+			},
+			
+			//编辑
+			editItem(item) {
+				uni.navigateTo({
+					url: '/pages/siteAdd/siteAdd?id=' + item.id + '',
 				});
-			}else{
-				uni.setNavigationBarTitle({
-					title: '权限管理'
+			},
+
+			//删除
+			deleteItem(item) {
+				uni.showModal({
+					title: '确认删除吗?',
+					content: '',
+					success: function(result) {
+						if (result.confirm) {
+							this.setDelSite({
+								"id": item.id
+							})
+						} else if (result.cancel) {
+							// console.log('用户点击取消');
+						}
+					}.bind(this)
+				});
+			},
+			
+			// 打开导航
+			mapLocation(item) {
+				uni.openLocation({
+					latitude: parseInt(item.latitude),
+					longitude: parseInt(item.longitude),
+					success: function() {
+						// console.log('success');
+					}
 				});
-				
-			}
-		},
-		methods: {
+			},
 
-			// 页面跳转
-			goAddPage(type) {
+			async setDelSite(ming = {}) {
+				const res = await this.$myRequest({
+					url: 'SiteManagement/setDelSite',
+					data: ming
+				})
+				if (!res.data.flag) {
+					uni.showToast({
+						title: "删除失败",
+						icon: "none"
+					});
+				}else{
+					uni.showToast({
+						title: "删除成功",
+					});
+					setTimeout(() => {
+						this.getSiteList()
+					}, 1000);
+				}
+				
+			},
+
+			async getSiteList(ming = {}) {
+				const res = await this.$myRequest({
+					url: 'SiteManagement/getSiteList',
+					showLoading: true,
+					data: ming
+				})
+				this.siteListRes = 1;
+				this.siteList = res.data.data
+				console.log(res.data.data);
+			},
+			
+			// 新增跳转
+			goAddPage() {
 				uni.navigateTo({
-					url: '/pages/add/add?type='+this.type,
+					url: '/pages/siteAdd/siteAdd',
 					success: res => {},
 					fail: () => {},
 					complete: () => {}
 				});
 			},
-			
-			goDeviceManage() {
-				uni.navigateTo({
-					url: '/pages/siteManage/siteManage?type=2',
-					success: res => {},
-					fail: () => {},
-					complete: () => {}
-				});
-			},
-			InputFocus(e) {
-				this.InputBottom = e.detail.height
-			},
-			InputBlur(e) {
-				this.InputBottom = 0
+			
+			//跳转到设备管理页面
+			goDeviceManage() {
+				uni.navigateTo({
+					url: '/pages/siteManage/siteManage',
+					success: res => {},
+					fail: () => {},
+					complete: () => {}
+				});
 			},
 
-
 			// ListTouch触摸开始
 			ListTouchStart(e) {
 				this.listTouchStart = e.touches[0].pageX

+ 268 - 219
pages/unprocessDetail/unprocessDetail.vue

@@ -3,163 +3,152 @@
 		<view class="timeBox flex justify-between align-center padding-lr-sm">
 			<view class="time">2021-01-18 15:16:45</view>
 			<button class="cu-btn radius bg-red sm">未处理</button>
-		</view>
+		</view>
 		<!-- 电力start -->
-		<view v-if="type==1">
-			<view class="basic-info" >
-				<view class="info-tit margin-left-xs">
-					<text class="cuIcon-titles margin-right-xs"></text>
-					基本信息
-				</view>
-				<view class="info-content">
-					<view class="info-one-info ">
-						<text>站点名称:</text>
-						<text>{{detailMessage.siteName}}</text>
-					</view>
-					<view>
-						<text>线路名称:</text>
-						<text>{{detailMessage.deviceName}}</text>
-					</view>
-					<view>
-						<text>警告信息:</text>
-						<text>{{detailMessage.measValue}}</text>
-					</view>
-					<view>
-						<text>警告状态:</text>
-						<text>{{detailMessage.measValue?'动作':'复归'}}</text>
-					</view>
-					<view>
-						<text>采集终端:</text>
-						<text>{{detailMessage.deviceCode}}</text>
-					</view>
-					<view>
-						<text>站点地址:</text>
-						<text>{{detailMessage.address}}<text class="icon iconfont map" @click="mapLocation()">&#xe612;</text></text>
-					</view>
-					<view>
-						<text>联系人:</text>
-						<text>{{detailMessage.userName}}</text>
-					</view>
-					<view>
-						<text>联系方式:</text>
-						<text>
-							{{detailMessage.phone}}
-							<text class="phone icon iconfont" @click="submit()">&#xe61d;</text>
-						</text>
-					</view>
-					<view>
-						<text>运行数据:</text>
-						<text class="checkMore" @tap="goOpeDataDetail(detailMessage)">点击查看</text>
-					</view>
-					<view>
-						<text>视频:</text>
-						<text class="checkMore" @tap="goVideoDetail">点击查看</text>
-					</view>
-				</view>
-			</view>
-			<!-- 处理状态start -->
-			<view class="processStatus">
-				<view class="info-tit margin-left-xs">
-					<text class="cuIcon-titles margin-right-xs"></text>
-					处理内容
-				</view>
-				<view class="padding-lr padding-bottom-lg">
-					<form action="">
-						<view class="cu-form-group">
-							<!-- <textarea maxlength="-1" :disabled="modalName!=null" @input="textareaAInput" placeholder="备注信息,最多可输入50个字..."></textarea>-->
-							<textarea class="JTxtArea lg" v-model="msg" placeholder="备注信息,最多可输入50个字..." :maxlength="50" :data-maxnum="reason.length+'/50'"
-							 auto-height ></textarea>
-						</view>
-			
-						<view class="btn-area">
-							<!-- <button class="bg-orange round missReport margin-top">误 报 </button> -->
-							<button class="bg-blue round  missReport margin-top" @click="powerSubmit()">告警确认 </button>
-						</view>
-			
-					</form>
-			
-			
-			
-				</view>
-			</view>
-			<!-- 处理状态end -->
-		</view>
-		<!-- 电力end-->
-		
-		
-		<view v-else>
-			<view class="basic-info">
-				<view class="info-tit margin-left-xs">
-					<text class="cuIcon-titles margin-right-xs"></text>
-					基本信息
-				</view>
-				<view class="info-content">
-					<view class="info-one-info ">
-						<text>设备名称:</text>
-						<text>{{detailMessage2.deviceName}}</text> 
-					</view>
-					
-					<view>
-						<text>设备地址:</text>
-						<text>{{detailMessage2.deviceAddress}}</text>
-					</view>
-					<view>
-						<text>告警信息:</text>
-						<text>{{detailMessage2.alarmInformation}}</text>
-					</view>
-				</view>
-			</view>
-			<!-- 报警当前情况截图start -->
-			<view class="basic-info">
-				<view class="info-tit margin-left-xs">
-					<text class="cuIcon-titles margin-right-xs"></text>
-					报警当前情况截图
-				</view>
-				<view class="info-content padding-lr-lg">
-					<image :src="detailMessage2.alarmPicture" style="width:100%"></image>
-				</view>
-			</view>
-			<!-- 报警当前情况截图end -->
-			<!-- 处理状态start -->
-			<view class="processStatus">
-				<view class="info-tit margin-left-xs">
-					<text class="cuIcon-titles margin-right-xs"></text>
-					处理内容
-				</view>
-				<view class="padding-lr padding-bottom-lg">
-					<form action="">
-						<!-- <radio-group class="block" @change="RadioChange">
-							<view class=" flex align-center ">
-								<radio class="blue mr-sm margin-right-xs" :class="radio=='A'?'checked':''" :checked="radio=='A'?true:false"
-								 value="A"></radio>
-								<view class="title">单个处理</view>
-								<radio class="blue margin-left-lg margin-right-xs" :class="radio=='B'?'checked':''" :checked="radio=='B'?true:false"
-								 value="B"></radio>
-								<view class="title ">批量处理</view>
-							</view>
-						</radio-group> -->
-			
-						<view class="cu-form-group">
-							<!-- <textarea maxlength="-1" :disabled="modalName!=null" @input="textareaAInput" placeholder="备注信息,最多可输入50个字..."></textarea>-->
-							<textarea class="JTxtArea lg" placeholder="备注信息,最多可输入50个字..." :maxlength="50" :data-maxnum="reason.length+'/50'"
-							 auto-height v-model="msg2"></textarea>
-						</view>
-						<view class="btn-area">
-							<button class="bg-orange round missReport margin-top" @click="videoMissSubmit()">误 报 </button>
-							<button class="bg-blue round  missReport margin-top " @click="videoSubmit()">告警确认 </button>
-						</view>
-					</form>
-			
-			
-			
-				</view>
-			</view>
-			<!-- 处理状态end -->
+		<view v-if="type==1">
+			<view class="basic-info">
+				<view class="info-tit margin-left-xs">
+					<text class="cuIcon-titles margin-right-xs"></text>
+					基本信息
+				</view>
+				<view class="info-content">
+					<view class="info-one-info ">
+						<text>站点名称:</text>
+						<text>{{detailMessage.siteName}}</text>
+					</view>
+					<view>
+						<text>线路名称:</text>
+						<text>{{detailMessage.deviceName}}</text>
+					</view>
+					<view>
+						<text>警告信息:</text>
+						<text>{{detailMessage.measValue}}</text>
+					</view>
+					<view>
+						<text>警告状态:</text>
+						<text>{{detailMessage.measValue?'动作':'复归'}}</text>
+					</view>
+					<view>
+						<text>采集终端:</text>
+						<text>{{detailMessage.deviceCode}}</text>
+					</view>
+					<view>
+						<text>站点地址:</text>
+						<text>{{detailMessage.address}}<text class="icon iconfont map" @click="mapLocation()">&#xe612;</text></text>
+					</view>
+					<view>
+						<text>联系人:</text>
+						<text>{{detailMessage.userName}}</text>
+					</view>
+					<view>
+						<text>联系方式:</text>
+						<text>
+							{{detailMessage.phone}}
+							<text class="phone icon iconfont" @click="submit()">&#xe61d;</text>
+						</text>
+					</view>
+					<view>
+						<text>运行数据:</text>
+						<text class="checkMore" @tap="goOpeDataDetail(detailMessage)">点击查看</text>
+					</view>
+					<view>
+						<text>视频:</text>
+						<text class="checkMore" @tap="goVideoDetail">点击查看</text>
+					</view>
+				</view>
+			</view>
+			<!-- 处理状态start -->
+			<view class="processStatus">
+				<view class="info-tit margin-left-xs">
+					<text class="cuIcon-titles margin-right-xs"></text>
+					处理内容
+				</view>
+				<view class="padding-lr padding-bottom-lg">
+					<form action="">
+						<view class="cu-form-group">
+							<!-- <textarea maxlength="-1" :disabled="modalName!=null" @input="textareaAInput" placeholder="备注信息,最多可输入50个字..."></textarea>-->
+							<textarea class="JTxtArea lg" v-model="msg" placeholder="备注信息,最多可输入50个字..." :maxlength="50" :data-maxnum="reason.length+'/50'"
+							 auto-height></textarea>
+						</view>
+
+						<view class="btn-area">
+							<!-- <button class="bg-orange round missReport margin-top">误 报 </button> -->
+							<button class="bg-blue round  missReport margin-top" @click="powerSubmit()">告警确认 </button>
+						</view>
+
+					</form>
+
+
+
+				</view>
+			</view>
+			<!-- 处理状态end -->
+		</view>
+		<!-- 电力end-->
+
+
+		<view v-else>
+			<view class="basic-info">
+				<view class="info-tit margin-left-xs">
+					<text class="cuIcon-titles margin-right-xs"></text>
+					基本信息
+				</view>
+				<view class="info-content">
+					<view class="info-one-info ">
+						<text>设备名称:</text>
+						<text>{{detailMessage2.deviceName}}</text>
+					</view>
+
+					<view>
+						<text>设备地址:</text>
+						<text>{{detailMessage2.deviceAddress}}</text>
+					</view>
+					<view>
+						<text>告警信息:</text>
+						<text>{{detailMessage2.alarmInformation}}</text>
+					</view>
+				</view>
+			</view>
+			<!-- 报警当前情况截图start -->
+			<view class="basic-info">
+				<view class="info-tit margin-left-xs">
+					<text class="cuIcon-titles margin-right-xs"></text>
+					报警当前情况截图
+				</view>
+				<view class="info-content padding-lr-lg">
+					<image :src="detailMessage2.alarmPicture" style="width:100%"></image>
+				</view>
+			</view>
+			<!-- 报警当前情况截图end -->
+			<!-- 处理状态start -->
+			<view class="processStatus">
+				<view class="info-tit margin-left-xs">
+					<text class="cuIcon-titles margin-right-xs"></text>
+					处理内容
+				</view>
+				<view class="padding-lr padding-bottom-lg">
+					<form action="">
+						<view class="cu-form-group">
+							<!-- <textarea maxlength="-1" :disabled="modalName!=null" @input="textareaAInput" placeholder="备注信息,最多可输入50个字..."></textarea>-->
+							<textarea class="JTxtArea lg" placeholder="备注信息,最多可输入50个字..." :maxlength="50" :data-maxnum="reason.length+'/50'"
+							 auto-height v-model="msg2"></textarea>
+						</view>
+						<view class="btn-area">
+							<button class="bg-orange round missReport margin-top" @click="videoMissSubmit()">误 报 </button>
+							<button class="bg-blue round  missReport margin-top " @click="videoSubmit()">告警确认 </button>
+						</view>
+					</form>
+
+
+
+				</view>
+			</view>
+			<!-- 处理状态end -->
 		</view>
-		
-		
-		
-		
+
+
+
+
 
 	</view>
 </template>
@@ -171,92 +160,151 @@
 				radio: 'A',
 				radio: 'B',
 				modalName: null,
-				reason:'',
-				type: '0',
-				detailMessage:{},
-				detailMessage2:{},
-				msg:'',
-				msg2:''
-				
+				reason: '',
+				type: '0',
+				detailMessage: {},
+				detailMessage2: {},
+				msg: '',
+				msg2: '',
+				flag:false
+
 			}
 		},
-		onLoad: function(option) {
-			this.type = option.type;
-			this.companyCode = option.companyCode;
-			this.processingStatus=option.processingStatus;
-			this.alarmId = option.id;
-			if(this.type==1){
-				this.getUnProcessDetail({"companyCode":option.companyCode,"processingStatus":option.processingStatus,"alarmId":option.id})
-			}else{
-				this.getUnProcessDetail2({"companyCode":option.companyCode,"processingStatus":option.processingStatus,"alarmId":option.id})
-				
-			}
-			
+		onLoad: function(option) {
+			this.type = option.type;
+			this.companyCode = option.companyCode;
+			this.processingStatus = option.processingStatus;
+			this.alarmId = option.id;
+			if (this.type == 1) {
+				this.getUnProcessDetail({
+					"companyCode": option.companyCode,
+					"processingStatus": option.processingStatus,
+					"alarmId": option.id
+				})
+			} else {
+				this.getUnProcessDetail2({
+					"companyCode": option.companyCode,
+					"processingStatus": option.processingStatus,
+					"alarmId": option.id
+				})
+
+			}
+
 		},
-		methods: {
-
-			async getUnProcessDetail(ming={}) {  //电力未处理详情接口
-				const res= await this.$myRequest({
-					url:'IntegratedAlarm/getPowerAlarmDetails',
-					data:ming
-				})
-				  console.log(res.data.data[0]);
-				  this.detailMessage=res.data.data[0]
-			},
-			
-			async getUnProcessDetail2(ming={}) {  //电力未处理详情接口
-				const res= await this.$myRequest({
-					url:'IntegratedAlarm/getVideoAlarmDetails',
-					data:ming
-				})
-				  console.log(res.data.data[0]);
-				  this.detailMessage2=res.data.data[0]
-			},
-			
-			async powerSubmitRes(ming={}) { 
-				const res= await this.$myRequest({
-					url:'IntegratedAlarm/setAlarmHandle',
-					data:ming
+		methods: {
+
+			async getUnProcessDetail(ming = {}) { 
+				const res = await this.$myRequest({
+					url: 'IntegratedAlarm/getPowerAlarmDetails',
+					data: ming
+				})
+				console.log(res.data.data[0]);
+				this.detailMessage = res.data.data[0]
+			},
+
+			async getUnProcessDetail2(ming = {}) { 
+				const res = await this.$myRequest({
+					url: 'IntegratedAlarm/getVideoAlarmDetails',
+					data: ming
+				})
+				console.log(res.data.data[0]);
+				this.detailMessage2 = res.data.data[0]
+			},
+
+			async powerSubmitRes(ming = {}) {
+				const res = await this.$myRequest({
+					url: 'IntegratedAlarm/setAlarmHandle',
+					data: ming
 				})
+			   if(res.data.flag){
+				  uni.showToast({
+				  	title: "提交成功",
+				  });
+				  this.msg='',
+				  this.msg2=''
+			   }
+				
+			},
+
+			powerSubmit() {
+				if(!this.msg){
+					uni.showToast({
+						title: "请输入处理内容",
+						icon:"none"
+					});
+				}else{
+					this.powerSubmitRes({
+						"type": 1,
+						"deviceCode": this.detailMessage.deviceCode,
+						"companyCode": this.companyCode,
+						"id": this.detailMessage.id,
+						"handlerContent": this.msg
+					})
+				}
 			},
-			
-			powerSubmit(){
-				
-				this.powerSubmitRes({"type":1,"deviceCode":this.detailMessage.deviceCode,"companyCode":this.companyCode,"id":this.detailMessage.id,"handlerContent":this.msg})
-			alert(成功)
-			},
-			videoSubmit(){
-				alert(1)
-				this.powerSubmitRes({"alarmStatus":0,"type":2,"deviceCode":this.detailMessage2.deviceCode,"companyCode":this.companyCode,"id":this.detailMessage2.id,"handlerContent":this.msg2})
-			},
-			videoMissSubmit(){
-				alert(1)
-				this.powerSubmitRes({"alarmStatus":1,"type":2,"deviceCode":this.detailMessage2.deviceCode,"companyCode":this.companyCode,"id":this.detailMessage2.id,"handlerContent":this.msg2})
-			},
-			
 			
+			videoSubmit() {
+				if(!this.msg2){
+					uni.showToast({
+						title: "请输入处理内容",
+						icon:"none"
+					});
+				}else{
+					this.powerSubmitRes({
+						"alarmStatus": 0,
+						"type": 2,
+						"deviceCode": this.detailMessage2.deviceCode,
+						"companyCode": this.companyCode,
+						"id": this.detailMessage2.id,
+						"handlerContent": this.msg2
+					})
+					
+				}
+			
+				
+			},
+			videoMissSubmit() {
+				if(!this.msg2){
+					uni.showToast({
+						title: "请输入处理内容",
+						icon:"none"
+					});
+				}else{
+					this.powerSubmitRes({
+						"alarmStatus": 1,
+						"type": 2,
+						"deviceCode": this.detailMessage2.deviceCode,
+						"companyCode": this.companyCode,
+						"id": this.detailMessage2.id,
+						"handlerContent": this.msg2
+					})
+				}
+				
+				
+			},
+
+
 			submit() {
 				uni.makePhoneCall({
 					phoneNumber: '15122423833' //仅为示例
 				});
-			},
-			
+			},
+
 			mapLocation() {
 				uni.openLocation({
-					latitude: parseInt(this.detailMessage.latitude),
+					latitude: parseInt(this.detailMessage.latitude),
 					longitude: parseInt(this.detailMessage.longitude),
 					success: function() {
 						console.log('success');
 					}
 				});
-
-
 			},
 
 			// 页面跳转
 			goOpeDataDetail(detailMessage) {
 				uni.navigateTo({
-					url: '/pages/unprocessDetail/opeDataDetail/opeDataDetail?companyCode='+this.companyCode+'&deviceCode='+detailMessage.deviceCode+'&deviceType='+this.type+'',
+					url: '/pages/unprocessDetail/opeDataDetail/opeDataDetail?companyCode=' + this.companyCode + '&deviceCode=' +
+						detailMessage.deviceCode + '&deviceType=' + this.type + '',
 					success: res => {},
 					fail: () => {},
 					complete: () => {}
@@ -302,6 +350,7 @@
 			color: #999999;
 		}
 	}
+
 	// textarea
 	.JTxtArea {
 		position: relative;

+ 28 - 16
pages/videoList/videoList.vue

@@ -4,27 +4,22 @@
 		<view class="cu-list menu-avatar">
 			<view class="cu-item" :class="modalName=='move-box-'+ index?'move-cur':''" v-for="(item,index) in deviceData"
 			 :key="index" :data-target="'move-box-' + index" @tap="goVideoDetail(item)">
-				<view class="cu-avatar round lg" style="background-image:url(../../static/video-icon-off.png);opacity:.7" ></view>
+				<view v-if="item.trueStatus==0" class="cu-avatar round lg" style="background-image:url(../../static/video-icon-on.png);opacity:.7" ></view>
+				<view v-else class="cu-avatar round lg" style="background-image:url(../../static/video-icon-off.png);opacity:.7" ></view>
+				
 				<view class="content">
 					<view class="">{{item.deviceName}}</view>
 				</view>
-				<view class="nav-right num">
-					<view class="online" >
-						{{item.trueStatus?'离线':'在线'}}
-						<text class="icon iconfont margin-right-xs margin-left-lg">&#xe629;</text>
-					</view>
-					<!-- <view v-if="item.status=='在线'" class="online" >
-						{{item.trueStatus}}
+				<view class="nav-right num">
+					<view v-if="item.trueStatus==1" class="offline" >
+						离线
 						<text class="icon iconfont margin-right-xs margin-left-lg">&#xe629;</text>
 					</view>
-					<view v-else-if="item.status=='离线'" class="text-gray" >
-						{{item.trueStatus}}
+					
+					<view v-else class="online">
+						在线
 						<text class="icon iconfont margin-right-xs margin-left-lg">&#xe629;</text>
-					</view>
-					<view v-else="item.status=='异常'" class="error" >
-						{{item.trueStatus}}
-						<text class="icon iconfont margin-right-xs margin-left-lg">&#xe629;</text>
-					</view> -->
+					</view>
 				</view>
 			</view>
 		</view>
@@ -35,7 +30,24 @@
 	export default {
 		data() {
 			return {
-				deviceData: [
+				deviceData: [
+					// {
+					// 	status: '离线',
+					// 	imgUrl: '../../static/video-icon-off.png',
+					// 	title: 'C59360332',
+					// 	num: 6
+					// }, {
+					// 	status: '在线',
+					// 	imgUrl: '../../static/video-icon-on.png',
+					// 	title: 'C59360332',
+					// 	num: 11
+					// },
+					// {
+					// 	status: '异常',
+					// 	imgUrl: '../../static/video-icon-error.png',
+					// 	title: 'C59360332',
+					// 	num: 6
+					// }
 				],
 				modalName: null,
 

+ 29 - 14
util/api.js

@@ -5,12 +5,18 @@ let ajaxTimes = 0;
 
 export const myRequest = (options) => {
 
-	ajaxTimes++;
+	let showLoading = options.showLoading || false;
+
 	// 显示加载中 效果
-	uni.showLoading({
-		title: "加载中",
-		mask: true,
-	});
+	if (showLoading) {
+		ajaxTimes++;
+		uni.showLoading({
+			title: "加载中",
+			mask: true,
+		});
+
+	}
+
 	return new Promise((resolve, reject) => {
 		uni.request({
 			url: BASE_URL + options.url,
@@ -20,28 +26,37 @@ export const myRequest = (options) => {
 				'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
 			},
 			success: (res) => {
-				console.log('success里')
 				if (res.data.flag == false) { //登录失效
 					return uni.showToast({
-						title: '获取数据失败',
+						title: '获取数据失败!',
+						icon: "none"
 					})
 				}
 				resolve(res)
 			},
 			fail: (err) => {
-				uni.showToast({
-					title: '请求接口失败',
-				})
+
+				uni.showModal({
+					showCancel: false,
+					content: '请求接口失败'
+				});
+				// uni.showToast({
+				// 	title: '请求接口失败',
+				// 	icon:"none"
+				// })
 				reject(err)
 
 			},
 			// 完成之后关闭加载效果
 			complete: () => {
-				ajaxTimes--;
-				if (ajaxTimes === 0) {
-					//  关闭正在等待的图标
-					uni.hideLoading();
+				if (showLoading) {
+					ajaxTimes--;
+					if (ajaxTimes === 0) {
+						//  关闭正在等待的图标
+						uni.hideLoading();
+					}
 				}
+
 			}
 		})
 	})