import { Component, OnInit } from '@angular/core';
import {AlertController, NavController} from "@ionic/angular";
import {Router} from "@angular/router";
import {SessionDataProviderService} from "../../store/session-data-provider.service";
import {WrenchService} from "../../services/wrench.service";
import {BlogDataService} from "../../store/blog-data.service";

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


  tabs = 'about';

  constructor(
      private navctr: NavController,
      private router: Router,
      public sessionDataProviderService: SessionDataProviderService,
      private alertController:AlertController,
      private wrenchService: WrenchService,
      public blogDataService: BlogDataService
  ) { }

  ngOnInit() {
    this.paygroundData();
  }

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

  usrData: {
    action:number, member_id: number, uid: string,
    sessionid: string,
    'limit': 30,
    'offset': 0
  };

  playListTotalData:any;
  playListData: [];
  playFastMenu:[];
  paygroundData(){


    this.usrData = {action:11201, member_id: this.sessionDataProviderService.member_id, uid: this.sessionDataProviderService.member_uid,
      sessionid: this.sessionDataProviderService.session,'limit': 30,
      'offset': 0 }

    this.wrenchService.getMyPlayground(this.usrData).subscribe(
        playListTotalData => {
          this.playListTotalData = playListTotalData;
          //debugger;
          // console.log("REFER  RETURN->", this.referTotalData);
          this.playFastMenu = this.playListTotalData.layer_menu;
          this.playListData = this.playListTotalData.result_list;
          console.log("playListTotalData RETURN DATA->", this.playListData);
        }
    );

  }


}
