user.js 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. // pages/user/user.js
  2. const {http} = require("../../utils/util")
  3. var infoOption = {
  4. header:{
  5. "Authorization": wx.getStorageSync('token')
  6. },
  7. }
  8. Page({
  9. /**
  10. * 页面的初始数据
  11. */
  12. data: {
  13. avatarUrl:"https://img.js.design/assets/smartFill/img313164da746310.jpg",
  14. nickName:"Username",
  15. userWxID:"UserWxID",
  16. personalSignatrue:"编辑个性签名,展示我的独特态度"
  17. },
  18. /**
  19. * 生命周期函数--监听页面加载
  20. */
  21. onLoad(options) {
  22. // http('/user/info',infoOption).then(res => {
  23. // console.log(res);
  24. // this.setData({
  25. // avatarUrl: res.avatar,
  26. // nickName: res.name,
  27. // personalSignatrue: res.sign,
  28. // })
  29. // })
  30. },
  31. /**
  32. * 生命周期函数--监听页面初次渲染完成
  33. */
  34. onReady() {
  35. },
  36. /**
  37. * 生命周期函数--监听页面显示
  38. */
  39. onShow() {
  40. this.setData({
  41. avatarUrl: wx.getStorageSync('avatarUrl'),
  42. nickName: wx.getStorageSync('nickName'),
  43. personalSignatrue: wx.getStorageSync('personalSignatrue'),
  44. })
  45. },
  46. /**
  47. * 生命周期函数--监听页面隐藏
  48. */
  49. onHide() {
  50. },
  51. /**
  52. * 生命周期函数--监听页面卸载
  53. */
  54. onUnload() {
  55. },
  56. /**
  57. * 页面相关事件处理函数--监听用户下拉动作
  58. */
  59. onPullDownRefresh() {
  60. },
  61. /**
  62. * 页面上拉触底事件的处理函数
  63. */
  64. onReachBottom() {
  65. },
  66. /**
  67. * 用户点击右上角分享
  68. */
  69. onShareAppMessage() {
  70. },
  71. changeBtn:function(){
  72. wx.navigateTo({
  73. url: '/pages/userchange/userchange',
  74. })
  75. },
  76. })