diff --git a/src/api/lottery.js b/src/api/lottery.js index 3a22883..381540c 100644 --- a/src/api/lottery.js +++ b/src/api/lottery.js @@ -33,3 +33,189 @@ export const withdrawApply = async (data) => { throw error } } + +// 获取排行榜 +export const ranklist = async (activityId) => { + try { + const response = await get(`/activity/lottery/recharge-rank?activityId=${activityId}`) + return response + } catch (error) { + console.error('Failed to fetch get rank list:', error) + console.error('error:' + error.response.errorMsg) + throw error + } +} + +// 获取有效活动 +export const validActivity = async () => { + try { + const response = await get(`/activity/lottery/valid-activity`) + return response + } catch (error) { + console.error('Failed to fetch get valid activity:', error) + console.error('error:' + error.response.errorMsg) + throw error + } +} + +// 获取活动详情 +export const activityDetail = async (activityCode) => { + try { + const response = await get(`/activity/lottery/detail/${activityCode}`) + return response + } catch (error) { + console.error('Failed to fetch get activity detail:', error) + console.error('error:' + error.response.errorMsg) + throw error + } +} + +// 获取充值记录 +export const myRecharge = async () => { + try { + const response = await get(`/activity/lottery/my-recharge`) + return response + } catch (error) { + console.error('Failed to fetch get my recharge:', error) + console.error('error:' + error.response.errorMsg) + throw error + } +} + +// 获取活动奖励配置列表. +export const activityRewardConfigs = async (activityType) => { + try { + const response = await get(`/activity/lottery/reward-configs?activityType=${activityType}`) + return response + } catch (error) { + console.error('Failed to fetch get activity reward:', error) + console.error('error:' + error.response.errorMsg) + throw error + } +} + +// 获取剩余中奖券 +export const myTickets = async () => { + try { + const response = await get(`/activity/lottery/my-ticket-count`) + return response + } catch (error) { + console.error('Failed to fetch get my tickets:', error) + console.error('error:' + error.response.errorMsg) + throw error + } +} + +// 获取我的总抽奖次数 +export const myTotalDrawCount = async () => { + try { + const response = await get(`/activity/lottery/my-total-draw-count`) + return response + } catch (error) { + console.error('Failed to fetch get my total draw count:', error) + console.error('error:' + error.response.errorMsg) + throw error + } +} + +// 执行单次抽奖 +export const onceDraw = async (data) => { + try { + const response = await post('/activity/lottery/draw', data) + return response + } catch (error) { + console.error('Failed to fetch once draw:', error) + throw error + } +} + +// 执行连抽 +export const multiDraw = async (data) => { + try { + const response = await post('/activity/lottery/multi-draw', data) + return response + } catch (error) { + console.error('Failed to fetch multiply draw:', error) + throw error + } +} + +// 获取我的中奖记录(默认最新100条) +export const drawRecords = async () => { + try { + const response = await get(`/activity/lottery/my-records?pageSize=100`) + return response + } catch (error) { + console.error('Failed to fetch get draw records:', error) + console.error('error:' + error.response.errorMsg) + throw error + } +} + +// 获取历史中奖用户 +export const winnerHistory = async () => { + try { + const response = await get(`/activity/lottery/winner-history`) + return response + } catch (error) { + console.error('Failed to fetch get winners:', error) + console.error('error:' + error.response.errorMsg) + throw error + } +} + +// 获取任务列表 +export const ActTaskList = async () => { + try { + const response = await get(`/spins/task/list`) + return response + } catch (error) { + console.error('Failed to fetch get tickets:', error) + console.error('error:' + error.response.errorMsg) + throw error + } +} + +// 领取任务奖励 +export const receiveTickets = async (data) => { + try { + const response = await post('/spins/task/receive/reward', data) + return response + } catch (error) { + console.error('Failed to fetch receive tickets:', error) + throw error + } +} + +// 领取充值奖励 +export const receiveRechargeReward = async (data) => { + try { + const response = await post('/activity/lottery/claim-reward', data) + return response + } catch (error) { + console.error('Failed to fetch receive rewards:', error) + throw error + } +} + +// 可提现金额转账给指定用户 +export const transferActivityDollar = async (data) => { + try { + const response = await post('/activity/lottery/transfer', data) + return response + } catch (error) { + console.error('Failed to fetch transfer activity dollar:', error) + throw error + } +} + +// 可提现金额兑换金币 +export const exchangeCoin = async (data) => { + try { + const response = await post('/activity/lottery/exchange', data) + return response + } catch (error) { + console.error('Failed to fetch exchange coin:', error) + throw error + } +} diff --git a/src/config/imagePaths.js b/src/config/imagePaths.js index 61d39a6..3f15554 100644 --- a/src/config/imagePaths.js +++ b/src/config/imagePaths.js @@ -8,3 +8,7 @@ export const OSS_BASE_URL = export const getPngUrl = (imagePath, filename) => { return `${OSS_BASE_URL}${imagePath}${filename}.png` } + +export const getWebpUrl = (imagePath, filename) => { + return `${OSS_BASE_URL}${imagePath}${filename}.webp` +} diff --git a/src/locales/ar.json b/src/locales/ar.json index faf64e6..d071ddb 100644 --- a/src/locales/ar.json +++ b/src/locales/ar.json @@ -242,15 +242,13 @@ "approved": "موافق عليه", "lucky_dollar": "دولار محظوظ", - "ranking": "الترتيب", - "lottery": "سحب القرعة", "history": "التاريخ", "current_earnings": "الأرباح الحالية: {amount}", "transfer_to_recharge_agent": "تحويل الأموال إلى وكيل الشحن", "select": "اختيار", "go_to_withdraw": "اذهب للسحب", "ticket": "تذكرة اليانصيب", - "current_raffle_tickets": "تذاكر اليانصيب الحالية: {count}", + "current_tickets": "تذاكر الطيران الحالية: {count}", "task_for_tickets": "احصل على تذاكر اليانصيب من خلال المهام", "minutes_short": "دقيقة", "hours_short": "ساعة", @@ -417,5 +415,10 @@ "vip": "VIP", "bd_policy": "سياسة BD", - "bd_leader_policy": "سياسة قائد BD" + "bd_leader_policy": "سياسة قائد BD", + + "recharge_reward": "مكافأة إعادة الشحن", + "ranking": "الترتيب", + "lottery": "القرعة", + "withdraw": "سحب" } diff --git a/src/locales/en.json b/src/locales/en.json index 7c106e5..5d651cb 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -242,15 +242,13 @@ "approved": "Approved", "lucky_dollar": "Lucky Dollar", - "ranking": "Ranking", - "lottery": "Lottery", "history": "history", "current_earnings": "Current earnings: {amount}", "transfer_to_recharge_agent": "Transfer to recharge agent", "select": "Select", "go_to_withdraw": "Go to withdraw", "ticket": "Ticket", - "current_raffle_tickets": "Current raffle tickets: {count}", + "current_tickets": "Current ticket: {count}", "task_for_tickets": "Task for tickets", "minutes_short": "mins", "hours_short": "hours", @@ -417,5 +415,10 @@ "vip": "VIP", "bd_policy": "BD Policy", - "bd_leader_policy": "BD Leader Policy" + "bd_leader_policy": "BD Leader Policy", + + "recharge_reward": "Recharge Reward", + "ranking": "Ranking", + "lottery": "Lottery", + "withdraw": "Withdraw" } diff --git a/src/locales/zh.json b/src/locales/zh.json index 59d672a..b91fe3a 100644 --- a/src/locales/zh.json +++ b/src/locales/zh.json @@ -242,15 +242,13 @@ "approved": "已批准", "lucky_dollar": "幸运美元", - "ranking": "排行", - "lottery": "抽奖", "history": "历史", "current_earnings": "当前收益:{amount}", "transfer_to_recharge_agent": "转账至充值代理", "select": "选择", "go_to_withdraw": "去提现", "ticket": "抽奖券", - "current_raffle_tickets": "当前抽奖券:{count}", + "current_tickets": "当前抽奖券:{count}", "task_for_tickets": "通过任务获取抽奖券", "minutes_short": "分钟", "hours_short": "小时", @@ -417,5 +415,10 @@ "vip": "VIP", "bd_policy": "BD政策", - "bd_leader_policy": "BD主管政策" + "bd_leader_policy": "BD主管政策", + + "recharge_reward": "充值奖励", + "ranking": "排行榜", + "lottery": "抽奖", + "withdraw": "提现" } diff --git a/src/router/index.js b/src/router/index.js index 7438880..bd6621f 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -365,6 +365,12 @@ const router = createRouter({ }, // 限时活动 + { + path: '/new-year', + name: 'new-year', + component: () => import('../views/Activities/NewYear/index.vue'), + meta: { requiresAuth: true }, + }, //2026年1月16日上午5点结束 { path: '/jack-pot', name: 'jack-pot', diff --git a/src/utils/permissionManager.js b/src/utils/permissionManager.js index 8bee76e..44a8a15 100644 --- a/src/utils/permissionManager.js +++ b/src/utils/permissionManager.js @@ -55,10 +55,11 @@ const RANKING_PAGES = [ // 活动页面 const ACTIVITIES = [ INVITATION_PAGES.INVITE_USER, //邀请新用户(邀请码) - '/recharge-reward', //充值奖励页面 + '/recharge-reward', //充值奖励 + '/new-year', //新年抽奖 + '/jack-pot', //水果游戏打榜 '/merry-christmas', //圣诞节 - '/jack-pot', //水果游戏打榜页面 '/lucky-champion', //幸运赢家 ] diff --git a/src/utils/routeGuard.js b/src/utils/routeGuard.js index 43f05e2..66484fb 100644 --- a/src/utils/routeGuard.js +++ b/src/utils/routeGuard.js @@ -406,10 +406,11 @@ class RouteGuard { // 活动页面 const ACTIVITIES = [ '/invitation-to-register', //邀请新用户注册页面 - '/recharge-reward', //充值奖励页面 + '/recharge-reward', //充值奖励 + '/new-year', //新年抽奖 + '/jack-pot', //水果游戏打榜 '/merry-christmas', //圣诞节 - '/jack-pot', //水果游戏打榜页面 '/lucky-champion', //幸运赢家 ] diff --git a/src/views/Activities/NewYear/components/Barrage.vue b/src/views/Activities/NewYear/components/Barrage.vue new file mode 100644 index 0000000..cc730fb --- /dev/null +++ b/src/views/Activities/NewYear/components/Barrage.vue @@ -0,0 +1,291 @@ + + + + + + + + + {{ barrageText(item) }} + + + + + + + + + diff --git a/src/views/Activities/NewYear/components/topUser.vue b/src/views/Activities/NewYear/components/topUser.vue new file mode 100644 index 0000000..e1ef024 --- /dev/null +++ b/src/views/Activities/NewYear/components/topUser.vue @@ -0,0 +1,293 @@ + + + + + + + + + + + + + + + + {{ name }} + + + + + + {{ distributionValue }} + + + + + + + + + + diff --git a/src/views/Activities/NewYear/index.vue b/src/views/Activities/NewYear/index.vue new file mode 100644 index 0000000..e0328b2 --- /dev/null +++ b/src/views/Activities/NewYear/index.vue @@ -0,0 +1,2695 @@ + + + + + + {{ $t('loading') }}... + + + + + + + + + + + + + + + + + + + + + {{ Days }}D + + + + + + {{ Hours }} + + + : + + + {{ Minutes }} + + + : + + + {{ Seconds }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ tag.name }} + + + + + + + + + + + + + + + + + + + + + + + + {{ myRechargeRecode?.userName }} + + + + ID:{{ myRechargeRecode?.account }} + + + + + Accumulated recharge:${{ formatRechargeAmount(myRechargeRecode?.totalAmount) }} + + + + + + + + + + + + + + + + handleRewardImageError(e, reward.type)" + /> + + + + + + {{ showDetail(reward.type, reward) }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ listItem?.rank }} + + + + + + + + + {{ listItem?.userName }} + + + {{ $t('user_id_prefix') }} {{ listItem?.specialAccount || listItem?.account }} + + + + + + + + + {{ listItem?.amount }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ t('current_tickets', { count: rollTimes }) }} + + + + + + + + + Total Spins:({{ totalDraw?.totalCount || 0 }}/100) + + + + Lucky Dollars Medal*permanent + + + + + + + {{ t('task_for_tickets') }} + + + + + + + + + + + + + + {{ showTarget(task) }} + + + {{ task.taskName }} + + + + + *{{ task.rewardValue }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ userInfo.userNickname || '' }} + + + ID:{{ userInfo.account || '' }} + + {{ t('current_earnings', { amount: currentAmount.availableAmount }) }} + + + + + + + + + + {{ t('transfer_to_recharge_agent') }} + + + + + + + + + + + + + + + + + + {{ selectedPayee.name || '' }} + + + ID: {{ selectedPayee.account || '' }} + + + + + {{ t('change') }} + + + + + + + + + + + + + + {{ t('select') }} + + + + + + + + ${{ coin.price }} + + + + + + + {{ t('transfer') }} + + + + + + + + {{ t('exchange_gold_coins') }} + + + + + + + + + + + {{ coin.amount }} coins x1 + ${{ coin.price }} + + + + + + + {{ t('exchange') }} + + + + + + + + {{ t('go_to_withdraw') }} + + + + + + + + + + + + + + + + {{ myRanking?.rank || 999 }} + + + + + + + + + {{ myRanking?.userName }} + + + + + + + + + {{ myRanking?.amount || 0 }} + + + + + + + + + + + + + + + + + + + + + + + + + You Get {{ result[resultShowIndex]?.prize?.prizeName }} + + {{ resultShowIndex + 1 }} / {{ result.length }} + + + + + + + + + + + + + + + + + {{ record.prize.prizeName }} + + + + {{ formatUTCCustom(record.drawTime) }} + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{{ $t('loading') }}...