Commit f748d6563029c57e103f66597f3e7b295c56594f
Exists in
master
and in
1 other branch
Merge branch 'master' into 'develop'
Master(mpuebla) See merge request !1
Showing
4 changed files
Show diff stats
src/js/controller.js
1 | 1 | angular.module('focaModalFormaPago') |
2 | 2 | .controller('focaModalFormaPagoController', [ |
3 | - '$timeout', '$filter', '$scope', '$uibModalInstance', 'focaModalFormaPagoService', | |
4 | - function ($timeout, $filter, $scope, $uibModalInstance, focaModalFormaPagoService) { | |
3 | + '$timeout', '$filter', '$scope', '$uibModal', | |
4 | + '$uibModalInstance', 'focaModalFormaPagoService', | |
5 | + function ($timeout, $filter, $scope, $uibModal, | |
6 | + $uibModalInstance, focaModalFormaPagoService) { | |
7 | + | |
8 | + //#region Variables | |
9 | + $scope.botonesTarjetas = []; | |
10 | + //#endregion | |
11 | + | |
12 | + init(); | |
13 | + | |
14 | + function init() { | |
15 | + $scope.botonesTarjetas = focaModalFormaPagoService.getBotonera(); | |
16 | + } | |
17 | + | |
18 | + $scope.seleccionarContado = function () { | |
19 | + var modalInstance = abrirModal('modal-tarjetas.html', | |
20 | + 'focaModalTarjetasController'); | |
21 | + modalInstance.result | |
22 | + .then(function (data) { | |
23 | + console.log(data); | |
24 | + }) | |
25 | + .catch(function (e) { console.error(e); }); | |
26 | + }; | |
27 | + | |
28 | + $scope.seleccionarTarjetas = function () { | |
29 | + var modalInstance = abrirModal('modal-tarjetas.html', | |
30 | + 'focaModalTarjetasController'); | |
31 | + modalInstance.result | |
32 | + .then(function (data) { | |
33 | + console.log(data); | |
34 | + }) | |
35 | + .catch(function (e) { console.error(e); }); | |
36 | + }; | |
37 | + | |
38 | + $scope.seleccionarCheque = function () { | |
39 | + var modalInstance = abrirModal('modal-tarjetas.html', | |
40 | + 'focaModalTarjetasController'); | |
41 | + modalInstance.result | |
42 | + .then(function (data) { | |
43 | + console.log(data); | |
44 | + }) | |
45 | + .catch(function (e) { console.error(e); }); | |
46 | + }; | |
47 | + | |
48 | + $scope.seleccionarVales = function () { | |
49 | + var modalInstance = abrirModal('modal-tarjetas.html', | |
50 | + 'focaModalTarjetasController'); | |
51 | + modalInstance.result | |
52 | + .then(function (data) { | |
53 | + console.log(data); | |
54 | + }) | |
55 | + .catch(function (e) { console.error(e); }); | |
56 | + }; | |
57 | + | |
58 | + $scope.seleccionarPagoElectronico = function () { | |
59 | + var modalInstance = abrirModal('modal-tarjetas.html', | |
60 | + 'focaModalTarjetasController'); | |
61 | + modalInstance.result | |
62 | + .then(function (data) { | |
63 | + console.log(data); | |
64 | + }) | |
65 | + .catch(function (e) { console.error(e); }); | |
66 | + }; | |
67 | + | |
68 | + function abrirModal(templateUrl, controller) { | |
69 | + return $uibModal.open( | |
70 | + { | |
71 | + templateUrl: templateUrl, | |
72 | + controller: controller, | |
73 | + resolve: { | |
74 | + filters: function () { return null; }, | |
75 | + }, | |
76 | + size: 'lg', | |
77 | + } | |
78 | + ); | |
79 | + | |
80 | + } | |
81 | + | |
82 | + $scope.cancel = function () { | |
83 | + $uibModalInstance.dismiss('cancel'); | |
84 | + }; | |
85 | + | |
86 | + $scope.select = function (iva) { | |
87 | + $uibModalInstance.close(iva); | |
88 | + }; | |
89 | + }] | |
90 | + ) | |
91 | + .controller('focaModalTarjetasController', [ | |
92 | + '$timeout', '$filter', '$scope', '$uibModalInstance', 'focaModalTarjetasService', | |
93 | + function ($timeout, $filter, $scope, $uibModalInstance, focaModalTarjetasService) { | |
5 | 94 | |
6 | 95 | //#region Variables |
7 | 96 | $scope.botonesTarjetas = []; |
... | ... | @@ -12,7 +101,7 @@ angular.module('focaModalFormaPago') |
12 | 101 | init(); |
13 | 102 | |
14 | 103 | function init() { |
15 | - $scope.botonesTarjetas = focaModalFormaPagoService.getBotonera(); | |
104 | + $scope.botonesTarjetas = focaModalTarjetasService.getBotonera(); | |
16 | 105 | } |
17 | 106 | |
18 | 107 | $scope.seleccionarTarjeta = function () { |
src/js/service.js
1 | 1 | angular.module('focaModalFormaPago') |
2 | 2 | .factory('focaModalFormaPagoService', ['$http', 'API_ENDPOINT', function ($http, API_ENDPOINT) { |
3 | 3 | return { |
4 | - getFormasPago: function () { | |
5 | - //TODO: pasar filtro | |
6 | - return $http.get(API_ENDPOINT.URL + '/forma-pago'); | |
7 | - }, | |
4 | + getBotonera: function () { | |
5 | + return [ | |
6 | + { | |
7 | + label: 'Contado', | |
8 | + image: 'contado.png', | |
9 | + disabled: true | |
10 | + }, | |
11 | + { | |
12 | + label: 'Tarjetas', | |
13 | + image: 'tarjeta.png', | |
14 | + disabled: false | |
15 | + }, | |
16 | + { | |
17 | + label: 'Cheque', | |
18 | + image: 'cheque.png', | |
19 | + disabled: true | |
20 | + }, | |
21 | + { | |
22 | + label: 'Vales', | |
23 | + image: 'vale.png', | |
24 | + disabled: true | |
25 | + }, | |
26 | + { | |
27 | + label: 'Pago Electronico', | |
28 | + image: 'qr.png', | |
29 | + disabled: true | |
30 | + } | |
31 | + ]; | |
32 | + } | |
33 | + }; | |
34 | + }]) | |
35 | + .factory('focaModalTarjetasService', ['$http', 'API_ENDPOINT', function ($http, API_ENDPOINT) { | |
36 | + return { | |
8 | 37 | getBotonera: function () { |
9 | 38 | return [ |
10 | 39 | { |
... | ... | @@ -16,12 +45,12 @@ angular.module('focaModalFormaPago') |
16 | 45 | label: 'tarjeta', |
17 | 46 | image: 'mastercard.svg', |
18 | 47 | active: false, |
19 | - }, | |
48 | + }, | |
20 | 49 | { |
21 | 50 | label: 'tarjeta', |
22 | 51 | image: 'maestro.svg', |
23 | 52 | active: false, |
24 | - }, | |
53 | + }, | |
25 | 54 | { |
26 | 55 | label: 'tarjeta', |
27 | 56 | image: 'americanExpress.svg', |
... | ... | @@ -31,27 +60,27 @@ angular.module('focaModalFormaPago') |
31 | 60 | label: 'tarjeta', |
32 | 61 | image: 'naranja.png', |
33 | 62 | active: false, |
34 | - }, | |
63 | + }, | |
35 | 64 | { |
36 | 65 | label: 'tarjeta', |
37 | 66 | image: 'cabal.svg', |
38 | 67 | active: false, |
39 | - }, | |
68 | + }, | |
40 | 69 | { |
41 | 70 | label: 'tarjeta', |
42 | 71 | image: 'argencard.svg', |
43 | 72 | active: false, |
44 | - }, | |
73 | + }, | |
45 | 74 | { |
46 | 75 | label: 'tarjeta', |
47 | 76 | image: 'nativa.png', |
48 | 77 | active: false, |
49 | - }, | |
78 | + }, | |
50 | 79 | { |
51 | 80 | label: 'tarjeta', |
52 | 81 | image: 'cencosud.png', |
53 | 82 | active: false, |
54 | - }, | |
83 | + }, | |
55 | 84 | ]; |
56 | 85 | } |
57 | 86 | }; |
src/views/modal-forma-pago.html
1 | 1 | <div class="modal-header"> |
2 | - <h5 class="modal-title">Pago con Tarjeta</h5> | |
2 | + <h5 class="modal-title">Formas de pago</h5> | |
3 | 3 | </div> |
4 | 4 | |
5 | 5 | <div class="modal-body" id="modal-body"> |
6 | - <div class="row mb-2"> | |
6 | + <div class="row"> | |
7 | 7 | <div class="col-12 p-0"> |
8 | 8 | <div class="row mx-0 botonera-secundaria"> |
9 | 9 | <div class="col-12"> |
10 | - <foca-botonera-tarjetas | |
10 | + <foca-botonera-forma-pago | |
11 | 11 | botones="botonesTarjetas" |
12 | 12 | max="1" |
13 | 13 | class="row justify-content-start mx-0" |
14 | 14 | > |
15 | - </foca-botonera-tarjetas> | |
15 | + </foca-botonera-forma-pago> | |
16 | 16 | </div> |
17 | 17 | </div> |
18 | 18 | </div> |
19 | 19 | </div> |
20 | - | |
21 | - <div class="border-top" ng-show="showForm"> | |
22 | - <div class="row mt-4 fadeIn"> | |
23 | - <div class="col"> | |
24 | - <form> | |
25 | - <div class="row"> | |
26 | - <div class="col-3 col-sm-2 pr-1"> | |
27 | - <input class="form-control"> | |
28 | - </div> | |
29 | - <div class="col-9 col-sm-4 pl-2"> | |
30 | - <input class="form-control"> | |
31 | - </div> | |
32 | - </div> | |
33 | - </form> | |
34 | - </div> | |
35 | - </div> | |
36 | - </div> | |
37 | - | |
38 | 20 | </div> |
39 | 21 | |
40 | 22 | <div class="modal-footer"> |
41 | - <button class="btn btn-sm btn-secondary my-1" type="button" ng-click="cancel()">Cancelar</button> | |
23 | + <button class="btn btn-sm btn-secondary" type="button" ng-click="cancel()">Cancelar</button> | |
42 | 24 | </div> |
src/views/modal-tarjetas.html
... | ... | @@ -0,0 +1,70 @@ |
1 | +<div class="modal-header"> | |
2 | + <h5 class="modal-title">Pago con Tarjeta</h5> | |
3 | +</div> | |
4 | + | |
5 | +<div class="modal-body" id="modal-body"> | |
6 | + <div class="row mb-2"> | |
7 | + <div class="col-12 p-0"> | |
8 | + <div class="row mx-0 botonera-secundaria"> | |
9 | + <div class="col-12"> | |
10 | + <foca-botonera-tarjetas | |
11 | + botones="botonesTarjetas" | |
12 | + max="1" | |
13 | + class="row justify-content-start mx-0" | |
14 | + > | |
15 | + </foca-botonera-tarjetas> | |
16 | + </div> | |
17 | + </div> | |
18 | + </div> | |
19 | + </div> | |
20 | + <div class="border-top" ng-show="showForm"> | |
21 | + <div class="row mt-4 fadeIn"> | |
22 | + <div class="col"> | |
23 | + <form> | |
24 | + <div class="row pb-3"> | |
25 | + <div class="col-3 col-sm-2 pr-1"> | |
26 | + <input class="form-control form-control-sm"> | |
27 | + </div> | |
28 | + <div class="col-9 col-sm-4 pl-2"> | |
29 | + <input class="form-control form-control-sm"> | |
30 | + </div> | |
31 | + </div> | |
32 | + <div class="row pb-3"> | |
33 | + <div class="col"> | |
34 | + <span>Importe</span> | |
35 | + <strong>$1560.45</strong> | |
36 | + </div> | |
37 | + </div> | |
38 | + <div class="row pb-3"> | |
39 | + <div class="col-auto pr-1 my-auto"> | |
40 | + <span>Cuotas</span> | |
41 | + </div> | |
42 | + <div class="col col-sm-5 pl-1"> | |
43 | + <input | |
44 | + class="form-control form-control-sm" | |
45 | + type="number" | |
46 | + ng-disabled="readonly"> | |
47 | + </div> | |
48 | + </div> | |
49 | + <div class="row pb-3"> | |
50 | + <div class="col-auto pr-1 my-auto"> | |
51 | + <span>Terminal Nº</span> | |
52 | + </div> | |
53 | + <div class="col col-sm-5 pl-1"> | |
54 | + <input | |
55 | + class="form-control form-control-sm" | |
56 | + type="number" | |
57 | + ng-disabled="readonly"> | |
58 | + </div> | |
59 | + </div> | |
60 | + </form> | |
61 | + </div> | |
62 | + </div> | |
63 | + </div> | |
64 | +</div> | |
65 | + | |
66 | + | |
67 | +<div class="modal-footer d-flex justify-content-between"> | |
68 | + <button class="btn btn-sm btn-secondary" type="button" ng-click="cancel()">Cancelar</button> | |
69 | + <button class="btn btn-sm btn-primary" type="button" ng-click="cancel()">Aceptar</button> | |
70 | +</div> |