/**
 * author: dabao
 */
var VUE = null
window.addEventListener("load", function() {
	VUE = new Vue({
		el: '#app',
		data() {
			return {
				companyName: '',
				value: '',
				list: [],
				loading: false,
				finished: false,
				page: 0,
				size: 999,
				total: 0
			}
		},
		mounted() {
			this.getList()
		},
		methods: {
			detail(index){
				debugger
				this.list[index].currentUserRead = true
				location.href = './law-list-detail.html?law_id='+this.list[index].lawId
			},
			getList(){
				http.get('/api/thLaw',{
					page: this.page++,// 每次请求增加下一页
					size: this.size,
					county: localStorage.getItem('appCounty'),
					category_id: gemhoUtil.getParameter('category_id'),
					sort: 'lawId,desc',
				}).then((res)=>{
					
					this.loading = false; // 加载状态结束
					this.list.push(...res.content);
					this.total = res.totalElements
					
					if(this.page*this.size >= this.total){
						 this.finished = true; // 下滑不在刷新数据
					}
				})
				
			}
		},
	});
});