<script>
	export default {
		onLaunch: function () {
			uni.onTabBarMidButtonTap(() => {
				uni.navigateTo({
					url: '/pages/index/dialog',
					animationType: 'slide-in-bottom'
				});
			});
			
			// console.log('预加载');
		},
		onShow: function () {
			// 获取浏览器版本信息
			function getBrowserInfo() {
			  const userAgent = navigator.userAgent;
			  let browserName = '未知浏览器';
			  let version = '未知版本';
			
			  // 检测 Chrome
			  if (userAgent.indexOf('Chrome') > -1 && userAgent.indexOf('Edg') === -1) {
			    browserName = 'Chrome';
			    version = userAgent.match(/Chrome\/(\d+\.\d+)/)[1];
			  }
			  // 检测 Edge (Chromium内核)
			  else if (userAgent.indexOf('Edg') > -1) {
			    browserName = 'Edge';
			    version = userAgent.match(/Edg\/(\d+\.\d+)/)[1];
			  }
			  // 检测 Firefox
			  else if (userAgent.indexOf('Firefox') > -1) {
			    browserName = 'Firefox';
			    version = userAgent.match(/Firefox\/(\d+\.\d+)/)[1];
			  }
			  // 检测 Safari
			  else if (userAgent.indexOf('Safari') > -1 && userAgent.indexOf('Chrome') === -1) {
			    browserName = 'Safari';
			    version = userAgent.match(/Version\/(\d+\.\d+)/)[1];
			  }
			
			  return {
			    browser: browserName,
			    version: version,
			    userAgent: userAgent
			  };
			}
			
			// 使用示例
			// const browserInfo = getBrowserInfo();
			// console.log(`浏览器: ${browserInfo.browser}`);
			// console.log(`版本号: ${browserInfo.version}`);
			// console.log(`完整用户代理: ${browserInfo.userAgent}`);
			// console.log('App Show')
		},
		onHide: function () {
			// console.log('App Hide')
		}
	};
</script>

<style lang="scss">
	/* 注意要写在第一行，同时给style标签加入lang="scss"属性 */
	// @import "@/uni_modules/uview-ui/index.scss";

	@font-face {
		font-family: 'PingFangSC';
		src: url('@/static/font/PingFang-SC.ttf') format('truetype');
		font-weight: normal;
		font-style: normal;
	}
	view {
		box-sizing: border-box;
		font-family: 'PingFangSC';
	}

	// 解决uview离线环境下没有图标
	@font-face {
		font-family: 'uicon-iconfont';
		src: url('@/static/font/font_2225171_8kdcwk4po24.ttf') format('truetype');
		font-weight: normal;
		font-style: normal;
	}

	.max_page {
		min-height: 100vh;
	}
	.mr-10 {
		margin-right: 10rpx;
	}
	.mb-8 {
		margin-bottom: 8rpx;
	}
	.pt-8 {
		padding-top: 8rpx;
	}
	.mb-10 {
		margin-bottom: 10rpx;
	}
	.mb-18 {
		margin-bottom: 18rpx;
	}
	.mb-64 {
		margin-bottom: 64rpx;
	}
	.mb-30 {
		margin-bottom: 30rpx;
	}
	.mb-36 {
		margin-bottom: 36rpx;
	}
	.mb-4 {
		margin-bottom: 4rpx;
	}
	.fz-30 {
		font-size: 30rpx;
	}
	.fz-28 {
		font-size: 28rpx;
	}
	.fz-24 {
		font-size: 24rpx;
	}
	.w_100 {
		width: 100%;
	}

	.h_100 {
		height: 100%;
	}

	.flex {
		display: flex;
	}
	.flex-jcsb {
		display: flex;
		justify-content: space-between;
	}
	.flex-c-c {
		display: flex;
		justify-content: center;
		align-items: center;
	}
	.tar {
		text-align: right;
	}
	.fw-600 {
		font-weight: 600;
	}
	.fw-400 {
		font-weight: 400;
	}
	.img_100 {
		width: 100%;
		height: 100%;
	}

	.fl1 {
		flex: 1;
	}

	.font_pf {
		font-family: 'PingFangSC';
	}

	.ellipsis-text {
		white-space: nowrap;
		/* 强制不换行 */
		overflow: hidden;
		/* 超出部分隐藏 */
		text-overflow: ellipsis;
		/* 超出部分显示省略号 */
	}

	/* 多行文本溢出 */
	.multi-line-ellipsis {
		display: -webkit-box;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 3;
		/* 显示的行数 */
		overflow: hidden;
	}

	.no-overflow {
		overflow: hidden;
	}
	.bold {
		font-weight: bold;
	}
</style>
