AboutV2.js 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. /**
  2. * 关于页面 - 外部链接
  3. * @邠心vbe on 2021/4/7
  4. */
  5. import React from 'react';
  6. import { View, Text, Image, StyleSheet, Linking } 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. const policyList = [{
  12. name: "Terms of Use",
  13. url: app.storeUrl.termsUseUrl
  14. }, {
  15. name: "Privacy Policy",
  16. url: app.storeUrl.privacyPolicyUrl
  17. }, {
  18. name: "Refund Policy",
  19. url: app.storeUrl.refundUrl
  20. }]
  21. export default About = () => {
  22. return (
  23. <View style={styles.container}>
  24. <Image
  25. style={styles.logo}
  26. resizeMode='contain'
  27. source={require('../../images/about-logo.png')}/>
  28. {/* <Text style={styles.appName}>{app.displayName}</Text> */}
  29. <Text style={styles.versionName}>{app.versionName}</Text>
  30. <Text style={ui.flex1}></Text>
  31. <View style={styles.linkView}>
  32. { policyList.map((item, index) =>
  33. (
  34. <TextView
  35. key={index}
  36. style={styles.linkText}
  37. onPress={() => Linking.openURL(item.url)}>
  38. {item.name}
  39. </TextView>
  40. )
  41. )}
  42. </View>
  43. {/*app.versionName + ' Build ' + app.versionCode + */}
  44. <Text style={styles.copyright}>{'Copyright ' + getYearRange() + ' ' + app.company}</Text>
  45. </View>
  46. );
  47. }
  48. const getYearRange = () => {
  49. const y = new Date().getFullYear();
  50. var r = '©' + author;
  51. if (y > author) {
  52. r += '-' + y
  53. }
  54. return r;
  55. }
  56. const styles = StyleSheet.create({
  57. container: {
  58. flex: 1,
  59. alignItems: 'center',
  60. backgroundColor: colorLight
  61. },
  62. logo: {
  63. width: 215,
  64. height: 70,
  65. marginTop: $vw(25),
  66. marginBottom: 12
  67. },
  68. appName: {
  69. color: '#000',
  70. fontSize: 20,
  71. paddingTop: 5,
  72. textAlign: 'center'
  73. },
  74. versionName: {
  75. color: '#999',
  76. fontSize: 11,
  77. paddingTop: 4,
  78. textAlign: 'center',
  79. },
  80. copyright: {
  81. color: '#aaa',
  82. fontSize: 10,
  83. lineHeight: 14,
  84. marginBottom: 16,
  85. textAlign: 'center'
  86. },
  87. linkView: {
  88. width: $vw(90),
  89. alignItems: 'center',
  90. flexDirection: 'row',
  91. justifyContent: 'space-around'
  92. },
  93. linkText: {
  94. ...ui.link,
  95. fontSize: 11,
  96. padding: 2,
  97. marginLeft: 4,
  98. marginRight: 4
  99. }
  100. })