()
| 449 | } |
| 450 | //领取解锁等级奖励(京豆) |
| 451 | function getGrowthReward() { |
| 452 | return new Promise(async resolve => { |
| 453 | const body = { "paramData":{"eventType":"GROWTH_REWARD"} }; |
| 454 | $.get(taskUrl('crazyJoy_event_getGrowthAndSceneState', JSON.stringify(body)), async (err, resp, data) => { |
| 455 | try { |
| 456 | if (err) { |
| 457 | console.log(`${JSON.stringify(err)}`) |
| 458 | console.log(`${$.name} API请求失败,请检查网路重试`) |
| 459 | } else { |
| 460 | if (safeGet(data)) { |
| 461 | data = JSON.parse(data); |
| 462 | if (data['resultCode'] === '0') { |
| 463 | if (data.data) { |
| 464 | for (let item of data.data) { |
| 465 | if (item.status === 1) { |
| 466 | if (item.eventRecordId) await obtainAward(item.eventRecordId); |
| 467 | } |
| 468 | } |
| 469 | if ($.GROWTH_REWARD_BEAN > 0) { |
| 470 | message += `解锁等级奖励:获得${$.GROWTH_REWARD_BEAN}京豆\n`; |
| 471 | } |
| 472 | } |
| 473 | } |
| 474 | } |
| 475 | } |
| 476 | } catch (e) { |
| 477 | $.logErr(e, resp) |
| 478 | } finally { |
| 479 | resolve(); |
| 480 | } |
| 481 | }) |
| 482 | }) |
| 483 | } |
| 484 | //获取特殊JOY情况 |
| 485 | function getSpecialJoy() { |
| 486 | return new Promise(async resolve => { |
no test coverage detected