import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
import { Storage } from '@ionic/storage';
import {Myservice} from '../../providers/myservice';

/**
 * Generated class for the FixpricesPage page.
 *
 * See https://ionicframework.com/docs/components/#navigation for more info on
 * Ionic pages and navigation.
 */

@IonicPage()
@Component({
  selector: 'page-fixprices',
  templateUrl: 'fixprices.html',
})
export class FixpricesPage {
	
	services:any;
	garage_list:any;
	
	constructor(public navCtrl: NavController, public navParams: NavParams,private myservice: Myservice,public storage:Storage) {
		this.services = this.navParams.get('service')
		this.find_garage();
		console.log(this.services)
	}

	ionViewDidLoad() {
		console.log('ionViewDidLoad FixpricesPage');
	}
	
	find_garage(){
		this.myservice.show_loader();
		this.myservice.load_get('find_garage/id/'+this.services.id).subscribe(data => {
			this.myservice.hide_loader();
			if(data.status == 'success'){
				this.garage_list = data.data;
				console.log(this.garage_list);
			}
		});
	}
	
	shopdetail(id){
		this.navCtrl.push('ShopdetailPage',{'garage_id' : id,'page' : 'fixprice','services' :this.services});
	}
	back(){
		this.navCtrl.pop();
	}

}
