(id)
| 418 | }); |
| 419 | } |
| 420 | function lottery(id) { |
| 421 | return new Promise(async (resolve) => { |
| 422 | const options = taskPostUrl('task/lottery', 'lottery', `starId=${$.activeId}&id=${id}`); |
| 423 | $.post(options, (err, resp, data) => { |
| 424 | try { |
| 425 | if (err) { |
| 426 | console.log(`${JSON.stringify(err)}`); |
| 427 | console.log(`${$.name} API请求失败,请检查网路重试`); |
| 428 | } else { |
| 429 | data = JSON.parse(data); |
| 430 | if (data && data.code === 200) { |
| 431 | if (data.data && data.data.status === 1) { |
| 432 | console.log(`京东账号${$.index} ${$.nickName || $.UserName}恭喜中奖\n【${$.activeId}】星推官抽奖详情${JSON.stringify(data)}\n`); |
| 433 | } else { |
| 434 | console.log(`【${$.activeId}】星推官抽奖:未中奖\n`) |
| 435 | } |
| 436 | } |
| 437 | } |
| 438 | } catch (e) { |
| 439 | $.logErr(e, resp); |
| 440 | } finally { |
| 441 | resolve(); |
| 442 | } |
| 443 | }); |
| 444 | }); |
| 445 | } |
| 446 | function TotalBean() { |
| 447 | return new Promise(async (resolve) => { |
| 448 | const options = { |
no test coverage detected