Page({
  data: {
    statusBarHeight: 44,
    deviceId: '',
    trialDays: 7
  },

  onBack: function () {
    wx.navigateBack({
      fail: function () {
        wx.reLaunch({ url: '/pages/index/index' })
      }
    })
  },

  onLoad: function (options) {
    var app = getApp()
    this.setData({ statusBarHeight: app.globalData.statusBarHeight })
    this.setData({ deviceId: options.device_id || '' })
  },

  onStart: function () {
    wx.redirectTo({ url: '/pages/wear-check/wear-check' })
  },

  onGoHome: function () {
    wx.reLaunch({ url: '/pages/index/index' })
  }
})
