index.js 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. import {
  2. ApiModel
  3. } from '../../../utils/api'
  4. const _Http = new ApiModel();
  5. Page({
  6. /**
  7. * 页面的初始数据
  8. */
  9. data: {
  10. userMsg: {}, //用户信息
  11. },
  12. /**
  13. * 生命周期函数--监听页面加载
  14. */
  15. onLoad: function (options) {
  16. },
  17. /* 跳转修改信息 */
  18. toUserMsg() {
  19. const data = JSON.stringify(this.data.userMsg)
  20. wx.navigateTo({
  21. url: '/pages/userMessage/index?data=' + data
  22. })
  23. },
  24. /**
  25. * 生命周期函数--监听页面初次渲染完成
  26. */
  27. onReady: function () {
  28. },
  29. /**
  30. * 生命周期函数--监听页面显示
  31. */
  32. onShow: function () {
  33. this.getTabBar().init();
  34. /* 获取个人信息 */
  35. _Http.basic({
  36. "accesstoken": wx.getStorageSync('token'),
  37. "classname": "customer.usercenter.usermsg.usermsg",
  38. "method": "query_usermsg",
  39. "content": {}
  40. }).then(s => {
  41. if (s.msg != "成功") return;
  42. this.setData({
  43. userMsg: s.data[0]
  44. })
  45. })
  46. },
  47. /**
  48. * 生命周期函数--监听页面隐藏
  49. */
  50. onHide: function () {
  51. },
  52. /**
  53. * 生命周期函数--监听页面卸载
  54. */
  55. onUnload: function () {
  56. },
  57. /**
  58. * 页面相关事件处理函数--监听用户下拉动作
  59. */
  60. onPullDownRefresh: function () {
  61. },
  62. /**
  63. * 页面上拉触底事件的处理函数
  64. */
  65. onReachBottom: function () {
  66. },
  67. /**
  68. * 用户点击右上角分享
  69. */
  70. onShareAppMessage: function () {
  71. }
  72. })