feat: 祈福小助手万年历小程序第一期
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
const { getTodayInfo, getAlmanacInfo } = require('../../utils/core/index.js');
|
||||
|
||||
Page({
|
||||
data: {
|
||||
dayInfo: {},
|
||||
almanac: {}
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
this.loadData();
|
||||
},
|
||||
|
||||
onPullDownRefresh() {
|
||||
this.loadData();
|
||||
wx.stopPullDownRefresh();
|
||||
},
|
||||
|
||||
loadData() {
|
||||
const dayInfo = getTodayInfo();
|
||||
const almanac = getAlmanacInfo(dayInfo.solarYear, dayInfo.solarMonth, dayInfo.solarDay);
|
||||
this.setData({ dayInfo, almanac });
|
||||
},
|
||||
|
||||
navTo(e) {
|
||||
const url = e.currentTarget.dataset.url;
|
||||
wx.navigateTo({ url });
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user