(prefix = "签到信息")
| 245 | } |
| 246 | |
| 247 | async querySign(prefix = "签到信息") { |
| 248 | const res = await this.api( |
| 249 | "POST", |
| 250 | "activityservice/api/sign2025/getlist", |
| 251 | { rule_id: 1, time: this.currentMonthFirstDay(), goods_rule_id: 1 }, |
| 252 | true |
| 253 | ); |
| 254 | if (Number(res?.errcode) !== 200) { |
| 255 | $.log(`${prefix}:查询失败 ${short(res)}`); |
| 256 | return; |
| 257 | } |
| 258 | this.signInfo = res.data || {}; |
| 259 | const today = String(this.signInfo.time || "").replace(/T/g, " ").slice(0, 10); |
| 260 | const signedDays = Array.isArray(this.signInfo.list) ? this.signInfo.list.length : firstValue(this.signInfo.sign_day, 0); |
| 261 | const todaySigned = Array.isArray(this.signInfo.list) |
| 262 | ? this.signInfo.list.some((item) => String(item.sign_time || "").slice(0, 10) === today) |
| 263 | : ""; |
| 264 | const status = todaySigned === "" ? "" : todaySigned ? ",今日已签" : ",今日未签"; |
| 265 | $.log(`${prefix}:日期=${today || "未知"},本月已签=${signedDays}${status}`); |
| 266 | } |
| 267 | |
| 268 | async sign() { |
| 269 | const res = await this.api("POST", "activityservice/api/sign2025/sign", { rule_id: 1, goods_rule_id: 1 }, true); |
no test coverage detected