소스 검색

【大屏】【添加】【图片预加载处理】

tags/jenkins-front-end-screenad-252-v141^0
caserKing 5 년 전
부모
커밋
70d90e01eb
1개의 변경된 파일14개의 추가작업 그리고 5개의 파일을 삭제
  1. +14
    -5
      App.js

+ 14
- 5
App.js 파일 보기

@@ -120,7 +120,7 @@ export default class MyPage extends Component {
curAdType02Index: 0, //广告图index curAdType02Index: 0, //广告图index
coverImgUrl: 'https://iformall-net.s3.cn-northwest-1.amazonaws.com.cn/456/37d833d7-263f-4f97-8588-e827c2f43db4.jpg', 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', previewImg: 'https://iformall-net.s3.cn-northwest-1.amazonaws.com.cn/456/37d833d7-263f-4f97-8588-e827c2f43db4.jpg',
curImgState: false,
}; };


/* this.codePushUpdate = this.codePushUpdate.bind(this); /* this.codePushUpdate = this.codePushUpdate.bind(this);
@@ -379,7 +379,13 @@ componentWillUnmount(){
async routine() { async routine() {
hbRequestCount -=1; hbRequestCount -=1;
getAdDataCount -=1; getAdDataCount -=1;
pageChangeCount -=1;
if (this.state.adType == 2 && this.state.curImgState) {
pageChangeCount -=1;
}
if (this.state.adType != 2) {
pageChangeCount -=1;
}


try { try {
if (getAdDataCount<=0) { if (getAdDataCount<=0) {
@@ -663,11 +669,14 @@ getAdView(){
<View style={styles.adWrapBox}> <View style={styles.adWrapBox}>
<Image style={styles.adWrapHideImg} <Image style={styles.adWrapHideImg}
onLoadStart={() => { onLoadStart={() => {

this.setState({
curImgState: false
})
}} }}
onLoad={() => { onLoad={() => {
this.setState({ this.setState({
coverImgUrl: this.state.previewImg
coverImgUrl: this.state.previewImg,
curImgState: true
}) })
}} }}
resizeMode="stretch" source={{uri: this.state.previewImg}}> resizeMode="stretch" source={{uri: this.state.previewImg}}>
@@ -689,7 +698,7 @@ getAdView(){
activeSlideOffset={0} activeSlideOffset={0}
autoplay={true} autoplay={true}
loop={true} loop={true}
autoplayInterval={3500}
autoplayInterval={4500}
/> />
</View> </View>
</View> </View>


불러오는 중...
취소
저장