Browse Source

首页设置按钮变为登出按钮

release
liushaowen 5 years ago
parent
commit
759c7c16c0
  1. BIN
      images/logout.png
  2. 19
      pages/index/index.js
  3. 3
      pages/index/index.wxml

BIN
images/logout.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 726 B

19
pages/index/index.js

@ -432,6 +432,25 @@ Page({
url: '/subpages/monthlyReport/pages/monthlyIndex/monthlyIndex?monthlyType=publish'
})
}
},
logout(){
api.logout().then(function (res) {
// $wuxToast().show({
// type: 'text',
// duration: 3000,
// color: '#fff',
// text: '退出成功',
// success: () => console.log('')
// })
console.log(wx.getStorageSync('token') + "************" + wx.getStorageSync('userTagKey'))
wx.setStorageSync('token', '')
wx.setStorageSync('userTagKey', '')
wx.setStorageSync('currentGrid', '')
console.log(wx.getStorageSync('token') + "************" + wx.getStorageSync('userTagKey'))
wx.reLaunch({
url: '../../pages/login/login'
})
})
}
})

3
pages/index/index.wxml

@ -5,7 +5,8 @@
<image src="/images/banner.png" class="banner-bg" mode="widthFix" />
<view class="info">
<view class="name">{{curGridName}}</view>
<image bindtap="toSetUp" class="icon icon-right-1" src="/images/shezhi.png"></image>
<!-- <image bindtap="toSetUp" class="icon icon-right-1" src="/images/shezhi.png"></image> -->
<image bindtap="logout" class="icon icon-right-1" src="/images/logout.png"></image>
<image bindtap="toNotice" wx:if="{{notice == 0}}" class="icon icon-right-2" src="/images/notice.png"></image>
<image bindtap="toNotice" wx:else class="icon icon-right-2" src="/images/notice-xz.png"></image>
</view>

Loading…
Cancel
Save