<script>
	export default {
		globalData: {
			currentHouseVerify: false,		// 当前小区是否认证
			registerInfo: {
				propertyName: '',
				propertyCode: '',
				platformName: '',
				platformCode: '',
				buildingId: '',
				buildingName: '',
				unitId: '',
				unitName: '',
				roomId: '',
				roomName: '',
				buildingStatus: '',
				buildingType: '',
				isDefault: 0,
				relationShip: '',
				residentName: '',
				residentPhone: '',
				sex: '',
				certificateType: '',
				certificateNo: ''
			},
			maintenanceInfo: {
				repairAddress: '',
				repairArticle: '',
				repairTitle: '',
				ownerPhone: '',
				reservationTime: '',
				repairDesc: '',
				repairPhoto: ''
			},
			complaintInfo: {
				complaintImg: "",
				complaintTheme: "",
				problemDesc: "",
				userId: "",
				userName: "",
				userPhone: ""
			}
		},
		onLaunch: function() {
			//小程序自动更新
			if (uni.canIUse('getUpdateManager')) {
				const updateManager = uni.getUpdateManager();
				updateManager.onCheckForUpdate(res => {
					// 请求完新版本信息的回调
					if (res.hasUpdate) {
						updateManager.onUpdateReady(() => {
							uni.showModal({
								title: '更新提示',
								content: '新版本已经准备好，是否重启应用？',
								success: res => {
									if (res.confirm) {
										// 新的版本已经下载好，调用 applyUpdate 应用新版本并重启
										updateManager.applyUpdate();
									}
								}
							});
						});
						updateManager.onUpdateFailed(() => {
							// 新的版本下载失败
							uni.showModal({
								title: '已经有新版本了哟~',
								content: '新版本已经上线啦~，请您删除当前小程序，重新搜索打开哟~'
							});
						});
					}
				});
			}
			// let _this = this;
			// wx.getSystemInfo({
			// 	success: function(res) {
			// 		let platform = res.platform 
			// 		_this.globalData.isMobieDevice = platform == "ios" || platform == "android" || platform == "devtools"
			// 	}
			// })
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>

<style lang="scss">
	/*每个页面公共css */
	@import '@/uni_modules/uni-scss/index.scss';
	/* #ifndef APP-NVUE */
	@import '@/static/customicons.css';
	// 设置整个项目的背景色
	page {
		background-color: #ffffff;
	}

	/* #endif */
</style>
