Compare commits

..

5 Commits

Author SHA1 Message Date
0abfb5245a style: Adjust item card height 2023-01-18 15:55:08 +07:00
5467d91085 feat: Items based on category voucher 2023-01-18 15:40:08 +07:00
1206c4f013 fix: Adjust redeem voucher message 2023-01-18 14:17:01 +07:00
ffaae28e64 feat:
- Redeem Code
2023-01-18 13:36:31 +07:00
9b915d22c6 feat:
- Revamp Design
- Adjust anomaly in design
2023-01-18 12:29:29 +07:00
11 changed files with 12499 additions and 6015 deletions

View File

@@ -1,9 +1,7 @@
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 package-lock.json /app/ COPY package.json /app
RUN npm install RUN yarn
COPY . /app COPY . /app
CMD npm run watch CMD npm run watch
EXPOSE 7700 EXPOSE 8080

View File

@@ -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: 7700 - containerPort: 8080
imagePullSecrets: imagePullSecrets:
- name: regcred - name: regcred

View File

@@ -18,7 +18,7 @@ spec:
service: service:
name: bukopin-redemption-client-react name: bukopin-redemption-client-react
port: port:
number: 7700 number: 8080
tls: tls:
- hosts: - hosts:
- "bukopin-fe.k3s.bangun-kreatif.com" - "bukopin-fe.k3s.bangun-kreatif.com"

View File

@@ -7,7 +7,7 @@ metadata:
run: bukopin-redemption-client-react run: bukopin-redemption-client-react
spec: spec:
ports: ports:
- port: 7700 - port: 8080
protocol: TCP protocol: TCP
selector: selector:
app: bukopin-redemption-client-react app: bukopin-redemption-client-react

18438
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -560,7 +560,7 @@ class App extends React.Component {
<WithdrawDialog /> <WithdrawDialog />
<div className={classes.root}> <div className={classes.root}>
<AppBar position="fixed"> <AppBar style={{ zIndex: 1 }} 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)}>

View File

@@ -199,7 +199,7 @@ class DashboardComponent extends React.Component {
Voucher Voucher
</Typography> </Typography>
<Typography component="p"> <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> </Typography>
</MuiCardContent> </MuiCardContent>
<MuiCardActions> <MuiCardActions>
@@ -330,7 +330,8 @@ 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) => {
let image = get(item, 'images.logo', ''); console.log("itemm", item)
let image = get(item, 'images.main', '');
if (!image.includes('http')) { if (!image.includes('http')) {
image = this.http.appendImagePath(image); image = this.http.appendImagePath(image);

View File

@@ -11,9 +11,11 @@
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;

View File

@@ -19,13 +19,66 @@ 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;
@@ -35,25 +88,29 @@ 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)
try { this.redeemCode(voucherCode)
await this.props.appstate.wallet.redeemVoucherCode(voucherCode);
this.props.onOk(); // try {
message.info("Voucher redeem success"); // await this.props.appstate.wallet.redeemVoucherCode(voucherCode);
} catch (e) { // this.props.onOk();
message.error(e.message); // message.info("Voucher redeem success");
} finally { // } catch (e) {
this.setState({ // message.error(e.message);
inputCode1: '', // } finally {
inputCode2: '', // this.setState({
inputCode3: '', // inputCode1: '',
inputCode4: '', // inputCode2: '',
confirmLoading: false // inputCode3: '',
}); // inputCode4: '',
} // confirmLoading: false
// });
// }
}} }}
onCancel={() => { onCancel={() => {

View File

@@ -5,7 +5,7 @@ export class ItemStore extends BaseStore {
@observable listImages = []; @observable listImages = [];
constructor(context) { constructor(context) {
super(context); super(context);
this.url = "items"; this.url = "/categories/11936220-31f7-4f5e-8555-9110dbec4a5d/items";
} }
@action @action

View File

@@ -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("items") return this.http.get("categories/11936220-31f7-4f5e-8555-9110dbec4a5d/items")
.then(res => { .then(res => {
this.list = res.data; this.list = res.data;
this.isLoading = false; this.isLoading = false;