const api = require('../../utils/api')

Page({
  data: {
    children: [],
    error: '',
  },
  onShow() {
    this.load()
  },
  async load() {
    try {
      const data = await api.listChildren()
      this.setData({ children: data.list || [], error: '' })
    } catch (err) {
      this.setData({ error: err.message || '加载失败' })
    }
  },
  goScreening() {
    wx.navigateTo({ url: '/pages/screening/screening' })
  },
})
