From f681f5d881e949f64bc1be5a636259f9f0269be3 Mon Sep 17 00:00:00 2001
From: Sum1Dream <418471657@qq.com>
Date: Wed, 13 Oct 2021 17:27:26 +0800
Subject: [PATCH] 1
---
.../activate-edit.component.html | 4 +-
.../activate-edit.component.scss | 4 ++
.../activate-edit/activate-edit.component.ts | 40 +++++++++++---
.../activate-list.component.html | 2 +-
.../activate-lottery-record.component.html | 27 ++++++++++
.../activate-lottery-record.component.ts | 42 ++++++++++++++-
src/app/app-routing.module.ts | 2 +-
src/app/services/activate.service.ts | 54 +++++++++++++++++++
8 files changed, 161 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 8126a9b..0cb7436 100644
--- a/src/app/admin/activate/activate-edit/activate-edit.component.html
+++ b/src/app/admin/activate/activate-edit/activate-edit.component.html
@@ -90,9 +90,7 @@
{
return new Promise((resolve, reject) => {
@@ -35,7 +33,7 @@ export class ActivateEditComponent implements OnInit {
listOfOption: string[] = [];
listOfData = [];
agentData = [];
- current = 1;
+ current = 0;
listOfControl = [{
isEdit: true,
agentId: null,
@@ -192,6 +190,8 @@ export class ActivateEditComponent implements OnInit {
}
this.activate.editActivityInfo(this.validateForm.value, data => {
if (data['return_code'] === '000000') {
+ this.editFlag = true;
+ this.id = data['return_data'].id;
this.current += 1;
this.message.success('编辑成功');
} else {
@@ -212,6 +212,18 @@ export class ActivateEditComponent implements OnInit {
this.message.create('error', data['return_msg']);
}
});
+ this.getListByActivityId(id);
+
+ }
+
+ getListByActivityId(id: number ) {
+ this.activate.getListByActivityId(id , data => {
+ if (data['return_code'] === '000000') {
+ this.listOfData = data['return_data'];
+ } else {
+ this.message.create('error', data['return_msg']);
+ }
+ });
}
// 上一步
@@ -224,7 +236,7 @@ export class ActivateEditComponent implements OnInit {
if (this.current === 0) {
this.editActivityInfo();
} else {
-
+ history.back();
}
}
@@ -297,7 +309,7 @@ export class ActivateEditComponent implements OnInit {
}
this.validateFormAward.value.activityPrizes = this.listOfControl;
- this.validateFormAward.value.activityInfoId = 7;
+ this.validateFormAward.value.activityInfoId = this.id;
if (this.logoFile.length !== 0) {
if (this.logoFile[0]['response'] != null) {
this.validateFormAward.value.img = this.logoFile[0]['response']['return_data'][0];
@@ -305,10 +317,11 @@ export class ActivateEditComponent implements OnInit {
this.validateFormAward.value.img = this.logoFile[0].name;
}
}
- console.log(this.validateFormAward.value);
+ this.message.loading('生成奖品中!');
this.activate.editActivityAward(this.validateFormAward.value , data => {
- console.log(data);
if (data['return_code'] === '000000') {
+ this.isVisible = false;
+ this.getListByActivityId(this.id);
this.message.success('编辑成功');
} else {
this.message.create('error', '编辑失败');
@@ -321,4 +334,15 @@ export class ActivateEditComponent implements OnInit {
this.isVisible = false;
}
+
+ deleteActivateAward(id: number) {
+ this.activate.deleteActivateAward(id , data => {
+ if (data['return_code'] === '000000') {
+ this.getListByActivityId(this.id);
+ this.message.success('成功');
+ } else {
+ this.message.create('error', '编辑失败');
+ }
+ });
+ }
}
diff --git a/src/app/admin/activate/activate-list/activate-list.component.html b/src/app/admin/activate/activate-list/activate-list.component.html
index 3af4252..70a1d71 100644
--- a/src/app/admin/activate/activate-list/activate-list.component.html
+++ b/src/app/admin/activate/activate-list/activate-list.component.html
@@ -89,7 +89,7 @@
{{data.createTime | date: 'yyyy-MM-dd HH:mm'}} |
{{data.status | status}} |
- 编辑
+ 编辑
发布
结束
更多操作
diff --git a/src/app/admin/activate/activate-lottery-record/activate-lottery-record.component.html b/src/app/admin/activate/activate-lottery-record/activate-lottery-record.component.html
index 9a288e8..ed37e42 100644
--- a/src/app/admin/activate/activate-lottery-record/activate-lottery-record.component.html
+++ b/src/app/admin/activate/activate-lottery-record/activate-lottery-record.component.html
@@ -3,6 +3,8 @@
+
+
|