<script>
import useStorage from '@/utils/useStroage.js';
export default {
	onLaunch: function () {
		useStorage.set('menuInfo', uni.getMenuButtonBoundingClientRect());
	},
	onShow: function () {
		const updateManager = uni.getUpdateManager();

		updateManager.onCheckForUpdate(function (res) {
			// 请求完新版本信息的回调
			// console.log(res.hasUpdate);
		});

		updateManager.onUpdateReady(function (res) {
			uni.showModal({
				title: '更新提示',
				content: '新版本已经准备好，是否重启应用？',
				success(res) {
					if (res.confirm) {
						// 新的版本已经下载好，调用 applyUpdate 应用新版本并重启
						updateManager.applyUpdate();
					}
				}
			});
		});

		updateManager.onUpdateFailed(function (res) {
			// 新的版本下载失败
		});
	},
	onHide: function () {}
};
</script>

<style lang="scss">
/*每个页面公共css */
@import '@/uni_modules/uview-ui/index.scss';
page,
view,
scroll-view,
swiper,
swiper-item,
match-media,
movable-area,
movable-view,
cover-view,
cover-image,
icon,
text,
rich-text,
progress,
button,
checkbox-group,
editor,
form,
input,
label,
picker,
picker-view,
radio-group,
slider,
switch,
textarea,
navigator,
audio,
camera,
image,
video,
live-player,
live-pusher,
map,
canvas,
web-view {
	box-sizing: border-box;
}

input {
	height: auto;
}

image {
	display: block;
}
page {
	background-color: #f2f2f2;
}
text {
	font-size: 28upx;
	color: #333;
}
@font-face {
	font-family: 'BebasNeue-Regular';
	src: url('./static/font/BebasNeue-Regular.woff');
}
.num {
	font-family: 'BebasNeue-Regular';
}
</style>
