From c8af1bd39d460c9e28e1f6e1f192dc58c510b749 Mon Sep 17 00:00:00 2001 From: Sum1Dream <418471657@qq.com> Date: Tue, 10 Jan 2023 16:38:25 +0800 Subject: [PATCH] 1 --- .../cms-content/cms-content.component.html | 45 ++-- .../cms/cms-content/cms-content.component.ts | 3 +- .../third-product.component.html | 24 +- .../discount-edit.component.html | 4 +- .../discount-edit/discount-edit.component.ts | 8 +- .../discount-list.component.html | 16 +- .../discount-list/discount-list.component.ts | 206 +++++++++--------- .../pipes/third-product/product-type.pipe.ts | 9 +- 8 files changed, 160 insertions(+), 155 deletions(-) diff --git a/src/app/admin/cms/cms-content/cms-content.component.html b/src/app/admin/cms/cms-content/cms-content.component.html index e921755..8975d1e 100644 --- a/src/app/admin/cms/cms-content/cms-content.component.html +++ b/src/app/admin/cms/cms-content/cms-content.component.html @@ -86,28 +86,27 @@ + [(nzPageIndex)]="pageNum" + [(nzPageSize)]="pageSize" + [nzScroll]="{ x: '1200px' }" + (nzPageIndexChange)="getRequest(false , searchForm.value)" + (nzPageSizeChange)="getRequest(false , searchForm.value)"> - + - 分类名称 - 内容标题 - 展示平台 - 状态 - 创建时间 - 操作 + 分类名称 + 内容标题 + 展示平台 + 创建时间 + 状态 + 操作 @@ -115,10 +114,8 @@ {{data.tag}} {{data.title}} {{data.platform | showType}} - - {{data.status == 1 ? '编辑中' : '已发布'}} - - {{data.createTime | date:'yyyy-MM-dd' }} + {{data.createTime | date:'yyyy-MM-dd hh:mm' }} + {{data.status == 1 ? '编辑中' : '已发布'}} 更多操作 @@ -209,7 +206,13 @@ 跳转路径 - + + + + + 跳转详情路径 + + diff --git a/src/app/admin/cms/cms-content/cms-content.component.ts b/src/app/admin/cms/cms-content/cms-content.component.ts index 408578c..f54c81b 100644 --- a/src/app/admin/cms/cms-content/cms-content.component.ts +++ b/src/app/admin/cms/cms-content/cms-content.component.ts @@ -67,6 +67,7 @@ export class CmsContentComponent implements OnInit { title: [null, [Validators.required]], platform: [null], platformArray: [null], + ext1: [null], sortId: [null, [Validators.required]], description: [null, [Validators.required]], jumpType: [null], @@ -87,7 +88,7 @@ export class CmsContentComponent implements OnInit { } whereObject['pageNum'] = this.pageNum; whereObject['pageSize'] = this.pageSize; - this.cms.getListContent(whereObject, data => { + this.cms.getListCmsContent(whereObject, data => { console.log(data); this.loading = false; if (data['return_code'] === '000000') { diff --git a/src/app/admin/config-manage/third-product/third-product.component.html b/src/app/admin/config-manage/third-product/third-product.component.html index e163ad0..aaf8668 100644 --- a/src/app/admin/config-manage/third-product/third-product.component.html +++ b/src/app/admin/config-manage/third-product/third-product.component.html @@ -14,17 +14,6 @@ - - - - - - - - - - - @@ -61,7 +50,6 @@ 编号 - 产品类型 产品名称 利润比例 @@ -75,9 +63,8 @@ {{i + 1}} - {{data.productName}} - + {{data.productType | productType : data.productId}} {{data.discount == null ? '暂未配置' : data.discount + "%"}} {{data.integralDiscount == null ? '0' : data.integralDiscount + "%"}} {{data.productPayTypeString.substring(0 , data.productPayTypeString.length - 1)}} @@ -104,13 +91,14 @@ - - - + + + + - + 卡券来源 diff --git a/src/app/admin/discount/discount-edit/discount-edit.component.html b/src/app/admin/discount/discount-edit/discount-edit.component.html index 6fec6ac..e27b0bb 100644 --- a/src/app/admin/discount/discount-edit/discount-edit.component.html +++ b/src/app/admin/discount/discount-edit/discount-edit.component.html @@ -37,7 +37,7 @@ 优惠券使用范围 - + @@ -47,7 +47,7 @@ 优惠券使用归属 - + diff --git a/src/app/admin/discount/discount-edit/discount-edit.component.ts b/src/app/admin/discount/discount-edit/discount-edit.component.ts index 03ee809..9827bc4 100644 --- a/src/app/admin/discount/discount-edit/discount-edit.component.ts +++ b/src/app/admin/discount/discount-edit/discount-edit.component.ts @@ -28,8 +28,8 @@ export class DiscountEditComponent implements OnInit { editFlag = false; id: number; discountImg = []; - usingRange = []; - usingScope = []; + useScope = []; + usingAttribution = []; WEB_SERVE_URL = environment.baseUrl; previewImage: string | undefined = ''; previewVisible = false; @@ -69,11 +69,11 @@ export class DiscountEditComponent implements OnInit { }); this.commonsService.getDictionary('USING_RANGE', data => { - this.usingScope = data['return_data']; + this.useScope = data['return_data']; }); this.commonsService.getDictionary('USING_ATTRIBUTION', data => { - this.usingRange = data['return_data']; + this.usingAttribution = data['return_data']; }); } diff --git a/src/app/admin/discount/discount-list/discount-list.component.html b/src/app/admin/discount/discount-list/discount-list.component.html index c66c8d3..c03a5ec 100644 --- a/src/app/admin/discount/discount-list/discount-list.component.html +++ b/src/app/admin/discount/discount-list/discount-list.component.html @@ -7,7 +7,7 @@
-
+
优惠券KYE @@ -15,7 +15,7 @@
-
+
优惠券名称 @@ -23,7 +23,7 @@
-
+
优惠券类型 @@ -35,6 +35,16 @@
+
+ + 使用范围 + + + + + + +
diff --git a/src/app/admin/discount/discount-list/discount-list.component.ts b/src/app/admin/discount/discount-list/discount-list.component.ts index 805fce9..d613e38 100644 --- a/src/app/admin/discount/discount-list/discount-list.component.ts +++ b/src/app/admin/discount/discount-list/discount-list.component.ts @@ -1,7 +1,6 @@ -import { Component, OnInit } from '@angular/core'; +import {Component, OnInit} from '@angular/core'; import {environment} from '../../../../environments/environment'; import {FormBuilder, FormGroup} from '@angular/forms'; -import {AgentService} from '../../../services/agent.service'; import {IconService} from '../../../services/icon.service'; import {NzMessageService} from 'ng-zorro-antd'; import {Router} from '@angular/router'; @@ -11,119 +10,122 @@ import {CouponService} from '../../../services/coupon.service'; import {MerchantService} from '../../../services/merchant.service'; @Component({ - selector: 'app-discount-list', - templateUrl: './discount-list.component.html', - styleUrls: ['./discount-list.component.scss'] + selector: 'app-discount-list', + templateUrl: './discount-list.component.html', + styleUrls: ['./discount-list.component.scss'] }) export class DiscountListComponent implements OnInit { - WEB_SERVE_URL = environment.imageUrl; - searchForm: FormGroup; // 搜索框 - searchFormCoupon: FormGroup; // 搜索框 - requestData = []; // 列表数据 - couponData = []; // 列表数据 - optionList = []; // 列表数据 - discountCoupon = []; // 列表数据 - total: number; // 页码 - pageNum = 1; // 页码 - pageSize = 10; // 条码 - loading = true; - isVisible = false; - isVisibleList = false; - couponList: any; - requestCouponData = []; // 列表数据 - loadingCoupon = true; - loadingDiscountCoupon = true; - discountId: number; - RelByDiscountId: number; - - setOfCheckedId = new Set(); - checked = false; - indeterminate = false; - - updateCheckedSet(id: number, checked: boolean): void { - if (checked) { - this.setOfCheckedId.add(id); - } else { - this.setOfCheckedId.delete(id); + WEB_SERVE_URL = environment.imageUrl; + searchForm: FormGroup; // 搜索框 + searchFormCoupon: FormGroup; // 搜索框 + requestData = []; // 列表数据 + couponData = []; // 列表数据 + optionList = []; // 列表数据 + discountCoupon = []; // 列表数据 + total: number; // 页码 + pageNum = 1; // 页码 + pageSize = 10; // 条码 + loading = true; + isVisible = false; + isVisibleList = false; + couponList: any; + requestCouponData = []; // 列表数据 + loadingCoupon = true; + loadingDiscountCoupon = true; + discountId: number; + RelByDiscountId: number; + usingRange = []; + setOfCheckedId = new Set(); + checked = false; + indeterminate = false; + + updateCheckedSet(id: number, checked: boolean): void { + if (checked) { + this.setOfCheckedId.add(id); + } else { + this.setOfCheckedId.delete(id); + } } - } - - onItemChecked(id: number, checked: boolean): void { - this.updateCheckedSet(id, checked); - this.refreshCheckedStatus(); - } - - onAllChecked(value: boolean): void { - this.requestCouponData.forEach(item => this.updateCheckedSet(item.id, value)); - this.refreshCheckedStatus(); - } + onItemChecked(id: number, checked: boolean): void { + this.updateCheckedSet(id, checked); + this.refreshCheckedStatus(); + } + onAllChecked(value: boolean): void { + this.requestCouponData.forEach(item => this.updateCheckedSet(item.id, value)); + this.refreshCheckedStatus(); + } - refreshCheckedStatus(): void { - this.checked = this.requestCouponData.every(item => this.setOfCheckedId.has(item.id)); - this.indeterminate = this.requestCouponData.some(item => this.setOfCheckedId.has(item.id)) && !this.checked; - } - constructor( - private form: FormBuilder, - private discount: DiscountService, - private iconService: IconService, - private merchant: MerchantService, - private message: NzMessageService, - private router: Router, - private common: CommonsService, - private coupon: CouponService - ) { - } + refreshCheckedStatus(): void { + this.checked = this.requestCouponData.every(item => this.setOfCheckedId.has(item.id)); + this.indeterminate = this.requestCouponData.some(item => this.setOfCheckedId.has(item.id)) && !this.checked; + } - ngOnInit(): void { - this.init(); - const whereObject = {}; - whereObject['pageNum'] = 1; - whereObject['pageSize'] = 30000; - this.merchant.getMerchantList(whereObject , data => { - if (data['return_code'] === '000000' ) { - this.optionList = data['return_data'].list; - } - }); - } + constructor( + private form: FormBuilder, + private discount: DiscountService, + private iconService: IconService, + private merchant: MerchantService, + private message: NzMessageService, + private router: Router, + private common: CommonsService, + private coupon: CouponService + ) { + } - public init(): void { - this.searchForm = this.form.group({ - discountKey: [null], - discountName: [null], - discountType: [null], - }); - this.searchFormCoupon = this.form.group({ - merchantId: [null], - couponName: [null], - couponType: [null], - couponSource: [null], - status: [2], - }); - this.getRequest(true, this.searchForm.value); - } + ngOnInit(): void { + this.common.getDictionary('USING_RANGE', data => { + this.usingRange = data['return_data']; + }); + this.init(); + const whereObject = {}; + whereObject['pageNum'] = 1; + whereObject['pageSize'] = 30000; + this.merchant.getMerchantList(whereObject, data => { + if (data['return_code'] === '000000') { + this.optionList = data['return_data'].list; + } + }); + } - // 查询列表 - public getRequest(reset: boolean = false, whereObject: object) { + public init(): void { + this.searchForm = this.form.group({ + discountKey: [null], + discountName: [null], + useScope: [null], + discountType: [null], + }); + this.searchFormCoupon = this.form.group({ + merchantId: [null], + couponName: [null], + couponType: [null], + couponSource: [null], + status: [2], + }); + this.getRequest(true, this.searchForm.value); + } - this.loading = false; - if (reset) { - this.pageNum = 1; + // 查询列表 + public getRequest(reset: boolean = false, whereObject: object) { + + this.loading = false; + if (reset) { + this.pageNum = 1; + } + whereObject['pageNum'] = this.pageNum; + whereObject['pageSize'] = this.pageSize; + this.discount.getDiscountList(whereObject, data => { + if (data['return_code'] === '000000') { + this.requestData = data['return_data'].list; + this.total = data['return_data'].total; + } else { + this.message.error(data['return_msg']); + } + }); } - whereObject['pageNum'] = this.pageNum; - whereObject['pageSize'] = this.pageSize; - this.discount.getDiscountList(whereObject, data => { - if (data['return_code'] === '000000') { - this.requestData = data['return_data'].list; - this.total = data['return_data'].total; - } else { - this.message.error(data['return_msg']); - } - }); - } // 重置 public resetForm(): void { diff --git a/src/app/pipes/third-product/product-type.pipe.ts b/src/app/pipes/third-product/product-type.pipe.ts index 1202bc5..29e13cc 100644 --- a/src/app/pipes/third-product/product-type.pipe.ts +++ b/src/app/pipes/third-product/product-type.pipe.ts @@ -7,10 +7,11 @@ export class ProductTypePipe implements PipeTransform { array = { 1: ['星巴克'], - 2: ['', '肯德基'], - 3: ['', '', '第三方产品'], - 4: ['中石化', '消费券', '其他卡券' , '贵州中石化' , '重庆中石油'], - 5: ['', '', '', '', '在线加油'], + 2: ['肯德基'], + 3: ['第三方产品'], + 5: ['中石化', '消费券', '其他卡券' , '贵州中石化' , '重庆中石油'], + 6: ['在线加油'], + 7: ['优惠券包'], }; transform(type: number , product: number): string {