From dc485a8c7b7ccb0321c40c8f9e4368168e31ec51 Mon Sep 17 00:00:00 2001 From: hzj <1304805162@qq.com> Date: Mon, 2 Feb 2026 19:45:20 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=96=B0=E9=99=90=E6=97=B6=E6=B4=BB?= =?UTF-8?q?=E5=8A=A8=E9=A1=B5=E9=9D=A2):=20=E7=99=BB=E5=BD=95=E5=A5=96?= =?UTF-8?q?=E5=8A=B1=E9=A2=86=E5=8F=96=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/task.js | 37 +++ src/router/index.js | 6 + src/utils/permissionManager.js | 7 +- src/utils/routeGuard.js | 1 + src/views/Activities/LoginReward/index.vue | 359 +++++++++++++++++++++ 5 files changed, 407 insertions(+), 3 deletions(-) create mode 100644 src/api/task.js create mode 100644 src/views/Activities/LoginReward/index.vue diff --git a/src/api/task.js b/src/api/task.js new file mode 100644 index 0000000..3905eab --- /dev/null +++ b/src/api/task.js @@ -0,0 +1,37 @@ +import { get, post } from '../utils/http.js' + +// 每日签到奖励列表. +export const apiGetLoginRewards = async (activityType) => { + try { + const response = await get(`/task/check/in/list/award?activityType=${activityType}`) + return response + } catch (error) { + console.error('Failed to get login rewards:', error) + console.error('error:' + error.response.errorMsg) + throw error + } +} + +// 今天是否已签到. +export const apiGetTodayLoginStatus = async (dailyKey) => { + try { + const response = await get(`/task/check/in/today?dailyKey=${dailyKey}`) + return response + } catch (error) { + console.error('Failed to get today login info:', error) + console.error('error:' + error.response.errorMsg) + throw error + } +} + +// 打卡-领取奖励. +export const postReceiveLoginReward = async (data) => { + try { + const response = await post(`/task/check/in/receive`, data) + return response + } catch (error) { + console.error('Failed to post receive login reward:', error) + console.error('error:' + error.response.errorMsg) + throw error + } +} diff --git a/src/router/index.js b/src/router/index.js index 7140d23..29f94ea 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -371,6 +371,12 @@ const router = createRouter({ }, // 限时活动 + { + path: '/login-reward', + name: 'login-reward', + component: () => import('../views/Activities/LoginReward/index.vue'), + meta: { requiresAuth: true }, + }, //2026年xxxxxx结束 { path: '/lucky-dollars-season3', name: 'lucky-dollars-season3', diff --git a/src/utils/permissionManager.js b/src/utils/permissionManager.js index 2a0caa2..974d5fe 100644 --- a/src/utils/permissionManager.js +++ b/src/utils/permissionManager.js @@ -58,9 +58,10 @@ const ACTIVITIES = [ INVITATION_PAGES.INVITE_USER, //邀请新用户(邀请码) '/recharge-reward', //充值奖励 - '/lucky-dollars-season3', //水果游戏打榜 - '/jack-pot', //水果游戏打榜 - '/new-year', //新年抽奖 + '/login-reward', // 登录奖励 + '/lucky-dollars-season3', // 水果游戏打榜 + '/jack-pot', // 水果游戏打榜 + '/new-year', // 新年抽奖 ] // 🎯 核心改变:基于身份的权限配置 diff --git a/src/utils/routeGuard.js b/src/utils/routeGuard.js index 27e89f3..e81c3b4 100644 --- a/src/utils/routeGuard.js +++ b/src/utils/routeGuard.js @@ -409,6 +409,7 @@ class RouteGuard { '/invitation-to-register', //邀请新用户注册页面 '/recharge-reward', //充值奖励 + '/login-reward', // 登录奖励 '/lucky-dollars-season3', //水果游戏打榜 '/jack-pot', //水果游戏打榜 '/new-year', //新年抽奖 diff --git a/src/views/Activities/LoginReward/index.vue b/src/views/Activities/LoginReward/index.vue new file mode 100644 index 0000000..d1cf49f --- /dev/null +++ b/src/views/Activities/LoginReward/index.vue @@ -0,0 +1,359 @@ + + + + +