Setting.js 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. import React, { Component } from 'react'
  2. import {
  3. StyleSheet,
  4. View,
  5. Image,
  6. Text,
  7. StatusBar,
  8. Alert,
  9. ImageBackground,
  10. PixelRatio,
  11. TouchableOpacity,
  12. ScrollView,
  13. } from 'react-native'
  14. import { connect } from 'react-redux'
  15. import { createAction, NavigationActions } from '../../utils'
  16. import AboutLogo from '../../static/images/about-logo.png'
  17. import Icon from '../../components/Iconfont/Iconfont'
  18. @connect(({ app, theme }) => ({ ...app, ...theme }))
  19. class Setting extends Component {
  20. constructor(props) {
  21. super(props)
  22. this.state = {}
  23. }
  24. logout = () => {
  25. this.props.dispatch(createAction('app/logout')())
  26. }
  27. touchList() {
  28. return (
  29. <TouchableOpacity
  30. style={{ flexDirection: 'row', justifyContent: 'space-between' }}
  31. >
  32. <Text>sss</Text>
  33. </TouchableOpacity>
  34. )
  35. }
  36. // 头部
  37. header() {
  38. return (
  39. <View
  40. style={{
  41. height: HEADERSTYLE.height,
  42. paddingTop: HEADERSTYLE.paddingTop + 5,
  43. backgroundColor: '#fff',
  44. borderBottomColor: '#eee',
  45. borderBottomWidth: 1 / PixelRatio.get(),
  46. }}
  47. >
  48. <View
  49. style={{
  50. flex: 1,
  51. justifyContent: 'center',
  52. }}
  53. >
  54. <TouchableOpacity
  55. style={{ position: 'absolute', left: 10, flexDirection: 'row' }}
  56. onPress={() => this.props.dispatch(NavigationActions.back())}
  57. >
  58. <Icon
  59. name="icon-icon-fanhui"
  60. size={20}
  61. color={'#666'}
  62. style={{ marginTop: 4 }}
  63. />
  64. <Text
  65. style={{
  66. fontSize: 14,
  67. lineHeight: 20,
  68. color: '#666',
  69. alignSelf: 'center',
  70. }}
  71. >
  72. 返回
  73. </Text>
  74. </TouchableOpacity>
  75. <Text
  76. style={{
  77. alignSelf: 'center',
  78. fontSize: 18,
  79. lineHeight: 25,
  80. letterSpacing: 0.19,
  81. color: '#333',
  82. }}
  83. >
  84. 关于
  85. </Text>
  86. </View>
  87. </View>
  88. )
  89. }
  90. TouchList(item) {
  91. let returnVal = []
  92. for (let i = 0; i < item.length; i++) {
  93. returnVal.push(
  94. <TouchableOpacity
  95. key={i}
  96. onPress={() => item[i].onTouch()}
  97. style={{
  98. paddingVertical: 10,
  99. flexDirection: 'row',
  100. justifyContent: 'space-between',
  101. borderTopWidth: 1 / PixelRatio.get(),
  102. borderTopColor: '#EEE',
  103. }}
  104. >
  105. <View
  106. style={{
  107. flexDirection: 'row',
  108. }}
  109. >
  110. <Text
  111. style={{
  112. fontSize: 14,
  113. lineHeight: 20,
  114. color: '#333',
  115. marginLeft: 5,
  116. alignSelf: 'center',
  117. }}
  118. >
  119. {item[i].text}
  120. </Text>
  121. </View>
  122. <Icon name="icon-icon-jianjinzhishiqi" size={24} color={'#CCC'} />
  123. </TouchableOpacity>
  124. )
  125. }
  126. return (
  127. <View
  128. style={{
  129. marginTop: 10,
  130. paddingHorizontal: 10,
  131. backgroundColor: '#FFF',
  132. }}
  133. >
  134. {returnVal}
  135. </View>
  136. )
  137. }
  138. render() {
  139. const { login, appTheme } = this.props,
  140. basicInfo = [
  141. {
  142. text: '特别声明',
  143. onTouch: () => {},
  144. },
  145. {
  146. text: '使用帮助',
  147. onTouch: () => {},
  148. },
  149. {
  150. text: '给我评分',
  151. onTouch: () => {},
  152. },
  153. {
  154. text: '隐私政策',
  155. onTouch: () => {},
  156. },
  157. {
  158. text: '退出',
  159. onTouch: () => this.logout(),
  160. },
  161. ]
  162. return (
  163. <View
  164. style={[
  165. styles.container,
  166. { backgroundColor: appTheme.backgroundColor },
  167. ]}
  168. >
  169. <StatusBar
  170. animated={true}
  171. barStyle={appTheme.barStyle}
  172. // barStyle={"dark-content"}
  173. backgroundColor={'transparent'}
  174. translucent={true}
  175. />
  176. {/* 头部 */}
  177. {this.header()}
  178. {/* 查看详情 */}
  179. <View style={{ flex: 1 }}>
  180. <View style={{ paddingTop: 20, paddingBottom: 5 }}>
  181. <Image
  182. source={AboutLogo}
  183. style={{ width: 77, height: 50, alignSelf: 'center' }}
  184. />
  185. {/* <Text
  186. style={{
  187. fontSize: 14,
  188. color: '#999',
  189. marginTop: 12,
  190. alignSelf: 'center',
  191. }}
  192. >
  193. 渠道云销 2.0
  194. </Text> */}
  195. <Text
  196. style={{
  197. fontSize: 14,
  198. color: '#999',
  199. marginTop: 12,
  200. alignSelf: 'center',
  201. }}
  202. >
  203. 易下单
  204. </Text>
  205. </View>
  206. <ScrollView style={{ flex: 1 }}>
  207. {this.TouchList(basicInfo)}
  208. </ScrollView>
  209. </View>
  210. <View style={{ paddingBottom: 30 }}>
  211. <Text
  212. style={{
  213. fontSize: 10,
  214. color: '#999',
  215. letterSpacing: 0.12,
  216. alignSelf: 'center',
  217. }}
  218. >
  219. Copyright@2017-2018
  220. </Text>
  221. <Text
  222. style={{
  223. fontSize: 10,
  224. color: '#999',
  225. letterSpacing: 0.12,
  226. alignSelf: 'center',
  227. }}
  228. >
  229. {/* 京软信科 版权所有 */}
  230. 用友 Yonyou.com 版权所有
  231. </Text>
  232. </View>
  233. </View>
  234. )
  235. }
  236. }
  237. const styles = StyleSheet.create({
  238. container: {
  239. flex: 1,
  240. },
  241. })
  242. export default Setting