<template>
	<view class="content">
		<view class="hflex acenter jbetween">
			<view class="top_bg">
				<view class="top" @click="toRule(1)">规则</view>
			</view>
			<view class="top_bg">
				<view class="top" @click="toRule(2)">公约</view>
			</view>
			<view class="top_bg">
				<view class="top" @click="toRule(3)">供方认可机构清单</view>
			</view>
		</view>
		<view class="">
			<block v-for="(item,index) in pageList" :key="index">
				<view class="box">
					<view class="box_name">{{item.title}}</view>
					<view class="text_style1 text_hide">规则:{{item.c_rule}}</view>
					<view class="text_style1 text_hide">公约:{{item.c_conv}}</view>
					<view class="bottom hflex jend">
						<view class="btn" @click="toDetail(item.id)">查看详情</view>
					</view>
				</view>
			</block>
		</view>
	</view>
</template>

<script>
	import $api from '@/static/js/api.js'
	var that = ''
	export default {
		data() {
			return {
				pageList: [
				],
				page: 1,
				limit: 10,
				total: 10
			}
		},
		onLoad() {
			that = this
			that.getList()
		},
		methods: {
			getList() {
				$api.req({
					url: '/data/api.ResCenter/index',
					data: {
						page: that.page,
						limit: that.limit
					}
				}, function(res) {
					if(res.code == 1) {
						if(that.page == 1) {
							that.pageList = res.data.data
						} else {
							that.pageList.concat(res.data.data)
						}
					}
				})
			},
			// 查看详情
			toDetail(id) {
				$api.jump('/page_index/pages/resources/resourDetail?id=' + id)
			},
			// 规则
			toRule(index) {
				$api.jump('/page_index/pages/resources/rule?index=' + index)
			}
		},
	}
</script>

<style lang="scss" scoped>
	.content {
		padding: 20rpx 30rpx;
		background: #F4F4F4;
		.top_bg {
			height: 64rpx;
			box-sizing: border-box;
			padding: 0 60rpx;
			background: #506DFF;
			border-radius: 12rpx;
			.top {
				font-size: 26rpx;
				font-weight: 400;
				color: #FFFFFF;
				line-height: 64rpx;
				position: relative;
			}
			.top::before {
				position: absolute;
				content: "";
				width: 8rpx;
				height: 8rpx;
				background: #FFB33A;
				border-radius: 50%;
				top: 32rpx;
				left: -16rpx;
			}
		}
		
		.box {
			width: 100%;
			margin-top: 20rpx;
			background: #FFFFFF;
			border-radius: 24rpx;
			box-sizing: border-box;
			padding: 24rpx 20rpx;
			.box_name {
				font-size: 30rpx;
				font-weight: 500;
				color: #222222;
				line-height: 42rpx;
				padding-bottom: 20rpx;
			}
			.text_style1 {
				font-size: 20rpx;
				font-weight: 400;
				color: #999999;
				line-height: 28rpx;
				padding-bottom: 20rpx;
			}
			.bottom {
				width: 100%;
				padding: 20rpx 0 0;
				border-top: 1rpx solid #F4F4F4;
				.btn {
					width: 148rpx;
					height: 52rpx;
					border-radius: 28rpx;
					border: 1px solid #506DFF;
					text-align: center;
					line-height: 52rpx;
					font-size: 26rpx;
					font-weight: 400;
					color: #506DFF;
				}
			}
		}
	}
</style>