1234567891011121314151617181920212223242526272829303132333435363738394041 |
- const app = getApp();
- Page({
- data: {
- images: {
- background: '/static_file/background.png'
- },
- userInfo: {
- name: '',
- id: '',
- address: ''
- }
- },
-
- // 页面加载时执行
- onLoad: function(options) {
- this.updateUserInfo();
- },
-
- onShow: function() {
- this.updateUserInfo();
- },
-
- // 更新用户信息的方法
- updateUserInfo: function() {
- this.setData({
- userInfo: {
- name: app.globalData.currentAccountInfo.username,
- id: app.globalData.currentAccountInfo.usernumber,
- address: app.globalData.currentAccountInfo.address
- }
- });
- },
-
- // 导航到指定页面
- navigateTo: function(e) {
- const url = e.currentTarget.dataset.url;
- wx.navigateTo({
- url: url
- });
- }
- })
|