合并自建站代码到话费修改

pull/1/head
袁野 3 years ago
parent 8d3c6dd3ec
commit 6113447582
  1. 19
      src/app/pipes/recharge-price/price-status.pipe.ts
  2. 23
      src/app/pipes/recharge-price/recharge-platform.pipe.ts

@ -0,0 +1,19 @@
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({
name: 'priceStatus'
})
export class PriceStatusPipe implements PipeTransform {
transform(value: number): string {
switch (value) {
case 1:
return '上线中';
case 2:
return '已售空';
case 3:
return '编辑中';
}
}
}

@ -0,0 +1,23 @@
import {Pipe, PipeTransform} from '@angular/core';
@Pipe({
name: 'rechargePlatform'
})
export class RechargePlatformPipe implements PipeTransform {
transform(value: string): unknown {
const array = value.split('-');
let string = '';
for (const i of array) {
if (Number(i) === 1) {
string = string + '尖椒,';
}
if (Number(i) === 2) {
string = string + '龙阅,';
}
}
return string.substring(0 , string.length - 1);
}
}
Loading…
Cancel
Save