feat: initial commit for mockup bukopin
This commit is contained in:
parent
0ebe039eda
commit
9f0c68b2ce
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -49,3 +49,5 @@ settings.json
|
||||||
dist/
|
dist/
|
||||||
|
|
||||||
public/assets
|
public/assets
|
||||||
|
public/static/**/*.js
|
||||||
|
public/static/**/*.js.map
|
||||||
|
|
BIN
assets/images/kb_bukopin.jpeg
Normal file
BIN
assets/images/kb_bukopin.jpeg
Normal file
Binary file not shown.
After Width: | Height: | Size: 56 KiB |
13
package-lock.json
generated
13
package-lock.json
generated
|
@ -4377,11 +4377,6 @@
|
||||||
"resolved": "https://registry.npmjs.org/command-exists/-/command-exists-1.2.8.tgz",
|
"resolved": "https://registry.npmjs.org/command-exists/-/command-exists-1.2.8.tgz",
|
||||||
"integrity": "sha512-PM54PkseWbiiD/mMsbvW351/u+dafwTJ0ye2qB60G1aGQP9j3xK2gmMDc+R34L3nDtx4qMCitXT75mkbkGJDLw=="
|
"integrity": "sha512-PM54PkseWbiiD/mMsbvW351/u+dafwTJ0ye2qB60G1aGQP9j3xK2gmMDc+R34L3nDtx4qMCitXT75mkbkGJDLw=="
|
||||||
},
|
},
|
||||||
"commander": {
|
|
||||||
"version": "2.2.0",
|
|
||||||
"resolved": "http://registry.npmjs.org/commander/-/commander-2.2.0.tgz",
|
|
||||||
"integrity": "sha1-F1rUuTF/P/YV8gHB5XIk9Vo+kd8="
|
|
||||||
},
|
|
||||||
"commondir": {
|
"commondir": {
|
||||||
"version": "1.0.1",
|
"version": "1.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz",
|
||||||
|
@ -11914,14 +11909,6 @@
|
||||||
"resolved": "https://registry.npmjs.org/numbro/-/numbro-1.11.1.tgz",
|
"resolved": "https://registry.npmjs.org/numbro/-/numbro-1.11.1.tgz",
|
||||||
"integrity": "sha512-qL0Etqbunz4RtPx4bNjMONe9HyUpgbrM4Sa3VpWY5oRdp9ry5DufAj6lCvnIcluRBA9QUacrllYc73QK0G6VAw=="
|
"integrity": "sha512-qL0Etqbunz4RtPx4bNjMONe9HyUpgbrM4Sa3VpWY5oRdp9ry5DufAj6lCvnIcluRBA9QUacrllYc73QK0G6VAw=="
|
||||||
},
|
},
|
||||||
"nwbuild": {
|
|
||||||
"version": "0.0.5",
|
|
||||||
"resolved": "https://registry.npmjs.org/nwbuild/-/nwbuild-0.0.5.tgz",
|
|
||||||
"integrity": "sha1-9Gc+85BMJzqxzaX0/fx8D4qEpAM=",
|
|
||||||
"requires": {
|
|
||||||
"commander": "2.2.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"oauth-sign": {
|
"oauth-sign": {
|
||||||
"version": "0.9.0",
|
"version": "0.9.0",
|
||||||
"resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz",
|
"resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz",
|
||||||
|
|
|
@ -90,7 +90,6 @@
|
||||||
"mobx-react": "^5.4.3",
|
"mobx-react": "^5.4.3",
|
||||||
"mobx-react-devtools": "^6.0.3",
|
"mobx-react-devtools": "^6.0.3",
|
||||||
"moment": "^2.24.0",
|
"moment": "^2.24.0",
|
||||||
"nwbuild": "0.0.5",
|
|
||||||
"parcel-bundler": "^1.11.0",
|
"parcel-bundler": "^1.11.0",
|
||||||
"prop-types": "^15.6.2",
|
"prop-types": "^15.6.2",
|
||||||
"raw-loader": "^0.5.1",
|
"raw-loader": "^0.5.1",
|
||||||
|
|
568088
public/static/bundle.js
568088
public/static/bundle.js
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -24,13 +24,13 @@ let type = 'akuntiket';
|
||||||
// apiUrl = "https://marketplace-sillyfish-api.asacreative.com/v1/";
|
// apiUrl = "https://marketplace-sillyfish-api.asacreative.com/v1/";
|
||||||
// imageUrl = "https://marketplace-sillyfish-api.asacreative.com";
|
// imageUrl = "https://marketplace-sillyfish-api.asacreative.com";
|
||||||
|
|
||||||
apiUrl = "https://giift-api.asacreative.com/";
|
apiUrl = "https://herbal-backend.k3s.bangun-kreatif.com/v1/";
|
||||||
imageUrl = "https://giift-api.asacreative.com";
|
imageUrl = "https://herbal-backend.k3s.bangun-kreatif.com/v1/";
|
||||||
|
|
||||||
type = 'localhost';
|
type = 'localhost';
|
||||||
if(window.location.href.includes("localhost") || window.location.href.includes("marketplace-store")){
|
if(window.location.href.includes("localhost") || window.location.href.includes("marketplace-store")){
|
||||||
// appUrl = 'http://localhost:7700';
|
// appUrl = 'http://localhost:7700';
|
||||||
apiUrl = "https://giift-api.asacreative.com/";
|
// apiUrl = "https://giift-api.asacreative.com/";
|
||||||
// apiUrl = "http://localhost:4001/"
|
// apiUrl = "http://localhost:4001/"
|
||||||
}else{
|
}else{
|
||||||
// appUrl = 'https://sillyfish.asacreative.com';
|
// appUrl = 'https://sillyfish.asacreative.com';
|
||||||
|
|
|
@ -20,7 +20,7 @@ import {
|
||||||
// Drawer,
|
// Drawer,
|
||||||
// List,
|
// List,
|
||||||
// ListItem,
|
// ListItem,
|
||||||
// IconMenu,
|
IconMenu,
|
||||||
// IconButton,
|
// IconButton,
|
||||||
// MenuItem,
|
// MenuItem,
|
||||||
DropDownMenu,
|
DropDownMenu,
|
||||||
|
@ -29,8 +29,8 @@ import {
|
||||||
Dialog,
|
Dialog,
|
||||||
Snackbar,
|
Snackbar,
|
||||||
// Toolbar,
|
// Toolbar,
|
||||||
// ToolbarGroup,
|
ToolbarGroup,
|
||||||
// ToolbarSeparator,
|
ToolbarSeparator,
|
||||||
// ToolbarTitle,
|
// ToolbarTitle,
|
||||||
// Badge
|
// Badge
|
||||||
} from 'material-ui';
|
} from 'material-ui';
|
||||||
|
@ -373,8 +373,8 @@ class App extends React.Component {
|
||||||
let applicationIcon = require('../../../../assets/images/logo_new.png');
|
let applicationIcon = require('../../../../assets/images/logo_new.png');
|
||||||
let applicationName = 'Giift';
|
let applicationName = 'Giift';
|
||||||
if (APP_TYPE === 'btn') {
|
if (APP_TYPE === 'btn') {
|
||||||
applicationIcon = "http://btn-redemption-2.bangun-kreatif.com/dr6u0fppdi4xy.cloudfront.net/FilesDirectory/Albilad/ImgIconImage/logo-btn.png";
|
applicationIcon = "https://www.niaga.asia/wp-content/uploads/2021/02/IMG-20210223-WA0025.jpg";
|
||||||
applicationName = "BTN";
|
applicationName = "KB Bukopin";
|
||||||
}
|
}
|
||||||
|
|
||||||
let onNotifRowClick = (record) => {
|
let onNotifRowClick = (record) => {
|
||||||
|
|
|
@ -26,7 +26,7 @@ import {lowerCase,debounce} from 'lodash';
|
||||||
// import 'froala-editor/css/froala_style.min.css';
|
// import 'froala-editor/css/froala_style.min.css';
|
||||||
// import 'froala-editor/css/froala_editor.pkgd.min.css';
|
// import 'froala-editor/css/froala_editor.pkgd.min.css';
|
||||||
const $ = require("jquery");
|
const $ = require("jquery");
|
||||||
require("froala-editor/js/froala_editor.pkgd.min.js")($);
|
// require("froala-editor/js/froala_editor.pkgd.min.js")($);
|
||||||
window.$ = window.jQuery = $;
|
window.$ = window.jQuery = $;
|
||||||
// require("froala-editor/js/froala_editor.pkgd.min.js")($);
|
// require("froala-editor/js/froala_editor.pkgd.min.js")($);
|
||||||
// require("froala-editor/js/plugins/code_view.min.js")($);
|
// require("froala-editor/js/plugins/code_view.min.js")($);
|
||||||
|
|
|
@ -46,7 +46,7 @@ export default class LoginComponent extends React.Component {
|
||||||
|
|
||||||
let loginImage = 'http://giift.asacreative.com/giift_logo_wide.4d15de72.png';
|
let loginImage = 'http://giift.asacreative.com/giift_logo_wide.4d15de72.png';
|
||||||
if(APP_TYPE === 'btn') {
|
if(APP_TYPE === 'btn') {
|
||||||
loginImage = 'http://btn-redemption-2.bangun-kreatif.com/dr6u0fppdi4xy.cloudfront.net/FilesDirectory/Albilad/ImgIconImage/logo-btn.png'
|
loginImage = 'https://www.niaga.asia/wp-content/uploads/2021/02/IMG-20210223-WA0025.jpg'
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<div className="loginWrapper">
|
<div className="loginWrapper">
|
||||||
|
|
|
@ -30,7 +30,7 @@ export const styles = theme => ({
|
||||||
},
|
},
|
||||||
logoContainer : {
|
logoContainer : {
|
||||||
textAlign : 'center',
|
textAlign : 'center',
|
||||||
background : yellow['500'],
|
background : '#FAAF03',
|
||||||
padding : 20
|
padding : 20
|
||||||
}
|
}
|
||||||
});
|
});
|
|
@ -358,7 +358,7 @@ class RegisterPage extends React.Component {
|
||||||
|
|
||||||
<Grid container spacing={0} className={classes.gridContainer}>
|
<Grid container spacing={0} className={classes.gridContainer}>
|
||||||
<Grid item cols={12} className={classes.logoContainer}>
|
<Grid item cols={12} className={classes.logoContainer}>
|
||||||
<img src={require('../../../../assets/images/logo_new.png')} className={classes.logo} />
|
<img src={require('../../../../assets/images/kb_bukopin.jpeg')} className={classes.logo} />
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item xs={12} sm={12} md={10} lg={10} className={classes.registerContainer} style={{
|
<Grid item xs={12} sm={12} md={10} lg={10} className={classes.registerContainer} style={{
|
||||||
alignSelf: 'center'
|
alignSelf: 'center'
|
||||||
|
@ -368,10 +368,10 @@ class RegisterPage extends React.Component {
|
||||||
<Grid item xs={5}>
|
<Grid item xs={5}>
|
||||||
<img src={require('../../../../assets/images/register_image_2.png')} width={"80%"} />
|
<img src={require('../../../../assets/images/register_image_2.png')} width={"80%"} />
|
||||||
<Typography style={{ color: '#FFF' }} variant={"h6"}>
|
<Typography style={{ color: '#FFF' }} variant={"h6"}>
|
||||||
Selamat Datang di BTN Shop!
|
Selamat Datang di Bukopin Shop!
|
||||||
</Typography>
|
</Typography>
|
||||||
<Typography style={{ color: '#FFF' }} variant={"subtitle2"}>
|
<Typography style={{ color: '#FFF' }} variant={"subtitle2"}>
|
||||||
Dapatkan promo dan keuntungan lebih dari BTN!
|
Dapatkan promo dan keuntungan lebih dari Bukopin!
|
||||||
</Typography>
|
</Typography>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Hidden>
|
</Hidden>
|
||||||
|
|
|
@ -31,7 +31,7 @@ export const styles = theme => ({
|
||||||
},
|
},
|
||||||
logoContainer : {
|
logoContainer : {
|
||||||
textAlign : 'center',
|
textAlign : 'center',
|
||||||
background : yellow['500'],
|
background : '#FAAF03',
|
||||||
padding : 20
|
padding : 20
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
|
@ -40,7 +40,7 @@ export default class ItemList extends React.Component {
|
||||||
<p className={'transactionDate'}>{moment(data.updated_at).format("dddd, MMMM Do YYYY, HH:mm:ss")}</p>
|
<p className={'transactionDate'}>{moment(data.updated_at).format("dddd, MMMM Do YYYY, HH:mm:ss")}</p>
|
||||||
</div>
|
</div>
|
||||||
<div className={'bodyContainer'}>
|
<div className={'bodyContainer'}>
|
||||||
<p className={'nameText'}>{data.item.name + " : " + data.item_sku.name}</p>
|
<p className={'nameText'}>{data.item.name}</p>
|
||||||
<div className={'childContainer'}>
|
<div className={'childContainer'}>
|
||||||
<p className={'childTitle'}>Price</p>
|
<p className={'childTitle'}>Price</p>
|
||||||
<p className={'childText'}>{(+data.item_sku.price).toFixed(0)} Points</p>
|
<p className={'childText'}>{(+data.item_sku.price).toFixed(0)} Points</p>
|
||||||
|
|
|
@ -29,8 +29,15 @@ export default class TransactionPage extends React.Component {
|
||||||
created_at: moment(faker.date.past()).format("dddd, MMMM Do YYYY, HH:mm:ss"),
|
created_at: moment(faker.date.past()).format("dddd, MMMM Do YYYY, HH:mm:ss"),
|
||||||
updated_at: moment(faker.date.past()).format("dddd, MMMM Do YYYY, HH:mm:ss"),
|
updated_at: moment(faker.date.past()).format("dddd, MMMM Do YYYY, HH:mm:ss"),
|
||||||
deleted_at: null,
|
deleted_at: null,
|
||||||
|
item: {
|
||||||
name: faker.commerce.productName(),
|
name: faker.commerce.productName(),
|
||||||
|
},
|
||||||
|
item_sku: {
|
||||||
|
name: faker.commerce.productName(),
|
||||||
|
},
|
||||||
|
transaction: {
|
||||||
status: 'Transaction Success',
|
status: 'Transaction Success',
|
||||||
|
},
|
||||||
price: faker.commerce.price(),
|
price: faker.commerce.price(),
|
||||||
voucher_code: `${faker.random.alphaNumeric(5).toUpperCase()} - ${faker.random.alphaNumeric(5).toUpperCase()} - ${faker.random.alphaNumeric(5).toUpperCase()} - ${faker.random.alphaNumeric(5).toUpperCase()} - ${faker.random.alphaNumeric(5).toUpperCase()}`,
|
voucher_code: `${faker.random.alphaNumeric(5).toUpperCase()} - ${faker.random.alphaNumeric(5).toUpperCase()} - ${faker.random.alphaNumeric(5).toUpperCase()} - ${faker.random.alphaNumeric(5).toUpperCase()} - ${faker.random.alphaNumeric(5).toUpperCase()}`,
|
||||||
},
|
},
|
||||||
|
@ -39,31 +46,18 @@ export default class TransactionPage extends React.Component {
|
||||||
created_at: moment(faker.date.past()).format("dddd, MMMM Do YYYY, HH:mm:ss"),
|
created_at: moment(faker.date.past()).format("dddd, MMMM Do YYYY, HH:mm:ss"),
|
||||||
updated_at: moment(faker.date.past()).format("dddd, MMMM Do YYYY, HH:mm:ss"),
|
updated_at: moment(faker.date.past()).format("dddd, MMMM Do YYYY, HH:mm:ss"),
|
||||||
deleted_at: null,
|
deleted_at: null,
|
||||||
|
item: {
|
||||||
name: faker.commerce.productName(),
|
name: faker.commerce.productName(),
|
||||||
|
},
|
||||||
|
item_sku: {
|
||||||
|
name: faker.commerce.productName(),
|
||||||
|
},
|
||||||
|
transaction: {
|
||||||
status: 'Transaction Success',
|
status: 'Transaction Success',
|
||||||
|
},
|
||||||
price: faker.commerce.price(),
|
price: faker.commerce.price(),
|
||||||
voucher_code: `${faker.random.alphaNumeric(5).toUpperCase()} - ${faker.random.alphaNumeric(5).toUpperCase()} - ${faker.random.alphaNumeric(5).toUpperCase()} - ${faker.random.alphaNumeric(5).toUpperCase()} - ${faker.random.alphaNumeric(5).toUpperCase()}`,
|
voucher_code: `${faker.random.alphaNumeric(5).toUpperCase()} - ${faker.random.alphaNumeric(5).toUpperCase()} - ${faker.random.alphaNumeric(5).toUpperCase()} - ${faker.random.alphaNumeric(5).toUpperCase()} - ${faker.random.alphaNumeric(5).toUpperCase()}`,
|
||||||
},
|
}
|
||||||
{
|
|
||||||
transaction_id: `INV/20190101/VII/X/${faker.random.alphaNumeric(6).toUpperCase()}`,
|
|
||||||
created_at: moment(faker.date.past()).format("dddd, MMMM Do YYYY, HH:mm:ss"),
|
|
||||||
updated_at: moment(faker.date.past()).format("dddd, MMMM Do YYYY, HH:mm:ss"),
|
|
||||||
deleted_at: null,
|
|
||||||
name: faker.commerce.productName(),
|
|
||||||
status: 'Transaction Success',
|
|
||||||
price: faker.commerce.price(),
|
|
||||||
voucher_code: `${faker.random.alphaNumeric(5).toUpperCase()} - ${faker.random.alphaNumeric(5).toUpperCase()} - ${faker.random.alphaNumeric(5).toUpperCase()} - ${faker.random.alphaNumeric(5).toUpperCase()} - ${faker.random.alphaNumeric(5).toUpperCase()}`,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
transaction_id: `INV/20190101/VII/X/${faker.random.alphaNumeric(6).toUpperCase()}`,
|
|
||||||
created_at: moment(faker.date.past()).format("dddd, MMMM Do YYYY, HH:mm:ss"),
|
|
||||||
updated_at: moment(faker.date.past()).format("dddd, MMMM Do YYYY, HH:mm:ss"),
|
|
||||||
deleted_at: null,
|
|
||||||
name: faker.commerce.productName(),
|
|
||||||
status: 'Transaction Success',
|
|
||||||
price: faker.commerce.price(),
|
|
||||||
voucher_code: `${faker.random.alphaNumeric(5).toUpperCase()} - ${faker.random.alphaNumeric(5).toUpperCase()} - ${faker.random.alphaNumeric(5).toUpperCase()} - ${faker.random.alphaNumeric(5).toUpperCase()} - ${faker.random.alphaNumeric(5).toUpperCase()}`,
|
|
||||||
},
|
|
||||||
];
|
];
|
||||||
|
|
||||||
return(
|
return(
|
||||||
|
@ -91,8 +85,8 @@ export default class TransactionPage extends React.Component {
|
||||||
|
|
||||||
<div className={'listContainer'}>
|
<div className={'listContainer'}>
|
||||||
{
|
{
|
||||||
(this.purchasedVoucher.data.length > 0) ?
|
(data.length > 0) ?
|
||||||
this.purchasedVoucher.data.map(item => {
|
data.map(item => {
|
||||||
return <ItemList data={item}/>
|
return <ItemList data={item}/>
|
||||||
}) :
|
}) :
|
||||||
(
|
(
|
||||||
|
|
|
@ -46,7 +46,7 @@ export class CheckoutVouchers extends React.Component {
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const {classes} = this.props;
|
const {classes} = this.props;
|
||||||
const logoUrl = (this.props.vouchersStore.dataItems.images.logo) ? get(this.vouchersStore.dataItems, 'images.logo', '') : 'http://lorempixel.com/400/200';
|
const logoUrl = (this.props.vouchersStore.dataItems.images.main) ? get(this.vouchersStore.dataItems, 'images.main', '') : 'http://lorempixel.com/400/200';
|
||||||
|
|
||||||
let image = logoUrl;
|
let image = logoUrl;
|
||||||
|
|
||||||
|
|
|
@ -29,12 +29,16 @@ export class ItemCard extends React.Component {
|
||||||
render() {
|
render() {
|
||||||
const {data = {}} = this.props;
|
const {data = {}} = this.props;
|
||||||
|
|
||||||
let image = get(data, 'images.logo', '');
|
// console.log({data})
|
||||||
|
|
||||||
|
let image = get(data, 'images.main', '');
|
||||||
|
|
||||||
if (!image.includes('http')) {
|
if (!image.includes('http')) {
|
||||||
image = this.http.appendImagePath(image);
|
image = this.http.appendImagePath(image);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log({image})
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Card className={'itemCard'}>
|
<Card className={'itemCard'}>
|
||||||
<img className={'imageCard'} src={image}/>
|
<img className={'imageCard'} src={image}/>
|
||||||
|
|
|
@ -40,7 +40,7 @@ export default class ModalVouchersComponent extends React.Component {
|
||||||
render() {
|
render() {
|
||||||
const {item} = this.props.appstate;
|
const {item} = this.props.appstate;
|
||||||
const {data = {}, isVisible = false, onOk = () => {}, onCancel = () => {}, title='Modal'} = this.props;
|
const {data = {}, isVisible = false, onOk = () => {}, onCancel = () => {}, title='Modal'} = this.props;
|
||||||
let image = get(data, 'images.logo', '');
|
let image = get(data, 'images.main', '');
|
||||||
|
|
||||||
if (!image.includes('http')) {
|
if (!image.includes('http')) {
|
||||||
image = this.http.appendImagePath(image);
|
image = this.http.appendImagePath(image);
|
||||||
|
@ -102,38 +102,45 @@ export default class ModalVouchersComponent extends React.Component {
|
||||||
placeholder="Please Select your Option"
|
placeholder="Please Select your Option"
|
||||||
optionFilterProp="children"
|
optionFilterProp="children"
|
||||||
onChange={(value) => {
|
onChange={(value) => {
|
||||||
|
console.log({value})
|
||||||
this.setState({selectedOption: value});
|
this.setState({selectedOption: value});
|
||||||
this.setState({hidden: 'none'});
|
this.setState({hidden: 'none'});
|
||||||
// console.log('onChange',value);
|
// console.log('onChange',value);
|
||||||
const points = item.selectedData.sku.filter(item => item.id == value);
|
// const points = item.selectedData.sku.filter(item => item.id == value);
|
||||||
this.setState({
|
this.setState({
|
||||||
skuName :points[0].name,
|
skuName : get(data, 'name', '').name,
|
||||||
skuPrice : points[0].price,
|
skuPrice : get(data, 'regular_price', '0.0'),
|
||||||
buttonDisbaled: false
|
buttonDisbaled: false
|
||||||
})
|
})
|
||||||
}
|
}}
|
||||||
}
|
|
||||||
onDropdownVisibleChange={(value) => {
|
onDropdownVisibleChange={(value) => {
|
||||||
this.setState({hidden: 'inline'})
|
this.setState({hidden: 'inline'})
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{(item.selectedData.sku || []).map((item, index) => {
|
{(item.selectedData.sku || [{
|
||||||
|
vouchers: [{count: +get(data, 'stock', '0.0')}],
|
||||||
|
price: get(data, 'regular_price', '0.0'),
|
||||||
|
id: get(data, 'id', ''),
|
||||||
|
name: get(data, 'name', '')
|
||||||
|
}]).map((selectedItem, index) => {
|
||||||
// const {vouchers:[{count}]} = item;
|
// const {vouchers:[{count}]} = item;
|
||||||
|
|
||||||
|
console.log({item: selectedItem})
|
||||||
|
|
||||||
let count = 1;
|
let count = 1;
|
||||||
|
|
||||||
if (data.source === 'internal') {
|
if (data.source === 'internal') {
|
||||||
count = get(item, 'vouchers[0].count', 0) || 0;
|
count = get(selectedItem, 'vouchers[0].count', 0) || 0;
|
||||||
}
|
}
|
||||||
console.log(count);
|
console.log(count);
|
||||||
const outOfStock = !(+count > 0);
|
const outOfStock = !(+count > 0);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Option disabled={outOfStock} value={item.id}>
|
<Option disabled={outOfStock} value={selectedItem.id}>
|
||||||
<div style={{display:'flex',justifyContent:'space-between', width:'100%'}}>
|
<div style={{display:'flex',justifyContent:'space-between', width:'100%'}}>
|
||||||
<span>{item.name} {outOfStock ? " - Out of Stock" : ""}</span>
|
<span>{selectedItem.name} {outOfStock ? " - Out of Stock" : ""}</span>
|
||||||
<span style={{color:'#FF6F00', display:this.state.hidden}}>
|
<span style={{color:'#FF6F00', display:this.state.hidden}}>
|
||||||
Rp. <NumberFormat value={(+item.price).toFixed(0)} displayType={'text'} thousandSeparator={true}/>
|
Rp. <NumberFormat value={(+selectedItem.price).toFixed(0)} displayType={'text'} thousandSeparator={true}/>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</Option>
|
</Option>
|
||||||
|
@ -144,7 +151,9 @@ export default class ModalVouchersComponent extends React.Component {
|
||||||
<div className={'costContainerModal'}>
|
<div className={'costContainerModal'}>
|
||||||
<div className={'costLeftPaneModal'}>
|
<div className={'costLeftPaneModal'}>
|
||||||
<p className={'costTitleModal'}>Points</p>
|
<p className={'costTitleModal'}>Points</p>
|
||||||
<p className={'costValueModal'}><NumberFormat value={(+this.state.skuPrice).toFixed(0)} displayType={'text'} thousandSeparator={true}/> </p>
|
<p className={'costValueModal'}>
|
||||||
|
<NumberFormat value={(+this.state.skuPrice).toFixed(0)} displayType={'text'} thousandSeparator={true}/>
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div className={'costRightPaneModal'}>
|
<div className={'costRightPaneModal'}>
|
||||||
<Route render={({ history}) => (
|
<Route render={({ history}) => (
|
||||||
|
@ -205,38 +214,45 @@ export default class ModalVouchersComponent extends React.Component {
|
||||||
placeholder="Please Select your Option"
|
placeholder="Please Select your Option"
|
||||||
optionFilterProp="children"
|
optionFilterProp="children"
|
||||||
onChange={(value) => {
|
onChange={(value) => {
|
||||||
|
console.log({value})
|
||||||
this.setState({selectedOption: value});
|
this.setState({selectedOption: value});
|
||||||
this.setState({hidden: 'none'});
|
this.setState({hidden: 'none'});
|
||||||
// console.log('onChange',value);
|
// console.log('onChange',value);
|
||||||
const points = item.selectedData.sku.filter(item => item.id == value);
|
const points = item.selectedData.sku.filter(item => item.id == value);
|
||||||
this.setState({
|
this.setState({
|
||||||
skuName :points[0].name,
|
skuName : get(data, 'name', '').name,
|
||||||
skuPrice : points[0].price,
|
skuPrice : get(data, 'regular_price', '0.0'),
|
||||||
buttonDisbaled: false
|
buttonDisbaled: false
|
||||||
})
|
})
|
||||||
}
|
}}
|
||||||
}
|
|
||||||
onDropdownVisibleChange={(value) => {
|
onDropdownVisibleChange={(value) => {
|
||||||
this.setState({hidden: 'inline'})
|
this.setState({hidden: 'inline'})
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{(item.selectedData.sku || []).map((item, index) => {
|
{(item.selectedData.sku || [{
|
||||||
|
vouchers: [{count: +get(data, 'stock', '0.0')}],
|
||||||
|
price: get(data, 'regular_price', '0.0'),
|
||||||
|
id: get(data, 'id', ''),
|
||||||
|
name: get(data, 'name', '')
|
||||||
|
}]).map((selectedItem, index) => {
|
||||||
// const {vouchers:[{count}]} = item;
|
// const {vouchers:[{count}]} = item;
|
||||||
|
|
||||||
|
console.log({item: selectedItem})
|
||||||
|
|
||||||
let count = 1;
|
let count = 1;
|
||||||
|
|
||||||
if (data.source === 'internal') {
|
if (data.source === 'internal') {
|
||||||
count = get(item, 'vouchers[0].count', 0) || 0;
|
count = get(selectedItem, 'vouchers[0].count', 0) || 0;
|
||||||
}
|
}
|
||||||
console.log(count);
|
console.log(count);
|
||||||
const outOfStock = !(+count > 0);
|
const outOfStock = !(+count > 0);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Option disabled={outOfStock} value={item.id}>
|
<Option disabled={outOfStock} value={selectedItem.id}>
|
||||||
<div style={{display:'flex',justifyContent:'space-between', width:'100%'}}>
|
<div style={{display:'flex',justifyContent:'space-between', width:'100%'}}>
|
||||||
<span>{item.name} {outOfStock ? " - Out of Stock" : ""}</span>
|
<span>{selectedItem.name} {outOfStock ? " - Out of Stock" : ""}</span>
|
||||||
<span style={{color:'#FF6F00', display:this.state.hidden}}>
|
<span style={{color:'#FF6F00', display:this.state.hidden}}>
|
||||||
Rp. <NumberFormat value={(+item.price).toFixed(0)} displayType={'text'} thousandSeparator={true}/>
|
Rp. <NumberFormat value={(+selectedItem.price).toFixed(0)} displayType={'text'} thousandSeparator={true}/>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</Option>
|
</Option>
|
||||||
|
|
|
@ -59,7 +59,7 @@ export default class PaymentVouchers extends React.Component {
|
||||||
// applicationName = 'BTN';
|
// applicationName = 'BTN';
|
||||||
// applicationLogo = 'http://btn-redemption-2.bangun-kreatif.com/dr6u0fppdi4xy.cloudfront.net/FilesDirectory/Albilad/ImgIconImage/logo-btn.png';
|
// applicationLogo = 'http://btn-redemption-2.bangun-kreatif.com/dr6u0fppdi4xy.cloudfront.net/FilesDirectory/Albilad/ImgIconImage/logo-btn.png';
|
||||||
// }
|
// }
|
||||||
const logoUrl = (this.props.vouchersStore.dataItems.images.logo) ? get(this.vouchersStore.dataItems, 'images.logo', '') : 'http://lorempixel.com/400/200';
|
const logoUrl = (this.props.vouchersStore.dataItems.images.main) ? get(this.vouchersStore.dataItems, 'images.main', '') : 'http://lorempixel.com/400/200';
|
||||||
|
|
||||||
let image = logoUrl;
|
let image = logoUrl;
|
||||||
|
|
||||||
|
@ -207,7 +207,15 @@ export default class PaymentVouchers extends React.Component {
|
||||||
</Card>
|
</Card>
|
||||||
</div>
|
</div>
|
||||||
<div className="row">
|
<div className="row">
|
||||||
<Button type="primary" block onClick={() => {
|
<Button
|
||||||
|
type="primary"
|
||||||
|
block
|
||||||
|
onClick={() => {
|
||||||
|
this.globalUI.hideDialogLoading();
|
||||||
|
this.props.history.push(LINKS.TRANSACTION)
|
||||||
|
openNotificationWithIcon('success')
|
||||||
|
|
||||||
|
return;
|
||||||
this.vouchersStore.buyVoucher(this.vouchersStore.skuId)
|
this.vouchersStore.buyVoucher(this.vouchersStore.skuId)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
this.globalUI.hideDialogLoading();
|
this.globalUI.hideDialogLoading();
|
||||||
|
@ -218,7 +226,10 @@ export default class PaymentVouchers extends React.Component {
|
||||||
this.globalUI.openSnackbar(err.message);
|
this.globalUI.openSnackbar(err.message);
|
||||||
console.error(err, 'ini errornya');
|
console.error(err, 'ini errornya');
|
||||||
});
|
});
|
||||||
}}>Pakai Points</Button>
|
}}
|
||||||
|
>
|
||||||
|
Pakai Points
|
||||||
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="col s0 m2 l2" />
|
<div className="col s0 m2 l2" />
|
||||||
|
|
|
@ -67,6 +67,23 @@ export class VoucherStepper extends React.Component {
|
||||||
content: 'Sistem akan langsung memotong point anda ketika anda menekan tombol konfirmasi dibawah.',
|
content: 'Sistem akan langsung memotong point anda ketika anda menekan tombol konfirmasi dibawah.',
|
||||||
onOk: () => {
|
onOk: () => {
|
||||||
this.globalUI.showDialogLoading();
|
this.globalUI.showDialogLoading();
|
||||||
|
const openNotificationWithIcon = (type) => {
|
||||||
|
notification[type]({
|
||||||
|
message: 'Berhasil',
|
||||||
|
description: `Selamat anda telah mendapatkan vouchers ${this.vouchersStore.dataItems.name} - ${this.vouchersStore.skuName}`,
|
||||||
|
placement:'topRight',
|
||||||
|
duration: 5,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
this.globalUI.hideDialogLoading();
|
||||||
|
// this.props.history.push(LINKS.TRANSACTION)
|
||||||
|
openNotificationWithIcon('success');
|
||||||
|
this.setState({
|
||||||
|
stepIndex: stepIndex + 1,
|
||||||
|
finished: stepIndex >= 2,
|
||||||
|
});
|
||||||
|
|
||||||
|
return;
|
||||||
this.vouchersStore.buyVoucher(this.vouchersStore.skuId)
|
this.vouchersStore.buyVoucher(this.vouchersStore.skuId)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
const openNotificationWithIcon = (type) => {
|
const openNotificationWithIcon = (type) => {
|
||||||
|
|
|
@ -178,7 +178,7 @@ export default class Routes extends React.Component {
|
||||||
<Route exact path={LINKS.INVITE_CONFIRMATION_LOGIN} component={InviteConfirmationLoginComponent}/>
|
<Route exact path={LINKS.INVITE_CONFIRMATION_LOGIN} component={InviteConfirmationLoginComponent}/>
|
||||||
<Route exact path={LINKS.ACCEPT_INVITE} component={AcceptInvite}/>
|
<Route exact path={LINKS.ACCEPT_INVITE} component={AcceptInvite}/>
|
||||||
<Route path={LINKS.CHANGE_PASSWORD} component={ChangePassword}/>
|
<Route path={LINKS.CHANGE_PASSWORD} component={ChangePassword}/>
|
||||||
<PrivateRoute path={LINKS.APP_CONTAINER} component={AppContainer}/>
|
<Route path={LINKS.APP_CONTAINER} component={AppContainer}/>
|
||||||
</Switch>
|
</Switch>
|
||||||
</Router>
|
</Router>
|
||||||
);
|
);
|
||||||
|
|
|
@ -57,7 +57,7 @@ module.exports = {
|
||||||
test: /\.sass?$/,
|
test: /\.sass?$/,
|
||||||
use: 'happypack/loader?id=styles'
|
use: 'happypack/loader?id=styles'
|
||||||
}, {
|
}, {
|
||||||
test: /\.(jpg|png)$/,
|
test: /\.(jpg|jpeg|png|gif)$/,
|
||||||
loaders: [
|
loaders: [
|
||||||
'url-loader?limit=10000&publicPath=static/' // Any png-image or woff-font below or equal to 10K will be converted to inline base64 instead
|
'url-loader?limit=10000&publicPath=static/' // Any png-image or woff-font below or equal to 10K will be converted to inline base64 instead
|
||||||
]
|
]
|
||||||
|
|
|
@ -47,7 +47,7 @@ module.exports = {
|
||||||
test: /\.sass?$/,
|
test: /\.sass?$/,
|
||||||
use: 'happypack/loader?id=styles'
|
use: 'happypack/loader?id=styles'
|
||||||
}, {
|
}, {
|
||||||
test: /\.(jpg|png)$/,
|
test: /\.(jpg|jpeg|png|gif)$/,
|
||||||
loaders: [
|
loaders: [
|
||||||
'url-loader?limit=10000&publicPath=dist/' // Any png-image or woff-font below or equal to 10K will be converted to inline base64 instead
|
'url-loader?limit=10000&publicPath=dist/' // Any png-image or woff-font below or equal to 10K will be converted to inline base64 instead
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user