comenzamos

This commit is contained in:
nat 2022-05-04 16:50:22 -03:00
parent 67aadf157f
commit 70235970ab
4 changed files with 11 additions and 17 deletions

5
public/js/app.js vendored
View File

@ -8,7 +8,7 @@ Vue.component('nav-bar', {
<img src="/assets/logoMPS.png" height="28"> <img src="/assets/logoMPS.png" height="28">
</a> </a>
<p style="margin:0 auto" class="navbar-item"><slot name="subpedido"></slot></p> <p style="margin:0 auto" class="navbar-item"><slot name="subpedido"></slot></p>
<a class="navbar-item" href="/chismosa"> <a class="navbar-item" href="#chismosa" @click.capture="toggleChismosa">
<img style="padding:0 0.3em;" src="/assets/chismosa.png" height="28"> <img style="padding:0 0.3em;" src="/assets/chismosa.png" height="28">
<p style="margin:0 auto; color:white">$ <span v-text="subpedido == null ? 0 : subpedido.total"></span></p> <p style="margin:0 auto; color:white">$ <span v-text="subpedido == null ? 0 : subpedido.total"></span></p>
</a> </a>
@ -47,6 +47,9 @@ Vue.component('nav-bar', {
.then(response => { .then(response => {
this.subpedido = response.data.data; this.subpedido = response.data.data;
}); });
},
toggleChismosa(){
Event.$emit("toggle-chismosa");
} }
}, mounted() { }, mounted() {
axios.get("/subpedidos/obtener_sesion").then(response => { axios.get("/subpedidos/obtener_sesion").then(response => {

View File

@ -1,6 +1,6 @@
Vue.component('chismosa', { Vue.component('chismosa', {
template: ` template: `
<div class="container"> <div class="container" v-show="this.visible">
<table v-show="this.subpedido.productos.length != 0" class="table is-fullwidth is-striped is-bordered"> <table v-show="this.subpedido.productos.length != 0" class="table is-fullwidth is-striped is-bordered">
<thead> <thead>
<tr> <tr>
@ -39,6 +39,7 @@ Vue.component('chismosa', {
subpedido: { subpedido: {
productos:[] productos:[]
}, },
visible: false
} }
}, },
computed: { computed: {
@ -69,6 +70,9 @@ Vue.component('chismosa', {
Event.$on('sync-subpedido', () => { Event.$on('sync-subpedido', () => {
this.fetchSubpedido(); this.fetchSubpedido();
}); });
Event.$on('toggle-chismosa', () => {
this.visible = !this.visible;
});
} }
}); });

View File

@ -1,15 +0,0 @@
@extends('layouts.app')
@section('stylesheets')
@endsection
@section('content')
<chismosa></chismosa>
<producto-container></producto-container>
@endsection
@section('scripts')
<script src="{{ asset('js/chismosa.js') }}"></script>
<script src="{{ asset('js/productos.js') }}"></script>
@endsection

View File

@ -5,6 +5,7 @@
@endsection @endsection
@section('content') @section('content')
<chismosa></chismosa>
<categorias-container></categorias-container> <categorias-container></categorias-container>
<productos-container></productos-container> <productos-container></productos-container>
<producto-container></producto-container> <producto-container></producto-container>
@ -12,4 +13,5 @@
@section('scripts') @section('scripts')
<script src="{{ asset('js/productos.js') }}"></script> <script src="{{ asset('js/productos.js') }}"></script>
<script src="{{ asset('js/chismosa.js') }}"></script>
@endsection @endsection