MCPcopy Create free account
hub / github.com/smallfawn/QLScriptPublic / getSignedState

Method getSignedState

wxapp/jingjianx_all.js:538–579  ·  view source on GitHub ↗
(reward, progress)

Source from the content-addressed store, hash-verified

536 }
537
538 getSignedState(reward, progress) {
539 const signType = Number(reward.signCycle || 0);
540 const signMode = Number(reward.signMode || 1);
541
542 if (signType === 0) {
543 return {
544 signType,
545 signMode,
546 signed: !progress.isSigning,
547 currentDay: progress.signInDays || 0,
548 apiPath: "/signed/capp/signed/confirm",
549 };
550 }
551
552 if (signMode === 2 && progress.totalDay) {
553 return {
554 signType,
555 signMode,
556 signed: !progress.totalDay.isSigning,
557 currentDay: progress.totalDay.signInDays || 0,
558 apiPath: "/signed/capp/signed/newconfirm",
559 };
560 }
561
562 if (signMode === 3 && Array.isArray(progress.dailyDay)) {
563 return {
564 signType,
565 signMode,
566 signed: progress.dailyDay.some((item) => isToday(item.signDate)),
567 currentDay: progress.dailyDay.length,
568 apiPath: "/signed/capp/signed/newconfirm",
569 };
570 }
571
572 return {
573 signType,
574 signMode,
575 signed: progress.totalDay ? !progress.totalDay.isSigning : false,
576 currentDay: progress.totalDay?.signInDays || 0,
577 apiPath: "/signed/capp/signed/newconfirm",
578 };
579 }
580
581 async sign() {
582 try {

Callers 1

signMethod · 0.95

Calls 1

isTodayFunction · 0.85

Tested by

no test coverage detected