|
|
@@ -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; |
|
|
@@ -299,7 +300,7 @@ codePushStatusDidChange(syncStatus) { |
|
|
|
adDataBgList = dataList.filter((item) => { |
|
|
|
return item.type == 2; |
|
|
|
}) |
|
|
|
//aaa |
|
|
|
// |
|
|
|
let num = 0; |
|
|
|
if (adDataList.length > 0 && adDataBgList.length > 0) { |
|
|
|
num = 2; |
|
|
@@ -309,7 +310,18 @@ codePushStatusDidChange(syncStatus) { |
|
|
|
} else if (!adDataList.length && adDataBgList.length > 0) { |
|
|
|
num = 1; |
|
|
|
} |
|
|
|
this.setState({adType: num }) |
|
|
|
//aaa |
|
|
|
// this.setState({adType: num }) |
|
|
|
this.setState({adType: 0 }) |
|
|
|
adDataList.map(item => { |
|
|
|
item.starNum = 3.4; |
|
|
|
item.logoUrl = item.coverImg; |
|
|
|
item.merchantName = '小米之家'; |
|
|
|
|
|
|
|
}) |
|
|
|
adDataList = [...adDataList,...adDataList]; |
|
|
|
adDataList = adDataList.slice(0,5); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
getAdDataList(first) { |
|
|
@@ -321,7 +333,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); |
|
|
@@ -475,7 +487,56 @@ getContentViewItemMerchantName(contentItem) { |
|
|
|
return contentItem.target.merchantVoList[0].merchantName; |
|
|
|
} |
|
|
|
} |
|
|
|
//排名 rank dom |
|
|
|
renderRankDom() { |
|
|
|
let rankDomStack = []; |
|
|
|
adDataList.map((item) => { |
|
|
|
rankDomStack.push(this.rankItemDom(item)); |
|
|
|
}) |
|
|
|
return rankDomStack; |
|
|
|
} |
|
|
|
//每一条 rank |
|
|
|
rankItemDom(item) { |
|
|
|
return ( |
|
|
|
<View style={styles.rankItemBox}> |
|
|
|
{/* <ImageBackground source={require('./image/item-background.png')} resizeMode="stretch" style={styles.rankItemBg}> */} |
|
|
|
<Image style={styles.RankLogo} resizeMode="stretch" source={{uri:item.logoUrl}}></Image> |
|
|
|
<View style={styles.rankContent}> |
|
|
|
<Text style={{fontWeight : 'bold'}}>{item.merchantName}</Text> |
|
|
|
<View style={styles.rankRun}> |
|
|
|
<Text>经营指数: {item.starNum} 分</Text> |
|
|
|
<StarRatingBar |
|
|
|
score={item.starNum} |
|
|
|
allowsHalfStars={true} |
|
|
|
accurateHalfStars={true} |
|
|
|
emptyStarImage={<Image style={{width:16, height: 16}} source={require('./image/star_gray.png')} />} |
|
|
|
filledStarImage={<Image style={{width:16, height: 16}} source={require('./image/star_gold.png')} />} |
|
|
|
scoreTextStyle={{color:'#fff'}} |
|
|
|
/> |
|
|
|
</View> |
|
|
|
|
|
|
|
<View style={styles.rankRun}> |
|
|
|
<Text>人气指数: {item.starNum} 分</Text> |
|
|
|
<StarRatingBar |
|
|
|
score={item.starNum} |
|
|
|
allowsHalfStars={true} |
|
|
|
accurateHalfStars={true} |
|
|
|
emptyStarImage={<Image style={{width:16, height: 16}} source={require('./image/hot_gray.png')} />} |
|
|
|
filledStarImage={<Image style={{width:16, height: 16}} source={require('./image/hot_gold.png')} />} |
|
|
|
scoreTextStyle={{color:'#fff'}} |
|
|
|
/> |
|
|
|
</View> |
|
|
|
|
|
|
|
</View> |
|
|
|
|
|
|
|
<Image source={{uri:item.target.qrCode}} resizeMode="stretch" style={styles.rankQrcodeImg}></Image> |
|
|
|
|
|
|
|
{/* </ImageBackground> */} |
|
|
|
|
|
|
|
</View> |
|
|
|
) |
|
|
|
} |
|
|
|
//券列表content部分 |
|
|
|
getContentViewItem(contentItem, annomation) { |
|
|
|
if (!contentItem) |
|
|
|
return ( |
|
|
@@ -485,7 +546,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,17 +597,25 @@ getContentViewItem(contentItem, annomation) { |
|
|
|
|
|
|
|
getContentView() { |
|
|
|
if (this.state.contentDisplayStatus) { |
|
|
|
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>) |
|
|
|
//aaa |
|
|
|
if (true) { |
|
|
|
return (<View style={styles.content}> |
|
|
|
{this.renderRankDom()} |
|
|
|
</View>) |
|
|
|
} else { |
|
|
|
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>) |
|
|
|
} |
|
|
|
} |
|
|
|
setAdSwiperItemDom(item) { |
|
|
|
let contentItem = item.item; |
|
|
@@ -568,7 +637,7 @@ setSwiperItemDom(item) { |
|
|
|
if (contentItem.subType == 7) |
|
|
|
curLogo = require('./image/groupbuy.png'); |
|
|
|
} |
|
|
|
//aaa |
|
|
|
// |
|
|
|
// contentItem.target.salePriceStr = 24502228; |
|
|
|
let curNumStr = contentItem.target.salePriceStr+''; |
|
|
|
let curStyleObj = {}; |
|
|
@@ -1335,6 +1404,48 @@ MyPage = CodePush(codePushOptions)(MyPage); |
|
|
|
backgroundColor: 'transparent', |
|
|
|
alignItems: 'center', |
|
|
|
|
|
|
|
}, |
|
|
|
//排名的列表样式 |
|
|
|
rankItemBox: { |
|
|
|
flex: 1, |
|
|
|
flexDirection: 'row', |
|
|
|
alignItems: 'center', |
|
|
|
width: '92%', |
|
|
|
height: 260/PixelRatio.get(), |
|
|
|
backgroundColor: '#fff', |
|
|
|
borderRadius: 26/PixelRatio.get(), |
|
|
|
marginTop: 20/PixelRatio.get(), |
|
|
|
borderWidth: 1, |
|
|
|
borderColor: 'green', |
|
|
|
}, |
|
|
|
|
|
|
|
rankContent: { |
|
|
|
marginLeft: 30/PixelRatio.get(), |
|
|
|
}, |
|
|
|
|
|
|
|
rankItemBg: { |
|
|
|
flex: 1, |
|
|
|
flexDirection: 'row', |
|
|
|
alignItems: 'center', |
|
|
|
width: '100%', |
|
|
|
height: 260/PixelRatio.get(), |
|
|
|
borderWidth: 1, |
|
|
|
borderColor: 'blue', |
|
|
|
}, |
|
|
|
|
|
|
|
RankLogo: { |
|
|
|
width: 220/PixelRatio.get(), |
|
|
|
height: 220/PixelRatio.get(), |
|
|
|
marginLeft: 30/PixelRatio.get(), |
|
|
|
borderWidth: 1, |
|
|
|
borderColor: 'yellow', |
|
|
|
}, |
|
|
|
|
|
|
|
rankQrcodeImg: { |
|
|
|
width: 220/PixelRatio.get(), |
|
|
|
height: 220/PixelRatio.get(), |
|
|
|
marginLeft: 10/PixelRatio.get(), |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |