增加订单管理下菜单:赠送优惠券列表

master
游梦婷 11 months ago
parent 29d2c7df22
commit 6ffa59f4fc
  1. 85
      src/app/admin/order-manage/give-coupons/give-coupons.component.html
  2. 7
      src/app/admin/order-manage/give-coupons/give-coupons.component.scss
  3. 28
      src/app/admin/order-manage/give-coupons/give-coupons.component.spec.ts
  4. 90
      src/app/admin/order-manage/give-coupons/give-coupons.component.ts
  5. 2
      src/app/admin/order-manage/order-manage-routing.module.ts
  6. 5
      src/app/admin/order-manage/order-manage.module.ts
  7. 4
      src/app/app-common.module.ts
  8. 34
      src/app/pipes/discount-code-status.pipe.ts
  9. 9
      src/app/services/order.service.ts
  10. 2
      src/environments/environment.ts

@ -0,0 +1,85 @@
<!-- start 面包屑 -->
<app-breadcrumb></app-breadcrumb>
<!-- end 面包屑 -->
<!-- start 搜索条件 -->
<div >
<div class="inner-content">
<form nz-form [formGroup]="searchForm" (ngSubmit)="getRequest(true , searchForm.value)">
<div nz-row>
<div nz-col nzSpan="8">
<nz-form-item>
<nz-form-label [nzSpan]="8">优惠券名称</nz-form-label>
<nz-form-control [nzSpan]="14">
<input nz-input formControlName="discountName" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col nzSpan="8">
<nz-form-item>
<nz-form-label [nzSpan]="8">状态</nz-form-label>
<nz-form-control [nzSpan]="14">
<nz-select formControlName="status" nzAllowClear>
<nz-option [nzValue]="0" nzLabel="已过期"></nz-option>
<nz-option [nzValue]="1" nzLabel="未使用"></nz-option>
<nz-option [nzValue]="2" nzLabel="已使用"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
</div>
</div>
<div nz-row>
<div nz-col nzSpan="24" class="search-button">
<button nz-button nzType="primary"><i nz-icon nzType="search" nzTheme="outline"></i>搜索</button>
</div>
</div>
</form>
</div>
</div>
<!-- end 搜索条件 -->
<!--列表数据-->
<div class="inner-content">
<span>共计 {{total?total:0}} 条数据</span>
<!--数组表格 -->
<nz-table #basicTable
nzShowPagination
nzShowSizeChanger
nzBordered
[nzData]="requestData"
[nzTotal]="total"
[nzLoading]="loading"
[nzFrontPagination]="false"
[(nzPageIndex)]="pageNum"
[(nzPageSize)]="pageSize"
(nzPageIndexChange)="getRequest(false , searchForm.value)"
(nzPageSizeChange)="getRequest(false , searchForm.value)"
[nzPageSizeOptions]="[10,20,50,100]"
[nzScroll]="{ x: '1200px'}">
<thead>
<tr>
<th >优惠券名称</th>
<th >优惠券类型</th>
<th >优惠金额</th>
<th>用户手机号</th>
<th>状态</th>
<th >使用时间</th>
<th>创建时间</th>
<th>使用截止时间</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let data of basicTable.data;let i = index">
<td>{{data.discountName}}</td>
<td>{{data.discountType | discountType}}</td>
<td>{{data.discountPrice}}</td>
<td>{{data.ext3 | phoneTranslate}}</td>
<td>{{data.status | discountCodeStatus2}}</td>
<td>{{data.useTime | date : 'yyyy-MM-dd HH:mm:ss'}}</td>
<td>{{data.createTime | date : 'yyyy-MM-dd HH:mm:ss'}}</td>
<td>{{data.useEndTime | date : 'yyyy-MM-dd HH:mm:ss'}}</td>
</tr>
</tbody>
</nz-table>
</div>

@ -0,0 +1,7 @@
img {
width: 60px;
}
.fontColor {
color: red;
}

@ -0,0 +1,28 @@
/* tslint:disable:no-unused-variable */
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { DebugElement } from '@angular/core';
import { GiveCouponsComponent } from './give-coupons.component';
describe('GiveCouponsComponent', () => {
let component: GiveCouponsComponent;
let fixture: ComponentFixture<GiveCouponsComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ GiveCouponsComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(GiveCouponsComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

@ -0,0 +1,90 @@
import { Component, OnInit } from '@angular/core';
import {environment} from '../../../../environments/environment';
import {CompanyService} from '../../../services/company.service';
import {LocalStorageService} from '../../../services/local-storage.service';
import {ADMIN_INFO_OBJECT} from '../../../services/local-storage.namespace';
import {CommonsService} from '../../../services/commons.service';
import {OrderMobileRechargeService} from '../../../services/order/order-mobile-recharge.service';
import {FormBuilder, FormGroup} from '@angular/forms';
import {NzMessageService, NzNotificationService} from 'ng-zorro-antd';
import {animate, state, style, transition, trigger} from '@angular/animations';
import { OrderService } from 'src/app/services/order.service';
@Component({
selector: 'app-give-coupons',
templateUrl: './give-coupons.component.html',
styleUrls: ['./give-coupons.component.scss']
})
export class GiveCouponsComponent implements OnInit {
// 搜索框
searchForm: FormGroup;
// 列表相关参数
// 总条数
total: number;
// 页码
pageNum = 1;
// 条码
pageSize = 10;
// 列表数据
requestData = [];
// 列表加载
loading = true;
// 数据加载中参数
loadingObject = {
title: '加载中...',
status: false,
};
constructor(
private form: FormBuilder,
private store: LocalStorageService,
private message: NzMessageService,
private orderMobileRechargeService: OrderMobileRechargeService,
private orderService: OrderService,
private commonsService: CommonsService,
private notification: NzNotificationService,
) { }
ngOnInit(): void {
// 搜索表单初始化
this.searchForm = this.form.group({
discountName: [null],
status: [null],
});
// 查询代理商赠送优惠券
this.getRequest(true, this.searchForm.value);
}
// 查询列表
public getRequest(reset: boolean = false, whereObject: object) {
this.loading = true;
if (reset) {
this.pageNum = 1;
}
whereObject['pageNum'] = this.pageNum;
whereObject['pageSize'] = this.pageSize;
this.orderService.getAgentDiscountList(whereObject, data => {
this.loading = false;
if (data['return_code'] === '000000') {
this.requestData = data['return_data'].list;
this.total = data['return_data'].total;
} else {
this.message.error(data['return_msg']);
}
});
}
}

@ -15,6 +15,7 @@ import {HltChargeOrderComponent} from './hlt-charge-order/hlt-charge-order.compo
import {GoodsOrderComponent} from './goods-order/goods-order.component';
import {GoodsChildOrderComponent} from './goods-child-order/goods-child-order.component';
import {ApiMerOrderListComponent} from "./api-mer-order-list/api-mer-order-list.component";
import { GiveCouponsComponent } from './give-coupons/give-coupons.component';
const routes: Routes = [
@ -33,6 +34,7 @@ const routes: Routes = [
{ path: 'goods-order', component: GoodsOrderComponent},
{ path: 'goods-child-order', component: GoodsChildOrderComponent},
{ path: 'api-mer-order', component: ApiMerOrderListComponent},
{path:'give-coupons',component:GiveCouponsComponent}
];
@NgModule({

@ -25,9 +25,12 @@ import { GoodsOrderComponent } from './goods-order/goods-order.component';
import {PreviewImageModule} from "../../common/preview-image/preview-image.module";
import { GoodsChildOrderComponent } from './goods-child-order/goods-child-order.component';
import { ApiMerOrderListComponent } from './api-mer-order-list/api-mer-order-list.component';
import { GiveCouponsComponent } from './give-coupons/give-coupons.component';
@NgModule({
declarations: [OrderOilListComponent, OrderCouponListComponent, OrderIntegralRechargeComponent, OrderRefundListComponent, KfcOrderListComponent, StarbucksOrderListComponent, MemberChargeOrderListComponent, MobileRechargeOrderListComponent, PreOrderComponent,DicountPackageOrderListComponent, MemberChargeOrderListComponent, DiscountUseConditionListComponent, HltChargeOrderComponent, GoodsOrderComponent, GoodsChildOrderComponent, ApiMerOrderListComponent],
declarations: [OrderOilListComponent, OrderCouponListComponent, OrderIntegralRechargeComponent, OrderRefundListComponent, KfcOrderListComponent, StarbucksOrderListComponent, MemberChargeOrderListComponent, MobileRechargeOrderListComponent, PreOrderComponent,DicountPackageOrderListComponent, MemberChargeOrderListComponent, DiscountUseConditionListComponent, HltChargeOrderComponent, GoodsOrderComponent, GoodsChildOrderComponent, ApiMerOrderListComponent,
GiveCouponsComponent
],
imports: [
CommonModule,
OrderManageRoutingModule,

@ -25,6 +25,8 @@ import {
DiscountStatusPipe,
DisplayAreaPipe,
DiscountCodeStatusPipe,
DiscountCodeStatusPipe2,
PhoneTranslate,
RechargePricePipe,
RechargeStatusPipe,
ChannelMarkPipe,
@ -100,6 +102,8 @@ const PIPES = [
DiscountStatusPipe,
DisplayAreaPipe,
DiscountCodeStatusPipe,
DiscountCodeStatusPipe2,
PhoneTranslate,
RechargePricePipe,
RechargeStatusPipe,
ChannelMarkPipe,

@ -21,3 +21,37 @@ export class DiscountCodeStatusPipe implements PipeTransform {
}
}
@Pipe({
name: 'discountCodeStatus2'
})
export class DiscountCodeStatusPipe2 implements PipeTransform {
transform(value: number): string {
switch (value) {
case 0:
return '已过期';
case 1:
return '未使用';
case 2:
return '已使用';
}
}
}
@Pipe({
name: 'phoneTranslate'
})
export class PhoneTranslate implements PipeTransform {
transform(value: string): string {
if(value&&value.length==11){
return value.substring(0, 3) + "****"+value.substring(7, 11);
}else{
return value
}
}
}

@ -333,4 +333,13 @@ export class OrderService {
callBack(data);
});
}
/*
*/
public getAgentDiscountList(param: object , callBack) {
this.http.get(environment.baseUrl + '/discount/getAgentDiscountList?'+ this.common.getWhereCondition(param)).subscribe( data => {
callBack(data);
});
}
}

@ -6,7 +6,7 @@ export const environment = {
production: false,
// baseUrl: 'http://localhost:9302/brest/', // 测试环境服务器地址(请求数据地址)
// orderUrl: 'http://localhost:9304/order/', // 测试环境服务器地址(请求数据地址)
baseUrl: 'https://hsg.dctpay.com/brest/', // 测试环境服务器地址(请求数据地址)
baseUrl: 'https://hsgcs.dctpay.com/brest/', // 测试环境服务器地址(请求数据地址)
// orderUrl: 'https://hsg.dctpay.com/order/', // 测试环境服务器地址(请求数据地址)
orderUrl: 'https://hsgcs.dctpay.com/order/', // 测试环境服务器地址(请求数据地址)
imageUrl: 'https://hsgcs.dctpay.com/filesystem/',

Loading…
Cancel
Save