diff --git a/pages/topics/index.js b/pages/topics/index.js index 302060a..ee4b634 100644 --- a/pages/topics/index.js +++ b/pages/topics/index.js @@ -23,9 +23,9 @@ Page({ /** * 生命周期函数--监听页面加载 */ - + onLoad: function () { - if (!store.hasPhone()) { + if (store.hasPhone()) { console.log('已经绑定手机号码') } else { console.log('未绑定手机号码') @@ -39,7 +39,7 @@ Page({ console.log('啦啦啦') this.fetchTopicList(); }, - fetchTopicList() { + fetchTopicList () { let page = this.data.currPage topicModel.getTopicList(page, res => { console.log('议题列表') @@ -82,10 +82,10 @@ Page({ wx.stopPullDownRefresh() }) }, - onRefreshList() { + onRefreshList () { this.fetchGoodIdeaList() }, - fetchGoodIdeaList() { + fetchGoodIdeaList () { let page = this.data.currPage topicModel.goldenList(page, res => { console.log('金点子列表') diff --git a/pages/user/index.js b/pages/user/index.js index e76ece6..fff2c37 100644 --- a/pages/user/index.js +++ b/pages/user/index.js @@ -27,7 +27,15 @@ Page({ * 生命周期函数--监听页面加载 */ onLoad: function (options) { - this.getUserInfo() + if (store.hasPhone()) { + console.log('已经绑定手机号码') + this.getUserInfo() + } else { + console.log('未绑定手机号码') + wx.redirectTo({ + url: '/pages/register/index', + }) + } }, isAuthUserInfo () { let that = this @@ -105,7 +113,7 @@ Page({ store.saveUserInfo({ nickName: res.result.nickName, avatarUrl: res.result.avatarUrl, - phone: res.result.phone === null ? '' : res.result.phone + phone: res.result.phone || '' }) } else { console.log('未授权') diff --git a/pages/user/index.wxml b/pages/user/index.wxml index 6245c1c..d04b769 100644 --- a/pages/user/index.wxml +++ b/pages/user/index.wxml @@ -9,10 +9,10 @@ - + - + 请升级微信版本 diff --git a/pages/user/index.wxss b/pages/user/index.wxss index d5c7e12..26f00ae 100644 --- a/pages/user/index.wxss +++ b/pages/user/index.wxss @@ -22,8 +22,7 @@ display: flex; flex-direction: row; align-items: center; - overflow: hidden; - justify-content: space-between; + justify-content: center; } .user_logo { width: 80px; @@ -66,8 +65,4 @@ overflow: hidden; } .authBtn{ - margin-right:10px; - margin: 0; - /* width: 100px; */ - flex-wrap: nowrap; } \ No newline at end of file diff --git a/utils/http.js b/utils/http.js index c52761d..615555c 100644 --- a/utils/http.js +++ b/utils/http.js @@ -30,7 +30,7 @@ class HTTP { 'content-type': 'application/json', } console.log(header) - console.log(data) + console.log(data || {}) wx.request({ url: url, data: data,