From 0db827cd6d2972564d352574d77befe3f868e366 Mon Sep 17 00:00:00 2001 From: yuanye Date: Thu, 30 Sep 2021 17:52:20 +0800 Subject: [PATCH 1/2] 1 --- .../activate-edit.component.html | 2 +- .../activate-edit/activate-edit.component.ts | 34 ++++++++++++------- src/app/services/activate.service.ts | 13 +++++++ 3 files changed, 35 insertions(+), 14 deletions(-) diff --git a/src/app/admin/activate/activate-edit/activate-edit.component.html b/src/app/admin/activate/activate-edit/activate-edit.component.html index 72c2b5d..8126a9b 100644 --- a/src/app/admin/activate/activate-edit/activate-edit.component.html +++ b/src/app/admin/activate/activate-edit/activate-edit.component.html @@ -167,7 +167,7 @@ - {{control.discountName}} + {{control.prizeName}} diff --git a/src/app/admin/activate/activate-edit/activate-edit.component.ts b/src/app/admin/activate/activate-edit/activate-edit.component.ts index 7f0a115..771aba4 100644 --- a/src/app/admin/activate/activate-edit/activate-edit.component.ts +++ b/src/app/admin/activate/activate-edit/activate-edit.component.ts @@ -42,7 +42,7 @@ export class ActivateEditComponent implements OnInit { agentName: null, prizeNum: null, prizeId: null, - discountName: null, + prizeName: null, loading : false }]; FILE_URL = environment.imageUrl; @@ -59,8 +59,6 @@ export class ActivateEditComponent implements OnInit { private message: NzMessageService, // 信息提示 private activatedRoute: ActivatedRoute, private agent: AgentService, - private discount: DiscountService, - private msg: NzMessageService, ) { } ngOnInit(): void { @@ -81,7 +79,6 @@ export class ActivateEditComponent implements OnInit { this.validateFormAward = this.fb.group({ name: [null, [Validators.required]], - img: [null, [Validators.required]], num: [null, [Validators.required]], }); @@ -134,7 +131,7 @@ export class ActivateEditComponent implements OnInit { } getDiscountName(id: number , i ) { - this.listOfControl[i].discountName = this.discountList.find(item => { + this.listOfControl[i].prizeName = this.discountList.find(item => { return item['highDiscount'].id == id; })['highDiscount'].discountName; console.log(this.listOfControl); @@ -255,7 +252,7 @@ export class ActivateEditComponent implements OnInit { agentName: null, prizeNum: null, prizeId: null, - discountName: null, + prizeName: null, loading : false }; this.listOfControl.push(control); @@ -299,13 +296,24 @@ export class ActivateEditComponent implements OnInit { return; } - this.validateForm.value.ruleArray = [{ - partakeMode: 1, - productType: 1 , - productIdArray: this.validateForm.value.productIdArray - }]; - - console.log(this.listOfControl); + this.validateFormAward.value.activityPrizes = this.listOfControl; + this.validateFormAward.value.activityInfoId = 7; + if (this.logoFile.length !== 0) { + if (this.logoFile[0]['response'] != null) { + this.validateFormAward.value.img = this.logoFile[0]['response']['return_data'][0]; + } else { + this.validateFormAward.value.img = this.logoFile[0].name; + } + } + console.log(this.validateFormAward.value); + this.activate.editActivityAward(this.validateFormAward.value , data => { + console.log(data); + if (data['return_code'] === '000000') { + this.message.success('编辑成功'); + } else { + this.message.create('error', '编辑失败'); + } + }); } diff --git a/src/app/services/activate.service.ts b/src/app/services/activate.service.ts index 665652c..f1c51bb 100644 --- a/src/app/services/activate.service.ts +++ b/src/app/services/activate.service.ts @@ -53,4 +53,17 @@ export class ActivateService { callBack(data); }); } + + /** + * @Author Sum1Dream + * @methodName editActivityInfo + * @Description //新增中奖名次 + * @Date 15:43 2021/9/30 + * @Param mod + **/ + public editActivityAward(params: object, callBack) { + this.http.post(environment.baseUrl + 'activityAward/editActivityAward', params).subscribe(data => { + callBack(data); + }); + } } From fde0cc92ddc06130bbfd9927d7d07686a30c0f41 Mon Sep 17 00:00:00 2001 From: yuanye Date: Thu, 30 Sep 2021 17:55:34 +0800 Subject: [PATCH 2/2] 1 --- src/app/services/activate.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/services/activate.service.ts b/src/app/services/activate.service.ts index 1180b0b..8148d28 100644 --- a/src/app/services/activate.service.ts +++ b/src/app/services/activate.service.ts @@ -66,7 +66,7 @@ export class ActivateService { callBack(data); }); } - + /** * @Author Sum1Dream * @methodName editActivityInfo