Преглед на файлове

【大屏】【添加】【给纯广告图的模式加上排名]

tags/jenkins-front-end-screenad-316-v172^0
caserKing преди 5 години
родител
ревизия
572ea9111a
променени са 1 файла, в които са добавени 29 реда и са изтрити 10 реда
  1. +29
    -10
      App.js

+ 29
- 10
App.js Целия файл

@@ -21,7 +21,7 @@ import DeviceInfo from "react-native-device-info";
import * as Animatable from 'react-native-animatable'; import * as Animatable from 'react-native-animatable';
import Swiper from 'react-native-swiper'; import Swiper from 'react-native-swiper';
import Carousel from 'react-native-snap-carousel'; import Carousel from 'react-native-snap-carousel';
import {BoxShadow} from 'react-native-shadow';
// import {BoxShadow} from 'react-native-shadow';
import StarRatingBar from 'react-native-star-rating-view/StarRatingBar'; import StarRatingBar from 'react-native-star-rating-view/StarRatingBar';


var testMac = 'FF:FF:FF:FF:FF:FF' var testMac = 'FF:FF:FF:FF:FF:FF'
@@ -129,7 +129,8 @@ export default class MyPage extends Component {
openRankList: false,//开启播放排名 openRankList: false,//开启播放排名
}; };

this.setAdSwiperItemDom = this.setAdSwiperItemDom.bind(this);
/* this.codePushUpdate = this.codePushUpdate.bind(this); /* this.codePushUpdate = this.codePushUpdate.bind(this);
this.startAd = this.startAd.bind(this); this.startAd = this.startAd.bind(this);
this.showErrMsg = this.showErrMsg.bind(this); */ this.showErrMsg = this.showErrMsg.bind(this); */
@@ -332,7 +333,7 @@ codePushStatusDidChange(syncStatus) {
} }
//aaa //aaa
// this.setState({adType: num }) // this.setState({adType: num })
this.setState({adType: 2 })
this.setState({adType: 1 })
adDataList.map(item => { adDataList.map(item => {
item.starNum = 3.4; item.starNum = 3.4;
item.logoUrl = item.coverImg; item.logoUrl = item.coverImg;
@@ -344,6 +345,14 @@ codePushStatusDidChange(syncStatus) {
this.setState({ this.setState({
merchantRankList: arr merchantRankList: arr
}) })
//aaa
if (this.state.adType == 1 && this.state.hasRankList) {
let obj = {
hasRank: true,
}
adDataBgList.push(obj)
}
} }


@@ -553,6 +562,8 @@ rankDom() {
} }
} else if (this.state.adType == 2) { } else if (this.state.adType == 2) {
animation = 'fadeIn'; animation = 'fadeIn';
} else if (this.state.adType == 1) {
animation = '';
} }
rankDomStack.push(this.rankItemDom(item,index,animation)); rankDomStack.push(this.rankItemDom(item,index,animation));
@@ -687,12 +698,20 @@ getContentView() {
} }
} }
setAdSwiperItemDom(item) { setAdSwiperItemDom(item) {
console.log(item)
let contentItem = item.item; let contentItem = item.item;
return (
<View style={styles.onlyAdSwiperItem}>
<Image source={{uri: contentItem.coverImg}} resizeMode='stretch' style={styles.onlyAdTypeItemImg} />
</View>
)
if (this.state.hasRankList && contentItem.hasRank != undefined && contentItem.hasRank) {
return (
this.renderRankDom()
)
} else {
return (
<View style={styles.onlyAdSwiperItem}>
<Image source={{uri: contentItem.coverImg}} resizeMode='stretch' style={styles.onlyAdTypeItemImg} />
</View>
)
}
} }
setSwiperItemDom(item) { setSwiperItemDom(item) {
let contentItem = item.item; let contentItem = item.item;
@@ -717,7 +736,7 @@ setSwiperItemDom(item) {
} }
return ( return (
<View style={styles.carouselItemWrap}> <View style={styles.carouselItemWrap}>
<BoxShadow setting={shadowOpt}>
{/* <BoxShadow setting={shadowOpt}> */}
<View> <View>
<View style={styles.contentItemTopForAd} key={index}> <View style={styles.contentItemTopForAd} key={index}>
<Image source={curLogo} resizeMode='center' style={styles.contentItemUpLayerLogo} /> <Image source={curLogo} resizeMode='center' style={styles.contentItemUpLayerLogo} />
@@ -747,7 +766,7 @@ setSwiperItemDom(item) {
</View> </View>
</View> </View>
</BoxShadow>
{/* </BoxShadow> */}
</View> </View>
) )
} }


Зареждане…
Отказ
Запис