| 298 | } |
| 299 | |
| 300 | async queryCalendar(prefix = "签到状态") { |
| 301 | const data = await this.mapApi("/activity/v1/checkin/calendar", { |
| 302 | activity_id: ACTIVITY_ID, |
| 303 | game_id: 1, |
| 304 | rule_id: "tencent_map_checkin", |
| 305 | }); |
| 306 | const today = data.calendar?.[this.todayKey()] || {}; |
| 307 | const prizes = Array.isArray(today.prizes) |
| 308 | ? today.prizes.map((item) => `${item.name || item.type || "奖励"}:${item.amount ?? ""}`).join(",") |
| 309 | : ""; |
| 310 | $.log(`${prefix}:今日${today.checkin ? "已签" : "未签"},周期已签=${data.checkin_days || 0}/${data.period || 0}${prizes ? `,奖励=${prizes}` : ""}`); |
| 311 | return { data, today }; |
| 312 | } |
| 313 | |
| 314 | async checkin() { |
| 315 | const { today } = await this.queryCalendar("签到前"); |