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}