<script>
	
	export default {
		globalData: {
			siteUrl: '',
			BluetoothState: false, // 蓝牙适配器状态
			connectState: false // 蓝牙连接状态
		},
		onLaunch: function() {
			console.log('App Launch', this.globalData.siteUrl)
			if (process.env.NODE_ENV === 'development') {
				// 开发环境
				if (uni.getStorageSync('ipPort')) {
					this.globalData.siteUrl = uni.getStorageSync('ipPort') + '/'
				} else {
					// this.globalData.siteUrl = "http://58.34.63.88:9090/"
					// this.globalData.siteUrl = 'http://192.168.34.125:6023/'
					// this.globalData.siteUrl = 'http://223.82.100.80:9000/'
					// this.globalData.siteUrl = 'http://120.236.247.200:9000/'
					this.globalData.siteUrl = 'http://zhgd.loganwy.com/'
					// this.globalData.siteUrl = 'http://183.60.227.61:30249/'
					// this.globalData.siteUrl = 'http://124.71.178.44:9000/'
					// this.globalData.siteUrl = "http://183.95.84.34:7185/"
					// this.globalData.siteUrl = "http://36.137.53.203:9090/"
					// this.globalData.siteUrl = 'http://124.71.178.44:8/'
					// Vue.prototype.url_config = 'http://124.71.87.250/'
					// this.globalData.siteUrl = 'http://58.250.210.4:9090/'
				}

			} else {
				// 生产环境
				console.log('生产环境')
				if (uni.getStorageSync('ipPort')) {
					this.globalData.siteUrl = uni.getStorageSync('ipPort') + '/'
				} else {
					// this.globalData.siteUrl = "http://58.34.63.88:9090/"
					// this.globalData.siteUrl = 'http://124.71.178.44:9000/'
					// Vue.prototype.url_config = 'http://192.168.34.125:6023/'
					// Vue.prototype.url_config = 'http://120.236.247.200:9000/'
					// this.globalData.siteUrl = "http://183.95.84.34:7185/"
					// this.globalData.siteUrl = "https://183.95.84.34:6183/"
					// this.globalData.siteUrl = "http://36.137.53.203:9090/"
					// this.globalData.siteUrl = 'http://183.60.227.61:30249/'
					this.globalData.siteUrl = 'http://zhgd.loganwy.com/'
					// this.globalData.siteUrl = "http://36.137.53.203:9090/"
					// Vue.prototype.url_config = 'http://124.71.87.250/'
					// Vue.prototype.url_config = 'http://58.250.210.4:9090/'
				}
			}
			var systemInfo;
			var that = this
			uni.getSystemInfo({
				success(res) {
					systemInfo = res
					uni.setStorageSync('systemInfo', res)
					// if(res.platform.indexOf('android')!=-1&&  typeof plus!=="undefined"){
					// 	//获取最新版本
					// 	that.sendRequest({
					// 		url: "xmgl/appVersion/getAppVersion",
					// 		data: {},
					// 		method: "POST",
					// 		success(res2){
					// 			console.log('最新版本',res2)
					// 			//获取当前应用版本
					// 			// console.log('plus.runtime.version',plus.runtime.version)
					// 			if(res2.result&&(res2.result.versionNo!=plus.runtime.version)){
					// 				uni.showModal({
					// 					title:'版本更新',
					// 					content:'更新内容：'+res2.result.versionDescribe,
					// 					confirmText:'更新',
					// 					success(res) {
					// 						if (res.confirm) {
					// 							console.log('用户点击确定');
					// 							uni.downloadFile({
					// 							    url: res2.result.downloadUrl,
					// 							    success: (res) => {
					// 							        if (res.statusCode === 200) {
					// 							            console.log('下载成功');
					// 							        }
					// 							    }
					// 							});
					// 						} else if (res.cancel) {
					// 							console.log('用户点击取消');
					// 						}
					// 					}
					// 				})
					// 			}
					// 		}
					// 	})
					// }
				}
			})

		},


		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>

<style lang="scss">
	/*每个页面公共css */
	html {
		// background-color: $uni-color-primary;
		// background-color: #f3f5fd;
		color: $uni-text-color;
	}

	.bgLightBlue {
		background-color: #f3f5fd;
	}

	uni-page-body,
	page {
		height: 100%;
		// background-color: #f3f5fd;
	}

	.fullHeight {
		height: 100%;
	}

	.bgWhite {
		background-color: white;
	}

	.btn {
		border-radius: 3px;
	}

	.btn[type=primary] {
		background-color: $uni-color-primary;
	}

	.primaryText {
		color: $uni-color-primary;
	}

	.primaryText2 {
		color: $--color-primary2;
	}

	.primaryText3 {
		color: $--color-primary3;
	}

	.primaryText4 {
		color: $--color-primary4;
	}

	.primaryText5 {
		color: $--color-primary5;
	}

	.redText {
		color: $--color-primary6;
	}

	.fixedHeaderBox {
		position: fixed;
		top: 0;
		left: 0;
		width: 100%;
		background-color: white;
		z-index: 2;
	}

	.whiteHeaderBox {
		.headerBox {
			color: white;
			background-color: #2b8df3;

			.backImg {
				color: white !important;
				opacity: 1;
			}
		}
	}
	.headerBox {
		height: 44px;
		align-items: center;
		background-color: white;
		color: rgba(42, 43, 91, 1);
		justify-content: center;
		position: relative;
		z-index: 2;
		border-bottom: 1px solid rgba(194, 194, 194, 0.2);
		font-size: 16px;

		.backImg {
			width: 24px;
			height: 24px;
			position: absolute;
			top: 9px;
			left: 10px;
			// opacity: 0.8;
			z-index: 999;
		}

		.headerName {
			text-align: center;
			// font-size: 18px;
			line-height: 44px;
			z-index: 3;
			position: relative;
			width: calc(100% - 80px);
			overflow: hidden;
			text-overflow: ellipsis;
			white-space: nowrap;
			text-align: center;
			padding-left: 44px;
			// font-weight: bold;
		}
	}

	.pageContent {
		height: calc(100% - 48px);
	}

	.fixedHeaderPageContent {
		padding-top: 48px;
	}

	.scroll-view_H {
		white-space: nowrap;
		padding: 0 20px 0 0;
		width: calc(100% - 20px);
		background-color: #FFFFFF;

		.scroll-view-item_H {
			display: inline-block;
			padding: 5px 10px;
			font-size: 14px;
			width: 80px;
			text-align: center;
			overflow: hidden;
			white-space: nowrap;
			text-overflow: ellipsis;

			.name {
				display: inline;
				padding: 2px 0;
			}

			&.active {
				.name {
					font-weight: bold;
					border-bottom: 4px solid $uni-color-primary;
				}
			}
		}
	}

	.blockBox {
		background-color: white;
		padding: 10px;
		margin: 10px 0;

		.blockTitle {
			position: relative;
			margin-bottom: 10px;

			.titleName {
				color: $uni-text-color;
				font-size: 17px;
				padding-left: 10px;
				// border-left: 2px solid $uni-color-primary;
				font-weight: bold;
				position: relative;

				&::before {
					content: "";
					position: absolute;
					left: 0;
					top: 10%;
					width: 3px;
					height: 80%;
					background-color: $uni-color-primary;
				}
			}
		}
	}

	.dataBox {
		display: flex;
		align-items: center;

		.dataItem {
			flex: 1;
			text-align: center;

			.num {
				font-size: 24px;
			}

			.text {
				font-size: 12px;
				color: $uni-text-color;
				opacity: 0.8;
			}
		}
	}

	.placeholderBox {
		margin: 100px auto;
		text-align: center;

		.noDataImg {
			width: 82px;
			height: 65px;
		}

		.text {
			color: $uni-text-color;
			opacity: 0.7;
			font-size: 13px;
			margin-top: 6px;
		}
	}

	.modalBox {
		position: fixed;
		background-color: rgba(0, 0, 0, 0.5);
		width: 100%;
		height: 100%;
		top: 0;
		left: 0;
		color: $uni-text-color;

		.modalContent {
			background-color: white;
			position: fixed;
			width: calc(90% - 30px);
			left: 5%;
			top: 50%;
			padding: 15px;
			transform: translateY(-50%);

			.modalTitle {
				font-size: 16px;
				text-align: center;
				border-bottom: 1px solid #ddd;
				padding-bottom: 10px;
				margin-bottom: 25px;
				position: relative;

				.closeImg {
					position: absolute;
					right: 0;
					top: -5px;
					opacity: 0.6;
				}
			}
		}
	}

	.formBox {
		margin: 20px 15px;

		.uni-form-item {
			display: flex;
			align-items: center;
			color: $uni-text-color2;
			margin-bottom: 15px;
		}

		.uni-form-label {
			width: 120px;
		}

		.uni-form-input {
			width: calc(100% - 120px);
			position: relative;

			.uni-input {
				height: 35px;
				border-radius: 35px;
				border: 1px solid rgba(42, 43, 91, 0.3);
				line-height: 35px;
				padding: 0 15px;
				overflow: hidden;

				&.disabled {
					background-color: rgba(216, 216, 216, 0.2);
				}
			}

			.floatBtn {
				position: absolute;
				right: 0;
				top: 0;
				height: 100%;
				line-height: 35px;
				padding: 0 15px;
				border-top-right-radius: 35px;
				border-bottom-right-radius: 35px;
				font-size: 15px;
				color: white;
				background-color: $uni-color-primary;
			}
		}

	}

	.formBox2 {
		margin: 30px 20px 10px;

		.uni-form-item {
			color: $uni-text-color2;
			margin-bottom: 15px;
		}

		.uni-form-label {
			font-size: 12px;
		}

		.uni-form-input {
			width: 100%;
			position: relative;
			font-size: 16px;

			.uni-input {
				height: 35px;
				border-bottom: 1px solid rgba(217, 217, 217, 1);
				line-height: 35px;
				padding: 0 15px;
				overflow: hidden;

				&:disabled {
					background-color: rgba(216, 216, 216, 0.3);
				}
			}
		}

	}

	.cl {
		color: rgba(42, 43, 91, 0.3);
	}

	.uni-select {
		display: flex;
		align-items: center;
		justify-content: space-between;

		.icon-down {
			width: 13px;
			height: 13px;
			opacity: 0.5;
		}
	}

	.star {
		color: $uni-color-error;
		margin-right: 5px;
		font-size: 16px;
		vertical-align: middle;
	}

	.submitBtn {
		border-radius: 40px;
		margin-top: 30px;
		height: 40px;
		line-height: 40px;
		border: 1px solid rgba(43, 141, 243, 1);

		&.big {
			height: 50px;
			line-height: 50px;
			box-shadow: 0px 4px 8px 0px rgba(43, 141, 243, 0.42);
			font-size: 20px;
		}
	}

	.deleteBtn {
		border-radius: 40px;
		height: 40px;
		line-height: 40px;
		border: 1px solid #e64340;
		color: #e64340;
		background-color: white;
		margin-top: 15px;
	}
</style>
