diff --git a/api/transaction/transaction.js b/api/transaction/transaction.js new file mode 100644 index 0000000..dd5959a --- /dev/null +++ b/api/transaction/transaction.js @@ -0,0 +1,155 @@ +import apollo from "../../lib/apollo.js"; + +async function getTransaction(token = "") { + var res = await apollo.query( + ` + query { + transactions{ + id + order_id + cust_name + cust_telp + cust_address + product_img{ + url + } + product_name + product_color + product_quantity + product_courier + product_price + } + }`, + token + ); + return res; +} + +async function getTransactionUnpaid(token = "") { + var res = await apollo.query( + ` + query { + transactions(where: { status: "1" }){ + id + order_id + cust_name + cust_telp + cust_address + product_img{ + url + } + product_name + product_color + product_quantity + product_courier + product_price + } + }`, + token + ); + return res; +} + +async function getTransactionPrepared(token = "") { + var res = await apollo.query( + ` + query { + transactions(where: { status: "2" }){ + id + order_id + cust_name + cust_telp + cust_address + product_img{ + url + } + product_name + product_color + product_quantity + product_courier + product_price + } + }`, + token + ); + return res; +} + +async function getTransactionSending(token = "") { + var res = await apollo.query( + ` + query { + transactions(where: { status: "3" }){ + id + order_id + cust_name + cust_telp + cust_address + product_img{ + url + } + product_name + product_color + product_quantity + product_courier + product_price + } + }`, + token + ); + return res; +} + +async function getTransactionFinished(token = "") { + var res = await apollo.query( + ` + query { + transactions(where: { status: "4" }){ + id + order_id + cust_name + cust_telp + cust_address + product_img{ + url + } + product_name + product_color + product_quantity + product_courier + product_price + } + }`, + token + ); + return res; +} + +async function newTransaction(content, token="") { + var res = await apollo.mutation( + ` + mutation($input : TransactionInput!){ + createTransaction( input:{data:$input} ) + { + transaction{ + id + } + } + } + `, + token, + { + input: content, + } + ); + return res; +} + +module.exports = { + newTransaction: newTransaction, + getTransaction:getTransaction, + getTransactionUnpaid:getTransactionUnpaid, + getTransactionPrepared:getTransactionPrepared, + getTransactionSending:getTransactionSending, + getTransactionFinished:getTransactionFinished, +}; \ No newline at end of file diff --git a/assets/img/home/01. HEADER.jpg b/assets/img/home/01. HEADER.jpg new file mode 100644 index 0000000..fcea991 Binary files /dev/null and b/assets/img/home/01. HEADER.jpg differ diff --git a/assets/img/home/bpr.jpg b/assets/img/home/bpr.jpg index 7d4d466..fe8a277 100644 Binary files a/assets/img/home/bpr.jpg and b/assets/img/home/bpr.jpg differ diff --git a/assets/img/home/emilia.jpg b/assets/img/home/emilia.jpg index fc85750..96faf70 100644 Binary files a/assets/img/home/emilia.jpg and b/assets/img/home/emilia.jpg differ diff --git a/assets/img/home/hino.jpg b/assets/img/home/hino.jpg index d64f830..0b93c28 100644 Binary files a/assets/img/home/hino.jpg and b/assets/img/home/hino.jpg differ diff --git a/assets/img/home/home.jpg b/assets/img/home/home.jpg index 05d364c..d542bbb 100644 Binary files a/assets/img/home/home.jpg and b/assets/img/home/home.jpg differ diff --git a/assets/img/home/honda.jpg b/assets/img/home/honda.jpg index 3a46d8c..d1fefa2 100644 Binary files a/assets/img/home/honda.jpg and b/assets/img/home/honda.jpg differ diff --git a/assets/img/home/mercedes.jpg b/assets/img/home/mercedes.jpg index f5cded4..37a44a5 100644 Binary files a/assets/img/home/mercedes.jpg and b/assets/img/home/mercedes.jpg differ diff --git a/assets/img/home/pim.jpg b/assets/img/home/pim.jpg index bcb1cb8..e435bb4 100644 Binary files a/assets/img/home/pim.jpg and b/assets/img/home/pim.jpg differ diff --git a/assets/img/home/suzuki.jpg b/assets/img/home/suzuki.jpg index 39c3ac5..6bec00d 100644 Binary files a/assets/img/home/suzuki.jpg and b/assets/img/home/suzuki.jpg differ diff --git a/assets/img/home/yamaha1.jpg b/assets/img/home/yamaha1.jpg index f5c61d9..655df88 100644 Binary files a/assets/img/home/yamaha1.jpg and b/assets/img/home/yamaha1.jpg differ diff --git a/assets/jss/nextjs-material-kit/components/headerLinksStyle.js b/assets/jss/nextjs-material-kit/components/headerLinksStyle.js index ab26541..a958def 100644 --- a/assets/jss/nextjs-material-kit/components/headerLinksStyle.js +++ b/assets/jss/nextjs-material-kit/components/headerLinksStyle.js @@ -24,11 +24,10 @@ const headerLinksStyle = theme => ({ [theme.breakpoints.down("sm")]: { width: "100%", "&:after": { - width: "calc(100% - 30px)", + width: "100%", content: '""', display: "block", height: "1px", - marginLeft: "15px", backgroundColor: "#e5e5e5" } } @@ -69,7 +68,6 @@ const headerLinksStyle = theme => ({ margin: "5px 15px" }, color: "#FFF", - padding: "0.9375rem", fontWeight: "400", fontSize: "12px", textTransform: "uppercase", diff --git a/assets/jss/nextjs-material-kit/pages/componentsSections/homeStyle.js b/assets/jss/nextjs-material-kit/pages/componentsSections/homeStyle.js index 3913197..c9bbb5e 100644 --- a/assets/jss/nextjs-material-kit/pages/componentsSections/homeStyle.js +++ b/assets/jss/nextjs-material-kit/pages/componentsSections/homeStyle.js @@ -6,7 +6,6 @@ const notificationsStyles = { display: "block", width: "100%", position: "relative", - padding: "0" }, title: { ...title, diff --git a/components/Footer/Footer.js b/components/Footer/Footer.js index 40a52f4..5dad08d 100644 --- a/components/Footer/Footer.js +++ b/components/Footer/Footer.js @@ -1,16 +1,10 @@ -/*eslint-disable*/ import React from "react"; -// nodejs library to set properties for components import PropTypes from "prop-types"; -// nodejs library that concatenates classes import classNames from "classnames"; -// material-ui core components import { List, ListItem } from "@material-ui/core"; import { makeStyles } from "@material-ui/core/styles"; -// @material-ui/icons import Favorite from "@material-ui/icons/Favorite"; - import GridContainer from "components/Grid/GridContainer.js"; import Grid from '@material-ui/core/Grid'; import GridItem from "components/Grid/GridItem.js"; @@ -18,39 +12,30 @@ import Paper from '@material-ui/core/Paper'; import Card from "components/Card/Card.js"; import styles from "assets/jss/nextjs-material-kit/components/footerStyle.js"; -// import iconfb from "assets/img/sosmed/iconfb.png"; -// import iconig from "assets/img/sosmed/iconig.png"; -// import icontwt from "assets/img/sosmed/icontwt.png"; -// import iconyt from "assets/img/sosmed/iconyt.png"; - const useStyles = makeStyles(styles); export default function Footer(props) { - const classes = useStyles(); - const { whiteFont } = props; - const footerClasses = classNames({ - [classes.footer]: true, - [classes.footerWhiteFont]: whiteFont - }); - const aClasses = classNames({ - [classes.a]: true, - [classes.footerWhiteFont]: whiteFont - }); - return ( -
- - -
- - -
-
- -
-
-
-
- + const classes = useStyles(); + const { whiteFont } = props; + const footerClasses = classNames({ + [classes.footer]: true, + [classes.footerWhiteFont]: whiteFont + }); + const aClasses = classNames({ + [classes.a]: true, + [classes.footerWhiteFont]: whiteFont + }); + return ( + +
+

+
+ + +
+

+
+ Home @@ -88,51 +73,30 @@ export default function Footer(props) { About Us -
-
-
-
-
- - -
- -
-
-
- - -
-
- © {1900 + new Date().getYear()} , All Right Reserved{" "} by{" "} @Thamrin Group Company -
-
-
-
-
- ); +

+
+ © {1900 + new Date().getYear()} , All Right Reserved{" "} by{" "} @Thamrin Brothers +


+ + ); } Footer.propTypes = { - whiteFont: PropTypes.bool + whiteFont: PropTypes.bool }; diff --git a/components/Footer/FooterHino.js b/components/Footer/FooterHino.js index 95d3fa0..75c0709 100644 --- a/components/Footer/FooterHino.js +++ b/components/Footer/FooterHino.js @@ -2,26 +2,16 @@ import React from "react"; // nodejs library to set properties for components import PropTypes from "prop-types"; -// nodejs library that concatenates classes import classNames from "classnames"; -// material-ui core components import { List, ListItem } from "@material-ui/core"; import { makeStyles } from "@material-ui/core/styles"; -// @material-ui/icons -import Favorite from "@material-ui/icons/Favorite"; - -import GridContainer from "components/Grid/GridContainer.js"; -import Grid from '@material-ui/core/Grid'; -import Paper from '@material-ui/core/Paper'; -import Card from "components/Card/Card.js"; +import GridItem from "components/Grid/GridItem.js"; import styles from "assets/jss/nextjs-material-kit/components/footerStyle.js"; - import CLM from "assets/img/clm.png"; import Hino from "assets/img/logohino.png"; const useStyles = makeStyles(styles); - export default function Footer(props) { const classes = useStyles(); const { whiteFont } = props; @@ -34,98 +24,53 @@ export default function Footer(props) { [classes.footerWhiteFont]: whiteFont }); return ( -

- - -
- -
- - - -
- - - - - - - -
- + +
+


+
+ +
- - - - -
- © {1900 + new Date().getYear()} , All Right Reserved{" "} by{" "} @Thamrin Group Company -
-
-
-
+

+
+ + + Home + + + Product + + + Latest News + + + Carrer + + + About Us + + +
+
+ + + Facebook + + + Instagram + + + Twitter + + + Youtube + + +


+
+ © {1900 + new Date().getYear()} , All Right Reserved{" "} by{" "} @Thamrin Brothers +


+ ); } diff --git a/components/Footer/FooterHome.js b/components/Footer/FooterHome.js index 7cab6c5..ed95779 100644 --- a/components/Footer/FooterHome.js +++ b/components/Footer/FooterHome.js @@ -1,30 +1,19 @@ /*eslint-disable*/ import React from "react"; -// nodejs library to set properties for components import PropTypes from "prop-types"; -// nodejs library that concatenates classes import classNames from "classnames"; -// material-ui core components import { List, ListItem } from "@material-ui/core"; import { makeStyles } from "@material-ui/core/styles"; -// @material-ui/icons import Favorite from "@material-ui/icons/Favorite"; - import GridContainer from "components/Grid/GridContainer.js"; import Grid from '@material-ui/core/Grid'; import GridItem from "components/Grid/GridItem.js"; import Paper from '@material-ui/core/Paper'; import Card from "components/Card/Card.js"; import styles from "assets/jss/nextjs-material-kit/components/footerStyle.js"; - import Logo from "assets/img/White.png"; -// import iconfb from "assets/img/sosmed/iconfb.png"; -// import iconig from "assets/img/sosmed/iconig.png"; -// import icontwt from "assets/img/sosmed/icontwt.png"; -// import iconyt from "assets/img/sosmed/iconyt.png"; - const useStyles = makeStyles(styles); export default function Footer(props) { @@ -39,20 +28,13 @@ export default function Footer(props) { [classes.footerWhiteFont]: whiteFont }); return ( -
- - +


- -
-
- -
- +
-
-
- - -
-
-
-
+
Facebook @@ -106,23 +78,12 @@ export default function Footer(props) { Youtube - -
-
-
-
-
-
- - -
-
+ +


+
© {1900 + new Date().getYear()} , All Right Reserved{" "} by{" "} @Thamrin Group Company -
-
-
-
-
+


+ ); } diff --git a/components/Footer/FooterHonda.js b/components/Footer/FooterHonda.js index 69b800d..ec904bf 100644 --- a/components/Footer/FooterHonda.js +++ b/components/Footer/FooterHonda.js @@ -1,22 +1,17 @@ /*eslint-disable*/ import React from "react"; -// nodejs library to set properties for components import PropTypes from "prop-types"; -// nodejs library that concatenates classes import classNames from "classnames"; -// material-ui core components import { List, ListItem } from "@material-ui/core"; import { makeStyles } from "@material-ui/core/styles"; -// @material-ui/icons import Favorite from "@material-ui/icons/Favorite"; - import GridContainer from "components/Grid/GridContainer.js"; import Grid from '@material-ui/core/Grid'; +import GridItem from "components/Grid/GridItem.js"; import Paper from '@material-ui/core/Paper'; import Card from "components/Card/Card.js"; import styles from "assets/jss/nextjs-material-kit/components/footerStyle.js"; -import NSCB from "assets/img/nscb.png"; const useStyles = makeStyles(styles); @@ -32,97 +27,74 @@ export default function Footer(props) { [classes.footerWhiteFont]: whiteFont }); return ( -

- - - - - - - - - - - - - - - -
- -
-
-
- - -
- © {1900 + new Date().getYear()} , All Right Reserved{" "} by{" "} @Thamrin Group Company + +
+


+
+ +
- - -
+

+
+ + + Home + + + Product + + {/* + YGP + + + Yamalube + + + Apparel + + + Helmet + + + Accessories + + + Service + + + Dealer + */} + + Latest News + + + Carrer + + + About Us + + +
+
+ + + Facebook + + + Instagram + + + Twitter + + + Youtube + + +


+
+ © {1900 + new Date().getYear()} , All Right Reserved{" "} by{" "} @Thamrin Brothers +


+ ); } diff --git a/components/Footer/FooterSuzuki.js b/components/Footer/FooterSuzuki.js index 718ae5a..6dc4a7c 100644 --- a/components/Footer/FooterSuzuki.js +++ b/components/Footer/FooterSuzuki.js @@ -1,25 +1,20 @@ -/*eslint-disable*/ import React from "react"; -// nodejs library to set properties for components import PropTypes from "prop-types"; -// nodejs library that concatenates classes import classNames from "classnames"; -// material-ui core components import { List, ListItem } from "@material-ui/core"; import { makeStyles } from "@material-ui/core/styles"; -// @material-ui/icons import Favorite from "@material-ui/icons/Favorite"; - import GridContainer from "components/Grid/GridContainer.js"; import Grid from '@material-ui/core/Grid'; +import GridItem from "components/Grid/GridItem.js"; import Paper from '@material-ui/core/Paper'; import Card from "components/Card/Card.js"; import styles from "assets/jss/nextjs-material-kit/components/footerStyle.js"; import NSCB from "assets/img/nscb.png"; +import Suzuki from "assets/img/Suzuki.png"; const useStyles = makeStyles(styles); - export default function Footer(props) { const classes = useStyles(); const { whiteFont } = props; @@ -32,97 +27,53 @@ export default function Footer(props) { [classes.footerWhiteFont]: whiteFont }); return ( -

- - - - - - - - - - - - - - - -
- + +
+


+
+ +
- - - - -
- © {1900 + new Date().getYear()} , All Right Reserved{" "} by{" "} @Thamrin Group Company -
-
-
-
+

+
+ + + Home + + + Product + + + Latest News + + + Carrer + + + About Us + + +
+
+ + + Facebook + + + Instagram + + + Twitter + + + Youtube + + +


+
+ © {1900 + new Date().getYear()} , All Right Reserved{" "} by{" "} @Thamrin Brothers +


+ ); } diff --git a/components/Header/HeaderHome.js b/components/Header/HeaderHome.js index e19a310..191dc9f 100644 --- a/components/Header/HeaderHome.js +++ b/components/Header/HeaderHome.js @@ -43,7 +43,7 @@ export default function HeaderHome(props) { - + diff --git a/components/Header/HeaderLinks.js b/components/Header/HeaderLinks.js index be11162..a319591 100644 --- a/components/Header/HeaderLinks.js +++ b/components/Header/HeaderLinks.js @@ -88,6 +88,9 @@ export default function HeaderLinks({ username, ...props }) { Dealers , + + Dealers + , ]} /> diff --git a/lib/apollo.js b/lib/apollo.js index 6f15f3e..6e44f9e 100644 --- a/lib/apollo.js +++ b/lib/apollo.js @@ -68,6 +68,7 @@ async function mutation(mutation, token = "", variables = {}) { }); res = { STATUS: 1, DATA: sql.data }; } catch (e) { + console.log(e); res = { STATUS: 0, DATA: errorHandler(e) }; } return res; diff --git a/package.json b/package.json index e8df28d..7c7bbc0 100644 --- a/package.json +++ b/package.json @@ -65,6 +65,7 @@ "react-datetime": "2.16.3", "react-dom": "16.13.1", "react-html-parser": "^2.0.2", + "react-input-number": "^5.0.19", "react-paginate": "^7.1.0", "react-query": "^3.12.1", "react-select": "^4.2.1", @@ -73,6 +74,7 @@ "rsuite": "^4.9.2", "scss": "^0.2.4", "styled-components": "5.1.0", + "sweetalert": "^2.1.2", "webpack": "4.43.0" } } diff --git a/pages-sections/hino/cart/checkout.js b/pages-sections/hino/cart/checkout.js new file mode 100644 index 0000000..5b4042e --- /dev/null +++ b/pages-sections/hino/cart/checkout.js @@ -0,0 +1,341 @@ +import React from 'react'; +import { makeStyles } from '@material-ui/core/styles'; +import clsx from 'clsx'; + +import SnackbarContent from "components/Snackbar/SnackbarContent.js"; +import Button1 from "components/CustomButtons/Button.js"; +import image1 from "../../../assets/img/mail.png" +import GridContainer from "components/Grid/GridContainer.js"; +import classNames from "classnames"; + +import Icon from "@material-ui/core/Icon"; +import Grid from '@material-ui/core/Grid'; +import TextField from '@material-ui/core/TextField'; +import Button from '@material-ui/core/Button'; +import Dialog from '@material-ui/core/Dialog'; +import ListItemText from '@material-ui/core/ListItemText'; +import ListItem from '@material-ui/core/ListItem'; +import List from '@material-ui/core/List'; +import Divider from '@material-ui/core/Divider'; +import AppBar from '@material-ui/core/AppBar'; +import Toolbar from '@material-ui/core/Toolbar'; +import IconButton from '@material-ui/core/IconButton'; +import Typography from '@material-ui/core/Typography'; +import CloseIcon from '@material-ui/icons/Close'; +import Slide from '@material-ui/core/Slide'; +import FormControl from '@material-ui/core/FormControl'; +import Select from '@material-ui/core/Select'; +import MenuItem from '@material-ui/core/MenuItem'; +import Card from "components/Card/Card.js"; +import CardBody from "components/Card/CardBody.js"; + +const useStyles = makeStyles((theme) => ({ + root: { + width: '100%', + }, + button: { + marginTop: theme.spacing(1), + marginRight: theme.spacing(1), + }, + actionsContainer: { + marginBottom: theme.spacing(2), + }, + resetContainer: { + padding: theme.spacing(3), + }, + appBar: { + position: 'relative', + }, + title: { + marginLeft: theme.spacing(2), + flex: 1, + }, + root: { + '&:hover': { + backgroundColor: 'transparent', + }, + }, + icon: { + borderRadius: '50%', + width: 16, + height: 16, + boxShadow: 'inset 0 0 0 1px rgba(16,22,26,.2), inset 0 -1px 0 rgba(16,22,26,.1)', + backgroundColor: '#f5f8fa', + backgroundImage: 'linear-gradient(180deg,hsla(0,0%,100%,.8),hsla(0,0%,100%,0))', + '$root.Mui-focusVisible &': { + outline: '2px auto rgba(19,124,189,.6)', + outlineOffset: 2, + }, + 'input:hover ~ &': { + backgroundColor: '#ebf1f5', + }, + 'input:disabled ~ &': { + boxShadow: 'none', + background: 'rgba(206,217,224,.5)', + }, + }, + checkedIcon: { + backgroundColor: '#137cbd', + backgroundImage: 'linear-gradient(180deg,hsla(0,0%,100%,.1),hsla(0,0%,100%,0))', + '&:before': { + display: 'block', + width: 16, + height: 16, + backgroundImage: 'radial-gradient(#fff,#fff 28%,transparent 32%)', + content: '""', + }, + 'input:hover ~ &': { + backgroundColor: '#106ba3', + }, + }, +})); + +const Transition = React.forwardRef(function Transition(props, ref) { + return ; +}); + +const DataCheckout = function ({ province, cities, midtransClient, backend, checkoutproduct, transactionToken, ...props }) { + console.log('Token :',transactionToken); + const classes = useStyles(); + const [open, setOpen] = React.useState(false); + const handleClickOpen = () => { + setOpen(true); + }; + const handleClose = () => { + setOpen(false); + }; + const { ...rest } = props; + const imageClasses = classNames( + classes.imgRaised, + classes.imgRoundedCircle, + classes.imgFluid + ); + const navImageClasses = classNames(classes.imgRounded, classes.imgGallery); + + const CheckoutAlamat = checkoutproduct.map((data) => { + return ( +
+ + +
+ + Alamat Pengiriman +

+

+
Yusmar
+
087797315685
+
Thamrin Indrapura Jl.Aipda Karel Satsuit Tubun,17 Ilir, Kec.Ilir Tim.I, Palembang, KOTA PALEMBANG - ILIR TIMUR II, SUMATERA SELATAN, ID 30114
+ + cached + Ubah Alamat + +
+
+
+
+ ); + }) + + const CheckoutProdukPesanan = checkoutproduct.map((data) => { + const handleChange = (event) => { + setAge(event.target.value); + }; + const handleChanges = (event) => { + setPengiriman(event.target.value); + }; + const [age, setAge] = React.useState(''); + const [pengiriman, setPengiriman] = React.useState(''); + return ( +
+ + +
+ + Pesanan Produk +


+ + +
+

Produk Dipesan

+ First slide +
+
+ +
+









+
{data.name}
+
+
+ +
+

Warna







+ + + +
+
+ +
+

Harga Satuan







+
Rp.{data.price}
+
+
+ +
+

Jumlah Unit







+ + + +
+
+ +
+

Sub Total Produk







+
Total Rp.{data.price}
+
+
+
+ + + + +

+ + + + + + + + + Pilih Opsi Pengiriman + + + + + + + + + + + + + + + + + +
+

+ Total Rp. {data.price} +
+
+
+
+
+
+ ); + }) + + return ( +
+