import React, { Component } from 'react'; import { Platform, StyleSheet, Text, View, Image, ImageBackground, PixelRatio, NativeModules, } from 'react-native'; //引用插件 import Package from './package.json' import HttpUtils from './HttpUtils.js'; import CodePush from "react-native-code-push"; import DeviceInfo from "react-native-device-info"; 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; var errorMsg = { ERR_MAC_GET:'设备编号获取错误', ERR_START_AD:'广告播放系统错误', ERR_DATA_GET:'广告数据获取错误', ERR_HEARTBEAT:'设备心跳数据错误', ERR_NO_DATA:'暂无优惠信息' } var animationThemes = [ // 滑入 { first:"slideInDown", second:"slideInLeft", third:"slideInRight" }, // 放大 { first:"zoomInDown", second:"zoomInLeft", third:"zoomInRight" }, // 翻转 { first:"flipInX", second:"flipInY", third:"flipInX" }, // 弹出 { first:"bounceInDown", second:"bounceInLeft", third:"bounceInRight" } ] const shadowOpt = { width: 800/PixelRatio.get(), height: 240/PixelRatio.get(), color:"#000", border:2, radius:3, opacity:0.5, x:2, y:3, style:{marginVertical:5} } var curTimer = null; var hbRequestCount var getAdDataCount var pageChangeCount var adDataList = []; var adDataBgList = []; var heartConfig = { heartbeatInterval:300, dataRefreshInterval:3600, pageChangeInterval:10, } var requestFailedCount = 0; var versionInfo = ''; let codePushOptions = { //设置检查更新的频率 //ON_APP_RESUME APP恢复到前台的时候 //ON_APP_START APP开启的时候 //MANUAL 手动检查 checkFrequency : CodePush.CheckFrequency.ON_APP_START }; export default class MyPage extends Component { constructor(props) { super(props); this.state = { baseInfo: null, contentItem0:null, contentItem1:null, contentItem2:null, animationTheme:animationThemes[0], contentDisplayStatus:false, syncMessage: "初始化..." , errorMessage: '加载中...', progress: { receivedBytes:0, totalBytes:0 }, updating:true, macAddress: '', versionInfo:'未知', adType: 0, curAdType02Index: 0, //广告图index coverImgUrl: '', previewImg: '', curImgState: false, }; /* this.codePushUpdate = this.codePushUpdate.bind(this); this.startAd = this.startAd.bind(this); this.showErrMsg = this.showErrMsg.bind(this); */ } componentDidMount() { this.codePushUpdate(); DeviceInfo.getMACAddress().then((mac)=>{ if (mac=='' || mac==null ) { if (NativeModules.BuildConfig.buildType == 'debug') { this.setState({macAddress : this.testMac}) this.startAd() } else { this.showErrMsg(errorMsg.ERR_MAC_GET); } } else { this.setState({macAddress : mac}) this.startAd() } }).catch(e => { this.showErrMsg(errorMsg.ERR_START_AD); }) } componentDidUpdate() { /* console.log(this.refs.scrollView) if (this.refs.scrollView != undefined) { var ScrollView = this.refs.scrollView; ScrollView.scrollBy(0, true); } */ } //更新函数 async codePushUpdate() { CodePush.allowRestart(); await CodePush.getUpdateMetadata(CodePush.UpdateState.RUNNING) .then((metadata: LocalPackage) => { this.setState({ versionInfo: metadata ? 'b'+NativeModules.BuildConfig.versionCode+"-" + metadata.label : 'b'+ NativeModules.BuildConfig.versionCode}); versionInfo = this.state.versionInfo; }, (error: any) => { this.setState({ versionInfo: "Unknown"}); versionInfo = this.state.versionInfo; }); await CodePush.sync( { mandatoryInstallMode: CodePush.InstallMode.ON_NEXT_RESTART, installMode: CodePush.InstallMode.ON_NEXT_RESTART}, this.codePushStatusDidChange.bind(this), this.codePushDownloadDidProgress.bind(this) ).then((status: SyncStatus) => { }, (error: any) => { console.log(error) // CodePush.restartApp(); }); } // 监听更新状态 codePushStatusDidChange(syncStatus) { switch(syncStatus) { case CodePush.SyncStatus.CHECKING_FOR_UPDATE: this.setState({ syncMessage: "检查更新" }); break; case CodePush.SyncStatus.DOWNLOADING_PACKAGE: this.setState({ syncMessage: "下载更新" }); break; case CodePush.SyncStatus.AWAITING_USER_ACTION: this.setState({ syncMessage: "等待用户操作" }); break; case CodePush.SyncStatus.INSTALLING_UPDATE: this.setState({ syncMessage: "安装更新" }); break; case CodePush.SyncStatus.UP_TO_DATE: this.setState({ syncMessage: "已更新到最新程序", updating: false }); break; case CodePush.SyncStatus.UPDATE_IGNORED: this.setState({ syncMessage: "更新被取消", updating: false }); break; case CodePush.SyncStatus.UPDATE_INSTALLED: this.setState({ syncMessage: "更新已安装,重启应用后生效", updating: false }); break; case CodePush.SyncStatus.UNKNOWN_ERROR: this.setState({ syncMessage: "未知错误", updating: false }); break; } } codePushDownloadDidProgress(progress) { this.setState({ progress }); } // 列表滚动 updateContent() { if (adDataList.length <=0) return false; if (curAdIndex >= adDataList.length) { curAdIndex = 0; } this.setState({contentItem0:adDataList[curAdIndex]}); if (curAdIndex + 1 < adDataList.length) this.setState({contentItem1:adDataList[curAdIndex+1]}); else this.setState({contentItem1:null}); if (curAdIndex + 2 < adDataList.length) this.setState({contentItem2:adDataList[curAdIndex+2]}); else this.setState({contentItem2:null}); curAdIndex+=3 return true; } hbRequest() { return HttpUtils.post(NativeModules.BuildConfig.apiHost + 'api/wxDeviceScreenAd/heartbeat?deviceId=' + encodeURIComponent(this.state.macAddress), {version:this.state.versionInfo}) .then(result => { if (result.code == 200) { let config = JSON.parse(result.data.config); heartConfig.heartbeatInterval = config.heartbeatInterval heartConfig.dataRefreshInterval=config.dataRefreshInterval heartConfig.pageChangeInterval=config.pageChangeInterval // 动画划入 if(config.animationTheme == 0){ this.setState({ animationTheme:animationThemes[0] }) }else if(config.animationTheme == 1){ // 放大 this.setState({ animationTheme:animationThemes[1] }) }else if(config.animationTheme == 2){ // 淡入 this.setState({ animationTheme:animationThemes[2] }) }else if(config.animationTheme == 3){ // 弹入 this.setState({ animationTheme:animationThemes[3] }) } } else { //do nothing } }) .catch(error => { requestFailedCount++ this.setState({ versionInfo: versionInfo+`[${requestFailedCount}]`}); }) }  showErrMsg(errMsg) { this.setState({contentDisplayStatus: false}) this.setState({errorMessage : errMsg}); } //判断播放类型adType dealLoopType(dataList) { adDataList = dataList.filter((item) => { return item.type == 0; }) adDataBgList = dataList.filter((item) => { return item.type == 2; }) // let num = 0; if (adDataList.length > 0 && adDataBgList.length > 0) { num = 2; this.setState({previewImg: adDataBgList[0].coverImg}); } else if (adDataList.length > 0 && !adDataBgList.length) { num = 0; } else if (!adDataList.length && adDataBgList.length > 0) { num = 1; } //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) { HttpUtils.get(NativeModules.BuildConfig.apiHost + 'api/wxDeviceScreenAd/list?deviceId=' + encodeURIComponent(this.state.macAddress) + '&pageNum=1&pageSize=1000') .then(result => { if (result.code != 200) { this.showErrMsg(result.message+'\n'+this.state.macAddress); } else if (result.data.list) { // //type==0的是券 1是? 2是广告大图 let curData = result.data.list; this.dealLoopType(curData); if (this.updateContent()) { this.setState({contentDisplayStatus: true}) } else { this.showErrMsg(errorMsg.ERR_NO_DATA); } } else {  this.showErrMsg(errorMsg.ERR_DATA_GET); } }) .catch(error => { if (first) { this.showErrMsg(error.message); } else { requestFailedCount++ this.setState({ versionInfo: versionInfo+`[${requestFailedCount}]`}); } }) } getBaseInfo() { HttpUtils.get(NativeModules.BuildConfig.apiHost + 'api/wxDeviceScreenAd/info?deviceId=' + encodeURIComponent(this.state.macAddress)) .then(result => { if (result.code != 200) { this.showErrMsg(result.message+'\n'+this.state.macAddress); } else if (result.data) { this.setState({baseInfo:result.data}); } else { this.showErrMsg(errorMsg.ERR_DATA_GET); } }) .catch(error => { this.showErrMsg(error.message); }) } componentWillUnmount(){ if (curTimer) clearTimeout(curTimer) } async routine() { hbRequestCount -=1; getAdDataCount -=1; if (this.state.adType == 2 && this.state.curImgState) { pageChangeCount -=1; } if (this.state.adType != 2) { pageChangeCount -=1; } try { if (getAdDataCount<=0) { this.getAdDataList(false) getAdDataCount = heartConfig.dataRefreshInterval } else if (hbRequestCount<=0) { this.hbRequest() hbRequestCount = heartConfig.heartbeatInterval } //如果是adType == 2时间间隔到了,要检验轮播是否走完在决定切换 if (this.state.adType == 2) { if (pageChangeCount<=0) { let curNum = this.state.curAdType02Index + 1; if (curNum >= adDataBgList.length) { curNum = 0; } this.setState({ curAdType02Index: curNum, previewImg:adDataBgList[curNum].coverImg }) pageChangeCount = heartConfig.pageChangeInterval } } else if (this.state.adType == 0) { if (pageChangeCount <= 0) { //页面切换间隔 if (this.state.contentDisplayStatus && this.state.baseInfo) { this.setState({ contentDisplayStatus: false}) if (this.updateContent()) { this.setState({ contentDisplayStatus: true}) } } else { await this.getBaseInfo() await this.getAdDataList(true) getAdDataCount = heartConfig.dataRefreshInterval hbRequestCount = heartConfig.heartbeatInterval } pageChangeCount = heartConfig.pageChangeInterval } } } catch(e){ this.setState({ versionInfo: versionInfo+'[E]'}); } curTimer = setTimeout(()=>{ this.routine(); },1000); } startAd() { hbRequestCount = 0; getAdDataCount = 0; pageChangeCount = 0; this.routine(); } getContentViewItemUplayer(contentItem) { if (contentItem.type == 0) { if (contentItem.subType == 2) return ( ) if (contentItem.subType == 6) return ( ) if (contentItem.subType == 7) return ( ) return null; } } getContentViewItemActionStr(contentItem) { if (contentItem.type == 0) { if (contentItem.subType == 2) return '扫码秒杀'; else if (contentItem.subType == 6) return '扫码砍价'; else if (contentItem.subType == 7) return '扫码拼团'; else return '扫码领取'; } } getContentViewItemMerchantName(contentItem) { if (contentItem.type == 0) { if (contentItem.target.merchantVoList.length > 1) return '多商户通用'; else 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 ( {/* */} {item.merchantName} 经营指数: {item.starNum} 分 } filledStarImage={} scoreTextStyle={{color:'#fff'}} /> 人气指数: {item.starNum} 分 } filledStarImage={} scoreTextStyle={{color:'#fff'}} /> {/* */} ) } //券列表content部分 getContentViewItem(contentItem, annomation) { if (!contentItem) return ( ) actionText = this.getContentViewItemActionStr(contentItem); merchantName = this.getContentViewItemMerchantName(contentItem); // // contentItem.target.salePriceStr = 234005.8; // console.warn(annomation) let curNumStr = contentItem.target.salePriceStr+''; let curStyleObj = {}; if (curNumStr.length > 5 || Number(curNumStr) > 10000) { curStyleObj = styles.contentItemTopDetailCurPriceStr02; } else { curStyleObj = styles.contentItemTopDetailCurPriceStr01; } return ( {/* 列表 */} {/* 券的title */} {contentItem.target.title} {/* 售价 */} {contentItem.target.salePriceStr} {/* {contentItem.target.salePriceStr} */} {/* 面额 */} ¥{contentItem.target.priceStr} {/* */} {/* 优惠券底部商户名称 */} {merchantName} {contentItem.target.merchantVoList[0].buildingName}{contentItem.target.merchantVoList[0].floorName} {actionText} {this.getContentViewItemUplayer(contentItem)} ) } getContentView() { if (this.state.contentDisplayStatus) { //aaa if (true) { return ( {this.renderRankDom()} ) } else { return ( {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)} ) } }else{ return ( {this.state.errorMessage} ) } } setAdSwiperItemDom(item) { let contentItem = item.item; return ( ) } setSwiperItemDom(item) { let contentItem = item.item; let index = item.index; let curLogo = null; if (contentItem.type == 0) { if (contentItem.subType == 2) curLogo = require('./image/timed.png'); if (contentItem.subType == 6) curLogo = require('./image/discount.png'); if (contentItem.subType == 7) curLogo = require('./image/groupbuy.png'); } // // contentItem.target.salePriceStr = 24502228; let curNumStr = contentItem.target.salePriceStr+''; let curStyleObj = {}; if (curNumStr.length > 6 || Number(curNumStr) > 100000) { curStyleObj = styles.contentItemTopDetailCurPriceStr04; } else { curStyleObj = styles.contentItemTopDetailCurPriceStr03; } return ( {/* */} {/* */} {/* 券的title */} {contentItem.target.title} {/* 售价 */} {contentItem.target.salePriceStr} {/* 面额 */} ¥{contentItem.target.priceStr} {/* */} {/* */} ) } getUpdateView() { if (this.state.progress.totalBytes > 0) return ( {this.state.syncMessage}{'\n'} {this.state.progress.receivedBytes} of {this.state.progress.totalBytes} bytes received{'\n'} ); return ( {this.state.syncMessage} ); } rendDefaultImg() { if (this.state.coverImgUrl) { return ( ) } else { return ( ) } } getAdView(){ if (this.state.baseInfo) { if (this.state.adType == 0) { return ( {/* 头部title二维码开始 */} {/* 券列表展示列表开始 */} {this.getContentView()} {/* 底部商场信息展示开始 */} 小程序 公众号 {this.state.versionInfo} ); } else if (this.state.adType == 2) { let curWidthNum = 1080/(PixelRatio.get()); return ( // slideInDown zoomInDown { this.setState({ curImgState: false }) }} onLoad={() => { this.setState({ coverImgUrl: this.state.previewImg, curImgState: true }) }} resizeMode="stretch" source={{uri: this.state.previewImg}}> {this.rendDefaultImg()} ); } else if (this.state.adType == 1) { let curWidthNum = 1080/(PixelRatio.get()) return( ) } } else { return ( {/* 头部title二维码开始 */} {/* 券列表展示列表开始 */} {this.getContentView()} {/* 底部商场信息展示开始 */} {this.state.versionInfo} ); } } render() { if (this.state.updating) { return this.getUpdateView(); } return this.getAdView(); } } MyPage = CodePush(codePushOptions)(MyPage); const styles = StyleSheet.create({ updatePage:{ flex: 2, width:'100%', height:'100%', backgroundColor:'transparent', textAlign :'center', textAlignVertical:'center', fontSize: 63/PixelRatio.get(), color: 'darkblue' }, //layer background background:{ flex: 1, width:'100%', height:'100%' }, //layer top title:{ flex: 6, flexDirection: 'row', alignItems: 'center', paddingLeft:42/PixelRatio.get(), paddingRight:42/PixelRatio.get(), backgroundColor:'transparent' }, content:{ flex: 18, flexDirection: 'column', alignItems: 'center', backgroundColor:'transparent' }, bottom:{ flex: 2, flexDirection: 'row', alignItems: 'center', paddingLeft:42/PixelRatio.get(), paddingRight:42/PixelRatio.get(), backgroundColor:'transparent' }, //layer title titleImagePlace: { flex: 2, paddingTop: '20%', paddingLeft: '15%', alignItems: 'center', backgroundColor:'transparent' }, titleImage: { width:'100%', height:'100%', flex: 1, backgroundColor:'transparent' }, titleQrcodeBonder: { width:'100%', height:'100%', alignItems: 'center', flexDirection: 'column', flex: 1, backgroundColor:'transparent' }, titleQrcodePlacehold: { flex: 5, backgroundColor:'transparent' }, titleQrcode: { flex: 6, width:'100%', height:'100%', backgroundColor:'transparent' }, //layer bottom bottomLogoBackground: { flex: 3, borderRadius:16/PixelRatio.get(), marginTop: 26/PixelRatio.get(), marginBottom: 26/PixelRatio.get(), backgroundColor:'transparent',//'rgba(255,255,255,0.5)', }, bottomLogo: { width:'100%', height:'100%', backgroundColor:'transparent' }, bottomQrcode1Background : { flex: 1, width:'100%', height:'100%', marginLeft: 21/PixelRatio.get(), paddingTop: 27/PixelRatio.get(), paddingBottom: 11/PixelRatio.get(), flexDirection: 'column', backgroundColor:'transparent' }, bottomQrcode2Background : { flex: 1, width:'100%', height:'100%', marginLeft: 21/PixelRatio.get(), paddingTop: 26/PixelRatio.get(), paddingBottom: 11/PixelRatio.get(), flexDirection: 'column', backgroundColor:'transparent' }, bottomQrcode1: { flex: 2, width:'100%', height:'100%', backgroundColor:'transparent' }, bottomQrcode2: { flex: 2, width:'100%', height:'100%', backgroundColor:'transparent' }, bottomQrcode1Str: { flex: 1, textAlign :'center', textAlignVertical:'center', fontSize: 16/PixelRatio.get(), color : 'white', backgroundColor:'transparent' }, bottomQrcode2Str: { flex: 1, textAlign :'center', textAlignVertical:'center', fontSize: 16/PixelRatio.get(), color : 'white', backgroundColor:'transparent' }, bottomPlacehold: { flex: 8, width:'100%', height:'100%', backgroundColor:'transparent', textAlign :'right', textAlignVertical:'bottom', fontSize: 27/PixelRatio.get(), color : 'gray' }, //layer content item contentItem:{ flex: 1, width:'100%', height:'100%', flexDirection: 'column', backgroundColor:'transparent' }, contentItemDownLayer:{ position:'absolute', width:'100%', height:'100%', flexDirection: 'column', alignItems: 'center', backgroundColor:'transparent' }, contentItemUpLayer:{ width:210/PixelRatio.get(), height:153/PixelRatio.get(), position:'absolute', backgroundColor:'transparent' }, contentItemUpLayerLogo: { width:160/PixelRatio.get(), height:83/PixelRatio.get(), position: 'absolute', left: -20/PixelRatio.get(), top: 20/PixelRatio.get(), zIndex:100, backgroundColor: 'transparent', }, contentItemTop:{ flex: 3, width:'100%', height:'100%', paddingLeft: 66/PixelRatio.get(), paddingRight: 53/PixelRatio.get(), paddingTop: 40/PixelRatio.get(), flexDirection: 'row', alignItems: 'center', backgroundColor:'transparent' }, contentItemBottom:{ flex: 1, width:'100%', height:'100%', paddingLeft: 66/PixelRatio.get(), paddingRight: 53/PixelRatio.get(), paddingBottom: 40/PixelRatio.get(), flexDirection: 'row', alignItems: 'center', backgroundColor:'transparent' }, //layer content item top contentItemTopCoverImg:{ flex: 5, width:'100%', height:'100%', borderRadius:27/PixelRatio.get(), backgroundColor:'transparent' }, contentItemTopDetail:{ flex: 6, width:'100%', height:'100%', paddingLeft: 20/PixelRatio.get(), paddingRight: 20/PixelRatio.get(), alignItems: 'center', backgroundColor:'transparent' }, contentItemTopQrcode:{ flex: 5, width:'100%', height:'100%', marginLeft:18/PixelRatio.get(), // backgroundColor:'transparent' }, contentItemTopQrcodeBox:{ flex: 5, width:'100%', height:'100%', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', marginLeft: -28/PixelRatio.get(), // backgroundColor:'transparent' }, contentItemTopQrcode02:{ width:'90%', height:'90%', }, //layer content item bottom contentItemBottomMerchantName:{ flex: 5, width:'100%', height:'100%', alignItems: 'center', color:"black", backgroundColor:'transparent', textAlign :'center', textAlignVertical:'center', fontSize: 27/PixelRatio.get(), fontWeight : 'bold', }, contentItemBottomPlacehold:{ flex: 6, fontSize: 27/PixelRatio.get(), paddingLeft: 27/PixelRatio.get(), paddingRight: 79/PixelRatio.get(), width:'100%', height:'100%', color:"black", textAlignVertical:'center', backgroundColor:'transparent', }, contentItemBottomAction:{ flex: 5, width:'100%', height:'100%', backgroundColor:'transparent', textAlign :'center', textAlignVertical:'center', fontSize: 36/PixelRatio.get(), color: 'black', }, contentItemBottomAction02:{ width:'100%', height: 60/PixelRatio.get(), backgroundColor:'transparent', textAlign :'center', textAlignVertical:'center', fontSize: 36/PixelRatio.get(), color: 'black', }, // 券的title contentItemTopDetailTitle:{ flex: 2, // height:'100%', width:'100%', marginTop:"2%", backgroundColor:'transparent', textAlign :'left', color:"black", textAlignVertical:'center', fontSize: 53/PixelRatio.get(), }, // 券的title contentItemTopDetailTitle02:{ flex: 2, // height:'100%', width:'100%', marginTop:"2%", paddingRight: 14/PixelRatio.get(), backgroundColor:'transparent', textAlign :'left', color:"black", textAlignVertical:'center', fontSize: 42/PixelRatio.get(), }, /* contentItemTopDetailRemark:{ flex: 1, width:'100%', height:'100%', backgroundColor:'transparent', textAlign :'left', textAlignVertical:'center', fontSize: 27/PixelRatio.get(), color : 'gray' }, */ contentItemTopDetailPrice:{ flex: 2, width:'100%', height:'100%', backgroundColor:'transparent', flexDirection: 'row', }, // 售价的样式 contentItemTopDetailCurPrice:{ position:"absolute", bottom:10, left:0, width:'100%', height:'100%', flexDirection: 'row', backgroundColor:'transparent', }, contentItemTopDetailCurPriceStr01:{ backgroundColor:'transparent', fontSize:96/PixelRatio.get(), fontFamily:"PingFangSC-Bold", fontWeight: "bold", textAlign :'left', textAlignVertical:'bottom', color : 'red' }, //金额超10000,字号修改 contentItemTopDetailCurPriceStr02:{ backgroundColor:'transparent', fontSize:64/PixelRatio.get(), fontFamily:"PingFangSC-Bold", fontWeight: "bold", textAlign :'left', textAlignVertical:'bottom', paddingBottom: 8/PixelRatio.get(), color : 'red' }, contentItemTopDetailCurPriceStr03:{ backgroundColor:'transparent', fontSize:72/PixelRatio.get(), fontFamily:"PingFangSC-Bold", fontWeight: "bold", textAlign :'left', color : 'red' }, //金额超10000,字号修改 contentItemTopDetailCurPriceStr04:{ backgroundColor:'transparent', fontSize:52/PixelRatio.get(), fontFamily:"PingFangSC-Bold", fontWeight: "bold", textAlign :'left', paddingTop: 16/PixelRatio.get(), color : 'red' }, contentItemTopDetailCurPriceStrUnit:{ backgroundColor:'transparent', textAlign :'left', textAlignVertical:'bottom', paddingBottom: 16/PixelRatio.get(), fontSize: 48/PixelRatio.get(), color : 'red', }, contentItemTopDetailCurPriceStrUnit02:{ backgroundColor:'transparent', textAlign :'left', textAlignVertical:'center', paddingBottom: 16/PixelRatio.get(), fontSize: 48/PixelRatio.get(), color : 'red' }, // 面额的样式 contentItemTopDetailSalePrice:{ position:"absolute", bottom:2, left:0, // flex: 1, paddingTop:138/PixelRatio.get(), width:'100%', // height:'100%', backgroundColor:'transparent', }, contentItemTopDetailSalePrice02:{ position:"absolute", bottom:14/PixelRatio.get(), left:0, // flex: 1, paddingTop:138/PixelRatio.get(), width:'100%', // height:'100%', backgroundColor:'transparent', }, contentItemTopDetailSalePriceStr:{ width:'100%', height:'100%', backgroundColor:'transparent', textAlign :'left', textAlignVertical:'bottom', fontSize: 27/PixelRatio.get(), textDecorationLine: 'line-through', color : 'gray' }, contentItemTopDetailSalePriceStr02:{ width:'100%', height:'100%', backgroundColor:'transparent', textAlignVertical:'center', textAlign :'left', fontSize: 27/PixelRatio.get(), textDecorationLine: 'line-through', color : 'gray' }, adTypeBg:{ flex: 1, width: '100%', height: '100%', }, adWrapBox: { width: '100%', height: '100%', position: 'relative', }, adWrap: { width: '100%', height: '100%', position: 'absolute', left: 0, top: 0, zIndex: 10, }, adWrapHideImg: { width: '100%', height: '100%', position: 'absolute', left: 0, top: 0, zIndex: -1, opacity:0, }, adTypeSwiper02:{ flex: 1, alignItems: 'center', position: 'absolute', left: 0, bottom: 60/PixelRatio.get(), width: '100%', height: 270/PixelRatio.get(), paddingTop: 10/PixelRatio.get(), paddingBottom: 10/PixelRatio.get(), backgroundColor: 'rgba(0,0,0,.1)', }, adTypeItemImgWrap:{ flex: 1, width: '100%', height: 369/PixelRatio.get(), flexDirection: 'row', alignItems: 'center', }, adTypeItemImg:{ width: 200/PixelRatio.get(), height: 200/PixelRatio.get(), marginLeft: 8/PixelRatio.get(), marginTop: 20/PixelRatio.get(), borderRadius:27/PixelRatio.get(), backgroundColor:'transparent' }, bottomBox:{ position: 'absolute', bottom: 20/PixelRatio.get(), left: 0, width: '100%', height: 130/PixelRatio.get(), flexDirection: 'row', alignItems: 'center', backgroundColor:'transparent', }, contentItemTopForAd:{ position: 'relative', flex: 1, width: 800/PixelRatio.get(), // width: '100%', height:'100%', paddingLeft: 12/PixelRatio.get(), paddingRight: 26/PixelRatio.get(), flexDirection: 'row', alignItems: 'flex-start', borderRadius: 6, backgroundColor:'rgba(255,255,255,.8)', }, onlyAdSwiperItem:{ width: '100%', height: '100%', }, onlyAdTypeItemImg:{ width: '100%', height: '100%', }, carouselItemWrap: { flex: 1, width: '100%', 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(), }, starImg: { width: 30/PixelRatio.get(), height: 30/PixelRatio.get(), }, starTitle: { fontSize: 30/PixelRatio.get(), }, merchantText: { fontWeight : 'bold', marginBottom:10/PixelRatio.get(), marginTop:10/PixelRatio.get(), } });