<template>
	<view class="container">
		<view class="list">
			<scroll-view :scroll-top="scrollTop" scroll-y="true" class="scroll-Y" @scrolltoupper="upper"
				@scrolltolower="lower" @scroll="scroll">
				<view class="card" v-for="(item,index) in list" @click="toNotice(item.id)">
					<view class="title">{{index + 1}}.{{item.title}}</view>
				</view>
			</scroll-view>
		</view>
	</view>
</template>

<script>
	import {
		get,
		post
	} from '@/common/request.js'
	export default {
		data() {
			return {
			
				scrollTop: 0,
				list: [],
			}
		},
		onLoad() {
			this.getList()
		},
		methods: {
			sectionChange(current) {
				this.current = current
			},
			toNotice(id) {
				uni.navigateTo({
					url: '/pages/index/details?id='+id
				})
			},
			getList() {
				get('/myapi/api/yq_driver/articleList').then(res => {
					this.list = res.data
				})
			},
			upper: function(e) {
				console.log(e)
			},
			lower: function(e) {
				console.log(e)
			},
			scroll: function(e) {
				console.log(e)
				this.old.scrollTop = e.detail.scrollTop
			},
		}
	}
</script>

<style scoped lang="less">
	.container {
		padding-top: 2px;
		background-color: #f4f4f4;
		height: calc(100vh - 46px);

		.list {
			padding: 5px 20px;

			.scroll-Y {
				height: calc(100vh - 86px);

				.card {
					background-color: #fff;
					padding: 10px;
					margin-bottom: 10px;
					font-size: 14px;
					border-radius: 10px;

					.title {
						font-size: 16px;
					}


				}
			}
		}
	}
</style>