|
hace 1 día | |
---|---|---|
.. | ||
README.md | hace 1 día | |
index.js | hace 1 día | |
index.json | hace 1 día | |
index.wxml | hace 1 día | |
index.wxss | hace 1 día |
签到页面是一个功能完整的每日签到系统,支持日历显示、签到记录和积分任务管理。
checkin_YYYY_MM
(如:checkin_2025_1
)// 本地存储键名格式
const storageKey = `checkin_${year}_${month}`;
// 存储数据格式(数组)
const checkedDates = [1, 3, 5, 8, 12]; // 已签到的日期
// 获取当月第一天是星期几
const firstDay = new Date(year, month, 1).getDay();
const adjustedFirstDay = firstDay === 0 ? 7 : firstDay; // 周日从0调整为7
// 获取当月天数
const daysInMonth = new Date(year, month + 1, 0).getDate();
// 签到接口(已预留)
App._post_form(
'checkin/dailyCheckin',
'application/json',
{
userId: userId,
date: '2025-01-15'
},
callback
);
// 获取签到历史接口(已预留)
App._post_form(
'checkin/getMonthlyHistory',
'application/json',
{
userId: userId,
year: 2025,
month: 1
},
callback
);
// app.json 中已注册
"pages": [
"pages/checkin/index",
// ... 其他页面
]
onLoad
→ 加载签到历史 → 初始化日历 → 获取用户信息onShow
→ 重新加载签到状态 → 刷新日历显示onPullDownRefresh
→ 手动刷新所有数据签到页面现已完全实现,具备完整的功能和良好的用户体验!