diff --git a/src/app/pages/index/index/index.component.html b/src/app/pages/index/index/index.component.html index 54c2e44..71219fc 100644 --- a/src/app/pages/index/index/index.component.html +++ b/src/app/pages/index/index/index.component.html @@ -1,64 +1,6 @@ -

首页

-

首页

-

首页

-

首页

-

首页

-

首页

-

首页

-

首页

-

首页

-

首页

-

首页

-

首页

-

首页

-

首页

-

首页

-

首页

-

首页

-

首页

-

首页

-

首页

-

首页

-

首页

-

首页

-

首页

-

首页

-

首页

-

首页

-

首页

-

首页

-

首页

-

首页

-

首页

-

首页

-

首页

-

首页

-

首页

-

首页

-

首页

-

首页

-

首页

-

首页

-

首页

-

首页

-

首页

-

首页

-

首页

-

首页

-

首页

-

首页

-

首页

-

首页

-

首页

-

首页

-

首页

-

首页

-

首页

-

首页

-

首页

-

首页

-

首页

-

首页

-

首页

-

首页

-

首页

+ + + diff --git a/src/app/pages/index/index/index.component.ts b/src/app/pages/index/index/index.component.ts index 00c144f..c75d7da 100644 --- a/src/app/pages/index/index/index.component.ts +++ b/src/app/pages/index/index/index.component.ts @@ -1,6 +1,7 @@ import { Component } from '@angular/core'; import {NzTabComponent, NzTabSetComponent} from "ng-zorro-antd/tabs"; -import {NgForOf} from "@angular/common"; +import {NgForOf, NgOptimizedImage} from "@angular/common"; +import {NzResultComponent} from "ng-zorro-antd/result"; @Component({ selector: 'app-index', @@ -8,7 +9,9 @@ import {NgForOf} from "@angular/common"; imports: [ NzTabSetComponent, NzTabComponent, - NgForOf + NgForOf, + NgOptimizedImage, + NzResultComponent ], templateUrl: './index.component.html', styleUrl: './index.component.less' diff --git a/src/app/pages/merchant/mer-list/mer-list.component.html b/src/app/pages/merchant/mer-list/mer-list.component.html index bee5478..af0465e 100644 --- a/src/app/pages/merchant/mer-list/mer-list.component.html +++ b/src/app/pages/merchant/mer-list/mer-list.component.html @@ -84,6 +84,7 @@ @@ -194,3 +195,91 @@ + + + + + + + + + +
+
+ + + + 支付平台 + 支付参数 + 创建时间 + 操作 + + + + + {{data.payPlatform | payPlatform}} + + +

惠支付商户号:{{ data.payMerNo }}

+

惠支付商户key:{{ data.payMerKey }}

+
+ +

汇联通终端号:{{ data.hltInstCode }}

+

汇联通商户号:{{ data.hltMerNo }}

+
+ + + {{ data.createTime | date: 'yyyy-MM-dd HH:mm'}} + + 修改 + + 删除 + + + +
+ +
+
+ + + + + +
+ + 类型 + + + + + + + + + 惠支付商户号 + + + + + + 惠支付商户key + + + + + + 汇联通终端号 + + + + + + 汇联通商户号 + + + + +
+
+
diff --git a/src/app/pages/merchant/mer-list/mer-list.component.ts b/src/app/pages/merchant/mer-list/mer-list.component.ts index 476b739..dd055e5 100644 --- a/src/app/pages/merchant/mer-list/mer-list.component.ts +++ b/src/app/pages/merchant/mer-list/mer-list.component.ts @@ -29,6 +29,10 @@ import {NzAvatarModule} from "ng-zorro-antd/avatar"; import {MerService} from "../../../services/merchant/mer.service"; import {RoleService} from "../../../services/role/role.service"; import {NzImageModule} from "ng-zorro-antd/image"; +import {GoodsTypeData} from "../../../model/goods.interface"; +import {NzPopconfirmDirective} from "ng-zorro-antd/popconfirm"; +import {NzTypographyComponent} from "ng-zorro-antd/typography"; +import {payPlatform} from "../../../pipes/mer/payPlatform.pipe"; @Component({ selector: 'app-mer-list', @@ -70,7 +74,10 @@ import {NzImageModule} from "ng-zorro-antd/image"; NzDescriptionsModule, NzUploadComponent, NzAvatarModule, - NzImageModule + NzImageModule, + NzPopconfirmDirective, + NzTypographyComponent, + payPlatform ], templateUrl: './mer-list.component.html', styleUrl: './mer-list.component.less' @@ -97,6 +104,13 @@ export class MerListComponent { uploadLoading = false; updateMerVisible = false; updateMerForm: FormGroup; + merPayConfig:any + // 编辑商品规格弹出框 + isVisiblePay = false; + nodesPayConfig: any; + editPayForm: FormGroup; + // 编辑弹出框 + isVisibleEdit = false; constructor(private fb: NonNullableFormBuilder, private merService: MerService, @@ -123,6 +137,17 @@ export class MerListComponent { address: [''], }); + // 初始化 + this.editPayForm = this.fb.group({ + merId: [''], + payPlatform: ['' , [Validators.required]], + payMerNo: [''], + payMerKey: [''], + hltInstCode: [''], + hltMerNo: [''], + id: [null], + }); + // 获取角色数据 this.roleService.queryAllRole((data: any) => { this.roleData = data['return_data']; @@ -315,4 +340,101 @@ export class MerListComponent { }); }; + + + + // 弹出 + showPayList(data: any): void { + console.log(data); + this.merPayConfig = data; + this.isVisiblePay = true; + this.getPayList(); + } + + // 查询规格列表 + getPayList(): void { + let params = { + merNo: this.merPayConfig?.merNo, + time: new Date().getTime() + } + this.merService.queryMerPayConfig(params , (data: any) => { + if (data['return_code'] == '000000') { + this.nodesPayConfig = data['return_data']; + } + }); + } + + // 唤醒编辑表单 + showEdit(item?: GoodsTypeData) { + if (item != null) { + this.editPayForm.patchValue(item); + + } else { + this.editPayForm.reset(); + } + this.isVisibleEdit = true; + } + + // 编辑表单提交 + handleEdit(): void { + + if (this.editPayForm.valid) { + this.editPayForm.value.merId = this.merPayConfig.id; + this.merService.editPayConfig(this.editPayForm.value , (data: any) => { + if (data['return_code'] === '000000') { + this.message.success("成功!"); + this.isVisibleEdit = false; + this.getPayList(); + } else { + this.message.error(data['return_msg']); + } + }); + } else { + Object.values(this.editPayForm.controls).forEach(control => { + if (control.invalid) { + console.log("control" , control) + control.markAsDirty(); + control.updateValueAndValidity({ onlySelf: true }); + } + }); + } + + } + + // 删除 + delete(id: number): void { + this.merService.delete(id , (data: any) => { + if (data['return_code'] === '000000') { + this.message.success("成功!"); + this.getPayList(); + } else { + this.message.error(data['return_msg']); + } + }); + } + + payTypeChange(type: string): void { + // 清除必填 + this.editPayForm.controls['payMerNo'].clearValidators(); + this.editPayForm.controls['payMerKey'].clearValidators(); + this.editPayForm.controls['hltInstCode'].clearValidators(); + this.editPayForm.controls['hltMerNo'].clearValidators(); + + if (type == "1") { + // 增加必填 + this.editPayForm.controls['payMerNo'].setValidators(Validators.required); + this.editPayForm.controls['payMerKey'].setValidators(Validators.required); + + } else if (type == "2") { + // 增加必填 + this.editPayForm.controls['hltInstCode'].setValidators(Validators.required); + this.editPayForm.controls['hltMerNo'].setValidators(Validators.required); + + } + this.editPayForm.controls['hltInstCode'].updateValueAndValidity(); + this.editPayForm.controls['hltMerNo'].updateValueAndValidity(); + this.editPayForm.controls['payMerNo'].updateValueAndValidity(); + this.editPayForm.controls['payMerKey'].updateValueAndValidity(); + } + } diff --git a/src/app/pipes/mer/payPlatform.pipe.ts b/src/app/pipes/mer/payPlatform.pipe.ts new file mode 100644 index 0000000..798a11a --- /dev/null +++ b/src/app/pipes/mer/payPlatform.pipe.ts @@ -0,0 +1,22 @@ +import { Pipe, PipeTransform } from '@angular/core'; + +@Pipe({ + name: 'payPlatform', + standalone: true +}) +export class payPlatform implements PipeTransform { + + transform(value: number): any { + switch (value) { + case 1: + return '惠支付'; + case 2: + return '工会卡'; + default: + return '未知支付类型' + } + } + + + +} diff --git a/src/app/services/merchant/mer.service.ts b/src/app/services/merchant/mer.service.ts index 75a5ba5..6ceccd6 100644 --- a/src/app/services/merchant/mer.service.ts +++ b/src/app/services/merchant/mer.service.ts @@ -68,4 +68,30 @@ export class MerService { callBack(data); }); } + + + /** + * 查询商户列表 + * @param params + * @param callBack + */ + public queryMerPayConfig(params: any, callBack:any) { + params.time = new Date().getTime(); + this.http.get(environment.baseUrl + 'mer/queryMerPayConfig?' + ObjectData.objectByString(params)).subscribe(data => { + callBack(data); + }); + } + + public editPayConfig(params: any, callBack:any) { + params.time = new Date().getTime(); + this.http.post(environment.baseUrl + 'mer/editPayConfig', params).subscribe(data => { + callBack(data); + }); + } + + public delete(id: number, callBack:any) { + this.http.get(environment.baseUrl + 'mer/delete?id=' + id ).subscribe(data => { + callBack(data); + }); + } } diff --git a/src/assets/home/home.png b/src/assets/home/home.png new file mode 100644 index 0000000..05efb6e Binary files /dev/null and b/src/assets/home/home.png differ diff --git a/src/environments/environment.ts b/src/environments/environment.ts index efdd6ff..20bafc1 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -4,14 +4,14 @@ export const environment = { production: false, - baseUrl: 'https://phg.dctpay.com/brest/', // 测试环境服务器地址(请求数据地址) - orderUrl: 'https://phg.dctpay.com/order/', // 测试环境服务器地址(请求数据地址) - userUrl: 'https://phg.dctpay.com/user/', // 测试环境服务器地址(请求数据地址) - imageUrl: 'https://phg.obs.cn-southwest-2.myhuaweicloud.com/', - // baseUrl: 'http://localhost:9702/brest/', // 测试环境服务器地址(请求数据地址) - // orderUrl: 'http://localhost:9703/order/', // 测试环境服务器地址(请求数据地址) - // userUrl: 'http://localhost:9704/user/', // 测试环境服务器地址(请求数据地址) - // imageUrl: 'https://phgcs.dctpay.com/filesystem/', + // baseUrl: 'https://phg.dctpay.com/brest/', // 测试环境服务器地址(请求数据地址) + // orderUrl: 'https://phg.dctpay.com/order/', // 测试环境服务器地址(请求数据地址) + // userUrl: 'https://phg.dctpay.com/user/', // 测试环境服务器地址(请求数据地址) + // imageUrl: 'https://phg.obs.cn-southwest-2.myhuaweicloud.com/', + baseUrl: 'http://localhost:9702/brest/', // 测试环境服务器地址(请求数据地址) + orderUrl: 'http://localhost:9703/order/', // 测试环境服务器地址(请求数据地址) + userUrl: 'http://localhost:9704/user/', // 测试环境服务器地址(请求数据地址) + imageUrl: 'https://phgcs.dctpay.com/filesystem/', };