广告屏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.
 
 
 
 
 

1479 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,index) => {
  436. rankDomStack.push(this.rankItemDom(item,index));
  437. })
  438. return rankDomStack;
  439. }
  440. //每一条 rank
  441. rankItemDom(item,index) {
  442. let fontSizeNum = 44/(PixelRatio.get());
  443. let curStyleObj = {
  444. width: fontSizeNum,
  445. height: fontSizeNum,
  446. }
  447. return (
  448. <View style={styles.rankItemBox} key={index}>
  449. <Image style={styles.RankLogo} resizeMode="stretch" source={{uri:item.logoUrl}}></Image>
  450. <View style={styles.rankContent}>
  451. <Text style={styles.merchantText} numberOfLines={1} ellipsizeMode="tail">{item.merchantName}</Text>
  452. <View style={styles.rankRunBox}>
  453. <View style={styles.rankRun}>
  454. <Text style={styles.starTitle}>经营指数: {item.starNum} 分</Text>
  455. <View style={{height: fontSizeNum,flexDirection: 'row', alignItems: 'center',marginTop:20/PixelRatio.get()}}>
  456. <StarRatingBar
  457. score={item.starNum}
  458. allowsHalfStars={true}
  459. accurateHalfStars={true}
  460. starStyle={curStyleObj}
  461. emptyStarImage={<Image style={curStyleObj} resizeMode="stretch" source={require('./image/star_gray.png')} />}
  462. filledStarImage={<Image style={curStyleObj} resizeMode="stretch" source={require('./image/star_red.png')} />}
  463. scoreTextStyle={{color:'#fff'}}
  464. />
  465. </View>
  466. </View>
  467. <View style={styles.rankRun}>
  468. <Text style={styles.starTitle}>人气指数: {item.starNum} 分</Text>
  469. <View style={{height: fontSizeNum,flexDirection: 'row', alignItems: 'center',marginTop:20/PixelRatio.get()}}>
  470. <StarRatingBar
  471. score={item.starNum}
  472. allowsHalfStars={true}
  473. accurateHalfStars={true}
  474. starStyle={curStyleObj}
  475. emptyStarImage={<Image style={curStyleObj} resizeMode="stretch" source={require('./image/hot_gray.png')} />}
  476. filledStarImage={<Image style={curStyleObj} resizeMode="stretch" source={require('./image/hot_red.png')} />}
  477. scoreTextStyle={{color:'#fff'}}
  478. />
  479. </View>
  480. </View>
  481. </View>
  482. </View>
  483. <Image source={{uri:item.target.qrCode}} resizeMode="stretch" style={styles.rankQrcodeImg}></Image>
  484. </View>
  485. )
  486. }
  487. //券列表content部分
  488. getContentViewItem(contentItem, annomation) {
  489. if (!contentItem)
  490. return (
  491. <View style={styles.contentItem}>
  492. </View>
  493. )
  494. actionText = this.getContentViewItemActionStr(contentItem);
  495. merchantName = this.getContentViewItemMerchantName(contentItem);
  496. //
  497. // contentItem.target.salePriceStr = 234005.8;
  498. // console.warn(annomation)
  499. let curNumStr = contentItem.target.salePriceStr+'';
  500. let curStyleObj = {};
  501. if (curNumStr.length > 5 || Number(curNumStr) > 10000) {
  502. curStyleObj = styles.contentItemTopDetailCurPriceStr02;
  503. } else {
  504. curStyleObj = styles.contentItemTopDetailCurPriceStr01;
  505. }
  506. return (
  507. <Animatable.View animation={annomation} style={styles.contentItem}>
  508. <ImageBackground source={require('./image/item-background.png')} resizeMode='center' style={styles.contentItemDownLayer} >
  509. {/* 列表 */}
  510. <View style={styles.contentItemTop}>
  511. <Image source={{uri: contentItem.coverImg}} resizeMode='cover' style={styles.contentItemTopCoverImg} />
  512. <View style={styles.contentItemTopDetail}>
  513. {/* 券的title */}
  514. <Text style={styles.contentItemTopDetailTitle} numberOfLines={2} ellipsizeMode="tail">{contentItem.target.title}</Text>
  515. <View style={styles.contentItemTopDetailPrice}>
  516. {/* 售价 */}
  517. <View style={styles.contentItemTopDetailCurPrice}>
  518. <Text style={styles.contentItemTopDetailCurPriceStrUnit}>¥</Text>
  519. <Text style={curStyleObj}>{contentItem.target.salePriceStr}</Text>
  520. {/* <Text style={styles.contentItemTopDetailCurPriceStr}>{contentItem.target.salePriceStr}</Text> */}
  521. </View>
  522. {/* 面额 */}
  523. <View style={styles.contentItemTopDetailSalePrice}>
  524. <Text style={styles.contentItemTopDetailSalePriceStr} >¥{contentItem.target.priceStr}</Text>
  525. </View>
  526. </View>
  527. </View>
  528. {/* <Image source={{uri:'data:image/png;base64,'+contentItem.qrcode}} resizeMode='contain' style={styles.contentItemTopQrcode} /> */}
  529. <Image source={{uri:contentItem.target.qrCode}} resizeMode='contain' style={styles.contentItemTopQrcode} />
  530. </View>
  531. {/* 优惠券底部商户名称 */}
  532. <View style={styles.contentItemBottom}>
  533. <Text style={styles.contentItemBottomMerchantName}>{merchantName}</Text>
  534. <Text style={styles.contentItemBottomPlacehold}>{contentItem.target.merchantVoList[0].buildingName}{contentItem.target.merchantVoList[0].floorName}</Text>
  535. <Text style={styles.contentItemBottomAction}>{actionText}</Text>
  536. </View>
  537. </ImageBackground>
  538. {this.getContentViewItemUplayer(contentItem)}
  539. </Animatable.View>
  540. )
  541. }
  542. getContentView() {
  543. if (this.state.contentDisplayStatus) {
  544. //aaa
  545. if (true) {
  546. return (<View style={styles.content}>
  547. {this.renderRankDom()}
  548. </View>)
  549. } else {
  550. return (<View style={styles.content}>
  551. {this.getContentViewItem(this.state.contentItem0,this.state.animationTheme.first)}
  552. {this.getContentViewItem(this.state.contentItem1,this.state.animationTheme.second)}
  553. {this.getContentViewItem(this.state.contentItem2,this.state.animationTheme.third)}
  554. </View>)
  555. }
  556. }else{
  557. return (
  558. <View style={styles.content}>
  559. <Text style={styles.updatePage}>{this.state.errorMessage}</Text>
  560. </View>)
  561. }
  562. }
  563. setAdSwiperItemDom(item) {
  564. let contentItem = item.item;
  565. return (
  566. <View style={styles.onlyAdSwiperItem}>
  567. <Image source={{uri: contentItem.coverImg}} resizeMode='stretch' style={styles.onlyAdTypeItemImg} />
  568. </View>
  569. )
  570. }
  571. setSwiperItemDom(item) {
  572. let contentItem = item.item;
  573. let index = item.index;
  574. let curLogo = null;
  575. if (contentItem.type == 0) {
  576. if (contentItem.subType == 2)
  577. curLogo = require('./image/timed.png');
  578. if (contentItem.subType == 6)
  579. curLogo = require('./image/discount.png');
  580. if (contentItem.subType == 7)
  581. curLogo = require('./image/groupbuy.png');
  582. }
  583. //
  584. // contentItem.target.salePriceStr = 24502228;
  585. let curNumStr = contentItem.target.salePriceStr+'';
  586. let curStyleObj = {};
  587. if (curNumStr.length > 6 || Number(curNumStr) > 100000) {
  588. curStyleObj = styles.contentItemTopDetailCurPriceStr04;
  589. } else {
  590. curStyleObj = styles.contentItemTopDetailCurPriceStr03;
  591. }
  592. return (
  593. <View style={styles.carouselItemWrap}>
  594. {/* <BoxShadow setting={shadowOpt}> */}
  595. <View setting={shadowOpt}>
  596. <View style={styles.contentItemTopForAd} key={index}>
  597. <Image source={curLogo} resizeMode='center' style={styles.contentItemUpLayerLogo} />
  598. {/* <ImageBackground style={styles.adTypeSwiper02} resizeMode="stretch" source={require('./image/item-background.png')}></ImageBackground> */}
  599. <Image source={{uri: contentItem.coverImg}} resizeMode='cover' style={styles.adTypeItemImg} />
  600. <View style={styles.contentItemTopDetail}>
  601. {/* 券的title */}
  602. <Text style={styles.contentItemTopDetailTitle02} numberOfLines={2} ellipsizeMode="tail">{contentItem.target.title}</Text>
  603. <View style={styles.contentItemTopDetailPrice}>
  604. {/* 售价 */}
  605. <View style={styles.contentItemTopDetailCurPrice}>
  606. <Text style={styles.contentItemTopDetailCurPriceStrUnit02}>¥</Text>
  607. <Text style={curStyleObj}>{contentItem.target.salePriceStr}</Text>
  608. </View>
  609. {/* 面额 */}
  610. <View style={styles.contentItemTopDetailSalePrice02}>
  611. <Text style={styles.contentItemTopDetailSalePriceStr02} >¥{contentItem.target.priceStr}</Text>
  612. </View>
  613. </View>
  614. </View>
  615. {/* <Image source={{uri:'data:image/png;base64,'+contentItem.qrcode}} resizeMode='contain' style={styles.contentItemTopQrcode} /> */}
  616. <View style={styles.contentItemTopQrcodeBox}>
  617. <Image source={{uri:contentItem.target.qrCode}} resizeMode='contain' style={styles.contentItemTopQrcode02} />
  618. </View>
  619. </View>
  620. </View>
  621. {/* </BoxShadow> */}
  622. </View>
  623. )
  624. }
  625. getUpdateView() {
  626. if (this.state.progress.totalBytes > 0)
  627. return (
  628. <Text style={styles.updatePage}>{this.state.syncMessage}{'\n'}
  629. {this.state.progress.receivedBytes} of {this.state.progress.totalBytes} bytes received{'\n'}
  630. </Text>
  631. );
  632. return (
  633. <Text style={styles.updatePage}>{this.state.syncMessage}
  634. </Text>
  635. );
  636. }
  637. rendDefaultImg() {
  638. if (this.state.coverImgUrl) {
  639. return (
  640. <ImageBackground style={styles.adTypeBg} resizeMode="stretch" source={{uri: this.state.coverImgUrl}}></ImageBackground>
  641. )
  642. } else {
  643. return (
  644. <ImageBackground style={styles.adTypeBg} resizeMode="stretch" source={require('./image/background.png')}></ImageBackground>
  645. )
  646. }
  647. }
  648. getAdView(){
  649. if (this.state.baseInfo) {
  650. if (this.state.adType == 0) {
  651. return (
  652. <ImageBackground style={styles.background} resizeMode='center' source={require('./image/background.png')}>
  653. {/* 头部title二维码开始 */}
  654. <View style={styles.title}>
  655. <View style={styles.titleImagePlace}>
  656. <Image source={require('./image/title.png')} resizeMode='center' style={styles.titleImage} />
  657. </View>
  658. <ImageBackground source={require('./image/title-qrcode.png') } resizeMode='center' style={styles.titleQrcodeBonder} >
  659. <View style={styles.titleQrcodePlacehold}></View>
  660. <Image source={{uri: this.state.baseInfo.imgQrcodeWeapp}} resizeMode='center' style={styles.titleQrcode} />
  661. <View style={styles.titleQrcodePlacehold}></View>
  662. </ImageBackground>
  663. </View>
  664. {/* 券列表展示列表开始 */}
  665. {this.getContentView()}
  666. {/* 底部商场信息展示开始 */}
  667. <View style={styles.bottom}>
  668. <View style={styles.bottomLogoBackground}>
  669. <Image source={{ uri: this.state.baseInfo.imgUrlH}} resizeMode='contain' style={styles.bottomLogo} />
  670. </View>
  671. <View style={styles.bottomQrcode1Background}>
  672. <Image source={{ uri: this.state.baseInfo.imgQrcodeWeapp}} resizeMode='center' style={styles.bottomQrcode1} />
  673. <Text style={styles.bottomQrcode1Str}>小程序</Text>
  674. </View>
  675. <View style={styles.bottomQrcode2Background}>
  676. <Image source={{ uri: this.state.baseInfo.imgQrcodeWemp}} resizeMode='center' style={styles.bottomQrcode2} />
  677. <Text style={styles.bottomQrcode1Str}>公众号</Text>
  678. </View>
  679. <Text style={styles.bottomPlacehold}>{this.state.versionInfo}</Text>
  680. </View>
  681. </ImageBackground>
  682. );
  683. } else if (this.state.adType == 2) {
  684. let curWidthNum = 1080/(PixelRatio.get());
  685. return (
  686. // <ImageBackground style={styles.adTypeBg} source={require('./image/ad1.jpg')}> slideInDown zoomInDown
  687. <View style={styles.adWrapBox}>
  688. <Image style={styles.adWrapHideImg}
  689. onLoadStart={() => {
  690. this.setState({
  691. curImgState: false
  692. })
  693. }}
  694. onLoad={() => {
  695. this.setState({
  696. coverImgUrl: this.state.previewImg,
  697. curImgState: true
  698. })
  699. }}
  700. resizeMode="stretch" source={{uri: this.state.previewImg}}>
  701. </Image>
  702. <Animatable.View animation="fadeIn" style={styles.adWrap} key={this.state.coverImgUrl}>
  703. {this.rendDefaultImg()}
  704. </Animatable.View>
  705. <View style={styles.adTypeSwiper02}>
  706. <Carousel
  707. style={styles.adTypeSwiper02Content}
  708. ref={'carousel02'}
  709. data={adDataList}
  710. renderItem={this.setSwiperItemDom}
  711. sliderWidth={curWidthNum}
  712. itemWidth={curWidthNum}
  713. layout={'stack'}
  714. activeSlideOffset={0}
  715. autoplay={true}
  716. loop={true}
  717. autoplayInterval={5000}
  718. />
  719. </View>
  720. </View>
  721. );
  722. } else if (this.state.adType == 1) {
  723. let curWidthNum = 1080/(PixelRatio.get())
  724. return(
  725. <Carousel
  726. ref={'carousel01'}
  727. data={adDataBgList}
  728. renderItem={this.setAdSwiperItemDom}
  729. sliderWidth={curWidthNum}
  730. itemWidth={curWidthNum}
  731. activeSlideOffset={0}
  732. autoplay={true}
  733. loop={true}
  734. autoplayInterval={5000}
  735. />
  736. )
  737. }
  738. }
  739. else {
  740. return (
  741. <ImageBackground style={styles.background} resizeMode='center' source={require('./image/background.png')}>
  742. {/* 头部title二维码开始 */}
  743. <View style={styles.title}>
  744. </View>
  745. {/* 券列表展示列表开始 */}
  746. {this.getContentView()}
  747. {/* 底部商场信息展示开始 */}
  748. <View style={styles.bottom}>
  749. <View style={styles.bottomLogoBackground}>
  750. </View>
  751. <View style={styles.bottomQrcode1Background}>
  752. </View>
  753. <View style={styles.bottomQrcode2Background}>
  754. </View>
  755. <Text style={styles.bottomPlacehold}>{this.state.versionInfo}</Text>
  756. </View>
  757. </ImageBackground>
  758. );
  759. }
  760. }
  761. render() {
  762. if (this.state.updating) {
  763. return this.getUpdateView();
  764. }
  765. return this.getAdView();
  766. }
  767. }
  768. MyPage = CodePush(codePushOptions)(MyPage);
  769. const styles = StyleSheet.create({
  770. updatePage:{
  771. flex: 2,
  772. width:'100%',
  773. height:'100%',
  774. backgroundColor:'transparent',
  775. textAlign :'center',
  776. textAlignVertical:'center',
  777. fontSize: 63/PixelRatio.get(),
  778. color: 'darkblue'
  779. },
  780. //layer background
  781. background:{
  782. flex: 1,
  783. width:'100%',
  784. height:'100%'
  785. },
  786. //layer top
  787. title:{
  788. flex: 6,
  789. flexDirection: 'row',
  790. alignItems: 'center',
  791. paddingLeft:42/PixelRatio.get(),
  792. paddingRight:42/PixelRatio.get(),
  793. backgroundColor:'transparent'
  794. },
  795. content:{
  796. flex: 18,
  797. flexDirection: 'column',
  798. alignItems: 'center',
  799. backgroundColor:'transparent'
  800. },
  801. bottom:{
  802. flex: 2,
  803. flexDirection: 'row',
  804. alignItems: 'center',
  805. paddingLeft:42/PixelRatio.get(),
  806. paddingRight:42/PixelRatio.get(),
  807. backgroundColor:'transparent'
  808. },
  809. //layer title
  810. titleImagePlace: {
  811. flex: 2,
  812. paddingTop: '20%',
  813. paddingLeft: '15%',
  814. alignItems: 'center',
  815. backgroundColor:'transparent'
  816. },
  817. titleImage: {
  818. width:'100%',
  819. height:'100%',
  820. flex: 1,
  821. backgroundColor:'transparent'
  822. },
  823. titleQrcodeBonder: {
  824. width:'100%',
  825. height:'100%',
  826. alignItems: 'center',
  827. flexDirection: 'column',
  828. flex: 1,
  829. backgroundColor:'transparent'
  830. },
  831. titleQrcodePlacehold: {
  832. flex: 5,
  833. backgroundColor:'transparent'
  834. },
  835. titleQrcode: {
  836. flex: 6,
  837. width:'100%',
  838. height:'100%',
  839. backgroundColor:'transparent'
  840. },
  841. //layer bottom
  842. bottomLogoBackground: {
  843. flex: 3,
  844. borderRadius:16/PixelRatio.get(),
  845. marginTop: 26/PixelRatio.get(),
  846. marginBottom: 26/PixelRatio.get(),
  847. backgroundColor:'transparent',//'rgba(255,255,255,0.5)',
  848. },
  849. bottomLogo: {
  850. width:'100%',
  851. height:'100%',
  852. backgroundColor:'transparent'
  853. },
  854. bottomQrcode1Background : {
  855. flex: 1,
  856. width:'100%',
  857. height:'100%',
  858. marginLeft: 21/PixelRatio.get(),
  859. paddingTop: 27/PixelRatio.get(),
  860. paddingBottom: 11/PixelRatio.get(),
  861. flexDirection: 'column',
  862. backgroundColor:'transparent'
  863. },
  864. bottomQrcode2Background : {
  865. flex: 1,
  866. width:'100%',
  867. height:'100%',
  868. marginLeft: 21/PixelRatio.get(),
  869. paddingTop: 26/PixelRatio.get(),
  870. paddingBottom: 11/PixelRatio.get(),
  871. flexDirection: 'column',
  872. backgroundColor:'transparent'
  873. },
  874. bottomQrcode1: {
  875. flex: 2,
  876. width:'100%',
  877. height:'100%',
  878. backgroundColor:'transparent'
  879. },
  880. bottomQrcode2: {
  881. flex: 2,
  882. width:'100%',
  883. height:'100%',
  884. backgroundColor:'transparent'
  885. },
  886. bottomQrcode1Str: {
  887. flex: 1,
  888. textAlign :'center',
  889. textAlignVertical:'center',
  890. fontSize: 16/PixelRatio.get(),
  891. color : 'white',
  892. backgroundColor:'transparent'
  893. },
  894. bottomQrcode2Str: {
  895. flex: 1,
  896. textAlign :'center',
  897. textAlignVertical:'center',
  898. fontSize: 16/PixelRatio.get(),
  899. color : 'white',
  900. backgroundColor:'transparent'
  901. },
  902. bottomPlacehold: {
  903. flex: 8,
  904. width:'100%',
  905. height:'100%',
  906. backgroundColor:'transparent',
  907. textAlign :'right',
  908. textAlignVertical:'bottom',
  909. fontSize: 27/PixelRatio.get(),
  910. color : 'gray'
  911. },
  912. //layer content item
  913. contentItem:{
  914. flex: 1,
  915. width:'100%',
  916. height:'100%',
  917. flexDirection: 'column',
  918. backgroundColor:'transparent'
  919. },
  920. contentItemDownLayer:{
  921. position:'absolute',
  922. width:'100%',
  923. height:'100%',
  924. flexDirection: 'column',
  925. alignItems: 'center',
  926. backgroundColor:'transparent'
  927. },
  928. contentItemUpLayer:{
  929. width:210/PixelRatio.get(),
  930. height:153/PixelRatio.get(),
  931. position:'absolute',
  932. backgroundColor:'transparent'
  933. },
  934. contentItemUpLayerLogo: {
  935. width:160/PixelRatio.get(),
  936. height:83/PixelRatio.get(),
  937. position: 'absolute',
  938. left: -20/PixelRatio.get(),
  939. top: 20/PixelRatio.get(),
  940. zIndex:100,
  941. backgroundColor: 'transparent',
  942. },
  943. contentItemTop:{
  944. flex: 3,
  945. width:'100%',
  946. height:'100%',
  947. paddingLeft: 66/PixelRatio.get(),
  948. paddingRight: 53/PixelRatio.get(),
  949. paddingTop: 40/PixelRatio.get(),
  950. flexDirection: 'row',
  951. alignItems: 'center',
  952. backgroundColor:'transparent'
  953. },
  954. contentItemBottom:{
  955. flex: 1,
  956. width:'100%',
  957. height:'100%',
  958. paddingLeft: 66/PixelRatio.get(),
  959. paddingRight: 53/PixelRatio.get(),
  960. paddingBottom: 40/PixelRatio.get(),
  961. flexDirection: 'row',
  962. alignItems: 'center',
  963. backgroundColor:'transparent'
  964. },
  965. //layer content item top
  966. contentItemTopCoverImg:{
  967. flex: 5,
  968. width:'100%',
  969. height:'100%',
  970. borderRadius:27/PixelRatio.get(),
  971. backgroundColor:'transparent'
  972. },
  973. contentItemTopDetail:{
  974. flex: 6,
  975. width:'100%',
  976. height:'100%',
  977. paddingLeft: 20/PixelRatio.get(),
  978. paddingRight: 20/PixelRatio.get(),
  979. alignItems: 'center',
  980. backgroundColor:'transparent'
  981. },
  982. contentItemTopQrcode:{
  983. flex: 5,
  984. width:'100%',
  985. height:'100%',
  986. marginLeft:18/PixelRatio.get(),
  987. // backgroundColor:'transparent'
  988. },
  989. contentItemTopQrcodeBox:{
  990. flex: 5,
  991. width:'100%',
  992. height:'100%',
  993. flexDirection: 'column',
  994. alignItems: 'center',
  995. justifyContent: 'center',
  996. marginLeft: -28/PixelRatio.get(),
  997. // backgroundColor:'transparent'
  998. },
  999. contentItemTopQrcode02:{
  1000. width:'90%',
  1001. height:'90%',
  1002. },
  1003. //layer content item bottom
  1004. contentItemBottomMerchantName:{
  1005. flex: 5,
  1006. width:'100%',
  1007. height:'100%',
  1008. alignItems: 'center',
  1009. color:"black",
  1010. backgroundColor:'transparent',
  1011. textAlign :'center',
  1012. textAlignVertical:'center',
  1013. fontSize: 27/PixelRatio.get(),
  1014. fontWeight : 'bold',
  1015. },
  1016. contentItemBottomPlacehold:{
  1017. flex: 6,
  1018. fontSize: 27/PixelRatio.get(),
  1019. paddingLeft: 27/PixelRatio.get(),
  1020. paddingRight: 79/PixelRatio.get(),
  1021. width:'100%',
  1022. height:'100%',
  1023. color:"black",
  1024. textAlignVertical:'center',
  1025. backgroundColor:'transparent',
  1026. },
  1027. contentItemBottomAction:{
  1028. flex: 5,
  1029. width:'100%',
  1030. height:'100%',
  1031. backgroundColor:'transparent',
  1032. textAlign :'center',
  1033. textAlignVertical:'center',
  1034. fontSize: 36/PixelRatio.get(),
  1035. color: 'black',
  1036. },
  1037. contentItemBottomAction02:{
  1038. width:'100%',
  1039. height: 60/PixelRatio.get(),
  1040. backgroundColor:'transparent',
  1041. textAlign :'center',
  1042. textAlignVertical:'center',
  1043. fontSize: 36/PixelRatio.get(),
  1044. color: 'black',
  1045. },
  1046. // 券的title
  1047. contentItemTopDetailTitle:{
  1048. flex: 2,
  1049. // height:'100%',
  1050. width:'100%',
  1051. marginTop:"2%",
  1052. backgroundColor:'transparent',
  1053. textAlign :'left',
  1054. color:"black",
  1055. textAlignVertical:'center',
  1056. fontSize: 53/PixelRatio.get(),
  1057. },
  1058. // 券的title
  1059. contentItemTopDetailTitle02:{
  1060. flex: 2,
  1061. // height:'100%',
  1062. width:'100%',
  1063. marginTop:"2%",
  1064. paddingRight: 14/PixelRatio.get(),
  1065. backgroundColor:'transparent',
  1066. textAlign :'left',
  1067. color:"black",
  1068. textAlignVertical:'center',
  1069. fontSize: 42/PixelRatio.get(),
  1070. },
  1071. /*
  1072. contentItemTopDetailRemark:{
  1073. flex: 1,
  1074. width:'100%',
  1075. height:'100%',
  1076. backgroundColor:'transparent',
  1077. textAlign :'left',
  1078. textAlignVertical:'center',
  1079. fontSize: 27/PixelRatio.get(),
  1080. color : 'gray'
  1081. },
  1082. */
  1083. contentItemTopDetailPrice:{
  1084. flex: 2,
  1085. width:'100%',
  1086. height:'100%',
  1087. backgroundColor:'transparent',
  1088. flexDirection: 'row',
  1089. },
  1090. // 售价的样式
  1091. contentItemTopDetailCurPrice:{
  1092. position:"absolute",
  1093. bottom:10,
  1094. left:0,
  1095. width:'100%',
  1096. height:'100%',
  1097. flexDirection: 'row',
  1098. backgroundColor:'transparent',
  1099. },
  1100. contentItemTopDetailCurPriceStr01:{
  1101. backgroundColor:'transparent',
  1102. fontSize:96/PixelRatio.get(),
  1103. fontFamily:"PingFangSC-Bold",
  1104. fontWeight: "bold",
  1105. textAlign :'left',
  1106. textAlignVertical:'bottom',
  1107. color : 'red'
  1108. },
  1109. //金额超10000,字号修改
  1110. contentItemTopDetailCurPriceStr02:{
  1111. backgroundColor:'transparent',
  1112. fontSize:64/PixelRatio.get(),
  1113. fontFamily:"PingFangSC-Bold",
  1114. fontWeight: "bold",
  1115. textAlign :'left',
  1116. textAlignVertical:'bottom',
  1117. paddingBottom: 8/PixelRatio.get(),
  1118. color : 'red'
  1119. },
  1120. contentItemTopDetailCurPriceStr03:{
  1121. backgroundColor:'transparent',
  1122. fontSize:72/PixelRatio.get(),
  1123. fontFamily:"PingFangSC-Bold",
  1124. fontWeight: "bold",
  1125. textAlign :'left',
  1126. color : 'red'
  1127. },
  1128. //金额超10000,字号修改
  1129. contentItemTopDetailCurPriceStr04:{
  1130. backgroundColor:'transparent',
  1131. fontSize:52/PixelRatio.get(),
  1132. fontFamily:"PingFangSC-Bold",
  1133. fontWeight: "bold",
  1134. textAlign :'left',
  1135. paddingTop: 16/PixelRatio.get(),
  1136. color : 'red'
  1137. },
  1138. contentItemTopDetailCurPriceStrUnit:{
  1139. backgroundColor:'transparent',
  1140. textAlign :'left',
  1141. textAlignVertical:'bottom',
  1142. paddingBottom: 16/PixelRatio.get(),
  1143. fontSize: 48/PixelRatio.get(),
  1144. color : 'red',
  1145. },
  1146. contentItemTopDetailCurPriceStrUnit02:{
  1147. backgroundColor:'transparent',
  1148. textAlign :'left',
  1149. textAlignVertical:'center',
  1150. paddingBottom: 16/PixelRatio.get(),
  1151. fontSize: 48/PixelRatio.get(),
  1152. color : 'red'
  1153. },
  1154. // 面额的样式
  1155. contentItemTopDetailSalePrice:{
  1156. position:"absolute",
  1157. bottom:2,
  1158. left:0,
  1159. // flex: 1,
  1160. paddingTop:138/PixelRatio.get(),
  1161. width:'100%',
  1162. // height:'100%',
  1163. backgroundColor:'transparent',
  1164. },
  1165. contentItemTopDetailSalePrice02:{
  1166. position:"absolute",
  1167. bottom:14/PixelRatio.get(),
  1168. left:0,
  1169. // flex: 1,
  1170. paddingTop:138/PixelRatio.get(),
  1171. width:'100%',
  1172. // height:'100%',
  1173. backgroundColor:'transparent',
  1174. },
  1175. contentItemTopDetailSalePriceStr:{
  1176. width:'100%',
  1177. height:'100%',
  1178. backgroundColor:'transparent',
  1179. textAlign :'left',
  1180. textAlignVertical:'bottom',
  1181. fontSize: 27/PixelRatio.get(),
  1182. textDecorationLine: 'line-through',
  1183. color : 'gray'
  1184. },
  1185. contentItemTopDetailSalePriceStr02:{
  1186. width:'100%',
  1187. height:'100%',
  1188. backgroundColor:'transparent',
  1189. textAlignVertical:'center',
  1190. textAlign :'left',
  1191. fontSize: 27/PixelRatio.get(),
  1192. textDecorationLine: 'line-through',
  1193. color : 'gray'
  1194. },
  1195. adTypeBg:{
  1196. flex: 1,
  1197. width: '100%',
  1198. height: '100%',
  1199. },
  1200. adWrapBox: {
  1201. width: '100%',
  1202. height: '100%',
  1203. position: 'relative',
  1204. },
  1205. adWrap: {
  1206. width: '100%',
  1207. height: '100%',
  1208. position: 'absolute',
  1209. left: 0,
  1210. top: 0,
  1211. zIndex: 10,
  1212. },
  1213. adWrapHideImg: {
  1214. width: '100%',
  1215. height: '100%',
  1216. position: 'absolute',
  1217. left: 0,
  1218. top: 0,
  1219. zIndex: -1,
  1220. opacity:0,
  1221. },
  1222. adTypeSwiper02:{
  1223. flex: 1,
  1224. alignItems: 'center',
  1225. position: 'absolute',
  1226. left: 0,
  1227. bottom: 60/PixelRatio.get(),
  1228. width: '100%',
  1229. height: 270/PixelRatio.get(),
  1230. paddingTop: 10/PixelRatio.get(),
  1231. paddingBottom: 10/PixelRatio.get(),
  1232. backgroundColor: 'rgba(0,0,0,.1)',
  1233. },
  1234. adTypeItemImgWrap:{
  1235. flex: 1,
  1236. width: '100%',
  1237. height: 369/PixelRatio.get(),
  1238. flexDirection: 'row',
  1239. alignItems: 'center',
  1240. },
  1241. adTypeItemImg:{
  1242. width: 200/PixelRatio.get(),
  1243. height: 200/PixelRatio.get(),
  1244. marginLeft: 8/PixelRatio.get(),
  1245. marginTop: 20/PixelRatio.get(),
  1246. borderRadius:27/PixelRatio.get(),
  1247. backgroundColor:'transparent'
  1248. },
  1249. bottomBox:{
  1250. position: 'absolute',
  1251. bottom: 20/PixelRatio.get(),
  1252. left: 0,
  1253. width: '100%',
  1254. height: 130/PixelRatio.get(),
  1255. flexDirection: 'row',
  1256. alignItems: 'center',
  1257. backgroundColor:'transparent',
  1258. },
  1259. contentItemTopForAd:{
  1260. position: 'relative',
  1261. flex: 1,
  1262. width: 800/PixelRatio.get(),
  1263. // width: '100%',
  1264. height:'100%',
  1265. paddingLeft: 12/PixelRatio.get(),
  1266. paddingRight: 26/PixelRatio.get(),
  1267. flexDirection: 'row',
  1268. alignItems: 'flex-start',
  1269. borderRadius: 6,
  1270. backgroundColor:'rgba(255,255,255,.8)',
  1271. },
  1272. onlyAdSwiperItem:{
  1273. width: '100%',
  1274. height: '100%',
  1275. },
  1276. onlyAdTypeItemImg:{
  1277. width: '100%',
  1278. height: '100%',
  1279. },
  1280. carouselItemWrap: {
  1281. flex: 1,
  1282. width: '100%',
  1283. backgroundColor: 'transparent',
  1284. alignItems: 'center',
  1285. },
  1286. //排名的列表样式
  1287. rankItemBox: {
  1288. flex: 1,
  1289. flexDirection: 'row',
  1290. alignItems: 'center',
  1291. width: '92%',
  1292. height: 250/PixelRatio.get(),
  1293. backgroundColor: '#fff',
  1294. borderRadius: 18/PixelRatio.get(),
  1295. marginTop: 30/PixelRatio.get(),
  1296. },
  1297. rankContent: {
  1298. flex: 1,
  1299. flexDirection: 'column',
  1300. marginLeft: 30/PixelRatio.get(),
  1301. },
  1302. rankItemBg: {
  1303. flex: 1,
  1304. flexDirection: 'row',
  1305. alignItems: 'center',
  1306. width: '100%',
  1307. height: 250/PixelRatio.get(),
  1308. },
  1309. RankLogo: {
  1310. width: 200/PixelRatio.get(),
  1311. height: 200/PixelRatio.get(),
  1312. marginLeft: 20/PixelRatio.get(),
  1313. },
  1314. rankQrcodeImg: {
  1315. width: 200/PixelRatio.get(),
  1316. height: 200/PixelRatio.get(),
  1317. marginLeft: 10/PixelRatio.get(),
  1318. },
  1319. starTitle: {
  1320. fontSize: 28/PixelRatio.get(),
  1321. },
  1322. rankRun: {
  1323. marginTop: 16/PixelRatio.get(),
  1324. },
  1325. merchantText: {
  1326. fontSize: 34/PixelRatio.get(),
  1327. fontWeight : 'bold',
  1328. marginBottom: 10/PixelRatio.get(),
  1329. marginTop: 30/PixelRatio.get(),
  1330. },
  1331. rankRunBox: {
  1332. flex: 1,
  1333. flexDirection: 'row',
  1334. }
  1335. });