From 82fc004941b75520f64d428df940dd9df0a0be22 Mon Sep 17 00:00:00 2001 From: Sum1Dream <418471657@qq.com> Date: Mon, 30 May 2022 10:46:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=88=E5=B9=B6=E8=87=AA=E5=BB=BA=E7=AB=99?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=88=B0=E8=AF=9D=E8=B4=B9=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../order-list/order-list.component.html | 26 ++--- .../price-list/price-list.component.html | 110 ++++++++++++++---- .../price-list/price-list.component.ts | 79 +++++++++---- src/app/app-common.module.ts | 7 +- src/app/pipes/index.ts | 2 + src/app/services/recharge.service.ts | 8 +- src/environments/environment.ts | 4 +- 7 files changed, 163 insertions(+), 73 deletions(-) diff --git a/src/app/admin/recharge-order/order-list/order-list.component.html b/src/app/admin/recharge-order/order-list/order-list.component.html index 6d700a0..a89cab0 100644 --- a/src/app/admin/recharge-order/order-list/order-list.component.html +++ b/src/app/admin/recharge-order/order-list/order-list.component.html @@ -125,15 +125,15 @@
共计 {{total}} 条数据
- - - + + + + + + + + +
{{data.status | rechargeStatus}} 详情 - 再次充值 - 申请退款 + + @@ -215,10 +215,6 @@ {{data['refundTime'] | date: 'yyyy-MM-dd HH:mm:ss'}} {{data['status'] | rechargeStatus}} - - - - diff --git a/src/app/admin/recharge-order/price-list/price-list.component.html b/src/app/admin/recharge-order/price-list/price-list.component.html index 122d98a..b2bf4e8 100644 --- a/src/app/admin/recharge-order/price-list/price-list.component.html +++ b/src/app/admin/recharge-order/price-list/price-list.component.html @@ -23,7 +23,7 @@ 充值平台 - + @@ -41,6 +41,18 @@
+ + + + + + + + + + + +
充值方式 @@ -96,20 +108,25 @@ [nzTotal]="total" [(nzPageIndex)]="pageNum" [(nzPageSize)]="pageSize" + [nzScroll]="{ x: '1200px' }" (nzPageIndexChange)="getRequest(false , searchForm.value)" (nzPageSizeChange)="getRequest(false , searchForm.value)"> - 编号 - 充值金额 - 折扣比例 - 支付金额 - 展示区域 - 商品ID - 充值金额 - 支付金额 - 创建时间 - 操作 + 编号 + 充值金额 + 折扣比例 + 支付金额 + 积分抵扣比例 + 运营商 + 充值类型 + 充值平台 + 支付方式 + 展示平台 + 商品ID + 创建时间 + 状态 + 操作 @@ -118,16 +135,19 @@ {{data.rechargePrice}} {{data.discount + "%"}} {{data.payPrice}} + {{data.integralDiscount + "%"}} {{data.operatorType | rechargePrice}} {{data.rechargeType== 1? '快充':'慢充'}} - {{data.showType | showType}} - {{data.price}} - {{data.realPrice}} + {{data.rechargePlatform | rechargePlatform}} + {{data.productPayTypeString.substring(0 , data.productPayTypeString.length - 1)}} + {{data.productPlatformString.substring(0 , data.productPlatformString.length - 1)}} + {{data.goodsId == null ? '暂未配置' : data.goodsId}} {{data.createTime | date: 'yyyy-MM-dd HH:mm'}} - - 编辑 - {{data.status === 1 ? '售空': '禁用'}} - 删除 + {{data.status | priceStatus}} + + 编辑 + {{data.status === 1 ? '售空': '上线'}} + 删除 @@ -135,7 +155,7 @@ diff --git a/src/app/admin/recharge-order/price-list/price-list.component.ts b/src/app/admin/recharge-order/price-list/price-list.component.ts index 51419d6..903eccd 100644 --- a/src/app/admin/recharge-order/price-list/price-list.component.ts +++ b/src/app/admin/recharge-order/price-list/price-list.component.ts @@ -31,7 +31,7 @@ export class PriceListComponent implements OnInit { isVisible = false; id: number; edit = false; - + payPrice; isVisibleGoods = false; realPrice = 0; @@ -86,7 +86,7 @@ export class PriceListComponent implements OnInit { }); this.validateForm = this.form.group({ discount: [null, [Validators.required]], - integralDiscount: [null, [Validators.required]], + integralDiscount: [0], operatorType: [null, [Validators.required]], rechargePrices: [null, [Validators.required]], productPlatform: [null, [Validators.required]], @@ -94,6 +94,10 @@ export class PriceListComponent implements OnInit { rechargePlatform: [null, [Validators.required]], rechargeWay: [null, [Validators.required]], payType: [null, [Validators.required]], + rechargePrice: [null], + payPrice: [null], + sort: [null], + goodsId: [null], }); @@ -131,6 +135,10 @@ export class PriceListComponent implements OnInit { this.id = id; this.edit = true; this.recharge.findById(id, data => { + data['return_data']['productPlatform'] = data['return_data']['productPlatformString'].substring(0 , data['return_data']['productPlatformString'].length - 1).split(','); + data['return_data']['rechargePlatform'] = data['return_data']['rechargePlatform'].substring(1 , data['return_data']['rechargePlatform'].length - 1).split('-'); + data['return_data']['payType'] = data['return_data']['productPayTypeString'].substring(0 , data['return_data']['productPayTypeString'].length - 1).split(','); + data['return_data']['rechargePrices'] = ['1']; this.validateForm.patchValue(data['return_data']); this.isVisible = true; }); @@ -141,17 +149,8 @@ export class PriceListComponent implements OnInit { } } - // 查看详情 - public getDetail(id: number): void { - this.router.navigate(['/admin/company/company-detail'], { - queryParams: { - companyId: id - } - }).then(r => console.log(r)); - } - - handleOk(): void { + const wait = this.message.loading('提交中..', { nzDuration: 0 }).messageId; // tslint:disable-next-line:forin for (const i in this.validateForm.controls) { this.validateForm.controls[i].markAsDirty(); @@ -166,6 +165,7 @@ export class PriceListComponent implements OnInit { this.validateForm.value['id'] = this.id; this.recharge.updatePrice(this.validateForm.value, data => { if (data['return_code'] === '000000') { + this.message.remove(wait); this.message.success('修改成功'); this.getRequest(false, this.searchForm.value); this.validateForm.reset(); @@ -177,6 +177,7 @@ export class PriceListComponent implements OnInit { } else { this.recharge.insertPrice(this.validateForm.value, data => { if (data['return_code'] === '000000') { + this.message.remove(wait); this.message.success('添加成功'); this.getRequest(false, this.searchForm.value); this.isVisible = false; @@ -190,33 +191,59 @@ export class PriceListComponent implements OnInit { } handleCancel(): void { + this.validateForm.reset(); this.isVisible = false; } - public getForbiddenUser(id, status: any): void { - - const message = (status === 1 ? '是否禁用' : '是否启用'); + public getForbiddenUser(idPost, status: any): void { + + let statusPost; + let message; + + switch (status) { + case 1: + statusPost = 2; + message = '是否售空'; + break; + case 2: + statusPost = 1; + message = '是否上线'; + break; + case 3: + statusPost = 1; + message = '是否上线'; + break; + } - this.common.showConfirm(message, data => { - if (data) { - this.recharge.onAndOffShelves(id, dataUser => { - if (dataUser['return_code'] === '000000') { - this.message.success('操作成功'); - this.getRequest(false , this.searchForm.value); + this.common.showConfirm(message, item => { + if (item) { + this.recharge.editPriceStatus( { + id: idPost, + status: statusPost + }, data => { + if (data['return_code'] === '000000') { + this.message.success('提交成功'); + this.getRequest(false, this.searchForm.value); } else { - this.message.error(dataUser['return_msg']); + this.message.error(data['return_msg']); } }); } }); + console.log(status); + console.log(statusPost); + console.log(message); } - public getForbiddenUserD(id): void { + public getForbiddenUserD(idPost): void { this.common.showConfirm('是否删除', item => { if (item) { - this.recharge.deletePrice(id, data => { + this.recharge.editPriceStatus({ + id: idPost, + status: 0 + }, data => { if (data['return_code'] === '000000') { this.message.success('删除成功'); this.getRequest(false, this.searchForm.value); @@ -228,7 +255,9 @@ export class PriceListComponent implements OnInit { }); } - + public changePayType(e): void { + this.payPrice = this.validateForm.value['rechargePrice'] * e / 100; + } } diff --git a/src/app/app-common.module.ts b/src/app/app-common.module.ts index 43159ee..6cddee7 100644 --- a/src/app/app-common.module.ts +++ b/src/app/app-common.module.ts @@ -45,6 +45,8 @@ import { } from './pipes'; import {OilCardStatusPipe} from "./pipes/oil-card/oil-card-status.pipe"; import { OilTypePipe } from './pipes/store/oil-type.pipe'; +import { RechargePlatformPipe } from './pipes/recharge-price/recharge-platform.pipe'; +import { PriceStatusPipe } from './pipes/recharge-price/price-status.pipe'; @@ -86,6 +88,9 @@ const PIPES = [ OilCardBindStatusPipe, OilCardRecordTypePipe, OilCardRecordSourceTypePipe, + OilTypePipe, + RechargePlatformPipe, + PriceStatusPipe, ]; @@ -99,8 +104,6 @@ const PIPES = [ ], declarations: [ ...PIPES, - OilTypePipe, - ], exports: [ diff --git a/src/app/pipes/index.ts b/src/app/pipes/index.ts index 7481d5f..bd61671 100644 --- a/src/app/pipes/index.ts +++ b/src/app/pipes/index.ts @@ -32,3 +32,5 @@ export * from './oil-card/oil-card-status.pipe'; export * from './oil-card/oil-card-bind-status.pipe'; export * from './oil-card/oil-card-record-type.pipe'; export * from './oil-card/oil-card-record-source-type.pipe'; +export * from './recharge-price/recharge-platform.pipe'; +export * from './recharge-price/price-status.pipe'; diff --git a/src/app/services/recharge.service.ts b/src/app/services/recharge.service.ts index 756f6ae..9e5c3ad 100644 --- a/src/app/services/recharge.service.ts +++ b/src/app/services/recharge.service.ts @@ -28,13 +28,13 @@ export class RechargeService { /** * @Author Sum1Dream - * @methodName deletePrice - * @Description //上下架 + * @methodName editPriceStatus + * @Description // 修改价格状态 * @Date 15:03 2021/8/12 * @Param mod **/ - public onAndOffShelves(id: number, callBack) { - this.http.get(environment.baseUrl + 'outRechargePrice/onAndOffShelves?id=' + id).subscribe(data => { + public editPriceStatus(params: object, callBack) { + this.http.post(environment.baseUrl + 'outRechargePrice/editPriceStatus' , params ).subscribe(data => { callBack(data); }); } diff --git a/src/environments/environment.ts b/src/environments/environment.ts index 21ad46f..5a795b3 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -6,8 +6,8 @@ export const environment = { production: false, // baseUrl: 'http://localhost:9302/brest/', // 测试环境服务器地址(请求数据地址) // imageUrl: 'http://localhost:9302/filesystem/', - baseUrl: 'https://hsgcs.dctpay.com/brest/', // 测试环境服务器地址(请求数据地址) - imageUrl: 'https://hsgcs.dctpay.com/filesystem/', + baseUrl: 'https://hsg.dctpay.com/brest/', // 测试环境服务器地址(请求数据地址) + imageUrl: 'https://hsg.dctpay.com/filesystem/', key: 'https://hsgcs.dctpay.com/phone-recharge-H5/index.html?codeValue=', inviteUrl: 'https://hsgcs.dctpay.com/wx/?action=ic&id=', };