diff --git a/src/common/pages/App/index.js b/src/common/pages/App/index.js index beff73c..2bf011c 100644 --- a/src/common/pages/App/index.js +++ b/src/common/pages/App/index.js @@ -410,6 +410,13 @@ export default class App extends React.Component { className={(this.state.selectedMenu === '/app/shop') ? "menuAkunItem active" : 'menuAkunItem'}>Shop + } + className={(this.state.selectedMenu === '/app/vouchers') ? "menuAkunItem active" : 'menuAkunItem'}>Vouchers + {/* this.openNotification(null, "System Information", "This is your computer locale timezone", "calendar")}>*/} diff --git a/src/common/pages/App/routes.js b/src/common/pages/App/routes.js index 9f991b2..2b37d38 100644 --- a/src/common/pages/App/routes.js +++ b/src/common/pages/App/routes.js @@ -10,6 +10,7 @@ import ReportComponent from './../Report'; import SettingComponent from './../Setting'; import WalletComponent from '../Wallet'; import ItemsComponent from '../Items/index'; +import VouchersComponent from '../Vouchers/index'; import FormItems from "../Items/FormItems/FormItems"; import FormItemAdmin from "../Items/FormItems/FormItemAdmin"; import FormPromotion from "../Items/FormItems/FormPromotion"; @@ -79,6 +80,7 @@ export default class ComponentName extends React.Component { + diff --git a/src/common/pages/Vouchers/All/index.js b/src/common/pages/Vouchers/All/index.js new file mode 100644 index 0000000..6f123d8 --- /dev/null +++ b/src/common/pages/Vouchers/All/index.js @@ -0,0 +1,567 @@ +import React from 'react'; +import {observer, inject} from 'mobx-react'; +import bind from 'bind-decorator'; +import { + Card, + CardActions, + CardHeader, + CardMedia, + CardTitle, + AutoComplete, + CardText, + FlatButton, + Divider, + RaisedButton, + Toolbar, + DatePicker, + FontIcon, + SelectField, + MenuItem, + ToolbarGroup, + FloatingActionButton, + ToolbarSeparator, + IconButton, + ToolbarTitle, + Table, + TableBody, + TableHeader, + TableHeaderColumn, + TableRow, + TableRowColumn, + TextField, + Paper, + RadioButton, + RadioButtonGroup, + DropDownMenu, + Dialog +} from 'material-ui'; +import {withRouter} from 'react-router'; +import {BrowserRouter as Router, Route} from 'react-router-dom'; +import StarBorder from 'material-ui/svg-icons/toggle/star-border'; +import ContentAdd from 'material-ui/svg-icons/content/add'; +import SwipeableViews from 'react-swipeable-views'; +import SearchIcon from 'material-ui/svg-icons/action/search'; +import AddIcon from 'material-ui/svg-icons/content/add'; +import EyeIcon from 'material-ui/svg-icons/image/remove-red-eye'; +import DeleteIcon from 'material-ui/svg-icons/content/delete-sweep'; +import ImageEdit from 'material-ui/svg-icons/image/edit'; +import EmptyComponent from '../../EmptyComponent'; +import LoadingDialog from "../../LoadingDialog"; +import Loader from 'react-loader-advanced'; +import {Row, Col} from 'antd'; + +import '../style.scss'; +import {appConfig} from "../../../config/app"; +import {Link} from 'react-router-dom'; +import {LINKS} from "../../../routes"; +import {ItemCard} from '../ItemCard'; +import InfiniteScroll from 'react-infinite-scroller'; + +@inject('appstate') +@observer +export default class All extends React.Component { + constructor(props) { + super(props);`` + this.props = props; + this.state = { + searchText:'', + value: 0, + statusBanned: "Banned", + statusSoldOut: "Sold Out" + }; + this.handleChange = this + .handleChange + .bind(this); + this.defaultState = Object.assign({}, this.state); + this.http = props.appstate.http; + this.authStore = props.appstate.auth; + this.uiStore = props.appstate.uiStore; + this.userData = props.appstate.userData; + this.globalUI = props.appstate.globalUI; + this.rewardStore = props.appstate.reward; + this.userData = props.appstate.userData; + this.myStoreItem = props.appstate.myStoreItem; + } + + componentDidMount() { + // this.myStoreItem.isSearching = false; + // if(this.userData.role == 'store') { + // this.myStoreItem.getAll(); + // } + // if(this.userData.role == 'administrator') { + // this.myStoreItem.setRequestQuery({user_store_id : this.props.id}); + // console.log('ini id',this.props.id); + // this.myStoreItem.getAll(); + // } + } + + componentWillUnmount(){ + // this.myStoreItem.isSearching = false; + // this.myStoreItem.reset(); + } + + deleteClicked = (id) => { + this.state.id = id; + this.setState({ + openedDelete: true + }); + } + + search = (event)=>{ + console.log("dataSearch",event.target.value); + if(event.target.value.length == 0){ + this.myStoreItem.isSearching = false; + } + else{ + this.myStoreItem.isSearching = true; + this.myStoreItem.search(event.target.value); + } + } + + + handleClickDelete = (id) => { + this.rewardStore.deleteReward(id); + this.setState({ + openedDelete: false, + openSnackbarDelete: true + }); + this.globalUI.openSnackbar("Successful Deleted Existing Reward"); + } + + handleCloseDelete = () => { + this.setState({ + openedDelete: false + }) + } + + handleChange = (event, index, value) => this.setState({value}); + + loadMore = ()=>{ + console.log('RUNNss'); + if(this.myStoreItem.data.length > 0){ + this.myStoreItem.nextPage(true); + } + } + + render() { + + const data = [ + { + category_id: "1e444a5a-cf4d-48e5-bde4-0f984ebd557d", + created_at: "2019-01-02T04:00:08.803Z", + custom_fields: null, + deleted_at: null, + description: null, + height: "0.00", + id: "7e3072c1-9bfd-4b52-af38-9c6e30456c73", + images: {main: "https://marketplace-sillyfish-api.asacreative.com/uploads/item_123634.png", gallery: ["https://marketplace-sillyfish-api.asacreative.com/uploads/item_123634.png"]}, + item_status_id: "2b1a2598-8333-4b19-ae7b-c054bec87540", + length: "0.00", + name: "Silly Oregano Seasoning", + odoo_additional_data: {product_id: 205, product_uom: 21, product_tmpl_id: 291}, + product_id: 205, + product_tmpl_id: 291, + product_uom: 21, + odoo_stock_id: 123634, + order: 147291, + preorder: null, + regular_price: "10", + sale_date_from: null, + sale_date_to: null, + sale_price: null, + seen: 0, + sold: 0, + stock: "34.00", + uom: "pack", + updated_at: "2019-01-02T13:00:05.042Z", + use_weight_as_stock: false, + user_store_id: "959194a0-7067-400c-b354-2e8d03300660", + visible: true, + weight: "0.04", + width: "0.00", + wishlist: "0", + },{ + category_id: "1e444a5a-cf4d-48e5-bde4-0f984ebd557d", + created_at: "2019-01-02T04:00:08.803Z", + custom_fields: null, + deleted_at: null, + description: null, + height: "0.00", + id: "7e3072c1-9bfd-4b52-af38-9c6e30456c73", + images: {main: "https://marketplace-sillyfish-api.asacreative.com/uploads/item_123634.png", gallery: ["https://marketplace-sillyfish-api.asacreative.com/uploads/item_123634.png"]}, + item_status_id: "2b1a2598-8333-4b19-ae7b-c054bec87540", + length: "0.00", + name: "Silly Oregano Seasoning", + odoo_additional_data: {product_id: 205, product_uom: 21, product_tmpl_id: 291}, + product_id: 205, + product_tmpl_id: 291, + product_uom: 21, + odoo_stock_id: 123634, + order: 147291, + preorder: null, + regular_price: "10", + sale_date_from: null, + sale_date_to: null, + sale_price: null, + seen: 0, + sold: 0, + stock: "34.00", + uom: "pack", + updated_at: "2019-01-02T13:00:05.042Z", + use_weight_as_stock: false, + user_store_id: "959194a0-7067-400c-b354-2e8d03300660", + visible: true, + weight: "0.04", + width: "0.00", + wishlist: "0", + },{ + category_id: "1e444a5a-cf4d-48e5-bde4-0f984ebd557d", + created_at: "2019-01-02T04:00:08.803Z", + custom_fields: null, + deleted_at: null, + description: null, + height: "0.00", + id: "7e3072c1-9bfd-4b52-af38-9c6e30456c73", + images: {main: "https://marketplace-sillyfish-api.asacreative.com/uploads/item_123634.png", gallery: ["https://marketplace-sillyfish-api.asacreative.com/uploads/item_123634.png"]}, + item_status_id: "2b1a2598-8333-4b19-ae7b-c054bec87540", + length: "0.00", + name: "Silly Oregano Seasoning", + odoo_additional_data: {product_id: 205, product_uom: 21, product_tmpl_id: 291}, + product_id: 205, + product_tmpl_id: 291, + product_uom: 21, + odoo_stock_id: 123634, + order: 147291, + preorder: null, + regular_price: "10", + sale_date_from: null, + sale_date_to: null, + sale_price: null, + seen: 0, + sold: 0, + stock: "34.00", + uom: "pack", + updated_at: "2019-01-02T13:00:05.042Z", + use_weight_as_stock: false, + user_store_id: "959194a0-7067-400c-b354-2e8d03300660", + visible: true, + weight: "0.04", + width: "0.00", + wishlist: "0", + },{ + category_id: "1e444a5a-cf4d-48e5-bde4-0f984ebd557d", + created_at: "2019-01-02T04:00:08.803Z", + custom_fields: null, + deleted_at: null, + description: null, + height: "0.00", + id: "7e3072c1-9bfd-4b52-af38-9c6e30456c73", + images: {main: "https://marketplace-sillyfish-api.asacreative.com/uploads/item_123634.png", gallery: ["https://marketplace-sillyfish-api.asacreative.com/uploads/item_123634.png"]}, + item_status_id: "2b1a2598-8333-4b19-ae7b-c054bec87540", + length: "0.00", + name: "Silly Oregano Seasoning", + odoo_additional_data: {product_id: 205, product_uom: 21, product_tmpl_id: 291}, + product_id: 205, + product_tmpl_id: 291, + product_uom: 21, + odoo_stock_id: 123634, + order: 147291, + preorder: null, + regular_price: "10", + sale_date_from: null, + sale_date_to: null, + sale_price: null, + seen: 0, + sold: 0, + stock: "34.00", + uom: "pack", + updated_at: "2019-01-02T13:00:05.042Z", + use_weight_as_stock: false, + user_store_id: "959194a0-7067-400c-b354-2e8d03300660", + visible: true, + weight: "0.04", + width: "0.00", + wishlist: "0", + },{ + category_id: "1e444a5a-cf4d-48e5-bde4-0f984ebd557d", + created_at: "2019-01-02T04:00:08.803Z", + custom_fields: null, + deleted_at: null, + description: null, + height: "0.00", + id: "7e3072c1-9bfd-4b52-af38-9c6e30456c73", + images: {main: "https://marketplace-sillyfish-api.asacreative.com/uploads/item_123634.png", gallery: ["https://marketplace-sillyfish-api.asacreative.com/uploads/item_123634.png"]}, + item_status_id: "2b1a2598-8333-4b19-ae7b-c054bec87540", + length: "0.00", + name: "Silly Oregano Seasoning", + odoo_additional_data: {product_id: 205, product_uom: 21, product_tmpl_id: 291}, + product_id: 205, + product_tmpl_id: 291, + product_uom: 21, + odoo_stock_id: 123634, + order: 147291, + preorder: null, + regular_price: "10", + sale_date_from: null, + sale_date_to: null, + sale_price: null, + seen: 0, + sold: 0, + stock: "34.00", + uom: "pack", + updated_at: "2019-01-02T13:00:05.042Z", + use_weight_as_stock: false, + user_store_id: "959194a0-7067-400c-b354-2e8d03300660", + visible: true, + weight: "0.04", + width: "0.00", + wishlist: "0", + },{ + category_id: "1e444a5a-cf4d-48e5-bde4-0f984ebd557d", + created_at: "2019-01-02T04:00:08.803Z", + custom_fields: null, + deleted_at: null, + description: null, + height: "0.00", + id: "7e3072c1-9bfd-4b52-af38-9c6e30456c73", + images: {main: "https://marketplace-sillyfish-api.asacreative.com/uploads/item_123634.png", gallery: ["https://marketplace-sillyfish-api.asacreative.com/uploads/item_123634.png"]}, + item_status_id: "2b1a2598-8333-4b19-ae7b-c054bec87540", + length: "0.00", + name: "Silly Oregano Seasoning", + odoo_additional_data: {product_id: 205, product_uom: 21, product_tmpl_id: 291}, + product_id: 205, + product_tmpl_id: 291, + product_uom: 21, + odoo_stock_id: 123634, + order: 147291, + preorder: null, + regular_price: "10", + sale_date_from: null, + sale_date_to: null, + sale_price: null, + seen: 0, + sold: 0, + stock: "34.00", + uom: "pack", + updated_at: "2019-01-02T13:00:05.042Z", + use_weight_as_stock: false, + user_store_id: "959194a0-7067-400c-b354-2e8d03300660", + visible: true, + weight: "0.04", + width: "0.00", + wishlist: "0", + },{ + category_id: "1e444a5a-cf4d-48e5-bde4-0f984ebd557d", + created_at: "2019-01-02T04:00:08.803Z", + custom_fields: null, + deleted_at: null, + description: null, + height: "0.00", + id: "7e3072c1-9bfd-4b52-af38-9c6e30456c73", + images: {main: "https://marketplace-sillyfish-api.asacreative.com/uploads/item_123634.png", gallery: ["https://marketplace-sillyfish-api.asacreative.com/uploads/item_123634.png"]}, + item_status_id: "2b1a2598-8333-4b19-ae7b-c054bec87540", + length: "0.00", + name: "Silly Oregano Seasoning", + odoo_additional_data: {product_id: 205, product_uom: 21, product_tmpl_id: 291}, + product_id: 205, + product_tmpl_id: 291, + product_uom: 21, + odoo_stock_id: 123634, + order: 147291, + preorder: null, + regular_price: "10", + sale_date_from: null, + sale_date_to: null, + sale_price: null, + seen: 0, + sold: 0, + stock: "34.00", + uom: "pack", + updated_at: "2019-01-02T13:00:05.042Z", + use_weight_as_stock: false, + user_store_id: "959194a0-7067-400c-b354-2e8d03300660", + visible: true, + weight: "0.04", + width: "0.00", + wishlist: "0", + },{ + category_id: "1e444a5a-cf4d-48e5-bde4-0f984ebd557d", + created_at: "2019-01-02T04:00:08.803Z", + custom_fields: null, + deleted_at: null, + description: null, + height: "0.00", + id: "7e3072c1-9bfd-4b52-af38-9c6e30456c73", + images: {main: "https://marketplace-sillyfish-api.asacreative.com/uploads/item_123634.png", gallery: ["https://marketplace-sillyfish-api.asacreative.com/uploads/item_123634.png"]}, + item_status_id: "2b1a2598-8333-4b19-ae7b-c054bec87540", + length: "0.00", + name: "Silly Oregano Seasoning", + odoo_additional_data: {product_id: 205, product_uom: 21, product_tmpl_id: 291}, + product_id: 205, + product_tmpl_id: 291, + product_uom: 21, + odoo_stock_id: 123634, + order: 147291, + preorder: null, + regular_price: "10", + sale_date_from: null, + sale_date_to: null, + sale_price: null, + seen: 0, + sold: 0, + stock: "34.00", + uom: "pack", + updated_at: "2019-01-02T13:00:05.042Z", + use_weight_as_stock: false, + user_store_id: "959194a0-7067-400c-b354-2e8d03300660", + visible: true, + weight: "0.04", + width: "0.00", + wishlist: "0", + },{ + category_id: "1e444a5a-cf4d-48e5-bde4-0f984ebd557d", + created_at: "2019-01-02T04:00:08.803Z", + custom_fields: null, + deleted_at: null, + description: null, + height: "0.00", + id: "7e3072c1-9bfd-4b52-af38-9c6e30456c73", + images: {main: "https://marketplace-sillyfish-api.asacreative.com/uploads/item_123634.png", gallery: ["https://marketplace-sillyfish-api.asacreative.com/uploads/item_123634.png"]}, + item_status_id: "2b1a2598-8333-4b19-ae7b-c054bec87540", + length: "0.00", + name: "Silly Oregano Seasoning", + odoo_additional_data: {product_id: 205, product_uom: 21, product_tmpl_id: 291}, + product_id: 205, + product_tmpl_id: 291, + product_uom: 21, + odoo_stock_id: 123634, + order: 147291, + preorder: null, + regular_price: "10", + sale_date_from: null, + sale_date_to: null, + sale_price: null, + seen: 0, + sold: 0, + stock: "34.00", + uom: "pack", + updated_at: "2019-01-02T13:00:05.042Z", + use_weight_as_stock: false, + user_store_id: "959194a0-7067-400c-b354-2e8d03300660", + visible: true, + weight: "0.04", + width: "0.00", + wishlist: "0", + } + ]; + + const actionsDelete = [ + , + this.handleClickDelete(this.state.id)} + />, + ]; + + return ( + + + + + + + + + + {/**/} + {/**/} + {/**/} + {/*} label="New Items"*/} + {/*primary={true}/>*/} + {/**/} + {/**/} + + + {/**/} + {/*}*/} + {/*messageStyle={{textAlign: 'center'}} backgroundStyle={{backgroundColor: 'rgba(255,255,255,0.5)'}}>*/} + + {/**/} + {/**/} + this.handleCloseDelete()} + > + Are you sure want to delete this data? + + + + + + + + {(this.userData.role === 'store' && this.userData.entity_permission.can_store_change_item) ? + + + + + add + + Add new item + + + : "" + } + + {(this.userData.role === 'administrator') ? + + + + + add + + Add new item + + + : "" + } + + {data.map(item => { + return ( + + ) + })} + + + + + ) + } +} + diff --git a/src/common/pages/Vouchers/ItemCard/index.js b/src/common/pages/Vouchers/ItemCard/index.js new file mode 100644 index 0000000..44ce089 --- /dev/null +++ b/src/common/pages/Vouchers/ItemCard/index.js @@ -0,0 +1,99 @@ +import React from 'react'; +import {inject, observer} from 'mobx-react'; +import { + Card, + CardMedia, + CardTitle, + CardText, + FontIcon, +} from 'material-ui'; +import NumberFormat from 'react-number-format'; +import {Link} from 'react-router-dom'; +import {LINKS} from "../../../routes"; +import {appConfig} from "../../../config/app"; +import get from 'lodash.get'; + +@inject('appstate') +@observer +export class ItemCard extends React.Component { + constructor(props) { + super(props); + this.props = props; + this.state = {}; + this.defaultState = Object.assign({}, this.state); + + this.http = props.appstate.http; + } + + componentDidMount() { + // console.log('ItemCard'); + } + + render() { + const {data = {}} = this.props; + const main = get(data,'images.main',null); + // const mainImage = this.http.appendImagePath(main); + const mainImage = main; + + return ( + + + + + + {/**/} + + {(data.name.length > 14) ? data.name.substring(0,13)+`...` : data.name}} titleStyle={{fontWeight: 'bold', fontSize: 18, lineHeight: '30px', whiteSpace: 'nowrap'}} + subtitle={{data.regular_price} Points}/> + {/*{(data.name.length > 14) ? data.name.substring(0,13)+`...` : data.name}} titleStyle={{fontWeight: 'bold', fontSize: 18, lineHeight: '30px', whiteSpace: 'nowrap'}}*/} + {/*subtitle={}/>*/} + + {/**/} + {/*{data.name}*/} + {/**/} + {/**/} + {/*Stock{data.stock}*/} + {/**/} + {/**/} + + + Stock : {+data.stock} {data.uom} + + + + + + remove_red_eye : {data.seen} + + + favorite_border : {data.wishlist} + + Sold + : {data.sold} + + + + + + ) + } + +} diff --git a/src/common/pages/Vouchers/index.js b/src/common/pages/Vouchers/index.js new file mode 100644 index 0000000..d752e9a --- /dev/null +++ b/src/common/pages/Vouchers/index.js @@ -0,0 +1,86 @@ +import React from 'react'; +import {inject, observer} from 'mobx-react'; +import {Link} from 'react-router'; +import { Affix, Card, Slider, Select } from 'antd'; +import {Tab, Tabs} from 'material-ui'; +import './style.scss'; +import All from "./All/index"; + +const Option = Select.Option; +@inject('appstate') +@observer +export default class VouchersComponent extends React.Component { + constructor(props) { + super(props); + this.props = props; + this.state = { + valueMinimal: 0, + valueMaximal: 0, + }; + this.defaultState = Object.assign({}, this.state); + } + + componentDidMount() { + } + + handleChangeMinimal = (valueMinimal) => { + this.setState({ valueMinimal }); + }; + + handleChangeMaximal = (valueMaximal) => { + this.setState({ valueMaximal }); + }; + + handleChange = (value) => { + console.log(`selected ${value}`); + } + + handleBlur = () => { + console.log('blur'); + } + + handleFocus = () => { + console.log('focus'); + } + + render() { + const { valueMinimal, valueMaximal } = this.state; + + return ( + + + + + + Min. Points + + + Max. Points + + + Category + option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0} + > + Electronic + Fashion + Food + + + + + + + + + + ) + } +} diff --git a/src/common/pages/Vouchers/style.scss b/src/common/pages/Vouchers/style.scss new file mode 100644 index 0000000..6d4e533 --- /dev/null +++ b/src/common/pages/Vouchers/style.scss @@ -0,0 +1,67 @@ +.setting { + margin-top: 35px; + .container { + padding: 25px; + + .ant-card { + background: #fff; + border-radius: 0; + font-size: 12px; + position: relative; + overflow: hidden; + transition: all .3s; + } + .ant-card-head { + height: 48px; + line-height: 48px; + background: #fff; + border-bottom: 0 solid #e9e9e9; + padding: 0 24px; + } + .ant-card:hover { + box-shadow: 4px 4px 40px rgba(0, 0, 0, .05); + border-color: transparent; + } + .ant-card-body-dashboard { + padding: 10px; + } + } + + + .label-form { + font-size: 14px; + line-height: 30px; + color: rgb(153, 153, 153); + text-shadow: rgb(255, 255, 255) 0px 1px 0px; + margin-bottom: -8px; + } + + .backgroundImage { + height: 182px; + background-image: url('/assets/images/material3.jpg'); + background-position: center; + background-size: cover; + cursor: pointer; + min-height: 75px; + position: relative; + width: 100%; + } + + } + + .photo-title{ + font-size: 1.25em; + font-weight: 400; + margin-left: 12px; + margin-top: 10px; + margin-bottom: 0; + } + + .box-upload{ + width: 100%; + height: 500px; + } + + + + \ No newline at end of file diff --git a/src/common/routes.js b/src/common/routes.js index de699c1..b0bb2bc 100644 --- a/src/common/routes.js +++ b/src/common/routes.js @@ -109,7 +109,8 @@ export const LINKS = { HOTEL:'/app/hotel', HOTEL_SEARCH:'/app/hotel/search', CAR:'/app/car', - CAR_SEARCH:'/app/car/search' + CAR_SEARCH:'/app/car/search', + VOUCHERS: '/app/vouchers', }; @inject('appstate')
{data.name}
Min. Points
Max. Points
Category