<template>
	<view>
		<!-- <uni-list>
			<uni-list-item  :title="item.title" v-for="(item,index) in dataList" @click="onclick(item)"></uni-list-item>
		</uni-list> -->

		<view class="list" @tap.stop="onclick(item)" v-for="(item, index) in dataList" :key="item.id">
		    <span class="listTitle">{{ item.title }}</span>
			<view class="jlSj">
			     <span class="jf">
			        {{ item.updateTime || item.createTime }}
			         <!-- <em class="iconfont icon-jifen"></em> -->
			     </span>
			   <!-- <view class="ck">

			         <span>
			             <em class="iconfont icon-chakan"></em>
			             {{ item.watchNum }}
			         </span>
			         <span :class=" favoriteList.includes(item.id) ? 'favorite' : 'not-favorite' ">
			             <em class="iconfont icon-shoucang" @click.stop="addFavorite(item)"></em>
			             {{ currentFavoriteCount(item) }}
			         </span>
			     </view> -->
			 </view>
		</view>

	</view>
</template>

<script>
	import {
		listMatters
	} from "@/api/handleAffairs/matter.js"
	export default {
		data() {
			return {
				queryForm:{
					pageNum: 1,
					pageSize: 10,
				},
				total:0,
				dataList: [],
			};
		},
		created() {

		},
		onLoad(option) {
			this.queryForm = Object.assign(uni.getStorageSync('data'), this.queryForm)
			this.getMatters()
		},
		onReachBottom(){
			let pageNum = this.queryForm.pageNum
			let pageSize = this.queryForm.pageSize
			let total = this.total
			if(pageNum * pageSize >= total){
				uni.showToast({
					title:'暂无更多数据'
				})
				return
			} else {
				this.queryForm.pageSize += 5;
				this.getMatters()
			}
		},
		methods: {
			onclick(data){//点击详情
				uni.setStorageSync('id', data.id);
				uni.navigateTo({
				    url: '/pages/gridQuery/mattercontent',
				});
			},
			getMatters() {
				let _that = this
				listMatters(_that.queryForm).then(res => {
					_that.dataList = res.rows
					_that.total = res.total

				})
			}
		}
	}
</script>

<style lang="scss">
@import './matterAll.css';
.container{
	height: 100%;
	content: '\e633';
}
.favorite{
	.icon-shoucang:before{
		color: red;
	}
}
.not-favorite{

}
</style>
