index.js 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. import React from 'react';
  2. import { Image, ScrollView, Alert ,StyleSheet, Text, View,TextInput } from 'react-native';
  3. import Button from 'antd-mobile-rn/lib/button';
  4. import { List,Switch,SearchBar } from 'antd-mobile-rn';
  5. import {Icon,Device} from '../../../tool'
  6. import commonStyles from '../../../styles/styles'
  7. const Item = List.Item;
  8. const Brief = Item.Brief;
  9. export default class App extends React.Component {
  10. constructor(props) {
  11. super(props);
  12. this. state = {
  13. //value: '美食',
  14. };
  15. }
  16. static navigationOptions ={
  17. title:'新的朋友'
  18. }
  19. onBlur = (value) => {
  20. //跳转
  21. }
  22. render() {
  23. const btn=(hasClick)=>{
  24. if(hasClick){
  25. return (
  26. // <Button></Button>
  27. <Text>2345</Text>
  28. )
  29. }else{
  30. return(
  31. <Text>123</Text>
  32. )
  33. }
  34. }
  35. return (
  36. <View style={commonStyles.page}>
  37. <View style={styles.searchBarWrap}>
  38. <View style={styles.serchWrap}>
  39. <Image style={styles.searchImg} source={Icon.Contact.search}/>
  40. <TextInput
  41. style={[styles.searchBar,{padding:0}]}
  42. placeholder="手机号/ID号搜索"
  43. // onFocus
  44. />
  45. </View>
  46. </View>
  47. <View style={styles.phoneCont}>
  48. <Image style={styles.phoneImg} source={Icon.Contact.phone}/>
  49. <Text style={styles.labelName} >添加手机联系人</Text>
  50. </View>
  51. <View style={styles.listWrap}>
  52. <View style={styles.list}>
  53. <Image
  54. style={styles.scanImg}
  55. source={Icon.Contact.scan}
  56. onPress={()=>{
  57. alert(1)
  58. }}
  59. />
  60. <View style={styles.listTitle}>
  61. <Text style={styles.listOne}>胡桃夹子</Text>
  62. <Text style={styles.listTwo}>可以加好友吗可以加好友吗可以加好友吗可以加好友吗</Text>
  63. </View>
  64. <View style={styles.isAdd}>
  65. <Text style={styles.isAdd1}>已添加</Text>
  66. </View>
  67. </View>
  68. <View style={styles.list}>
  69. <Image
  70. style={styles.scanImg}
  71. source={Icon.Contact.scan}
  72. onPress={()=>{
  73. alert(1)
  74. }}
  75. />
  76. <View style={styles.listTitle}>
  77. <Text style={styles.listOne}>胡桃夹子</Text>
  78. <Text style={styles.listTwo}>可以加好友吗可以加好友吗可以加好友吗可以加好友吗</Text>
  79. </View>
  80. <View style={styles.isAdd}>
  81. <Text style={styles.isAdd1}>已添加</Text>
  82. </View>
  83. </View>
  84. </View>
  85. </View>
  86. );
  87. }
  88. }
  89. const styles = StyleSheet.create({
  90. searchBarWrap:{
  91. backgroundColor:'#f0f0f0',
  92. height:Device.scale(58),
  93. },
  94. serchWrap:{
  95. borderRadius:Device.scale(8),
  96. height:Device.scale(36),
  97. backgroundColor:"#fff",
  98. flexDirection:"row",
  99. alignItems:"center",
  100. marginBottom:Device.scale(11),
  101. marginTop:Device.scale(11),
  102. marginLeft:Device.scale(8),
  103. marginRight:Device.scale(8),
  104. },
  105. searchImg:{
  106. width:Device.scale(17),
  107. height:Device.scale(17),
  108. marginLeft:Device.scale(8),
  109. marginRight:Device.scale(6),
  110. },
  111. searchBar:{
  112. width:Device.scale(320),
  113. paddingBottom:0,
  114. padding:0,
  115. height:Device.scale(36),
  116. },
  117. phoneImg:{
  118. width:Device.scale(23),
  119. height:Device.scale(32),
  120. marginBottom:Device.scale(8),
  121. marginTop:Device.scale(23),
  122. },
  123. phoneCont:{
  124. height:Device.scale(99),
  125. backgroundColor:"#fff",
  126. flexDirection:"column",
  127. alignItems: 'center',
  128. borderTopColor:'#000',
  129. borderBottomColor:'#000',
  130. borderTopWidth:1,
  131. borderBottomWidth:1,
  132. borderTopColor:"#d8d8d8",
  133. borderBottomColor:"#d8d8d8",
  134. },
  135. labelName:{
  136. fontSize:Device.scale(11),
  137. color:'#858484',
  138. },
  139. listWrap:{
  140. paddingLeft:Device.scale(10),
  141. marginTop:Device.scale(10),
  142. backgroundColor:"#FFF",
  143. borderBottomColor:"#e5e5e5",
  144. borderBottomWidth:1,
  145. borderTopColor:"#e5e5e5",
  146. borderTopWidth:1,
  147. },
  148. list:{
  149. height:Device.scale(55),
  150. borderBottomColor:"#e5e5e5",
  151. borderBottomWidth:1,
  152. flexDirection:"row",
  153. justifyContent:"center",
  154. alignItems:"center",
  155. paddingRight:Device.scale(10),
  156. },
  157. scanImg:{
  158. width:Device.scale(38),
  159. height:Device.scale(38),
  160. },
  161. listTitle:{
  162. flex:1,
  163. paddingLeft:Device.scale(10),
  164. },
  165. listOne:{
  166. fontSize:Device.scale(14),
  167. color:"#000",
  168. },
  169. listTwo:{
  170. fontSize:Device.scale(10),
  171. color:"#000",
  172. opacity:0.6,
  173. marginTop:8,
  174. width:Device.scale(190),
  175. height:Device.scale(12),
  176. // marginHorizontal: 5,
  177. flexShrink: 1
  178. },
  179. isAdd:{
  180. width:Device.scale(55),
  181. height:Device.scale(26),
  182. backgroundColor:"#1bc3fa",
  183. borderRadius:Device.scale(5),
  184. },
  185. isAdd1:{
  186. fontSize:Device.scale(13),
  187. color:"#fff",
  188. lineHeight:Device.scale(26),
  189. textAlign:"center",
  190. }
  191. });