diff --git a/components/refresher/index.wxml b/components/refresher/index.wxml index 0845207..f1eabeb 100644 --- a/components/refresher/index.wxml +++ b/components/refresher/index.wxml @@ -6,5 +6,4 @@ {{ _state }} - \ No newline at end of file diff --git a/pages/article/hot-index/index.wxml b/pages/article/hot-index/index.wxml index e10349b..5c9f963 100644 --- a/pages/article/hot-index/index.wxml +++ b/pages/article/hot-index/index.wxml @@ -1,4 +1,3 @@ - - + - + diff --git a/pages/article/index/index.js b/pages/article/index/index.js index e8d562d..a13a212 100644 --- a/pages/article/index/index.js +++ b/pages/article/index/index.js @@ -1,5 +1,6 @@ // pages/stock/index.js const request = require('../../../utils/request') //导入模块 +const util = require('../../../utils/util') const app = getApp() Component({ @@ -12,6 +13,7 @@ Component({ */ data: { height: app.globalData.safeFragmentHeight - 190, + safeBottom: app.globalData.safeBottom, firstShow: false, tabList: [ '热门', '纸品价格', '车辆排队', '纸厂扣点' ], tabIndex: 0 @@ -23,7 +25,7 @@ Component({ fragment.onRestart() } if (!this.data.firstShow) { - this.setData({ height: app.globalData.safeFragmentHeight - 190, tabList: this.data.tabList}) + this.setData({ height: app.globalData.safeFragmentHeight - 190, tabList: this.data.tabList, safeBottom: app.globalData.safeBottom}) // request.get('/information-center/article-category/get/article-category-list').then(result => { // for (let index = 0; index < result.data.length; index++) { // this.data.tabList[index + 1] = result.data[index].name @@ -44,6 +46,9 @@ Component({ }, stopTouchMove: function(e){ return false + }, + postMoment: function(){ + util.navigateTo('/pages/article/publish/index') } } }) \ No newline at end of file diff --git a/pages/article/index/index.wxml b/pages/article/index/index.wxml index 4289579..9bd745e 100644 --- a/pages/article/index/index.wxml +++ b/pages/article/index/index.wxml @@ -3,9 +3,6 @@ 情报 - @@ -15,4 +12,10 @@ - \ No newline at end of file + + + + + + + \ No newline at end of file diff --git a/pages/article/index/index.wxss b/pages/article/index/index.wxss index efef51c..8fac637 100644 --- a/pages/article/index/index.wxss +++ b/pages/article/index/index.wxss @@ -3,7 +3,6 @@ width: calc(100% - 20px); background-color: #008AFF; position: fixed; - bottom: 150px; left: 25px; } diff --git a/pages/home/index/index.js b/pages/home/index/index.js index 4abbfa4..b29513b 100644 --- a/pages/home/index/index.js +++ b/pages/home/index/index.js @@ -16,8 +16,7 @@ Component({ data: { height: app.globalData.safeFragmentHeight, firstShow: false, - token: app.globalData.userToken, - userInfo: {}, + userInfo: null, avatarUrl: '/assets/image/ygImg.png', accountMoney: 0, messageNumber: 0 @@ -25,7 +24,6 @@ Component({ lifetimes: { // 生命周期函数,可以为函数,或一个在methods段中定义的方法名 attached: function () { - event.on('EventMessage', this, this.onEvent) }, detached: function () { @@ -42,9 +40,8 @@ Component({ this.data.firstShow = true }, onEvent: function (message) { - console.log('home>>index>>onEvent', message) - if (message.what == 82) { - // 认证成功 + if (message.what == 888) { + this.setData({ userInfo: app.globalData.userInfo, accountMoney: 0, messageNumber: 0, avatarUrl: '/assets/image/ygImg.png' }) } }, fetchUserInfo: function () { diff --git a/pages/home/setting/index.js b/pages/home/setting/index.js index 28605e4..32cb7ab 100644 --- a/pages/home/setting/index.js +++ b/pages/home/setting/index.js @@ -1,6 +1,6 @@ // pages/home/setting/index.js import { $wuxDialog } from '../../../components/index' -const event = require('../../../utils/event.js') +const event = require('../../../utils/event') const app = getApp() Page({ @@ -51,17 +51,12 @@ Page({ onTap(e) { wx.removeStorageSync('accessToken') wx.removeStorageSync('Authorization') - wx.reLaunch({ - url: '/pages/login/index' - }) + app.globalData.token = null + app.globalData.userInfo = null + event.emit('EventMessage', { what: 888, desc: 'Logout' }) + wx.navigateBack() } }] }) - - // wx.requestSubscribeMessage({ - // tmplIds: app.tmplIds, - // complete(res) { - // } - // }) } }) \ No newline at end of file