var http = require('../../utils/request') Page({ data: { statusBarHeight: 44, plans: [ { plan: 'monthly', price: '¥99', desc: '约3.3元/天' }, { plan: 'yearly', price: '¥899', desc: '省¥289' } ], selected: 'yearly', purchasing: false }, onBack: function () { wx.navigateBack({ fail: function () { wx.reLaunch({ url: '/pages/index/index' }) } }) }, onLoad: function () { var app = getApp() this.setData({ statusBarHeight: app.globalData.statusBarHeight }) }, onSelect: function (e) { this.setData({ selected: e.currentTarget.dataset.plan }) }, onPurchase: function () { wx.showModal({ title: '暂未开放', content: '在线购买功能尚未开放,请联系管理员开通订阅。', showCancel: false }) } })