You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
hunjianghu/杨盼成/pages/start/start.js

57 lines
1.1 KiB

//login.js
//获取应用实例
var app = getApp();
Page({
data: {
remind: '加载中',
angle: 0,
userInfo: {}
},
goToIndex:function(){
if (app.globalData.isConnected) {
wx.switchTab({
url: '/pages/index/index',
});
} else {
wx.showToast({
title: '当前无网络',
icon: 'none',
})
}
},
onLoad:function(){
var that = this
wx.setNavigationBarTitle({
title: wx.getStorageSync('mallName')
})
},
onShow:function(){
let that = this
let userInfo = wx.getStorageSync('userInfo')
if (!userInfo) {
app.goLoginPageTimeOut()
} else {
that.setData({
userInfo: userInfo
})
}
},
onReady: function(){
var that = this;
setTimeout(function(){
that.setData({
remind: ''
});
}, 1000);
wx.onAccelerometerChange(function(res) {
var angle = -(res.x*30).toFixed(1);
if(angle>14){ angle=14; }
else if(angle<-14){ angle=-14; }
if(that.data.angle !== angle){
that.setData({
angle: angle
});
}
});
}
});