From 828841c2cc024438340920be7d06961d81bdf83a Mon Sep 17 00:00:00 2001 From: john Date: Mon, 22 Jul 2024 13:56:28 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat:?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 4 +- src/App.tsx | 7 +- src/assets/Earns-fill-active.svg | 1 + src/assets/Earns-fill.svg | 1 + src/assets/Launchpool-fill-active.svg | 1 + src/assets/Launchpool-fill.svg | 1 + src/assets/Leaderboard-fill-active.svg | 1 + src/assets/Leaderboard-fill.svg | 1 + src/assets/account_age_icon.svg | 1 + src/assets/arrow_right.svg | 1 + src/assets/home-fill-active.svg | 1 + src/assets/home-fill.svg | 1 + src/assets/invited_friends_icon.svg | 1 + src/assets/logo.svg | 2 +- src/assets/telegram_premium_icon.svg | 1 + src/assets/user-fill-active.svg | 1 + src/assets/user-fill.svg | 1 + src/components/BottomTab.tsx | 82 ++++++++--- src/pages/Earns-m.module.css | 189 +++++++++++++++++++++++++ src/pages/Earns.tsx | 60 ++++++++ src/pages/Frends-m.module.css | 16 +-- src/pages/Frends.tsx | 26 ++-- src/pages/Guide-m.module.css | 2 +- src/pages/Guide.tsx | 3 +- src/pages/Home-m.module.css | 1 - src/pages/Home.tsx | 48 +++---- src/pages/Index-m.module.css | 1 + src/pages/Index.tsx | 16 +++ src/pages/Launchpool-m.module.css | 22 +++ src/pages/Launchpool.tsx | 18 +++ src/pages/Leaderboard-m.module.css | 28 ++-- src/pages/Leaderboard.tsx | 20 +-- src/server/api.ts | 111 +-------------- 33 files changed, 454 insertions(+), 216 deletions(-) create mode 100644 src/assets/Earns-fill-active.svg create mode 100644 src/assets/Earns-fill.svg create mode 100644 src/assets/Launchpool-fill-active.svg create mode 100644 src/assets/Launchpool-fill.svg create mode 100644 src/assets/Leaderboard-fill-active.svg create mode 100644 src/assets/Leaderboard-fill.svg create mode 100644 src/assets/account_age_icon.svg create mode 100644 src/assets/arrow_right.svg create mode 100644 src/assets/home-fill-active.svg create mode 100644 src/assets/home-fill.svg create mode 100644 src/assets/invited_friends_icon.svg create mode 100644 src/assets/telegram_premium_icon.svg create mode 100644 src/assets/user-fill-active.svg create mode 100644 src/assets/user-fill.svg create mode 100644 src/pages/Earns-m.module.css create mode 100644 src/pages/Earns.tsx create mode 100644 src/pages/Launchpool-m.module.css create mode 100644 src/pages/Launchpool.tsx diff --git a/.env.development b/.env.development index d16759b..a504b6b 100644 --- a/.env.development +++ b/.env.development @@ -1,11 +1,11 @@ ### # @LastEditors: John # @Date: 2024-06-18 10:12:21 - # @LastEditTime: 2024-07-18 14:49:49 + # @LastEditTime: 2024-07-22 13:52:06 # @Author: John ### VITE_BASE_URL= VITE_BASE_API_URL=/dev VITE_TG_COMMUNITY=johntest_bot VITE_TG_BOT_NAME=johntest_bot -VITE_TG_BOT_WEBAPP_NAME=starcraft +VITE_TG_BOT_WEBAPP_NAME=penguin_coop diff --git a/src/App.tsx b/src/App.tsx index ed148cd..ea74b60 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,7 +1,7 @@ /* * @LastEditors: John * @Date: 2024-07-13 10:21:58 - * @LastEditTime: 2024-07-19 17:54:47 + * @LastEditTime: 2024-07-22 13:55:00 * @Author: John */ import { MemoryRouter, Route, Routes } from "react-router-dom"; @@ -16,11 +16,6 @@ import Guide from "./pages/Guide"; import useUserStore from "./store/User"; import { useEffect } from "react"; import Index from "./pages/Index"; -import { - api_get_user_information, - api_login, - api_query_whether_the_user_receives_the_registration_reward, -} from "./server/api"; function App() { const WebApp = useWebApp(); diff --git a/src/assets/Earns-fill-active.svg b/src/assets/Earns-fill-active.svg new file mode 100644 index 0000000..8772c22 --- /dev/null +++ b/src/assets/Earns-fill-active.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/Earns-fill.svg b/src/assets/Earns-fill.svg new file mode 100644 index 0000000..98a4560 --- /dev/null +++ b/src/assets/Earns-fill.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/Launchpool-fill-active.svg b/src/assets/Launchpool-fill-active.svg new file mode 100644 index 0000000..00340fc --- /dev/null +++ b/src/assets/Launchpool-fill-active.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/Launchpool-fill.svg b/src/assets/Launchpool-fill.svg new file mode 100644 index 0000000..f0b5cfd --- /dev/null +++ b/src/assets/Launchpool-fill.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/Leaderboard-fill-active.svg b/src/assets/Leaderboard-fill-active.svg new file mode 100644 index 0000000..68328b0 --- /dev/null +++ b/src/assets/Leaderboard-fill-active.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/Leaderboard-fill.svg b/src/assets/Leaderboard-fill.svg new file mode 100644 index 0000000..b258c7d --- /dev/null +++ b/src/assets/Leaderboard-fill.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/account_age_icon.svg b/src/assets/account_age_icon.svg new file mode 100644 index 0000000..55722ef --- /dev/null +++ b/src/assets/account_age_icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/arrow_right.svg b/src/assets/arrow_right.svg new file mode 100644 index 0000000..5c7eee8 --- /dev/null +++ b/src/assets/arrow_right.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/home-fill-active.svg b/src/assets/home-fill-active.svg new file mode 100644 index 0000000..a03225f --- /dev/null +++ b/src/assets/home-fill-active.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/home-fill.svg b/src/assets/home-fill.svg new file mode 100644 index 0000000..e35d6ca --- /dev/null +++ b/src/assets/home-fill.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/invited_friends_icon.svg b/src/assets/invited_friends_icon.svg new file mode 100644 index 0000000..5295fd1 --- /dev/null +++ b/src/assets/invited_friends_icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/logo.svg b/src/assets/logo.svg index 39e6d69..35eb95d 100644 --- a/src/assets/logo.svg +++ b/src/assets/logo.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/assets/telegram_premium_icon.svg b/src/assets/telegram_premium_icon.svg new file mode 100644 index 0000000..4db6945 --- /dev/null +++ b/src/assets/telegram_premium_icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/user-fill-active.svg b/src/assets/user-fill-active.svg new file mode 100644 index 0000000..05931cc --- /dev/null +++ b/src/assets/user-fill-active.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/user-fill.svg b/src/assets/user-fill.svg new file mode 100644 index 0000000..96f84b4 --- /dev/null +++ b/src/assets/user-fill.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/components/BottomTab.tsx b/src/components/BottomTab.tsx index 9254a25..c42925b 100644 --- a/src/components/BottomTab.tsx +++ b/src/components/BottomTab.tsx @@ -1,13 +1,23 @@ /* * @LastEditors: John * @Date: 2024-07-13 18:07:43 - * @LastEditTime: 2024-07-19 15:42:36 + * @LastEditTime: 2024-07-22 11:03:20 * @Author: John */ import { useLocation, useNavigate } from "react-router-dom"; import classes from "./BottomTab-m.module.css"; import { AppOutline, HistogramOutline, TeamFill } from "antd-mobile-icons"; import { useEffect, useState } from "react"; +import home_fill from "@/assets/home-fill.svg"; +import home_fill_active from "@/assets/home-fill-active.svg"; +import Leaderboard_fill from "@/assets/Leaderboard-fill.svg"; +import Leaderboard_fill_active from "@/assets/Leaderboard-fill-active.svg"; +import user_fill from "@/assets/user-fill.svg"; +import user_fill_active from "@/assets/user-fill-active.svg"; +import Launchpool_fill from "@/assets/Launchpool-fill.svg"; +import Launchpool_fill_active from "@/assets/Launchpool-fill-active.svg"; +import Earns_fill from "@/assets/Earns-fill.svg"; +import Earns_fill_active from "@/assets/Earns-fill-active.svg"; export default function () { const navigate = useNavigate(); const { pathname } = useLocation(); @@ -22,30 +32,58 @@ export default function () { <> diff --git a/src/pages/Earns-m.module.css b/src/pages/Earns-m.module.css new file mode 100644 index 0000000..7bba6ca --- /dev/null +++ b/src/pages/Earns-m.module.css @@ -0,0 +1,189 @@ +.Earns { + display: flex; + flex-direction: column; + align-items: center; + padding-top: 24px; + .Earns_title { + opacity: 1; + width: 311px; + font-family: Roboto; + font-size: 24px; + font-weight: 600; + line-height: normal; + text-align: center; + letter-spacing: 0em; + + font-variation-settings: "opsz" auto; + font-feature-settings: "kern" on; + color: #ffffff; + } + + .Earns_list { + display: flex; + flex-direction: column; + gap: 16px; + margin-top: 16px; + .Earns_box { + width: 345px; + /* height: 303px; */ + border-radius: 12px; + opacity: 1; + + background: #18181b; + + box-sizing: border-box; + border: 1px solid #27272a; + padding: 15px; + + .Earns_box_title { + display: flex; + align-items: center; + gap: 10px; + > div { + width: 40px; + height: 40px; + opacity: 1; + + background: #09090b; + } + > span { + opacity: 1; + + font-family: Roboto; + font-size: 20px; + font-weight: 600; + line-height: 24px; + letter-spacing: 0em; + + font-variation-settings: "opsz" auto; + font-feature-settings: "kern" on; + color: #ffffff; + } + } + + .Earns_box_list { + display: flex; + flex-direction: column; + gap: 8px; + margin-top: 10px; + .Earns_box_list_item { + width: 315px; + height: 108px; + border-radius: 12px; + opacity: 1; + + background: #09090b; + padding: 0 10px; + display: flex; + flex-direction: column; + .Earns_box_list_item_top { + border-bottom: 1px solid #27272a; + display: flex; + align-items: center; + gap: 6px; + height: 59px; + .platform_icon { + width: 32px; + height: 32px; + } + > span { + opacity: 1; + + font-family: Roboto; + font-size: 16px; + font-weight: normal; + line-height: 24px; + letter-spacing: 0em; + + font-variation-settings: "opsz" auto; + font-feature-settings: "kern" on; + color: #ffffff; + } + > button { + width: 68px; + height: 32px; + border-radius: 30px; + opacity: 1; + + background: #e2c72d; + margin-left: auto; + display: flex; + align-items: center; + .Earns_box_list_item_top_btn { + display: flex; + align-items: center; + gap: 6px; + > span { + opacity: 1; + + font-family: Roboto; + font-size: 16px; + font-weight: normal; + line-height: 24px; + letter-spacing: 0em; + + font-variation-settings: "opsz" auto; + font-feature-settings: "kern" on; + color: #000000; + } + + > img { + width: 24px; + height: 24px; + } + } + } + } + + .Earns_box_list_item_bottom { + display: flex; + align-items: center; + gap: 4px; + flex: 1; + > span { + &:nth-of-type(1) { + opacity: 1; + + font-family: Roboto; + font-size: 14px; + font-weight: normal; + line-height: 24px; + letter-spacing: 0em; + + font-variation-settings: "opsz" auto; + font-feature-settings: "kern" on; + color: #adadad; + } + + &:nth-of-type(2) { + display: block; + width: 14px; + height: 14px; + border-radius: 38px; + opacity: 1; + + background: #ffffff; + margin-left: auto; + } + + &:nth-of-type(3) { + opacity: 1; + + font-family: Roboto; + font-size: 14px; + font-weight: bold; + line-height: 24px; + text-align: right; + letter-spacing: 0em; + + font-variation-settings: "opsz" auto; + font-feature-settings: "kern" on; + color: #ffffff; + } + } + } + } + } + } + } +} diff --git a/src/pages/Earns.tsx b/src/pages/Earns.tsx new file mode 100644 index 0000000..acd06a2 --- /dev/null +++ b/src/pages/Earns.tsx @@ -0,0 +1,60 @@ +import { Button } from "antd-mobile"; +import classes from "./Earns-m.module.css"; +import tuite_white from "@/assets/tuite_white.svg"; +import arrow_right from "@/assets/arrow_right.svg"; +export default function () { + return ( + <> +
+ + Complete tasks to earn more DUCKS + + + +
+ + ); +} + +function EarnsBox() { + return ( +
  • +
    +
    + Quote this tweet +
    + + +
  • + ); +} + +function EarnsBoxItem() { + return ( +
  • +
    + + Quote this tweet + +
    + +
    + Reward + + +1,000 PENS +
    +
  • + ); +} diff --git a/src/pages/Frends-m.module.css b/src/pages/Frends-m.module.css index 44411a1..65683bd 100644 --- a/src/pages/Frends-m.module.css +++ b/src/pages/Frends-m.module.css @@ -5,6 +5,7 @@ .top_title { /* 自动布局子元素 */ opacity: 1; + width: 209px; font-family: Roboto; font-size: 28px; @@ -25,16 +26,13 @@ /* width: 141px; */ height: 149px; margin-top: 31px; - background-image: url("../assets/kuang.svg"); - background-repeat: no-repeat; - background-size: contain; } .tip { /* 自动布局子元素 */ opacity: 1; font-family: Roboto; - font-size: 22px; + font-size: 16px; font-weight: normal; line-height: normal; text-align: center; @@ -42,9 +40,7 @@ font-variation-settings: "opsz" auto; font-feature-settings: "kern" on; - color: #ffffff; - - z-index: 0; + color: #adadad; margin-top: 61px; } @@ -136,9 +132,9 @@ height: 48px; border-radius: 0px; opacity: 1; - background-image: url("../assets/big_buttom_bg.svg"); - background-repeat: no-repeat; - background-size: contain; + + border-radius: 470px; + background: #e2c72d; > span { opacity: 1; diff --git a/src/pages/Frends.tsx b/src/pages/Frends.tsx index f8dd9cb..b6ee17a 100644 --- a/src/pages/Frends.tsx +++ b/src/pages/Frends.tsx @@ -1,7 +1,7 @@ /* * @LastEditors: John * @Date: 2024-07-13 16:08:30 - * @LastEditTime: 2024-07-19 15:57:27 + * @LastEditTime: 2024-07-22 13:42:24 * @Author: John */ /* @@ -10,13 +10,12 @@ * @LastEditTime: 2024-07-15 15:31:58 * @Author: John */ -import logo from "@/assets/logo.png"; +import logo from "@/assets/logo.svg"; import { Avatar, Button } from "antd-mobile"; import classes from "./Frends-m.module.css"; import { useWebApp } from "@vkruglikov/react-telegram-web-app"; import useUserStore from "@/store/User"; import { useEffect, useState } from "react"; -import { api_homepage_subordinates_users } from "@/server/api"; import { subordinatesUsers } from "@/server/module"; import { cn } from "@/utils"; export default function () { @@ -32,24 +31,21 @@ export default function () { return () => {}; }, []); - async function updateFriends(level: number) { - const { data } = await api_homepage_subordinates_users().send({ - queryParams: { level }, - }); - setFrends(data?.data); - } + async function updateFriends(level: number) {} return ( <>
    - Invite friends and get more SCTT + Invite friends and get more PENS - - {frends?.length == 0 ? ( - - Tap on the button to invite your friends - + {!frends || frends?.length == 0 ? ( + <> + + + Tap on the button to invite your friends + + ) : (
    diff --git a/src/pages/Launchpool-m.module.css b/src/pages/Launchpool-m.module.css new file mode 100644 index 0000000..9655c2e --- /dev/null +++ b/src/pages/Launchpool-m.module.css @@ -0,0 +1,22 @@ +.Launchpool { + min-height: 100vh; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + gap: 13px; + > span { + opacity: 1; + + font-family: Roboto; + font-size: 18px; + font-weight: normal; + line-height: 24px; + text-transform: capitalize; + letter-spacing: 0em; + + font-variation-settings: "opsz" auto; + font-feature-settings: "kern" on; + color: #adadad; + } +} diff --git a/src/pages/Launchpool.tsx b/src/pages/Launchpool.tsx new file mode 100644 index 0000000..e36d60c --- /dev/null +++ b/src/pages/Launchpool.tsx @@ -0,0 +1,18 @@ +/* + * @LastEditors: John + * @Date: 2024-07-22 10:59:37 + * @LastEditTime: 2024-07-22 11:11:20 + * @Author: John + */ +import logo from "@/assets/logo.svg"; +import classes from "./Launchpool-m.module.css"; +export default function () { + return ( + <> +
    + + Coming Soon! +
    + + ); +} diff --git a/src/pages/Leaderboard-m.module.css b/src/pages/Leaderboard-m.module.css index 91afbd2..140a963 100644 --- a/src/pages/Leaderboard-m.module.css +++ b/src/pages/Leaderboard-m.module.css @@ -25,16 +25,16 @@ border-radius: 12px; opacity: 1; - /* 自动布局 */ + background: #18181b; + + box-sizing: border-box; + border: 1px solid #27272a; + display: flex; align-items: center; - padding: 13px 15px; - /* background: #1e1e1e; */ - background-image: url("../assets/user_rank_bg.svg"); - background-repeat: no-repeat; - background-size: contain; - border-radius: 0px; + padding: 0 13px; + gap: 12px; margin-top: 38px; > div { @@ -157,7 +157,6 @@ .rank_list { width: 100%; padding: 0 15px; - padding-bottom: 94px; margin-top: 32px; display: flex; flex-direction: column; @@ -165,6 +164,19 @@ .rank_item { display: flex; align-items: center; + + width: 345px; + height: 68px; + border-radius: 12px; + opacity: 1; + + background: #18181b; + + box-sizing: border-box; + border: 1px solid #27272a; + + padding: 0 12px; + gap: 12px; > svg { diff --git a/src/pages/Leaderboard.tsx b/src/pages/Leaderboard.tsx index cc1e2d7..9e85384 100644 --- a/src/pages/Leaderboard.tsx +++ b/src/pages/Leaderboard.tsx @@ -1,7 +1,7 @@ /* * @LastEditors: John * @Date: 2024-07-13 16:08:04 - * @LastEditTime: 2024-07-19 14:55:57 + * @LastEditTime: 2024-07-22 13:42:56 * @Author: John */ import { Avatar, Button } from "antd-mobile"; @@ -12,19 +12,19 @@ import rank2 from "@/assets/rank2.svg"; import rank3 from "@/assets/rank3.svg"; import { useEffect, useState } from "react"; -import { api_ranking } from "@/server/api"; import { RewardVo } from "@/server/module"; export default function () { const [userRank, setUserRank] = useState(); - const [ranks, setRanks] = useState(); + const [ranks, setRanks] = useState([ + { + tgName: "LAW.D", + amount: "49,055,319", + ranking: 1, + }, + ]); const [totalUser, setTotalUser] = useState(); useEffect(() => { - (async () => { - const { data } = await api_ranking().send({}); - setUserRank(data?.data.rewardVo); - setRanks(data?.data.rewardVos); - setTotalUser(data?.data.numberOfUsers); - })(); + (async () => {})(); return () => {}; }, []); @@ -32,7 +32,7 @@ export default function () { return ( <>
    - Telegram Wall of Fame + Penguin Champs
    diff --git a/src/server/api.ts b/src/server/api.ts index 1ed876d..56c7162 100644 --- a/src/server/api.ts +++ b/src/server/api.ts @@ -1,7 +1,7 @@ /* * @LastEditors: John * @Date: 2024-07-15 10:35:20 - * @LastEditTime: 2024-07-19 15:50:19 + * @LastEditTime: 2024-07-22 13:42:07 * @Author: John */ import { GET, POST } from "./client"; @@ -11,112 +11,3 @@ import { taskConfigurationListItem, userBenefits, } from "./module"; - -// 登录 -export function api_login() { - return POST< - { - initData: string; - invitationCode?: string; - }, - { token: string } - >({ - url: "/api/account/signIn", - }); -} - -// 查询用户是否领取注册奖励 -export function api_query_whether_the_user_receives_the_registration_reward() { - return GET({ - url: "/api/reward/signUpForIncentives", - }); -} - -// 领取奖励 -export function api_receive_rewards() { - return POST({ - url: "/api/reward/claimYourRewards", - }); -} - -// 排行 -export function api_ranking() { - return GET< - any, - { - rewardVo: RewardVo; - rewardVos: RewardVo[]; - numberOfUsers: number; - } - >({ - url: "/api/reward/rankingWalletLog", - }); -} - -// 首页查询用户收益 -export function api_homepage_query_user_income() { - return GET({ - url: "/api/reward/userBenefits", - }); -} - -// 获取用户信息 -export function api_get_user_information() { - return GET< - any, - { - account: string; - accountType: number; - allPid: string; - chainType: number; - codePrompt: number; - createTime: string; - flag: number; - id: string; - level: number; - minLevel: number; - mintNumber: number; - passwordLogin: string; - passwordPay: string; - presidentNumber: number; - referId: string; - shareCode: string; - shareNum: number; - teamNum: number; - uid: string; - updateTime: string; - userImg: string; - userType: number; - } - >({ - url: "/api/user/findUser", - }); -} - -// 首页下级用户 -export function api_homepage_subordinates_users() { - return GET<{ level: number }, subordinatesUsers[]>({ - url: "/api/reward/subordinateUsers", - }); -} - -// 关注推特 -export function api_follow_twitter() { - return POST({ - url: "/api/reward/followTwitter", - }); -} - -// 查询任务配置列表 - -export function api_query_task_configuration_list() { - return GET({ - url: "/api/task-config", - }); -} - -export function api_start_task() { - return POST({ - url: "/api/task-config", - }); -}