广告屏react-native项目
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 
 
 
 

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