diff --git a/src/app/pipes/apiMerchant/verify-product-type.pipe.ts b/src/app/pipes/apiMerchant/verify-product-type.pipe.ts new file mode 100644 index 0000000..22890c1 --- /dev/null +++ b/src/app/pipes/apiMerchant/verify-product-type.pipe.ts @@ -0,0 +1,17 @@ +import { Pipe, PipeTransform } from '@angular/core'; + +@Pipe({ + name: 'verifyProductType' +}) +export class VerifyProductTypePipe implements PipeTransform { + + transform(value: string[]): unknown { + if (value != null) { + return value.includes('6'); + } else { + return null; + } + + } + +} diff --git a/src/app/pipes/order/order-product-type.pipe.ts b/src/app/pipes/order/order-product-type.pipe.ts new file mode 100644 index 0000000..f256d70 --- /dev/null +++ b/src/app/pipes/order/order-product-type.pipe.ts @@ -0,0 +1,34 @@ +import { Pipe, PipeTransform } from '@angular/core'; + +@Pipe({ + name: 'orderProductType' +}) +export class OrderProductTypePipe implements PipeTransform { + transform(value: number): string { + switch (value) { + case 1: + return '星巴克'; + case 2: + return '肯德基'; + case 3: + return '会员充值'; + case 4: + return '积分充值'; + case 5: + return '购买卡券'; + case 6: + return '加油服务'; + case 7: + return '优惠券包'; + case 8: + return '汇联通充值'; + case 9: + return '话费充值'; + case 99: + return '商户充值'; + default: + return '未知'; + } + } + +}