广告屏react-native项目
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 
 

833 行
23 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. var testMac = 'FF:FF:FF:FF:FF:FF'
  19. var contentItemDefault = {
  20. type:0,
  21. subType:0,
  22. qrcode:[],
  23. target:{
  24. coverImg:'',
  25. title:'',
  26. subTitle:'',
  27. priceStr:'',
  28. salePriceStr:'',
  29. remark:'',
  30. }
  31. }
  32. var baseInfoDefault = {
  33. imgUrlH:'',
  34. imgQrcodeWeapp:'',
  35. imgQrcodeWemp:''
  36. }
  37. var curAdIndex = 0;
  38. var errorMsg = {
  39. ERR_MAC_GET:'设备编号获取错误',
  40. ERR_START_AD:'广告播放系统错误',
  41. ERR_DATA_GET:'广告数据获取错误',
  42. ERR_HEARTBEAT:'设备心跳数据错误'
  43. }
  44. var animationThemes = [
  45. // 滑入
  46. {
  47. first:"slideInDown",
  48. second:"slideInLeft",
  49. third:"slideInRight"
  50. },
  51. // 放大
  52. {
  53. first:"zoomInDown",
  54. second:"zoomInLeft",
  55. third:"zoomInRight"
  56. },
  57. // 翻转
  58. {
  59. first:"flipInX",
  60. second:"flipInY",
  61. third:"flipInX"
  62. },
  63. // 弹出
  64. {
  65. first:"bounceInDown",
  66. second:"bounceInLeft",
  67. third:"bounceInRight"
  68. }
  69. ]
  70. var hbRequestCount
  71. var getAdDataCount
  72. var pageChangeCount
  73. export default class MyPage extends Component {
  74. constructor(props) {
  75. super(props);
  76. this.state = {
  77. baseInfo: baseInfoDefault,
  78. adDataList:[],
  79. contentItem0:null,
  80. contentItem1:null,
  81. contentItem2:null,
  82. animationTheme:{},
  83. heartConfig:{
  84. heartbeatInterval:1000*5*60,
  85. dataRefreshInterval:1000*60*60,
  86. pageChangeInterval:1000*10,
  87. },
  88. contentDisplayStatus:false,
  89. syncMessage: "初始化..." ,
  90. errorMessage: '加载中...',
  91. progress: {
  92. receivedBytes:0,
  93. totalBytes:0
  94. },
  95. macAddress: '',
  96. versionInfo:'未知'
  97. };
  98. }
  99. // 监听更新状态
  100. codePushStatusDidChange(syncStatus) {
  101. switch(syncStatus) {
  102. case CodePush.SyncStatus.CHECKING_FOR_UPDATE:
  103. this.setState({ syncMessage: "检查更新" });
  104. break;
  105. case CodePush.SyncStatus.DOWNLOADING_PACKAGE:
  106. this.setState({ syncMessage: "下载更新" });
  107. break;
  108. case CodePush.SyncStatus.AWAITING_USER_ACTION:
  109. this.setState({ syncMessage: "等待用户操作" });
  110. break;
  111. case CodePush.SyncStatus.INSTALLING_UPDATE:
  112. this.setState({ syncMessage: "安装更新" });
  113. break;
  114. case CodePush.SyncStatus.UP_TO_DATE:
  115. this.setState({ syncMessage: "已更新到最新程序", progress: false });
  116. break;
  117. case CodePush.SyncStatus.UPDATE_IGNORED:
  118. this.setState({ syncMessage: "更新被取消", progress: false });
  119. break;
  120. case CodePush.SyncStatus.UPDATE_INSTALLED:
  121. this.setState({ syncMessage: "更新已安装,重启应用后生效", progress: false });
  122. break;
  123. case CodePush.SyncStatus.UNKNOWN_ERROR:
  124. this.setState({ syncMessage: "未知错误", progress: false });
  125. break;
  126. }
  127. }
  128. codePushDownloadDidProgress(progress) {
  129. this.setState({ progress });
  130. }
  131. // 列表滚动
  132. updateContent() {
  133. if (this.state.adDataList.length <=0)
  134. return false;
  135. if (curAdIndex >= this.state.adDataList.length) {
  136. curAdIndex = 0
  137. }
  138. this.setState({contentItem0:this.state.adDataList[curAdIndex]});
  139. if (curAdIndex + 1 < this.state.adDataList.length)
  140. this.setState({contentItem1:this.state.adDataList[curAdIndex+1]});
  141. else
  142. this.setState({contentItem1:null});
  143. if (curAdIndex + 2 < this.state.adDataList.length)
  144. this.setState({contentItem2:this.state.adDataList[curAdIndex+2]});
  145. else
  146. this.setState({contentItem2:null});
  147. curAdIndex+=3
  148. return true;
  149. }
  150. hbRequest() {
  151. HttpUtils.post(NativeModules.BuildConfig.apiHost + 'api/wxDeviceScreenAd/heartbeat?deviceId='
  152. +encodeURIComponent(this.state.macAddress),
  153. {version:this.state.versionInfo})
  154. .then(result => {
  155. let config = JSON.parse(result.data.config);
  156. this.setState({
  157. heartConfig:{
  158. heartbeatInterval:config.heartbeatInterval,
  159. dataRefreshInterval:config.dataRefreshInterval,
  160. pageChangeInterval:config.pageChangeInterval
  161. }
  162. })
  163. // 动画划入
  164. if(config.animationTheme == 0){
  165. this.setState({
  166. animationTheme:animationThemes[0]
  167. })
  168. }else if(config.animationTheme == 1){
  169. // 放大
  170. this.setState({
  171. animationTheme:animationThemes[1]
  172. })
  173. }else if(config.animationTheme == 2){
  174. // 淡入
  175. this.setState({
  176. animationTheme:animationThemes[2]
  177. })
  178. }else if(config.animationTheme == 3){
  179. // 弹入
  180. this.setState({
  181. animationTheme:animationThemes[3]
  182. })
  183. }
  184. })
  185. .catch(error => {
  186. console.warn(error)
  187. this.setState({ errorMessage : error});
  188. })
  189. }
  190. getAdDataList() {
  191. HttpUtils.get(NativeModules.BuildConfig.apiHost + 'api/wxDeviceScreenAd/list?deviceId='+encodeURIComponent(this.state.macAddress)+'&pageNum=1&pageSize=1000')
  192. .then((result) => {
  193. if (result.code != 200) {
  194. this.setState({contentDisplayStatus: false})
  195. this.setState({errorMessage : result.message+'\n'+this.state.macAddress});
  196. } else if (result.data.list) {
  197. this.setState({adDataList : result.data.list});
  198. if (this.updateContent()) {
  199. this.setState({contentDisplayStatus: true})
  200. }
  201. } else {
  202. this.setState({contentDisplayStatus: false})
  203. this.setState({errorMessage : errorMsg.ERR_DATA_GET});
  204. }
  205. })
  206. .catch(error => {
  207. this.setState({contentDisplayStatus: false})
  208. this.setState({errorMessage : error.message});
  209. })
  210. }
  211. getBaseInfo() {
  212. HttpUtils.get(NativeModules.BuildConfig.apiHost + 'api/wxDeviceScreenAd/info?deviceId='+encodeURIComponent(this.state.macAddress))
  213. .then(result => {
  214. if (result.code != 200) {
  215. this.setState({contentDisplayStatus: false})
  216. this.setState({errorMessage : result.message+'\n'+this.state.macAddress});
  217. } else if (result.data) {
  218. this.setState({baseInfo:result.data});
  219. } else {
  220. this.setState({contentDisplayStatus: false})
  221. this.setState({errorMessage : errorMsg.ERR_DATA_GET});
  222. }
  223. })
  224. .catch(error => {
  225. this.setState({contentDisplayStatus: false})
  226. this.setState({errorMessage : error.message});
  227. })
  228. }
  229. componentDidMount() {
  230. CodePush.allowRestart();
  231. CodePush.sync(
  232. { installMode: CodePush.InstallMode.IMMEDIATE},
  233. this.codePushStatusDidChange.bind(this),
  234. this.codePushDownloadDidProgress.bind(this)
  235. );
  236. CodePush.getUpdateMetadata(CodePush.UpdateState.RUNNING)
  237. .then((metadata: LocalPackage) => {
  238. this.setState({ versionInfo: metadata ? metadata.appVersion + "-" + metadata.label : "Unknown"});
  239. }, (error: any) => {
  240. this.setState({ versionInfo: "Unknown"});
  241. });
  242. DeviceInfo.getMACAddress().then((mac)=>{
  243. if (mac=='' || mac==null ) {
  244. if (NativeModules.BuildConfig.buildType == 'debug') {
  245. this.setState({macAddress : this.testMac})
  246. this.startAd()
  247. } else {
  248. this.setState({ contentDisplayStatus: false})
  249. this.setState({ errorMessage : errorMsg.ERR_MAC_GET});
  250. }
  251. } else {
  252. this.setState({macAddress : mac})
  253. this.startAd()
  254. }
  255. }).catch(e => {
  256. this.setState({ contentDisplayStatus: false})
  257. this.setState({ errorMessage : errorMsg.ERR_START_AD});
  258. })
  259. }
  260. startAd() {
  261. this.getBaseInfo()
  262. this.getAdDataList()
  263. this.hbRequest()
  264. hbRequestCount =this.state.heartConfig.heartbeatInterval;
  265. getAdDataCount =this.state.heartConfig.dataRefreshInterval;
  266. pageChangeCount =this.state.heartConfig.pageChangeInterval;
  267. setInterval(()=>{
  268. hbRequestCount -=1000;
  269. getAdDataCount -=1000;
  270. pageChangeCount -=1000;
  271. if (pageChangeCount <= 0) { //页面切换间隔
  272. if (this.state.contentDisplayStatus) {
  273. this.setState({ contentDisplayStatus: false})
  274. if (this.updateContent()) {
  275. this.setState({ contentDisplayStatus: true})
  276. }
  277. } else {
  278. this.getBaseInfo()
  279. this.getAdDataList()
  280. }
  281. pageChangeCount = this.state.heartConfig.pageChangeInterval
  282. }
  283. if (getAdDataCount<=0) {
  284. this.getAdDataList()
  285. getAdDataCount = this.state.heartConfig.dataRefreshInterval
  286. }
  287. if (hbRequestCount<=0) {
  288. this.hbRequest()
  289. hbRequestCount = this.state.heartConfig.heartbeatInterval
  290. }
  291. },
  292. 1000
  293. );
  294. }
  295. getContentViewItemUplayer(contentItem) {
  296. if (contentItem.type == 0) {
  297. if (contentItem.subType == 2)
  298. return (<Image source={require('./image/timed.png')} resizeMode='center' style={styles.contentItemUpLayer} /> )
  299. if (contentItem.subType == 6)
  300. return (<Image source={require('./image/discount.png')} resizeMode='center' style={styles.contentItemUpLayer} /> )
  301. if (contentItem.subType == 7)
  302. return (<Image source={require('./image/groupbuy.png')} resizeMode='center' style={styles.contentItemUpLayer} /> )
  303. return null;
  304. }
  305. }
  306. getContentViewItemActionStr(contentItem) {
  307. if (contentItem.type == 0) {
  308. if (contentItem.subType == 2)
  309. return '扫码秒杀';
  310. else if (contentItem.subType == 6)
  311. return '扫码砍价';
  312. else if (contentItem.subType == 7)
  313. return '扫码拼团';
  314. else
  315. return '扫码领取';
  316. }
  317. }
  318. getContentViewItemMerchantName(contentItem) {
  319. if (contentItem.type == 0) {
  320. if (contentItem.target.merchantVoList.length > 1)
  321. return '多商户通用';
  322. else
  323. return contentItem.target.merchantVoList[0].merchantName;
  324. }
  325. }
  326. getContentViewItem(contentItem, annomation) {
  327. if (!contentItem)
  328. return (
  329. <View style={styles.contentItem}>
  330. </View>
  331. )
  332. actionText = this.getContentViewItemActionStr(contentItem);
  333. merchantName = this.getContentViewItemMerchantName(contentItem);
  334. // console.warn(annomation)
  335. return (
  336. <Animatable.View animation={annomation} easing="ease-out" duration={1500} delay={500} useNativeDriver ={true} style={styles.contentItem}>
  337. <ImageBackground source={require('./image/item-background.png')} resizeMode='center' style={styles.contentItemDownLayer} >
  338. {/* 列表 */}
  339. <View style={styles.contentItemTop}>
  340. <Image source={{uri: contentItem.target.coverImg}} resizeMode='cover' style={styles.contentItemTopCoverImg} />
  341. <View style={styles.contentItemTopDetail}>
  342. {/* 券的title */}
  343. <Text style={styles.contentItemTopDetailTitle} numberOfLines={2} ellipsizeMode="tail">{contentItem.target.title}</Text>
  344. <View style={styles.contentItemTopDetailPrice}>
  345. {/* 售价 */}
  346. <View style={styles.contentItemTopDetailCurPrice}>
  347. <Text style={styles.contentItemTopDetailCurPriceStrUnit}>¥</Text>
  348. <Text style={styles.contentItemTopDetailCurPriceStr}>{contentItem.target.salePriceStr}</Text>
  349. </View>
  350. {/* 面额 */}
  351. <View style={styles.contentItemTopDetailSalePrice}>
  352. <Text style={styles.contentItemTopDetailSalePriceStr} >¥{contentItem.target.priceStr}</Text>
  353. </View>
  354. </View>
  355. </View>
  356. <Image source={{uri:'data:image/png;base64,'+contentItem.qrcode}} resizeMode='contain' style={styles.contentItemTopQrcode} />
  357. </View>
  358. {/* 优惠券底部商户名称 */}
  359. <View style={styles.contentItemBottom}>
  360. <Text style={styles.contentItemBottomMerchantName}>{merchantName}</Text>
  361. <Text style={styles.contentItemBottomPlacehold}>{contentItem.target.merchantVoList[0].buildingName}{contentItem.target.merchantVoList[0].floorName}</Text>
  362. <Text style={styles.contentItemBottomAction}>{actionText}</Text>
  363. </View>
  364. </ImageBackground>
  365. {this.getContentViewItemUplayer(contentItem)}
  366. </Animatable.View>
  367. )
  368. }
  369. getContentView() {
  370. if (this.state.contentDisplayStatus) {
  371. return (<View style={styles.content}>
  372. {this.getContentViewItem(this.state.contentItem0,this.state.animationTheme.first)}
  373. {this.getContentViewItem(this.state.contentItem1,this.state.animationTheme.second)}
  374. {this.getContentViewItem(this.state.contentItem2,this.state.animationTheme.third)}
  375. </View>)
  376. }else{
  377. return (
  378. <View style={styles.content}>
  379. <Text style={styles.updatePage}>{this.state.errorMessage}</Text>
  380. </View>)
  381. }
  382. }
  383. render() {
  384. if (this.state.progress) {
  385. if (this.state.progress.totalBytes > 0)
  386. return (
  387. <Text style={styles.updatePage}>{this.state.syncMessage}{'\n'}
  388. {this.state.progress.receivedBytes} of {this.state.progress.totalBytes} bytes received{'\n'}
  389. </Text>
  390. );
  391. return (
  392. <Text style={styles.updatePage}>{this.state.syncMessage}
  393. </Text>
  394. );
  395. }
  396. return (
  397. <ImageBackground style={styles.background} resizeMode='center' source={require('./image/background.png')}>
  398. {/* 头部title二维码开始 */}
  399. <View style={styles.title}>
  400. <View style={styles.titleImagePlace}>
  401. <Image source={require('./image/title.png')} resizeMode='center' style={styles.titleImage} />
  402. </View>
  403. <ImageBackground source={require('./image/title-qrcode.png') } resizeMode='center' style={styles.titleQrcodeBonder} >
  404. <View style={styles.titleQrcodePlacehold}></View>
  405. <Image source={{uri: this.state.baseInfo.imgQrcodeWeapp}} resizeMode='center' style={styles.titleQrcode} />
  406. <View style={styles.titleQrcodePlacehold}></View>
  407. </ImageBackground>
  408. </View>
  409. {/* 券列表展示列表开始 */}
  410. {this.getContentView()}
  411. {/* 底部商场信息展示开始 */}
  412. <View style={styles.bottom}>
  413. <View style={styles.bottomLogoBackground}>
  414. <Image source={{ uri: this.state.baseInfo.imgUrlH, cache: 'force-cache'}} resizeMode='contain' style={styles.bottomLogo} />
  415. </View>
  416. <View style={styles.bottomQrcode1Background}>
  417. <Image source={{ uri: this.state.baseInfo.imgQrcodeWeapp, cache: 'force-cache'}} resizeMode='center' style={styles.bottomQrcode1} />
  418. <Text style={styles.bottomQrcode1Str}>小程序</Text>
  419. </View>
  420. <View style={styles.bottomQrcode2Background}>
  421. <Image source={{ uri: this.state.baseInfo.imgQrcodeWemp, cache: 'force-cache'}} resizeMode='center' style={styles.bottomQrcode2} />
  422. <Text style={styles.bottomQrcode1Str}>公众号</Text>
  423. </View>
  424. <Text style={styles.bottomPlacehold}>{this.state.versionInfo}</Text>
  425. {/* <Text style={styles.bottomPlacehold}>{this.state.heartConfig}</Text> */}
  426. </View>
  427. </ImageBackground>
  428. );
  429. }
  430. }
  431. const styles = StyleSheet.create({
  432. updatePage:{
  433. flex: 2,
  434. width:'100%',
  435. height:'100%',
  436. backgroundColor:'transparent',
  437. textAlign :'center',
  438. textAlignVertical:'center',
  439. fontSize: 63/PixelRatio.get(),
  440. color: 'darkblue'
  441. },
  442. //layer background
  443. background:{
  444. flex: 1,
  445. width:'100%',
  446. height:'100%'
  447. },
  448. //layer top
  449. title:{
  450. flex: 6,
  451. flexDirection: 'row',
  452. alignItems: 'center',
  453. paddingLeft:42/PixelRatio.get(),
  454. paddingRight:42/PixelRatio.get(),
  455. backgroundColor:'transparent'
  456. },
  457. content:{
  458. flex: 18,
  459. flexDirection: 'column',
  460. alignItems: 'center',
  461. backgroundColor:'transparent'
  462. },
  463. bottom:{
  464. flex: 2,
  465. flexDirection: 'row',
  466. alignItems: 'center',
  467. paddingLeft:42/PixelRatio.get(),
  468. paddingRight:42/PixelRatio.get(),
  469. backgroundColor:'transparent'
  470. },
  471. //layer title
  472. titleImagePlace: {
  473. flex: 2,
  474. paddingTop: '20%',
  475. paddingLeft: '15%',
  476. alignItems: 'center',
  477. backgroundColor:'transparent'
  478. },
  479. titleImage: {
  480. width:'100%',
  481. height:'100%',
  482. flex: 1,
  483. backgroundColor:'transparent'
  484. },
  485. titleQrcodeBonder: {
  486. width:'100%',
  487. height:'100%',
  488. alignItems: 'center',
  489. flexDirection: 'column',
  490. flex: 1,
  491. backgroundColor:'transparent'
  492. },
  493. titleQrcodePlacehold: {
  494. flex: 5,
  495. backgroundColor:'transparent'
  496. },
  497. titleQrcode: {
  498. flex: 6,
  499. width:'100%',
  500. height:'100%',
  501. backgroundColor:'transparent'
  502. },
  503. //layer bottom
  504. bottomLogoBackground: {
  505. flex: 3,
  506. borderRadius:16/PixelRatio.get(),
  507. marginTop: 26/PixelRatio.get(),
  508. marginBottom: 26/PixelRatio.get(),
  509. backgroundColor:'transparent',//'rgba(255,255,255,0.5)',
  510. },
  511. bottomLogo: {
  512. width:'100%',
  513. height:'100%',
  514. backgroundColor:'transparent'
  515. },
  516. bottomQrcode1Background : {
  517. flex: 1,
  518. width:'100%',
  519. height:'100%',
  520. marginLeft: 21/PixelRatio.get(),
  521. paddingTop: 27/PixelRatio.get(),
  522. paddingBottom: 11/PixelRatio.get(),
  523. flexDirection: 'column',
  524. backgroundColor:'transparent'
  525. },
  526. bottomQrcode2Background : {
  527. flex: 1,
  528. width:'100%',
  529. height:'100%',
  530. marginLeft: 21/PixelRatio.get(),
  531. paddingTop: 26/PixelRatio.get(),
  532. paddingBottom: 11/PixelRatio.get(),
  533. flexDirection: 'column',
  534. backgroundColor:'transparent'
  535. },
  536. bottomQrcode1: {
  537. flex: 2,
  538. width:'100%',
  539. height:'100%',
  540. backgroundColor:'transparent'
  541. },
  542. bottomQrcode2: {
  543. flex: 2,
  544. width:'100%',
  545. height:'100%',
  546. backgroundColor:'transparent'
  547. },
  548. bottomQrcode1Str: {
  549. flex: 1,
  550. textAlign :'center',
  551. textAlignVertical:'center',
  552. fontSize: 16/PixelRatio.get(),
  553. color : 'white',
  554. backgroundColor:'transparent'
  555. },
  556. bottomQrcode2Str: {
  557. flex: 1,
  558. textAlign :'center',
  559. textAlignVertical:'center',
  560. fontSize: 16/PixelRatio.get(),
  561. color : 'white',
  562. backgroundColor:'transparent'
  563. },
  564. bottomPlacehold: {
  565. flex: 8,
  566. width:'100%',
  567. height:'100%',
  568. backgroundColor:'transparent',
  569. textAlign :'right',
  570. textAlignVertical:'bottom',
  571. fontSize: 27/PixelRatio.get(),
  572. color : 'gray'
  573. },
  574. //layer content item
  575. contentItem:{
  576. flex: 1,
  577. width:'100%',
  578. height:'100%',
  579. flexDirection: 'column',
  580. backgroundColor:'transparent'
  581. },
  582. contentItemDownLayer:{
  583. position:'absolute',
  584. width:'100%',
  585. height:'100%',
  586. flexDirection: 'column',
  587. alignItems: 'center',
  588. backgroundColor:'transparent'
  589. },
  590. contentItemUpLayer:{
  591. width:210/PixelRatio.get(),
  592. height:153/PixelRatio.get(),
  593. position:'absolute',
  594. backgroundColor:'transparent'
  595. },
  596. contentItemTop:{
  597. flex: 3,
  598. width:'100%',
  599. height:'100%',
  600. paddingLeft: 66/PixelRatio.get(),
  601. paddingRight: 53/PixelRatio.get(),
  602. paddingTop: 40/PixelRatio.get(),
  603. flexDirection: 'row',
  604. alignItems: 'center',
  605. backgroundColor:'transparent'
  606. },
  607. contentItemBottom:{
  608. flex: 1,
  609. width:'100%',
  610. height:'100%',
  611. paddingLeft: 66/PixelRatio.get(),
  612. paddingRight: 53/PixelRatio.get(),
  613. paddingBottom: 40/PixelRatio.get(),
  614. flexDirection: 'row',
  615. alignItems: 'center',
  616. backgroundColor:'transparent'
  617. },
  618. //layer content item top
  619. contentItemTopCoverImg:{
  620. flex: 5,
  621. width:'100%',
  622. height:'100%',
  623. borderRadius:27/PixelRatio.get(),
  624. backgroundColor:'transparent'
  625. },
  626. contentItemTopDetail:{
  627. flex: 6,
  628. width:'100%',
  629. height:'100%',
  630. paddingLeft: 20/PixelRatio.get(),
  631. paddingRight: 20/PixelRatio.get(),
  632. alignItems: 'center',
  633. backgroundColor:'transparent'
  634. },
  635. contentItemTopQrcode:{
  636. flex: 5,
  637. width:'100%',
  638. height:'100%',
  639. backgroundColor:'transparent'
  640. },
  641. //layer content item bottom
  642. contentItemBottomMerchantName:{
  643. flex: 5,
  644. width:'100%',
  645. height:'100%',
  646. alignItems: 'center',
  647. color:"black",
  648. backgroundColor:'transparent',
  649. textAlign :'center',
  650. textAlignVertical:'center',
  651. fontSize: 27/PixelRatio.get(),
  652. fontWeight : 'bold'
  653. },
  654. contentItemBottomPlacehold:{
  655. flex: 6,
  656. fontSize: 27/PixelRatio.get(),
  657. paddingLeft: 27/PixelRatio.get(),
  658. paddingRight: 79/PixelRatio.get(),
  659. width:'100%',
  660. height:'100%',
  661. color:"black",
  662. textAlignVertical:'center',
  663. backgroundColor:'transparent',
  664. },
  665. contentItemBottomAction:{
  666. flex: 5,
  667. width:'100%',
  668. height:'100%',
  669. backgroundColor:'transparent',
  670. fontWeight : 'bold',
  671. textAlign :'center',
  672. textAlignVertical:'center',
  673. fontSize: 36/PixelRatio.get(),
  674. color: 'darkgray'
  675. },
  676. // 券的title
  677. contentItemTopDetailTitle:{
  678. flex: 2,
  679. // height:'100%',
  680. width:'100%',
  681. marginTop:"2%",
  682. // borderStyle:"solid",
  683. // borderWidth:1,
  684. // borderColor:"red",
  685. backgroundColor:'transparent',
  686. textAlign :'left',
  687. color:"black",
  688. textAlignVertical:'center',
  689. fontSize: 53/PixelRatio.get(),
  690. },
  691. /*
  692. contentItemTopDetailRemark:{
  693. flex: 1,
  694. width:'100%',
  695. height:'100%',
  696. backgroundColor:'transparent',
  697. textAlign :'left',
  698. textAlignVertical:'center',
  699. fontSize: 27/PixelRatio.get(),
  700. color : 'gray'
  701. },
  702. */
  703. contentItemTopDetailPrice:{
  704. flex: 2,
  705. width:'100%',
  706. height:'100%',
  707. backgroundColor:'transparent',
  708. flexDirection: 'row',
  709. },
  710. // 售价的样式
  711. contentItemTopDetailCurPrice:{
  712. position:"absolute",
  713. bottom:10,
  714. left:0,
  715. width:'100%',
  716. height:'100%',
  717. flexDirection: 'row',
  718. backgroundColor:'transparent',
  719. },
  720. contentItemTopDetailCurPriceStr:{
  721. backgroundColor:'transparent',
  722. fontSize:96/PixelRatio.get(),
  723. fontFamily:"PingFangSC-Bold",
  724. fontWeight: "bold",
  725. textAlign :'left',
  726. textAlignVertical:'bottom',
  727. color : 'red'
  728. },
  729. contentItemTopDetailCurPriceStrUnit:{
  730. backgroundColor:'transparent',
  731. textAlign :'left',
  732. textAlignVertical:'bottom',
  733. paddingBottom: 16/PixelRatio.get(),
  734. fontSize: 48/PixelRatio.get(),
  735. color : 'red'
  736. },
  737. // 面额的样式
  738. contentItemTopDetailSalePrice:{
  739. position:"absolute",
  740. bottom:2,
  741. left:0,
  742. // flex: 1,
  743. paddingTop:50,
  744. width:'100%',
  745. // height:'100%',
  746. backgroundColor:'transparent',
  747. },
  748. contentItemTopDetailSalePriceStr:{
  749. width:'100%',
  750. height:'100%',
  751. backgroundColor:'transparent',
  752. textAlign :'left',
  753. textAlignVertical:'bottom',
  754. fontSize: 27/PixelRatio.get(),
  755. textDecorationLine: 'line-through',
  756. color : 'gray'
  757. },
  758. });