|
|
@ -6,9 +6,7 @@ import {CouponService} from '../../../services/coupon.service'; |
|
|
|
import {ActivateService} from '../../../services/activate.service'; |
|
|
|
import {ActivateService} from '../../../services/activate.service'; |
|
|
|
import {NzUploadFile} from 'ng-zorro-antd'; |
|
|
|
import {NzUploadFile} from 'ng-zorro-antd'; |
|
|
|
import {environment} from '../../../../environments/environment'; |
|
|
|
import {environment} from '../../../../environments/environment'; |
|
|
|
import {Observable, Observer} from 'rxjs'; |
|
|
|
import {AgentService} from '../../../services/agent.service'; |
|
|
|
import {AgentService} from "../../../services/agent.service"; |
|
|
|
|
|
|
|
import {DiscountService} from "../../../services/discount.service"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function getBase64(file: File): Promise<string | ArrayBuffer | null> { |
|
|
|
function getBase64(file: File): Promise<string | ArrayBuffer | null> { |
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
return new Promise((resolve, reject) => { |
|
|
@ -35,7 +33,7 @@ export class ActivateEditComponent implements OnInit { |
|
|
|
listOfOption: string[] = []; |
|
|
|
listOfOption: string[] = []; |
|
|
|
listOfData = []; |
|
|
|
listOfData = []; |
|
|
|
agentData = []; |
|
|
|
agentData = []; |
|
|
|
current = 1; |
|
|
|
current = 0; |
|
|
|
listOfControl = [{ |
|
|
|
listOfControl = [{ |
|
|
|
isEdit: true, |
|
|
|
isEdit: true, |
|
|
|
agentId: null, |
|
|
|
agentId: null, |
|
|
@ -192,6 +190,8 @@ export class ActivateEditComponent implements OnInit { |
|
|
|
} |
|
|
|
} |
|
|
|
this.activate.editActivityInfo(this.validateForm.value, data => { |
|
|
|
this.activate.editActivityInfo(this.validateForm.value, data => { |
|
|
|
if (data['return_code'] === '000000') { |
|
|
|
if (data['return_code'] === '000000') { |
|
|
|
|
|
|
|
this.editFlag = true; |
|
|
|
|
|
|
|
this.id = data['return_data'].id; |
|
|
|
this.current += 1; |
|
|
|
this.current += 1; |
|
|
|
this.message.success('编辑成功'); |
|
|
|
this.message.success('编辑成功'); |
|
|
|
} else { |
|
|
|
} else { |
|
|
@ -212,6 +212,18 @@ export class ActivateEditComponent implements OnInit { |
|
|
|
this.message.create('error', data['return_msg']); |
|
|
|
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) { |
|
|
|
if (this.current === 0) { |
|
|
|
this.editActivityInfo(); |
|
|
|
this.editActivityInfo(); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
|
|
|
|
history.back(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
@ -297,7 +309,7 @@ export class ActivateEditComponent implements OnInit { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.validateFormAward.value.activityPrizes = this.listOfControl; |
|
|
|
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.length !== 0) { |
|
|
|
if (this.logoFile[0]['response'] != null) { |
|
|
|
if (this.logoFile[0]['response'] != null) { |
|
|
|
this.validateFormAward.value.img = this.logoFile[0]['response']['return_data'][0]; |
|
|
|
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; |
|
|
|
this.validateFormAward.value.img = this.logoFile[0].name; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
console.log(this.validateFormAward.value); |
|
|
|
this.message.loading('生成奖品中!'); |
|
|
|
this.activate.editActivityAward(this.validateFormAward.value , data => { |
|
|
|
this.activate.editActivityAward(this.validateFormAward.value , data => { |
|
|
|
console.log(data); |
|
|
|
|
|
|
|
if (data['return_code'] === '000000') { |
|
|
|
if (data['return_code'] === '000000') { |
|
|
|
|
|
|
|
this.isVisible = false; |
|
|
|
|
|
|
|
this.getListByActivityId(this.id); |
|
|
|
this.message.success('编辑成功'); |
|
|
|
this.message.success('编辑成功'); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
this.message.create('error', '编辑失败'); |
|
|
|
this.message.create('error', '编辑失败'); |
|
|
@ -321,4 +334,15 @@ export class ActivateEditComponent implements OnInit { |
|
|
|
this.isVisible = false; |
|
|
|
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', '编辑失败'); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|