import {Component, OnInit} from '@angular/core';
import {Router} from "@angular/router";
import {MyService} from "../my.service";

@Component({
  selector: 'ydlife-mk-material',
  templateUrl: './mk-material.component.html',
  styleUrls: ['./mk-material.component.scss']
})
export class MkMaterialComponent implements OnInit {
  materialLists: Array<any>;
  posterInfos: Array<any>;

  constructor(private router: Router, private myService: MyService) {
  }

  ngOnInit() {
    this.materialLists = [
      {id: 10, itemId: '166', title: 'E生平安.百万医疗'},
      {id: 9, itemId: 'ph465', title: 'E生平安·疾无忧'},
      {id: 1, itemId: '118', title: '百年康惠保（旗舰版）重大疾病保险'},
      {id: 2, itemId: '133', title: '康乐一生重大疾病保险（C款升级款）'},
      {id: 3, itemId: '131', title: '复星联合妈咪宝贝少儿重大疾病保险'},
      {id: 4, itemId: '117', title: '百年定惠保'},
      {id: 5, itemId: '136', title: '中信保诚祯爱两全定期寿险'},
      {id: 6, itemId: '137', title: '中信保诚祯爱优选定期寿险'},
      {id: 7, itemId: '138', title: '中信保诚祯爱减额定期寿险'},
      {id: 8, itemId: '139', title: '中信保诚祯爱增额定期寿险'}
    ];
    this.posterQuery();
  }

  posterQuery() {
    this.myService.posterQuery({
      paginationInfo: {
        noLimitFlag: 'CONFIRM'
      }
    }).subscribe(res => {
      if (res['success']) {
        this.posterInfos = res['data']['posterInfos'];
      }
    });
  }

}
