|
|
@@ -22,6 +22,7 @@ import * as Animatable from 'react-native-animatable'; |
|
|
|
import Swiper from 'react-native-swiper'; |
|
|
|
import Carousel from 'react-native-snap-carousel'; |
|
|
|
// import {BoxShadow} from 'react-native-shadow'; |
|
|
|
import StarRatingBar from 'react-native-star-rating-view/StarRatingBar'; |
|
|
|
|
|
|
|
var testMac = 'FF:FF:FF:FF:FF:FF' |
|
|
|
var curAdIndex = 0; |
|
|
@@ -71,6 +72,7 @@ const shadowOpt = { |
|
|
|
} |
|
|
|
|
|
|
|
var curTimer = null; |
|
|
|
var curRankTimer = null; |
|
|
|
|
|
|
|
var hbRequestCount |
|
|
|
var getAdDataCount |
|
|
@@ -122,8 +124,13 @@ export default class MyPage extends Component { |
|
|
|
coverImgUrl: '', |
|
|
|
previewImg: '', |
|
|
|
curImgState: false, |
|
|
|
merchantRankList: [], |
|
|
|
hasRankList: true,// 有排名列表 |
|
|
|
openRankList: false,//开启播放排名 |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
this.setAdSwiperItemDom = this.setAdSwiperItemDom.bind(this); |
|
|
|
/* this.codePushUpdate = this.codePushUpdate.bind(this); |
|
|
|
this.startAd = this.startAd.bind(this); |
|
|
|
this.showErrMsg = this.showErrMsg.bind(this); */ |
|
|
@@ -239,6 +246,7 @@ codePushStatusDidChange(syncStatus) { |
|
|
|
this.setState({contentItem2:null}); |
|
|
|
|
|
|
|
curAdIndex+=3 |
|
|
|
|
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
@@ -253,7 +261,7 @@ codePushStatusDidChange(syncStatus) { |
|
|
|
heartConfig.heartbeatInterval = config.heartbeatInterval |
|
|
|
heartConfig.dataRefreshInterval=config.dataRefreshInterval |
|
|
|
heartConfig.pageChangeInterval=config.pageChangeInterval |
|
|
|
|
|
|
|
|
|
|
|
// 动画划入 |
|
|
|
if(config.animationTheme == 0){ |
|
|
|
this.setState({ |
|
|
@@ -290,8 +298,22 @@ codePushStatusDidChange(syncStatus) { |
|
|
|
this.setState({contentDisplayStatus: false}) |
|
|
|
this.setState({errorMessage : errMsg}); |
|
|
|
} |
|
|
|
//开启 排名页播放的计时器 |
|
|
|
dealRankTimer(type) { |
|
|
|
if (type) { |
|
|
|
let num = Number(heartConfig.pageChangeInterval) * 1000; |
|
|
|
curRankTimer = setInterval(() => { |
|
|
|
this.setState({ |
|
|
|
openRankList: false |
|
|
|
}) |
|
|
|
clearInterval(curRankTimer); |
|
|
|
},num) |
|
|
|
} else { |
|
|
|
clearInterval(curRankTimer); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//判断播放类型adType |
|
|
|
//判断播放类型adType 0 纯券 1纯广告图 2 广告图+券 |
|
|
|
dealLoopType(dataList) { |
|
|
|
adDataList = dataList.filter((item) => { |
|
|
|
return item.type == 0; |
|
|
@@ -299,7 +321,15 @@ codePushStatusDidChange(syncStatus) { |
|
|
|
adDataBgList = dataList.filter((item) => { |
|
|
|
return item.type == 2; |
|
|
|
}) |
|
|
|
//aaa |
|
|
|
let merchantRankList = dataList.filter((item) => { |
|
|
|
if (item.type == 3) { |
|
|
|
item.extInfo = JSON.parse(item.extInfo); |
|
|
|
item.extInfo.executionIndex = Number(item.extInfo.executionIndex); |
|
|
|
item.extInfo.populationIndex = Number(item.extInfo.populationIndex); |
|
|
|
} |
|
|
|
return item.type == 3; |
|
|
|
}) |
|
|
|
// |
|
|
|
let num = 0; |
|
|
|
if (adDataList.length > 0 && adDataBgList.length > 0) { |
|
|
|
num = 2; |
|
|
@@ -309,7 +339,23 @@ codePushStatusDidChange(syncStatus) { |
|
|
|
} else if (!adDataList.length && adDataBgList.length > 0) { |
|
|
|
num = 1; |
|
|
|
} |
|
|
|
//aaa |
|
|
|
this.setState({adType: num }) |
|
|
|
this.setState({ |
|
|
|
merchantRankList: merchantRankList, |
|
|
|
hasRankList: merchantRankList.length > 0 ? true:false |
|
|
|
}) |
|
|
|
console.log(merchantRankList) |
|
|
|
console.log(this.state.hasRankList) |
|
|
|
//aaa |
|
|
|
if (this.state.adType == 1 && this.state.hasRankList) { |
|
|
|
let obj = { |
|
|
|
hasRank: true, |
|
|
|
} |
|
|
|
adDataBgList.push(obj) |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
getAdDataList(first) { |
|
|
@@ -321,7 +367,7 @@ codePushStatusDidChange(syncStatus) { |
|
|
|
if (result.code != 200) { |
|
|
|
this.showErrMsg(result.message+'\n'+this.state.macAddress); |
|
|
|
} else if (result.data.list) { |
|
|
|
//aaa |
|
|
|
// |
|
|
|
//type==0的是券 1是? 2是广告大图 |
|
|
|
let curData = result.data.list; |
|
|
|
this.dealLoopType(curData); |
|
|
@@ -375,13 +421,17 @@ componentWillUnmount(){ |
|
|
|
async routine() { |
|
|
|
hbRequestCount -=1; |
|
|
|
getAdDataCount -=1; |
|
|
|
if (this.state.adType == 2 && this.state.curImgState) { |
|
|
|
pageChangeCount -=1; |
|
|
|
} |
|
|
|
if (this.state.adType != 2) { |
|
|
|
pageChangeCount -=1; |
|
|
|
//等待第一次图片加载完成再倒计时 |
|
|
|
if (!this.state.openRankList) { |
|
|
|
if (this.state.adType == 2 && this.state.curImgState) { |
|
|
|
pageChangeCount -=1; |
|
|
|
} |
|
|
|
if (this.state.adType != 2) { |
|
|
|
pageChangeCount -=1; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
if (getAdDataCount<=0) { |
|
|
@@ -395,10 +445,21 @@ async routine() { |
|
|
|
//如果是adType == 2时间间隔到了,要检验轮播是否走完在决定切换 |
|
|
|
if (this.state.adType == 2) { |
|
|
|
if (pageChangeCount<=0) { |
|
|
|
|
|
|
|
let curNum = this.state.curAdType02Index + 1; |
|
|
|
if (curNum >= adDataBgList.length) { |
|
|
|
//如果播放到了最后一页,接下来暂停计时器,可能播放商户排名页 |
|
|
|
if (!this.state.openRankList) { |
|
|
|
this.dealRankTimer(true); |
|
|
|
this.setState({ |
|
|
|
openRankList: true, |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
curNum = 0; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.setState({ |
|
|
|
curAdType02Index: curNum, |
|
|
|
previewImg:adDataBgList[curNum].coverImg |
|
|
@@ -409,6 +470,13 @@ async routine() { |
|
|
|
|
|
|
|
} else if (this.state.adType == 0) { |
|
|
|
if (pageChangeCount <= 0) { //页面切换间隔 |
|
|
|
//如果播放到了最后一页,接下来暂停计时器,可能播放商户排名页 |
|
|
|
if (curAdIndex >= adDataList.length) { |
|
|
|
this.dealRankTimer(true); |
|
|
|
this.setState({ |
|
|
|
openRankList: true, |
|
|
|
}) |
|
|
|
} |
|
|
|
if (this.state.contentDisplayStatus && this.state.baseInfo) { |
|
|
|
this.setState({ contentDisplayStatus: false}) |
|
|
|
if (this.updateContent()) { |
|
|
@@ -475,7 +543,95 @@ getContentViewItemMerchantName(contentItem) { |
|
|
|
return contentItem.target.merchantVoList[0].merchantName; |
|
|
|
} |
|
|
|
} |
|
|
|
//排名 rank dom |
|
|
|
rankDom() { |
|
|
|
let rankDomStack = []; |
|
|
|
let {merchantRankList,} = this.state; |
|
|
|
|
|
|
|
if (merchantRankList.length > 0) { |
|
|
|
merchantRankList.map((item,index) => { |
|
|
|
let animation = ''; |
|
|
|
if (this.state.adType == 0) { |
|
|
|
if (index == 0) { |
|
|
|
animation = this.state.animationTheme.first; |
|
|
|
} else if (index == 1) { |
|
|
|
animation = this.state.animationTheme.second; |
|
|
|
} else if (index == 2) { |
|
|
|
animation = this.state.animationTheme.third; |
|
|
|
} else if (index == 3) { |
|
|
|
animation = this.state.animationTheme.second; |
|
|
|
} else if (index == 4) { |
|
|
|
animation = this.state.animationTheme.third; |
|
|
|
} |
|
|
|
} else if (this.state.adType == 2) { |
|
|
|
animation = 'fadeIn'; |
|
|
|
} else if (this.state.adType == 1) { |
|
|
|
animation = ''; |
|
|
|
} |
|
|
|
|
|
|
|
rankDomStack.push(this.rankItemDom(item,index,animation)); |
|
|
|
}) |
|
|
|
} |
|
|
|
return rankDomStack; |
|
|
|
} |
|
|
|
//每一条 rank |
|
|
|
rankItemDom(item,index,animation) { |
|
|
|
let fontSizeNum = 40/(PixelRatio.get()); |
|
|
|
let fontSizeNum02 = 46/(PixelRatio.get()); |
|
|
|
let curStyleObj = { |
|
|
|
width: fontSizeNum, |
|
|
|
height: fontSizeNum, |
|
|
|
} |
|
|
|
let curStyleObj02 = { |
|
|
|
width: fontSizeNum02, |
|
|
|
height: fontSizeNum02, |
|
|
|
} |
|
|
|
return ( |
|
|
|
<Animatable.View animation={animation} style={styles.rankItemBox} key={index}> |
|
|
|
<Image style={styles.RankLogo} resizeMode="stretch" source={{uri:item.coverImg}}></Image> |
|
|
|
<View style={styles.rankContent}> |
|
|
|
<Text style={styles.merchantText} numberOfLines={1} ellipsizeMode="tail">{item.title}</Text> |
|
|
|
<View style={styles.rankRunBox}> |
|
|
|
<View style={styles.rankRun01}> |
|
|
|
<Text style={styles.starTitle}>经营指数: {item.extInfo.executionIndex} 分</Text> |
|
|
|
<View style={{height: fontSizeNum,flexDirection: 'row', alignItems: 'center',marginTop:22/PixelRatio.get()}}> |
|
|
|
<StarRatingBar |
|
|
|
score={item.extInfo.executionIndex} |
|
|
|
allowsHalfStars={true} |
|
|
|
accurateHalfStars={true} |
|
|
|
starStyle={curStyleObj} |
|
|
|
emptyStarImage={<Image style={curStyleObj} resizeMode="stretch" source={require('./image/star_gray.png')} />} |
|
|
|
filledStarImage={<Image style={curStyleObj} resizeMode="stretch" source={require('./image/star_yellow.png')} />} |
|
|
|
scoreTextStyle={{color:'transparent'}} |
|
|
|
/> |
|
|
|
</View> |
|
|
|
|
|
|
|
</View> |
|
|
|
|
|
|
|
<View style={styles.rankRun02}> |
|
|
|
<Text style={styles.starTitle}>人气指数: {item.extInfo.populationIndex} 分</Text> |
|
|
|
<View style={{height: fontSizeNum,flexDirection: 'row', alignItems: 'center',marginTop:22/PixelRatio.get()}}> |
|
|
|
<StarRatingBar |
|
|
|
score={item.extInfo.populationIndex} |
|
|
|
allowsHalfStars={true} |
|
|
|
accurateHalfStars={true} |
|
|
|
starStyle={curStyleObj02} |
|
|
|
emptyStarImage={<Image style={curStyleObj02} resizeMode="stretch" source={require('./image/hot_gray.png')} />} |
|
|
|
filledStarImage={<Image style={curStyleObj02} resizeMode="stretch" source={require('./image/hot_yellow.png')} />} |
|
|
|
scoreTextStyle={{color:'transparent'}} |
|
|
|
/> |
|
|
|
</View> |
|
|
|
</View> |
|
|
|
</View> |
|
|
|
|
|
|
|
</View> |
|
|
|
|
|
|
|
<Image source={{uri:item.target.qrCode}} resizeMode="stretch" style={styles.rankQrcodeImg}></Image> |
|
|
|
|
|
|
|
</Animatable.View> |
|
|
|
) |
|
|
|
} |
|
|
|
//券列表content部分 |
|
|
|
getContentViewItem(contentItem, annomation) { |
|
|
|
if (!contentItem) |
|
|
|
return ( |
|
|
@@ -485,7 +641,7 @@ getContentViewItem(contentItem, annomation) { |
|
|
|
|
|
|
|
actionText = this.getContentViewItemActionStr(contentItem); |
|
|
|
merchantName = this.getContentViewItemMerchantName(contentItem); |
|
|
|
//aaa |
|
|
|
// |
|
|
|
// contentItem.target.salePriceStr = 234005.8; |
|
|
|
// console.warn(annomation) |
|
|
|
let curNumStr = contentItem.target.salePriceStr+''; |
|
|
@@ -536,25 +692,33 @@ getContentViewItem(contentItem, annomation) { |
|
|
|
|
|
|
|
getContentView() { |
|
|
|
if (this.state.contentDisplayStatus) { |
|
|
|
//aaa |
|
|
|
return (<View style={styles.content}> |
|
|
|
{this.getContentViewItem(this.state.contentItem0,this.state.animationTheme.first)} |
|
|
|
{this.getContentViewItem(this.state.contentItem1,this.state.animationTheme.second)} |
|
|
|
{this.getContentViewItem(this.state.contentItem2,this.state.animationTheme.third)} |
|
|
|
</View>) |
|
|
|
}else{ |
|
|
|
return ( |
|
|
|
<View style={styles.content}> |
|
|
|
<Text style={styles.updatePage}>{this.state.errorMessage}</Text> |
|
|
|
</View>) |
|
|
|
} |
|
|
|
}else{ |
|
|
|
return ( |
|
|
|
<View style={styles.content}> |
|
|
|
<Text style={styles.updatePage}>{this.state.errorMessage}</Text> |
|
|
|
</View>) |
|
|
|
} |
|
|
|
} |
|
|
|
setAdSwiperItemDom(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) { |
|
|
|
let contentItem = item.item; |
|
|
@@ -568,7 +732,7 @@ setSwiperItemDom(item) { |
|
|
|
if (contentItem.subType == 7) |
|
|
|
curLogo = require('./image/groupbuy.png'); |
|
|
|
} |
|
|
|
//aaa |
|
|
|
// |
|
|
|
// contentItem.target.salePriceStr = 24502228; |
|
|
|
let curNumStr = contentItem.target.salePriceStr+''; |
|
|
|
let curStyleObj = {}; |
|
|
@@ -580,7 +744,7 @@ setSwiperItemDom(item) { |
|
|
|
return ( |
|
|
|
<View style={styles.carouselItemWrap}> |
|
|
|
{/* <BoxShadow setting={shadowOpt}> */} |
|
|
|
<View setting={shadowOpt}> |
|
|
|
<View> |
|
|
|
<View style={styles.contentItemTopForAd} key={index}> |
|
|
|
<Image source={curLogo} resizeMode='center' style={styles.contentItemUpLayerLogo} /> |
|
|
|
|
|
|
@@ -637,84 +801,142 @@ rendDefaultImg() { |
|
|
|
) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
renderTicketDom() { |
|
|
|
return ( |
|
|
|
<ImageBackground style={styles.background} resizeMode='center' source={require('./image/background.png')}> |
|
|
|
{/* 头部title二维码开始 */} |
|
|
|
<View style={styles.title}> |
|
|
|
<View style={styles.titleImagePlace}> |
|
|
|
<Image source={require('./image/title.png')} resizeMode='center' style={styles.titleImage} /> |
|
|
|
</View> |
|
|
|
<ImageBackground source={require('./image/title-qrcode.png') } resizeMode='center' style={styles.titleQrcodeBonder} > |
|
|
|
<View style={styles.titleQrcodePlacehold}></View> |
|
|
|
<Image source={{uri: this.state.baseInfo.imgQrcodeWeapp}} resizeMode='center' style={styles.titleQrcode} /> |
|
|
|
<View style={styles.titleQrcodePlacehold}></View> |
|
|
|
</ImageBackground> |
|
|
|
</View> |
|
|
|
{/* 券列表展示列表开始 */} |
|
|
|
{this.getContentView()} |
|
|
|
{/* 底部商场信息展示开始 */} |
|
|
|
<View style={styles.bottom}> |
|
|
|
<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> |
|
|
|
</ImageBackground> |
|
|
|
); |
|
|
|
} |
|
|
|
//rank page aaa |
|
|
|
renderRankDom() { |
|
|
|
return ( |
|
|
|
<ImageBackground style={styles.background} resizeMode='center' source={require('./image/background-yellow.png')}> |
|
|
|
{/* 头部title二维码开始 */} |
|
|
|
<View style={styles.title}> |
|
|
|
<View style={styles.titleImagePlace}> |
|
|
|
<Image source={require('./image/title_yellow.png')} resizeMode='center' style={styles.titleImage} /> |
|
|
|
</View> |
|
|
|
<ImageBackground source={require('./image/title-qrcode.png') } resizeMode='center' style={styles.titleQrcodeBonder} > |
|
|
|
<View style={styles.titleQrcodePlacehold}></View> |
|
|
|
<Image source={{uri: this.state.baseInfo.imgQrcodeWeapp}} resizeMode='center' style={styles.titleQrcode} /> |
|
|
|
<View style={styles.titleQrcodePlacehold}></View> |
|
|
|
</ImageBackground> |
|
|
|
</View> |
|
|
|
{/* 券列表展示列表开始 */} |
|
|
|
<View style={styles.content}> |
|
|
|
{this.rankDom()} |
|
|
|
</View> |
|
|
|
{/* 底部商场信息展示开始 */} |
|
|
|
<View style={styles.bottom}> |
|
|
|
<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> |
|
|
|
</ImageBackground> |
|
|
|
); |
|
|
|
} |
|
|
|
renderAdDom() { |
|
|
|
let curWidthNum = 1080/(PixelRatio.get()); |
|
|
|
return ( |
|
|
|
// <ImageBackground style={styles.adTypeBg} source={require('./image/ad1.jpg')}> slideInDown zoomInDown |
|
|
|
<View style={styles.adWrapBox}> |
|
|
|
<Image style={styles.adWrapHideImg} |
|
|
|
onLoadStart={() => { |
|
|
|
this.setState({ |
|
|
|
curImgState: false |
|
|
|
}) |
|
|
|
}} |
|
|
|
onLoad={() => { |
|
|
|
this.setState({ |
|
|
|
coverImgUrl: this.state.previewImg, |
|
|
|
curImgState: true |
|
|
|
}) |
|
|
|
}} |
|
|
|
resizeMode="stretch" source={{uri: this.state.previewImg}}> |
|
|
|
</Image> |
|
|
|
|
|
|
|
<Animatable.View animation="fadeIn" style={styles.adWrap} key={this.state.coverImgUrl}> |
|
|
|
{this.rendDefaultImg()} |
|
|
|
</Animatable.View> |
|
|
|
|
|
|
|
<View style={styles.adTypeSwiper02}> |
|
|
|
<Carousel |
|
|
|
style={styles.adTypeSwiper02Content} |
|
|
|
ref={'carousel02'} |
|
|
|
data={adDataList} |
|
|
|
renderItem={this.setSwiperItemDom} |
|
|
|
sliderWidth={curWidthNum} |
|
|
|
itemWidth={curWidthNum} |
|
|
|
layout={'stack'} |
|
|
|
activeSlideOffset={0} |
|
|
|
autoplay={true} |
|
|
|
loop={true} |
|
|
|
autoplayInterval={5000} |
|
|
|
/> |
|
|
|
</View> |
|
|
|
</View> |
|
|
|
|
|
|
|
); |
|
|
|
} |
|
|
|
getAdView(){ |
|
|
|
if (this.state.baseInfo) { |
|
|
|
if (this.state.adType == 0) { |
|
|
|
return ( |
|
|
|
<ImageBackground style={styles.background} resizeMode='center' source={require('./image/background.png')}> |
|
|
|
{/* 头部title二维码开始 */} |
|
|
|
<View style={styles.title}> |
|
|
|
<View style={styles.titleImagePlace}> |
|
|
|
<Image source={require('./image/title.png')} resizeMode='center' style={styles.titleImage} /> |
|
|
|
</View> |
|
|
|
<ImageBackground source={require('./image/title-qrcode.png') } resizeMode='center' style={styles.titleQrcodeBonder} > |
|
|
|
<View style={styles.titleQrcodePlacehold}></View> |
|
|
|
<Image source={{uri: this.state.baseInfo.imgQrcodeWeapp}} resizeMode='center' style={styles.titleQrcode} /> |
|
|
|
<View style={styles.titleQrcodePlacehold}></View> |
|
|
|
</ImageBackground> |
|
|
|
</View> |
|
|
|
{/* 券列表展示列表开始 */} |
|
|
|
{this.getContentView()} |
|
|
|
{/* 底部商场信息展示开始 */} |
|
|
|
<View style={styles.bottom}> |
|
|
|
<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> |
|
|
|
</ImageBackground> |
|
|
|
); |
|
|
|
if (this.state.hasRankList && this.state.openRankList) { |
|
|
|
return ( |
|
|
|
this.renderRankDom() |
|
|
|
) |
|
|
|
} else { |
|
|
|
return ( |
|
|
|
this.renderTicketDom() |
|
|
|
) |
|
|
|
} |
|
|
|
} else if (this.state.adType == 2) { |
|
|
|
let curWidthNum = 1080/(PixelRatio.get()); |
|
|
|
return ( |
|
|
|
// <ImageBackground style={styles.adTypeBg} source={require('./image/ad1.jpg')}> slideInDown zoomInDown |
|
|
|
<View style={styles.adWrapBox}> |
|
|
|
<Image style={styles.adWrapHideImg} |
|
|
|
onLoadStart={() => { |
|
|
|
this.setState({ |
|
|
|
curImgState: false |
|
|
|
}) |
|
|
|
}} |
|
|
|
onLoad={() => { |
|
|
|
this.setState({ |
|
|
|
coverImgUrl: this.state.previewImg, |
|
|
|
curImgState: true |
|
|
|
}) |
|
|
|
}} |
|
|
|
resizeMode="stretch" source={{uri: this.state.previewImg}}> |
|
|
|
</Image> |
|
|
|
|
|
|
|
<Animatable.View animation="fadeIn" style={styles.adWrap} key={this.state.coverImgUrl}> |
|
|
|
{this.rendDefaultImg()} |
|
|
|
</Animatable.View> |
|
|
|
|
|
|
|
<View style={styles.adTypeSwiper02}> |
|
|
|
<Carousel |
|
|
|
style={styles.adTypeSwiper02Content} |
|
|
|
ref={'carousel02'} |
|
|
|
data={adDataList} |
|
|
|
renderItem={this.setSwiperItemDom} |
|
|
|
sliderWidth={curWidthNum} |
|
|
|
itemWidth={curWidthNum} |
|
|
|
layout={'stack'} |
|
|
|
activeSlideOffset={0} |
|
|
|
autoplay={true} |
|
|
|
loop={true} |
|
|
|
autoplayInterval={5000} |
|
|
|
/> |
|
|
|
</View> |
|
|
|
</View> |
|
|
|
|
|
|
|
); |
|
|
|
if (this.state.hasRankList && this.state.openRankList) { |
|
|
|
return ( |
|
|
|
this.renderRankDom() |
|
|
|
) |
|
|
|
} else { |
|
|
|
return ( |
|
|
|
this.renderAdDom() |
|
|
|
) |
|
|
|
} |
|
|
|
|
|
|
|
} else if (this.state.adType == 1) { |
|
|
|
let curWidthNum = 1080/(PixelRatio.get()) |
|
|
@@ -1335,6 +1557,69 @@ MyPage = CodePush(codePushOptions)(MyPage); |
|
|
|
backgroundColor: 'transparent', |
|
|
|
alignItems: 'center', |
|
|
|
|
|
|
|
}, |
|
|
|
//排名的列表样式 |
|
|
|
rankItemBox: { |
|
|
|
// flex: 1, |
|
|
|
flexDirection: 'row', |
|
|
|
alignItems: 'center', |
|
|
|
width: '92%', |
|
|
|
height: 250/PixelRatio.get(), |
|
|
|
backgroundColor: '#fff', |
|
|
|
borderRadius: 18/PixelRatio.get(), |
|
|
|
marginTop: 30/PixelRatio.get(), |
|
|
|
}, |
|
|
|
|
|
|
|
rankContent: { |
|
|
|
flex: 1, |
|
|
|
flexDirection: 'column', |
|
|
|
marginLeft: 22/PixelRatio.get(), |
|
|
|
}, |
|
|
|
|
|
|
|
rankItemBg: { |
|
|
|
flex: 1, |
|
|
|
flexDirection: 'row', |
|
|
|
alignItems: 'center', |
|
|
|
width: '100%', |
|
|
|
height: 250/PixelRatio.get(), |
|
|
|
}, |
|
|
|
|
|
|
|
RankLogo: { |
|
|
|
width: 188/PixelRatio.get(), |
|
|
|
height: 200/PixelRatio.get(), |
|
|
|
marginLeft: 20/PixelRatio.get(), |
|
|
|
}, |
|
|
|
|
|
|
|
rankQrcodeImg: { |
|
|
|
width: 200/PixelRatio.get(), |
|
|
|
height: 200/PixelRatio.get(), |
|
|
|
marginRight: 20/PixelRatio.get(), |
|
|
|
}, |
|
|
|
|
|
|
|
starTitle: { |
|
|
|
fontSize: 32/PixelRatio.get(), |
|
|
|
}, |
|
|
|
|
|
|
|
rankRun01: { |
|
|
|
marginTop: 12/PixelRatio.get(), |
|
|
|
}, |
|
|
|
|
|
|
|
rankRun02: { |
|
|
|
marginTop: 12/PixelRatio.get(), |
|
|
|
marginLeft: 10/PixelRatio.get(), |
|
|
|
}, |
|
|
|
|
|
|
|
merchantText: { |
|
|
|
fontSize: 40/PixelRatio.get(), |
|
|
|
fontWeight : 'bold', |
|
|
|
marginBottom: 10/PixelRatio.get(), |
|
|
|
marginTop: 22/PixelRatio.get(), |
|
|
|
}, |
|
|
|
|
|
|
|
rankRunBox: { |
|
|
|
flex: 1, |
|
|
|
flexDirection: 'row', |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |