import { Router } from '@angular/router';
import { Component, OnInit } from '@angular/core';
import { NavController } from '@ionic/angular';
import { WrenchService } from 'src/app/services/wrench.service';
import {SessionDataProviderService} from "../../store/session-data-provider.service";
import {WaitingInterestService} from "../../store/waiting-interest.service";

@Component({
  selector: 'app-pendinterest',
  templateUrl: './pendinterest.page.html',
  styleUrls: ['./pendinterest.page.scss'],
})
export class PendinterestPage implements OnInit {

  tabs = 'about';

  constructor(
      private navctr: NavController,
      private router: Router,
      public sessionDataProviderService: SessionDataProviderService,
      private wrenchService: WrenchService,
      private waitingInterestService:WaitingInterestService
  ) {
  }

  ngOnInit() {
  //  this.getInterestList();
  }

  onBack() {
    this.navctr.back();
  }


  jobInterest(item) {
    debugger;
      this.router.navigate(['marketdetail'],{state: item});
  }

  //  (usrData){
  usrData: {
    action: number, member_id: number, uid: string, sessionid: string, limit: 20, page: 1, offset: 0
  };

  // interestTotalData: any;
  // interestJobsData: [];
  // total_jobs: number = 0;
  //
  // getInterestList() {
  //   this.usrData = {
  //     action: 13005,
  //     member_id: this.sessionDataProviderService.member_id,
  //     uid: this.sessionDataProviderService.member_uid,
  //     sessionid: this.sessionDataProviderService.session,
  //     limit: 20, page: 1, offset: 0
  //   }
  //
  //   this.wrenchService.getWaitingInterest(this.usrData).subscribe(
  //       interestTotalData => {
  //         this.interestTotalData = interestTotalData;
  //         console.log("interestTotalData  RETURN->", this.interestTotalData);
  //         this.interestJobsData = this.interestTotalData.result_list;
  //         this.total_jobs = this.interestJobsData.length;
  //         console.log("jobManagerJobsData RETURN DATA->", this.interestJobsData);
  //       }
  //   );
  // }
}