From c10eaa34e8e299b8ce3edb5d2b52697d9036b9e5 Mon Sep 17 00:00:00 2001 From: enggar_ganteng Date: Thu, 3 Jan 2019 00:09:28 +0700 Subject: [PATCH] form search hotel --- assets/images/icon/hotel-icon.png | Bin 0 -> 809 bytes package-lock.json | 5 + package.json | 1 + src/common/pages/App/routes.js | 4 +- src/common/pages/Hotel/HotelSearch.js | 178 +++++++++++ src/common/pages/Hotel/index.js | 416 +++++++++----------------- src/common/routes.js | 3 +- 7 files changed, 337 insertions(+), 270 deletions(-) create mode 100644 assets/images/icon/hotel-icon.png create mode 100644 src/common/pages/Hotel/HotelSearch.js diff --git a/assets/images/icon/hotel-icon.png b/assets/images/icon/hotel-icon.png new file mode 100644 index 0000000000000000000000000000000000000000..4c9f5400e834b5d1d757e51c828ff0911e8d7ea4 GIT binary patch literal 809 zcmeAS@N?(olHy`uVBq!ia0vp^CLqkg1|*MGNWTVBEX7WqAsj$Z!;#Vf4nJ zFq?xgW58xrN1&i&iEBhjaDG}zd16s2LwR|*US?i)adKios$PCk`s{Z$QVa}C%RF5i zLoyoQ&h+*W4U{=nUoY>XIZ>ij!ja;$CQ=C4MnEuvF{$oB(~Ek%Ha-0|xns%SN#8^-^1QZZ@6PD=*tJ2#zgy1G^Xq|@-?tOf z_QzCn7szCkNAm|fE{Sgxd|>)POu}HZecai=1nCVY&!maH);;%u)AP8}t?yp1rj}fn z{%Jkwoad`)SKj2UPr5TDL_c%-lHf_}Dr>)g`s(#{s>l+*pw&yJ=Vea~dH%IuWk$^_ z6W>Y4gi4%$&YHAN?Zq)~ppqAbE)NaY?{~a(nBy$7C-1y2XWxW!ZzT zky8q+1af28_NywcRQ>SF_WpBw=TH1bn?v-!KK^rTZ~LlgkGiehEtC`=it28+>k}<+ z-Q + diff --git a/src/common/pages/Hotel/HotelSearch.js b/src/common/pages/Hotel/HotelSearch.js new file mode 100644 index 0000000..831273f --- /dev/null +++ b/src/common/pages/Hotel/HotelSearch.js @@ -0,0 +1,178 @@ +import React from 'react'; +import {inject, observer} from 'mobx-react'; +import { + RaisedButton +} from 'material-ui'; +import { Affix, Card, Slider, Select, Row, Col, Icon, Tag,Rate, Button, Checkbox } from 'antd'; +import {startCase} from 'lodash'; +import LoadingDialog from "../LoadingDialog"; +import Loader from 'react-loader-advanced'; +import './style.scss'; +import {DIALOG} from "../../stores/global_ui"; +import EmptyComponent from '../EmptyComponent'; + +@inject('appstate') +@observer +export default class HotelSearch extends React.Component { + constructor(props) { + super(props); + this.props = props; + this.state = { + value: 1, + valueMinimal: 0, + valueMaximal: 0, + }; + this.defaultState = Object.assign({}, this.state); + this.http = props.appstate.http; + this.authStore = props.appstate.auth; + this.globalUI = props.appstate.globalUI; + } + + componentDidMount() { + + } + + handleChangeMinimal = (valueMinimal) => { + this.setState({ valueMinimal }); + }; + + handleChangeMaximal = (valueMaximal) => { + this.setState({ valueMaximal }); + }; + + handleBlur = () => { + console.log('blur'); + } + + handleFocus = () => { + console.log('focus'); + } + + + + render() { + const { valueMinimal, valueMaximal } = this.state; + + return ( +
+
+
+ +

Min. Points

+ + +

Max. Points

+ + +

Rating Bintang

+ + +

Fasilitas

+ + + Air Conditioning + Check All + Bar + Business Centre + Coffee Shop + Gym + Internet Access + Pool + Restaurant + Room Service + Wi-Fi Access + + +
+
+ +
+ + + + + example + + + +

Oasis Amir Hotel

+ +

Senen, Jakarta

+
+ Air Conditional + Wi-Fi Access + Restaurant +
+

5,390 Poin

+ + + + +
+
+
+ + + + + + example + + + +

Hotel Aston

+ +

Kuningan, Jakarta

+
+ Air Conditional + Wi-Fi Access + Restaurant + Pool +
+

14,230 Poin

+ + + + +
+
+
+ + + + + example + + + +

Hotel Horision

+ +

Menteng, Jakarta

+
+ Air Conditional + Wi-Fi Access + Restaurant + Pool +
+

20,500 Poin

+ + + + +
+
+
+
+
+ + +
+ ) + } +} diff --git a/src/common/pages/Hotel/index.js b/src/common/pages/Hotel/index.js index a63ca69..ec4910a 100644 --- a/src/common/pages/Hotel/index.js +++ b/src/common/pages/Hotel/index.js @@ -1,311 +1,191 @@ import React from 'react'; import {inject, observer} from 'mobx-react'; import { + AutoComplete, + Avatar, Card, - CardTitle, + CardHeader, + Dialog, Divider, + FlatButton, + FontIcon, + IconMenu, + MenuItem, RaisedButton, - Table, - TableBody, - TableHeader, - TableHeaderColumn, - TableRow, - TableRowColumn, - TextField, - Toolbar, - ToolbarGroup, - ToolbarSeparator, - IconButton, - IconMenu, MenuItem, + SelectField, + TextField } from 'material-ui'; -import {Table as TableAntd} from 'antd'; -import {startCase} from 'lodash'; -import {LINKS} from "../../routes"; -import {Link} from 'react-router-dom'; -import SearchIcon from 'material-ui/svg-icons/action/search'; -import UnarchiveIcon from 'material-ui/svg-icons/content/unarchive'; -import ArchiveIcon from 'material-ui/svg-icons/content/archive'; -import DC from 'decimal.js-light'; -import NumberFormat from 'react-number-format'; -import MoreIcon from 'material-ui/svg-icons/navigation/more-vert'; -import LoadingDialog from "../LoadingDialog"; +import { + Row, + Col, + Select, + DatePicker, + Button, + // Card, + Slider, + // Divider, + Rate, + Checkbox, + Icon, + // Avatar, + Tag} from "antd" +import moment from 'moment'; +import get from 'lodash.get'; import Loader from 'react-loader-advanced'; +import LoadingDialog from "../LoadingDialog"; +import omit from 'lodash.omit'; +import {LINKS} from "../../routes"; + import './style.scss'; -import {DIALOG} from "../../stores/global_ui"; -import EmptyComponent from '../EmptyComponent'; @inject('appstate') @observer -export default class HotelComponent extends React.Component { +export default class CheckSchedule extends React.Component { constructor(props) { super(props); this.props = props; this.state = { - value: 1, - searchText: '', - slideIndex: 0, - filteredInfo: null, - sortedInfo: null, + maskapai: "", + returnDateDisabled: true, + depatureAirport: '', + destinationAirport: '', + adult: 1, + children: 0, + baby: 0, + value: 0, + searchTimeoutId: false, + errorMessageDialog: false, + errorMessage: "", + errorDepature: "", + errorDestination: "", + searchTextArrival: '', + searchTextDeparture: '' }; this.defaultState = Object.assign({}, this.state); this.http = props.appstate.http; this.authStore = props.appstate.auth; + this.appstate = props.appstate; this.globalUI = props.appstate.globalUI; - this.transactionStore = props.appstate.transaction; - this.bankStore = props.appstate.bank; - this.userData = props.appstate.userData; } componentDidMount() { - this.globalUI.openLoading(); - this.transactionStore.getAll().then(res => { - this.globalUI.closeLoading(); - }); - this.transactionStore.getAmount(); - this.bankStore.getByUserID('tesss'); - // this.globalUI.closeLoading(); - // this.authStore.getWallet(); + } - handleUpdateInput = (searchText) => { - this.setState({ - searchText: searchText, - }); - }; + componentWillUnmount() { - handleNewRequest = () => { - this.setState({ - searchText: '', - }); - }; - - tabsHandleChange = (value) => { - this.setState({ - slideIndex: value, - }); - }; - - search = (event)=>{ - if(event.target.value.length == 0){ - this.transactionStore.isSearching = false; - } - else{ - this.transactionStore.isSearching = true; - this.transactionStore.search(event.target.value); - } - }; - - handleChangeSorter = (pagination, filters, sorter) => { - // console.log('Various parameters', pagination, filters, sorter); - this.setState({ - filteredInfo: filters, - sortedInfo: sorter, - }); - }; - - handleChange = (event, index, value) => this.setState({value}); + console.log('COMPONENT GONE'); + } render() { - const undeposit_fund = ; - const balance = ; + const styles = { - const columns = [{ - title: 'Id', - dataIndex: 'id', - key: 'id', - className: 'recentOrder-noOrder', - render: (text) => {{(text.split("-")[0])}}, - }, - { - title: 'Date', - dataIndex: 'created_at', - key: 'created_at', - className: 'recentOrder-noOrder', - render: (text) => ( -
- {moment(text).format('MMM DD, YYYY')} {moment(text).format('hh:mm')} -
- ) + radioButton: { + marginBottom: 16, }, - { - title: 'Type', - dataIndex: 'type', - key: 'type', - className: 'recentOrder-noOrder', - render: (text) => {text.name} - }, - - { - title: 'Status', - dataIndex: 'status', - key: 'status', - className: 'recentOrder-status', - render: (text) =>
{text === 'created' ? 'Waiting Approval' : startCase(text)}
- }, - { - title: 'Amount', - dataIndex: 'amount', - key: 'amount', - className: 'recentOrder-customer bolder green', - render: (text) => { - return - - } - - }]; + }; return ( -
-
-
-
-

Wallet

-
-
- { - (this.transactionStore.saldo.length === 2) ? -
-
- - - +
+ +
+ + } + /> + + } + messageStyle={{textAlign: 'center'}} + backgroundStyle={{backgroundColor: 'rgba(255,255,255,0.5)'}}> +
+
+
+

Where

+ +
+
+

Check-in

+ +
+
+

Check-out

+ +
+
+

Rooms

+ +
-
- - - +
+ +
+ + +
-
- : -
- - - -
- } -
- - - - - - - - - {(window.innerWidth < 600) ? -
- } - anchorOrigin={{horizontal: 'left', vertical: 'top'}} - targetOrigin={{horizontal: 'left', vertical: 'top'}} - > - this.globalUI.showDialog(DIALOG.WALLET.DEPOSIT)}/> - this.globalUI.showDialog(DIALOG.WALLET.WITHDRAW)}/> - -
- : -
- {/*}*/} - {/*label="Deposit"*/} - {/*style={{marginRight: 20}}*/} - {/*onClick={() => this.globalUI.showDialog(DIALOG.WALLET.DEPOSIT)}*/} - {/*primary={true}/>*/} - } - label="Withdraw" - onClick={() => this.globalUI.showDialog(DIALOG.WALLET.WITHDRAW)} - primary={true}/> -
- } +
+
+
+ + {/* { + this.props.history.push(LINKS.HOTEL_SEARCH); + console.log('hotel'); + }} + label="Find Schedule" + primary={true} + fullWidth={(window.innerWidth < 600) ? true : false} + icon={search}/> */} +
+
-
-
- -
- } - messageStyle={{textAlign: 'center'}} - backgroundStyle={{backgroundColor: 'rgba(255,255,255,0.5)'}}> - {` - // return { - // onClick: () => { - // this.props.history.push(`${LINKS.ORDER}/${record.id}`); - // }, // click row - // }; - // }} - /> - {/**/} - {/**/} - {/**/} - {/*Id*/} - {/*Date*/} - {/*Type*/} - {/*Status*/} - {/*Amount*/} - {/**/} - {/**/} - {/**/} - {/*{*/} - {/*(this.transactionStore.isSearching ? this.transactionStore.transactionListFiltered : this.transactionStore.list).map((item, index) => {*/} - - {/*return (*/} - {/**/} - {/**/} - {/*{item.id.split('-')[0]}*/} - {/**/} - {/*{moment(item.created_at).format('MMMM Do YYYY, hh:mm:ss')}*/} - {/*{item.type.name}*/} - {/*{item.status === 'created' ? 'Waiting Approved' : item.status}*/} - {/**/} - {/**/} - {/*);*/} - {/*})*/} - {/*}*/} - {/*{*/} - {/*(this.transactionStore.list.length === 0) ?*/} - {/**/} - {/**/} - {/**/} - {/**/} - {/* : ""*/} - {/*}*/} - {/**/} - {/*
*/} -
-
+ +
- -
) } diff --git a/src/common/routes.js b/src/common/routes.js index f2c472f..511897b 100644 --- a/src/common/routes.js +++ b/src/common/routes.js @@ -106,7 +106,8 @@ export const LINKS = { FEATURED_ITEMS : '/app/featured_banners', CUSTOM_MENU : '/app/custom_menu', PROMOTION:'/app/promotion', - HOTEL:'/app/hotel' + HOTEL:'/app/hotel', + HOTEL_SEARCH:'/app/hotel/search' }; @inject('appstate')