<template>
	<view class="box">
		<u-navbar :autoBack="true" title="法律法规" bgColor="rgba(255,255,255,0)" :placeholder="true" titleStyle="font-weight:bold;color:#000000"></u-navbar>
		<view class="" style="border: 1px solid #eba869; width: 670rpx; margin: auto; margin-top: 32rpx">
			<u-search
				bgColor="transparent"
				v-model="val"
				shape="square"
				:showAction="true"
				actionText="搜索"
				@custom="searchBtn"
				:actionStyle="{ color: '#985741', fontSize: '28rpx', fontWeight: 'bold', backgroundColor: '#fff9e9' }"
			></u-search>
		</view>
		<view class="fg_box" @click="lawBtn(item.id)" v-for="item in lawList" :key="item.id">
			<view class="">
				<image style="width: 180rpx; height: 266rpx" src="https://huli-app.wenlvti.net/app_static/WenWuGuanJia/image/fg_img.png"></image>
			</view>
			<view class="">
				<view class="title">{{ item.title }}</view>
				<view style="font-size: 24rpx; color: rgba(68, 68, 68, 0.4)">{{ item.create_date }}</view>
			</view>
			<view class="">
				<image :src="item.img" style="width: 40rpx; height: 40rpx"></image>
			</view>
		</view>
	</view>
</template>

<script>
let that;
export default {
	data() {
		return {
			val: '',
			lawList: []
		};
	},
	onLoad() {
		that = this;
		this.getArchives();
	},
	methods: {
		getArchives() {
			uni.request({
				url: 'https://huli-app.wenlvti.net/addons/cms/api.archives/index',
				data: {
					page: 1,
					channel: 35,
					model: -1,
					menu_index: 1
				},
				success: function (res) {
					that.lawList = res.data.data.pageList.data;
					// console.log(that.lawList, 545);
				}
			});
		},
		searchBtn() {
			uni.request({
				url: 'https://huli-app.wenlvti.net//addons/cms/api.search/index',
				data: {
					model: 6,
					page: 1,
					orderby: 'default',
					orderway: 'asc',
					q: this.val
				},
				success: function (res) {
					console.log(res, 545);
					that.lawList = res.data.data.pageList.data;
				}
			});
		},
		lawBtn(id) {
			uni.navigateTo({
				url: '/index_fenbao/fuWu/FaLv/XiangQing?id=' + id
			});
		}
	}
};
</script>

<style>
.box {
	width: 100%;
	padding-bottom: 50rpx;
	/* 	background-image: url('https://huli-app.wenlvti.net/app_static/WenWuGuanJia/image/xbg_2.png');
	background-size: 100% 100%;
	background-attachment: fixed;
	background-repeat: repeat-y; */
	min-height: 100%;
	height: auto;
	background-color: #fff9e9;
}
/deep/.u-input--radius.data-v-113bc24f,
.u-input--square.data-v-113bc24f {
	border: 1px solid #eba869 !important;
}
.fg_box {
	display: flex;
	align-items: center;
	justify-content: space-around;
	margin: auto;
	margin-top: 40rpx;
	width: 670rpx;
	height: 322rpx;
	border: 2rpx solid #ebc9a9;
}
.title {
	width: 346rpx;
	/* height: 96rpx; */
	font-size: 32rpx;
	color: #444444;
	line-height: 48rpx;
}
.u-search__action--active.data-v-0a306a29 {
	height: 60rpx !important;
	line-height: 60rpx !important;
}
.u-search__action--active.data-v-2d141374 {
	height: 60rpx !important;
	line-height: 60rpx !important;
}
</style>
