123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- const app = getApp()
- let userInfo = app.globalData.userInfo;
- Page({
-
- data: {
- timeout:[
- {text:"不开启"},
- {text:"播放当前声音关闭"},
- {text:"播放2首声音关闭"},
- {text:"播放3首声音关闭"},
- {text:"播放4首声音关闭"},
- {text:"10分钟后"},
- {text:"20分钟后"},
- {text:"30分钟后"},
- ],
- activeIndex:0,
- login: true,
- avatarUrl:"",
- nickName:""
- },
- onLoad: function (options) {
- var that = this;
-
- wx.getSystemInfo({
- success (res) {
- console.log(res.windowHeight);
- that.setData({
- phoneHeight: res.windowHeight,
- })
- }
- })
-
- wx.getStorage({
- key: 'login',
- success(res){
- if (res.data === 200) {
- that.setData({
- login: false
- })
- } else {
- that.setData({
- login: true
- })
- }
- }
- })
-
- },
-
- 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,
- avatarUrl: e.detail.userInfo.avatarUrl,
- nickName: e.detail.userInfo.nickName
- })
- }
- })
- },
- phoneLogin:function(){
- wx.navigateTo({
- url: './phoneLogin/phoneLogin',
- });
- },
- gotoLogin(){
- wx.navigateTo({
- url: './phoneLogin/phoneLogin',
- });
- },
- openSwitch:function(){
- var that = this;
- that.setData({
- show:true
- })
- },
- close:function(){
- var that = this;
- that.setData({
- show:false
- })
- },
- chooseTimeOut:function(e){
- var that = this;
- console.log(e)
- that.setData({
- activeIndex:e.currentTarget.dataset.activeindex
- })
- }
- })
|