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

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