parking-order.js 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. // components/parking-order.js
  2. Component({
  3. /**
  4. * 组件的属性列表
  5. */
  6. properties: {
  7. occupyOrder:{
  8. type: Array,
  9. value: []
  10. },
  11. showPopup:{
  12. type: Boolean,
  13. value: false
  14. }
  15. },
  16. lifetimes:{
  17. attached(){
  18. // this.loadOccupyOrder();
  19. // 页面加载时显示弹窗
  20. let isLogin = wx.getStorageSync('isLogin');
  21. if (isLogin) {
  22. this.loadOccupyOrder();
  23. }
  24. },
  25. },
  26. pageLifetimes:{
  27. // 组件所在页面的生命周期函数
  28. show: function () {
  29. // let isLogin = wx.getStorageSync('isLogin');
  30. // if (isLogin) {
  31. // this.loadOccupyOrder();
  32. // }
  33. },
  34. },
  35. /**
  36. * 组件的初始数据
  37. */
  38. data: {
  39. showPopup: false,
  40. occupyFeeOrderList:[]
  41. },
  42. /**
  43. * 组件的方法列表
  44. */
  45. methods: {
  46. loadOccupyOrder(){
  47. let that = this;
  48. wx.request({
  49. url: getApp().globalData.postHeadAgreement +'/restapi/wechat/queryOccupyFeeOrder',
  50. data: {
  51. userId: wx.getStorageSync('userInfo').userId,
  52. searchIndex: 2,
  53. pagenum: this.data.pagenum++,
  54. pagesize: 10,
  55. },
  56. method: 'POST',
  57. success(res) {
  58. console.log("占位费",res);
  59. // if (res.data.result.total > 0) {
  60. // that.setData({
  61. // showPopup:true
  62. // })
  63. // }
  64. if (res.data.result) {
  65. let {
  66. rows: occupyFeeOrderList,
  67. } = res.data.result;
  68. that.setData({
  69. occupyFeeOrderList: that.data.occupyFeeOrderList.concat(occupyFeeOrderList),
  70. });
  71. }
  72. }
  73. });
  74. },
  75. handleConfirm() {
  76. // 点击确认按钮
  77. this.setData({
  78. showPopup: false
  79. });
  80. },
  81. handleContact() {
  82. // 联系客服
  83. wx.makePhoneCall({
  84. phoneNumber: '18888888888' // 替换为实际的客服电话
  85. });
  86. },
  87. }
  88. })