| @@ -164,6 +164,8 @@ async codePushUpdate() { | |||
| CodePush.allowRestart(); | |||
| await CodePush.getUpdateMetadata(CodePush.UpdateState.RUNNING) | |||
| .then((metadata: LocalPackage) => { | |||
| console.log(CodePush.UpdateState) | |||
| console.log(metadata) | |||
| this.setState({ versionInfo: metadata ? 'b'+NativeModules.BuildConfig.versionCode+"-" + metadata.label : 'b'+ NativeModules.BuildConfig.versionCode}); | |||
| versionInfo = this.state.versionInfo; | |||
| }, (error: any) => { | |||
| @@ -303,6 +305,9 @@ codePushStatusDidChange(syncStatus) { | |||
| let num = 0; | |||
| if (adDataList.length > 0 && adDataBgList.length > 0) { | |||
| num = 2; | |||
| this.setState({ | |||
| coverImgUrl: adDataBgList[0].coverImg | |||
| }) | |||
| } else if (adDataList.length > 0 && !adDataBgList.length) { | |||
| num = 0; | |||
| } else if (!adDataList.length && adDataBgList.length > 0) { | |||
| @@ -321,12 +326,6 @@ codePushStatusDidChange(syncStatus) { | |||
| this.showErrMsg(result.message+'\n'+this.state.macAddress); | |||
| } else if (result.data.list) { | |||
| //aaa | |||
| /* result.data.list[0].type = 2; | |||
| result.data.list[1].type = 2; | |||
| result.data.list[2].type = 2; | |||
| result.data.list[3].type = 2; | |||
| result.data.list[4].type = 2; | |||
| result.data.list[5].type = 2; */ | |||
| console.log(result.data) | |||
| //type==0的是券 1是? 2是广告大图 | |||
| let curData = result.data.list; | |||
| @@ -360,6 +359,7 @@ codePushStatusDidChange(syncStatus) { | |||
| if (result.code != 200) { | |||
| this.showErrMsg(result.message+'\n'+this.state.macAddress); | |||
| } else if (result.data) { | |||
| console.log(result.data) | |||
| this.setState({baseInfo:result.data}); | |||
| } else { | |||
| this.showErrMsg(errorMsg.ERR_DATA_GET); | |||
| @@ -398,7 +398,7 @@ async routine() { | |||
| hbRequestCount = heartConfig.heartbeatInterval | |||
| } | |||
| //如果是adType == 2时间间隔到了,要检验轮播是否走完在决定切换 | |||
| //如果是adType == 2时间间隔到了, | |||
| if (this.state.adType == 2) { | |||
| if (pageChangeCount<=0) { | |||
| let curNum = this.state.curAdType02Index + 1; | |||
| @@ -483,6 +483,7 @@ getContentViewItemMerchantName(contentItem) { | |||
| } | |||
| getContentViewItem(contentItem, annomation) { | |||
| console.log(contentItem) | |||
| if (!contentItem) | |||
| return ( | |||
| <View style={styles.contentItem}> | |||
| @@ -710,37 +711,17 @@ getAdView(){ | |||
| activeSlideOffset={0} | |||
| autoplay={true} | |||
| loop={true} | |||
| autoplayInterval={4500} | |||
| autoplayInterval={5000} | |||
| /> | |||
| </View> | |||
| </View> | |||
| ); | |||
| /* itemHeight={134} | |||
| sliderHeight={134} | |||
| adType == 2 滚动轮播 */ | |||
| /* <Swiper ref='scrollView' style={styles.adTypeSwiper02} autoplay={true} autoplayTimeout={1} showPagination={false} | |||
| dotColor="transparent" activeDotColor="transparent" horizontal={true} showsButtons={false}> | |||
| {this.renderAdTypeSwiper()} | |||
| </Swiper> */ | |||
| /* <View style={styles.bottomBox}> | |||
| <View style={styles.bottomLogoBackground}> | |||
| <Image source={{ uri: this.state.baseInfo.imgUrlH}} resizeMode='contain' style={styles.bottomLogo} /> | |||
| </View> | |||
| <View style={styles.bottomQrcode1Background}> | |||
| <Image source={{ uri: this.state.baseInfo.imgQrcodeWeapp}} resizeMode='center' style={styles.bottomQrcode1} /> | |||
| <Text style={styles.bottomQrcode1Str}>小程序</Text> | |||
| </View> | |||
| <View style={styles.bottomQrcode2Background}> | |||
| <Image source={{ uri: this.state.baseInfo.imgQrcodeWemp}} resizeMode='center' style={styles.bottomQrcode2} /> | |||
| <Text style={styles.bottomQrcode1Str}>公众号</Text> | |||
| </View> | |||
| <Text style={styles.bottomPlacehold}>{this.state.versionInfo}</Text> | |||
| </View> */ | |||
| } else if (this.state.adType == 1) { | |||
| let curWidthNum = 1080/(PixelRatio.get()) | |||
| let timeSpace = parseInt(Number(heartConfig.pageChangeInterval)*1000); | |||
| return( | |||
| <Carousel | |||
| ref={'carousel01'} | |||
| @@ -751,7 +732,7 @@ getAdView(){ | |||
| activeSlideOffset={0} | |||
| autoplay={true} | |||
| loop={true} | |||
| autoplayInterval={5000} | |||
| autoplayInterval={timeSpace} | |||
| /> | |||
| ) | |||
| } | |||