report.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. // pages/report/report.js
  2. import { myReportList, getReport } from '../../api/my'
  3. const app = getApp()
  4. Page({
  5. /**
  6. * 页面的初始数据
  7. */
  8. data: {
  9. reportList: [],
  10. showPage: true
  11. },
  12. /**
  13. * 生命周期函数--监听页面显示
  14. */
  15. onShow() {
  16. app.globalData.selectedInex = 1
  17. this.getMyReportList()
  18. },
  19. // 我的报告
  20. getMyReportList () {
  21. var that = this
  22. wx.showLoading({
  23. title: '加载中...',
  24. mask: true
  25. })
  26. myReportList({}).then(res => {
  27. wx.hideLoading()
  28. var response = res.data || []
  29. that.setData({
  30. reportList: response
  31. })
  32. }).catch(e => {
  33. wx.hideLoading()
  34. wx.showModal({
  35. content: e,
  36. confirmColor: '#333',
  37. showCancel: false
  38. })
  39. })
  40. },
  41. /**
  42. * 立即预约
  43. */
  44. handleAppoint() {
  45. wx.navigateTo({
  46. url: '/pages/appointment/appointment',
  47. })
  48. },
  49. /**
  50. * 生命周期函数--监听页面卸载
  51. */
  52. onUnload() {
  53. },
  54. /**
  55. * 页面相关事件处理函数--监听用户下拉动作
  56. */
  57. onPullDownRefresh() {
  58. },
  59. /**
  60. * 页面上拉触底事件的处理函数
  61. */
  62. onReachBottom() {
  63. },
  64. /**
  65. * 点击报告进入详情
  66. */
  67. handleDetail(e) {
  68. var reportId = e.currentTarget.dataset.reportid
  69. wx.navigateTo({
  70. url: '/pages/reportDetail/reportDetail?reportid=' + reportId
  71. })
  72. }
  73. })