Bläddra i källkod

监察上报添加筛选/站点管理BUG修复

fanghuisheng 2 år sedan
förälder
incheckning
fb5170d875

+ 16 - 3
pages/eleControl/controlReport/controlReport.vue

@@ -1,6 +1,18 @@
 <template>
   <view class="site-wrapper">
     <view style="height: calc(100vh - 200rpx)">
+      <!-- 筛选框start -->
+      <view class="cu-bar search bg-gray filter-section">
+        <view class="search-form round bg-white">
+          <text class="cuIcon-search"></text>
+          <input class="" type="text" placeholder="请输入标题" v-model="supervision_title" />
+        </view>
+        <view class="action">
+          <button class="cu-btn bg-blue round" @click="loadData">查询</button>
+        </view>
+      </view>
+      <!-- 筛选框end -->
+
       <view class="cu-list menu-avatar">
         <view
           class="cu-item"
@@ -55,6 +67,8 @@ export default {
       size: 11,
       loadStatus: "loading", //加载样式:more-加载前样式,loading-加载中样式,nomore-没有数据样式
       isLoadMore: false, //是否加载中
+
+      supervision_title: "",
     };
   },
 
@@ -91,6 +105,7 @@ export default {
       this.getDataList({
         currentPage: this.currentPage,
         size: this.size,
+        supervision_title: this.supervision_title,
       });
     },
 
@@ -105,7 +120,7 @@ export default {
 
       if (res.data.total) {
         // this.controlReport = res.data.data
-        this.controlReport = this.controlReport.concat(res.data.data);
+        this.controlReport = res.data.data;
         if (res.data.data.length < this.size) {
           //判断接口返回数据量小于请求数据量,则表示此为最后一页
           this.isLoadMore = true;
@@ -113,8 +128,6 @@ export default {
         } else {
           this.isLoadMore = false;
         }
-        console.log("this.controlReport");
-        console.log(this.controlReport);
       } else {
         this.isLoadMore = true;
         this.loadStatus = "nomore";

+ 267 - 301
pages/login/login.vue

@@ -1,309 +1,275 @@
 <template>
-	<view class="section">
-
-		<view class="text-area content">
-			<text class="title">智慧用电</text>
-		</view>
-
-		<form class="padding-lg flex flex-direction">
-			<view class="login-box shadow ">
-				<view class="phone-box">
-					<input type="text" placeholder="请输入手机号码" onfocus="this.placeholder=''" v-model="phone">
-					<span class="icon iconfont left-icon">&#xe64f;</span>
-					<span class="icon iconfont right-icon" @tap="clearPhone">&#xe610;</span>
-				</view>
-				<view class="password-box">
-					<input type="text" placeholder="请输入验证码" v-model="verify" maxlength="5" >
-					<text class="icon iconfont left-icon">&#xe86a;</text>
-					<view @click="getVerifyCode">
-						<text class="right-icon verify">{{!codeTime?'获取验证码':codeTime+'s'}}</text>
-
-					</view>
-				</view>
-
-				<view class="btn-area">
-					<button class="submit" @click="$noMultipleClicks(submitRes)">提 交 </button>
-				</view>
-			</view>
-		</form>
-	</view>
+  <view class="section">
+    <view class="text-area content">
+      <text class="title">智慧用电</text>
+    </view>
+
+    <form class="padding-lg flex flex-direction">
+      <view class="login-box shadow">
+        <view class="phone-box">
+          <input type="text" placeholder="请输入手机号码" onfocus="this.placeholder=''" v-model="phone" />
+          <span class="icon iconfont left-icon">&#xe64f;</span>
+          <span class="icon iconfont right-icon" @tap="clearPhone">&#xe610;</span>
+        </view>
+        <view class="password-box">
+          <input type="text" placeholder="请输入验证码" v-model="verify" maxlength="5" />
+          <text class="icon iconfont left-icon">&#xe86a;</text>
+          <view @click="getVerifyCode">
+            <text class="right-icon verify">{{ !codeTime ? "获取验证码" : codeTime + "s" }}</text>
+          </view>
+        </view>
+
+        <view class="btn-area">
+          <button class="submit" @click="$noMultipleClicks(submitRes)">提 交</button>
+        </view>
+      </view>
+    </form>
+  </view>
 </template>
 
 <script>
-	export default {
-		data() {
-			return {
-				noClick:true,
-				codeTime: 0,
-				
-				phone: '',
-				verify: '',
-				VerificationCodeOne: ''
-
-			}
-		},
-		onLoad(option) {
-			// alert(option.flag)
-			
-			if(option.flag){	
-			}else{
-			this.init()
-				
-			}
-
-			uni.setNavigationBarColor({
-				frontColor: "#ffffff", //文字颜色
-				backgroundColor: "#4866DF", //底部背景色
-
-			})
-			uni.setNavigationBarTitle({
-				title: '登录'
-			});
-
-
-
-
-		},
-		methods: {
-			
-			async init(){
-				window.location.href=this.$BASE_URL+"Login/getLoginAuthorizes1"
-				
-			},
-			
-			
-			clearPhone(){
-				this.phone=''
-			},
-
-			
-
-
-			//短信验证码验证
-			getVerifyCode() {
-				if (!this.phone) {
-					uni.showToast({
-						title: "请输入手机号码...",
-						icon: "none"
-					});
-					return
-
-				}
-				// /^1[3|4|5|7|8|9][0-9]{9}$/
-				if (!/^1[3456789]\d{9}$/.test(this.phone)) {
-					uni.showToast({
-						title: "请输入正确的手机号码...",
-						icon: "none"
-					});
-					return
-				}
-				this.getVerifyData({
-					"phone": this.phone
-				})
-
-				if (this.codeTime > 0) {
-					uni.showToast({
-						title: '不能重复获取',
-						icon: "none"
-					});
-					return;
-				} else {
-					this.codeTime = 60
-					let timer = setInterval(() => {
-						this.codeTime--;
-						if (this.codeTime < 1) {
-							clearInterval(timer);
-							this.codeTime = 0
-						}
-					}, 1000)
-				}
-
-
-			},
-			async getVerifyData(params = {}) {
-				const res = await this.$myRequest({
-					url: 'Login/getVerificationCode',
-					data: params
-				})
-
-
-				this.VerificationCodeOne = eval('(' + res.data + ')').data[0].VerificationCode
-			},
-
-			// 登录提交按钮
-			submitRes() {
-				if (!this.phone) {
-					uni.showToast({
-						title: "请输入手机号码...",
-						icon: "none"
-					});
-					return
-
-				}
-				if (!/^1[3456789]\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(params = {}) {
-				const res = await this.$myRequest({
-					url: 'Login/setSignUp1',
-					data: params
-				})
-			
-				
-				if (res.data.flag == true) {
-					uni.switchTab({
-						url: '/pages/index/index'
-					});
-
-				} else {
-
-				}
-			},
-
-		}
-	}
+export default {
+  data() {
+    return {
+      noClick: true,
+      codeTime: 0,
+
+      phone: "",
+      verify: "",
+      VerificationCodeOne: "",
+    };
+  },
+  onLoad(option) {
+    // alert(option.flag)
+
+    if (option.flag) {
+    } else {
+      this.init();
+    }
+
+    uni.setNavigationBarColor({
+      frontColor: "#ffffff", //文字颜色
+      backgroundColor: "#4866DF", //底部背景色
+    });
+    uni.setNavigationBarTitle({
+      title: "登录",
+    });
+  },
+  methods: {
+    async init() {
+      window.location.href = this.$BASE_URL + "Login/getLoginAuthorizes1";
+    },
+
+    clearPhone() {
+      this.phone = "";
+    },
+
+    //短信验证码验证
+    getVerifyCode() {
+      if (!this.phone) {
+        uni.showToast({
+          title: "请输入手机号码...",
+          icon: "none",
+        });
+        return;
+      }
+      // /^1[3|4|5|7|8|9][0-9]{9}$/
+      if (!/^1[3456789]\d{9}$/.test(this.phone)) {
+        uni.showToast({
+          title: "请输入正确的手机号码...",
+          icon: "none",
+        });
+        return;
+      }
+      this.getVerifyData({
+        phone: this.phone,
+      });
+
+      if (this.codeTime > 0) {
+        uni.showToast({
+          title: "不能重复获取",
+          icon: "none",
+        });
+        return;
+      } else {
+        this.codeTime = 60;
+        let timer = setInterval(() => {
+          this.codeTime--;
+          if (this.codeTime < 1) {
+            clearInterval(timer);
+            this.codeTime = 0;
+          }
+        }, 1000);
+      }
+    },
+    async getVerifyData(params = {}) {
+      const res = await this.$myRequest({
+        url: "Login/getVerificationCode",
+        data: params,
+      });
+
+      this.VerificationCodeOne = eval("(" + res.data + ")").data[0].VerificationCode;
+    },
+
+    // 登录提交按钮
+    submitRes() {
+      if (!this.phone) {
+        uni.showToast({
+          title: "请输入手机号码...",
+          icon: "none",
+        });
+        return;
+      }
+      if (!/^1[3456789]\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(params = {}) {
+      const res = await this.$myRequest({
+        url: "Login/setSignUp1",
+        data: params,
+      });
+
+      if (res.data.flag == true) {
+        uni.switchTab({
+          url: "/pages/index/index",
+        });
+      } else {
+      }
+    },
+  },
+};
 </script>
 
 <style>
-	.section {
-		height: 400rpx;
-		background-image: url(/static/login-bg.png);
-		background-size: cover;
-		background-repeat: no-repeat;
-	}
-
-	.content {
-		height: 434rpx;
-		text-align: center;
-		position: relative;
-
-
-	}
-
-	.login-box {
-		height: 600rpx;
-		position: relative;
-		top: -150rpx;
-		background: #fff;
-		border-radius: 30rpx;
-		padding: 100rpx 20rpx;
-	}
-
-	.shadow {
-		box-shadow: 1px 1px 4px rgb(26 26 26 / 10%);
-	}
-
-	.title {
-		position: absolute;
-		color: #fff;
-		font-size: 60rpx;
-		bottom: 180rpx;
-		display: block;
-		width: 100%;
-
-	}
-
-	input,
-	button {
-		width: 100%;
-		height: 100rpx;
-		line-height: 100rpx;
-		opacity: 1;
-		border: 1px solid #dbdbdb;
-		border-radius: 100rpx;
-		background: #fff;
-		coloe: #333;
-		margin: 40rpx 0;
-		font-size: 34rpx;
-
-	}
-
-	input {
-
-		text-indent: 100rpx;
-
-	}
-
-
-	.submit {
-		background: #4074E7;
-		color: #fff
-	}
-
-	.phone-box,
-	.password-box {
-		position: relative;
-	}
-
-	.phone-box text,
-	.password-box text {
-		font-size: 30rpx;
-		color: #999999
-	}
-
-	.left-icon {
-		position: absolute;
-		left: 48rpx;
-		top: 50%;
-		margin-top: -20rpx;
-		line-height: 100%
-	}
-
-	.right-icon {
-		position: absolute;
-		right: 48rpx;
-		top: 50%;
-		margin-top: -20rpx;
-		line-height: 100%
-	}
-
-	.right-icon.verify {
-		margin-top: -10rpx;
-		color: #4074E7
-	}
-
-	.iconfont {
-		color: #999
-	}
-
-	/* 底部 */
-	.box {
-		display: none;
-		position: fixed;
-		bottom: 0;
-		width: 100%;
-		border-top: 1px solid pink
-	}
-
-	.cuIcon-cu-image .iconfont {
-		width: 38rpx;
-		height: 38rpx;
-		display: inline-block;
-		margin-bottom: 10rpx;
-	}
-
-	.text-gray {
-		font-size: 26rpx;
-	}
+.section {
+  height: 400rpx;
+  background-image: url(/static/login-bg.png);
+  background-size: cover;
+  background-repeat: no-repeat;
+}
+
+.content {
+  height: 434rpx;
+  text-align: center;
+  position: relative;
+}
+
+.login-box {
+  height: 600rpx;
+  position: relative;
+  top: -150rpx;
+  background: #fff;
+  border-radius: 30rpx;
+  padding: 100rpx 20rpx;
+}
+
+.shadow {
+  box-shadow: 1px 1px 4px rgb(26 26 26 / 10%);
+}
+
+.title {
+  position: absolute;
+  color: #fff;
+  font-size: 60rpx;
+  bottom: 180rpx;
+  display: block;
+  width: 100%;
+}
+
+input,
+button {
+  width: 100%;
+  height: 100rpx;
+  line-height: 100rpx;
+  opacity: 1;
+  border: 1px solid #dbdbdb;
+  border-radius: 100rpx;
+  background: #fff;
+  coloe: #333;
+  margin: 40rpx 0;
+  font-size: 34rpx;
+}
+
+input {
+  text-indent: 100rpx;
+}
+
+.submit {
+  background: #4074e7;
+  color: #fff;
+}
+
+.phone-box,
+.password-box {
+  position: relative;
+}
+
+.phone-box text,
+.password-box text {
+  font-size: 30rpx;
+  color: #999999;
+}
+
+.left-icon {
+  position: absolute;
+  left: 48rpx;
+  top: 50%;
+  margin-top: -20rpx;
+  line-height: 100%;
+}
+
+.right-icon {
+  position: absolute;
+  right: 48rpx;
+  top: 50%;
+  margin-top: -20rpx;
+  line-height: 100%;
+}
+
+.right-icon.verify {
+  margin-top: -10rpx;
+  color: #4074e7;
+}
+
+.iconfont {
+  color: #999;
+}
+
+/* 底部 */
+.box {
+  display: none;
+  position: fixed;
+  bottom: 0;
+  width: 100%;
+  border-top: 1px solid pink;
+}
+
+.cuIcon-cu-image .iconfont {
+  width: 38rpx;
+  height: 38rpx;
+  display: inline-block;
+  margin-bottom: 10rpx;
+}
+
+.text-gray {
+  font-size: 26rpx;
+}
 </style>

+ 2 - 4
pages/siteAdd/siteAdd.vue

@@ -63,16 +63,14 @@
 					<option value="2">嘉定</option>
 				</select>
 			</view>
-
-			<!-- <view class="form-item">
+			<view class="form-item">
 				<view class="title"><text class="necessary">*</text>装机容量:</view>
 				<input name="input" v-model="installed_capacity"/>
 			</view>
 			<view class="form-item" style="padding-bottom:200rpx">
 				<view class="title"><text class="necessary">*</text>流变变化:</view>
 				<input name="input" v-model="rheological_change"/>
-			</view> -->
-
+			</view>
 
 			<view class="btn-area submitBottomBtn padding-lr-sm">
 				<button class="bg-blue round  margin-top" @click="$noMultipleClicks(addSubmit)">提 交 </button>

+ 155 - 177
pages/siteListAlarming/siteListAlarming.vue

@@ -1,186 +1,164 @@
 <template>
-	<!-- <list-test :bindData="siteListData" :bindUrl="linkUrl" :bindIcon="linkIcon" :bindNum="num" :bindType="type"
+  <!-- <list-test :bindData="siteListData" :bindUrl="linkUrl" :bindIcon="linkIcon" :bindNum="num" :bindType="type"
 	 :bindSiteName="siteName" :bindDetailUrl="detailUrl" :bindSiteListRes="siteListRes">
 	</list-test> -->
-	
-	<view  class="site-wrapper" ref="contentWrapper">
-		
-			<view style="height:100rpx"></view>
-		<!-- 筛选框start -->
-		<view class="ding">
-			<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="请输入站点名称"
-					  v-model="siteName"/>
-				</view>
-				<view class="action">
-					<button class="cu-btn bg-blue round" @click="searchData">查询</button>
-				</view>
-			</view>
-		</view>
-		<!-- 筛选框end -->
-		
-		<!-- 站点列表start -->
-		<view class="site-items" style="margin-top:0;">
-			<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" :data-target="'move-box-' + index">
-					<view class="cu-avatar round lg"  v-bind:style="{ 'background-image': 'url(' + linkIcon+ ')' }"></view>
-					
-					
-					<view class="content" v-if="type==1"  @tap="goNowUrl(item)" >
-						<view class="text-grey site-tit ">
-							<text style="width:93%" class="inTwoLine">{{item.siteName}}( 共{{item.siteAlarmCount}}个未处理告警 )</text>
-						</view>
-					</view>
-					
-					<view class="content" v-else  @tap="goNowUrl" @longpress="showDetail(item)">
-						<view class="text-grey site-tit">
-							{{item.siteName}}
-							<text>(共3个设备)</text>
-						</view>
-						<view class="showDetail" v-if="item.isShow" @tap.stop="goNowDetailUrl" >查看详情</view>
-					</view>
-					
-					
-					
-					
-					<view class="nav-right num">
-						<view class="text-grey">
-							<text class="icon iconfont margin-right-xs margin-left-lg">&#xe629;</text>
-						</view>
-					</view>
-				</view>
-			</view>
-			<view v-if="!siteListData.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 -->
-	
-		
-	</view>
-	
 
+  <view class="site-wrapper" ref="contentWrapper">
+    <view style="height: 100rpx"></view>
+    <!-- 筛选框start -->
+    <view class="ding">
+      <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="请输入站点名称" v-model="siteName" />
+        </view>
+        <view class="action">
+          <button class="cu-btn bg-blue round" @click="searchData">查询</button>
+        </view>
+      </view>
+    </view>
+    <!-- 筛选框end -->
+
+    <!-- 站点列表start -->
+    <view class="site-items" style="margin-top: 0">
+      <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" :data-target="'move-box-' + index">
+          <view class="cu-avatar round lg" v-bind:style="{ 'background-image': 'url(' + linkIcon + ')' }"></view>
+
+          <view class="content" v-if="type == 1" @tap="goNowUrl(item)">
+            <view class="text-grey site-tit">
+              <text style="width: 93%" class="inTwoLine">{{ item.siteName }}( 共{{ item.siteAlarmCount }}个未处理告警 )</text>
+            </view>
+          </view>
+
+          <view class="content" v-else @tap="goNowUrl" @longpress="showDetail(item)">
+            <view class="text-grey site-tit">
+              {{ item.siteName }}
+              <text>(共3个设备)</text>
+            </view>
+            <view class="showDetail" v-if="item.isShow" @tap.stop="goNowDetailUrl">查看详情</view>
+          </view>
+
+          <view class="nav-right num">
+            <view class="text-grey">
+              <text class="icon iconfont margin-right-xs margin-left-lg">&#xe629;</text>
+            </view>
+          </view>
+        </view>
+      </view>
+      <view v-if="!siteListData.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 -->
+  </view>
 </template>
 
 <script>
-	import json from '../../data/json.js';
-
-	export default {
-
-		data() {
-			return {
-				modalName: null,
-				siteListRes: 0,
-				type: 1,
-				linkUrl: '/pages/alarmingList/alarmingList',
-				linkIcon: '../../static/site-icon-alarm.png',
-				siteListData: [],
-				num: ' 共3个未处理告警',
-				detailUrl: '/pages/siteDetail/siteDetail',
-				siteName: '',
-				
-				currentPage: 1,
-				size: 12,
-				loadStatus: 'loading', //加载样式:more-加载前样式,loading-加载中样式,nomore-没有数据样式
-				isLoadMore: false, //是否加载中
-			};
-		},
-
-
-		onPullDownRefresh() {
-			console.log('refresh');
-			setTimeout(function() {
-				uni.stopPullDownRefresh();
-			}, 1000);
-		},
-		computed: {
-
-		},
-
-		mounted() {
-
-		},
-		onReachBottom() { //上拉触底函数
-			if (!this.isLoadMore) { //此处判断,上锁,防止重复请求
-				this.isLoadMore = true
-				this.currentPage += 1;
-				this.loadData()
-			}
-		},
-
-		onLoad() {
-			this.loadData()
-		},
-
-		methods: {
-			searchData(){
-				this.currentPage=1,
-				this.siteListData=[]
-				this.siteListRes=0
-				
-				this.loadData()
-				
-			},
-			loadData(){
-				this.getDataList({
-					"siteName":this.siteName,
-					currentPage: this.currentPage,
-					size: this.size,
-				})
-				
-			},
-			// 页面跳转
-			goNowUrl(item) {
-				uni.navigateTo({
-					url: this.linkUrl+'?companyCode='+item.companyCode,
-					success: res => {},
-					fail: () => {},
-					complete: () => {}
-				});
-				// if(item.siteAlarmCount){
-					
-				// }
-				
-			},
-			
-			InputFocus(e) {
-				this.InputBottom = e.detail.height
-			},
-			InputBlur(e) {
-				this.InputBottom = 0
-			},
-			async getDataList(params = {}) {
-				const res = await this.$myRequest({
-					url: 'IntegratedAlarm/getSiteList',
-					showLoading: true,
-					data: params
-				})
-				// console.log(res.data.data)
-				// this.siteListData = res.data.data
-				this.siteListRes = 1;
-				if (res.data.total) {
-					this.siteListData = this.siteListData.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'
-				}
-			}
-		}
-
-	}
-</script>
+import json from "../../data/json.js";
+
+export default {
+  data() {
+    return {
+      modalName: null,
+      siteListRes: 0,
+      type: 1,
+      linkUrl: "/pages/alarmingList/alarmingList",
+      linkIcon: "../../static/site-icon-alarm.png",
+      siteListData: [],
+      num: " 共3个未处理告警",
+      detailUrl: "/pages/siteDetail/siteDetail",
+      siteName: "",
+
+      currentPage: 1,
+      size: 12,
+      loadStatus: "loading", //加载样式:more-加载前样式,loading-加载中样式,nomore-没有数据样式
+      isLoadMore: false, //是否加载中
+    };
+  },
 
-<style>
+  onPullDownRefresh() {
+    console.log("refresh");
+    setTimeout(function () {
+      uni.stopPullDownRefresh();
+    }, 1000);
+  },
+  computed: {},
+
+  mounted() {},
+  onReachBottom() {
+    //上拉触底函数
+    if (!this.isLoadMore) {
+      //此处判断,上锁,防止重复请求
+      this.isLoadMore = true;
+      this.currentPage += 1;
+      this.loadData();
+    }
+  },
+
+  onLoad() {
+    this.loadData();
+  },
+
+  methods: {
+    searchData() {
+      (this.currentPage = 1), (this.siteListData = []);
+      this.siteListRes = 0;
+
+      this.loadData();
+    },
+    loadData() {
+      this.getDataList({
+        siteName: this.siteName,
+        currentPage: this.currentPage,
+        size: this.size,
+      });
+    },
+    // 页面跳转
+    goNowUrl(item) {
+      uni.navigateTo({
+        url: this.linkUrl + "?companyCode=" + item.companyCode,
+        success: (res) => {},
+        fail: () => {},
+        complete: () => {},
+      });
+      // if(item.siteAlarmCount){
+
+      // }
+    },
+
+    InputFocus(e) {
+      this.InputBottom = e.detail.height;
+    },
+    InputBlur(e) {
+      this.InputBottom = 0;
+    },
+    async getDataList(params = {}) {
+      const res = await this.$myRequest({
+        url: "IntegratedAlarm/getSiteList",
+        showLoading: true,
+        data: params,
+      });
+      // console.log(res.data.data)
+      // this.siteListData = res.data.data
+      this.siteListRes = 1;
+      if (res.data.total) {
+        this.siteListData = this.siteListData.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";
+      }
+    },
+  },
+};
+</script>
 
-</style>
+<style></style>

+ 83 - 89
util/api.js

@@ -1,98 +1,92 @@
-
-
 /** qhome.usky.cn测试域名  wx.ewoogi.com 正式域名 **/
 
-const BASE_URL = 'https://wx.ewoogi.com/USKYOF/USKYOF.php/Home/'  
-const websiteUrl = 'https://wx.ewoogi.com'
+var BASE_URL = "";
+if (window.location.host.indexOf("localhost") == -1) {
+  BASE_URL = "https://wx.ewoogi.com/USKYOF/USKYOF.php/Home/";
+} else {
+  BASE_URL = "https://qhome.usky.cn/USKYOF/USKYOF.php/Home/";
+}
 
+const websiteUrl = "https://wx.ewoogi.com";
 
 // 同时发送异步代码的次数,防止一次点击中有多次请求,用于处理
 let ajaxTimes = 0;
 
-function myRequest(options){
-
-	let showLoading = options.showLoading || false;
-
-	// 显示加载中 效果
-	if (showLoading) {
-		ajaxTimes++;
-		uni.showLoading({
-			title: "加载中",
-			mask: true,
-		});
-	}
-
-	return new Promise((resolve, reject) => {
-		uni.request({
-			url: BASE_URL + options.url,
-			method: options.method || 'POST',
-			data: options.data || {},
-			header: {
-				'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
-			},
-			success: (res) => {
-				let notShowToastUrl = ['Login/getLoginAuthorize'];
-				if (!notShowToastUrl.includes(options.url)) {
-					if (res.data.flag == false) {
-
-						// 修复首页操作失败bug start
-						let notIndexFail2 = ['Index/getDataStatistics'];
-						let ua = navigator.userAgent.toLowerCase();
-						if (notIndexFail2.includes(options.url) && ua.match(
-								/MicroMessenger/i) == "micromessenger") {
-							
-						} else {
-
-							return uni.showToast({
-								title: res.data.msg ? res.data.msg : "获取数据失败",
-								icon: "none"
-							})
-						}
-						// end
-
-						// return uni.showToast({
-						// 	title: res.data.msg ? res.data.msg : "获取数据失败",
-						// 	icon: "none"
-						// })
-					}
-					resolve(res)
-				}
-			},
-			fail: (err) => {
-
-				// 修复首页请求接口失败bug start
-				let notIndexFail = ['Index/getDataStatistics', 'Com/getAuthorizationUrl'];
-				if (notIndexFail.includes(options.url)) {
-					window.location.href =
-						'https://wx.ewoogi.com/wx/index.html#/pages/index/index';
-				} else {
-					uni.showModal({
-						showCancel: false,
-						content: '请求接口失败'
-					});
-				}
-				// end
-
-				reject(err)
-
-			},
-			// 完成之后关闭加载效果
-			complete: () => {
-				if (showLoading) {
-					ajaxTimes--;
-					if (ajaxTimes === 0) {
-						//  关闭正在等待的图标
-						uni.hideLoading();
-					}
-				}
-
-			}
-		})
-	})
-
+function myRequest(options) {
+  let showLoading = options.showLoading || false;
+
+  // 显示加载中 效果
+  if (showLoading) {
+    ajaxTimes++;
+    uni.showLoading({
+      title: "加载中",
+      mask: true,
+    });
+  }
+
+  return new Promise((resolve, reject) => {
+    uni.request({
+      url: BASE_URL + options.url,
+      method: options.method || "POST",
+      data: options.data || {},
+      header: {
+        "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
+      },
+      success: (res) => {
+        let notShowToastUrl = ["Login/getLoginAuthorize"];
+        if (!notShowToastUrl.includes(options.url)) {
+          if (res.data.flag == false) {
+            // 修复首页操作失败bug start
+            let notIndexFail2 = ["Index/getDataStatistics"];
+            let ua = navigator.userAgent.toLowerCase();
+            if (notIndexFail2.includes(options.url) && ua.match(/MicroMessenger/i) == "micromessenger") {
+            } else {
+              return uni.showToast({
+                title: res.data.msg ? res.data.msg : "获取数据失败",
+                icon: "none",
+              });
+            }
+            // end
+
+            // return uni.showToast({
+            // 	title: res.data.msg ? res.data.msg : "获取数据失败",
+            // 	icon: "none"
+            // })
+          }
+          resolve(res);
+        }
+      },
+      fail: (err) => {
+        // 修复首页请求接口失败bug start
+        let notIndexFail = ["Index/getDataStatistics", "Com/getAuthorizationUrl"];
+        if (notIndexFail.includes(options.url)) {
+          window.location.href = "https://wx.ewoogi.com/wx/index.html#/pages/index/index";
+        } else {
+          uni.showModal({
+            showCancel: false,
+            content: "请求接口失败",
+          });
+        }
+        // end
+
+        reject(err);
+      },
+      // 完成之后关闭加载效果
+      complete: () => {
+        if (showLoading) {
+          ajaxTimes--;
+          if (ajaxTimes === 0) {
+            //  关闭正在等待的图标
+            uni.hideLoading();
+          }
+        }
+      },
+    });
+  });
 }
 
-
-	export default {
-	    BASE_URL,myRequest,websiteUrl
-	}
+export default {
+  BASE_URL,
+  myRequest,
+  websiteUrl,
+};