feat: 会员
This commit is contained in:
parent
b428010a9c
commit
081e79fbb8
@ -119,7 +119,7 @@ export default function OwnerPage() {
|
||||
<UserInfo userInfo={userInfoDetails} />
|
||||
|
||||
{/* 会员卡 */}
|
||||
<MemberCard pro={userInfoDetails?.membership_level} />
|
||||
<MemberCard pro={userInfoDetails?.membership_level} points={userInfoDetails?.remain_points} />
|
||||
|
||||
{/* 分类 */}
|
||||
<View style={{ marginHorizontal: -16, marginBottom: -16 }}>
|
||||
|
||||
@ -37,9 +37,10 @@ export default function Rights() {
|
||||
requestProducts,
|
||||
ErrorCode
|
||||
} = useIAP();
|
||||
const { pro } = useLocalSearchParams<{
|
||||
const { points, pro } = useLocalSearchParams<{
|
||||
credit: string;
|
||||
pro: string;
|
||||
points: string;
|
||||
pro: string
|
||||
}>();
|
||||
// 用户勾选协议
|
||||
const [agree, setAgree] = useState<boolean>(false);
|
||||
@ -226,7 +227,7 @@ export default function Rights() {
|
||||
</ThemedText>
|
||||
<View style={styles.cardPoints}>
|
||||
<StarSvg />
|
||||
<ThemedText style={styles.cardPointsText}>{pro}</ThemedText>
|
||||
<ThemedText style={styles.cardPointsText}>{points}</ThemedText>
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
@ -266,8 +267,6 @@ export default function Rights() {
|
||||
padding: 16,
|
||||
paddingBottom: 32,
|
||||
backgroundColor: '#fff',
|
||||
borderTopWidth: 1,
|
||||
borderTopColor: '#eee',
|
||||
position: 'absolute',
|
||||
bottom: 0,
|
||||
left: 0,
|
||||
@ -303,8 +302,8 @@ export default function Rights() {
|
||||
}}
|
||||
activeOpacity={0.8}
|
||||
>
|
||||
<ThemedText style={{ color: '#fff', fontWeight: '700', fontSize: 14 }}>
|
||||
{t('rights.subscribe', { ns: 'personal' })}
|
||||
<ThemedText style={{ color: '#fff', fontWeight: '700', fontSize: 18 }}>
|
||||
{t('rights.subscribe', { ns: 'personal' })} {payType?.split('_')[payType?.split('_')?.length - 1]}
|
||||
</ThemedText>
|
||||
</TouchableOpacity>
|
||||
|
||||
@ -365,8 +364,8 @@ const styles = StyleSheet.create({
|
||||
},
|
||||
goPay: {
|
||||
backgroundColor: '#E2793F',
|
||||
borderRadius: 24,
|
||||
paddingVertical: 10,
|
||||
borderRadius: 32,
|
||||
paddingVertical: 16,
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
width: "100%",
|
||||
@ -379,9 +378,9 @@ const styles = StyleSheet.create({
|
||||
marginBottom: 16
|
||||
},
|
||||
switchButtonItem: {
|
||||
width: "48%",
|
||||
width: "47%",
|
||||
borderRadius: 24,
|
||||
paddingVertical: 6,
|
||||
paddingVertical: 8,
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
borderWidth: 1
|
||||
@ -390,7 +389,7 @@ const styles = StyleSheet.create({
|
||||
marginHorizontal: 16,
|
||||
marginVertical: 16,
|
||||
padding: 16,
|
||||
borderRadius: 12,
|
||||
borderRadius: 32,
|
||||
backgroundColor: '#fff',
|
||||
shadowColor: '#000',
|
||||
shadowOffset: {
|
||||
@ -421,7 +420,7 @@ const styles = StyleSheet.create({
|
||||
marginHorizontal: 16,
|
||||
marginVertical: 16,
|
||||
backgroundColor: '#FFB645',
|
||||
borderRadius: 12,
|
||||
borderRadius: 32,
|
||||
},
|
||||
cardContent: {
|
||||
position: 'absolute',
|
||||
@ -440,7 +439,7 @@ const styles = StyleSheet.create({
|
||||
fontWeight: '700',
|
||||
color: '#E2793F',
|
||||
backgroundColor: '#fff',
|
||||
paddingHorizontal: 8,
|
||||
paddingHorizontal: 16,
|
||||
paddingVertical: 2,
|
||||
borderRadius: 20,
|
||||
textAlign: 'center',
|
||||
@ -450,12 +449,12 @@ const styles = StyleSheet.create({
|
||||
display: 'flex',
|
||||
flexDirection: 'row',
|
||||
alignItems: 'center',
|
||||
gap: 4
|
||||
gap: 8
|
||||
},
|
||||
cardPointsText: {
|
||||
fontSize: 32,
|
||||
fontWeight: '700',
|
||||
color: '#4C320C',
|
||||
lineHeight: 32
|
||||
lineHeight: 36
|
||||
}
|
||||
});
|
||||
@ -67,7 +67,7 @@ const CategoryComponent = ({ title, data, bgSvg, style, width }: CategoryProps)
|
||||
</View>
|
||||
<ThemedText style={styles.itemTitle}>{item.title}</ThemedText>
|
||||
</View>
|
||||
<View style={{ alignSelf: 'flex-start', flex: 1 }}>
|
||||
<View style={{ alignSelf: 'flex-start', flex: 1, width: 100 }}>
|
||||
{item?.title === "Length" ? (
|
||||
typeof item.number === 'object' ? (
|
||||
renderTimeDisplay(item.number)
|
||||
|
||||
@ -6,14 +6,20 @@ import { Dimensions, StyleSheet, TouchableOpacity, View } from "react-native";
|
||||
import CardBg from './cardBg';
|
||||
import IpSvg from './ipSvg';
|
||||
|
||||
const MemberCard = ({ pro }: { pro: string }) => {
|
||||
const MemberCard = ({ pro, points }: { pro: string, points: number }) => {
|
||||
const { t } = useTranslation();
|
||||
const proPng = require("@/assets/images/png/owner/pro.png");
|
||||
const width = Dimensions.get("window").width;
|
||||
const router = useRouter();
|
||||
|
||||
return (
|
||||
<TouchableOpacity style={[styles.container]} onPress={() => router.push("/rights")}>
|
||||
<TouchableOpacity style={[styles.container]} onPress={() => router.push({
|
||||
pathname: '/rights',
|
||||
params: {
|
||||
points: points,
|
||||
pro: pro
|
||||
}
|
||||
})}>
|
||||
{/* 背景图 */}
|
||||
<View style={[styles.cardBg, { opacity: pro === "pro" ? 1 : 0.5 }]}>
|
||||
<CardBg pro={pro} date={"2025-09-05"} />
|
||||
|
||||
@ -50,7 +50,7 @@ const styles = StyleSheet.create({
|
||||
goPro: {
|
||||
backgroundColor: '#E2793F',
|
||||
borderRadius: 24,
|
||||
paddingVertical: 6,
|
||||
paddingVertical: 12,
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
width: "100%",
|
||||
|
||||
@ -64,10 +64,10 @@ const Premium = (props: Props) => {
|
||||
</ThemedText>
|
||||
<BlackStarSvg />
|
||||
</View>
|
||||
<ThemedText style={[styles.titleText, { fontSize: 16 }]}>
|
||||
<ThemedText style={[styles.titleText, { fontSize: 16, marginTop: item?.product_code === bestValue ? 0 : -10 }]}>
|
||||
{item.product_code?.split('_')[item.product_code?.split('_')?.length - 1]}
|
||||
</ThemedText>
|
||||
<ThemedText style={[styles.titleText, { fontSize: 32, lineHeight: 32 }]}>
|
||||
<ThemedText style={[styles.titleText, { fontSize: 32, lineHeight: 32, paddingVertical: item?.product_code === bestValue ? 0 : 5 }]}>
|
||||
$ {(Number(item.unit_price.amount) - Number(item.discount_amount.amount)).toFixed(2)}
|
||||
</ThemedText>
|
||||
<View style={{ flexDirection: 'row', alignItems: 'center' }}>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user