UNPKG

uatcomponent

Version:
47 lines (43 loc) 1.92 kB
import React, { Component } from 'react'; import { View,StyleSheet, } from "react-native"; import * as Model from "./src/model"; import { SearchBar } from './src/container/searchBar/searchBar'; import { ImgNav } from './src/container/imgNav/imgNav'; import { Banner } from './src/container/banner/banner'; import { BlankLine } from './src/container/blankLine/blankLine'; import { Window } from './src/container/window/window'; import { RecommendProductList } from 'uatcomponent/src/container/recommendProductList/recommendProductList'; import { RecommendCategory } from 'uatcomponent/src/container/recommendCategory/recommendCategory'; import { RecommendSeries } from 'uatcomponent/src/container/recommendSeries/recommendSeries'; import { ProductList } from 'uatcomponent/src/container/productList/productList'; /** * 生成入口函数 * @param {} data */ type Props = Model.ComponentProps<Model.ComponentBase<Object>,Model.NaviParams>; type State = {}; export default class UatComponent extends Component <Props,State>{ /**渲染特殊组建 */ renderNormal = ()=>{ return <View style={styles.normal}/> } render(){ const {data} = this.props; if(!data)return this.renderNormal() switch(data.type){ case 4:return <ProductList {...this.props}/>; case 5:return <RecommendProductList {...this.props}/>; // case 6:return <SearchBar {...this.props} />//暂时不用,前段固定 case 8:return <ImgNav {...this.props}/> case 9:return <Banner {...this.props}/> case 11:return <BlankLine {...this.props}/> case 13:return <Window {...this.props}/> case 88:return <RecommendCategory {...this.props}/>; case 89:return <RecommendSeries {...this.props}/>; default:return this.renderNormal(); } } } const styles = StyleSheet.create({ normal : {width:100,height:0} })