36 行
833 B
JavaScript
36 行
833 B
JavaScript
Page({
|
|
data: {
|
|
statusBarHeight: 44,
|
|
deviceId: '',
|
|
trialDays: 7,
|
|
isFreeMode: false
|
|
},
|
|
|
|
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 || '' })
|
|
var self = this
|
|
var http = require('../../utils/request')
|
|
http.get('/api/v1/subscription').then(function (sub) {
|
|
if (sub && sub.plan === 'free') self.setData({ isFreeMode: true })
|
|
}).catch(function () {})
|
|
},
|
|
|
|
onStart: function () {
|
|
wx.redirectTo({ url: '/pages/wear-check/wear-check' })
|
|
},
|
|
|
|
onGoHome: function () {
|
|
wx.reLaunch({ url: '/pages/index/index' })
|
|
}
|
|
})
|