广告屏react-native项目
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 
 
 

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