Skip to content
Permalink
Browse files

feat(ever-admin): preview barcodes" step "Orders Settings" EV-1195

  • Loading branch information...
AlishMekliov931 committed Apr 8, 2019
1 parent ae29ca1 commit ac6fbd55f1a5cc6263bf861094e616e7884577de
@@ -26,10 +26,10 @@
<ngx-barcode
*ngIf="!isQRCode"
[bc-value]="barcodetData"
[bc-format]="'CODE128'"
[bc-format]="ngxBarcodeFormat"
[bc-element-type]="img"
[bc-height]="30"
[bc-width]="1.5"
[bc-width]="1"
></ngx-barcode>
</div>
</div>
@@ -1,7 +1,8 @@
import { Component } from '@angular/core';
import OrderBarcodeTypes from '@modules/server.common/enums/OrderBarcodeTypes';
import OrderBarcodeTypes, {
orderBarcodeTypesToString
} from '@modules/server.common/enums/OrderBarcodeTypes';
import QRCode from 'qrcode';
import { Types } from 'mongoose';

@Component({
selector: 'ea-merchants-setup-orders-settings',
@@ -13,12 +14,25 @@ export class SetupMerchantOrdersSettingsComponent {
barcodetData: string;
barcodetDataUrl: string;
isQRCode: boolean = true;
ngxBarcodeFormat: string;

orderBarcodeTypes = [
{ label: 'QR', value: OrderBarcodeTypes.QR },
{ label: 'CODE128', value: OrderBarcodeTypes.CODE128 },
{ label: 'CODE39', value: OrderBarcodeTypes.CODE39 },
{ label: 'pharmacode', value: OrderBarcodeTypes.pharmacode }
{
label: orderBarcodeTypesToString(OrderBarcodeTypes.QR),
value: OrderBarcodeTypes.QR
},
{
label: orderBarcodeTypesToString(OrderBarcodeTypes.CODE128),
value: OrderBarcodeTypes.CODE128
},
{
label: orderBarcodeTypesToString(OrderBarcodeTypes.CODE39),
value: OrderBarcodeTypes.CODE39
},
{
label: orderBarcodeTypesToString(OrderBarcodeTypes.MSI),
value: OrderBarcodeTypes.MSI
}
];

constructor() {
@@ -33,5 +47,8 @@ export class SetupMerchantOrdersSettingsComponent {

typeChange(type) {
this.isQRCode = type === OrderBarcodeTypes.QR;
if (!this.isQRCode) {
this.ngxBarcodeFormat = orderBarcodeTypesToString(type);
}
}
}
@@ -7,7 +7,8 @@ enum OrderBarcodeTypes {
QR = 0,
CODE128 = 1,
CODE39 = 2,
pharmacode = 3
pharmacode = 3,
MSI = 4
}

export function orderBarcodeTypesToString(status: OrderBarcodeTypes): string {
@@ -20,6 +21,8 @@ export function orderBarcodeTypesToString(status: OrderBarcodeTypes): string {
return 'CODE39';
case OrderBarcodeTypes.pharmacode:
return 'pharmacode';
case OrderBarcodeTypes.MSI:
return 'MSI';
default:
return 'BAD_STATUS';
}

0 comments on commit ac6fbd5

Please sign in to comment.
You can’t perform that action at this time.