mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2026-03-25 05:29:45 +08:00
✨首页添加游戏签到组件,支持补签 (#182)
* Initial plan * Add sign-in card component to homepage Co-authored-by: BTMuli <72692909+BTMuli@users.noreply.github.com> * Fix v-icon usage in sign-in card buttons Co-authored-by: BTMuli <72692909+BTMuli@users.noreply.github.com> * Fix: Merge new home components into existing localStorage Co-authored-by: BTMuli <72692909+BTMuli@users.noreply.github.com> * Refactor: Remove redundant code in getShowItems Co-authored-by: BTMuli <72692909+BTMuli@users.noreply.github.com> * Add error handling for localStorage parsing Co-authored-by: BTMuli <72692909+BTMuli@users.noreply.github.com> * Redesign sign-in card to show multiple game accounts with compact UI Co-authored-by: BTMuli <72692909+BTMuli@users.noreply.github.com> * Fix reward item spacing with flex properties Co-authored-by: BTMuli <72692909+BTMuli@users.noreply.github.com> * Redesign sign-in card: grid layout, account switching, light mode fixes Co-authored-by: BTMuli <72692909+BTMuli@users.noreply.github.com> * Add forceReload parameter to prevent unnecessary API calls Co-authored-by: BTMuli <72692909+BTMuli@users.noreply.github.com> * Show multiple game accounts with grid layout and MiHoYo account in append Co-authored-by: BTMuli <72692909+BTMuli@users.noreply.github.com> * Use unique keys and concurrent API requests for better performance Co-authored-by: BTMuli <72692909+BTMuli@users.noreply.github.com> * Refactor sign-in component: split into reusable parts with user switcher Co-authored-by: BTMuli <72692909+BTMuli@users.noreply.github.com> * Fix sign-in logic: highlight based on count not date, enable resign button Co-authored-by: BTMuli <72692909+BTMuli@users.noreply.github.com> * Remove duplicate code and fix comment Co-authored-by: BTMuli <72692909+BTMuli@users.noreply.github.com> * Add reward cell component, extra rewards support, and improved visual distinction Co-authored-by: BTMuli <72692909+BTMuli@users.noreply.github.com> * 🏷️ 添加Store类型,调整首页选项框宽度 * 🏷️签到 → 游戏签到 * ♻️ 首页组件重构,支持组件分享 * ♻️ 调整组件UI * 💄 调整loading标题文本大小 * 💄 微调样式 * Refactor sign-in component: sequential loading, progress bar, internal data processing Co-authored-by: BTMuli <72692909+BTMuli@users.noreply.github.com> * Fix code review issues: correct gameInfo reference and add refresh event Co-authored-by: BTMuli <72692909+BTMuli@users.noreply.github.com> * 🎨 调整逻辑 * Refactor: self-contained data updates and numeric state enums Co-authored-by: BTMuli <72692909+BTMuli@users.noreply.github.com> * 🚸 调整排序逻辑 * 🚸 调整loading文本 * ✏️ 调整类型,修复打包失败 * ♻️ 添加补签相关请求 * 💄 调整脚本页布局 * 💄 调整首页布局 * Implement resign feature with local data updates and confirmation dialog Co-authored-by: BTMuli <72692909+BTMuli@users.noreply.github.com> * ✏️ 补充类型描述 * Fix resign logic: check is_sub, optimize resign info loading, improve success message Co-authored-by: BTMuli <72692909+BTMuli@users.noreply.github.com> * 🎨 调整逻辑,微调样式 * 🎨 调整唤起位置 * Add click handlers to reward cells for sign-in and resign actions Co-authored-by: BTMuli <72692909+BTMuli@users.noreply.github.com> * 🐛 对ID进行限制 * 💄 微调顶部gameNav样式 * Fix resign logic: only first missed day is clickable Co-authored-by: BTMuli <72692909+BTMuli@users.noreply.github.com> * 🎨 放宽补签限制 * 🐛 修正删除逻辑判断 --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: BTMuli <72692909+BTMuli@users.noreply.github.com> Co-authored-by: BTMuli <bt-muli@outlook.com>
This commit is contained in:
@@ -236,7 +236,7 @@ async function refreshState(ck: TGApp.App.Account.Cookie): Promise<void> {
|
||||
`[签到任务]刷新${item.info.title}-${item.account.regionName}-${item.account.gameUid}`,
|
||||
);
|
||||
if (item.reward === undefined) {
|
||||
const rewardResp = await lunaReq.home(item.account, cookie);
|
||||
const rewardResp = await lunaReq.sign.info(item.account, cookie);
|
||||
console.log("签到奖励", item, rewardResp);
|
||||
if ("retcode" in rewardResp) {
|
||||
await TGLogger.Script(
|
||||
@@ -245,7 +245,7 @@ async function refreshState(ck: TGApp.App.Account.Cookie): Promise<void> {
|
||||
showSnackbar.error(`[${rewardResp.retcode}] ${rewardResp.message}`);
|
||||
} else item.reward = rewardResp.awards[dayNow - 1];
|
||||
}
|
||||
const statResp = await lunaReq.info(item.account, cookie);
|
||||
const statResp = await lunaReq.sign.stat(item.account, cookie);
|
||||
console.log("签到状态", item, statResp);
|
||||
if ("retcode" in statResp) {
|
||||
await TGLogger.Script(`[签到任务]获取签到状态失败:${statResp.retcode} ${statResp.message}`);
|
||||
@@ -267,7 +267,7 @@ async function trySign(ac: SignAccount[], ck: TGApp.App.Account.Cookie): Promise
|
||||
let check = false;
|
||||
let challenge: string | undefined = undefined;
|
||||
while (!check) {
|
||||
const signResp = await lunaReq.sign(item.account, cookie, challenge);
|
||||
const signResp = await lunaReq.sign.oper(item.account, cookie, challenge);
|
||||
console.log("签到信息", item, signResp);
|
||||
if (challenge !== undefined) challenge = undefined;
|
||||
if ("retcode" in signResp) {
|
||||
|
||||
Reference in New Issue
Block a user