// pages/report/report.js import { myReportList, getReport } from '../../api/my' const app = getApp() Page({ /** * 页面的初始数据 */ data: { reportList: [], showPage: true }, /** * 生命周期函数--监听页面显示 */ onShow() { this.getMyReportList() }, // 我的报告 getMyReportList () { var that = this wx.showLoading({ title: '加载中...', mask: true }) myReportList({}).then(res => { wx.hideLoading() var response = res.data || [] that.setData({ reportList: response }) }).catch(e => { wx.hideLoading() wx.showModal({ content: e, confirmColor: '#333', showCancel: false }) }) }, /** * 立即预约 */ handleAppoint() { wx.navigateTo({ url: '/pages/appointment/appointment', }) }, /** * 生命周期函数--监听页面卸载 */ onUnload() { }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh() { }, /** * 页面上拉触底事件的处理函数 */ onReachBottom() { }, /** * 点击报告进入详情 */ handleDetail(e) { var reportId = e.currentTarget.dataset.reportid console.log(e.currentTarget.dataset.reportid); wx.navigateTo({ url: '/pages/reportDetail/reportDetail?reportid=' + reportId }) /* var data = { name: '循环系统', reportId: reportId } getReport(data).then(res => { console.log(res); }) return */ } })