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

187 行
9.1 KiB

  1. import React, { useState } from 'react';
  2. import * as Icon from 'react-feather';
  3. import NumberFormat from 'react-number-format';
  4. const Checkout = function ({ transactionToken, backend, review, ...props }) {
  5. console.log(transactionToken);
  6. const Checkin = review[0].checkIn;
  7. const [Checkinyear, Checkinmonth, Checkinday] = Checkin.split('-')
  8. const Checkout = review[0].checkOut;
  9. const [Checkoutnyear, Checkoutnmonth, Checkoutnday] = Checkout.split('-')
  10. const date = (new Date(review[0].checkIn)).getTime();
  11. const today = (new Date(review[0].checkOut)).getTime();
  12. const msDay = 24 * 60 * 60 * 1000; // milliseconds per day
  13. const days = Math.floor((today - date) / msDay);
  14. const ReviewContens = review.map((data) => {
  15. return (
  16. <div className="row">
  17. <div className="col-lg-12 col-md-6">
  18. <div className="billing-details">
  19. <div className="row">
  20. <div className="col-lg-4 col-md-6">
  21. <img style={{ borderRadius: "10px" }} src="https://origin.pegipegi.com/jalan/images/pictM/Y4/Y972594/Y972594002.jpg" width="100%" />
  22. </div>
  23. <div className="col-lg-6 col-md-6">
  24. <h2 className="title">{data.namaKamar}</h2>
  25. <div className="row">
  26. <div className="col-lg-3 col-md-6">
  27. <p>Fasilitas : </p>
  28. </div>
  29. </div>
  30. <div className="row">
  31. <div className="col-lg-3 col-md-6">
  32. <p><Icon.Wifi /> Free Wifi</p>
  33. </div>
  34. <div className="col-lg-3 col-md-6">
  35. <p><Icon.Phone /> Telepon</p>
  36. </div>
  37. </div><br /><br />
  38. <div className="row">
  39. <div className="col-lg-3 col-md-6">
  40. <h6>Check In </h6>
  41. <h6><p>{`${Checkinday}/${Checkinmonth}/${Checkinyear}`}</p></h6>
  42. <h6><p>Setelah 14:00</p></h6>
  43. </div>
  44. <div className="col-lg-3 col-md-6">
  45. <h6>Check Out </h6>
  46. <h6><p>{`${Checkoutnday}/${Checkoutnmonth}/${Checkoutnyear}`}</p></h6>
  47. <h6><p>Sebelum 14:00</p></h6>
  48. </div>
  49. <div className="col-lg-3 col-md-6">
  50. <h6>Durasi Hari </h6>
  51. <h6><p>{days} Hari</p></h6>
  52. </div>
  53. <div className="col-lg-2 col-md-6">
  54. <h6>Pengunjung </h6>
  55. <h6><p>1 Orang</p></h6>
  56. </div>
  57. </div>
  58. </div>
  59. </div><br />
  60. </div>
  61. </div>
  62. <div className="col-lg-12 col-md-6" style={{ marginTop: "50px" }}>
  63. <div className="billing-details">
  64. <h3 className="title">Informasi Pemesan</h3>
  65. <div className="row">
  66. <div className="col-lg-7 col-md-4">
  67. <div className="row">
  68. <div className="col-lg-12 col-md-4">
  69. <h6>Nama Pemesan : {data.namaPemesan}</h6>
  70. </div>
  71. <div className="col-lg-12 col-md-4">
  72. <h6>Nomer HP Pemesan : {data.teleponPemesan} </h6>
  73. </div>
  74. <div className="col-lg-12 col-md-4">
  75. <h6>Alamat Email Pemesan : {data.emailPemesan}</h6>
  76. </div>
  77. </div>
  78. </div>
  79. <div className="col-lg-5 col-md-4">
  80. <div className="row">
  81. <div className="col-lg-12 col-md-4">
  82. <h6>Pesan Khusus : {data.requestKamar}</h6>
  83. </div>
  84. <div className="col-lg-12 col-md-4">
  85. <h6>Jumlah Pengunjung : {data.jumlahPengunjung} Orang</h6>
  86. </div>
  87. <div className="col-lg-12 col-md-4">
  88. <h6>Catatan : {data.catatan} Orang</h6>
  89. </div>
  90. </div>
  91. </div>
  92. </div>
  93. </div>
  94. </div>
  95. <div className="col-lg-12 col-md-6" style={{ marginTop: "50px" }}>
  96. <div className="order-details">
  97. <h3 className="title">Total Pesanan</h3>
  98. <div className="order-table table-responsive">
  99. <table className="table table-bordered">
  100. <thead>
  101. <tr>
  102. <th scope="col">Jenis Kamar</th>
  103. <th scope="col">Total</th>
  104. </tr>
  105. </thead>
  106. <tbody>
  107. <tr>
  108. <td className="product-name">
  109. <span href="#">Catania {data.namaKamar}</span>
  110. </td>
  111. <td className="product-total">
  112. <span className="subtotal-amount"><NumberFormat value={data.hargaKamar * days} displayType={'text'} thousandSeparator={true} prefix={'Rp.'} /></span>
  113. </td>
  114. </tr>
  115. <tr>
  116. <td className="product-name">
  117. <span href="#">Pajak 10%</span>
  118. </td>
  119. <td className="product-total">
  120. <span type="disable" className="subtotal-amount"><NumberFormat value={data.hargaKamar * days * 0.1} displayType={'text'} thousandSeparator={true} prefix={'Rp.'} /></span>
  121. </td>
  122. </tr>
  123. <tr>
  124. <td className="product-name">
  125. <span href="#">Total</span>
  126. </td>
  127. <td className="product-total">
  128. <span type="disable" className="subtotal-amount"><NumberFormat value={data.hargaKamar * days + data.hargaKamar * days * 0.1} displayType={'text'} thousandSeparator={true} prefix={'Rp.'} /></span>
  129. </td>
  130. </tr>
  131. </tbody>
  132. </table>
  133. </div>
  134. <button
  135. onClick={(e) => { snap.pay(transactionToken); }}
  136. className="btn btn-primary order-btn"
  137. >
  138. Bayar Pesanan
  139. </button>
  140. </div>
  141. </div>
  142. </div>
  143. );
  144. })
  145. return (
  146. <>
  147. <script type="text/javascript"
  148. src="https://app.sandbox.midtrans.com/snap/snap.js"
  149. data-client-key="SB-Mid-client-srx674LjNbEybd4-">
  150. </script>
  151. <div className="checkout-area ptb-80">
  152. <div className="container">
  153. <div className="row">
  154. <div className="col-lg-12 col-md-12">
  155. <div className="user-actions">
  156. <h4><Icon.Edit width="50px" /> Mohon Periksa Ulang Pesanan Anda</h4><br />
  157. </div>
  158. </div>
  159. </div>
  160. {ReviewContens}
  161. </div>
  162. </div>
  163. </>
  164. )
  165. }
  166. export default Checkout;