import {Component, Input, OnInit} from '@angular/core';
import {HttpService} from '../../service/http.service';
import {ConfigService} from '../../service/config.service';
import {IAward} from '../../model';

@Component({
  selector: 'app-notice',
  templateUrl: './notice.component.html',
  styleUrls: ['./notice.component.less']
})
export class NoticeComponent implements OnInit {
  list: IAward[] = [];

  constructor(
    private http: HttpService,
    public config: ConfigService
  ) {
  }

  ngOnInit(): void {
    this.getData();
  }

  getData() {
    setTimeout(() => {
      const a = localStorage.getItem('campaignId');
      if (a) {
        this.http.get(this.http.apis.findPageByOper, {
          data: {
            campaignId: a
          },
          success: (res: any) => {
            this.list = res.records || [];
          }
        });
      }
    }, 1000);

  }

}
