From 285a1b7c753e709390815f1b003b8c715a6e616b Mon Sep 17 00:00:00 2001 From: caserKing Date: Tue, 27 Aug 2019 19:24:36 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=A4=A7=E5=B1=8F=E3=80=91=E3=80=90?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E3=80=91=E3=80=90=E5=9B=BE=E7=89=87=E9=A2=84?= =?UTF-8?q?=E5=8A=A0=E8=BD=BD=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.js | 38 ++++++++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/App.js b/App.js index a128b38..2c95fbd 100644 --- a/App.js +++ b/App.js @@ -118,7 +118,8 @@ export default class MyPage extends Component { versionInfo:'未知', adType: 0, curAdType02Index: 0, //广告图index - curCoverImgUrl: '', + coverImgUrl: 'https://iformall-net.s3.cn-northwest-1.amazonaws.com.cn/456/37d833d7-263f-4f97-8588-e827c2f43db4.jpg', + previewImg: 'https://iformall-net.s3.cn-northwest-1.amazonaws.com.cn/456/37d833d7-263f-4f97-8588-e827c2f43db4.jpg', }; @@ -398,7 +399,7 @@ async routine() { } this.setState({ curAdType02Index: curNum, - curCoverImgUrl:adDataBgList[curNum].coverImg + previewImg:adDataBgList[curNum].coverImg }) pageChangeCount = heartConfig.pageChangeInterval } @@ -657,19 +658,23 @@ getAdView(){ ); } else if (this.state.adType == 2) { let curWidthNum = 1080/(PixelRatio.get()); - let curImgObj = null; - if (!this.state.curCoverImgUrl) { - curImgObj = require('./image/background.png'); - } else { - curImgObj = { - uri: this.state.curCoverImgUrl - } - } return ( // slideInDown zoomInDown - - + { + + }} + onLoad={() => { + this.setState({ + coverImgUrl: this.state.previewImg + }) + }} + resizeMode="stretch" source={{uri: this.state.previewImg}}> + + + + @@ -1227,6 +1232,15 @@ MyPage = CodePush(codePushOptions)(MyPage); top: 0, zIndex: 10, }, + adWrapHideImg: { + width: '100%', + height: '100%', + position: 'absolute', + left: 0, + top: 0, + zIndex: -1, + opacity:0, + }, adTypeSwiper02:{ flex: 1,