Ming 4 年之前
父節點
當前提交
8608292f8a
共有 1 個文件被更改,包括 17 次插入90 次删除
  1. 17 90
      pages/index/index.vue

+ 17 - 90
pages/index/index.vue

@@ -1,6 +1,5 @@
 <template>
 	<view style="background:#f1f1f1;" class="padding-sm">
-
 		<!-- 下拉选择 -->
 		<view class="searchSelect shadow" v-if="flag">
 			<view class="cu-bar search bg-white">
@@ -60,7 +59,6 @@
 		</view>
 		<!-- 图表 end-->
 
-
 		<!-- 宫格列表 -->
 		<view class="section2 section  bg-white margin-top-sm margin-bottom-sm">
 			<view class="cu-list grid col-3 no-border">
@@ -105,18 +103,13 @@
 				alarmCount: json.staticData.data[0].alarmCount,
 				cuIconList: json.cuIconList,
 				Inv: 0,
-
 				defaultSite: 0,
-
-
 				flag: false,
 				searchList: [],
 				searchList2: [],
-
 				searchInput: '',
 				selectedCode: 10012,
 				getData: [],
-
 				codeResult: '',
 
 			};
@@ -128,34 +121,29 @@
 				alert("你点击了扫一扫");
 				this.scanQRCode();
 			} else {
-				alert("你点击了获取位置");
-				this.getLocation()
-
-
-				// this.showTag()
+				// alert("你点击了获取位置");
+				// this.getLocation()
+				this.showTag()
 			}
 		},
 
 		onLoad(option) {
 
 			if (option.op) {
-
 				// alert('op')
-
 				// 首页数据渲染
-				this.getSearchList();
-				this.getHomeData({
-					'company_code': uni.getStorageSync('selectedCode') ? uni.getStorageSync('selectedCode') : this
-						.defaultSite
-				});
-				this.getHandleData({
-					'company_code': uni.getStorageSync('selectedCode') ? uni.getStorageSync('selectedCode') : this
-						.defaultSite
-				});
+				// this.getSearchList();
+				// this.getHomeData({
+				// 	'company_code': uni.getStorageSync('selectedCode') ? uni.getStorageSync('selectedCode') : this
+				// 		.defaultSite
+				// });
+				// this.getHandleData({
+				// 	'company_code': uni.getStorageSync('selectedCode') ? uni.getStorageSync('selectedCode') : this
+				// 		.defaultSite
+				// });
 
 			} else {
 				// this.init()
-
 			}
 
 			// 首页数据渲染
@@ -168,14 +156,7 @@
 				'company_code': uni.getStorageSync('selectedCode') ? uni.getStorageSync('selectedCode') : this
 					.defaultSite
 			});
-
-
-
-
-
-
-
-
+			
 			var res = uni.getStorageSync('selectedCode');
 			var res2 = uni.getStorageSync('selectedName');
 			if (res) {
@@ -183,48 +164,32 @@
 					title: res2
 				});
 			}
-
-
-
-
+			
+			
+			
+			
 			// 图表切换渲染
 			this.hackReset = false;
 			this.$nextTick(() => {
 				this.hackReset = true;
 			})
-
-
-
 		},
 		methods: {
-
 			async init() {
 				window.location.href = this.$BASE_URL + "Com/getPageAuthorization1"
 			},
-
-
-
-
-
-
 			//扫码
 			scanQRCode() {
-				alert(1);
-				
-				
 				// 将this赋值给that
 				let that = this;
-				
 				// 微信公众号获取位置
 				jwx.configWeiXin(jweixin => {
 					jweixin.scanQRCode({
 						needResult: 1, // 默认为0,扫描结果由微信处理,1则直接返回扫描结果,
 						scanType: ["qrCode", "barCode"], // 可以指定扫二维码还是一维码,默认二者都有
 						success: function(res) {
-							
 							setTimeout(function() {
 								/* 放1000ms后执行的代码 */
-								alert(2)
 								alert(res.resultStr)
 								that.getCodeResult({
 									"ercode": res.resultStr
@@ -237,19 +202,16 @@
 			
 			// 扫码成功后请求
 			async getCodeResult(param = {}) {
-				alert(3)
 				const res = await this.$myRequest({
 					url: 'ScanPush/scan_push',
 					data: param
 				})
-				
 				if (res.data.flag) {
 					uni.showToast({
 						title: '扫码成功',
 						icon: "none"
 					})
 				}
-			
 			},
 
 			//获取地理位置
@@ -258,9 +220,7 @@
 				// 将this赋值给that
 				let that = this;
 				// 微信公众号获取位置
-
 				jwx.configWeiXin(jweixin => {
-
 					alert(22)
 					jweixin.getLocation({
 						type: 'gcj02', // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02'
@@ -269,13 +229,8 @@
 						}
 					});
 				});
-
-
-
 			},
 
-
-
 			// 九宫格页面跳转
 			navItemClick(index) {
 				let url = "";
@@ -313,7 +268,6 @@
 					case 10:
 						url = "/pages/accountManage/accountManage"
 						break;
-
 					default:
 						break;
 				}
@@ -337,19 +291,12 @@
 				uni.navigateTo({
 					url: '/pages/deviceOffLine/deviceOffLine?status_type=1',
 				});
-
 			},
 			goNormalList() {
 				uni.navigateTo({
 					url: '/pages/deviceOffLine/deviceOffLine?status_type=2',
 				});
-
 			},
-
-
-
-			
-
 			//站点下拉请求
 			async getSearchList(param = {}) {
 				const res = await this.$myRequest({
@@ -357,9 +304,7 @@
 					data: param
 				})
 				this.getData = res.data.data
-
 				this.defaultSite = this.getData[0].owner_code;
-
 				if (!uni.getStorageSync('selectedCode')) {
 					uni.setStorageSync('selectedCode', this.getData[0].owner_code);
 					uni.setStorageSync('selectedName', this.getData[0].owner_name);
@@ -368,18 +313,10 @@
 					this.searchList.push(item)
 					this.searchList2.push(item);
 				});
-				// console.log('this.searchList')
-				// console.log(this.searchList)
-
-
 			},
-
-
 			showTag() {
 				this.flag = !this.flag;
 			},
-
-
 			// 下拉选择
 			clickSelectItem(item, index) {
 				this.selectedCode = item.owner_code;
@@ -401,20 +338,15 @@
 				var newlist = this.searchList2.filter(item => item.owner_name.indexOf(this.searchInput) > -1);
 				this.searchList = newlist
 			},
-
-
 			InputFocus(e) {
 				this.InputBottom = e.detail.height
 			},
 			InputBlur(e) {
 				this.InputBottom = 0
 			},
-
 			changeTab(Inv) {
 				that.navIdx = Inv;
-
 			},
-
 			//echarts图表请求
 			async getHomeData(param = {}) {
 				const res = await this.$myRequest({
@@ -424,7 +356,6 @@
 				// console.log('首页请求staticData')
 				// console.log(res.data.data[0])
 				this.staticData = res.data.data[0]
-
 			},
 			// 未处理告警请求
 			async getHandleData(param = {}) {
@@ -433,13 +364,9 @@
 					showLoading: true,
 					data: param
 				})
-
 				this.cuIconList[0].badge = res.data.data[0].comprehensive_alarm_count;
 				this.cuIconList[2].badge = res.data.data[0].fire_brigade_inspector_count
 			},
-
-
-
 		}
 	}
 </script>