index.js 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. // pages/my/index.js
  2. const app = getApp()
  3. Page({
  4. /**
  5. * 页面的初始数据
  6. */
  7. data: {
  8. nvabarData: {
  9. showCapsule: 1, //是否显示左上角图标,消息中心 1表示显示 0表示不显示
  10. showBack: 0, //返回
  11. title: '我的', //导航栏 中间的标题
  12. // 此页面 页面内容距最顶部的距离
  13. height: app.globalData.height * 2 + 20,
  14. },
  15. active: 4,
  16. icon: {
  17. normal: '/pages/images/home.png',
  18. active: '/pages/images/home_fill.png',
  19. bankNormal: '/pages/images/duijie.png',
  20. bankActive: '/pages/images/duijie_fill.png',
  21. marketNormal: '/pages/images/recharge.png',
  22. marketActive: '/pages/images/recharge_fill.png',
  23. policyNormal: '/pages/images/news_hot.png',
  24. policyActive: '/pages/images/news_hot_fill.png',
  25. myNormal: '/pages/images/people.png',
  26. myActive: '/pages/images/people_fill.png',
  27. myicon1:'/pages/images/my_icon1.png',
  28. myicon2:'/pages/images/my_icon2.png',
  29. myicon3:'/pages/images/my_icon3.png',
  30. myicon4:'/pages/images/my_icon4.png'
  31. },
  32. },
  33. // 切换菜单
  34. onChange(event) {
  35. this.setData({
  36. active: event.detail
  37. });
  38. if (event.detail == 0) {
  39. wx.redirectTo({
  40. url: '/pages/home/index'
  41. })
  42. } else if (event.detail == 1) {
  43. wx.redirectTo({
  44. url: '/pages/bank/index'
  45. })
  46. } else if (event.detail == 2) {
  47. wx.redirectTo({
  48. url: '/pages/market/index'
  49. })
  50. } else if (event.detail == 3) {
  51. wx.redirectTo({
  52. url: '/pages/policy/index'
  53. })
  54. } else if (event.detail == 4) {
  55. wx.redirectTo({
  56. url: '/pages/my/index'
  57. })
  58. }
  59. },
  60. // 企业认证
  61. onattestation: function () {
  62. wx.navigateTo({
  63. url: '/pages/attestation/index'
  64. })
  65. },
  66. onAboutMe: function () {
  67. wx.navigateTo({
  68. url: '/pages/aboutme/index'
  69. })
  70. },
  71. // 我的融资
  72. myFinanceBtn: function () {
  73. wx.navigateTo({
  74. url: '/pages/myFinance/index'
  75. })
  76. },
  77. //贷款产品
  78. myloanprojuct: function () {
  79. wx.navigateTo({
  80. url: '/pages/myloanprojuct/index'
  81. })
  82. },
  83. // 密码修改
  84. onUpdatePass: function () {
  85. wx.navigateTo({
  86. url: '/pages/updatePassword/index'
  87. })
  88. },
  89. // 退出登录
  90. onGoout: function () {
  91. wx.removeStorage({
  92. key: 'user',
  93. success: function (res) {
  94. wx.showToast({
  95. title: '退出成功',
  96. icon: 'none',
  97. duration: 1500
  98. })
  99. },
  100. })
  101. wx.clearStorage()
  102. wx.navigateTo({
  103. url: '/pages/login/index'
  104. })
  105. },
  106. /**
  107. * 生命周期函数--监听页面加载
  108. */
  109. onLoad: function (options) {
  110. if (wx.getStorageSync('user') == "") {
  111. wx.redirectTo({
  112. url: '/pages/login/index'
  113. })
  114. } else {
  115. // wx.redirectTo({
  116. // url: '/pages/my/index'
  117. // })
  118. }
  119. },
  120. /**
  121. * 生命周期函数--监听页面初次渲染完成
  122. */
  123. onReady: function () {
  124. },
  125. /**
  126. * 生命周期函数--监听页面显示
  127. */
  128. onShow: function () {
  129. },
  130. /**
  131. * 生命周期函数--监听页面隐藏
  132. */
  133. onHide: function () {
  134. },
  135. /**
  136. * 生命周期函数--监听页面卸载
  137. */
  138. onUnload: function () {
  139. },
  140. /**
  141. * 页面相关事件处理函数--监听用户下拉动作
  142. */
  143. onPullDownRefresh: function () {
  144. },
  145. /**
  146. * 页面上拉触底事件的处理函数
  147. */
  148. onReachBottom: function () {
  149. },
  150. /**
  151. * 用户点击右上角分享
  152. */
  153. onShareAppMessage: function () {
  154. }
  155. })