<template>
	<!-- 申遗历程 -->
	<view class="apply">
		<navbar title="申遗历程" leftClick @leftClick="$utils.navigateBack" />
		<view class="top-img">
			<image src="../static/applyRelic/jdz.png" mode="aspectFill" style="width: 100%; height: 100%;"></image>
		</view>

		<view class="middle-box">
			<view class="middle-img">
				<view>
					<image src="../static/applyRelic/2.png" mode="aspectFill" />
				</view>
				<view>
					<image src="../static/applyRelic/2.png" mode="aspectFill" />
				</view>
				<view>
					<image src="../static/applyRelic/2.png" mode="aspectFill" />
				</view>
			</view>
			<view class="middle-font">
				<view>
					申遗历程
				</view>
				<view>
					申遗缘由
				</view>
				<view>
					遗产价值
				</view>
			</view>
		</view>

		<view class="apply-list">
			<uv-list @scrolltolower="scrolltolower">
				<uv-list-item 
				:title="item.articleTitle" 
				:note="$dayjs(item.createTime).format('YYYY-MM-DD')"
				:border="true"
				v-for="(item,index) in list" 
				:key="index"
				:clickable="true"
				@click="toUrl(item)"
				>
					<template #footer>
						<uv-image :src="item.articleImage" radius="10rpx" width="240rpx"
							height="160rpx" />
					</template>
				</uv-list-item>
			</uv-list>
		</view>
		<tabber />
	</view>
</template>

<script>
	export default {
		data() {
			return {
				queryParams: {
					pageNo: 1,
					pageSize: 10,
				},
				total : 0,
				list : [],
			}
		},
		onShow() {
			this.queryArticleList()
		},
		onReachBottom() {
			this.loadMoreData()
		},
		methods: {
			queryArticleList(){
				this.$api('queryArticleList', res => {
					if(res.code == 200){
						this.list = res.result
					}
				})
			},
			loadMoreData(){
				if(this.queryParams.pageSize < this.total){
					this.queryParams.pageSize += 10
					this.queryArticleList()
				}
			},
			toUrl(item){
				console.log(item);
				this.$utils.navigateTo(`/pages_order/service/articleDetail?id=${item.id}`)
			},
		}
	}
</script>

<style scoped lang="scss">
	.apply {

		.top-img {
			height: 380rpx;
		}

		.middle-box {
			display: flex;
			position: relative;
			height: 220rpx;
			align-items: center;
			justify-content: space-around;
			background-color: #fff;

			.middle-img {
				display: flex;
				align-items: center;
				justify-content: space-around;
				width: 100%;

				view {
					width: 160rpx;
					height: 160rpx;

					image {
						width: 100%;
						height: 100%;
					}
				}
			}

			.middle-font {
				position: absolute;
				display: flex;
				width: 100%;
				justify-content: space-around;

				view {
					width: 60rpx;
					color: #FFFDF6;
					font-weight: 600;
				}
			}
		}

		.apply-list {
			width: 94%;
			margin-left: 3%;
			/deep/ .uv-list-item{
				background-color: #FFFDF6 !important;
			}
		}
	}
</style>