diff --git a/src/app/admin/order-manage/give-coupons/give-coupons.component.html b/src/app/admin/order-manage/give-coupons/give-coupons.component.html new file mode 100644 index 0000000..bfbbee7 --- /dev/null +++ b/src/app/admin/order-manage/give-coupons/give-coupons.component.html @@ -0,0 +1,85 @@ + + + + +
+
+
+
+
+ + 优惠券名称 + + + + +
+
+ + 状态 + + + + + + + + +
+
+
+
+ +
+
+
+
+
+ + + +
+ 共计 {{total?total:0}} 条数据 + + + + + 优惠券名称 + 优惠券类型 + 优惠金额 + 用户手机号 + 状态 + 使用时间 + 创建时间 + 使用截止时间 + + + + + {{data.discountName}} + {{data.discountType | discountType}} + {{data.discountPrice}} + {{data.ext3 | phoneTranslate}} + {{data.status | discountCodeStatus2}} + {{data.useTime | date : 'yyyy-MM-dd HH:mm:ss'}} + {{data.createTime | date : 'yyyy-MM-dd HH:mm:ss'}} + {{data.useEndTime | date : 'yyyy-MM-dd HH:mm:ss'}} + + + +
+ + diff --git a/src/app/admin/order-manage/give-coupons/give-coupons.component.scss b/src/app/admin/order-manage/give-coupons/give-coupons.component.scss new file mode 100644 index 0000000..3043a17 --- /dev/null +++ b/src/app/admin/order-manage/give-coupons/give-coupons.component.scss @@ -0,0 +1,7 @@ +img { + width: 60px; + } + .fontColor { + color: red; + } + \ No newline at end of file diff --git a/src/app/admin/order-manage/give-coupons/give-coupons.component.spec.ts b/src/app/admin/order-manage/give-coupons/give-coupons.component.spec.ts new file mode 100644 index 0000000..7a065c2 --- /dev/null +++ b/src/app/admin/order-manage/give-coupons/give-coupons.component.spec.ts @@ -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; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ GiveCouponsComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(GiveCouponsComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/admin/order-manage/give-coupons/give-coupons.component.ts b/src/app/admin/order-manage/give-coupons/give-coupons.component.ts new file mode 100644 index 0000000..1461bfe --- /dev/null +++ b/src/app/admin/order-manage/give-coupons/give-coupons.component.ts @@ -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']); + } + }); + } + + +} diff --git a/src/app/admin/order-manage/order-manage-routing.module.ts b/src/app/admin/order-manage/order-manage-routing.module.ts index b1fb09d..38b090a 100644 --- a/src/app/admin/order-manage/order-manage-routing.module.ts +++ b/src/app/admin/order-manage/order-manage-routing.module.ts @@ -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({ diff --git a/src/app/admin/order-manage/order-manage.module.ts b/src/app/admin/order-manage/order-manage.module.ts index d01212e..417f808 100644 --- a/src/app/admin/order-manage/order-manage.module.ts +++ b/src/app/admin/order-manage/order-manage.module.ts @@ -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, diff --git a/src/app/app-common.module.ts b/src/app/app-common.module.ts index 162724a..197c99d 100644 --- a/src/app/app-common.module.ts +++ b/src/app/app-common.module.ts @@ -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, diff --git a/src/app/pipes/discount-code-status.pipe.ts b/src/app/pipes/discount-code-status.pipe.ts index ac390ef..b980386 100644 --- a/src/app/pipes/discount-code-status.pipe.ts +++ b/src/app/pipes/discount-code-status.pipe.ts @@ -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 + } + + } + +} \ No newline at end of file diff --git a/src/app/services/order.service.ts b/src/app/services/order.service.ts index 97d1495..5efb3c8 100644 --- a/src/app/services/order.service.ts +++ b/src/app/services/order.service.ts @@ -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); + }); + } } diff --git a/src/environments/environment.ts b/src/environments/environment.ts index fd50ef6..d25e70f 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -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/',