Ming 4 年之前
父節點
當前提交
ce9c1bbaab

+ 18 - 0
common/common.scss

@@ -1,5 +1,23 @@
 /* common */
 
+	* {
+			-webkit-touch-callout: none;
+			-webkit-user-select: none;
+			-khtml-user-select: none;
+			-moz-user-select: none;
+			-ms-user-select: none;
+			user-select: none;
+		}
+		
+	body .uni-input-input,body .uni-textarea-textarea{
+				-webkit-touch-callout: initial!important;
+				-webkit-user-select: initial!important;
+				-khtml-user-select: initial!important;
+				-moz-user-select: initial!important;
+				-ms-user-select: initial!important;
+				user-select: initial!important;
+			}
+
 body {
 	font-size: 32rpx;
 }

+ 2 - 2
manifest.json

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

+ 10 - 10
pages/deviceManage/deviceAdd/deviceAdd.vue

@@ -21,16 +21,16 @@
 				<view class="title"><text class="necessary">*</text>所属楼层:</view>
 				<select name="" id="" v-model="louyu">
 					<option value="">请选择</option>
-					<option value="-10">楼层B10</option>
-					<option value="-9">楼层B9</option>
-					<option value="-8">楼层B8</option>
-					<option value="-7">楼层B7</option>
-					<option value="-6">楼层B6</option>
-					<option value="-5">楼层B5</option>
-					<option value="-4">楼层B4</option>
-					<option value="-3">楼层B3</option>
-					<option value="-2">楼层B2</option>
-					<option value="-1">楼层B1</option>
+					<option value="B10">楼层B10</option>
+					<option value="B9">楼层B9</option>
+					<option value="B8">楼层B8</option>
+					<option value="B7">楼层B7</option>
+					<option value="B6">楼层B6</option>
+					<option value="B5">楼层B5</option>
+					<option value="B4">楼层B4</option>
+					<option value="B3">楼层B3</option>
+					<option value="B2">楼层B2</option>
+					<option value="B1">楼层B1</option>
 					<!-- <option :value=item v-for="item in 60" >楼层{{item}}</option> -->
 					<option :value=item v-for="item in 60" >楼层{{item}}</option>
 				</select>

+ 60 - 58
pages/deviceManage/deviceManage.vue

@@ -51,8 +51,8 @@
 						<view class="cu-item" :class="modalName=='move-box-'+ index?'move-cur':''"
 							v-for="(item,index) in newDeviceManage" :key="index" :data-target="'move-box-' + index">
 							<view class="cu-form-group margin-top">
-								<checkbox :value="String(item.id)" :checked="checkedArr.includes(String(item.id))"
-									:class="{'checked':checkedArr.includes(String(item.id))}"></checkbox>
+								<checkbox :value="String(item.owner_code)" :checked="checkedArr.includes(String(item.owner_code))"
+									:class="{'checked':checkedArr.includes(String(item.owner_code))}"></checkbox>
 							</view>
 							<view class="cu-avatar round lg">
 								<image class="image-bg" src="/static/device-icon.png" />
@@ -102,9 +102,15 @@
 			</view>
 			<view class="share-item  text-center">
 				<view><text class="icon iconfont margin-xs" style="color:#FF642E">&#xe66e;</text></view>
-				<view @tap="showModal" data-target="DialogModal">
+				<!-- <view @tap="showModal" data-target="DialogModal">
+					导出
+				</view> -->
+				
+				<view @tap="exportButton()" data-target="DialogModal">
 					导出
 				</view>
+				
+				
 			</view>
 			<view class="checkAll" style="display:inline-block">
 				<checkbox-group @change="allChoose" v-if="deviceManage.length">
@@ -183,6 +189,8 @@
 			return {
 				dwtype: 0,
 				transmission_mode: 0,
+				dwtype1: 0,
+				transmission_mode1: 0,
 
 				deviceManage: [],
 				deviceManageRes: 0,
@@ -236,10 +244,52 @@
 			this.getDataList({
 				'company_code': uni.getStorageSync('selectedCode')
 			})
-		
-			// document.querySelector('.uni-page-head-bd .uni-page-head__title').style.userSelect='none';
-		},
+				},
 		methods: {
+			
+			exportButton() {
+				if (this.checkedArr.length == 0) {
+					uni.showModal({
+						showCancel: false,
+						content: '请选择至少一条需要导出的数据'
+					});
+					return;
+				} 
+				let aa;
+				let bb;
+				if(this.allChecked==true){
+					alert('全选');
+					aa='status';
+					 bb=1
+				}else{
+					alert('非全选')
+					 aa='device_code_list';
+					 bb=this.checkedArr.join(",")
+					 alert(bb)
+				}
+
+					let exportUrl = this.$BASE_URL+
+						`ExportModule/getDeviceConfigListExpor/transmission_mode/${this.transmission_mode1}/${aa}/${bb}/dwtype/${this.dwtype1}/company_code/${uni.getStorageSync('selectedCode')}/`
+					alert(exportUrl)
+					
+				var ua = window.navigator.userAgent.toLowerCase();
+				if (ua.match(/MicroMessenger/i) == 'micromessenger') {
+					uni.showModal({
+						showCancel: false,
+						content: '如需下载,请在默认浏览器中操作',
+						success: function(res) {
+							window.location.href = exportUrl;
+						}
+					});
+				} else {
+					window.location.href = exportUrl;
+				}
+			
+			},
+			
+			
+			
+			
 
 			//筛选请求
 			searchList() {
@@ -248,6 +298,8 @@
 					"dwtype": this.dwtype,
 					'company_code': uni.getStorageSync('selectedCode')
 				})
+				this.transmission_mode1=this.transmission_mode;
+				this.dwtype1=this.dwtype;
 			},
 
 			// 列表数据请求
@@ -295,22 +347,6 @@
 			//导出弹框
 			showModal(e) {
 				var ua = window.navigator.userAgent.toLowerCase();
-				// if(ua.match(/MicroMessenger/i) == 'micromessenger'){
-				// 	uni.showModal({
-				// 		showCancel: false,
-				// 		content: '点击右上角 ┇,选择默认浏览器进行导出操作'
-				// 	});
-				// }else{
-				// 	if (this.checkedArr.length == 0) {
-				// 		uni.showModal({
-				// 			showCancel: false,
-				// 			content: '请选择至少一条需要导出的数据'
-				// 		});
-				// 	} else {
-				// 		this.modalName = e.currentTarget.dataset.target;
-				// 	}
-				// }
-
 				if (this.checkedArr.length == 0) {
 					uni.showModal({
 						showCancel: false,
@@ -417,7 +453,9 @@
 
 			// 多选复选框改变事件
 			changeCheckbox(e) {
+				console.log(e.detail.value)
 				this.checkedArr = e.detail.value;
+				
 				// 如果选择的数组中有值,并且长度等于列表的长度,就是全选
 				if (this.checkedArr.length > 0 && this.checkedArr.length == this.newDeviceManage.length) {
 					this.allChecked = true;
@@ -450,42 +488,6 @@
 </script>
 
 <style>
-	
-
-	page {
-		-moz-user-select: none;
-		/*火狐*/
-		-webkit-user-select: none;
-		/*webkit浏览器*/
-		-ms-user-select: none;
-		/*IE10*/
-		-khtml-user-select: none;
-		/*早期浏览器*/
-		user-select: none;
-	}
-
-	/* user-select有2个值(none表示不能选中文本,text表示可以选择文本) */
-
-
-	* {
-		-webkit-touch-callout: none;
-		-webkit-user-select: none;
-		-khtml-user-select: none;
-		-moz-user-select: none;
-		-ms-user-select: none;
-		user-select: none;
-	}
-
-	input {
-		-webkit-touch-callout: initial !important;
-		-webkit-user-select: initial !important;
-		-khtml-user-select: initial !important;
-		-moz-user-select: initial !important;
-		-ms-user-select: initial !important;
-		user-select: initial !important;
-	}
-
-
 
 	.showDetailEdit {
 		position: absolute;

+ 1 - 0
pages/deviceOffLine/deviceOffLine.vue

@@ -154,6 +154,7 @@
 
 				//#ifdef H5
 				let exportUrl= this.$BASE_URL+`ExportModule/getStatusDetailsListExpor/status_type/${this.status_type}/company_code/${uni.getStorageSync('selectedCode')}/ transfer_type/${this. transfer_type1}/dwtype/${this.dwtype1}/`
+				
 				var ua = window.navigator.userAgent.toLowerCase();
 
 				if(ua.match(/MicroMessenger/i) == 'micromessenger'){

+ 58 - 36
pages/index/index.vue

@@ -115,7 +115,9 @@
 
 				searchInput: '',
 				selectedCode: 10012,
-				getData: []
+				getData: [],
+
+				codeResult: '',
 
 			};
 		},
@@ -126,20 +128,20 @@
 				alert("你点击了扫一扫");
 				this.scanQRCode();
 			} else {
-				// alert("你点击了获取位置");
-				// this.getLocation()
+				alert("你点击了获取位置");
+				this.getLocation()
 
 
-				this.showTag()
+				// this.showTag()
 			}
 		},
 
 		onLoad(option) {
-			
+
 			if (option.op) {
-			
+
 				// alert('op')
-				
+
 				// 首页数据渲染
 				this.getSearchList();
 				this.getHomeData({
@@ -150,31 +152,22 @@
 					'company_code': uni.getStorageSync('selectedCode') ? uni.getStorageSync('selectedCode') : this
 						.defaultSite
 				});
-			
-			
-			
-			
-			} else {
-				// alert(2)
-				this.init()
-			
-			}
-			
-			
-			// let ua = navigator.userAgent.toLowerCase();
-			// if (ua.match(/MicroMessenger/i) == "micromessenger") {
-				
-
-
-
-
-			// }
-
-
-
 
+			} else {
+				// this.init()
 
+			}
 
+			// 首页数据渲染
+			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
+			});
 
 
 
@@ -191,7 +184,7 @@
 				});
 			}
 
-			
+
 
 
 			// 图表切换渲染
@@ -216,23 +209,48 @@
 
 			//扫码
 			scanQRCode() {
-				alert(1)
+				alert(1);
+				
+				
 				// 将this赋值给that
 				let that = this;
+				
 				// 微信公众号获取位置
 				jwx.configWeiXin(jweixin => {
-
 					jweixin.scanQRCode({
 						needResult: 1, // 默认为0,扫描结果由微信处理,1则直接返回扫描结果,
 						scanType: ["qrCode", "barCode"], // 可以指定扫二维码还是一维码,默认二者都有
 						success: function(res) {
-							var result = res.resultStr; // 当needResult 为 1 时,扫码返回的结果
-							alert(result);
+							
+							setTimeout(function() {
+								/* 放1000ms后执行的代码 */
+								alert(2)
+								alert(res.resultStr)
+								that.getCodeResult({
+									"ercode": res.resultStr
+								})
+							}, 1000)
 						}
 					});
-
 				});
 			},
+			
+			// 扫码成功后请求
+			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"
+					})
+				}
+			
+			},
 
 			//获取地理位置
 			getLocation() {
@@ -244,7 +262,7 @@
 				jwx.configWeiXin(jweixin => {
 
 					alert(22)
-					wx.getLocation({
+					jweixin.getLocation({
 						type: 'gcj02', // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02'
 						success: function(res) {
 							alert(res.longitude)
@@ -329,6 +347,9 @@
 			},
 
 
+
+			
+
 			//站点下拉请求
 			async getSearchList(param = {}) {
 				const res = await this.$myRequest({
@@ -353,6 +374,7 @@
 
 			},
 
+
 			showTag() {
 				this.flag = !this.flag;
 			},

+ 3 - 6
pages/login/login.vue

@@ -46,14 +46,10 @@
 				
 			}else{
 				// alert(2)
-				this.init()
+				// this.init()
 				
 			}
-			
-			
-			
-
-			// this.init()
+		
 
 			uni.setNavigationBarColor({
 				frontColor: "#ffffff", //文字颜色
@@ -221,6 +217,7 @@
 </script>
 
 <style>
+
 	.section {
 		height: 400rpx;
 		background-image: url(/static/login-bg.png);

+ 11 - 6
pages/test/test.vue

@@ -20,14 +20,14 @@
 		onLoad() {
 
 			// #ifdef H5
-			let url = location.href.split('#')[0]
+			let redirect_uri = location.href.split('#')[0]
 			uni.request({
-				url: "https://s.yxin.tech/sign.php",
+				url: "https://qhome.usky.cn/USKYZHAF/sign.php",
 				header: {
 					'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
 				},
 				data: {
-					"url": url
+					"url": redirect_uri
 				},
 				method: 'GET',
 				success: (res) => {
@@ -37,7 +37,7 @@
 						'scanQRCode'
 					];
 					let info = {
-						debug: false, // 调试,发布的时候改为false
+						debug: true, // 调试,发布的时候改为false
 						appId: res.data.appid,
 						nonceStr: res.data.nonceStr,
 						timestamp: parseInt(res.data.timestamp),
@@ -103,7 +103,7 @@
 			},
 
 			scancode: function() {
-				// alert(1);
+				alert(1);
 				this.$wx.scanQRCode({
 
 					needResult: 1, // 默认为0,扫描结果由微信处理,1则直接返回扫描结果,
@@ -111,7 +111,12 @@
 					scanType: ["qrCode", "barCode"], // 可以指定扫二维码还是一维码,默认二者都有
 
 					success: function(res) {
-						alert(2);
+						
+						setTimeout(function(){
+						     /* 放200ms后执行的代码 */
+						     alert(2)
+						    },1000)
+						
 						var result = res.resultStr; // 当needResult 为 1 时,扫码返回的结果
 
 					}

+ 4 - 3
util/jssdk.js

@@ -10,7 +10,8 @@ export function configWeiXin(callback) {
 	// start
 	uni.request({
 		// url: "/web/sign.php",
-		url:"https://s.yxin.tech/sign.php",	
+		// url:"https://s.yxin.tech/sign.php",	
+		url:"https://qhome.usky.cn/USKYZHAF/sign.php",
 		header: {
 			'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
 		},
@@ -28,7 +29,7 @@ export function configWeiXin(callback) {
 				'scanQRCode'
 			];
 			let info = {
-				debug: false, // 调试,发布的时候改为false
+				debug: true, // 调试,发布的时候改为false
 				appId: res.data.appid,
 				nonceStr: res.data.nonceStr,
 				timestamp: parseInt(res.data.timestamp),
@@ -38,7 +39,7 @@ export function configWeiXin(callback) {
 
 			jweixin.config(info);
 			jweixin.error(err => {
-				console.log('config fail:', err);
+				alert('config fail:', err);
 				return
 			});