From dd0aa0f8a49a8b0f2edc76ac9e8af2777af9c70d Mon Sep 17 00:00:00 2001 From: hupeng Date: Tue, 5 Mar 2019 10:52:10 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=A0=B7=E5=BC=8F][=E6=96=B0=E5=A2=9E]:?= =?UTF-8?q?=E4=BC=98=E6=83=A0=E5=88=B8=E5=8A=A8=E7=94=BB=E6=95=88=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.js | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/App.js b/App.js index c4c9786..a64d1de 100644 --- a/App.js +++ b/App.js @@ -17,6 +17,8 @@ import HttpUtils from './HttpUtils.js'; import CodePush from "react-native-code-push"; import DeviceInfo from "react-native-device-info"; +import * as Animatable from 'react-native-animatable'; + // 取得屏幕的宽高Dimensions const { width, height } = Dimensions.get('window'); @@ -143,9 +145,10 @@ getAdDataList() { .then(result => { this.setState({ adDataList : result.data.list}); - this.setState({ - contentItem1 : this.state.adDataList[0]}); - }) + if (this.state.adDataList.length > 0) + this.setState({ + contentItem1 : this.state.adDataList[0]}); + }) .catch(error => console.error(error)) } @@ -193,12 +196,12 @@ render() { - + - + {this.state.contentItem1.target.title} {this.state.contentItem1.target.remark} @@ -225,13 +228,14 @@ render() { - - + + + - + {this.state.contentItem1.target.title} {this.state.contentItem1.target.remark} @@ -257,14 +261,14 @@ render() { - + - + - + {this.state.contentItem1.target.title} {this.state.contentItem1.target.remark} @@ -290,7 +294,7 @@ render() { - + @@ -464,12 +468,12 @@ render() { }, //layer content item top - contentItemTopCover:{ + contentItemTopCoverImg:{ flex: 5, width:'100%', height:'100%', borderRadius:10, - backgroundColor:'blue' + backgroundColor:'transparent' }, contentItemTopDetail:{ flex: 6,