广告屏react-native项目
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

1464 lines
41 KiB

  1. import React, { Component } from 'react';
  2. import {
  3. Platform,
  4. StyleSheet,
  5. Text,
  6. View,
  7. Image,
  8. ImageBackground,
  9. PixelRatio,
  10. NativeModules,
  11. } from 'react-native';
  12. //引用插件
  13. import Package from './package.json'
  14. import HttpUtils from './HttpUtils.js';
  15. import CodePush from "react-native-code-push";
  16. import DeviceInfo from "react-native-device-info";
  17. import * as Animatable from 'react-native-animatable';
  18. import Swiper from 'react-native-swiper';
  19. import Carousel from 'react-native-snap-carousel';
  20. // import {BoxShadow} from 'react-native-shadow';
  21. import StarRatingBar from 'react-native-star-rating-view/StarRatingBar';
  22. var testMac = 'FF:FF:FF:FF:FF:FF'
  23. var curAdIndex = 0;
  24. var errorMsg = {
  25. ERR_MAC_GET:'设备编号获取错误',
  26. ERR_START_AD:'广告播放系统错误',
  27. ERR_DATA_GET:'广告数据获取错误',
  28. ERR_HEARTBEAT:'设备心跳数据错误',
  29. ERR_NO_DATA:'暂无优惠信息'
  30. }
  31. var animationThemes = [
  32. // 滑入
  33. {
  34. first:"slideInDown",
  35. second:"slideInLeft",
  36. third:"slideInRight"
  37. },
  38. // 放大
  39. {
  40. first:"zoomInDown",
  41. second:"zoomInLeft",
  42. third:"zoomInRight"
  43. },
  44. // 翻转
  45. {
  46. first:"flipInX",
  47. second:"flipInY",
  48. third:"flipInX"
  49. },
  50. // 弹出
  51. {
  52. first:"bounceInDown",
  53. second:"bounceInLeft",
  54. third:"bounceInRight"
  55. }
  56. ]
  57. const shadowOpt = {
  58. width: 800/PixelRatio.get(),
  59. height: 240/PixelRatio.get(),
  60. color:"#000",
  61. border:2,
  62. radius:3,
  63. opacity:0.5,
  64. x:2,
  65. y:3,
  66. style:{marginVertical:5}
  67. }
  68. var curTimer = null;
  69. var hbRequestCount
  70. var getAdDataCount
  71. var pageChangeCount
  72. var adDataList = [];
  73. var adDataBgList = [];
  74. var heartConfig = {
  75. heartbeatInterval:300,
  76. dataRefreshInterval:3600,
  77. pageChangeInterval:10,
  78. }
  79. var requestFailedCount = 0;
  80. var versionInfo = '';
  81. let codePushOptions = {
  82. //设置检查更新的频率
  83. //ON_APP_RESUME APP恢复到前台的时候
  84. //ON_APP_START APP开启的时候
  85. //MANUAL 手动检查
  86. checkFrequency : CodePush.CheckFrequency.ON_APP_START
  87. };
  88. export default class MyPage extends Component {
  89. constructor(props) {
  90. super(props);
  91. this.state = {
  92. baseInfo: null,
  93. contentItem0:null,
  94. contentItem1:null,
  95. contentItem2:null,
  96. animationTheme:animationThemes[0],
  97. contentDisplayStatus:false,
  98. syncMessage: "初始化..." ,
  99. errorMessage: '加载中...',
  100. progress: {
  101. receivedBytes:0,
  102. totalBytes:0
  103. },
  104. updating:true,
  105. macAddress: '',
  106. versionInfo:'未知',
  107. adType: 0,
  108. curAdType02Index: 0, //广告图index
  109. coverImgUrl: '',
  110. previewImg: '',
  111. curImgState: false,
  112. };
  113. /* this.codePushUpdate = this.codePushUpdate.bind(this);
  114. this.startAd = this.startAd.bind(this);
  115. this.showErrMsg = this.showErrMsg.bind(this); */
  116. }
  117. componentDidMount() {
  118. this.codePushUpdate();
  119. DeviceInfo.getMACAddress().then((mac)=>{
  120. if (mac=='' || mac==null ) {
  121. if (NativeModules.BuildConfig.buildType == 'debug') {
  122. this.setState({macAddress : this.testMac})
  123. this.startAd()
  124. } else {
  125. this.showErrMsg(errorMsg.ERR_MAC_GET);
  126. }
  127. } else {
  128. this.setState({macAddress : mac})
  129. this.startAd()
  130. }
  131. }).catch(e => {
  132. this.showErrMsg(errorMsg.ERR_START_AD);
  133. })
  134. }
  135. componentDidUpdate() {
  136. /* console.log(this.refs.scrollView)
  137. if (this.refs.scrollView != undefined) {
  138. var ScrollView = this.refs.scrollView;
  139. ScrollView.scrollBy(0, true);
  140. } */
  141. }
  142. //更新函数
  143. async codePushUpdate() {
  144. CodePush.allowRestart();
  145. await CodePush.getUpdateMetadata(CodePush.UpdateState.RUNNING)
  146. .then((metadata: LocalPackage) => {
  147. this.setState({ versionInfo: metadata ? 'b'+NativeModules.BuildConfig.versionCode+"-" + metadata.label : 'b'+ NativeModules.BuildConfig.versionCode});
  148. versionInfo = this.state.versionInfo;
  149. }, (error: any) => {
  150. this.setState({ versionInfo: "Unknown"});
  151. versionInfo = this.state.versionInfo;
  152. });
  153. await CodePush.sync(
  154. { mandatoryInstallMode: CodePush.InstallMode.ON_NEXT_RESTART,
  155. installMode: CodePush.InstallMode.ON_NEXT_RESTART},
  156. this.codePushStatusDidChange.bind(this),
  157. this.codePushDownloadDidProgress.bind(this)
  158. ).then((status: SyncStatus) => {
  159. }, (error: any) => {
  160. console.log(error)
  161. // CodePush.restartApp();
  162. });
  163. }
  164. // 监听更新状态
  165. codePushStatusDidChange(syncStatus) {
  166. switch(syncStatus) {
  167. case CodePush.SyncStatus.CHECKING_FOR_UPDATE:
  168. this.setState({ syncMessage: "检查更新" });
  169. break;
  170. case CodePush.SyncStatus.DOWNLOADING_PACKAGE:
  171. this.setState({ syncMessage: "下载更新" });
  172. break;
  173. case CodePush.SyncStatus.AWAITING_USER_ACTION:
  174. this.setState({ syncMessage: "等待用户操作" });
  175. break;
  176. case CodePush.SyncStatus.INSTALLING_UPDATE:
  177. this.setState({ syncMessage: "安装更新" });
  178. break;
  179. case CodePush.SyncStatus.UP_TO_DATE:
  180. this.setState({ syncMessage: "已更新到最新程序", updating: false });
  181. break;
  182. case CodePush.SyncStatus.UPDATE_IGNORED:
  183. this.setState({ syncMessage: "更新被取消", updating: false });
  184. break;
  185. case CodePush.SyncStatus.UPDATE_INSTALLED:
  186. this.setState({ syncMessage: "更新已安装,重启应用后生效", updating: false });
  187. break;
  188. case CodePush.SyncStatus.UNKNOWN_ERROR:
  189. this.setState({ syncMessage: "未知错误", updating: false });
  190. break;
  191. }
  192. }
  193. codePushDownloadDidProgress(progress) {
  194. this.setState({ progress });
  195. }
  196. // 列表滚动
  197. updateContent() {
  198. if (adDataList.length <=0)
  199. return false;
  200. if (curAdIndex >= adDataList.length) {
  201. curAdIndex = 0;
  202. }
  203. this.setState({contentItem0:adDataList[curAdIndex]});
  204. if (curAdIndex + 1 < adDataList.length)
  205. this.setState({contentItem1:adDataList[curAdIndex+1]});
  206. else
  207. this.setState({contentItem1:null});
  208. if (curAdIndex + 2 < adDataList.length)
  209. this.setState({contentItem2:adDataList[curAdIndex+2]});
  210. else
  211. this.setState({contentItem2:null});
  212. curAdIndex+=3
  213. return true;
  214. }
  215. hbRequest() {
  216. return HttpUtils.post(NativeModules.BuildConfig.apiHost
  217. + 'api/wxDeviceScreenAd/heartbeat?deviceId='
  218. + encodeURIComponent(this.state.macAddress),
  219. {version:this.state.versionInfo})
  220. .then(result => {
  221. if (result.code == 200) {
  222. let config = JSON.parse(result.data.config);
  223. heartConfig.heartbeatInterval = config.heartbeatInterval
  224. heartConfig.dataRefreshInterval=config.dataRefreshInterval
  225. heartConfig.pageChangeInterval=config.pageChangeInterval
  226. // 动画划入
  227. if(config.animationTheme == 0){
  228. this.setState({
  229. animationTheme:animationThemes[0]
  230. })
  231. }else if(config.animationTheme == 1){
  232. // 放大
  233. this.setState({
  234. animationTheme:animationThemes[1]
  235. })
  236. }else if(config.animationTheme == 2){
  237. // 淡入
  238. this.setState({
  239. animationTheme:animationThemes[2]
  240. })
  241. }else if(config.animationTheme == 3){
  242. // 弹入
  243. this.setState({
  244. animationTheme:animationThemes[3]
  245. })
  246. }
  247. } else {
  248. //do nothing
  249. }
  250. })
  251. .catch(error => {
  252. requestFailedCount++
  253. this.setState({ versionInfo: versionInfo+`[${requestFailedCount}]`});
  254. })
  255. }
  256.  showErrMsg(errMsg) {
  257. this.setState({contentDisplayStatus: false})
  258. this.setState({errorMessage : errMsg});
  259. }
  260. //判断播放类型adType
  261. dealLoopType(dataList) {
  262. adDataList = dataList.filter((item) => {
  263. return item.type == 0;
  264. })
  265. adDataBgList = dataList.filter((item) => {
  266. return item.type == 2;
  267. })
  268. //
  269. let num = 0;
  270. if (adDataList.length > 0 && adDataBgList.length > 0) {
  271. num = 2;
  272. this.setState({previewImg: adDataBgList[0].coverImg});
  273. } else if (adDataList.length > 0 && !adDataBgList.length) {
  274. num = 0;
  275. } else if (!adDataList.length && adDataBgList.length > 0) {
  276. num = 1;
  277. }
  278. //aaa
  279. // this.setState({adType: num })
  280. this.setState({adType: 0 })
  281. adDataList.map(item => {
  282. item.starNum = 3.4;
  283. item.logoUrl = item.coverImg;
  284. item.merchantName = '小米之家';
  285. })
  286. adDataList = [...adDataList,...adDataList];
  287. adDataList = adDataList.slice(0,5);
  288. }
  289. getAdDataList(first) {
  290. HttpUtils.get(NativeModules.BuildConfig.apiHost
  291. + 'api/wxDeviceScreenAd/list?deviceId='
  292. + encodeURIComponent(this.state.macAddress)
  293. + '&pageNum=1&pageSize=1000')
  294. .then(result => {
  295. if (result.code != 200) {
  296. this.showErrMsg(result.message+'\n'+this.state.macAddress);
  297. } else if (result.data.list) {
  298. //
  299. //type==0的是券 1是? 2是广告大图
  300. let curData = result.data.list;
  301. this.dealLoopType(curData);
  302. if (this.updateContent()) {
  303. this.setState({contentDisplayStatus: true})
  304. } else {
  305. this.showErrMsg(errorMsg.ERR_NO_DATA);
  306. }
  307. } else {
  308.  this.showErrMsg(errorMsg.ERR_DATA_GET);
  309. }
  310. })
  311. .catch(error => {
  312. if (first) {
  313. this.showErrMsg(error.message);
  314. }
  315. else {
  316. requestFailedCount++
  317. this.setState({ versionInfo: versionInfo+`[${requestFailedCount}]`});
  318. }
  319. })
  320. }
  321. getBaseInfo() {
  322. HttpUtils.get(NativeModules.BuildConfig.apiHost
  323. + 'api/wxDeviceScreenAd/info?deviceId='
  324. + encodeURIComponent(this.state.macAddress))
  325. .then(result => {
  326. if (result.code != 200) {
  327. this.showErrMsg(result.message+'\n'+this.state.macAddress);
  328. } else if (result.data) {
  329. this.setState({baseInfo:result.data});
  330. } else {
  331. this.showErrMsg(errorMsg.ERR_DATA_GET);
  332. }
  333. })
  334. .catch(error => {
  335. this.showErrMsg(error.message);
  336. })
  337. }
  338. componentWillUnmount(){
  339. if (curTimer)
  340. clearTimeout(curTimer)
  341. }
  342. async routine() {
  343. hbRequestCount -=1;
  344. getAdDataCount -=1;
  345. if (this.state.adType == 2 && this.state.curImgState) {
  346. pageChangeCount -=1;
  347. }
  348. if (this.state.adType != 2) {
  349. pageChangeCount -=1;
  350. }
  351. try {
  352. if (getAdDataCount<=0) {
  353. this.getAdDataList(false)
  354. getAdDataCount = heartConfig.dataRefreshInterval
  355. } else if (hbRequestCount<=0) {
  356. this.hbRequest()
  357. hbRequestCount = heartConfig.heartbeatInterval
  358. }
  359. //如果是adType == 2时间间隔到了,要检验轮播是否走完在决定切换
  360. if (this.state.adType == 2) {
  361. if (pageChangeCount<=0) {
  362. let curNum = this.state.curAdType02Index + 1;
  363. if (curNum >= adDataBgList.length) {
  364. curNum = 0;
  365. }
  366. this.setState({
  367. curAdType02Index: curNum,
  368. previewImg:adDataBgList[curNum].coverImg
  369. })
  370. pageChangeCount = heartConfig.pageChangeInterval
  371. }
  372. } else if (this.state.adType == 0) {
  373. if (pageChangeCount <= 0) { //页面切换间隔
  374. if (this.state.contentDisplayStatus && this.state.baseInfo) {
  375. this.setState({ contentDisplayStatus: false})
  376. if (this.updateContent()) {
  377. this.setState({ contentDisplayStatus: true})
  378. }
  379. } else {
  380. await this.getBaseInfo()
  381. await this.getAdDataList(true)
  382. getAdDataCount = heartConfig.dataRefreshInterval
  383. hbRequestCount = heartConfig.heartbeatInterval
  384. }
  385. pageChangeCount = heartConfig.pageChangeInterval
  386. }
  387. }
  388. } catch(e){
  389. this.setState({ versionInfo: versionInfo+'[E]'});
  390. }
  391. curTimer = setTimeout(()=>{
  392. this.routine();
  393. },1000);
  394. }
  395. startAd() {
  396. hbRequestCount = 0;
  397. getAdDataCount = 0;
  398. pageChangeCount = 0;
  399. this.routine();
  400. }
  401. getContentViewItemUplayer(contentItem) {
  402. if (contentItem.type == 0) {
  403. if (contentItem.subType == 2)
  404. return (<Image source={require('./image/timed.png')} resizeMode='center' style={styles.contentItemUpLayer} /> )
  405. if (contentItem.subType == 6)
  406. return (<Image source={require('./image/discount.png')} resizeMode='center' style={styles.contentItemUpLayer} /> )
  407. if (contentItem.subType == 7)
  408. return (<Image source={require('./image/groupbuy.png')} resizeMode='center' style={styles.contentItemUpLayer} /> )
  409. return null;
  410. }
  411. }
  412. getContentViewItemActionStr(contentItem) {
  413. if (contentItem.type == 0) {
  414. if (contentItem.subType == 2)
  415. return '扫码秒杀';
  416. else if (contentItem.subType == 6)
  417. return '扫码砍价';
  418. else if (contentItem.subType == 7)
  419. return '扫码拼团';
  420. else
  421. return '扫码领取';
  422. }
  423. }
  424. getContentViewItemMerchantName(contentItem) {
  425. if (contentItem.type == 0) {
  426. if (contentItem.target.merchantVoList.length > 1)
  427. return '多商户通用';
  428. else
  429. return contentItem.target.merchantVoList[0].merchantName;
  430. }
  431. }
  432. //排名 rank dom
  433. renderRankDom() {
  434. let rankDomStack = [];
  435. adDataList.map((item) => {
  436. rankDomStack.push(this.rankItemDom(item));
  437. })
  438. return rankDomStack;
  439. }
  440. //每一条 rank
  441. rankItemDom(item) {
  442. let fontSizeNum = 34/PixelRatio.get();
  443. return (
  444. <View style={styles.rankItemBox}>
  445. {/* <ImageBackground source={require('./image/item-background.png')} resizeMode="stretch" style={styles.rankItemBg}> */}
  446. <Image style={styles.RankLogo} resizeMode="stretch" source={{uri:item.logoUrl}}></Image>
  447. <View style={styles.rankContent}>
  448. <Text style={styles.merchantText}>{item.merchantName}</Text>
  449. <View style={styles.rankRun}>
  450. <Text style={styles.starTitle}>经营指数: {item.starNum} 分</Text>
  451. <StarRatingBar
  452. score={item.starNum}
  453. allowsHalfStars={true}
  454. accurateHalfStars={true}
  455. emptyStarImage={<Image style={{width:fontSizeNum,height:fontSizeNum}} source={require('./image/star_gray.png')} />}
  456. filledStarImage={<Image style={{width:fontSizeNum,height:fontSizeNum}} source={require('./image/star_gold.png')} />}
  457. scoreTextStyle={{color:'#fff'}}
  458. />
  459. </View>
  460. <View style={styles.rankRun}>
  461. <Text style={styles.starTitle}>人气指数: {item.starNum} 分</Text>
  462. <StarRatingBar
  463. score={item.starNum}
  464. allowsHalfStars={true}
  465. accurateHalfStars={true}
  466. emptyStarImage={<Image style={{width:fontSizeNum,height:fontSizeNum}} source={require('./image/hot_gray.png')} />}
  467. filledStarImage={<Image style={{width:fontSizeNum,height:fontSizeNum}} source={require('./image/hot_gold.png')} />}
  468. scoreTextStyle={{color:'#fff'}}
  469. />
  470. </View>
  471. </View>
  472. <Image source={{uri:item.target.qrCode}} resizeMode="stretch" style={styles.rankQrcodeImg}></Image>
  473. {/* </ImageBackground> */}
  474. </View>
  475. )
  476. }
  477. //券列表content部分
  478. getContentViewItem(contentItem, annomation) {
  479. if (!contentItem)
  480. return (
  481. <View style={styles.contentItem}>
  482. </View>
  483. )
  484. actionText = this.getContentViewItemActionStr(contentItem);
  485. merchantName = this.getContentViewItemMerchantName(contentItem);
  486. //
  487. // contentItem.target.salePriceStr = 234005.8;
  488. // console.warn(annomation)
  489. let curNumStr = contentItem.target.salePriceStr+'';
  490. let curStyleObj = {};
  491. if (curNumStr.length > 5 || Number(curNumStr) > 10000) {
  492. curStyleObj = styles.contentItemTopDetailCurPriceStr02;
  493. } else {
  494. curStyleObj = styles.contentItemTopDetailCurPriceStr01;
  495. }
  496. return (
  497. <Animatable.View animation={annomation} style={styles.contentItem}>
  498. <ImageBackground source={require('./image/item-background.png')} resizeMode='center' style={styles.contentItemDownLayer} >
  499. {/* 列表 */}
  500. <View style={styles.contentItemTop}>
  501. <Image source={{uri: contentItem.coverImg}} resizeMode='cover' style={styles.contentItemTopCoverImg} />
  502. <View style={styles.contentItemTopDetail}>
  503. {/* 券的title */}
  504. <Text style={styles.contentItemTopDetailTitle} numberOfLines={2} ellipsizeMode="tail">{contentItem.target.title}</Text>
  505. <View style={styles.contentItemTopDetailPrice}>
  506. {/* 售价 */}
  507. <View style={styles.contentItemTopDetailCurPrice}>
  508. <Text style={styles.contentItemTopDetailCurPriceStrUnit}>¥</Text>
  509. <Text style={curStyleObj}>{contentItem.target.salePriceStr}</Text>
  510. {/* <Text style={styles.contentItemTopDetailCurPriceStr}>{contentItem.target.salePriceStr}</Text> */}
  511. </View>
  512. {/* 面额 */}
  513. <View style={styles.contentItemTopDetailSalePrice}>
  514. <Text style={styles.contentItemTopDetailSalePriceStr} >¥{contentItem.target.priceStr}</Text>
  515. </View>
  516. </View>
  517. </View>
  518. {/* <Image source={{uri:'data:image/png;base64,'+contentItem.qrcode}} resizeMode='contain' style={styles.contentItemTopQrcode} /> */}
  519. <Image source={{uri:contentItem.target.qrCode}} resizeMode='contain' style={styles.contentItemTopQrcode} />
  520. </View>
  521. {/* 优惠券底部商户名称 */}
  522. <View style={styles.contentItemBottom}>
  523. <Text style={styles.contentItemBottomMerchantName}>{merchantName}</Text>
  524. <Text style={styles.contentItemBottomPlacehold}>{contentItem.target.merchantVoList[0].buildingName}{contentItem.target.merchantVoList[0].floorName}</Text>
  525. <Text style={styles.contentItemBottomAction}>{actionText}</Text>
  526. </View>
  527. </ImageBackground>
  528. {this.getContentViewItemUplayer(contentItem)}
  529. </Animatable.View>
  530. )
  531. }
  532. getContentView() {
  533. if (this.state.contentDisplayStatus) {
  534. //aaa
  535. if (true) {
  536. return (<View style={styles.content}>
  537. {this.renderRankDom()}
  538. </View>)
  539. } else {
  540. return (<View style={styles.content}>
  541. {this.getContentViewItem(this.state.contentItem0,this.state.animationTheme.first)}
  542. {this.getContentViewItem(this.state.contentItem1,this.state.animationTheme.second)}
  543. {this.getContentViewItem(this.state.contentItem2,this.state.animationTheme.third)}
  544. </View>)
  545. }
  546. }else{
  547. return (
  548. <View style={styles.content}>
  549. <Text style={styles.updatePage}>{this.state.errorMessage}</Text>
  550. </View>)
  551. }
  552. }
  553. setAdSwiperItemDom(item) {
  554. let contentItem = item.item;
  555. return (
  556. <View style={styles.onlyAdSwiperItem}>
  557. <Image source={{uri: contentItem.coverImg}} resizeMode='stretch' style={styles.onlyAdTypeItemImg} />
  558. </View>
  559. )
  560. }
  561. setSwiperItemDom(item) {
  562. let contentItem = item.item;
  563. let index = item.index;
  564. let curLogo = null;
  565. if (contentItem.type == 0) {
  566. if (contentItem.subType == 2)
  567. curLogo = require('./image/timed.png');
  568. if (contentItem.subType == 6)
  569. curLogo = require('./image/discount.png');
  570. if (contentItem.subType == 7)
  571. curLogo = require('./image/groupbuy.png');
  572. }
  573. //
  574. // contentItem.target.salePriceStr = 24502228;
  575. let curNumStr = contentItem.target.salePriceStr+'';
  576. let curStyleObj = {};
  577. if (curNumStr.length > 6 || Number(curNumStr) > 100000) {
  578. curStyleObj = styles.contentItemTopDetailCurPriceStr04;
  579. } else {
  580. curStyleObj = styles.contentItemTopDetailCurPriceStr03;
  581. }
  582. return (
  583. <View style={styles.carouselItemWrap}>
  584. {/* <BoxShadow setting={shadowOpt}> */}
  585. <View setting={shadowOpt}>
  586. <View style={styles.contentItemTopForAd} key={index}>
  587. <Image source={curLogo} resizeMode='center' style={styles.contentItemUpLayerLogo} />
  588. {/* <ImageBackground style={styles.adTypeSwiper02} resizeMode="stretch" source={require('./image/item-background.png')}></ImageBackground> */}
  589. <Image source={{uri: contentItem.coverImg}} resizeMode='cover' style={styles.adTypeItemImg} />
  590. <View style={styles.contentItemTopDetail}>
  591. {/* 券的title */}
  592. <Text style={styles.contentItemTopDetailTitle02} numberOfLines={2} ellipsizeMode="tail">{contentItem.target.title}</Text>
  593. <View style={styles.contentItemTopDetailPrice}>
  594. {/* 售价 */}
  595. <View style={styles.contentItemTopDetailCurPrice}>
  596. <Text style={styles.contentItemTopDetailCurPriceStrUnit02}>¥</Text>
  597. <Text style={curStyleObj}>{contentItem.target.salePriceStr}</Text>
  598. </View>
  599. {/* 面额 */}
  600. <View style={styles.contentItemTopDetailSalePrice02}>
  601. <Text style={styles.contentItemTopDetailSalePriceStr02} >¥{contentItem.target.priceStr}</Text>
  602. </View>
  603. </View>
  604. </View>
  605. {/* <Image source={{uri:'data:image/png;base64,'+contentItem.qrcode}} resizeMode='contain' style={styles.contentItemTopQrcode} /> */}
  606. <View style={styles.contentItemTopQrcodeBox}>
  607. <Image source={{uri:contentItem.target.qrCode}} resizeMode='contain' style={styles.contentItemTopQrcode02} />
  608. </View>
  609. </View>
  610. </View>
  611. {/* </BoxShadow> */}
  612. </View>
  613. )
  614. }
  615. getUpdateView() {
  616. if (this.state.progress.totalBytes > 0)
  617. return (
  618. <Text style={styles.updatePage}>{this.state.syncMessage}{'\n'}
  619. {this.state.progress.receivedBytes} of {this.state.progress.totalBytes} bytes received{'\n'}
  620. </Text>
  621. );
  622. return (
  623. <Text style={styles.updatePage}>{this.state.syncMessage}
  624. </Text>
  625. );
  626. }
  627. rendDefaultImg() {
  628. if (this.state.coverImgUrl) {
  629. return (
  630. <ImageBackground style={styles.adTypeBg} resizeMode="stretch" source={{uri: this.state.coverImgUrl}}></ImageBackground>
  631. )
  632. } else {
  633. return (
  634. <ImageBackground style={styles.adTypeBg} resizeMode="stretch" source={require('./image/background.png')}></ImageBackground>
  635. )
  636. }
  637. }
  638. getAdView(){
  639. if (this.state.baseInfo) {
  640. if (this.state.adType == 0) {
  641. return (
  642. <ImageBackground style={styles.background} resizeMode='center' source={require('./image/background.png')}>
  643. {/* 头部title二维码开始 */}
  644. <View style={styles.title}>
  645. <View style={styles.titleImagePlace}>
  646. <Image source={require('./image/title.png')} resizeMode='center' style={styles.titleImage} />
  647. </View>
  648. <ImageBackground source={require('./image/title-qrcode.png') } resizeMode='center' style={styles.titleQrcodeBonder} >
  649. <View style={styles.titleQrcodePlacehold}></View>
  650. <Image source={{uri: this.state.baseInfo.imgQrcodeWeapp}} resizeMode='center' style={styles.titleQrcode} />
  651. <View style={styles.titleQrcodePlacehold}></View>
  652. </ImageBackground>
  653. </View>
  654. {/* 券列表展示列表开始 */}
  655. {this.getContentView()}
  656. {/* 底部商场信息展示开始 */}
  657. <View style={styles.bottom}>
  658. <View style={styles.bottomLogoBackground}>
  659. <Image source={{ uri: this.state.baseInfo.imgUrlH}} resizeMode='contain' style={styles.bottomLogo} />
  660. </View>
  661. <View style={styles.bottomQrcode1Background}>
  662. <Image source={{ uri: this.state.baseInfo.imgQrcodeWeapp}} resizeMode='center' style={styles.bottomQrcode1} />
  663. <Text style={styles.bottomQrcode1Str}>小程序</Text>
  664. </View>
  665. <View style={styles.bottomQrcode2Background}>
  666. <Image source={{ uri: this.state.baseInfo.imgQrcodeWemp}} resizeMode='center' style={styles.bottomQrcode2} />
  667. <Text style={styles.bottomQrcode1Str}>公众号</Text>
  668. </View>
  669. <Text style={styles.bottomPlacehold}>{this.state.versionInfo}</Text>
  670. </View>
  671. </ImageBackground>
  672. );
  673. } else if (this.state.adType == 2) {
  674. let curWidthNum = 1080/(PixelRatio.get());
  675. return (
  676. // <ImageBackground style={styles.adTypeBg} source={require('./image/ad1.jpg')}> slideInDown zoomInDown
  677. <View style={styles.adWrapBox}>
  678. <Image style={styles.adWrapHideImg}
  679. onLoadStart={() => {
  680. this.setState({
  681. curImgState: false
  682. })
  683. }}
  684. onLoad={() => {
  685. this.setState({
  686. coverImgUrl: this.state.previewImg,
  687. curImgState: true
  688. })
  689. }}
  690. resizeMode="stretch" source={{uri: this.state.previewImg}}>
  691. </Image>
  692. <Animatable.View animation="fadeIn" style={styles.adWrap} key={this.state.coverImgUrl}>
  693. {this.rendDefaultImg()}
  694. </Animatable.View>
  695. <View style={styles.adTypeSwiper02}>
  696. <Carousel
  697. style={styles.adTypeSwiper02Content}
  698. ref={'carousel02'}
  699. data={adDataList}
  700. renderItem={this.setSwiperItemDom}
  701. sliderWidth={curWidthNum}
  702. itemWidth={curWidthNum}
  703. layout={'stack'}
  704. activeSlideOffset={0}
  705. autoplay={true}
  706. loop={true}
  707. autoplayInterval={5000}
  708. />
  709. </View>
  710. </View>
  711. );
  712. } else if (this.state.adType == 1) {
  713. let curWidthNum = 1080/(PixelRatio.get())
  714. return(
  715. <Carousel
  716. ref={'carousel01'}
  717. data={adDataBgList}
  718. renderItem={this.setAdSwiperItemDom}
  719. sliderWidth={curWidthNum}
  720. itemWidth={curWidthNum}
  721. activeSlideOffset={0}
  722. autoplay={true}
  723. loop={true}
  724. autoplayInterval={5000}
  725. />
  726. )
  727. }
  728. }
  729. else {
  730. return (
  731. <ImageBackground style={styles.background} resizeMode='center' source={require('./image/background.png')}>
  732. {/* 头部title二维码开始 */}
  733. <View style={styles.title}>
  734. </View>
  735. {/* 券列表展示列表开始 */}
  736. {this.getContentView()}
  737. {/* 底部商场信息展示开始 */}
  738. <View style={styles.bottom}>
  739. <View style={styles.bottomLogoBackground}>
  740. </View>
  741. <View style={styles.bottomQrcode1Background}>
  742. </View>
  743. <View style={styles.bottomQrcode2Background}>
  744. </View>
  745. <Text style={styles.bottomPlacehold}>{this.state.versionInfo}</Text>
  746. </View>
  747. </ImageBackground>
  748. );
  749. }
  750. }
  751. render() {
  752. if (this.state.updating) {
  753. return this.getUpdateView();
  754. }
  755. return this.getAdView();
  756. }
  757. }
  758. MyPage = CodePush(codePushOptions)(MyPage);
  759. const styles = StyleSheet.create({
  760. updatePage:{
  761. flex: 2,
  762. width:'100%',
  763. height:'100%',
  764. backgroundColor:'transparent',
  765. textAlign :'center',
  766. textAlignVertical:'center',
  767. fontSize: 63/PixelRatio.get(),
  768. color: 'darkblue'
  769. },
  770. //layer background
  771. background:{
  772. flex: 1,
  773. width:'100%',
  774. height:'100%'
  775. },
  776. //layer top
  777. title:{
  778. flex: 6,
  779. flexDirection: 'row',
  780. alignItems: 'center',
  781. paddingLeft:42/PixelRatio.get(),
  782. paddingRight:42/PixelRatio.get(),
  783. backgroundColor:'transparent'
  784. },
  785. content:{
  786. flex: 18,
  787. flexDirection: 'column',
  788. alignItems: 'center',
  789. backgroundColor:'transparent'
  790. },
  791. bottom:{
  792. flex: 2,
  793. flexDirection: 'row',
  794. alignItems: 'center',
  795. paddingLeft:42/PixelRatio.get(),
  796. paddingRight:42/PixelRatio.get(),
  797. backgroundColor:'transparent'
  798. },
  799. //layer title
  800. titleImagePlace: {
  801. flex: 2,
  802. paddingTop: '20%',
  803. paddingLeft: '15%',
  804. alignItems: 'center',
  805. backgroundColor:'transparent'
  806. },
  807. titleImage: {
  808. width:'100%',
  809. height:'100%',
  810. flex: 1,
  811. backgroundColor:'transparent'
  812. },
  813. titleQrcodeBonder: {
  814. width:'100%',
  815. height:'100%',
  816. alignItems: 'center',
  817. flexDirection: 'column',
  818. flex: 1,
  819. backgroundColor:'transparent'
  820. },
  821. titleQrcodePlacehold: {
  822. flex: 5,
  823. backgroundColor:'transparent'
  824. },
  825. titleQrcode: {
  826. flex: 6,
  827. width:'100%',
  828. height:'100%',
  829. backgroundColor:'transparent'
  830. },
  831. //layer bottom
  832. bottomLogoBackground: {
  833. flex: 3,
  834. borderRadius:16/PixelRatio.get(),
  835. marginTop: 26/PixelRatio.get(),
  836. marginBottom: 26/PixelRatio.get(),
  837. backgroundColor:'transparent',//'rgba(255,255,255,0.5)',
  838. },
  839. bottomLogo: {
  840. width:'100%',
  841. height:'100%',
  842. backgroundColor:'transparent'
  843. },
  844. bottomQrcode1Background : {
  845. flex: 1,
  846. width:'100%',
  847. height:'100%',
  848. marginLeft: 21/PixelRatio.get(),
  849. paddingTop: 27/PixelRatio.get(),
  850. paddingBottom: 11/PixelRatio.get(),
  851. flexDirection: 'column',
  852. backgroundColor:'transparent'
  853. },
  854. bottomQrcode2Background : {
  855. flex: 1,
  856. width:'100%',
  857. height:'100%',
  858. marginLeft: 21/PixelRatio.get(),
  859. paddingTop: 26/PixelRatio.get(),
  860. paddingBottom: 11/PixelRatio.get(),
  861. flexDirection: 'column',
  862. backgroundColor:'transparent'
  863. },
  864. bottomQrcode1: {
  865. flex: 2,
  866. width:'100%',
  867. height:'100%',
  868. backgroundColor:'transparent'
  869. },
  870. bottomQrcode2: {
  871. flex: 2,
  872. width:'100%',
  873. height:'100%',
  874. backgroundColor:'transparent'
  875. },
  876. bottomQrcode1Str: {
  877. flex: 1,
  878. textAlign :'center',
  879. textAlignVertical:'center',
  880. fontSize: 16/PixelRatio.get(),
  881. color : 'white',
  882. backgroundColor:'transparent'
  883. },
  884. bottomQrcode2Str: {
  885. flex: 1,
  886. textAlign :'center',
  887. textAlignVertical:'center',
  888. fontSize: 16/PixelRatio.get(),
  889. color : 'white',
  890. backgroundColor:'transparent'
  891. },
  892. bottomPlacehold: {
  893. flex: 8,
  894. width:'100%',
  895. height:'100%',
  896. backgroundColor:'transparent',
  897. textAlign :'right',
  898. textAlignVertical:'bottom',
  899. fontSize: 27/PixelRatio.get(),
  900. color : 'gray'
  901. },
  902. //layer content item
  903. contentItem:{
  904. flex: 1,
  905. width:'100%',
  906. height:'100%',
  907. flexDirection: 'column',
  908. backgroundColor:'transparent'
  909. },
  910. contentItemDownLayer:{
  911. position:'absolute',
  912. width:'100%',
  913. height:'100%',
  914. flexDirection: 'column',
  915. alignItems: 'center',
  916. backgroundColor:'transparent'
  917. },
  918. contentItemUpLayer:{
  919. width:210/PixelRatio.get(),
  920. height:153/PixelRatio.get(),
  921. position:'absolute',
  922. backgroundColor:'transparent'
  923. },
  924. contentItemUpLayerLogo: {
  925. width:160/PixelRatio.get(),
  926. height:83/PixelRatio.get(),
  927. position: 'absolute',
  928. left: -20/PixelRatio.get(),
  929. top: 20/PixelRatio.get(),
  930. zIndex:100,
  931. backgroundColor: 'transparent',
  932. },
  933. contentItemTop:{
  934. flex: 3,
  935. width:'100%',
  936. height:'100%',
  937. paddingLeft: 66/PixelRatio.get(),
  938. paddingRight: 53/PixelRatio.get(),
  939. paddingTop: 40/PixelRatio.get(),
  940. flexDirection: 'row',
  941. alignItems: 'center',
  942. backgroundColor:'transparent'
  943. },
  944. contentItemBottom:{
  945. flex: 1,
  946. width:'100%',
  947. height:'100%',
  948. paddingLeft: 66/PixelRatio.get(),
  949. paddingRight: 53/PixelRatio.get(),
  950. paddingBottom: 40/PixelRatio.get(),
  951. flexDirection: 'row',
  952. alignItems: 'center',
  953. backgroundColor:'transparent'
  954. },
  955. //layer content item top
  956. contentItemTopCoverImg:{
  957. flex: 5,
  958. width:'100%',
  959. height:'100%',
  960. borderRadius:27/PixelRatio.get(),
  961. backgroundColor:'transparent'
  962. },
  963. contentItemTopDetail:{
  964. flex: 6,
  965. width:'100%',
  966. height:'100%',
  967. paddingLeft: 20/PixelRatio.get(),
  968. paddingRight: 20/PixelRatio.get(),
  969. alignItems: 'center',
  970. backgroundColor:'transparent'
  971. },
  972. contentItemTopQrcode:{
  973. flex: 5,
  974. width:'100%',
  975. height:'100%',
  976. marginLeft:18/PixelRatio.get(),
  977. // backgroundColor:'transparent'
  978. },
  979. contentItemTopQrcodeBox:{
  980. flex: 5,
  981. width:'100%',
  982. height:'100%',
  983. flexDirection: 'column',
  984. alignItems: 'center',
  985. justifyContent: 'center',
  986. marginLeft: -28/PixelRatio.get(),
  987. // backgroundColor:'transparent'
  988. },
  989. contentItemTopQrcode02:{
  990. width:'90%',
  991. height:'90%',
  992. },
  993. //layer content item bottom
  994. contentItemBottomMerchantName:{
  995. flex: 5,
  996. width:'100%',
  997. height:'100%',
  998. alignItems: 'center',
  999. color:"black",
  1000. backgroundColor:'transparent',
  1001. textAlign :'center',
  1002. textAlignVertical:'center',
  1003. fontSize: 27/PixelRatio.get(),
  1004. fontWeight : 'bold',
  1005. },
  1006. contentItemBottomPlacehold:{
  1007. flex: 6,
  1008. fontSize: 27/PixelRatio.get(),
  1009. paddingLeft: 27/PixelRatio.get(),
  1010. paddingRight: 79/PixelRatio.get(),
  1011. width:'100%',
  1012. height:'100%',
  1013. color:"black",
  1014. textAlignVertical:'center',
  1015. backgroundColor:'transparent',
  1016. },
  1017. contentItemBottomAction:{
  1018. flex: 5,
  1019. width:'100%',
  1020. height:'100%',
  1021. backgroundColor:'transparent',
  1022. textAlign :'center',
  1023. textAlignVertical:'center',
  1024. fontSize: 36/PixelRatio.get(),
  1025. color: 'black',
  1026. },
  1027. contentItemBottomAction02:{
  1028. width:'100%',
  1029. height: 60/PixelRatio.get(),
  1030. backgroundColor:'transparent',
  1031. textAlign :'center',
  1032. textAlignVertical:'center',
  1033. fontSize: 36/PixelRatio.get(),
  1034. color: 'black',
  1035. },
  1036. // 券的title
  1037. contentItemTopDetailTitle:{
  1038. flex: 2,
  1039. // height:'100%',
  1040. width:'100%',
  1041. marginTop:"2%",
  1042. backgroundColor:'transparent',
  1043. textAlign :'left',
  1044. color:"black",
  1045. textAlignVertical:'center',
  1046. fontSize: 53/PixelRatio.get(),
  1047. },
  1048. // 券的title
  1049. contentItemTopDetailTitle02:{
  1050. flex: 2,
  1051. // height:'100%',
  1052. width:'100%',
  1053. marginTop:"2%",
  1054. paddingRight: 14/PixelRatio.get(),
  1055. backgroundColor:'transparent',
  1056. textAlign :'left',
  1057. color:"black",
  1058. textAlignVertical:'center',
  1059. fontSize: 42/PixelRatio.get(),
  1060. },
  1061. /*
  1062. contentItemTopDetailRemark:{
  1063. flex: 1,
  1064. width:'100%',
  1065. height:'100%',
  1066. backgroundColor:'transparent',
  1067. textAlign :'left',
  1068. textAlignVertical:'center',
  1069. fontSize: 27/PixelRatio.get(),
  1070. color : 'gray'
  1071. },
  1072. */
  1073. contentItemTopDetailPrice:{
  1074. flex: 2,
  1075. width:'100%',
  1076. height:'100%',
  1077. backgroundColor:'transparent',
  1078. flexDirection: 'row',
  1079. },
  1080. // 售价的样式
  1081. contentItemTopDetailCurPrice:{
  1082. position:"absolute",
  1083. bottom:10,
  1084. left:0,
  1085. width:'100%',
  1086. height:'100%',
  1087. flexDirection: 'row',
  1088. backgroundColor:'transparent',
  1089. },
  1090. contentItemTopDetailCurPriceStr01:{
  1091. backgroundColor:'transparent',
  1092. fontSize:96/PixelRatio.get(),
  1093. fontFamily:"PingFangSC-Bold",
  1094. fontWeight: "bold",
  1095. textAlign :'left',
  1096. textAlignVertical:'bottom',
  1097. color : 'red'
  1098. },
  1099. //金额超10000,字号修改
  1100. contentItemTopDetailCurPriceStr02:{
  1101. backgroundColor:'transparent',
  1102. fontSize:64/PixelRatio.get(),
  1103. fontFamily:"PingFangSC-Bold",
  1104. fontWeight: "bold",
  1105. textAlign :'left',
  1106. textAlignVertical:'bottom',
  1107. paddingBottom: 8/PixelRatio.get(),
  1108. color : 'red'
  1109. },
  1110. contentItemTopDetailCurPriceStr03:{
  1111. backgroundColor:'transparent',
  1112. fontSize:72/PixelRatio.get(),
  1113. fontFamily:"PingFangSC-Bold",
  1114. fontWeight: "bold",
  1115. textAlign :'left',
  1116. color : 'red'
  1117. },
  1118. //金额超10000,字号修改
  1119. contentItemTopDetailCurPriceStr04:{
  1120. backgroundColor:'transparent',
  1121. fontSize:52/PixelRatio.get(),
  1122. fontFamily:"PingFangSC-Bold",
  1123. fontWeight: "bold",
  1124. textAlign :'left',
  1125. paddingTop: 16/PixelRatio.get(),
  1126. color : 'red'
  1127. },
  1128. contentItemTopDetailCurPriceStrUnit:{
  1129. backgroundColor:'transparent',
  1130. textAlign :'left',
  1131. textAlignVertical:'bottom',
  1132. paddingBottom: 16/PixelRatio.get(),
  1133. fontSize: 48/PixelRatio.get(),
  1134. color : 'red',
  1135. },
  1136. contentItemTopDetailCurPriceStrUnit02:{
  1137. backgroundColor:'transparent',
  1138. textAlign :'left',
  1139. textAlignVertical:'center',
  1140. paddingBottom: 16/PixelRatio.get(),
  1141. fontSize: 48/PixelRatio.get(),
  1142. color : 'red'
  1143. },
  1144. // 面额的样式
  1145. contentItemTopDetailSalePrice:{
  1146. position:"absolute",
  1147. bottom:2,
  1148. left:0,
  1149. // flex: 1,
  1150. paddingTop:138/PixelRatio.get(),
  1151. width:'100%',
  1152. // height:'100%',
  1153. backgroundColor:'transparent',
  1154. },
  1155. contentItemTopDetailSalePrice02:{
  1156. position:"absolute",
  1157. bottom:14/PixelRatio.get(),
  1158. left:0,
  1159. // flex: 1,
  1160. paddingTop:138/PixelRatio.get(),
  1161. width:'100%',
  1162. // height:'100%',
  1163. backgroundColor:'transparent',
  1164. },
  1165. contentItemTopDetailSalePriceStr:{
  1166. width:'100%',
  1167. height:'100%',
  1168. backgroundColor:'transparent',
  1169. textAlign :'left',
  1170. textAlignVertical:'bottom',
  1171. fontSize: 27/PixelRatio.get(),
  1172. textDecorationLine: 'line-through',
  1173. color : 'gray'
  1174. },
  1175. contentItemTopDetailSalePriceStr02:{
  1176. width:'100%',
  1177. height:'100%',
  1178. backgroundColor:'transparent',
  1179. textAlignVertical:'center',
  1180. textAlign :'left',
  1181. fontSize: 27/PixelRatio.get(),
  1182. textDecorationLine: 'line-through',
  1183. color : 'gray'
  1184. },
  1185. adTypeBg:{
  1186. flex: 1,
  1187. width: '100%',
  1188. height: '100%',
  1189. },
  1190. adWrapBox: {
  1191. width: '100%',
  1192. height: '100%',
  1193. position: 'relative',
  1194. },
  1195. adWrap: {
  1196. width: '100%',
  1197. height: '100%',
  1198. position: 'absolute',
  1199. left: 0,
  1200. top: 0,
  1201. zIndex: 10,
  1202. },
  1203. adWrapHideImg: {
  1204. width: '100%',
  1205. height: '100%',
  1206. position: 'absolute',
  1207. left: 0,
  1208. top: 0,
  1209. zIndex: -1,
  1210. opacity:0,
  1211. },
  1212. adTypeSwiper02:{
  1213. flex: 1,
  1214. alignItems: 'center',
  1215. position: 'absolute',
  1216. left: 0,
  1217. bottom: 60/PixelRatio.get(),
  1218. width: '100%',
  1219. height: 270/PixelRatio.get(),
  1220. paddingTop: 10/PixelRatio.get(),
  1221. paddingBottom: 10/PixelRatio.get(),
  1222. backgroundColor: 'rgba(0,0,0,.1)',
  1223. },
  1224. adTypeItemImgWrap:{
  1225. flex: 1,
  1226. width: '100%',
  1227. height: 369/PixelRatio.get(),
  1228. flexDirection: 'row',
  1229. alignItems: 'center',
  1230. },
  1231. adTypeItemImg:{
  1232. width: 200/PixelRatio.get(),
  1233. height: 200/PixelRatio.get(),
  1234. marginLeft: 8/PixelRatio.get(),
  1235. marginTop: 20/PixelRatio.get(),
  1236. borderRadius:27/PixelRatio.get(),
  1237. backgroundColor:'transparent'
  1238. },
  1239. bottomBox:{
  1240. position: 'absolute',
  1241. bottom: 20/PixelRatio.get(),
  1242. left: 0,
  1243. width: '100%',
  1244. height: 130/PixelRatio.get(),
  1245. flexDirection: 'row',
  1246. alignItems: 'center',
  1247. backgroundColor:'transparent',
  1248. },
  1249. contentItemTopForAd:{
  1250. position: 'relative',
  1251. flex: 1,
  1252. width: 800/PixelRatio.get(),
  1253. // width: '100%',
  1254. height:'100%',
  1255. paddingLeft: 12/PixelRatio.get(),
  1256. paddingRight: 26/PixelRatio.get(),
  1257. flexDirection: 'row',
  1258. alignItems: 'flex-start',
  1259. borderRadius: 6,
  1260. backgroundColor:'rgba(255,255,255,.8)',
  1261. },
  1262. onlyAdSwiperItem:{
  1263. width: '100%',
  1264. height: '100%',
  1265. },
  1266. onlyAdTypeItemImg:{
  1267. width: '100%',
  1268. height: '100%',
  1269. },
  1270. carouselItemWrap: {
  1271. flex: 1,
  1272. width: '100%',
  1273. backgroundColor: 'transparent',
  1274. alignItems: 'center',
  1275. },
  1276. //排名的列表样式
  1277. rankItemBox: {
  1278. flex: 1,
  1279. flexDirection: 'row',
  1280. alignItems: 'center',
  1281. width: '92%',
  1282. height: 260/PixelRatio.get(),
  1283. backgroundColor: '#fff',
  1284. borderRadius: 26/PixelRatio.get(),
  1285. marginTop: 20/PixelRatio.get(),
  1286. borderWidth: 1,
  1287. borderColor: 'green',
  1288. },
  1289. rankContent: {
  1290. marginLeft: 30/PixelRatio.get(),
  1291. },
  1292. rankItemBg: {
  1293. flex: 1,
  1294. flexDirection: 'row',
  1295. alignItems: 'center',
  1296. width: '100%',
  1297. height: 260/PixelRatio.get(),
  1298. borderWidth: 1,
  1299. borderColor: 'blue',
  1300. },
  1301. RankLogo: {
  1302. width: 220/PixelRatio.get(),
  1303. height: 220/PixelRatio.get(),
  1304. marginLeft: 30/PixelRatio.get(),
  1305. borderWidth: 1,
  1306. borderColor: 'yellow',
  1307. },
  1308. rankQrcodeImg: {
  1309. width: 220/PixelRatio.get(),
  1310. height: 220/PixelRatio.get(),
  1311. marginLeft: 10/PixelRatio.get(),
  1312. },
  1313. starTitle: {
  1314. fontSize: 34/PixelRatio.get(),
  1315. },
  1316. merchantText: {
  1317. fontSize: 40/PixelRatio.get(),
  1318. fontWeight : 'bold',
  1319. marginBottom:10/PixelRatio.get(),
  1320. marginTop:10/PixelRatio.get(),
  1321. }
  1322. });