<script>
	const NET = require('@/utils/request')
	const API = require('@/config/api')
	export default {
		onLaunch: function() {
			console.log('App Launch1')
			// uni.setStorage({
			// 	key: 'token',
			// 	data: '5a4b36295826f056ab445674f01c47fc'
			// })
			// uni.setStorage({
			// 	key: 'userId',
			// 	data: '2053085'
			// })
			// uni.setStorage({
			// 	key: 'token',
			// 	data: 'ddd64884836d585dcf6a3897deddb893'
			// })
			pluginsReady(function() {
				EbeiPlugins.getLocalUserInfo(function(userInfo) {
					uni.setStorage({
						key: 'token',
						data: userInfo.token
					})
					// uni.setStorage({
					// 	key: 'token',
					// 	data: '4abdbc073a14665058dace2e0d3bab60'
					// })
					uni.setStorage({
						key: 'userId',
						data: userInfo.userid
					})
					uni.setStorage({
						key: 'userName',
						data: userInfo.userName
					})
					uni.setStorage({
						key: 'companyId',
						data: userInfo.companyId
					})
					// alert(uni.getStorageSync('token'))
				}, function(e) {
					alert('获取用户信息失败:' + e)
				});
			})
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		},
	}

	function pluginsReady(callback) {
		if (window.EbeiPlugins) {
			callback && callback()
		} else {
			document.addEventListener('deviceready', callback, false)
		}
	};
</script>

<style lang="scss">
	@import "uview-ui/index.scss";

	page {
		width: 100%;
		height: 100%;
		background: #f5f5f9;
	}

	.content {
		width: 100%;
		height: 100%;
	}

	.status_bar {
		height: 80rpx;
		width: 100%;
		background-color: #5976ba;
		color: #fff;
		text-align: center;
		line-height: 80rpx;
		padding: 0 20rpx;

		.left {
			width: 60px;
			height: 80rpx;
			float: left;
		}

		.right {
			width: 60px;
			height: 80rpx;
			float: right;
		}

		.left2 {
			width: 80px;
			height: 80rpx;
			float: left;
			text-align: center;
		}

		.right2 {
			width: 80px;
			height: 80rpx;
			float: right;
			text-align: center;
		}
	}

	.topbar {
		height: 25px;
		background-color: #5976ba;
	}

	.status_tabs {
		height: 80rpx;
		line-height: 80rpx;
		width: 100%;
		background-color: #5976ba;
	}

	.card {
		width: calc(100% - 20px);
		margin: 0 auto;
		margin-bottom: 10px;
		border-radius: 5px;
		background: #fff;

		.top {
			display: flex;
			justify-content: space-between;
			height: 40px;
			padding: 10px;
			line-height: 20px;
			border-bottom: 1px solid #e4e4e4;

			.left {
				font-weight: bold;
			}
		}

		.bottom {
			padding: 10px;

			view {
				line-height: 25px;
			}

			.bButton {
				margin-top: 10px;
				height: 40px;
				line-height: 40px;

				span {
					float: right;
					display: block;
					height: 39px;
					line-height: 39px;
					border-radius: 39px;
					// width: 80px;
					padding: 0 30px;
					background-color: #5976ba;
					border: 1px solid #5976ba;
					color: #fff;
					text-align: center;
				}
			}
		}
	}

	.mainCont {
		width: 100%;
	}

	.bottomButton {
		width: 100%;
		height: 60px;
		line-height: 60px;
		background: #f5f5f9;
		position: fixed;
		bottom: 0;
		left: 0;
		padding-top: 10px;
		z-index: 20;

		view {
			width: calc(100% - 30px);
			height: 40px;
			line-height: 40px;
			border-radius: 40px;
			color: #fff;
			text-align: center;
			background-color: #5976ba;
			margin: 0 auto;
		}
	}

	.slot-btn {
		width: 80px;
		height: 80px;
		display: flex;
		justify-content: center;
		align-items: center;
	}
</style>
