12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- const app = getApp()
- let userInfo = app.globalData.userInfo;
- let height = app.globalData.phoneHeight
- Page({
-
- data: {
- currentIndex:0,
- height:height,
- content: [
- {text: "我的收藏"},
- {text: "我的已购"},
- {text: "收听历史"},
- {text: "我的礼包"}
- ]
- },
-
- onLoad: function (options) {
- var that = this;
- var height;
- wx.getSystemInfo({
- success (res) {
- console.log(res.windowHeight);
- height = res.windowHeight
- }
- })
- if (app.globalData.userInfo === null){
- that.setData({
- login:true
- })
- }else{
- that.setData({
- login: false,
- height:height
- })
- }
- },
-
- onShareAppMessage: function () {
- },
-
-
- bindGetUserInfo(e) {
- var that = this;
- wx.getUserInfo({
- success: function (res) {
- app.globalData.userInfo = e.detail.userInfo;
- console.log(e.detail.userInfo);
- 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
- })
- }
- })
|