From aec3707710b6b90dff69175a33c61e5111d6dd9a Mon Sep 17 00:00:00 2001 From: hupeng Date: Tue, 5 Mar 2019 20:23:53 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=A0=B7=E5=BC=8F][=E6=96=B0=E5=A2=9E]:?= =?UTF-8?q?=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 | 222 ++++++++++++++++++++++++++++++--------------------------- 1 file changed, 118 insertions(+), 104 deletions(-) diff --git a/App.js b/App.js index 717df96..0d351af 100644 --- a/App.js +++ b/App.js @@ -45,6 +45,8 @@ export default class MyPage extends Component { contentItem2:contentItemDefault, contentItem3:contentItemDefault, + contentDisplayStatus:true, + syncMessage: "INIT" , progress: { receivedBytes:0, @@ -134,6 +136,14 @@ componentDidMount() { this.getBaseInfo() this.getAdDataList() + setInterval( + ()=>{ + this.setState({ contentDisplayStatus: false}) + + this.setState({ contentDisplayStatus: true}) + }, + 5000, + ); } @@ -154,6 +164,113 @@ render() { ); } + if (this.state.contentDisplayStatus) { + var content = ( + + + + + + + + + {this.state.contentItem1.target.title} + {this.state.contentItem1.target.remark} + + + {this.state.contentItem1.target.priceStr} + + + + {this.state.contentItem1.target.salePriceStr}元 + + + + + + + + 肯德基 + + 扫码领取 + + + + + + + + + + + + + + + + {this.state.contentItem1.target.title} + {this.state.contentItem1.target.remark} + + + {this.state.contentItem1.target.priceStr} + + + + {this.state.contentItem1.target.salePriceStr}元 + + + + + + + + + 肯德基 + + 扫码领取 + + + + + + + + + + + + + + {this.state.contentItem1.target.title} + {this.state.contentItem1.target.remark} + + + {this.state.contentItem1.target.priceStr} + + + + {this.state.contentItem1.target.salePriceStr}元 + + + + + + + + + 肯德基 + + 扫码领取 + + + + + + ) + }else{ + var content = + } + return ( @@ -167,112 +284,9 @@ render() { - - - - - - - - - - - - {this.state.contentItem1.target.title} - {this.state.contentItem1.target.remark} - - - {this.state.contentItem1.target.priceStr} - - - - {this.state.contentItem1.target.salePriceStr}元 - - - - - - - - 肯德基 - - 扫码领取 - - - - - - - - - - - - - - - - {this.state.contentItem1.target.title} - {this.state.contentItem1.target.remark} - - - {this.state.contentItem1.target.priceStr} - - - - {this.state.contentItem1.target.salePriceStr}元 - - - - - - - - - 肯德基 - - 扫码领取 - - - - - - - - - - - - - - {this.state.contentItem1.target.title} - {this.state.contentItem1.target.remark} - - - {this.state.contentItem1.target.priceStr} - - - - {this.state.contentItem1.target.salePriceStr}元 - - - - - - - - - 肯德基 - - 扫码领取 - - - - - - + {content}