|
|
@@ -8,18 +8,22 @@ import { |
|
|
|
Image, |
|
|
|
ImageBackground, |
|
|
|
PixelRatio, |
|
|
|
NativeModules |
|
|
|
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'; |
|
|
|
var testMac = 'FF:FF:FF:FF:FF:FF' |
|
|
|
import Swiper from 'react-native-swiper'; |
|
|
|
import Carousel from 'react-native-snap-carousel'; |
|
|
|
// import {BoxShadow} from 'react-native-shadow'; |
|
|
|
|
|
|
|
var testMac = 'FF:FF:FF:FF:FF:FF' |
|
|
|
var curAdIndex = 0; |
|
|
|
var errorMsg = { |
|
|
|
ERR_MAC_GET:'设备编号获取错误', |
|
|
@@ -54,17 +58,29 @@ var animationThemes = [ |
|
|
|
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 timer = null; |
|
|
|
var curTimer = null; |
|
|
|
|
|
|
|
var hbRequestCount |
|
|
|
var getAdDataCount |
|
|
|
var pageChangeCount |
|
|
|
|
|
|
|
var adDataList = [] |
|
|
|
var adDataList = []; |
|
|
|
var adDataBgList = []; |
|
|
|
|
|
|
|
var heartConfig = { |
|
|
|
heartbeatInterval:10, |
|
|
|
heartbeatInterval:300, |
|
|
|
dataRefreshInterval:3600, |
|
|
|
pageChangeInterval:10, |
|
|
|
} |
|
|
@@ -90,7 +106,7 @@ export default class MyPage extends Component { |
|
|
|
contentItem0:null, |
|
|
|
contentItem1:null, |
|
|
|
contentItem2:null, |
|
|
|
animationTheme:{}, |
|
|
|
animationTheme:animationThemes[0], |
|
|
|
contentDisplayStatus:false, |
|
|
|
syncMessage: "初始化..." , |
|
|
|
errorMessage: '加载中...', |
|
|
@@ -100,8 +116,46 @@ export default class MyPage extends Component { |
|
|
|
}, |
|
|
|
updating:true, |
|
|
|
macAddress: '', |
|
|
|
versionInfo:'未知' |
|
|
|
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); |
|
|
|
} */ |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
//更新函数 |
|
|
@@ -123,7 +177,8 @@ async codePushUpdate() { |
|
|
|
).then((status: SyncStatus) => { |
|
|
|
|
|
|
|
}, (error: any) => { |
|
|
|
CodePush.restartApp(); |
|
|
|
console.log(error) |
|
|
|
// CodePush.restartApp(); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
@@ -167,7 +222,8 @@ codePushStatusDidChange(syncStatus) { |
|
|
|
return false; |
|
|
|
|
|
|
|
if (curAdIndex >= adDataList.length) { |
|
|
|
curAdIndex = 0 |
|
|
|
curAdIndex = 0; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
this.setState({contentItem0:adDataList[curAdIndex]}); |
|
|
@@ -235,6 +291,27 @@ codePushStatusDidChange(syncStatus) { |
|
|
|
this.setState({errorMessage : errMsg}); |
|
|
|
} |
|
|
|
|
|
|
|
//判断播放类型adType |
|
|
|
dealLoopType(dataList) { |
|
|
|
adDataList = dataList.filter((item) => { |
|
|
|
return item.type == 0; |
|
|
|
}) |
|
|
|
adDataBgList = dataList.filter((item) => { |
|
|
|
return item.type == 2; |
|
|
|
}) |
|
|
|
//aaa |
|
|
|
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; |
|
|
|
} |
|
|
|
this.setState({adType: num }) |
|
|
|
} |
|
|
|
|
|
|
|
getAdDataList(first) { |
|
|
|
HttpUtils.get(NativeModules.BuildConfig.apiHost |
|
|
|
+ 'api/wxDeviceScreenAd/list?deviceId=' |
|
|
@@ -244,7 +321,12 @@ codePushStatusDidChange(syncStatus) { |
|
|
|
if (result.code != 200) { |
|
|
|
this.showErrMsg(result.message+'\n'+this.state.macAddress); |
|
|
|
} else if (result.data.list) { |
|
|
|
adDataList = result.data.list; |
|
|
|
//aaa |
|
|
|
//type==0的是券 1是? 2是广告大图 |
|
|
|
let curData = result.data.list; |
|
|
|
this.dealLoopType(curData); |
|
|
|
|
|
|
|
|
|
|
|
if (this.updateContent()) { |
|
|
|
this.setState({contentDisplayStatus: true}) |
|
|
|
} else { |
|
|
@@ -283,36 +365,23 @@ codePushStatusDidChange(syncStatus) { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
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); |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
componentWillUnmount(){ |
|
|
|
if (timer) |
|
|
|
clearTimeout(timer) |
|
|
|
if (curTimer) |
|
|
|
clearTimeout(curTimer) |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async routine() { |
|
|
|
hbRequestCount -=1; |
|
|
|
getAdDataCount -=1; |
|
|
|
pageChangeCount -=1; |
|
|
|
if (this.state.adType == 2 && this.state.curImgState) { |
|
|
|
pageChangeCount -=1; |
|
|
|
} |
|
|
|
if (this.state.adType != 2) { |
|
|
|
pageChangeCount -=1; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
if (getAdDataCount<=0) { |
|
|
@@ -322,26 +391,45 @@ async routine() { |
|
|
|
this.hbRequest() |
|
|
|
hbRequestCount = heartConfig.heartbeatInterval |
|
|
|
} |
|
|
|
|
|
|
|
if (pageChangeCount <= 0) { //页面切换间隔 |
|
|
|
if (this.state.contentDisplayStatus && this.state.baseInfo) { |
|
|
|
this.setState({ contentDisplayStatus: false}) |
|
|
|
if (this.updateContent()) { |
|
|
|
this.setState({ contentDisplayStatus: true}) |
|
|
|
|
|
|
|
//如果是adType == 2时间间隔到了,要检验轮播是否走完在决定切换 |
|
|
|
if (this.state.adType == 2) { |
|
|
|
if (pageChangeCount<=0) { |
|
|
|
let curNum = this.state.curAdType02Index + 1; |
|
|
|
if (curNum >= adDataBgList.length) { |
|
|
|
curNum = 0; |
|
|
|
} |
|
|
|
} else { |
|
|
|
await this.getBaseInfo() |
|
|
|
await this.getAdDataList(true) |
|
|
|
getAdDataCount = heartConfig.dataRefreshInterval |
|
|
|
hbRequestCount = heartConfig.heartbeatInterval |
|
|
|
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 |
|
|
|
} |
|
|
|
pageChangeCount = heartConfig.pageChangeInterval |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} catch(e){ |
|
|
|
this.setState({ versionInfo: versionInfo+'[E]'}); |
|
|
|
} |
|
|
|
|
|
|
|
timer = setTimeout(()=>{ |
|
|
|
curTimer = setTimeout(()=>{ |
|
|
|
this.routine(); |
|
|
|
},1000); |
|
|
|
} |
|
|
@@ -397,8 +485,18 @@ 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+''; |
|
|
|
let curStyleObj = {}; |
|
|
|
if (curNumStr.length > 5 || Number(curNumStr) > 10000) { |
|
|
|
curStyleObj = styles.contentItemTopDetailCurPriceStr02; |
|
|
|
} else { |
|
|
|
curStyleObj = styles.contentItemTopDetailCurPriceStr01; |
|
|
|
} |
|
|
|
return ( |
|
|
|
|
|
|
|
<Animatable.View animation={annomation} style={styles.contentItem}> |
|
|
|
|
|
|
|
<ImageBackground source={require('./image/item-background.png')} resizeMode='center' style={styles.contentItemDownLayer} > |
|
|
@@ -412,7 +510,8 @@ getContentViewItem(contentItem, annomation) { |
|
|
|
{/* 售价 */} |
|
|
|
<View style={styles.contentItemTopDetailCurPrice}> |
|
|
|
<Text style={styles.contentItemTopDetailCurPriceStrUnit}>¥</Text> |
|
|
|
<Text style={styles.contentItemTopDetailCurPriceStr}>{contentItem.target.salePriceStr}</Text> |
|
|
|
<Text style={curStyleObj}>{contentItem.target.salePriceStr}</Text> |
|
|
|
{/* <Text style={styles.contentItemTopDetailCurPriceStr}>{contentItem.target.salePriceStr}</Text> */} |
|
|
|
</View> |
|
|
|
{/* 面额 */} |
|
|
|
<View style={styles.contentItemTopDetailSalePrice}> |
|
|
@@ -449,6 +548,71 @@ getContentView() { |
|
|
|
</View>) |
|
|
|
} |
|
|
|
} |
|
|
|
setAdSwiperItemDom(item) { |
|
|
|
let contentItem = item.item; |
|
|
|
return ( |
|
|
|
<View style={styles.onlyAdSwiperItem}> |
|
|
|
<Image source={{uri: contentItem.coverImg}} resizeMode='stretch' style={styles.onlyAdTypeItemImg} /> |
|
|
|
</View> |
|
|
|
) |
|
|
|
} |
|
|
|
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'); |
|
|
|
} |
|
|
|
//aaa |
|
|
|
// 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 ( |
|
|
|
<View style={styles.carouselItemWrap}> |
|
|
|
{/* <BoxShadow setting={shadowOpt}> */} |
|
|
|
<View setting={shadowOpt}> |
|
|
|
<View style={styles.contentItemTopForAd} key={index}> |
|
|
|
<Image source={curLogo} resizeMode='center' style={styles.contentItemUpLayerLogo} /> |
|
|
|
|
|
|
|
{/* <ImageBackground style={styles.adTypeSwiper02} resizeMode="stretch" source={require('./image/item-background.png')}></ImageBackground> */} |
|
|
|
<Image source={{uri: contentItem.coverImg}} resizeMode='cover' style={styles.adTypeItemImg} /> |
|
|
|
<View style={styles.contentItemTopDetail}> |
|
|
|
{/* 券的title */} |
|
|
|
<Text style={styles.contentItemTopDetailTitle02} numberOfLines={2} ellipsizeMode="tail">{contentItem.target.title}</Text> |
|
|
|
<View style={styles.contentItemTopDetailPrice}> |
|
|
|
{/* 售价 */} |
|
|
|
<View style={styles.contentItemTopDetailCurPrice}> |
|
|
|
<Text style={styles.contentItemTopDetailCurPriceStrUnit02}>¥</Text> |
|
|
|
<Text style={curStyleObj}>{contentItem.target.salePriceStr}</Text> |
|
|
|
</View> |
|
|
|
{/* 面额 */} |
|
|
|
<View style={styles.contentItemTopDetailSalePrice02}> |
|
|
|
<Text style={styles.contentItemTopDetailSalePriceStr02} >¥{contentItem.target.priceStr}</Text> |
|
|
|
</View> |
|
|
|
</View> |
|
|
|
</View> |
|
|
|
{/* <Image source={{uri:'data:image/png;base64,'+contentItem.qrcode}} resizeMode='contain' style={styles.contentItemTopQrcode} /> */} |
|
|
|
<View style={styles.contentItemTopQrcodeBox}> |
|
|
|
<Image source={{uri:contentItem.target.qrCode}} resizeMode='contain' style={styles.contentItemTopQrcode02} /> |
|
|
|
</View> |
|
|
|
|
|
|
|
|
|
|
|
</View> |
|
|
|
</View> |
|
|
|
{/* </BoxShadow> */} |
|
|
|
</View> |
|
|
|
) |
|
|
|
} |
|
|
|
|
|
|
|
getUpdateView() { |
|
|
|
if (this.state.progress.totalBytes > 0) |
|
|
@@ -462,41 +626,113 @@ getUpdateView() { |
|
|
|
</Text> |
|
|
|
); |
|
|
|
} |
|
|
|
rendDefaultImg() { |
|
|
|
if (this.state.coverImgUrl) { |
|
|
|
return ( |
|
|
|
<ImageBackground style={styles.adTypeBg} resizeMode="stretch" source={{uri: this.state.coverImgUrl}}></ImageBackground> |
|
|
|
) |
|
|
|
} else { |
|
|
|
return ( |
|
|
|
<ImageBackground style={styles.adTypeBg} resizeMode="stretch" source={require('./image/background.png')}></ImageBackground> |
|
|
|
) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
getAdView(){ |
|
|
|
if (this.state.baseInfo) { |
|
|
|
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> |
|
|
|
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> |
|
|
|
); |
|
|
|
} 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> |
|
|
|
<Text style={styles.bottomPlacehold}>{this.state.versionInfo}</Text> |
|
|
|
</View> |
|
|
|
</ImageBackground> |
|
|
|
);} |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
} else if (this.state.adType == 1) { |
|
|
|
let curWidthNum = 1080/(PixelRatio.get()) |
|
|
|
return( |
|
|
|
<Carousel |
|
|
|
ref={'carousel01'} |
|
|
|
data={adDataBgList} |
|
|
|
renderItem={this.setAdSwiperItemDom} |
|
|
|
sliderWidth={curWidthNum} |
|
|
|
itemWidth={curWidthNum} |
|
|
|
activeSlideOffset={0} |
|
|
|
autoplay={true} |
|
|
|
loop={true} |
|
|
|
autoplayInterval={5000} |
|
|
|
/> |
|
|
|
) |
|
|
|
} |
|
|
|
} |
|
|
|
else { |
|
|
|
return ( |
|
|
|
<ImageBackground style={styles.background} resizeMode='center' source={require('./image/background.png')}> |
|
|
@@ -713,6 +949,15 @@ MyPage = CodePush(codePushOptions)(MyPage); |
|
|
|
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, |
|
|
@@ -761,11 +1006,24 @@ MyPage = CodePush(codePushOptions)(MyPage); |
|
|
|
flex: 5, |
|
|
|
width:'100%', |
|
|
|
height:'100%', |
|
|
|
// borderStyle:"solid", |
|
|
|
// borderWidth:1, |
|
|
|
// borderColor:"red", |
|
|
|
marginLeft:18/PixelRatio.get(), |
|
|
|
backgroundColor:'transparent' |
|
|
|
// 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 |
|
|
@@ -779,7 +1037,8 @@ MyPage = CodePush(codePushOptions)(MyPage); |
|
|
|
textAlign :'center', |
|
|
|
textAlignVertical:'center', |
|
|
|
fontSize: 27/PixelRatio.get(), |
|
|
|
fontWeight : 'bold' |
|
|
|
fontWeight : 'bold', |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
contentItemBottomPlacehold:{ |
|
|
@@ -803,9 +1062,16 @@ MyPage = CodePush(codePushOptions)(MyPage); |
|
|
|
textAlignVertical:'center', |
|
|
|
fontSize: 36/PixelRatio.get(), |
|
|
|
color: 'black', |
|
|
|
// borderStyle:"solid", |
|
|
|
// borderWidth:1, |
|
|
|
// borderColor:"red" |
|
|
|
}, |
|
|
|
|
|
|
|
contentItemBottomAction02:{ |
|
|
|
width:'100%', |
|
|
|
height: 60/PixelRatio.get(), |
|
|
|
backgroundColor:'transparent', |
|
|
|
textAlign :'center', |
|
|
|
textAlignVertical:'center', |
|
|
|
fontSize: 36/PixelRatio.get(), |
|
|
|
color: 'black', |
|
|
|
}, |
|
|
|
|
|
|
|
// 券的title |
|
|
@@ -814,15 +1080,25 @@ MyPage = CodePush(codePushOptions)(MyPage); |
|
|
|
// height:'100%', |
|
|
|
width:'100%', |
|
|
|
marginTop:"2%", |
|
|
|
// borderStyle:"solid", |
|
|
|
// borderWidth:1, |
|
|
|
// borderColor:"red", |
|
|
|
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, |
|
|
@@ -854,7 +1130,7 @@ MyPage = CodePush(codePushOptions)(MyPage); |
|
|
|
backgroundColor:'transparent', |
|
|
|
}, |
|
|
|
|
|
|
|
contentItemTopDetailCurPriceStr:{ |
|
|
|
contentItemTopDetailCurPriceStr01:{ |
|
|
|
backgroundColor:'transparent', |
|
|
|
fontSize:96/PixelRatio.get(), |
|
|
|
fontFamily:"PingFangSC-Bold", |
|
|
@@ -863,6 +1139,36 @@ MyPage = CodePush(codePushOptions)(MyPage); |
|
|
|
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', |
|
|
@@ -870,6 +1176,15 @@ MyPage = CodePush(codePushOptions)(MyPage); |
|
|
|
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' |
|
|
|
}, |
|
|
|
// 面额的样式 |
|
|
@@ -878,7 +1193,18 @@ MyPage = CodePush(codePushOptions)(MyPage); |
|
|
|
bottom:2, |
|
|
|
left:0, |
|
|
|
// flex: 1, |
|
|
|
paddingTop:50, |
|
|
|
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', |
|
|
@@ -894,4 +1220,121 @@ MyPage = CodePush(codePushOptions)(MyPage); |
|
|
|
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', |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |