chargingDetailPage.tsx 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. import {
  2. View,
  3. Text,
  4. Pressable,
  5. Image,
  6. ScrollView,
  7. Alert,
  8. ImageBackground,
  9. ActivityIndicator,
  10. Dimensions
  11. } from 'react-native';
  12. import { SafeAreaView } from 'react-native-safe-area-context';
  13. import { router, useLocalSearchParams } from 'expo-router';
  14. import { CrossLogoSvg, PreviousPageBlackSvg } from '../../../../component/global/SVG';
  15. import { useEffect, useState } from 'react';
  16. import { FlashList } from '@shopify/flash-list';
  17. import DisplayedOnlyCouponTabView from '../../../../component/global/displayedOnlyCouponTabView';
  18. import NotificationTabView from '../../../../component/global/notificationTabViewComponent';
  19. import { chargeStationService } from '../../../../service/chargeStationService';
  20. import { formatToChineseDateTime } from '../../../../util/lib';
  21. const ChargingDetailPage = () => {
  22. const screenHeight = Dimensions.get('window').height;
  23. const { promotion } = useLocalSearchParams();
  24. const promotionObj = JSON.parse(promotion as string);
  25. const [loading, setLoading] = useState(false);
  26. return (
  27. <SafeAreaView className="flex-1 bg-white" edges={['top', 'right', 'left']}>
  28. <ScrollView>
  29. {loading ? (
  30. <View className="items-center justify-center">
  31. <ActivityIndicator />
  32. </View>
  33. ) : (
  34. <View style={{ minHeight: screenHeight, flex: 1 }} className="mx-[5%]">
  35. <View style={{ marginTop: 25 }}>
  36. <Pressable
  37. onPress={() => {
  38. if (router.canGoBack()) {
  39. router.back();
  40. } else {
  41. router.replace('/notificationPage');
  42. }
  43. }}
  44. hitSlop={{ top: 20, bottom: 20, left: 20, right: 20 }}
  45. >
  46. <CrossLogoSvg />
  47. </Pressable>
  48. <Text style={{ fontSize: 45, marginVertical: 25 }}>詳情</Text>
  49. </View>
  50. <View className="space-y-2 ">
  51. <Text className="text-base lg:text-lg">充電完成</Text>
  52. <Text className="text-sm">親愛的用戶,您的愛車已充滿電完成!請盡快駛離充電站,以便其他車輛使用。感謝您的配合!</Text>
  53. <Text className="text-xs text-gray-500 pt-8 pb-4">
  54. 最新更新日期:{formatToChineseDateTime(promotionObj.updatedAt)}
  55. </Text>
  56. </View>
  57. </View>
  58. )}
  59. </ScrollView>
  60. </SafeAreaView>
  61. );
  62. };
  63. export default ChargingDetailPage;