123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- /*
- * 搜索结果页面
- */
- import React, { Component } from "react";
- import {
- Platform,
- StyleSheet,
- Text,
- View,
- Image,
- TouchableOpacity,
- ImageBackground,
- Button,
- StatusBar,
- Modal,
- TouchableHighlight,
- DeviceEventEmitter,
- FlatList,
- TextInput
- } from "react-native";
- import BasePage from "./BasePage";
- import Dimensions from './utils/dimensions';
- import ShopBox from "./components/ShopBox";
- import TopicTitle from './components/TopicTitle';
- import ScrollRow from './components/ScrollRow';
- import CourseTitle from './components/CourseTitle';
- export default class SearchResult extends BasePage {
- componentDidMount() {
- const { searchText } = this.props.navigation.state.params;
- console.log('searchText',searchText)
- this.setState({
- text: searchText
- })
- // courseDetails.getCourseDetails(courseId).then(res => {
- // console.log('列表',res.data)
- // const courseList = res.data.course;
- // const wareList = res.data.wareList;
- // this.setState({
- // courseList,
- // wareList,
- // uri: wareList[0].playUrl
- // })
- // }).catch(err => {
- // console.log(err)
- // });
- }
- state = {
- text: ''
- };
- searchBox = () => {
- return (
- <View style={styles.searchBox}>
- <TextInput
- style={styles.searchInput}
- onChangeText={(text) => this.setState({ text })}
- value={this.state.text}
- renderItem={item => this.renderItem(item)}
- />
- </View>
- )
- }
- renderItem = (item) =>{
- return (
- <View>
-
- </View>
- )
- }
- render() {
- return (
- <View>
- <CourseTitle
- width={Dimensions.width}
- title="搜索"
- lefttype={1}
- textcolor={'#231F20'}
- backPress={() => this.goBack()}
- // backPress={() => alert("左侧按钮")}
- />
- {/* <FlatList
- ListHeaderComponent={() => this.searchBox()}
- /> */}
- </View>
- )
- }
- }
- const styles = StyleSheet.create({
- searchBox: {
- width: Dimensions.width,
- height: 60,
- alignItems: 'center',
- justifyContent: 'center',
- backgroundColor: '#f6f7f8'
- },
- searchInput: {
- width: '88.5%',
- height: 40,
- borderRadius: 20,
- backgroundColor: '#fff',
- paddingLeft: 15
- }
- })
|