123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 |
- 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();
- }
-
- }
-
- }
|