searchBar.js 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. import React from 'react';
  2. import { Image, ScrollView,TextInput} from 'react-native';
  3. import { StyleSheet, Text, View } from 'react-native';
  4. import { List } from 'antd-mobile-rn';
  5. import {Icon,Device} from '../../../tool'
  6. import {connect} from 'react-redux'
  7. class SearchBar extends React.Component {
  8. constructor(props){
  9. super(props)
  10. }
  11. render() {
  12. const {navigation} =this.props.props
  13. return (
  14. <View style={styles.searchBarWrap}>
  15. <View style={styles.serchWrap}>
  16. <Image style={styles.searchImg} source={Icon.Contact.search}/>
  17. {/* <TextInput
  18. style={[styles.searchBar,{padding:0}]}
  19. placeholder="手机号/ID号搜索"
  20. onFocus={()=>{
  21. navigation.navigate({ routeName:"Search" })
  22. }}
  23. /> */}
  24. <Text
  25. style={[styles.searchBar,{padding:0}]}
  26. onPress={()=>{
  27. navigation.navigate({ routeName:"Search" })
  28. }}
  29. >
  30. 手机号/ID号搜索
  31. </Text>
  32. </View>
  33. <View style={styles.tip}>
  34. <View style={[styles.tip1,{borderBottomWidth:1}]}
  35. onTouchStart={()=>{
  36. navigation.navigate({ routeName:"NewFriend" })
  37. }}
  38. >
  39. <Image style={styles.iconImg} source={Icon.Contact.newFriendIcon}/>
  40. <Text style={styles.tipTitle}>新的朋友</Text>
  41. </View>
  42. <View style={styles.tip1}>
  43. <Image style={styles.iconImg} source={Icon.Contact.groupChatIcon}/>
  44. <Text style={styles.tipTitle}>群聊</Text>
  45. </View>
  46. </View>
  47. </View>
  48. );
  49. }
  50. }
  51. export default connect()(SearchBar) ;
  52. const styles = StyleSheet.create({
  53. searchBarWrap:{
  54. backgroundColor:'#f0f0f0',
  55. height:Device.scale(170),
  56. },
  57. serchWrap:{
  58. borderRadius:Device.scale(8),
  59. height:Device.scale(36),
  60. backgroundColor:"#fff",
  61. flexDirection:"row",
  62. alignItems:"center",
  63. marginBottom:Device.scale(11),
  64. marginTop:Device.scale(11),
  65. marginLeft:Device.scale(10),
  66. marginRight:Device.scale(10),
  67. borderWidth:1,
  68. borderColor:'#c4c4c4'
  69. },
  70. searchImg:{
  71. width:Device.scale(17),
  72. height:Device.scale(17),
  73. marginLeft:Device.scale(8),
  74. marginRight:Device.scale(6),
  75. },
  76. searchBar:{
  77. width:Device.scale(320),
  78. paddingBottom:0,
  79. padding:0,
  80. height:Device.scale(36),
  81. lineHeight:Device.scale(36),
  82. color:'rgba(0,0,0,0.3)'
  83. },
  84. tip:{
  85. borderTopWidth:1,
  86. borderColor:"rgba(0,0,0,0.1)",
  87. height:Device.scale(113),
  88. backgroundColor:'#fff',
  89. // borderBottomWidth:1
  90. },
  91. tip1:{
  92. flexDirection:"row",
  93. alignItems:"center",
  94. height:Device.scale(55),
  95. borderColor:"rgba(0,0,0,0.1)",
  96. marginLeft:Device.scale(11),
  97. },
  98. iconImg:{
  99. width:Device.scale(38),
  100. height:Device.scale(38),
  101. borderRadius:Device.scale(5),
  102. marginRight:Device.scale(10),
  103. }
  104. });