<template>
	<view class="app">
		<u-tabs :list="tabList" :current="tabcurrent" @change="change"></u-tabs>
		<view class="items">
			<view class="item" @tap='godiseasemanagement'>
				<image src="../../static/zbglzbgl.png" mode=""></image>
				<view class="title">
					专病管理云社区
				</view>
			</view>
			<view class="item" @tap='gogeriatricdisease'>
				<image src="../../static/lnb.png" mode=""></image>
				<view class="title">
					国家老年病中心
				</view>
			</view>
		</view>
		<u-toast ref="uToast" />
	</view>
</template>

<script>
	export default {
		data() {
			return {
				tabcurrent: 0,
				tabList: [{
					name: '专病管理'
				}],
			};
		},
		onShow() {},
		onLoad() {},
		methods: {
			//跳转专病管理小程序
			godiseasemanagement() {
				const phone = uni.getStorageSync('phone');
				if (phone) {
					uni.navigateToMiniProgram({
						appId: 'wxa690d053c34ceebd',
						path: 'pages/index/index',
						extraData: {
							'from': 'qy',
							'phone': phone
						},
						success(res) {}
					})
				} else {
					this.$refs.uToast.show({
						title: '您未登录,请先登录',
						type: 'error',
						duration: '1000',
						url: '/pages/login/login'
					})
				}
			},
			//老年病中心
			gogeriatricdisease() {
				uni.navigateTo({
					url: '/pages/geriatricdisease/geriatricdisease'
				})
			},
		},
		//1.分享给朋友
		onShareAppMessage(res) {
			let pages = getCurrentPages();
			let url = pages[pages.length - 1].$page.fullPath
			return {
				title: '泉医到家',
				path: url,
			}
		},
		//2.分享到朋友圈
		onShareTimeline(res) {
			let pages = getCurrentPages();
			let url = pages[pages.length - 1].$page.fullPath
			return {
				title: '泉医到家',
				path: url,
			}
		},
	}
</script>

<style lang="scss">
	.app {
		padding: 0;

		.items {
			background-color: #fff;
			width: 96%;
			margin: 20rpx auto;
			padding: 60rpx 0;
			border-radius: 5rpx;

			.item {
				width: 50%;
				display: inline-block;

				image {
					width: 150rpx;
					height: 150rpx;
					display: block;
					margin: 0 auto;
				}

				.title {
					display: block;
					margin: 20rpx auto;
					width: 180rpx;
					text-align: center;
					font-size: 40rpx;
					line-height: 50rpx;
					font-weight: 600;
				}
			}
		}

	}
</style>
