<template>
	<view class="agreement-list-page">
		<view class="list-container">
			<view class="agreement-item" v-for="item in agreements" :key="item.id" @click="goToDetail(item)">
				<view class="item-info">
					<text class="item-title">{{ item.title }}</text>
					<text class="item-date">更新时间：{{ item.updateTime }}</text>
				</view>
				<uni-icons type="right" size="14" color="#ccc"></uni-icons>
			</view>
		</view>
	</view>
</template>

<script setup>
import { ref } from 'vue'
const agreements = ref([
	{ id: 1, title: '隐私政策', updateTime: '2024-01-15' },
	{ id: 2, title: '用户服务协议', updateTime: '2024-01-15' },
	{ id: 3, title: '商家托运协议', updateTime: '2024-02-01' },
	{ id: 4, title: '宠物洗护服务规范', updateTime: '2024-02-01' }
])
const goToDetail = (item) => uni.navigateTo({ url: `/pages/my/agreement/detail/index?title=${item.title}` })
</script>

<style lang="scss" scoped>
.agreement-list-page { min-height: 100vh; background: #f7f8fa; }
.list-container { padding: 24rpx; }
.agreement-item { display: flex; align-items: center; background: #fff; border-radius: 20rpx; padding: 32rpx; margin-bottom: 16rpx; }
.item-info { flex: 1; }
.item-title { display: block; font-size: 30rpx; color: #333; font-weight: 600; margin-bottom: 8rpx; }
.item-date { display: block; font-size: 24rpx; color: #999; }
</style>
