<template>
	<view class="profile-container">
		<!-- 顶部个人信息 -->
		<view class="profile-header">
			<view class="profile-avatar">
				<image src="/static/avatar.png" mode="aspectFill" />
			</view>
			<view class="profile-info">
				<view class="profile-name">Hi, 微信用户</view>
				<view class="profile-id">船舶编号：- </view>
			</view>
			<view class="profile-setting">
				<image class="setting-icon" src="/static/icon_setting.png" mode="aspectFit" />
			</view>
		</view>

		<!-- 功能卡片1 -->
		<view class="profile-card first-card">
			<view class="profile-item" v-for="item in mainList" :key="item.text" @click="onItemClick(item)">
				<image :src="item.icon" class="profile-list-icon" mode="aspectFit" />
				<text class="item-text">{{ item.text }}</text>
				<image src="/static/right_arrow.png" class="profile-arrow-icon" mode="aspectFit" />
			</view>
		</view>

		<!-- 功能卡片2 -->
		<view class="profile-card">
			<view class="profile-item" v-for="item in helpList" :key="item.text" @click="onItemClick(item)">
				<image :src="item.icon" class="profile-list-icon" mode="aspectFit" />
				<text class="item-text">{{ item.text }}</text>
				<image src="/static/right_arrow.png" class="profile-arrow-icon" mode="aspectFit" />
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				mainList: [
					{ text: '我的预约', icon: '/static/icon_my1.png' },
					{ text: '我的购票', icon: '/static/icon_my2.png' },
					{ text: '我的发票', icon: '/static/icon_my3.png' },
					{ text: '船舶信息', icon: '/static/icon_my4.png' },
				],
				helpList: [
					{ text: '联系客服', icon: '/static/icon_my5.png' },
					{ text: '帮助中心', icon: '/static/icon_my6.png' },
					{ text: '关于我们', icon: '/static/icon_my7.png' },
				]
			}
		},
		methods: {
			onItemClick(item) {
				if (item.text === '船舶信息') {
					uni.navigateTo({ url: '/pages/my/ship_detail' });
				} else {
					uni.showToast({ title: item.text, icon: 'none' })
				}
			}
		}
	}
</script>

<style lang="scss">
.profile-container {
	min-height: 100vh;
	background: linear-gradient(180deg, #cbe6ff 0%, #f6faff 100%);
	padding-top: 88rpx;
	padding-bottom: 100rpx;
}
.profile-header {
	display: flex;
	align-items: center;
	padding: 40rpx 30rpx 20rpx 30rpx;
	position: relative;
	margin-top: 44rpx;
}
.profile-avatar image {
	width: 120rpx;
	height: 120rpx;
	border-radius: 50%;
	background: #fff;
	border: 2rpx solid #e0e0e0;
}
.profile-info {
	flex: 1;
	margin-left: 24rpx;
}
.profile-name {
	font-size: 36rpx;
	font-weight: bold;
	color: #222;
}
.profile-id {
	font-size: 24rpx;
	color: #7a8599;
	margin-top: 8rpx;
}
.profile-setting {
	position: absolute;
	right: 30rpx;
	top: 40rpx;
}
.setting-placeholder {
	width: 80rpx;
	height: 80rpx;
	border-radius: 50%;
	background: #e0e0e0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #888;
	font-size: 28rpx;
	font-weight: bold;
	margin-top: 25rpx;
}
.profile-card {
	background: #fff;
	border-radius: 24rpx;
	margin: 20rpx 20rpx 0 20rpx;
	box-shadow: 0 4rpx 16rpx rgba(0,0,0,0.03);
	overflow: hidden;
}
.profile-item {
	display: flex;
	align-items: center;
	padding: 32rpx 24rpx;
	border-bottom: 1rpx solid #f0f0f0;
	font-size: 30rpx;
	color: #222;
	position: relative;
}
.profile-item:last-child {
	border-bottom: none;
}
.profile-item .iconfont {
	font-size: 40rpx;
	margin-right: 24rpx;
	color: #3b82f6;
}
.profile-item .icon-arrow-right {
	margin-left: auto;
	color: #c0c4cc;
	font-size: 32rpx;
}
.item-text {
	flex: 1;
}
.tabbar {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	height: 100rpx;
	background: #fff;
	display: flex;
	border-top: 1rpx solid #f0f0f0;
	z-index: 10;
}
.tabbar-item {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	color: #888;
	font-size: 24rpx;
}
.tabbar-item .iconfont {
	font-size: 40rpx;
	margin-bottom: 4rpx;
}
.tabbar-item.active {
	color: #3b82f6;
}

.setting-icon {
  width: 80rpx;
  height: 80rpx;
  border-radius: 50%;
  background: #e0e0e0;
  margin-top: 25rpx;
}

.profile-list-icon {
  width: 40rpx;
  height: 40rpx;
  margin-right: 24rpx;
  vertical-align: middle;
}

.first-card {
  margin-bottom: 38rpx;
}

.profile-arrow-icon {
  width: 38rpx;
  height: 38rpx;
  margin-left: auto;
  display: block;
}
</style> 