<template>
	<view class="page">
		<navbar/>

		<view class="user">
			<!-- 用户信息区域 -->
			<view class="user-info">
				<image class="avatar" src="https://img95.699pic.com/photo/50058/1378.jpg_wh860.jpg" mode=""></image>
				<view class="info">
					<view class="name">战斗世界 <text class="id">(ID: 50523541)</text></view>
					<view class="desc">世界达人，小说控</view>
					<view class="phone">手机号：19898474531</view>
				</view>
				<view class="more">
					<uv-icon name="more-dot-fill" size="46rpx" color="#999"></uv-icon>
				</view>
			</view>
			
			<!-- 图片区域 -->
			<view class="section">
				<view class="section-title">图片</view>
				<view class="section-list">
					<view class="section-item" @click="navigateTo('/pages/wallet')">
						<view class="section-item-left">
							<uv-icon name="photo" size="40rpx" color="#333"></uv-icon>
							<text>钱包提现</text>
						</view>
						<uv-icon name="arrow-right" size="36rpx" color="#999"></uv-icon>
					</view>
					<view class="section-item" @click="navigateTo('/pages/gift')">
						<view class="section-item-left">
							<uv-icon name="gift" size="40rpx" color="#333"></uv-icon>
							<text>礼物盒</text>
						</view>
						<uv-icon name="arrow-right" size="36rpx" color="#999"></uv-icon>
					</view>
				</view>
			</view>
			
			<!-- 日常区域 -->
			<view class="section">
				<view class="section-title">日常</view>
				<view class="section-list">
					<view class="section-item" @click="navigateTo('/pages/comments')">
						<view class="section-item-left">
							<uv-icon name="chat" size="40rpx" color="#333"></uv-icon>
							<text>我的评论</text>
						</view>
						<view class="badge">294</view>
						<uv-icon name="arrow-right" size="36rpx" color="#999"></uv-icon>
					</view>
					<view class="section-item" @click="navigateTo('/pages/tasks')">
						<view class="section-item-left">
							<uv-icon name="list" size="40rpx" color="#333"></uv-icon>
							<text>任务中心</text>
						</view>
						<view class="badge">5</view>
						<uv-icon name="arrow-right" size="36rpx" color="#999"></uv-icon>
					</view>
				</view>
			</view>
			
			<!-- 设置区域 -->
			<view class="section">
				<view class="section-title">设置</view>
				<view class="section-list">
					<view class="section-item" @click="navigateTo('/pages/author')">
						<view class="section-item-left">
							<uv-icon name="star" size="40rpx" color="#333"></uv-icon>
							<text>申请成为作者</text>
						</view>
						<uv-icon name="arrow-right" size="36rpx" color="#999"></uv-icon>
					</view>
					<view class="section-item" @click="navigateTo('/pages/customer-service')">
						<view class="section-item-left">
							
							<text>联系客服</text>
						</view>
						<uv-icon name="arrow-right" size="36rpx" color="#999"></uv-icon>
					</view>
					<view class="section-item" @click="navigateTo('/pages/edit-info')">
						<view class="section-item-left">
							<uv-icon name="edit-pen" size="40rpx" color="#333"></uv-icon>
							<text>修改信息</text>
						</view>
						<uv-icon name="arrow-right" size="36rpx" color="#999"></uv-icon>
					</view>
					<view class="section-item" @click="logout">
						<view class="section-item-left">
							
							<text>退出登录</text>
						</view>
						<uv-icon name="arrow-right" size="36rpx" color="#999"></uv-icon>
					</view>
				</view>
			</view>
		</view>

		<tabber select="cart" />
	</view>
</template>

<script>
	import tabber from '@/components/base/tabbar.vue'
	export default {
		components: {
			tabber,
		},
		data() {
			return {
				
			}
		},
		methods: {
			navigateToPage(url) {
				uni.navigateTo({
					url
				})
			},
			logout() {
				// 退出登录逻辑
				uni.showModal({
					title: '提示',
					content: '确定要退出登录吗？',
					success: (res) => {
						if (res.confirm) {
							// 执行退出登录
							uni.showToast({
								title: '已退出登录'
							})
						}
					}
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	.page {
		padding-bottom: 200rpx;
		background-color: #f5f5f5;
	}

	.user {
		padding: 20rpx 30rpx;
		
		.user-info {
			display: flex;
			align-items: center;
			padding: 30rpx 20rpx;
			background-color: #fff;
			border-radius: 20rpx;
			margin-bottom: 20rpx;
			
			.avatar {
				width: 120rpx;
				height: 120rpx;
				border-radius: 50%;
				margin-right: 20rpx;
			}
			
			.info {
				flex: 1;
				
				.name {
					font-size: 32rpx;
					font-weight: bold;
					margin-bottom: 10rpx;
					
					.id {
						font-size: 24rpx;
						font-weight: normal;
						color: #999;
					}
				}
				
				.desc {
					font-size: 26rpx;
					color: #666;
					margin-bottom: 10rpx;
				}
				
				.phone {
					font-size: 26rpx;
					color: #666;
				}
			}
			
			.more {
				padding: 10rpx;
			}
		}
		
		.section {
			margin-bottom: 20rpx;
			
			.section-title {
				font-size: 28rpx;
				color: #999;
				padding: 20rpx 10rpx 10rpx;
			}
			
			.section-list {
				background-color: #fff;
				border-radius: 20rpx;
				overflow: hidden;
				
				.section-item {
					display: flex;
					align-items: center;
					justify-content: space-between;
					padding: 30rpx 20rpx;
					border-bottom: 1px solid #f5f5f5;
					
					&:last-child {
						border-bottom: none;
					}
					
					.section-item-left {
						display: flex;
						align-items: center;
						
						text {
							margin-left: 20rpx;
							font-size: 28rpx;
						}
					}
					
					.badge {
						background-color: #FA5A0A;
						color: #fff;
						font-size: 22rpx;
						padding: 2rpx 12rpx;
						border-radius: 20rpx;
						margin-right: 10rpx;
					}
				}
			}
		}
	}
</style>