mine.ts 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. // pages/mine/mine.ts
  2. import Dialog from '@vant/weapp/dialog/dialog';
  3. Page({
  4. /**
  5. * 页面的初始数据
  6. */
  7. data: {
  8. // 功能菜单项
  9. menulists: [{id: 1, title: '我的库存', img: 'medal', path: '/mMine/pages/myinventorys/list/list'},
  10. {id: 2, title: "我的订单", img: 'invitation', path: '/mMine/pages/myorders/list/list'},
  11. {id: 3, title: '我的履约', img: 'underway', path: '/mMine/pages/myperformance/list/list'},
  12. {id: 4, title: '我的出境', img: 'hot', path: '/mHome/pages/inspection/list/list'},
  13. {id: 5, title: '我的保税', img: 'fire-o', path: '/mHome/pages/bond/list/list'}],
  14. // 列表菜单项
  15. tablelists: [{id: 1, title: '签约账户', path: '/mMine/pages/bank/bankh'},
  16. {id: 2, title: '收货地址', path: '/mMine/pages/address/list/list'},
  17. {id: 3, title: '发票信息', path: '/mMine/pages/invoice/list/list'},
  18. {id: 4, title: '账户安全', path: ''},
  19. {id: 5, title: '关于我们', path: '/mMine/pages/about/about/about'}],
  20. /// 微信头像
  21. avatarUrl: "",
  22. /// 微信昵称
  23. nickName: ""
  24. },
  25. /**
  26. * 进入系统设置
  27. */
  28. goToSettings() {
  29. wx.navigateTo({
  30. url: '/mMine/pages/settings/settings'
  31. })
  32. },
  33. /**
  34. * 生命周期函数--监听页面加载
  35. */
  36. onLoad() {
  37. /// 获取微信头像
  38. let url = wx.getStorageSync('avatarUrl')
  39. if (url) {
  40. this.setData({
  41. avatarUrl: url
  42. })
  43. }
  44. },
  45. /**
  46. * 系统登出响应
  47. */
  48. onLoginOut() {
  49. Dialog.confirm({
  50. title: '提示',
  51. message: '确定要退出系统吗?',
  52. }).then(() => {
  53. /// 清楚所有的缓存数据
  54. wx.clearStorage()
  55. /// loding....
  56. wx.showLoading({
  57. title: '登出中....'
  58. })
  59. /// 登出
  60. setTimeout(function () {
  61. wx.hideLoading()
  62. // on confirm
  63. wx.reLaunch({ url: '/pages/login/login' })
  64. }, 2000)
  65. }).catch(() => {
  66. // on cancel
  67. });
  68. },
  69. /**
  70. * 生命周期函数--监听页面初次渲染完成
  71. */
  72. onReady() {
  73. },
  74. /**
  75. * 生命周期函数--监听页面显示
  76. */
  77. onShow() {
  78. this.getTabBar().init()
  79. },
  80. /**
  81. * 生命周期函数--监听页面隐藏
  82. */
  83. onHide() {
  84. },
  85. /**
  86. * 生命周期函数--监听页面卸载
  87. */
  88. onUnload() {
  89. },
  90. /**
  91. * 页面相关事件处理函数--监听用户下拉动作
  92. */
  93. onPullDownRefresh() {
  94. },
  95. /**
  96. * 页面上拉触底事件的处理函数
  97. */
  98. onReachBottom() {
  99. },
  100. /**
  101. * 用户点击右上角分享
  102. */
  103. onShareAppMessage() {
  104. }
  105. })