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

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