|
|
@ -6,14 +6,24 @@ import { |
|
|
|
TouchableOpacity, |
|
|
|
TouchableOpacity, |
|
|
|
StyleSheet, |
|
|
|
StyleSheet, |
|
|
|
ScrollView, |
|
|
|
ScrollView, |
|
|
|
|
|
|
|
BackHandler, |
|
|
|
} from "react-native"; |
|
|
|
} from "react-native"; |
|
|
|
|
|
|
|
import { useNavigation, useFocusEffect } from "@react-navigation/native"; |
|
|
|
|
|
|
|
import { NativeStackNavigationProp } from "@react-navigation/native-stack"; |
|
|
|
import fontSize from "../../utils/fontsizeUtils"; |
|
|
|
import fontSize from "../../utils/fontsizeUtils"; |
|
|
|
|
|
|
|
|
|
|
|
// import { useRoute, RouteProp } from "@react-navigation/native";
|
|
|
|
// import { useRoute, RouteProp } from "@react-navigation/native";
|
|
|
|
// import { RootStackParamList } from "../../navigation/types";
|
|
|
|
// import { RootStackParamList } from "../../navigation/types";
|
|
|
|
// import { payApi } from "../../services/api/payApi";
|
|
|
|
// import { payApi } from "../../services/api/payApi";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
type RootStackParamList = { |
|
|
|
|
|
|
|
MainTabs: { screen: string } | undefined; |
|
|
|
|
|
|
|
PaymentSuccessScreen: undefined; |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
export const PaymentSuccessScreen = () => { |
|
|
|
export const PaymentSuccessScreen = () => { |
|
|
|
|
|
|
|
const navigation = useNavigation<NativeStackNavigationProp<RootStackParamList>>(); |
|
|
|
|
|
|
|
|
|
|
|
// const route = useRoute<RouteProp<RootStackParamList, 'PaymentSuccessScreen'>>();
|
|
|
|
// const route = useRoute<RouteProp<RootStackParamList, 'PaymentSuccessScreen'>>();
|
|
|
|
// const { paymentId, PayerID } = route.params;
|
|
|
|
// const { paymentId, PayerID } = route.params;
|
|
|
|
// console.log("paymentId", paymentId);
|
|
|
|
// console.log("paymentId", paymentId);
|
|
|
@ -27,6 +37,46 @@ export const PaymentSuccessScreen = () => { |
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }, [paymentId, PayerID]);
|
|
|
|
// }, [paymentId, PayerID]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 处理系统返回,返回到首页
|
|
|
|
|
|
|
|
useFocusEffect( |
|
|
|
|
|
|
|
React.useCallback(() => { |
|
|
|
|
|
|
|
const onBackPress = () => { |
|
|
|
|
|
|
|
navigation.reset({ |
|
|
|
|
|
|
|
index: 0, |
|
|
|
|
|
|
|
routes: [{
|
|
|
|
|
|
|
|
name: 'MainTabs', |
|
|
|
|
|
|
|
params: { screen: 'Home' } |
|
|
|
|
|
|
|
}], |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
return true; // 阻止默认返回行为
|
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 监听硬件返回按钮(Android)
|
|
|
|
|
|
|
|
const backHandler = BackHandler; |
|
|
|
|
|
|
|
const subscription = backHandler.addEventListener('hardwareBackPress', onBackPress); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 监听导航事件(iOS手势返回和导航栏返回按钮)
|
|
|
|
|
|
|
|
const unsubscribe = navigation.addListener('beforeRemove', (e) => { |
|
|
|
|
|
|
|
// 阻止默认行为
|
|
|
|
|
|
|
|
e.preventDefault(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 执行自定义返回逻辑
|
|
|
|
|
|
|
|
navigation.reset({ |
|
|
|
|
|
|
|
index: 0, |
|
|
|
|
|
|
|
routes: [{
|
|
|
|
|
|
|
|
name: 'MainTabs', |
|
|
|
|
|
|
|
params: { screen: 'Home' } |
|
|
|
|
|
|
|
}], |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return () => { |
|
|
|
|
|
|
|
subscription?.remove(); |
|
|
|
|
|
|
|
unsubscribe(); |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
}, [navigation]) |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<ScrollView style={styles.container} showsVerticalScrollIndicator={false} > |
|
|
|
<ScrollView style={styles.container} showsVerticalScrollIndicator={false} > |
|
|
|
<View style={styles.header}> |
|
|
|
<View style={styles.header}> |
|
|
@ -35,32 +85,32 @@ export const PaymentSuccessScreen = () => { |
|
|
|
<View style={styles.headerSuccessText}> |
|
|
|
<View style={styles.headerSuccessText}> |
|
|
|
<Text style={styles.headerSuccessTextTitle}>支付成功</Text> |
|
|
|
<Text style={styles.headerSuccessTextTitle}>支付成功</Text> |
|
|
|
</View> |
|
|
|
</View> |
|
|
|
<View style={styles.headerPriceText}> |
|
|
|
{/* <View style={styles.headerPriceText}> |
|
|
|
<Text style={styles.headerPriceTextTitle}>73800FCFA</Text> |
|
|
|
<Text style={styles.headerPriceTextTitle}>73800FCFA</Text> |
|
|
|
</View> |
|
|
|
</View> */} |
|
|
|
</View> |
|
|
|
</View> |
|
|
|
|
|
|
|
|
|
|
|
<View style={styles.headerSuccessInfo}> |
|
|
|
<View style={styles.headerSuccessInfo}> |
|
|
|
<View style={styles.headerSuccessInfoItem}> |
|
|
|
{/* <View style={styles.headerSuccessInfoItem}> |
|
|
|
<Text style={styles.headerSuccessInfoItemText}>现代电话</Text> |
|
|
|
<Text style={styles.headerSuccessInfoItemText}>现代电话</Text> |
|
|
|
<Text style={styles.headerSuccessInfoItemText1}>17088752341</Text> |
|
|
|
<Text style={styles.headerSuccessInfoItemText1}>17088752341</Text> |
|
|
|
</View> |
|
|
|
</View> */} |
|
|
|
<View style={styles.headerSuccessInfoItem1}> |
|
|
|
{/* <View style={styles.headerSuccessInfoItem1}> |
|
|
|
<Text style={styles.headerSuccessInfoItemText}>地址</Text> |
|
|
|
<Text style={styles.headerSuccessInfoItemText}>地址</Text> |
|
|
|
<Text style={styles.headerSuccessInfoItemText1}>河南省</Text> |
|
|
|
<Text style={styles.headerSuccessInfoItemText1}>河南省</Text> |
|
|
|
</View> |
|
|
|
</View> */} |
|
|
|
</View> |
|
|
|
</View> |
|
|
|
<View style={styles.headerSuccessInfoItem2}> |
|
|
|
<View style={styles.headerSuccessInfoItem2}> |
|
|
|
<Text>货到仓库后,打电话联系您</Text> |
|
|
|
<Text>货到仓库后,打电话联系您</Text> |
|
|
|
</View> |
|
|
|
</View> |
|
|
|
<View style={styles.button}> |
|
|
|
{/* <View style={styles.button}> |
|
|
|
<View style={styles.buttonItem}> |
|
|
|
<View style={styles.buttonItem}> |
|
|
|
<Text style={styles.buttonText}>查看订单</Text> |
|
|
|
<Text style={styles.buttonText}>查看订单</Text> |
|
|
|
</View> |
|
|
|
</View> |
|
|
|
<View style={styles.buttonItem}> |
|
|
|
<View style={styles.buttonItem}> |
|
|
|
<Text style={styles.buttonText}>订单详情</Text> |
|
|
|
<Text style={styles.buttonText}>订单详情</Text> |
|
|
|
</View> |
|
|
|
</View> |
|
|
|
</View> |
|
|
|
</View> */} |
|
|
|
</View> |
|
|
|
</View> |
|
|
|
|
|
|
|
|
|
|
|
<View style={styles.recommend}> |
|
|
|
<View style={styles.recommend}> |
|
|
|