| 425 | } |
| 426 | |
| 427 | function getCoin() { |
| 428 | return new Promise(async resolve => { |
| 429 | $.get(taskUrl('crazyJoy_joy_produce'), async (err, resp, data) => { |
| 430 | try { |
| 431 | if (err) { |
| 432 | console.log(`${JSON.stringify(err)}`) |
| 433 | console.log(`${$.name} API请求失败,请检查网路重试`) |
| 434 | } else { |
| 435 | if (safeGet(data)) { |
| 436 | data = JSON.parse(data); |
| 437 | if (data.data && data.data.totalCoinAmount) { |
| 438 | $.coin = data.data.totalCoinAmount; |
| 439 | } |
| 440 | } |
| 441 | } |
| 442 | } catch (e) { |
| 443 | $.logErr(e, resp) |
| 444 | } finally { |
| 445 | resolve(); |
| 446 | } |
| 447 | }) |
| 448 | }) |
| 449 | } |
| 450 | //领取解锁等级奖励(京豆) |
| 451 | function getGrowthReward() { |
| 452 | return new Promise(async resolve => { |