me.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. import http from '../../base/httputil'
  2. const app = getApp()
  3. Page({
  4. /**
  5. * 页面的初始数据
  6. */
  7. data: {
  8. isShowAccoutDialog : false,
  9. isBindSuccess : false,
  10. userName :'未登录',
  11. password: null,
  12. openid: null
  13. },
  14. onLoad(e){
  15. this.setData({
  16. isBindSuccess : app.isLoginSuccess,
  17. // userName:
  18. })
  19. if(app.isLoginSuccess){
  20. this.data.userName=wx.getStorageSync('userName')
  21. this.setData({
  22. userName:this.data.userName
  23. })
  24. }
  25. },
  26. onShow() {
  27. },
  28. inputUserName(e){
  29. this.userName = e.detail.value
  30. },
  31. inputPassword(e){
  32. this.password = e.detail.value
  33. },
  34. isLogin(){
  35. if(!app.isLoginSuccess){
  36. wx.reLaunch({
  37. url: '../denglu/denglu',
  38. })
  39. }else{
  40. wx.showModal({
  41. title: '提示',
  42. content: '确认退出?',
  43. complete: (res) => {
  44. if (res.cancel) {
  45. }
  46. if (res.confirm) {
  47. this.clear()
  48. }
  49. }
  50. })
  51. }
  52. },
  53. /**
  54. * 生命周期函数--监听页面初次渲染完成
  55. */
  56. onReady() {
  57. },
  58. /**
  59. * 生命周期函数--监听页面隐藏
  60. */
  61. onHide() {
  62. },
  63. /**
  64. * 生命周期函数--监听页面卸载
  65. */
  66. onUnload() {
  67. },
  68. /**
  69. * 页面相关事件处理函数--监听用户下拉动作
  70. */
  71. onPullDownRefresh() {
  72. },
  73. /**
  74. * 页面上拉触底事件的处理函数
  75. */
  76. onReachBottom() {
  77. },
  78. /**
  79. * 用户点击右上角分享
  80. */
  81. onShareAppMessage() {
  82. },
  83. })