From ce3ea6a5f7e2d71cf1e0120191f340904a3ac0c2 Mon Sep 17 00:00:00 2001 From: Sum1Dream <418471657@qq.com> Date: Mon, 6 Mar 2023 16:32:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=90=86=E5=95=86?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../apiMerchant/verify-product-type.pipe.ts | 17 ++++++++++ .../pipes/order/order-product-type.pipe.ts | 34 +++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 src/app/pipes/apiMerchant/verify-product-type.pipe.ts create mode 100644 src/app/pipes/order/order-product-type.pipe.ts 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 '未知'; + } + } + +}