About.js 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. {/*app.versionName + ' Build ' + app.versionCode + */}
  26. <Text style={styles.copyright}>{'Copyright ' + getYearRange() + ' ' + app.company}</Text>
  27. </View>
  28. );
  29. }
  30. const getYearRange = () => {
  31. const y = new Date().getFullYear();
  32. var r = '©' + author;
  33. if (y > author) {
  34. r += '-' + y
  35. }
  36. return r;
  37. }
  38. const styles = StyleSheet.create({
  39. container: {
  40. flex: 1,
  41. alignItems: 'center',
  42. backgroundColor: colorLight
  43. },
  44. logo: {
  45. width: 215,
  46. height: 70,
  47. marginTop: $vw(25),
  48. marginBottom: 12
  49. },
  50. appName: {
  51. color: '#000',
  52. fontSize: 20,
  53. paddingTop: 5,
  54. textAlign: 'center'
  55. },
  56. versionName: {
  57. color: '#999',
  58. fontSize: 11,
  59. paddingTop: 4,
  60. textAlign: 'center',
  61. },
  62. copyright: {
  63. color: '#aaa',
  64. fontSize: 10,
  65. lineHeight: 14,
  66. marginBottom: 16,
  67. textAlign: 'center'
  68. },
  69. linkText: {
  70. ...ui.link,
  71. fontSize: 11,
  72. padding: 2,
  73. marginLeft: 4,
  74. marginRight: 4
  75. }
  76. })