修改优惠券状态

pull/1/head
袁野 4 years ago
parent 097bd42168
commit ba1288f11e
  1. 2
      src/app/admin/coupon/coupon-list/coupon-list.component.html
  2. 2
      src/app/admin/order/order-coupons/order-coupons.component.html
  3. 8
      src/app/app-common.module.ts
  4. 21
      src/app/pipes/discount-code-status.pipe.ts
  5. 19
      src/app/pipes/display-area.pipe.ts
  6. 2
      src/app/pipes/index.ts

@ -121,7 +121,7 @@
<td>¥{{data.salesPrice}}</td>
<td>¥{{data.discountPrice}}</td>
<td>{{data.stockCount}}</td>
<td>{{data.displayArea === 1 ? '赠券专区' : '金币专区'}}</td>
<td>{{data.displayArea | displayArea}}</td>
<td>{{data.couponType === 1 ? '内部卷' : '外部卷'}}</td>
<td>{{data.isPresent === true ? '赠券' : '无赠券'}}</td>
<td>{{data.status | couponStatus}}</td>

@ -115,7 +115,7 @@
{{data['highUser'] == null ? '暂无': data['highUser'].name}}
</td>
<td>{{data.createTime | date: 'yyyy-MM-dd HH:mm'}}</td>
<td>{{data.status | couponCode}}</td>
<td>{{data.status | discountCodeStatus}}</td>
</tbody>
</nz-table>

@ -21,7 +21,9 @@ import {
PaytypePipe,
DiscountTypePipe,
OrderCouponStatusPipe,
DiscountStatusPipe
DiscountStatusPipe,
DisplayAreaPipe,
DiscountCodeStatusPipe
} from './pipes';
@ -37,7 +39,9 @@ const PIPES = [
PaymodelPipe,
PaytypePipe,
DiscountTypePipe,
DiscountStatusPipe
DiscountStatusPipe,
DisplayAreaPipe,
DiscountCodeStatusPipe,
];

@ -0,0 +1,21 @@
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({
name: 'discountCodeStatus'
})
export class DiscountCodeStatusPipe implements PipeTransform {
transform(value: number): string {
switch (value) {
case 1:
return '待领取';
case 2:
return '待使用';
case 3:
return '已使用';
case 4:
return '已过期';
}
}
}

@ -0,0 +1,19 @@
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({
name: 'displayArea'
})
export class DisplayAreaPipe implements PipeTransform {
transform(value: any): string {
switch (value) {
case 1:
return '赠券专区';
case 2:
return '金币专区';
case null:
return '消费券';
}
}
}

@ -10,3 +10,5 @@ export * from './paymodel.pipe';
export * from './paytype.pipe';
export * from './discount-type.pipe';
export * from './discount-status.pipe';
export * from './display-area.pipe';
export * from './discount-code-status.pipe';

Loading…
Cancel
Save