You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

57 lines
1.2 KiB

// pages/order/index.js
Page({
// 分享给朋友/群聊
onShareAppMessage() {
return {
title: '鸡蛋贸易平台 - 我的订单',
path: '/pages/order/index',
imageUrl: '/images/你有好蛋.png'
}
},
// 分享到朋友圈
onShareTimeline() {
return {
title: '鸡蛋贸易平台 - 我的订单',
query: '',
imageUrl: '/images/你有好蛋.png'
}
},
data: {
userInfo: {},
orders: []
},
onLoad() {
// 页面加载时的初始化逻辑
this.loadUserInfo();
},
onShow() {
// 页面显示时的逻辑
this.loadUserInfo();
// 更新自定义tabBar状态
if (typeof this.getTabBar === 'function' && this.getTabBar()) {
this.getTabBar().setData({
selected: 4 // 保持与个人中心相同的选中状态
});
}
},
// 加载用户信息
loadUserInfo() {
const app = getApp();
if (app.globalData.userInfo) {
this.setData({ userInfo: app.globalData.userInfo });
} else {
const localUserInfo = wx.getStorageSync('userInfo') || {};
this.setData({ userInfo: localUserInfo });
}
},
// 返回上一页
goBack() {
wx.navigateBack();
}
})