pull/1/head
袁野 2 years ago
parent a139e77dcc
commit 2532249212
  1. 19
      src/app/pipes/integral/integral-product.pipe.ts
  2. 21
      src/app/pipes/integral/integral-type.pipe.ts

@ -0,0 +1,19 @@
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({
name: 'integralProduct'
})
export class IntegralProductPipe implements PipeTransform {
array = {
1: ['重庆中石化' , '', '', '贵州中石化'],
2: ['在线加油' ],
3: ['电信' , '移动' , '联通'],
4: ['星巴克' , '肯德基' , '会员充值']
};
transform(type: number , product: number): string {
return this.array[type][product - 1];
}
}

@ -0,0 +1,21 @@
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({
name: 'integralType'
})
export class IntegralTypePipe implements PipeTransform {
transform(value: number): string {
switch (value) {
case 1:
return '卡券';
case 2:
return '在线加油';
case 3:
return '话费';
case 4:
return '第三方';
}
}
}
Loading…
Cancel
Save