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