Compare commits
11 Commits
4a7dfe6d52
...
devops-sta
| Author | SHA1 | Date | |
|---|---|---|---|
| d1ab78d35a | |||
| cd8cc52f18 | |||
| 4a5e15c55c | |||
| 0abfb5245a | |||
| dec43f819d | |||
| 5467d91085 | |||
| e2cb987ded | |||
| 1206c4f013 | |||
| e8553ea12f | |||
| ffaae28e64 | |||
| 9b915d22c6 |
@@ -5,5 +5,5 @@ WORKDIR /app
|
||||
COPY package.json package-lock.json /app/
|
||||
RUN npm install
|
||||
COPY . /app
|
||||
CMD npm run watch
|
||||
CMD npm run start
|
||||
EXPOSE 7700
|
||||
@@ -560,7 +560,7 @@ class App extends React.Component {
|
||||
<WithdrawDialog />
|
||||
|
||||
<div className={classes.root}>
|
||||
<AppBar position="fixed">
|
||||
<AppBar style={{ zIndex: 1 }} position="fixed">
|
||||
<Toolbar className={classes.toolbar}>
|
||||
<div className={classes.sectionMobile}>
|
||||
<IconButton className={classes.menuButton} color="action" aria-label="Open drawer" onClick={this.toggleDrawerNew(true)}>
|
||||
|
||||
@@ -199,7 +199,7 @@ class DashboardComponent extends React.Component {
|
||||
Voucher
|
||||
</Typography>
|
||||
<Typography component="p">
|
||||
<NumberFormat value={(0).toFixed(2)} displayType={'text'} thousandSeparator={true} prefix={'Rp '} />
|
||||
<NumberFormat value={(this.props.appstate.wallet.data.wallet).toFixed(2)} displayType={'text'} thousandSeparator={true} prefix={'Rp '} />
|
||||
</Typography>
|
||||
</MuiCardContent>
|
||||
<MuiCardActions>
|
||||
@@ -330,7 +330,8 @@ class DashboardComponent extends React.Component {
|
||||
style={{ marginTop: 15 }}>
|
||||
{(this.vouchersStore.list.length > 0) ?
|
||||
this.vouchersStore.list.map((item, index) => {
|
||||
let image = get(item, 'images.logo', '');
|
||||
console.log("itemm", item)
|
||||
let image = get(item, 'images.main', '');
|
||||
|
||||
if (!image.includes('http')) {
|
||||
image = this.http.appendImagePath(image);
|
||||
|
||||
@@ -73,7 +73,7 @@ export default class ComponentName extends React.Component {
|
||||
// description: 'Please check your email to continue'
|
||||
// });
|
||||
this.props.history.push({
|
||||
pathname:LINKS.VOUCHERS
|
||||
pathname:LINKS.DASHBOARD
|
||||
});
|
||||
this.setState({isLoading: false, isSuccess: true})
|
||||
// this
|
||||
|
||||
@@ -209,7 +209,7 @@ class RegisterPage extends React.Component {
|
||||
no_rekening : this.state.no_rekening
|
||||
}
|
||||
};
|
||||
this.props.history.push(LINKS.VOUCHERS);
|
||||
this.props.history.push(LINKS.DASHBOARD);
|
||||
// this.authStore.register(data).then(res => {
|
||||
// //message.success("Please check your email to confirm your account");this.props.history.push(LINKS.LOGIN);
|
||||
// setTimeout(() => {
|
||||
|
||||
@@ -11,9 +11,11 @@
|
||||
background-color: white;
|
||||
border: #ccc 1px solid;
|
||||
width: 100%;
|
||||
height: 200px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
text-align: center;
|
||||
align-items: center;
|
||||
margin-bottom: 10px;
|
||||
cursor: pointer;
|
||||
|
||||
@@ -19,13 +19,66 @@ export default class ModalTopupComponent extends React.Component {
|
||||
inputCode2: '',
|
||||
inputCode3: '',
|
||||
inputCode4: '',
|
||||
confirmLoading: false
|
||||
confirmLoading: false,
|
||||
onOk: {}
|
||||
};
|
||||
this.defaultState = Object.assign({}, this.state);
|
||||
}
|
||||
|
||||
componentDidMount() {}
|
||||
|
||||
redeemCode (code) {
|
||||
|
||||
const codeList = [
|
||||
{
|
||||
code: 'MLXNAPNU18nd0871',
|
||||
amount: 10000
|
||||
},
|
||||
{
|
||||
code: 'ABAKO1239KLKHASD',
|
||||
amount: 20000
|
||||
},
|
||||
|
||||
{
|
||||
code: 'W54VCZJN23FGSDAG',
|
||||
amount: 50000
|
||||
},
|
||||
{
|
||||
code: '123456789ABCEFGH',
|
||||
amount: 100000
|
||||
}
|
||||
]
|
||||
|
||||
let rightCode = {};
|
||||
|
||||
codeList.map((cl) => {
|
||||
if (cl.code === code){
|
||||
rightCode = cl
|
||||
}}
|
||||
)
|
||||
|
||||
this.setState({
|
||||
inputCode1: '',
|
||||
inputCode2: '',
|
||||
inputCode3: '',
|
||||
inputCode4: ''
|
||||
});
|
||||
|
||||
if (rightCode.code){
|
||||
message.success("Voucher redeem success");
|
||||
this.props.appstate.wallet.data.wallet = this.props.appstate.wallet.data.wallet + rightCode.amount
|
||||
this.setState({
|
||||
confirmLoading: false
|
||||
});
|
||||
this.state.onOk()
|
||||
}else{
|
||||
this.setState({
|
||||
confirmLoading: false
|
||||
});
|
||||
message.warning("Voucher redeem failed")
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
const {data, isVisible = false, onOk = () => {}, onCancel = () => {}, title='Redeem your code'} = this.props;
|
||||
|
||||
@@ -35,25 +88,29 @@ export default class ModalTopupComponent extends React.Component {
|
||||
visible={isVisible}
|
||||
onOk={async () => {
|
||||
this.setState({
|
||||
confirmLoading: true
|
||||
confirmLoading: true,
|
||||
onOk: onOk()
|
||||
});
|
||||
let voucherCode = this.state.inputCode1 + this.state.inputCode2 + this.state.inputCode3 + this.state.inputCode4;
|
||||
console.log("voucherCode", voucherCode)
|
||||
|
||||
try {
|
||||
await this.props.appstate.wallet.redeemVoucherCode(voucherCode);
|
||||
this.props.onOk();
|
||||
message.info("Voucher redeem success");
|
||||
} catch (e) {
|
||||
message.error(e.message);
|
||||
} finally {
|
||||
this.setState({
|
||||
inputCode1: '',
|
||||
inputCode2: '',
|
||||
inputCode3: '',
|
||||
inputCode4: '',
|
||||
confirmLoading: false
|
||||
});
|
||||
}
|
||||
this.redeemCode(voucherCode)
|
||||
|
||||
// try {
|
||||
// await this.props.appstate.wallet.redeemVoucherCode(voucherCode);
|
||||
// this.props.onOk();
|
||||
// message.info("Voucher redeem success");
|
||||
// } catch (e) {
|
||||
// message.error(e.message);
|
||||
// } finally {
|
||||
// this.setState({
|
||||
// inputCode1: '',
|
||||
// inputCode2: '',
|
||||
// inputCode3: '',
|
||||
// inputCode4: '',
|
||||
// confirmLoading: false
|
||||
// });
|
||||
// }
|
||||
|
||||
}}
|
||||
onCancel={() => {
|
||||
|
||||
@@ -5,7 +5,7 @@ export class ItemStore extends BaseStore {
|
||||
@observable listImages = [];
|
||||
constructor(context) {
|
||||
super(context);
|
||||
this.url = "items";
|
||||
this.url = "/categories/11936220-31f7-4f5e-8555-9110dbec4a5d/items";
|
||||
}
|
||||
|
||||
@action
|
||||
|
||||
@@ -26,7 +26,7 @@ export default class Vouchers {
|
||||
getList(){
|
||||
console.log('res');
|
||||
this.isLoading = true;
|
||||
return this.http.get("items")
|
||||
return this.http.get("categories/11936220-31f7-4f5e-8555-9110dbec4a5d/items")
|
||||
.then(res => {
|
||||
this.list = res.data;
|
||||
this.isLoading = false;
|
||||
|
||||
Reference in New Issue
Block a user