diff --git a/app/Http/Livewire/ShowServicios.php b/app/Http/Livewire/ShowServicios.php index 5e2008d..e0547bc 100755 --- a/app/Http/Livewire/ShowServicios.php +++ b/app/Http/Livewire/ShowServicios.php @@ -61,6 +61,7 @@ class ShowServicios extends Component public $fecha_final_1; public $fecha_final_2; public $utilidad; + public $tp = false; use LivewireAlert; protected $rules = [ @@ -85,9 +86,12 @@ class ShowServicios extends Component $this->email_tarjetaPlan = $this->usuario_actual->email; $this->celular_tarjetaPlan = $this->usuario_actual->celular; } - if (!empty($this->tarifa_id)) { - $this->cargartarjetaPlan($this->tarifa_id); + if (!empty($this->cantidad_tarjetaPlan)) { + //dd($this->tarifa_id); + //$this->cargartarjetaPlan($this->tarifa_id); + } + $this->msj = Configuracione::orderby('id', 'desc')->select('msj_compra', 'msj_wp', 'clave_1', 'clave_2', 'clave_3', 'clave_4', 'clave_5', 'clave_6', 'iptv')->first(); @@ -114,12 +118,13 @@ class ShowServicios extends Component //Al abrir la tarjeta del servicio public function cargartarjetaPlan($id) { + //$this->tarjetaPlan=false; //Buscar tarifas por el id $tarifa_seleccionada = Tarifas::find($id); - //dd($tarifa_seleccionada); //Traer el servicio relacionado con esa tarifa $servicio_tarifa = $tarifa_seleccionada->servicio; + //INFORMACIÓN DEL SERVICIO $this->servicio_id = $servicio_tarifa->id; //Id $this->servicio_tarjetaPlan = $servicio_tarifa->nombre; //Nombre @@ -128,7 +133,7 @@ class ShowServicios extends Component $this->colorFondo_tarjetaPlan = $servicio_tarifa->color_fondo; //Color de fondo //INFORMACIÓN DE LA TARJETA - $this->tarifa_id = $id; //El id de la tarifa + $this->tarifa_id = $tarifa_seleccionada->id; //El id de la tarifa $this->pantallas_tarjetaPlan = $tarifa_seleccionada->pantallas; //Numero de pantallas de la tarifa $this->dias_tarjetaPlan = $tarifa_seleccionada->dias; // Numero de dias de la tarifa @@ -142,6 +147,7 @@ class ShowServicios extends Component ->where('tarifa_id', $id) ->first(); + //Si tiene tarifa personalizada toma el precio, si no tiene da el valor de la tarifa. $this->valor_tarjetaPlan = ($usuario_tarifa) ? $usuario_tarifa->precio : $tarifa_seleccionada->valor; //Si tiene tarifa personalizada toma la utilidad, si no tiene toma la utilidad de la tarifa. @@ -192,8 +198,9 @@ class ShowServicios extends Component } } - - $this->tarjetaPlan = true; + + //dd($this->tarjetaPlan); + $this->tp = true; }