123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- const app = getApp()
- Page({
-
- data: {
- currentIndex:0,
- height:0,
- content: [
- {text: "我的收藏"},
- {text: "我的已购"},
- {text: "收听历史"},
- {text: "我的礼包"}
- ],
- login: true
- },
-
- onLoad: function (options) {
- var that = this;
- wx.getSystemInfo({
- success (res) {
- that.setData({
- height :res.windowHeight
- })
- }
- })
- wx.getStorage({
- key: 'login',
- success(res){
- if(res.data === 200){
- that.setData({
- login: false,
- })
- }
- },
- fail(res){
- console.log(res)
- }
- })
- },
-
- onShareAppMessage: function () {
- },
-
-
- bindGetUserInfo(e) {
- var that = this;
- wx.getUserInfo({
- success: function (res) {
- app.globalData.userInfo = e.detail.userInfo;
- wx.setStorage({
- key: "login",
- data: 200
- })
- that.setData({
- login: false,
- })
- }
- })
- },
- checkItem(e){
- var that = this;
- if (this.data.currentIndex === e.target.dataset.current) {
- return false;
- } else {
- that.setData({
- currentIndex: e.target.dataset.index
- })
- }
- },
-
- changeTab:function(e){
- var that = this;
- console.log(e.detail.current)
- that.setData({
- currentIndex:e.detail.current
- })
- }
- })
|