MCPcopy Index your code
hub / github.com/smallfawn/QLScriptPublic / getLotteryNum

Method getLotteryNum

wxapp/haitian.js:439–455  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

437 }
438
439 async getLotteryNum() {
440 try {
441 const result = await this.request("/lucky/activity/opporturnity", {
442 params: { activityCode: `jfcj${this.activity_code}` },
443 });
444 if (result?.can_use > 0) {
445 $.log(`当前剩余抽奖次数:${result.can_use}`);
446 for (let can = 0; can < result.can_use; can++) {
447 await this.doLottery();
448 }
449 } else {
450 $.log("当前剩余抽奖次数0");
451 }
452 } catch (e) {
453 $.log(`查询抽奖次数失败:${e.message || e}`);
454 }
455 }
456}
457
458!(async () => {

Callers 1

runMethod · 0.95

Calls 3

requestMethod · 0.95
doLotteryMethod · 0.95
logMethod · 0.45

Tested by

no test coverage detected