report.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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. this.getMyReportList()
  17. },
  18. // 我的报告
  19. getMyReportList () {
  20. var that = this
  21. wx.showLoading({
  22. title: '加载中...',
  23. mask: true
  24. })
  25. myReportList({}).then(res => {
  26. wx.hideLoading()
  27. var response = res.data || []
  28. that.setData({
  29. reportList: response
  30. })
  31. }).catch(e => {
  32. wx.hideLoading()
  33. wx.showModal({
  34. content: e,
  35. confirmColor: '#333',
  36. showCancel: false
  37. })
  38. })
  39. },
  40. /**
  41. * 立即预约
  42. */
  43. handleAppoint() {
  44. wx.navigateTo({
  45. url: '/pages/appointment/appointment',
  46. })
  47. },
  48. /**
  49. * 生命周期函数--监听页面卸载
  50. */
  51. onUnload() {
  52. },
  53. /**
  54. * 页面相关事件处理函数--监听用户下拉动作
  55. */
  56. onPullDownRefresh() {
  57. },
  58. /**
  59. * 页面上拉触底事件的处理函数
  60. */
  61. onReachBottom() {
  62. },
  63. /**
  64. * 点击报告进入详情
  65. */
  66. handleDetail(e) {
  67. var reportId = e.currentTarget.dataset.reportid
  68. console.log(e.currentTarget.dataset.reportid);
  69. wx.navigateTo({
  70. url: '/pages/reportDetail/reportDetail?reportid=' + reportId
  71. })
  72. /* var data = {
  73. name: '循环系统',
  74. reportId: reportId
  75. }
  76. getReport(data).then(res => {
  77. console.log(res);
  78. })
  79. return
  80. */
  81. }
  82. })