diff --git a/pages/article/detail/index.js b/pages/article/detail/index.js index 6638217..80cb452 100644 --- a/pages/article/detail/index.js +++ b/pages/article/detail/index.js @@ -115,16 +115,16 @@ Page({ } this.data.keyboardHeight = Number(e.detail.height) wx.setStorageSync('keyboardHeight', this.data.keyboardHeight) - this.setData({ - inputBottom: e.detail.height - }) + this.setData({ inputBottom: e.detail.height }) }, inputBlur: function(e) { - this.setData({ - inputBottom: 0, focus: false - }) + this.setData({ inputBottom: 0, focus: false }) }, showComment: function(e) { + if(!app.globalData.userInfo){ + wx.navigateTo({ url: '/pages/login/index' }) + return + } if(this.data.keyboardHeight){ this.setData({ focus: true,inputBottom: this.data.keyboardHeight }) } else { @@ -150,6 +150,10 @@ Page({ }) }, likeComment: function(e){ + if(!app.globalData.userInfo){ + wx.navigateTo({ url: '/pages/login/index' }) + return + } var item = this.data.commentList[e.currentTarget.dataset.page][e.currentTarget.dataset.index] if(item.isLiked){ util.showToast('请勿重复点赞') @@ -173,6 +177,10 @@ Page({ }) }, likePost: function(){ + if(!app.globalData.userInfo){ + wx.navigateTo({ url: '/pages/login/index' }) + return + } if(this.data.momentDetail.isLiked){ util.showToast('请勿重复点赞') return diff --git a/utils/util.js b/utils/util.js index 88a5fa0..821282b 100644 --- a/utils/util.js +++ b/utils/util.js @@ -173,7 +173,6 @@ const tokenList = [ 'pages/mall/price-index/index', '/pages/article/price-detail/index', '/pages/article/queue-detail/index', - '/pages/article/detail/index', '/pages/shop/index/index', '/pages/bidding/index/index', '/pages/morder/index/index', @@ -186,8 +185,7 @@ const tokenList = [ '/pages/agent/order/index', '/pages/home/idcard/index', '/pages/shop/detail/index', - '/pages/article/publish/index', - 'pages/agent/factory/index' + '/pages/article/publish/index' ] function navigateTo(url){