| 307 | } |
| 308 | |
| 309 | async activityPush(activityId, label) { |
| 310 | const res = await this.gql( |
| 311 | `mutation activity($activity_id: Int!) { |
| 312 | activityPush(id: $activity_id) { |
| 313 | code |
| 314 | message |
| 315 | reward_log { |
| 316 | action |
| 317 | reward_type |
| 318 | amount |
| 319 | balance |
| 320 | } |
| 321 | } |
| 322 | }`, |
| 323 | { activity_id: Number(activityId) }, |
| 324 | this.token, |
| 325 | true |
| 326 | ); |
| 327 | const result = res?.data?.activityPush; |
| 328 | if (!result) return `${label}失败: ${short(res)}`; |
| 329 | if (Number(result.code) === 0) { |
| 330 | const log = result.reward_log || {}; |
| 331 | return `${label}成功:${log.action || label} +${log.amount ?? 0}米豆,余额=${log.balance ?? "未知"}`; |
| 332 | } |
| 333 | return `${label}失败:${result.message || short(result)}`; |
| 334 | } |
| 335 | |
| 336 | async doSign() { |
| 337 | if (!this.checkIn) return "未找到签到任务"; |