<script>
	export default {
		onLaunch: function() {
			if (process.uniEnv.name == 'bjst') {
				document.getElementsByTagName('body')[0].style.background =
					"linear-gradient(0deg, #187B47, #13A13F, #15A147, #12794C)"
			}
			// 禁止 ios 缩放屏幕
			document.addEventListener('gesturestart', function(event) {
				event.preventDefault();
			});

			// 禁止移动端（IOS）双击页面变大
			let touchTime = 0;
			document.addEventListener('touchstart', function(event) {
				if (event.touches.length > 1) {
					event.preventDefault();
				}
			});
			document.addEventListener(
				'touchend',
				function(event) {
					//记录当前点击的时间与下一次时间的间隔
					const nowTime = new Date();
					if (nowTime.getTime() - touchTime <= 300) {
						// event.preventDefault();
					}
					touchTime = nowTime.getTime();
				},
				false
			);
			let userAgentInfo = navigator.userAgent;
			let Agents = ['Android', 'iPhone', 'SymbianOS', 'Windows Phone', 'iPad', 'iPod'];
			let getArr = Agents.filter(i => userAgentInfo.includes(i));
			let isMobile = getArr.length ? true : false;
			// this.$store.state.isMobile = isMobile

			if (!(window && window.plus) && ((location.host.includes("127.0.0.1") || location.host.includes(
					"localhost")))) {

				if (!isMobile && window.frames.length == parent.frames.length) {
					//pc携带参数跳转
					let getRouter = window.location.href.split("#");
					if (getRouter.length > 1) {
						window.location.href = window.location.origin + "/pc.html#" + getRouter.pop(); //编码
						return;
					}
					window.location.href = window.location.origin + "/pc.html";
				}
			}
		},
		onShow: function() {},
		onHide: function() {}
	}
</script>

<style lang="scss">
	:root {
		// --theme--:#00ba29;
		// --borderTheme--:rgba(5, 156, 92, 0.2);
		--theme--: #f18403;
		--borderTheme--: #A3A3A3;
	}

	// body{
	// 	background: linear-gradient(0deg, #187B47, #13A13F, #15A147, #12794C);
	// }
	/*每个页面公共css */
	@import 'vant/lib/index.css';
	@import "uview-ui/index.scss";

	.u-form-item__body__right__message {
		display: none !important;
	}

	uni-toast .uni-toast {
		display: flex;
		align-items: center;
		padding: 20rpx 15rpx;
		width: auto;
		box-shadow: 0rpx 2rpx 12rpx 0rpx rgba(0, 0, 0, 0.1);
		border: 1px solid #D3D4D3;
		background: white !important;
		color: black !important;
		font-family: Arial;
		font-weight: 400;
		font-size: 30rpx;
		color: #606266;
	}

	uni-toast .uni-simple-toast__text {
		background: white !important;
		color: black !important;
	}

	.uni-toast .uni-toast__content {
		margin: 0;
		margin-left: 10rpx;
		white-space: nowrap;
	}

	uni-toast .uni-toast__icon {
		margin: 0;
	}
</style>