SummaryV2.js 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653
  1. /**
  2. * 新版充电结算页面
  3. * @邠心vbe on 2023/02/08
  4. */
  5. import React, { Component } from 'react';
  6. import { View, Text, StyleSheet, ScrollView, RefreshControl } from 'react-native';
  7. import apiCharge from '../../api/apiCharge';
  8. import Button from '../../components/Button';
  9. import Dialog from '../../components/Dialog';
  10. import { MyRefreshProps } from '../../components/ThemesConfig';
  11. import utils from '../../utils/utils';
  12. import { PageList } from '../Router';
  13. import app from '../../../app.json';
  14. import TextView from '../../components/TextView';
  15. import Skeleton from 'react-native-reanimated-skeleton';
  16. export default class SummaryV2 extends Component {
  17. constructor(props) {
  18. super(props);
  19. this.state = {
  20. loading: true,
  21. isActully: true,
  22. refreshing: false,
  23. summaryInfo: {
  24. top: {},
  25. station: {},
  26. connector: {},
  27. chargingFee: {},
  28. idleFee: {},
  29. reservationFee: {},
  30. payment: {}
  31. },
  32. chargingPk: "",
  33. isPendding: false
  34. };
  35. this.action = "";
  36. this.canBack = false;
  37. }
  38. componentDidMount() {
  39. const params = this.props.route.params;
  40. if (params.chargingPk) {
  41. //Dialog.showProgressDialog();
  42. this.setState({
  43. chargingPk: params.chargingPk
  44. })
  45. if (params.action && params.action == "view") {
  46. this.setState({
  47. isActully: false
  48. });
  49. setTimeout(() => {
  50. this.getSummaryData(params.chargingPk);
  51. }, 1000);
  52. } else {
  53. setTimeout(() => {
  54. this.getSummaryData(params.chargingPk);
  55. }, 3000);
  56. }
  57. }
  58. if (params.action) {
  59. this.action = params.action;
  60. }
  61. this.props.navigation.addListener('focus', e => {
  62. this.canBack = false;
  63. });
  64. this.props.navigation.addListener('beforeRemove', e => {
  65. if (this.state.isActully && !this.canBack) {
  66. this.toRating();
  67. e.preventDefault();
  68. }
  69. });
  70. }
  71. getSummaryData(chargingPk) {
  72. apiCharge.getChargeSummaryV2({
  73. chargingPk: chargingPk
  74. }).then(res => {
  75. //Dialog.dismissLoading();
  76. if (res.data) {
  77. this.setState({
  78. loading: false,
  79. refreshing: false,
  80. summaryInfo: res.data,
  81. isPendding: (res.data.hasSettled != true)
  82. });
  83. }
  84. }).catch((err) => {
  85. //Dialog.dismissLoading();
  86. toastShort(err);
  87. this.setState({
  88. isPendding: true,
  89. refreshing: false
  90. });
  91. });
  92. }
  93. onRefresh() {
  94. if (this.state.chargingPk) {
  95. this.setState({
  96. refreshing: true
  97. });
  98. this.getSummaryData(this.state.chargingPk);
  99. }
  100. }
  101. toRating() {
  102. this.canBack = true;
  103. if (this.action == "view") {
  104. goBack();
  105. } else {
  106. //routeUtil.resetToHome(this.props);
  107. startPage(PageList.home);
  108. //startPage(PageList.rating, this.state.stationInfo);
  109. }
  110. }
  111. toTransaction() {
  112. if (this.action == "view") {
  113. goBack();
  114. } else {
  115. startPage(PageList.wallet)
  116. }
  117. }
  118. getSummaryText(data) {
  119. if (this.state.summaryInfo?.paymentType == 'Fleet Credit') {
  120. return '-';
  121. } else {
  122. return currency + '' + (data ?? '0');
  123. }
  124. }
  125. getTaxTitle(title="") {
  126. if (this.state.summaryInfo?.taxRate) {
  127. return title.replace("$s", this.state.summaryInfo.taxRate)
  128. } else {
  129. return title.replace(" ($s)", "");
  130. }
  131. }
  132. isLoading(precond) {
  133. return utils.isNotEmpty(precond) || this.state.loading;
  134. }
  135. getSkeletonLeft(size=3) {
  136. const list = [];
  137. for (let i = 0; i < size; i++) {
  138. list.push({width: i % 2 ==0 ? '100%' : '70%', height: 18, marginTop: 4, marginBottom: 4, borderRadius: 3});
  139. }
  140. return list;
  141. }
  142. getSkeletonRight(size=3) {
  143. const list = [];
  144. for (let i = 0; i < size; i++) {
  145. list.push({width: '100%', height: 18, marginTop: 4, marginBottom: 4, borderRadius: 3});
  146. }
  147. return list;
  148. }
  149. getSectionSkeleton(size) {
  150. if (this.state.loading) {
  151. return (
  152. <View style={[styles.sections, ui.flexc]}>
  153. <Skeleton
  154. containerStyle={ui.flex2}
  155. isLoading={this.state.loading}
  156. boneColor='#eeeeee'
  157. highlightColor='#f6f6f6'
  158. animationType="shiver"
  159. layout={this.getSkeletonLeft(size)}
  160. animationDirection={'horizontalRight'}>
  161. </Skeleton>
  162. <View style={ui.flex2}></View>
  163. <Skeleton
  164. containerStyle={ui.flex1}
  165. isLoading={this.state.loading}
  166. boneColor='#eeeeee'
  167. highlightColor='#f6f6f6'
  168. animationType="shiver"
  169. layout={this.getSkeletonRight(size)}
  170. animationDirection={'horizontalRight'}>
  171. </Skeleton>
  172. </View>
  173. )
  174. } else {
  175. return <></>
  176. }
  177. }
  178. render() {
  179. if (this.state.isPendding) {
  180. return (
  181. <ScrollView
  182. style={styles.container}
  183. contentContainerStyle={ui.flex1}
  184. refreshControl={
  185. <RefreshControl
  186. {...MyRefreshProps()}
  187. refreshing={this.state.refreshing}
  188. onRefresh={() => this.onRefresh()}
  189. />
  190. }>
  191. <View style={styles.processContent}>
  192. <TextView style={styles.processTitle}>{$t("receipt.processTitle")}</TextView>
  193. <TextView style={styles.processText}>{$t("receipt.processMessage1")}</TextView>
  194. <TextView style={styles.processText}>Please pull down refresh this page after a few minutes to view your receipt.</TextView>
  195. {/* <TextView style={styles.processText}>
  196. {$t("receipt.processMessage2")}
  197. <Text style={[ui.bold, ui.underline]} onPress={() => this.toTransaction()}>{$t("receipt.processMessage3")}</Text>.
  198. </TextView> */}
  199. <TextView style={styles.processText}>{$t("receipt.processMessage4")}</TextView>
  200. </View>
  201. <View style={styles.bottomButton}>
  202. <Button
  203. text={$t('home.done')}
  204. elevation={1.5}
  205. onClick={() => this.toRating()}/>
  206. </View>
  207. </ScrollView>
  208. )
  209. } else {
  210. return (
  211. <ScrollView
  212. style={styles.container}
  213. refreshControl={
  214. <RefreshControl
  215. {...MyRefreshProps()}
  216. refreshing={this.state.refreshing}
  217. onRefresh={() => this.onRefresh()}
  218. />
  219. }>
  220. { this.isLoading(this.state.summaryInfo.top) &&
  221. <View style={styles.headerView}>
  222. { this.state.isActully && <>
  223. <Skeleton
  224. isLoading={this.state.loading}
  225. boneColor='#eeeeee'
  226. highlightColor='#f6f6f6'
  227. animationType="shiver"
  228. layout={[{width: 56, height: 56, borderRadius: 56}]}
  229. animationDirection={'horizontalRight'}>
  230. <Octicons
  231. name="check-circle-fill"
  232. color={colorAccent}
  233. size={56}/>
  234. </Skeleton>
  235. <Skeleton
  236. isLoading={this.state.loading}
  237. boneColor='#eeeeee'
  238. highlightColor='#f6f6f6'
  239. animationType="shiver"
  240. layout={[{width: 60, height: 20, marginTop: 8, borderRadius: 3}]}
  241. animationDirection={'horizontalRight'}>
  242. <TextView style={styles.topTitle}>{$t('receipt.successful')}</TextView>
  243. </Skeleton>
  244. <Skeleton
  245. isLoading={this.state.loading}
  246. boneColor='#eeeeee'
  247. highlightColor='#f6f6f6'
  248. animationType="shiver"
  249. layout={[{width: 100, height: 18, marginTop: 4, marginBottom: 32, borderRadius: 3}]}
  250. animationDirection={'horizontalRight'}>
  251. <TextView style={styles.topDesc}>{$t('receipt.chargingSessionComplete')}</TextView>
  252. </Skeleton>
  253. </>}
  254. { utils.isNotEmpty(this.state.summaryInfo.top.company) &&
  255. <View style={styles.formRow}>
  256. <TextView style={styles.label}>{$t('sign.labelCompany')}:</TextView>
  257. <TextView style={styles.text}>{this.state.summaryInfo.top.company}</TextView>
  258. </View>
  259. }
  260. { utils.isNotEmpty(this.state.summaryInfo.top.registrationNo) &&
  261. <View style={styles.formRow}>
  262. <TextView style={styles.label}>{$t('receipt.labelRegistrationNo')}</TextView>
  263. <TextView style={styles.text}>{this.state.summaryInfo.top.registrationNo}</TextView>
  264. </View>
  265. }
  266. <View style={styles.formRow}>
  267. <Skeleton
  268. containerStyle={ui.flex1}
  269. isLoading={this.state.loading}
  270. boneColor='#eeeeee'
  271. highlightColor='#f6f6f6'
  272. animationType="shiver"
  273. layout={this.getSkeletonLeft()}
  274. animationDirection={'horizontalRight'}>
  275. </Skeleton>
  276. <View style={ui.flex2}></View>
  277. <Skeleton
  278. containerStyle={ui.flex1}
  279. isLoading={this.state.loading}
  280. boneColor='#eeeeee'
  281. highlightColor='#f6f6f6'
  282. animationType="shiver"
  283. layout={this.getSkeletonRight()}
  284. animationDirection={'horizontalRight'}>
  285. </Skeleton>
  286. </View>
  287. { utils.isNotEmpty(this.state.summaryInfo.top.transactionId) &&
  288. <View style={styles.formRow}>
  289. <TextView style={styles.label}>{$t('receipt.labelTransactionID')}</TextView>
  290. <TextView style={styles.text}>{this.state.summaryInfo.top.transactionId}</TextView>
  291. </View>
  292. }
  293. { utils.isNotEmpty(this.state.summaryInfo.top.referenceId) &&
  294. <View style={styles.formRow}>
  295. <TextView style={styles.label}>{$t('receipt.labelReferenceID')}</TextView>
  296. <TextView style={styles.text}>{this.state.summaryInfo.top.referenceId}</TextView>
  297. </View>
  298. }
  299. { utils.isNotEmpty(this.state.summaryInfo.top.dateTime) &&
  300. <View style={styles.formRow}>
  301. <TextView style={styles.label}>{$t('receipt.labelDateTime')}</TextView>
  302. <TextView style={styles.text}>{this.state.summaryInfo.top.dateTime}</TextView>
  303. </View>
  304. }
  305. </View>
  306. }
  307. {this.getSectionSkeleton(2)}
  308. {/* <View style={styles.sections}>
  309. <View style={styles.formRow}>
  310. <Text style={styles.label}>{$t('wallet.labelTransactionId')}</Text>
  311. <Text style={styles.text}>{this.state.summaryInfo.transactionPk}</Text>
  312. </View>
  313. <View style={styles.formRow}>
  314. <Text style={styles.label}>{$t('wallet.labelReferenceId')}</Text>
  315. <Text style={styles.text}>{this.state.summaryInfo.chargingPk}</Text>
  316. </View>
  317. <View style={styles.formRow}>
  318. <Text style={styles.label}>{$t('wallet.labelDateTime')}</Text>
  319. <Text style={styles.text}>{this.state.summaryInfo.dateTime}</Text>
  320. </View>
  321. </View> */}
  322. { utils.isNotEmpty(this.state.summaryInfo.station) &&
  323. <View style={styles.sections}>
  324. <TextView style={styles.formTitle}>{$t('wallet.labelYourStation')}</TextView>
  325. <View style={styles.formRow}>
  326. <TextView style={styles.label}>{$t('wallet.labelStationId')}</TextView>
  327. <TextView style={styles.text}>{this.state.summaryInfo.station.stationId}</TextView>
  328. </View>
  329. <View style={styles.formRow}>
  330. <TextView style={styles.label}>{$t('receipt.labelSiteName')}</TextView>
  331. <TextView style={styles.text}>{this.state.summaryInfo.station.siteName ?? "-"}</TextView>
  332. </View>
  333. </View>
  334. }
  335. {this.getSectionSkeleton()}
  336. { utils.isNotEmpty(this.state.summaryInfo.connector) &&
  337. <View style={styles.sections}>
  338. <TextView style={styles.formTitle}>{$t('wallet.labelYourConnector')}</TextView>
  339. <View style={styles.formRow}>
  340. <TextView style={styles.label}>{$t('charging.labelType')}:</TextView>
  341. <TextView style={styles.text}>{this.state.summaryInfo.connector.type}</TextView>
  342. </View>
  343. <View style={styles.formRow}>
  344. <TextView style={styles.label}>{$t('charging.labelPower')}:</TextView>
  345. <TextView style={styles.text}>{this.state.summaryInfo.connector.power}</TextView>
  346. </View>
  347. <View style={styles.formRow}>
  348. <TextView style={styles.label}>{$t('charging.labelRates')}:</TextView>
  349. <TextView style={styles.text}>{this.state.summaryInfo.connector.rates}</TextView>
  350. </View>
  351. </View>
  352. }
  353. {this.getSectionSkeleton()}
  354. { utils.isNotEmpty(this.state.summaryInfo.chargingFee) &&
  355. <View style={styles.sections}>
  356. <TextView style={styles.formTitle}>{$t('receipt.breakdownChargingFees')}</TextView>
  357. <View style={styles.formRow}>
  358. <TextView style={styles.label}>{$t('wallet.labelChargeTime')}</TextView>
  359. <TextView style={styles.text}>{this.state.summaryInfo.chargingFee.chargeTime ?? "-"}</TextView>
  360. </View>
  361. <View style={styles.formRow}>
  362. <TextView style={styles.label}>{$t('wallet.labelChargeDelivered')}</TextView>
  363. <TextView style={styles.text}>{this.state.summaryInfo.chargingFee.chargeDelivered ?? 0}</TextView>
  364. </View>
  365. <View style={styles.formRow}>
  366. <TextView style={styles.label}>{this.getTaxTitle($t('receipt.labelChargTransSubtotal2'))}</TextView>
  367. <TextView style={styles.text}>{this.state.summaryInfo.chargingFee.transactionSubtotal}</TextView>
  368. </View>
  369. </View>
  370. }
  371. {this.getSectionSkeleton()}
  372. { utils.isNotEmpty(this.state.summaryInfo.idleFeeV2) &&
  373. <View style={styles.sections}>
  374. <TextView style={styles.formTitle}>{$t('receipt.breakdownIdlesFees')}</TextView>
  375. <View style={styles.formRow}>
  376. <TextView style={styles.label}>Idle Fee Rules:</TextView>
  377. <TextView style={styles.text}>{this.state.summaryInfo.idleFeeV2.idleRule}</TextView>
  378. </View>
  379. <View style={styles.formRow}>
  380. <TextView style={styles.label}>Grace Period Start Time:</TextView>
  381. <TextView style={styles.text}>{this.state.summaryInfo.idleFeeV2.gracePeriodStartTime}</TextView>
  382. </View>
  383. <View style={styles.formRow}>
  384. <TextView style={styles.label}>Idle Fee Start Time:</TextView>
  385. <TextView style={styles.text}>{this.state.summaryInfo.idleFeeV2.idlePeriodStartTime}</TextView>
  386. </View>
  387. <View style={styles.formRow}>
  388. <TextView style={styles.label}>Idle Fee Period:</TextView>
  389. <TextView style={styles.text}>{this.state.summaryInfo.idleFeeV2.idlePeriod}</TextView>
  390. </View>
  391. <View style={styles.formRow}>
  392. <TextView style={styles.label}>Idle Fee End Time:</TextView>
  393. <TextView style={styles.text}>{this.state.summaryInfo.idleFeeV2.idlePeriodEndTime}</TextView>
  394. </View>
  395. <View style={styles.formRow}>
  396. <TextView style={styles.label}>{$t('receipt.labelIdleFeeSubtotal3')}</TextView>
  397. <TextView style={styles.text}>{this.state.summaryInfo.idleFeeV2.sumFee}</TextView>
  398. </View>
  399. </View>
  400. }
  401. {/* utils.isNotEmpty(this.state.summaryInfo.idleFee) &&
  402. <View style={styles.sections}>
  403. <TextView style={styles.formTitle}>{$t('receipt.breakdownIdlesFees')}</TextView>
  404. <View style={styles.formRow}>
  405. <TextView style={styles.label}>{$t('receipt.labelIdleStartTime')}</TextView>
  406. <TextView style={styles.text}>{this.state.summaryInfo.idleFee.startTime}</TextView>
  407. </View>
  408. <View style={styles.formRow}>
  409. <TextView style={styles.label}>{$t('receipt.labelIdleDuration')}</TextView>
  410. <TextView style={styles.text}>{this.state.summaryInfo.idleFee.duration}</TextView>
  411. </View>
  412. <View style={styles.formRow}>
  413. <TextView style={styles.label}>{$t('receipt.labelIdleFeeSubtotal3')}</TextView>
  414. <TextView style={styles.text}>{this.state.summaryInfo.idleFee.subtotal}</TextView>
  415. </View>
  416. </View>
  417. */}
  418. {this.getSectionSkeleton()}
  419. { utils.isNotEmpty(this.state.summaryInfo.reservationFee) &&
  420. <View style={styles.sections}>
  421. <TextView style={styles.formTitle}>{$t('receipt.breakdownReservationFees')}</TextView>
  422. <View style={styles.formRow}>
  423. <TextView style={styles.label}>{$t('receipt.labelTimeReservation')}</TextView>
  424. <TextView style={styles.text}>{this.state.summaryInfo.reservationFee.reservationTime}</TextView>
  425. </View>
  426. <View style={styles.formRow}>
  427. <TextView style={styles.label}>{$t('receipt.labelDurationReservation')}</TextView>
  428. <TextView style={styles.text}>{this.state.summaryInfo.reservationFee.reservationDuration}</TextView>
  429. </View>
  430. <View style={styles.formRow}>
  431. <TextView style={styles.label}>{this.getTaxTitle($t('receipt.labelReservationFeeSubtotal2'))}</TextView>
  432. <TextView style={styles.text}>{this.state.summaryInfo.reservationFee.reservationFeeSubtotal}</TextView>
  433. </View>
  434. </View>
  435. }
  436. {this.getSectionSkeleton(8)}
  437. { utils.isNotEmpty(this.state.summaryInfo.payment) &&
  438. <View style={styles.sections}>
  439. <TextView style={styles.formTitle}>{$t('receipt.breakdownPayment')}</TextView>
  440. <View style={styles.formRow}>
  441. <TextView style={styles.label}>{$t('wallet.labelPaymentMadeBy')}</TextView>
  442. <TextView style={styles.text}>{this.state.summaryInfo.payment.paymentMadeBy ?? "-"}</TextView>
  443. </View>
  444. { utils.isNotEmpty(this.state.summaryInfo.payment.transactionSubtotal) &&
  445. <View style={styles.formRow}>
  446. <TextView style={styles.label}>{this.getTaxTitle($t('receipt.labelChargTransSubtotal2'))}</TextView>
  447. <TextView style={styles.text}>{this.state.summaryInfo.payment.transactionSubtotal}</TextView>
  448. </View>
  449. }
  450. { utils.isNotEmpty(this.state.summaryInfo.payment.idleFeeSubtotal) &&
  451. <View style={styles.formRow}>
  452. <TextView style={styles.label}>{$t('receipt.labelIdleFeeSubtotal3')}</TextView>
  453. <TextView style={styles.text}>{this.state.summaryInfo.payment.idleFeeSubtotal}</TextView>
  454. </View>
  455. }
  456. { utils.isNotEmpty(this.state.summaryInfo.payment.reservationFeeSubtotal) &&
  457. <View style={styles.formRow}>
  458. <TextView style={styles.label}>{this.getTaxTitle($t('receipt.labelReservationFeeSubtotal2'))}</TextView>
  459. <TextView style={styles.text}>{this.state.summaryInfo.payment.reservationFeeSubtotal}</TextView>
  460. </View>
  461. }
  462. { utils.isNotEmpty(this.state.summaryInfo.payment.finalPayment) &&
  463. <View style={styles.formRow}>
  464. <TextView style={styles.label}>
  465. { utils.isNotEmpty(this.state.summaryInfo.payment.discountCredit)
  466. ? $t('receipt.labelAfterDiscount')
  467. : $t('receipt.labelFinalPaymentAmount')
  468. }
  469. </TextView>
  470. <TextView style={styles.text}>{this.state.summaryInfo.payment.finalPayment ?? "-"}</TextView>
  471. </View>
  472. }
  473. {/* <View style={styles.formRow}>
  474. <Text style={styles.label}>{$t('wallet.labelChargeRates')}</Text>
  475. <Text style={styles.text}>{currency}{this.state.summaryInfo.chargeRates ?? '0.0'}</Text>
  476. </View> */}
  477. { utils.isNotEmpty(this.state.summaryInfo.payment.exchangeRate) &&
  478. <View style={styles.formRow}>
  479. <TextView style={styles.label}>{$t('wallet.labelExchangeRate')}</TextView>
  480. <TextView style={styles.text}>{this.state.summaryInfo.payment.exchangeRate ?? "-"}</TextView>
  481. </View>
  482. }
  483. {/* <View style={styles.formRow}>
  484. <Text style={styles.label}>{$t('wallet.labelPreviousBalance')}</Text>
  485. <Text style={styles.text}>{this.getSummaryText(this.state.summaryInfo.previousBalance)}</Text>
  486. </View> */}
  487. { utils.isNotEmpty(this.state.summaryInfo.payment.resultingBalance) &&
  488. <View style={styles.formRow}>
  489. <TextView style={styles.label}>{$t('wallet.labelResultingBalance')}</TextView>
  490. <TextView style={styles.text}>{this.state.summaryInfo.payment.resultingBalance ?? "-"}</TextView>
  491. </View>
  492. }
  493. { utils.isNotEmpty(this.state.summaryInfo.payment.refundAmount) &&
  494. <View style={styles.formRow}>
  495. <TextView style={styles.label}>{$t('wallet.labelRefundAmount')}</TextView>
  496. <TextView style={styles.text}>{this.state.summaryInfo.payment.refundAmount ?? "-"}</TextView>
  497. </View>
  498. }
  499. </View>
  500. }
  501. <EndView/>
  502. { (this.state.isActully && utils.isNotEmpty(this.state.summaryInfo.top)) &&
  503. <View style={styles.bottomButton}>
  504. {/* <TextView
  505. style={styles.feedback}
  506. onPress={() => startPage(PageList.feedback)}>{$t('wallet.linkSubmitFeedback')}</TextView> */}
  507. {/* <Text style={styles.tipText}>{$t('wallet.tipsReceipt')}</Text> */}
  508. <Button
  509. text={$t('home.done')}
  510. elevation={1.5}
  511. onClick={() => this.toRating()}/>
  512. </View>
  513. }
  514. </ScrollView>
  515. );
  516. }
  517. }
  518. }
  519. const styles = StyleSheet.create({
  520. container: {
  521. flex: 1,
  522. paddingLeft: 16,
  523. paddingRight: 16,
  524. backgroundColor: colorLight
  525. },
  526. headerView: {
  527. alignItems: 'center',
  528. paddingTop: 16,
  529. paddingBottom: 24
  530. },
  531. topTitle: {
  532. color: textPrimary,
  533. fontSize: 16,
  534. paddingTop: 8,
  535. paddingLeft: 8,
  536. fontWeight: 'bold'
  537. },
  538. topDesc: {
  539. color: textPrimary,
  540. fontSize: 14,
  541. marginBottom: 32
  542. },
  543. sections: {
  544. borderRadius: 10,
  545. marginBottom: 12,
  546. backgroundColor: colorLight
  547. },
  548. sections2: {
  549. paddingTop: 0,
  550. paddingLeft: 0,
  551. paddingRight: 0,
  552. paddingBottom: 8,
  553. borderRadius: 10,
  554. marginBottom: 8,
  555. backgroundColor: colorLight
  556. },
  557. formTitle: {
  558. color: '#000',
  559. fontSize: 14,
  560. marginTop: -4,
  561. marginBottom: 6,
  562. paddingBottom: 6,
  563. fontWeight: 'bold',
  564. borderBottomWidth: 1,
  565. borderBottomColor: textPrimary
  566. },
  567. formRow: {
  568. paddingTop: 3,
  569. paddingBottom: 3,
  570. alignItems: 'center',
  571. flexDirection: 'row'
  572. },
  573. label: {
  574. flex: 1,
  575. color: textPrimary,
  576. fontSize: 13,
  577. },
  578. text: {
  579. color: textPrimary,
  580. fontSize: 12,
  581. fontWeight: 'bold'
  582. },
  583. stationInfoView: {
  584. padding: 12,
  585. marginBottom: 0,
  586. alignItems: 'center',
  587. flexDirection: 'row',
  588. justifyContent: 'space-between'
  589. },
  590. stationInfoText: {
  591. color: '#999',
  592. fontSize: 11
  593. },
  594. connectorView: {
  595. alignItems: 'center',
  596. flexDirection: 'row'
  597. },
  598. typeIcon: {
  599. width: 36,
  600. height: 36
  601. },
  602. feedback: {
  603. color: '#12A5F9',
  604. fontSize: 14,
  605. textAlign: 'center',
  606. marginBottom: 16,
  607. ...ui.underline
  608. },
  609. bottomButton: {
  610. marginTop: 16,
  611. marginBottom: 32
  612. },
  613. tipText: {
  614. color: textPrimary,
  615. fontSize: 12,
  616. textAlign: 'center',
  617. marginBottom: 8
  618. },
  619. processContent: {
  620. flex: 1,
  621. justifyContent: 'center'
  622. },
  623. processTitle: {
  624. color: textTitle,
  625. fontSize: 24,
  626. fontWeight: 'bold',
  627. textAlign: 'center'
  628. },
  629. processText: {
  630. color: textPrimary,
  631. fontSize: 14,
  632. textAlign: 'center',
  633. paddingTop: 16
  634. }
  635. });