Compare commits
12 Commits
bukopin
...
4a7dfe6d52
| Author | SHA1 | Date | |
|---|---|---|---|
| 4a7dfe6d52 | |||
| 5840ec682f | |||
| 9e39000483 | |||
| 35ce9e2484 | |||
| 6e83553e86 | |||
| 7a4ea8c528 | |||
| c154ccc0f6 | |||
|
|
b2a0cc9cdc | ||
|
|
0a482dd766 | ||
|
|
8a8d7c0e74 | ||
|
|
8c02184bd9 | ||
|
|
07634ef503 |
@@ -1,7 +1,9 @@
|
|||||||
FROM node:8-alpine
|
FROM node:8-alpine
|
||||||
|
RUN apk add --no-cache libc6-compat
|
||||||
|
RUN apk add --no-cache git
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY package.json /app
|
COPY package.json package-lock.json /app/
|
||||||
RUN yarn
|
RUN npm install
|
||||||
COPY . /app
|
COPY . /app
|
||||||
CMD npm run watch
|
CMD npm run watch
|
||||||
EXPOSE 8080
|
EXPOSE 7700
|
||||||
@@ -17,7 +17,7 @@ spec:
|
|||||||
- name: bukopin-redemption-client-react
|
- name: bukopin-redemption-client-react
|
||||||
image: registry-harbor.app.bangun-kreatif.com/bukopin/bukopin-redemption-client-react:<VERSION>
|
image: registry-harbor.app.bangun-kreatif.com/bukopin/bukopin-redemption-client-react:<VERSION>
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 8080
|
- containerPort: 7700
|
||||||
imagePullSecrets:
|
imagePullSecrets:
|
||||||
- name: regcred
|
- name: regcred
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ spec:
|
|||||||
service:
|
service:
|
||||||
name: bukopin-redemption-client-react
|
name: bukopin-redemption-client-react
|
||||||
port:
|
port:
|
||||||
number: 8080
|
number: 7700
|
||||||
tls:
|
tls:
|
||||||
- hosts:
|
- hosts:
|
||||||
- "bukopin-fe.k3s.bangun-kreatif.com"
|
- "bukopin-fe.k3s.bangun-kreatif.com"
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ metadata:
|
|||||||
run: bukopin-redemption-client-react
|
run: bukopin-redemption-client-react
|
||||||
spec:
|
spec:
|
||||||
ports:
|
ports:
|
||||||
- port: 8080
|
- port: 7700
|
||||||
protocol: TCP
|
protocol: TCP
|
||||||
selector:
|
selector:
|
||||||
app: bukopin-redemption-client-react
|
app: bukopin-redemption-client-react
|
||||||
|
|||||||
18920
package-lock.json
generated
18920
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -560,7 +560,7 @@ class App extends React.Component {
|
|||||||
<WithdrawDialog />
|
<WithdrawDialog />
|
||||||
|
|
||||||
<div className={classes.root}>
|
<div className={classes.root}>
|
||||||
<AppBar style={{ zIndex: 1 }} position="fixed">
|
<AppBar position="fixed">
|
||||||
<Toolbar className={classes.toolbar}>
|
<Toolbar className={classes.toolbar}>
|
||||||
<div className={classes.sectionMobile}>
|
<div className={classes.sectionMobile}>
|
||||||
<IconButton className={classes.menuButton} color="action" aria-label="Open drawer" onClick={this.toggleDrawerNew(true)}>
|
<IconButton className={classes.menuButton} color="action" aria-label="Open drawer" onClick={this.toggleDrawerNew(true)}>
|
||||||
|
|||||||
@@ -199,7 +199,7 @@ class DashboardComponent extends React.Component {
|
|||||||
Voucher
|
Voucher
|
||||||
</Typography>
|
</Typography>
|
||||||
<Typography component="p">
|
<Typography component="p">
|
||||||
<NumberFormat value={(this.props.appstate.wallet.data.wallet).toFixed(2)} displayType={'text'} thousandSeparator={true} prefix={'Rp '} />
|
<NumberFormat value={(0).toFixed(2)} displayType={'text'} thousandSeparator={true} prefix={'Rp '} />
|
||||||
</Typography>
|
</Typography>
|
||||||
</MuiCardContent>
|
</MuiCardContent>
|
||||||
<MuiCardActions>
|
<MuiCardActions>
|
||||||
@@ -330,8 +330,7 @@ class DashboardComponent extends React.Component {
|
|||||||
style={{ marginTop: 15 }}>
|
style={{ marginTop: 15 }}>
|
||||||
{(this.vouchersStore.list.length > 0) ?
|
{(this.vouchersStore.list.length > 0) ?
|
||||||
this.vouchersStore.list.map((item, index) => {
|
this.vouchersStore.list.map((item, index) => {
|
||||||
console.log("itemm", item)
|
let image = get(item, 'images.logo', '');
|
||||||
let image = get(item, 'images.main', '');
|
|
||||||
|
|
||||||
if (!image.includes('http')) {
|
if (!image.includes('http')) {
|
||||||
image = this.http.appendImagePath(image);
|
image = this.http.appendImagePath(image);
|
||||||
|
|||||||
@@ -11,11 +11,9 @@
|
|||||||
background-color: white;
|
background-color: white;
|
||||||
border: #ccc 1px solid;
|
border: #ccc 1px solid;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 200px;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
text-align: center;
|
|
||||||
align-items: center;
|
align-items: center;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|||||||
@@ -19,66 +19,13 @@ export default class ModalTopupComponent extends React.Component {
|
|||||||
inputCode2: '',
|
inputCode2: '',
|
||||||
inputCode3: '',
|
inputCode3: '',
|
||||||
inputCode4: '',
|
inputCode4: '',
|
||||||
confirmLoading: false,
|
confirmLoading: false
|
||||||
onOk: {}
|
|
||||||
};
|
};
|
||||||
this.defaultState = Object.assign({}, this.state);
|
this.defaultState = Object.assign({}, this.state);
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount() {}
|
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() {
|
render() {
|
||||||
const {data, isVisible = false, onOk = () => {}, onCancel = () => {}, title='Redeem your code'} = this.props;
|
const {data, isVisible = false, onOk = () => {}, onCancel = () => {}, title='Redeem your code'} = this.props;
|
||||||
|
|
||||||
@@ -88,29 +35,25 @@ export default class ModalTopupComponent extends React.Component {
|
|||||||
visible={isVisible}
|
visible={isVisible}
|
||||||
onOk={async () => {
|
onOk={async () => {
|
||||||
this.setState({
|
this.setState({
|
||||||
confirmLoading: true,
|
confirmLoading: true
|
||||||
onOk: onOk()
|
|
||||||
});
|
});
|
||||||
let voucherCode = this.state.inputCode1 + this.state.inputCode2 + this.state.inputCode3 + this.state.inputCode4;
|
let voucherCode = this.state.inputCode1 + this.state.inputCode2 + this.state.inputCode3 + this.state.inputCode4;
|
||||||
console.log("voucherCode", voucherCode)
|
|
||||||
|
|
||||||
this.redeemCode(voucherCode)
|
try {
|
||||||
|
await this.props.appstate.wallet.redeemVoucherCode(voucherCode);
|
||||||
// try {
|
this.props.onOk();
|
||||||
// await this.props.appstate.wallet.redeemVoucherCode(voucherCode);
|
message.info("Voucher redeem success");
|
||||||
// this.props.onOk();
|
} catch (e) {
|
||||||
// message.info("Voucher redeem success");
|
message.error(e.message);
|
||||||
// } catch (e) {
|
} finally {
|
||||||
// message.error(e.message);
|
this.setState({
|
||||||
// } finally {
|
inputCode1: '',
|
||||||
// this.setState({
|
inputCode2: '',
|
||||||
// inputCode1: '',
|
inputCode3: '',
|
||||||
// inputCode2: '',
|
inputCode4: '',
|
||||||
// inputCode3: '',
|
confirmLoading: false
|
||||||
// inputCode4: '',
|
});
|
||||||
// confirmLoading: false
|
}
|
||||||
// });
|
|
||||||
// }
|
|
||||||
|
|
||||||
}}
|
}}
|
||||||
onCancel={() => {
|
onCancel={() => {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ export class ItemStore extends BaseStore {
|
|||||||
@observable listImages = [];
|
@observable listImages = [];
|
||||||
constructor(context) {
|
constructor(context) {
|
||||||
super(context);
|
super(context);
|
||||||
this.url = "/categories/11936220-31f7-4f5e-8555-9110dbec4a5d/items";
|
this.url = "items";
|
||||||
}
|
}
|
||||||
|
|
||||||
@action
|
@action
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ export default class Vouchers {
|
|||||||
getList(){
|
getList(){
|
||||||
console.log('res');
|
console.log('res');
|
||||||
this.isLoading = true;
|
this.isLoading = true;
|
||||||
return this.http.get("categories/11936220-31f7-4f5e-8555-9110dbec4a5d/items")
|
return this.http.get("items")
|
||||||
.then(res => {
|
.then(res => {
|
||||||
this.list = res.data;
|
this.list = res.data;
|
||||||
this.isLoading = false;
|
this.isLoading = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user