user.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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. this.setData({
  23. avatarUrl: wx.getStorageSync('avatarUrl'),
  24. nickName: wx.getStorageSync('nickName'),
  25. })
  26. // http('/user/info',infoOption).then(res => {
  27. // console.log(res);
  28. // this.setData({
  29. // avatarUrl: res.avatar,
  30. // nickName: res.name,
  31. // personalSignatrue: res.sign,
  32. // })
  33. // })
  34. },
  35. /**
  36. * 生命周期函数--监听页面初次渲染完成
  37. */
  38. onReady() {
  39. },
  40. /**
  41. * 生命周期函数--监听页面显示
  42. */
  43. onShow() {
  44. },
  45. /**
  46. * 生命周期函数--监听页面隐藏
  47. */
  48. onHide() {
  49. },
  50. /**
  51. * 生命周期函数--监听页面卸载
  52. */
  53. onUnload() {
  54. },
  55. /**
  56. * 页面相关事件处理函数--监听用户下拉动作
  57. */
  58. onPullDownRefresh() {
  59. },
  60. /**
  61. * 页面上拉触底事件的处理函数
  62. */
  63. onReachBottom() {
  64. },
  65. /**
  66. * 用户点击右上角分享
  67. */
  68. onShareAppMessage() {
  69. },
  70. changeBtn:function(){
  71. wx.navigateTo({
  72. url: '/pages/userchange/userchange',
  73. })
  74. },
  75. })