<template>
	<view>
		<u-navbar class="u-navbar-box" title="用户协议" placeholder bgColor="transparent" autoBack />
		<u-cell-group :border="false" :customStyle="{background: '#fff',padding: '10rpx 0', borderRadius: '20rpx'}">
			<u-cell v-for="(item, index) in dataList" :key='index' :title="item.title" isLink @click="goToInfo(item)"/>
		</u-cell-group>
	</view>
</template>

<script setup>
	import {
		onMounted,
		ref
	} from 'vue';
	import {
		getProtocolList
	} from '@/common/config/application-api.js'

	const dataList = ref([
		{title: '用户协议'}
	]);

	function init() {
		getProtocolList({
			parmas: {
				status: 'active'
			}
		}).then(data => {
			dataList.value = data;
			// console.log('getProtocolList=>', res);
		})
	}
	function goToInfo(item) {
		uni.$u.route('/pages/subpack/pages/protocol/info', {
			id: item.id
		})
	}
	onMounted(() => {
		init();
	})
</script>
<style>
	page {
		background-color: #F6FAFF;
	}
</style>
<style lang="scss" scoped>
	:deep(.u-navbar__content__title) {
		font-weight: bold;
		font-size: 36rpx;
		color: #222222;
	}

	.u-navbar-box {
		background: radial-gradient(circle at left, #FFE5E4 0%, #EEF2F5 40%, #DBEEFB 100%);
	}
</style>