index.js 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. // pages/noshop/index.js
  2. import * as API_Passport from '../../api/passport.js'
  3. import * as Common from '../../utils/common'
  4. const app=getApp()
  5. Page({
  6. /**
  7. * 页面的初始数据
  8. */
  9. data: {
  10. icon: {
  11. type: 'warn',
  12. color: '#ef473a'
  13. }
  14. },
  15. /**
  16. * 生命周期函数--监听页面加载
  17. */
  18. onLoad: function (options) {
  19. },
  20. /**
  21. * 生命周期函数--监听页面初次渲染完成
  22. */
  23. onReady: function () {
  24. },
  25. /**
  26. * 生命周期函数--监听页面显示
  27. */
  28. onShow: function () {
  29. },
  30. /**
  31. * 生命周期函数--监听页面隐藏
  32. */
  33. onHide: function () {
  34. },
  35. /**
  36. * 生命周期函数--监听页面卸载
  37. */
  38. onUnload: function () {
  39. },
  40. /**
  41. * 页面相关事件处理函数--监听用户下拉动作
  42. */
  43. onPullDownRefresh: function () {
  44. },
  45. /**
  46. * 页面上拉触底事件的处理函数
  47. */
  48. onReachBottom: function () {
  49. },
  50. /**
  51. * 用户点击右上角分享
  52. */
  53. onShareAppMessage: function () {
  54. },
  55. goApplayShop(e) {
  56. wx.redirectTo({
  57. url: '/pages/shop/shop-apply',
  58. })
  59. },
  60. logout(e){
  61. API_Passport.logout({'uid':app.globalData.authorInfo.uid}).then(res=>{
  62. wx.removeStorageSync('authorInfo')
  63. wx.removeStorageSync('sellerUser')
  64. wx.removeStorageSync('sellerShop')
  65. wx.removeStorageSync('login_result')
  66. app.globalData.authorInfo = {}
  67. app.globalData.sellerUser = {}
  68. app.globalData.sellerShop = {}
  69. //退出登录 会清除redis授权缓存,自动登录一下,把redis授权重新写入,以防用户又直接登录
  70. Common.toAutoLogin()
  71. })
  72. }
  73. })