<template>
	<view class="userInfo">
		<view class="my-message">
			<view class="left">
				<image :src="userInfo.img" mode=""></image>
			</view>
			<view class="right">
				{{userInfo.username}}
			</view>
		</view>
		<uni-list>
			<uni-list-item title="我的收藏" link to="/pages/userInfo/myCollection/myCollection"></uni-list-item>
			<uni-list-item title="常见问题" link to="/pages/userInfo/question/question"></uni-list-item>
			<uni-list-item title="联系我们" link to="/pages/userInfo/contactUs/contactUs"></uni-list-item>
			<uni-list-item title="设置" link to="/pages/userInfo/setting/setting"></uni-list-item>
			<view class="share-box">
				<button title="分享" open-type="share">分享</button>
			</view>
		</uni-list>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				userInfo: {}
			}
		},
		created() {
			this.userInfo = uni.getStorageSync('userInfo')
		},
		onShareAppMessage(res) {
			if (res.from === 'button') { // 来自页面内分享按钮
				console.log(res)
			}
			return {
				title: '想要好看的图片就来[节点壁纸]吧!',
				path: `/pages/index/index?id=${this.userInfo.id}`
			}
		},
		methods: {
			share() {

			}
		}
	}
</script>

<style lang="less">
	.userInfo {
		height: 100%;
		background-color: white;

		.my-message {
			display: flex;
			justify-content: flex-start;
			align-items: center;
			padding: 20rpx;

			.left {
				width: 100rpx;
				height: 100rpx;
				margin-right: 20rpx;

				>image {
					width: 100%;
					height: 100%;
					border-radius: 50%;
				}
			}

			.right {
				font-size: 12px;
			}
		}

		.share-box {
			width: 100vw;

			>button {
				background: none;
				outline: none;
				font-size: 14px;
				text-align: left;
				line-height: 14px;
				padding: 12px 15px;
			}

		}

		.bottom-btn {
			position: fixed;
			bottom: 0;
			left: 0;
			width: 100vw;
			z-index: 1000;
		}
	}
</style>
