diff --git a/src/app/pipes/chlid-recharge-status.pipe.ts b/src/app/pipes/chlid-recharge-status.pipe.ts new file mode 100644 index 0000000..b43a75a --- /dev/null +++ b/src/app/pipes/chlid-recharge-status.pipe.ts @@ -0,0 +1,21 @@ +import { Pipe, PipeTransform } from '@angular/core'; + +@Pipe({ + name: 'chlidRechargeStatus' +}) +export class ChlidRechargeStatusPipe implements PipeTransform { + + transform(value: number): string { + switch (value) { + case 101: + return '充值成功'; + case 102: + return '充值中'; + case 103: + return '充值失败'; + case 104: + return '未充值'; + } + } + +} diff --git a/src/app/pipes/pay-status.pipe.ts b/src/app/pipes/pay-status.pipe.ts new file mode 100644 index 0000000..15edb4b --- /dev/null +++ b/src/app/pipes/pay-status.pipe.ts @@ -0,0 +1,23 @@ +import { Pipe, PipeTransform } from '@angular/core'; + +@Pipe({ + name: 'payStatus' +}) +export class PayStatusPipe implements PipeTransform { + + transform(value: number): string { + switch (value) { + case 101: + return '待支付'; + case 102: + return '已支付'; + case 100: + return '已完成'; + case 104: + return '已取消'; + case 105: + return '已退款'; + } + } + +}