Publish Mini Program Dev Version / publish (push) Successful in 1m8s
- 个人中心仅保留登录管理、我的数据/功能菜单与关于信息 - 新增偏好设置二级页 preferences(原偏好设置统一收敛至此) - 新增我的收藏二级页 bookmarks,支持删除与跳转日详情 - 生辰管理拆分为二级页 birth-profiles,未登录时提示引导登录 - 八字页入口改为直达生辰管理页;修复 fortune 非 tabBar 页误用 switchTab
29 lines
691 B
JavaScript
29 lines
691 B
JavaScript
Page({
|
|
data: {
|
|
bookmarks: []
|
|
},
|
|
|
|
onShow() {
|
|
this.loadBookmarks();
|
|
},
|
|
|
|
loadBookmarks() {
|
|
const bookmarks = wx.getStorageSync('lunar-bookmarks') || [];
|
|
this.setData({ bookmarks });
|
|
},
|
|
|
|
removeBookmark(e) {
|
|
const date = e.currentTarget.dataset.date;
|
|
const bookmarks = this.data.bookmarks.filter(b => b.date !== date);
|
|
wx.setStorageSync('lunar-bookmarks', bookmarks);
|
|
this.setData({ bookmarks });
|
|
wx.showToast({ title: '已删除', icon: 'success' });
|
|
},
|
|
|
|
// 点击收藏项跳转到当日详情
|
|
openDetail(e) {
|
|
const date = e.currentTarget.dataset.date;
|
|
wx.navigateTo({ url: `/pages/day-detail/day-detail?date=${date}` });
|
|
}
|
|
});
|