广告屏react-native项目
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 
 
 

835 rader
24 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*10,
  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. },1000)
  292. }
  293. getContentViewItemUplayer(contentItem) {
  294. if (contentItem.type == 0) {
  295. if (contentItem.subType == 2)
  296. return (<Image source={require('./image/timed.png')} resizeMode='center' style={styles.contentItemUpLayer} /> )
  297. if (contentItem.subType == 6)
  298. return (<Image source={require('./image/discount.png')} resizeMode='center' style={styles.contentItemUpLayer} /> )
  299. if (contentItem.subType == 7)
  300. return (<Image source={require('./image/groupbuy.png')} resizeMode='center' style={styles.contentItemUpLayer} /> )
  301. return null;
  302. }
  303. }
  304. getContentViewItemActionStr(contentItem) {
  305. if (contentItem.type == 0) {
  306. if (contentItem.subType == 2)
  307. return '扫码秒杀';
  308. else if (contentItem.subType == 6)
  309. return '扫码砍价';
  310. else if (contentItem.subType == 7)
  311. return '扫码拼团';
  312. else
  313. return '扫码领取';
  314. }
  315. }
  316. getContentViewItemMerchantName(contentItem) {
  317. if (contentItem.type == 0) {
  318. if (contentItem.target.merchantVoList.length > 1)
  319. return '多商户通用';
  320. else
  321. return contentItem.target.merchantVoList[0].merchantName;
  322. }
  323. }
  324. getContentViewItem(contentItem, annomation) {
  325. if (!contentItem)
  326. return (
  327. <View style={styles.contentItem}>
  328. </View>
  329. )
  330. actionText = this.getContentViewItemActionStr(contentItem);
  331. merchantName = this.getContentViewItemMerchantName(contentItem);
  332. // console.warn(annomation)
  333. return (
  334. <Animatable.View animation={annomation} easing="ease-out" duration={1500} delay={500} useNativeDriver ={true} style={styles.contentItem}>
  335. <ImageBackground source={require('./image/item-background.png')} resizeMode='center' style={styles.contentItemDownLayer} >
  336. {/* 列表 */}
  337. <View style={styles.contentItemTop}>
  338. <Image source={{uri: contentItem.target.coverImg}} resizeMode='cover' style={styles.contentItemTopCoverImg} />
  339. <View style={styles.contentItemTopDetail}>
  340. {/* 券的title */}
  341. <Text style={styles.contentItemTopDetailTitle} numberOfLines={2} ellipsizeMode="tail">{contentItem.target.title}</Text>
  342. <View style={styles.contentItemTopDetailPrice}>
  343. {/* 售价 */}
  344. <View style={styles.contentItemTopDetailCurPrice}>
  345. <Text style={styles.contentItemTopDetailCurPriceStrUnit}>¥</Text>
  346. <Text style={styles.contentItemTopDetailCurPriceStr}>{contentItem.target.salePriceStr}</Text>
  347. </View>
  348. {/* 面额 */}
  349. <View style={styles.contentItemTopDetailSalePrice}>
  350. <Text style={styles.contentItemTopDetailSalePriceStr} >¥{contentItem.target.priceStr}</Text>
  351. </View>
  352. </View>
  353. </View>
  354. <Image source={{uri:'data:image/png;base64,'+contentItem.qrcode}} resizeMode='contain' style={styles.contentItemTopQrcode} />
  355. </View>
  356. {/* 优惠券底部商户名称 */}
  357. <View style={styles.contentItemBottom}>
  358. <Text style={styles.contentItemBottomMerchantName}>{merchantName}</Text>
  359. <Text style={styles.contentItemBottomPlacehold}>{contentItem.target.merchantVoList[0].buildingName}{contentItem.target.merchantVoList[0].floorName}</Text>
  360. <Text style={styles.contentItemBottomAction}>{actionText}</Text>
  361. </View>
  362. </ImageBackground>
  363. {this.getContentViewItemUplayer(contentItem)}
  364. </Animatable.View>
  365. )
  366. }
  367. getContentView() {
  368. if (this.state.contentDisplayStatus) {
  369. return (<View style={styles.content}>
  370. {this.getContentViewItem(this.state.contentItem0,this.state.animationTheme.first)}
  371. {this.getContentViewItem(this.state.contentItem1,this.state.animationTheme.second)}
  372. {this.getContentViewItem(this.state.contentItem2,this.state.animationTheme.third)}
  373. </View>)
  374. }else{
  375. return (
  376. <View style={styles.content}>
  377. <Text style={styles.updatePage}>{this.state.errorMessage}</Text>
  378. </View>)
  379. }
  380. }
  381. render() {
  382. if (this.state.progress) {
  383. if (this.state.progress.totalBytes > 0)
  384. return (
  385. <Text style={styles.updatePage}>{this.state.syncMessage}{'\n'}
  386. {this.state.progress.receivedBytes} of {this.state.progress.totalBytes} bytes received{'\n'}
  387. </Text>
  388. );
  389. return (
  390. <Text style={styles.updatePage}>{this.state.syncMessage}
  391. </Text>
  392. );
  393. }
  394. return (
  395. <ImageBackground style={styles.background} resizeMode='center' source={require('./image/background.png')}>
  396. {/* 头部title二维码开始 */}
  397. <View style={styles.title}>
  398. <View style={styles.titleImagePlace}>
  399. <Image source={require('./image/title.png')} resizeMode='center' style={styles.titleImage} />
  400. </View>
  401. <ImageBackground source={require('./image/title-qrcode.png') } resizeMode='center' style={styles.titleQrcodeBonder} >
  402. <View style={styles.titleQrcodePlacehold}></View>
  403. <Image source={{uri: this.state.baseInfo.imgQrcodeWeapp}} resizeMode='center' style={styles.titleQrcode} />
  404. <View style={styles.titleQrcodePlacehold}></View>
  405. </ImageBackground>
  406. </View>
  407. {/* 券列表展示列表开始 */}
  408. {this.getContentView()}
  409. {/* 底部商场信息展示开始 */}
  410. <View style={styles.bottom}>
  411. <View style={styles.bottomLogoBackground}>
  412. <Image source={{ uri: this.state.baseInfo.imgUrlH, cache: 'force-cache'}} resizeMode='contain' style={styles.bottomLogo} />
  413. </View>
  414. <View style={styles.bottomQrcode1Background}>
  415. <Image source={{ uri: this.state.baseInfo.imgQrcodeWeapp, cache: 'force-cache'}} resizeMode='center' style={styles.bottomQrcode1} />
  416. <Text style={styles.bottomQrcode1Str}>小程序</Text>
  417. </View>
  418. <View style={styles.bottomQrcode2Background}>
  419. <Image source={{ uri: this.state.baseInfo.imgQrcodeWemp, cache: 'force-cache'}} resizeMode='center' style={styles.bottomQrcode2} />
  420. <Text style={styles.bottomQrcode1Str}>公众号</Text>
  421. </View>
  422. <Text style={styles.bottomPlacehold}>{this.state.versionInfo}</Text>
  423. </View>
  424. </ImageBackground>
  425. );
  426. }
  427. }
  428. const styles = StyleSheet.create({
  429. updatePage:{
  430. flex: 2,
  431. width:'100%',
  432. height:'100%',
  433. backgroundColor:'transparent',
  434. textAlign :'center',
  435. textAlignVertical:'center',
  436. fontSize: 63/PixelRatio.get(),
  437. color: 'darkblue'
  438. },
  439. //layer background
  440. background:{
  441. flex: 1,
  442. width:'100%',
  443. height:'100%'
  444. },
  445. //layer top
  446. title:{
  447. flex: 6,
  448. flexDirection: 'row',
  449. alignItems: 'center',
  450. paddingLeft:42/PixelRatio.get(),
  451. paddingRight:42/PixelRatio.get(),
  452. backgroundColor:'transparent'
  453. },
  454. content:{
  455. flex: 18,
  456. flexDirection: 'column',
  457. alignItems: 'center',
  458. backgroundColor:'transparent'
  459. },
  460. bottom:{
  461. flex: 2,
  462. flexDirection: 'row',
  463. alignItems: 'center',
  464. paddingLeft:42/PixelRatio.get(),
  465. paddingRight:42/PixelRatio.get(),
  466. backgroundColor:'transparent'
  467. },
  468. //layer title
  469. titleImagePlace: {
  470. flex: 2,
  471. paddingTop: '20%',
  472. paddingLeft: '15%',
  473. alignItems: 'center',
  474. backgroundColor:'transparent'
  475. },
  476. titleImage: {
  477. width:'100%',
  478. height:'100%',
  479. flex: 1,
  480. backgroundColor:'transparent'
  481. },
  482. titleQrcodeBonder: {
  483. width:'100%',
  484. height:'100%',
  485. alignItems: 'center',
  486. flexDirection: 'column',
  487. flex: 1,
  488. backgroundColor:'transparent'
  489. },
  490. titleQrcodePlacehold: {
  491. flex: 5,
  492. backgroundColor:'transparent'
  493. },
  494. titleQrcode: {
  495. flex: 6,
  496. width:'100%',
  497. height:'100%',
  498. backgroundColor:'transparent'
  499. },
  500. //layer bottom
  501. bottomLogoBackground: {
  502. flex: 3,
  503. borderRadius:16/PixelRatio.get(),
  504. marginTop: 26/PixelRatio.get(),
  505. marginBottom: 26/PixelRatio.get(),
  506. backgroundColor:'transparent',//'rgba(255,255,255,0.5)',
  507. },
  508. bottomLogo: {
  509. width:'100%',
  510. height:'100%',
  511. backgroundColor:'transparent'
  512. },
  513. bottomQrcode1Background : {
  514. flex: 1,
  515. width:'100%',
  516. height:'100%',
  517. marginLeft: 21/PixelRatio.get(),
  518. paddingTop: 27/PixelRatio.get(),
  519. paddingBottom: 11/PixelRatio.get(),
  520. flexDirection: 'column',
  521. backgroundColor:'transparent'
  522. },
  523. bottomQrcode2Background : {
  524. flex: 1,
  525. width:'100%',
  526. height:'100%',
  527. marginLeft: 21/PixelRatio.get(),
  528. paddingTop: 26/PixelRatio.get(),
  529. paddingBottom: 11/PixelRatio.get(),
  530. flexDirection: 'column',
  531. backgroundColor:'transparent'
  532. },
  533. bottomQrcode1: {
  534. flex: 2,
  535. width:'100%',
  536. height:'100%',
  537. backgroundColor:'transparent'
  538. },
  539. bottomQrcode2: {
  540. flex: 2,
  541. width:'100%',
  542. height:'100%',
  543. backgroundColor:'transparent'
  544. },
  545. bottomQrcode1Str: {
  546. flex: 1,
  547. textAlign :'center',
  548. textAlignVertical:'center',
  549. fontSize: 16/PixelRatio.get(),
  550. color : 'white',
  551. backgroundColor:'transparent'
  552. },
  553. bottomQrcode2Str: {
  554. flex: 1,
  555. textAlign :'center',
  556. textAlignVertical:'center',
  557. fontSize: 16/PixelRatio.get(),
  558. color : 'white',
  559. backgroundColor:'transparent'
  560. },
  561. bottomPlacehold: {
  562. flex: 8,
  563. width:'100%',
  564. height:'100%',
  565. backgroundColor:'transparent',
  566. textAlign :'right',
  567. textAlignVertical:'bottom',
  568. fontSize: 27/PixelRatio.get(),
  569. color : 'gray'
  570. },
  571. //layer content item
  572. contentItem:{
  573. flex: 1,
  574. width:'100%',
  575. height:'100%',
  576. flexDirection: 'column',
  577. backgroundColor:'transparent'
  578. },
  579. contentItemDownLayer:{
  580. position:'absolute',
  581. width:'100%',
  582. height:'100%',
  583. flexDirection: 'column',
  584. alignItems: 'center',
  585. backgroundColor:'transparent'
  586. },
  587. contentItemUpLayer:{
  588. width:210/PixelRatio.get(),
  589. height:153/PixelRatio.get(),
  590. position:'absolute',
  591. backgroundColor:'transparent'
  592. },
  593. contentItemTop:{
  594. flex: 3,
  595. width:'100%',
  596. height:'100%',
  597. paddingLeft: 66/PixelRatio.get(),
  598. paddingRight: 53/PixelRatio.get(),
  599. paddingTop: 40/PixelRatio.get(),
  600. flexDirection: 'row',
  601. alignItems: 'center',
  602. backgroundColor:'transparent'
  603. },
  604. contentItemBottom:{
  605. flex: 1,
  606. width:'100%',
  607. height:'100%',
  608. paddingLeft: 66/PixelRatio.get(),
  609. paddingRight: 53/PixelRatio.get(),
  610. paddingBottom: 40/PixelRatio.get(),
  611. flexDirection: 'row',
  612. alignItems: 'center',
  613. backgroundColor:'transparent'
  614. },
  615. //layer content item top
  616. contentItemTopCoverImg:{
  617. flex: 5,
  618. width:'100%',
  619. height:'100%',
  620. borderRadius:27/PixelRatio.get(),
  621. backgroundColor:'transparent'
  622. },
  623. contentItemTopDetail:{
  624. flex: 6,
  625. width:'100%',
  626. height:'100%',
  627. paddingLeft: 20/PixelRatio.get(),
  628. paddingRight: 20/PixelRatio.get(),
  629. alignItems: 'center',
  630. backgroundColor:'transparent'
  631. },
  632. contentItemTopQrcode:{
  633. flex: 5,
  634. width:'100%',
  635. height:'100%',
  636. // borderStyle:"solid",
  637. // borderWidth:1,
  638. // borderColor:"red",
  639. marginLeft:18/PixelRatio.get(),
  640. backgroundColor:'transparent'
  641. },
  642. //layer content item bottom
  643. contentItemBottomMerchantName:{
  644. flex: 5,
  645. width:'100%',
  646. height:'100%',
  647. alignItems: 'center',
  648. color:"black",
  649. backgroundColor:'transparent',
  650. textAlign :'center',
  651. textAlignVertical:'center',
  652. fontSize: 27/PixelRatio.get(),
  653. fontWeight : 'bold'
  654. },
  655. contentItemBottomPlacehold:{
  656. flex: 6,
  657. fontSize: 27/PixelRatio.get(),
  658. paddingLeft: 27/PixelRatio.get(),
  659. paddingRight: 79/PixelRatio.get(),
  660. width:'100%',
  661. height:'100%',
  662. color:"black",
  663. textAlignVertical:'center',
  664. backgroundColor:'transparent',
  665. },
  666. contentItemBottomAction:{
  667. flex: 5,
  668. width:'100%',
  669. height:'100%',
  670. backgroundColor:'transparent',
  671. textAlign :'center',
  672. textAlignVertical:'center',
  673. fontSize: 36/PixelRatio.get(),
  674. color: 'black',
  675. // borderStyle:"solid",
  676. // borderWidth:1,
  677. // borderColor:"red"
  678. },
  679. // 券的title
  680. contentItemTopDetailTitle:{
  681. flex: 2,
  682. // height:'100%',
  683. width:'100%',
  684. marginTop:"2%",
  685. // borderStyle:"solid",
  686. // borderWidth:1,
  687. // borderColor:"red",
  688. backgroundColor:'transparent',
  689. textAlign :'left',
  690. color:"black",
  691. textAlignVertical:'center',
  692. fontSize: 53/PixelRatio.get(),
  693. },
  694. /*
  695. contentItemTopDetailRemark:{
  696. flex: 1,
  697. width:'100%',
  698. height:'100%',
  699. backgroundColor:'transparent',
  700. textAlign :'left',
  701. textAlignVertical:'center',
  702. fontSize: 27/PixelRatio.get(),
  703. color : 'gray'
  704. },
  705. */
  706. contentItemTopDetailPrice:{
  707. flex: 2,
  708. width:'100%',
  709. height:'100%',
  710. backgroundColor:'transparent',
  711. flexDirection: 'row',
  712. },
  713. // 售价的样式
  714. contentItemTopDetailCurPrice:{
  715. position:"absolute",
  716. bottom:10,
  717. left:0,
  718. width:'100%',
  719. height:'100%',
  720. flexDirection: 'row',
  721. backgroundColor:'transparent',
  722. },
  723. contentItemTopDetailCurPriceStr:{
  724. backgroundColor:'transparent',
  725. fontSize:96/PixelRatio.get(),
  726. fontFamily:"PingFangSC-Bold",
  727. fontWeight: "bold",
  728. textAlign :'left',
  729. textAlignVertical:'bottom',
  730. color : 'red'
  731. },
  732. contentItemTopDetailCurPriceStrUnit:{
  733. backgroundColor:'transparent',
  734. textAlign :'left',
  735. textAlignVertical:'bottom',
  736. paddingBottom: 16/PixelRatio.get(),
  737. fontSize: 48/PixelRatio.get(),
  738. color : 'red'
  739. },
  740. // 面额的样式
  741. contentItemTopDetailSalePrice:{
  742. position:"absolute",
  743. bottom:2,
  744. left:0,
  745. // flex: 1,
  746. paddingTop:50,
  747. width:'100%',
  748. // height:'100%',
  749. backgroundColor:'transparent',
  750. },
  751. contentItemTopDetailSalePriceStr:{
  752. width:'100%',
  753. height:'100%',
  754. backgroundColor:'transparent',
  755. textAlign :'left',
  756. textAlignVertical:'bottom',
  757. fontSize: 27/PixelRatio.get(),
  758. textDecorationLine: 'line-through',
  759. color : 'gray'
  760. },
  761. });