searchResult.js 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /*
  2. * 搜索结果页面
  3. */
  4. import React, { Component } from "react";
  5. import {
  6. Platform,
  7. StyleSheet,
  8. Text,
  9. View,
  10. Image,
  11. TouchableOpacity,
  12. ImageBackground,
  13. Button,
  14. StatusBar,
  15. Modal,
  16. TouchableHighlight,
  17. DeviceEventEmitter,
  18. FlatList,
  19. TextInput
  20. } from "react-native";
  21. import BasePage from "./BasePage";
  22. import Dimensions from './utils/dimensions';
  23. import ShopBox from "./components/ShopBox";
  24. import TopicTitle from './components/TopicTitle';
  25. import ScrollRow from './components/ScrollRow';
  26. export default class SearchResult extends BasePage {
  27. state = {
  28. text: '123123123123'
  29. };
  30. searchBox = () => {
  31. return (
  32. <View style={styles.searchBox}>
  33. <TextInput
  34. style={styles.searchInput}
  35. onChangeText={(text) => this.setState({ text })}
  36. value={this.state.text}
  37. renderItem={item => this.renderItem(item)}
  38. />
  39. </View>
  40. )
  41. }
  42. renderItem = (item) =>{
  43. return (
  44. <View>
  45. </View>
  46. )
  47. }
  48. render() {
  49. return (
  50. <FlatList
  51. ListHeaderComponent={() => this.searchBox()}
  52. />
  53. )
  54. }
  55. }
  56. const styles = StyleSheet.create({
  57. searchBox: {
  58. width: Dimensions.width,
  59. height: 60,
  60. alignItems: 'center',
  61. justifyContent: 'center',
  62. backgroundColor: '#f6f7f8'
  63. },
  64. searchInput: {
  65. width: '88.5%',
  66. height: 40,
  67. borderRadius: 20,
  68. backgroundColor: '#fff'
  69. }
  70. })