From 6ffa59f4fcb0acd7f2b642466130ee1007023646 Mon Sep 17 00:00:00 2001 From: youmengting <2080639302@qq.com> Date: Tue, 26 Dec 2023 16:01:59 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E4=B8=8B=E8=8F=9C=E5=8D=95=EF=BC=9A=E8=B5=A0?= =?UTF-8?q?=E9=80=81=E4=BC=98=E6=83=A0=E5=88=B8=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../give-coupons/give-coupons.component.html | 85 ++++++++++++++++++ .../give-coupons/give-coupons.component.scss | 7 ++ .../give-coupons.component.spec.ts | 28 ++++++ .../give-coupons/give-coupons.component.ts | 90 +++++++++++++++++++ .../order-manage-routing.module.ts | 2 + .../admin/order-manage/order-manage.module.ts | 5 +- src/app/app-common.module.ts | 4 + src/app/pipes/discount-code-status.pipe.ts | 34 +++++++ src/app/services/order.service.ts | 9 ++ src/environments/environment.ts | 2 +- 10 files changed, 264 insertions(+), 2 deletions(-) create mode 100644 src/app/admin/order-manage/give-coupons/give-coupons.component.html create mode 100644 src/app/admin/order-manage/give-coupons/give-coupons.component.scss create mode 100644 src/app/admin/order-manage/give-coupons/give-coupons.component.spec.ts create mode 100644 src/app/admin/order-manage/give-coupons/give-coupons.component.ts 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/', From def4c93e3f07dd15bf15e6f15269a959934334a8 Mon Sep 17 00:00:00 2001 From: youmengting <2080639302@qq.com> Date: Tue, 26 Dec 2023 16:46:37 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E8=B5=A0=E9=80=81=E4=BC=98=E6=83=A0?= =?UTF-8?q?=E5=88=B8=E5=88=97=E8=A1=A8=EF=BC=9A=E6=9A=82=E4=B8=8D=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E4=BC=98=E6=83=A0=E9=87=91=E9=A2=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../order-manage/give-coupons/give-coupons.component.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 index bfbbee7..9418b47 100644 --- a/src/app/admin/order-manage/give-coupons/give-coupons.component.html +++ b/src/app/admin/order-manage/give-coupons/give-coupons.component.html @@ -59,7 +59,7 @@ 优惠券名称 优惠券类型 - 优惠金额 + 用户手机号 状态 使用时间 @@ -71,7 +71,7 @@ {{data.discountName}} {{data.discountType | discountType}} - {{data.discountPrice}} + {{data.ext3 | phoneTranslate}} {{data.status | discountCodeStatus2}} {{data.useTime | date : 'yyyy-MM-dd HH:mm:ss'}} From 37e9cac65b08fcf1e1bb87322aeac5e0185ace7c Mon Sep 17 00:00:00 2001 From: youmengting <2080639302@qq.com> Date: Fri, 29 Dec 2023 14:51:17 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=AB=98=E5=BE=B7?= =?UTF-8?q?=E5=9C=B0=E5=9B=BE=E7=9A=84key=E8=BF=87=E6=9C=9F,=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=AF=86=E9=92=A5=E9=85=8D=E7=BD=AE=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/index.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/index.html b/src/index.html index 4c366ef..bb6df91 100644 --- a/src/index.html +++ b/src/index.html @@ -5,7 +5,8 @@ 嗨森逛 - + +