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

450 行
19 KiB

  1. import React from "react";
  2. import classNames from "classnames";
  3. import { makeStyles } from "@material-ui/core/styles";
  4. import Dashboard from "@material-ui/icons/Dashboard";
  5. import GridContainer from "components/Grid/GridContainer.js";
  6. import Grid from '@material-ui/core/Grid';
  7. import GridItem from "components/Grid/GridItem.js";
  8. import NavPills from "components/NavPills/NavPills.js";
  9. import Card from "components/Card/Card.js";
  10. import CardBody from "components/Card/CardBody.js";
  11. import CardHeader from "components/Card/CardHeader.js";
  12. import Button from "components/CustomButtons/Button.js";
  13. import Icon from "@material-ui/core/Icon";
  14. import Typography from '@material-ui/core/Typography';
  15. import styles from "assets/jss/nextjs-material-kit/pages/profilePage.js";
  16. import Carousel from "react-slick";
  17. import Image from "assets/img/sosmed/yt.jpg";
  18. import Paper from '@material-ui/core/Paper';
  19. const useStyles = makeStyles(styles);
  20. const DataCheckout = function ({ midtransClient, transactionToken, backend, order, unpaid, prepared, sending, finished, ...props }) {
  21. console.log('Token :',transactionToken);
  22. const classes = useStyles();
  23. const navImageClasses = classNames(classes.imgRounded, classes.imgGallery);
  24. const SemuaOrder = order.map((data) => {
  25. return (
  26. <div className={classes.root}>
  27. <Card style={{padding:"10px"}}>
  28. <Grid container spacing={3}>
  29. <Grid item xs={6}>
  30. <h4>Dealer A.Rivai | Thamrin Brothers - Yamaha</h4>
  31. </Grid>
  32. <Grid item xs={6}>
  33. <div align="right">
  34. <h4>Paket Telah Diterima | Selesai</h4>
  35. </div>
  36. </Grid>
  37. </Grid>
  38. <Grid container spacing={3}>
  39. <Grid item xs={4}><br/>
  40. <img src={Image} width="60%"/>
  41. </Grid>
  42. <Grid item xs={4} style={{marginLeft:"-70px", marginTop:"12px"}}>
  43. <h4>All New NMAX 155 Connected / ABS Version</h4>
  44. <h5>Variasi = Hitam</h5>
  45. <h5>Jumlah = 1 Unit</h5>
  46. </Grid>
  47. <Grid item xs={4}>
  48. <div align="right" style={{marginRight:"-70px", marginTop:"12px"}}>
  49. <h4>Rp.32.000.000,-</h4><br/><br/><br/><br/>
  50. <h4>Total Pesanan = Rp.32.000.000,-</h4>
  51. </div>
  52. </Grid>
  53. </Grid>
  54. <Grid container>
  55. <Grid item xs={4}>
  56. <h5>Nilai produk sebelum 30-10-2021</h5>
  57. <h5>Nilai sekarang & dapatkan 100 Koin Loyalty!</h5>
  58. </Grid>
  59. <Grid item xs={2}>
  60. </Grid>
  61. <Grid item xs={2}>
  62. </Grid>
  63. <Grid item xs={2}>
  64. <div align="right">
  65. <Button color="danger" href={"/yamaha/product/product_detail?s="}>
  66. <Icon className={classes.icons}>shopping_cart</Icon>Beli Lagi Produk
  67. </Button>
  68. </div>
  69. </Grid>
  70. <Grid item xs={2}>
  71. <div align="right">
  72. <Button
  73. color="info"
  74. href={"/yamaha/product/product_detail?s="}
  75. >
  76. <Icon className={classes.icons}>open_in_new</Icon>Beri Nilai Produk
  77. </Button>
  78. </div>
  79. </Grid>
  80. </Grid>
  81. </Card>
  82. </div>
  83. );
  84. })
  85. const BelumBayar = unpaid.map((data) => {
  86. return (
  87. <div className={classes.root}>
  88. <Card style={{padding:"10px"}}>
  89. <Grid container spacing={3}>
  90. <Grid item xs={6}>
  91. <h4>Dealer A.Rivai | Thamrin Brothers - Yamaha</h4>
  92. </Grid>
  93. <Grid item xs={6}>
  94. <div align="right">
  95. <h4>Paket Telah Diterima | Selesai</h4>
  96. </div>
  97. </Grid>
  98. </Grid>
  99. <hr/>
  100. <Grid container spacing={3}>
  101. <Grid item xs={4}><br/>
  102. <img src={Image} width="60%"/>
  103. </Grid>
  104. <Grid item xs={4} style={{marginLeft:"-70px", marginTop:"12px"}}>
  105. <h4>All New NMAX 155 Connected / ABS Version</h4>
  106. <h5>Variasi = Hitam</h5>
  107. <h5>Jumlah = 1 Unit</h5>
  108. </Grid>
  109. <Grid item xs={4}>
  110. <div align="right" style={{marginRight:"-70px", marginTop:"12px"}}>
  111. <h4>Rp.32.000.000,-</h4><br/><br/><br/><br/>
  112. <h4>Total Pesanan = Rp.32.000.000,-</h4>
  113. </div>
  114. </Grid>
  115. </Grid>
  116. <Grid container>
  117. <Grid item xs={4}>
  118. <h5>Nilai produk sebelum 30-10-2021</h5>
  119. <h5>Nilai sekarang & dapatkan 100 Koin Loyalty!</h5>
  120. </Grid>
  121. <Grid item xs={2}>
  122. </Grid>
  123. <Grid item xs={2}>
  124. </Grid>
  125. <Grid item xs={2}>
  126. <div align="right">
  127. <Button color="info" onClick={(e)=>{snap.pay(transactionToken);}} style={{width:"100%"}}>
  128. <Icon className={classes.icons}>attach_money</Icon>
  129. Bayar Pesanan
  130. </Button>
  131. </div>
  132. </Grid>
  133. <Grid item xs={2}>
  134. <div align="right">
  135. <Button
  136. color="info"
  137. href={"/yamaha/product/product_detail?s="}
  138. >
  139. <Icon className={classes.icons}>open_in_new</Icon>Hapus Produk
  140. </Button>
  141. </div>
  142. </Grid>
  143. </Grid>
  144. </Card>
  145. </div>
  146. );
  147. })
  148. const Dikemas = prepared.map((data) => {
  149. return (
  150. <div className={classes.root}>
  151. <Card style={{padding:"10px"}}>
  152. <Grid container spacing={3}>
  153. <Grid item xs={6}>
  154. <h4>Dealer A.Rivai | Thamrin Brothers - Yamaha</h4>
  155. </Grid>
  156. <Grid item xs={6}>
  157. <div align="right">
  158. <h4>Paket Telah Diterima | Selesai</h4>
  159. </div>
  160. </Grid>
  161. </Grid>
  162. <hr/>
  163. <Grid container spacing={3}>
  164. <Grid item xs={4}><br/>
  165. <img src={Image} width="80%"/>
  166. </Grid>
  167. <Grid item xs={4}>
  168. <h3>All New NMAX 155 Connected / ABS Version</h3>
  169. <h5>Variasi = Hitam</h5>
  170. <h5>Jumlah = 1 Unit</h5>
  171. </Grid>
  172. <Grid item xs={4}>
  173. <div align="left">
  174. <h3>Rp.32.000.000,-</h3><br/><br/><br/><br/>
  175. <h3>Total Pesanan = Rp.32.000.000,-</h3>
  176. </div>
  177. </Grid>
  178. </Grid>
  179. <hr/><br/>
  180. <Grid container>
  181. <Grid item xs={4}>
  182. <h5>Nilai produk sebelum 30-10-2021</h5>
  183. <h5>Nilai sekarang & dapatkan 100 Koin Loyalty!</h5>
  184. </Grid>
  185. <Grid item xs={2}>
  186. </Grid>
  187. <Grid item xs={2}>
  188. </Grid>
  189. <Grid item xs={2}>
  190. <div align="right">
  191. <Button
  192. color="danger"
  193. href={"/yamaha/product/product_detail?s="}
  194. >
  195. <Icon className={classes.icons}>shopping_cart</Icon>Beli Lagi Produk
  196. </Button>
  197. </div>
  198. </Grid>
  199. <Grid item xs={2}>
  200. <div align="right">
  201. <Button
  202. color="info"
  203. href={"/yamaha/product/product_detail?s="}
  204. >
  205. <Icon className={classes.icons}>open_in_new</Icon>Beri Nilai Produk
  206. </Button>
  207. </div>
  208. </Grid>
  209. </Grid>
  210. </Card>
  211. </div>
  212. );
  213. })
  214. const Dikirim = sending.map((data) => {
  215. return (
  216. <div className={classes.root}>
  217. <Card style={{padding:"10px"}}>
  218. <Grid container spacing={3}>
  219. <Grid item xs={6}>
  220. <h4>Dealer A.Rivai | Thamrin Brothers - Yamaha</h4>
  221. </Grid>
  222. <Grid item xs={6}>
  223. <div align="right">
  224. <h4>Paket Telah Diterima | Selesai</h4>
  225. </div>
  226. </Grid>
  227. </Grid>
  228. <hr/>
  229. <Grid container spacing={3}>
  230. <Grid item xs={4}><br/>
  231. <img src={Image} width="80%"/>
  232. </Grid>
  233. <Grid item xs={4}>
  234. <h3>All New NMAX 155 Connected / ABS Version</h3>
  235. <h5>Variasi = Hitam</h5>
  236. <h5>Jumlah = 1 Unit</h5>
  237. </Grid>
  238. <Grid item xs={4}>
  239. <div align="left">
  240. <h3>Rp.32.000.000,-</h3><br/><br/><br/><br/>
  241. <h3>Total Pesanan = Rp.32.000.000,-</h3>
  242. </div>
  243. </Grid>
  244. </Grid>
  245. <hr/><br/>
  246. <Grid container>
  247. <Grid item xs={4}>
  248. <h5>Nilai produk sebelum 30-10-2021</h5>
  249. <h5>Nilai sekarang & dapatkan 100 Koin Loyalty!</h5>
  250. </Grid>
  251. <Grid item xs={2}>
  252. </Grid>
  253. <Grid item xs={2}>
  254. </Grid>
  255. <Grid item xs={2}>
  256. <div align="right">
  257. <Button
  258. color="danger"
  259. href={"/yamaha/product/product_detail?s="}
  260. >
  261. <Icon className={classes.icons}>shopping_cart</Icon>Beli Lagi Produk
  262. </Button>
  263. </div>
  264. </Grid>
  265. <Grid item xs={2}>
  266. <div align="right">
  267. <Button
  268. color="info"
  269. href={"/yamaha/product/product_detail?s="}
  270. >
  271. <Icon className={classes.icons}>open_in_new</Icon>Beri Nilai Produk
  272. </Button>
  273. </div>
  274. </Grid>
  275. </Grid>
  276. </Card>
  277. </div>
  278. );
  279. })
  280. const Selesai = finished.map((data) => {
  281. return (
  282. <div className={classes.root}>
  283. <Card style={{padding:"10px"}}>
  284. <Grid container spacing={3}>
  285. <Grid item xs={6}>
  286. <h4>Dealer A.Rivai | Thamrin Brothers - Yamaha</h4>
  287. </Grid>
  288. <Grid item xs={6}>
  289. <div align="right">
  290. <h4>Paket Telah Diterima | Selesai</h4>
  291. </div>
  292. </Grid>
  293. </Grid>
  294. <hr/>
  295. <Grid container spacing={3}>
  296. <Grid item xs={4}><br/>
  297. <img src={Image} width="80%"/>
  298. </Grid>
  299. <Grid item xs={4}>
  300. <h3>All New NMAX 155 Connected / ABS Version</h3>
  301. <h5>Variasi = Hitam</h5>
  302. <h5>Jumlah = 1 Unit</h5>
  303. </Grid>
  304. <Grid item xs={4}>
  305. <div align="left">
  306. <h3>Rp.32.000.000,-</h3><br/><br/><br/><br/>
  307. <h3>Total Pesanan = Rp.32.000.000,-</h3>
  308. </div>
  309. </Grid>
  310. </Grid>
  311. <hr/><br/>
  312. <Grid container>
  313. <Grid item xs={4}>
  314. <h5>Nilai produk sebelum 30-10-2021</h5>
  315. <h5>Nilai sekarang & dapatkan 100 Koin Loyalty!</h5>
  316. </Grid>
  317. <Grid item xs={2}>
  318. </Grid>
  319. <Grid item xs={2}>
  320. </Grid>
  321. <Grid item xs={2}>
  322. <div align="right">
  323. <Button
  324. color="danger"
  325. href={"/yamaha/product/product_detail?s="}
  326. >
  327. <Icon className={classes.icons}>shopping_cart</Icon>Beli Lagi Produk
  328. </Button>
  329. </div>
  330. </Grid>
  331. <Grid item xs={2}>
  332. <div align="right">
  333. <Button
  334. color="info"
  335. href={"/yamaha/product/product_detail?s="}
  336. >
  337. <Icon className={classes.icons}>open_in_new</Icon>Beri Nilai Produk
  338. </Button>
  339. </div>
  340. </Grid>
  341. </Grid>
  342. </Card>
  343. </div>
  344. );
  345. })
  346. return (
  347. <Card className={classes.textCenter}>
  348. <script type="text/javascript" src="https://app.sandbox.midtrans.com/snap/snap.js" data-client-key="SB-Mid-client-srx674LjNbEybd4-"/>
  349. <div align="center">
  350. <CardHeader color="info">Pesanan Saya</CardHeader>
  351. </div>
  352. <CardBody>
  353. <div align="center">
  354. <h2>Pesayanan Saya</h2>
  355. </div>
  356. <GridContainer justify="center">
  357. <GridItem>
  358. <NavPills
  359. alignCenter
  360. color="primary"
  361. tabs={[
  362. {
  363. tabButton: "Semua",
  364. tabIcon: Dashboard,
  365. tabContent: (
  366. <div>
  367. <h2>Semua Pesanan</h2><hr/>
  368. <div style={{padding:"20px"}}>
  369. {SemuaOrder}
  370. </div>
  371. </div>
  372. ),
  373. },
  374. {
  375. tabButton: "Belum Bayar",
  376. tabIcon: Dashboard,
  377. tabContent: (
  378. <div>
  379. <h2>Belum Bayar</h2><hr/>
  380. <div >
  381. {BelumBayar}
  382. </div>
  383. </div>
  384. ),
  385. },
  386. {
  387. tabButton: "Dikemas",
  388. tabIcon: Dashboard,
  389. tabContent: (
  390. <div>
  391. <h2>Dikemas</h2><hr/>
  392. <div >
  393. {Dikemas}
  394. </div>
  395. </div>
  396. ),
  397. },
  398. {
  399. tabButton: "Dikirim",
  400. tabIcon: Dashboard,
  401. tabContent: (
  402. <div>
  403. <h2>Dikirim</h2><hr/>
  404. <div >
  405. {Dikirim}
  406. </div>
  407. </div>
  408. ),
  409. },
  410. {
  411. tabButton: "Selesai",
  412. tabIcon: Dashboard,
  413. tabContent: (
  414. <div>
  415. <h2>Selesai</h2><hr/>
  416. <div >
  417. {Selesai}
  418. </div>
  419. </div>
  420. ),
  421. },
  422. ]}
  423. />
  424. </GridItem>
  425. </GridContainer>
  426. </CardBody>
  427. </Card>
  428. );
  429. }
  430. export default DataCheckout;