import * as API from '@/apis/news.js' export default { data() { return { isLoading:false, initBl:false, clientHeight: 0, list: [ 1, 2, 3, 4, 6, 7 ], recordList: [], listForm: { totalPage: 1, pageIndex: 1, pageSize: 20 } } }, methods: { gotoInfo(item) { this.carhelp.set("form", { name: 'buytickets', id: this.id, buy: true, oplist: [ { id:item.id, upStationName:item.stationName, upStationId:item.stationId, imageUrl:item.imageUrl, ticketType:item.ticketType, ticketTypeName:item.ticketTypeName } ], //当前添加的2人 list: [] // 一共添加的人 }); uni.navigateTo({ //url: "/pages/news/details?id=" + id url: "/pages/buytickets/selectSite?select=true&id=" +item.vehicleId }) }, lower() { console.log("--------") if (this.listForm.pageIndex <= this.listForm.totalPage ) { this.passengerMessage(); } else { return; } }, passengerMessage() { if(this.$refs.common){ this.$refs.common.showLoading(); } this.listForm.openId=this.carhelp.getOpenId() API.passengerMessage(this.listForm).then((res) => { this.initBl=true this.isLoading=true var response=res.data; if (response) { if (this.listForm.pageIndex == 1) { this.recordList = response.data; this.listForm.pageIndex = response.pageNumber; this.listForm.totalPage = response.totalPage; } else { this.recordList = [ ...this.recordList, ...response.data ]; } } this.listForm.pageIndex++; this.$refs.common.showLoading(false); }).catch(error => { this.$refs.common.showLoading(false,error); }) } }, onLoad() { this.clientHeight = document.body.clientHeight; }, onReady() { this.passengerMessage(); }, onShow() { if(this.initBl){ this.recordList= [], this.listForm= { totalPage: 1, pageIndex: 1, pageSize: 20 } this.passengerMessage(); } } }