kydc/progress/checkin-detail/checkin-detail.js

23 lines
557 B
JavaScript
Raw Normal View History

2026-05-03 21:44:16 +08:00
const app = getApp()
Page({
data: {
stats: null,
loading: false,
error: '',
},
onShow() {
this.loadStats()
},
loadStats() {
this.setData({ loading: true, error: '' })
wx.request({
url: `${app.globalData.baseUrl}/api/v1/checkin/stats`,
header: { 'X-Auth-Token': app.globalData.authToken || '' },
2026-05-03 21:44:16 +08:00
success: (res) => this.setData({ stats: res.data?.data || null }),
fail: () => this.setData({ error: '打卡数据加载失败' }),
complete: () => this.setData({ loading: false }),
})
},
})