About.js 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /**
  2. * 关于页面
  3. * @邠心vbe on 2021/4/7
  4. */
  5. import React from 'react';
  6. import { View, Text, Image, StyleSheet } from 'react-native';
  7. import app from '../../../app.json';
  8. import TextView from '../../components/TextView';
  9. import { PageList } from '../Router';
  10. const author = 2023;
  11. export default About = () => {
  12. return (
  13. <View style={styles.container}>
  14. <Image
  15. style={styles.logo}
  16. resizeMode='contain'
  17. source={require('../../images/about-logo.png')}/>
  18. {/* <Text style={styles.appName}>{app.displayName}</Text> */}
  19. <Text style={styles.versionName}>{app.versionName}</Text>
  20. <Text style={ui.flex1}></Text>
  21. <View style={ui.flexcc}>
  22. <TextView style={styles.linkText} onPress={() => startPage(PageList.condition)}>{$t("drawer.termsOfUse")}</TextView>
  23. <TextView style={styles.linkText} onPress={() => startPage(PageList.privacy)}>{$t("drawer.privacyPolicy")}</TextView>
  24. </View>
  25. <Text style={styles.copyright}>{'Copyright ' + /*app.versionName + ' Build ' + app.versionCode + */getYearRange()+' LUMI CHARGING PTE. LTD.'}</Text>
  26. </View>
  27. );
  28. }
  29. const getYearRange = () => {
  30. const y = new Date().getFullYear();
  31. var r = '©' + author;
  32. if (y > author) {
  33. r += '-' + y
  34. }
  35. return r;
  36. }
  37. const styles = StyleSheet.create({
  38. container: {
  39. flex: 1,
  40. alignItems: 'center',
  41. backgroundColor: colorLight
  42. },
  43. logo: {
  44. width: 215,
  45. height: 70,
  46. marginTop: $vw(25),
  47. marginBottom: 12
  48. },
  49. appName: {
  50. color: '#000',
  51. fontSize: 20,
  52. paddingTop: 5,
  53. textAlign: 'center'
  54. },
  55. versionName: {
  56. color: '#999',
  57. fontSize: 11,
  58. paddingTop: 4,
  59. textAlign: 'center',
  60. },
  61. copyright: {
  62. color: '#aaa',
  63. fontSize: 10,
  64. lineHeight: 14,
  65. marginBottom: 16,
  66. textAlign: 'center'
  67. },
  68. linkText: {
  69. ...ui.link,
  70. fontSize: 10,
  71. padding: 1,
  72. marginLeft: 4,
  73. marginRight: 4
  74. }
  75. })