bybusList.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. import * as API from '@/apis/my.js'
  2. export default {
  3. data() {
  4. return {
  5. isLoading:false,
  6. clientHeight: 0,
  7. list: [
  8. 1, 2, 3, 4, 6, 7
  9. ],
  10. recordList: [],
  11. listForm: {
  12. totalPage: 1,
  13. pageIndex: 1,
  14. pageSize: 5
  15. }
  16. }
  17. },
  18. methods: {
  19. gotoUrl(id){
  20. uni.navigateTo({
  21. url:"/pages/my/user/bybusDetails?id="+id
  22. })
  23. },
  24. lower() {
  25. console.log("--------")
  26. if (this.listForm.pageIndex <= this.listForm.totalPage ) {
  27. this.passengerRecordList();
  28. } else {
  29. return;
  30. }
  31. },
  32. passengerRecordList() {
  33. this.$refs.common.showLoading();
  34. this.listForm.openId=this.carhelp.getOpenId()
  35. API.passengerRecordList(this.listForm).then((res) => {
  36. this.isLoading=true;
  37. var response=res.data;
  38. if (response) {
  39. if (this.listForm.pageIndex == 1) {
  40. this.recordList = response.data;
  41. this.listForm.pageIndex = response.pageNumber;
  42. this.listForm.totalPage = response.totalPage;
  43. } else {
  44. this.recordList = [
  45. ...this.recordList,
  46. ...response.data
  47. ];
  48. }
  49. }
  50. this.listForm.pageIndex++;
  51. this.$refs.common.showLoading(false);
  52. }).catch(error => {
  53. this.$refs.common.showLoading(false,error);
  54. })
  55. }
  56. },
  57. onLoad() {
  58. this.clientHeight = document.body.clientHeight;
  59. },
  60. onReady() {
  61. this.passengerRecordList();
  62. },
  63. }