From fa4092302b7ac0dfe80c4cbb22858b159b8d22ff Mon Sep 17 00:00:00 2001 From: jinyaqiu Date: Thu, 31 Jul 2025 16:19:30 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20pro=E5=8D=A1=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env | 2 +- app/(tabs)/owner.tsx | 11 +- assets/icons/svg/pro.svg | 62 ----------- assets/icons/svg/proText.svg | 9 ++ assets/icons/svg/righttopDate.svg | 3 + assets/icons/svg/topRightData.svg | 3 - components/owner/rights/memberCard.tsx | 139 +++++++++++++++++++++++++ i18n/locales/zh/personal.json | 3 +- lib/server-api-util.ts | 2 +- package-lock.json | 11 ++ package.json | 3 +- 11 files changed, 174 insertions(+), 74 deletions(-) delete mode 100644 assets/icons/svg/pro.svg create mode 100644 assets/icons/svg/proText.svg create mode 100644 assets/icons/svg/righttopDate.svg delete mode 100644 assets/icons/svg/topRightData.svg create mode 100644 components/owner/rights/memberCard.tsx diff --git a/.env b/.env index 53a6945..8a1f236 100644 --- a/.env +++ b/.env @@ -1 +1 @@ -API_ENDPOINT=http://192.168.31.115:18080/api \ No newline at end of file +API_ENDPOINT=http://192.168.31.16:31646/api \ No newline at end of file diff --git a/app/(tabs)/owner.tsx b/app/(tabs)/owner.tsx index eed318d..62db827 100644 --- a/app/(tabs)/owner.tsx +++ b/app/(tabs)/owner.tsx @@ -1,20 +1,19 @@ -import ComeinSvg from '@/assets/icons/svg/comein.svg'; import ConversationsSvg from '@/assets/icons/svg/conversations.svg'; import StoriesSvg from '@/assets/icons/svg/stories.svg'; import AskNavbar from '@/components/layout/ask'; import CarouselComponent from '@/components/owner/carousel'; import CreateCountComponent from '@/components/owner/createCount'; import Ranking from '@/components/owner/ranking'; +import MemberCard from '@/components/owner/rights/memberCard'; import SettingModal from '@/components/owner/setting'; import UserInfo from '@/components/owner/userName'; -import { ThemedText } from '@/components/ThemedText'; import { checkAuthStatus } from '@/lib/auth'; import { fetchApi } from '@/lib/server-api-util'; import { CountData, UserInfoDetails } from '@/types/user'; import { useRouter } from 'expo-router'; import { useEffect, useState } from 'react'; import { useTranslation } from 'react-i18next'; -import { FlatList, StyleSheet, TouchableOpacity, View } from 'react-native'; +import { FlatList, StyleSheet, View } from 'react-native'; import { useSafeAreaInsets } from "react-native-safe-area-context"; export default function OwnerPage() { @@ -82,7 +81,7 @@ export default function OwnerPage() { {/* 资源数据 */} - router.push({ pathname: '/rights', params: { credit: userInfoDetails?.remain_points, pro: userInfoDetails?.membership_level } @@ -94,7 +93,9 @@ export default function OwnerPage() { {t("generalSetting.unlock", { ns: "personal" })} - + */} + + {/* 分类 */} diff --git a/assets/icons/svg/pro.svg b/assets/icons/svg/pro.svg deleted file mode 100644 index 6088bbd..0000000 --- a/assets/icons/svg/pro.svg +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/assets/icons/svg/proText.svg b/assets/icons/svg/proText.svg new file mode 100644 index 0000000..9fda745 --- /dev/null +++ b/assets/icons/svg/proText.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/assets/icons/svg/righttopDate.svg b/assets/icons/svg/righttopDate.svg new file mode 100644 index 0000000..49dc48c --- /dev/null +++ b/assets/icons/svg/righttopDate.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/icons/svg/topRightData.svg b/assets/icons/svg/topRightData.svg deleted file mode 100644 index 61eb428..0000000 --- a/assets/icons/svg/topRightData.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/components/owner/rights/memberCard.tsx b/components/owner/rights/memberCard.tsx new file mode 100644 index 0000000..191a44f --- /dev/null +++ b/components/owner/rights/memberCard.tsx @@ -0,0 +1,139 @@ +import ProTextSvg from '@/assets/icons/svg/proText.svg'; +import RightTopDateSvg from '@/assets/icons/svg/righttopDate.svg'; +import { ThemedText } from '@/components/ThemedText'; +import { useTranslation } from "react-i18next"; +import { StyleSheet, View } from "react-native"; + +const MemberCard = () => { + const { t } = useTranslation(); + + return ( + + + + + + {t("personal:generalSetting.unlock")} + + + + + + + + + + + + 2025-09-25截止 + + + + ); +}; + +const styles = StyleSheet.create({ + date: { + fontSize: 12, + fontWeight: 'bold', + color: '#4C320C', + padding: 4, + transform: [{ rotate: '40deg' }], + position: 'absolute', + top: 20, + right: -38, + }, + container: { + borderRadius: 32, + height: 140, + }, + card: { + flex: 1, + backgroundColor: '#4C320C', + borderRadius: 16, + padding: 16, + flexDirection: 'row', + justifyContent: 'space-between', + overflow: 'hidden', + }, + content: { + flex: 1, + justifyContent: 'space-between', + }, + textContainer: { + flex: 1, + justifyContent: 'center', + }, + title: { + fontSize: 42, + fontWeight: 'bold', + width: '100%', + textAlign: 'center' + }, + subtitle: { + color: '#FFE4A8', + fontSize: 14, + marginBottom: 12, + }, + benefitsContainer: { + marginTop: 8, + }, + benefit: { + color: '#FFF8DE', + fontSize: 12, + lineHeight: 20, + }, + decorativeElements: { + position: 'absolute', + top: 0, + left: 0, + right: 0, + bottom: 0, + }, + topRightData: { + position: 'absolute', + top: -4, + right: 16, + zIndex: 0, + }, + topRightData2: { + position: 'absolute', + top: '50%', + right: -16, + zIndex: 0, + }, + righttopData: { + position: 'absolute', + top: -6, + right: 20, + zIndex: 0, + }, + line: { + position: 'absolute', + bottom: 16, + left: 16, + right: 16, + height: 4, + }, + characterContainer: { + position: 'absolute', + right: 0, + bottom: 0, + width: 360, + height: 140, + justifyContent: 'flex-end', + alignItems: 'flex-end', + }, + gradient: { + position: 'absolute', + left: 0, + right: 0, + top: 0, + bottom: 0, + }, + transparentText: { + opacity: 1, + }, +}); + +export default MemberCard; \ No newline at end of file diff --git a/i18n/locales/zh/personal.json b/i18n/locales/zh/personal.json index 6ba9bab..f06f787 100644 --- a/i18n/locales/zh/personal.json +++ b/i18n/locales/zh/personal.json @@ -87,7 +87,8 @@ "premium": "升级至会员", "unlock": "解锁更多记忆魔法", "delete": "确定要注销账号吗?", - "cancel": "取消" + "cancel": "取消", + "pro": "Pro" }, "rights": { "title": "权益", diff --git a/lib/server-api-util.ts b/lib/server-api-util.ts index 8331343..870d4c7 100644 --- a/lib/server-api-util.ts +++ b/lib/server-api-util.ts @@ -25,7 +25,7 @@ export interface PagedResult { // 获取.env文件中的变量 -export const API_ENDPOINT = Constants.expoConfig?.extra?.API_ENDPOINT || "http://192.168.31.115:18080/api"; +export const API_ENDPOINT = Constants.expoConfig?.extra?.API_ENDPOINT || "http://192.168.31.16:31646/api"; // 更新 access_token 的逻辑 - 用于React组件中 export const useAuthToken = async(message: string | null) => { diff --git a/package-lock.json b/package-lock.json index 09db5d3..61c613b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,7 @@ "version": "1.0.0", "dependencies": { "@expo/vector-icons": "^14.1.0", + "@react-native-masked-view/masked-view": "0.3.2", "@react-navigation/bottom-tabs": "^7.3.10", "@react-navigation/elements": "^2.3.8", "@react-navigation/native": "^7.1.6", @@ -3792,6 +3793,16 @@ } } }, + "node_modules/@react-native-masked-view/masked-view": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/@react-native-masked-view/masked-view/-/masked-view-0.3.2.tgz", + "integrity": "sha512-XwuQoW7/GEgWRMovOQtX3A4PrXhyaZm0lVUiY8qJDvdngjLms9Cpdck6SmGAUNqQwcj2EadHC1HwL0bEyoa/SQ==", + "license": "MIT", + "peerDependencies": { + "react": ">=16", + "react-native": ">=0.57" + } + }, "node_modules/@react-native-picker/picker": { "version": "2.11.1", "resolved": "https://registry.npmjs.org/@react-native-picker/picker/-/picker-2.11.1.tgz", diff --git a/package.json b/package.json index 788a6a7..048dedc 100644 --- a/package.json +++ b/package.json @@ -81,7 +81,8 @@ "react-native-view-shot": "4.0.3", "react-native-web": "~0.20.0", "react-native-webview": "13.13.5", - "react-redux": "^9.2.0" + "react-redux": "^9.2.0", + "@react-native-masked-view/masked-view": "0.3.2" }, "devDependencies": { "@babel/core": "^7.25.2",