|
@@ -9,6 +9,7 @@ Page({
|
|
userInfo: {
|
|
userInfo: {
|
|
avatarUrl:"../../images/person.png"
|
|
avatarUrl:"../../images/person.png"
|
|
},
|
|
},
|
|
|
|
+ loginif:false
|
|
},
|
|
},
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -16,6 +17,15 @@ Page({
|
|
*/
|
|
*/
|
|
onLoad: function (options) {
|
|
onLoad: function (options) {
|
|
console.log(app.globalData);
|
|
console.log(app.globalData);
|
|
|
|
+ if(wx.getStorageSync('openid')){
|
|
|
|
+ this.setData({
|
|
|
|
+ loginif:true
|
|
|
|
+ })
|
|
|
|
+ }else{
|
|
|
|
+ this.setData({
|
|
|
|
+ loginif:false
|
|
|
|
+ })
|
|
|
|
+ }
|
|
if (app.globalData.userInfo) {
|
|
if (app.globalData.userInfo) {
|
|
this.setData({
|
|
this.setData({
|
|
userInfo: app.globalData.userInfo,
|
|
userInfo: app.globalData.userInfo,
|
|
@@ -39,6 +49,11 @@ Page({
|
|
})
|
|
})
|
|
};
|
|
};
|
|
},
|
|
},
|
|
|
|
+ login:function(){
|
|
|
|
+ wx.navigateTo ({
|
|
|
|
+ url: '/pages/auth/auth',
|
|
|
|
+ })
|
|
|
|
+ },
|
|
getUserInfo: function(e) {
|
|
getUserInfo: function(e) {
|
|
//点击取消按钮
|
|
//点击取消按钮
|
|
if (e.detail.userInfo == null) {
|
|
if (e.detail.userInfo == null) {
|
|
@@ -65,7 +80,7 @@ Page({
|
|
* 生命周期函数--监听页面显示
|
|
* 生命周期函数--监听页面显示
|
|
*/
|
|
*/
|
|
onShow: function () {
|
|
onShow: function () {
|
|
-
|
|
|
|
|
|
+ this.onLoad()
|
|
},
|
|
},
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -103,9 +118,17 @@ Page({
|
|
|
|
|
|
},
|
|
},
|
|
gotoAttention(){
|
|
gotoAttention(){
|
|
- wx.navigateTo({
|
|
|
|
- url: '../attention/attention',
|
|
|
|
- })
|
|
|
|
|
|
+ if(wx.getStorageSync('openid')){
|
|
|
|
+ wx.navigateTo({
|
|
|
|
+ url: '../attention/attention',
|
|
|
|
+ })
|
|
|
|
+ }else{
|
|
|
|
+ wx.showLoading({title: '请先授权登录'})
|
|
|
|
+ setTimeout(function(){
|
|
|
|
+ wx.hideLoading()
|
|
|
|
+ },600);
|
|
|
|
+ }
|
|
|
|
+
|
|
},
|
|
},
|
|
gotoAbout(){
|
|
gotoAbout(){
|
|
wx.showToast({
|
|
wx.showToast({
|