Compare View
Commits (10)
-
Master(efernandez) See merge request !17
-
Master(efernandez) See merge request !18
-
Facturador(mpuebla) See merge request !19
-
Master(brodriguez) See merge request !20
Showing
4 changed files
Show diff stats
package.json
... | ... | @@ -4,6 +4,8 @@ |
4 | 4 | "description": "Login", |
5 | 5 | "main": "dist/foca-login.js", |
6 | 6 | "scripts": { |
7 | + "refresh": "gulp uglify && cp tmp/foca-login.js ../wrapper-demo/node_modules/foca-login/dist/foca-login.min.js", | |
8 | + "frefresh": "gulp uglify && cp tmp/foca-login.js ../wrapper-facturador/node_modules/foca-login/dist/foca-login.min.js", | |
7 | 9 | "test": "echo \"Error: no test specified\" && exit 1", |
8 | 10 | "gulp-pre-commit": "gulp pre-commit", |
9 | 11 | "postinstall": "gulp uglify && gulp clean-post-install", |
src/js/controller.js
1 | 1 | angular.module('focaLogin') |
2 | 2 | .controller('focaLoginController', [ |
3 | - '$scope', 'focaLoginService', '$location', '$cookies', 'focaModalService', 'md5', | |
4 | - function($scope, focaLoginService, $location, $cookies, focaModalService, md5) { | |
3 | + '$scope', 'focaLoginService', '$location', '$cookies', 'focaModalService', 'md5', 'APP', | |
4 | + function($scope, focaLoginService, $location, $cookies, focaModalService, md5, APP) { | |
5 | 5 | $scope.paso = 1; |
6 | 6 | $scope.enviar = function() { |
7 | 7 | angular.element('#password').blur(); |
8 | 8 | focaLoginService.login({ |
9 | 9 | idUsuario: $scope.usuario.idUsuario, |
10 | - clave: md5.createHash($scope.usuario.clave) | |
10 | + clave: APP != 'facturador' ? md5.createHash($scope.usuario.clave) : | |
11 | + $scope.usuario.clave | |
11 | 12 | }).then(function(datos) { |
12 | 13 | if (datos.data.chofer && datos.data.chofer.id) { |
13 | 14 | $cookies.put('chofer', datos.data.chofer.id); |
... | ... | @@ -15,6 +16,9 @@ angular.module('focaLogin') |
15 | 16 | } else if (datos.data.vendedorCobrador && datos.data.vendedorCobrador.id) { |
16 | 17 | $cookies.put('vendedorCobrador', datos.data.vendedorCobrador.id); |
17 | 18 | $cookies.put('nombreUsuario', datos.data.vendedorCobrador.NOM); |
19 | + } else if (datos.data.vendedorPlaya) { | |
20 | + $cookies.put('vendedorPlaya', datos.data.vendedorPlaya.CodVen); | |
21 | + $cookies.put('nombreUsuario', datos.data.vendedorPlaya.NomVen.trim()); | |
18 | 22 | } else { |
19 | 23 | focaModalService.alert('Existe un error con el usuario ingresado'); |
20 | 24 | return; |
... | ... | @@ -46,6 +50,7 @@ angular.module('focaLogin') |
46 | 50 | function($cookies, $location) { |
47 | 51 | $cookies.remove('chofer'); |
48 | 52 | $cookies.remove('vendedorCobrador'); |
53 | + $cookies.remove('vendedorPlaya'); | |
49 | 54 | $cookies.remove('nombreUsuario'); |
50 | 55 | $cookies.remove('token'); |
51 | 56 | //Cierra ventana |
src/js/service.js
... | ... | @@ -20,6 +20,10 @@ angular.module('focaLogin') |
20 | 20 | if ($cookies.get('vendedorCobrador')) { |
21 | 21 | return {vendedorCobrador: $cookies.get('vendedorCobrador')}; |
22 | 22 | } |
23 | + | |
24 | + if ($cookies.get('vendedorPlaya')) { | |
25 | + return {vendedorPlaya: $cookies.get('vendedorPlaya')}; | |
26 | + } | |
23 | 27 | } |
24 | 28 | }; |
25 | 29 | } |
src/views/foca-login.html
1 | -<div class="login"> | |
1 | +<img src="img/logo.png" class="w-25 rounded mx-auto d-block"> | |
2 | +<div class="login mt-5 p-3 border-0"> | |
2 | 3 | <form name="login"> |
3 | - <div class="login-titulo"> | |
4 | + | |
5 | + <div class="login-titulo"> | |
4 | 6 | <span>Ingreso de usuario</span> |
5 | 7 | </div> |
6 | - <div class="login-campo"> | |
7 | - <label>Usuario</label> | |
8 | - <input | |
9 | - type = "text" | |
10 | - ng-model = "usuario.idUsuario" | |
11 | - ng-focus = "paso = 1" | |
12 | - foca-focus = "paso == 1" | |
13 | - ng-keyup = "$event.keyCode == 13 && irPaso(2)" | |
14 | - ladda = "loginLoading" | |
15 | - teclado-virtual | |
16 | - /> | |
8 | + | |
9 | + <div class="row justify-content-center m-5"> | |
10 | + <div class="col col-sm-10 col-md-5 col-lg-4 bg-gray-gradient shadow rounded-2"> | |
11 | + <form name="login"> | |
12 | + <div class="row my-2 justify-content-center"> | |
13 | + <div class="col border-bottom border-white"> | |
14 | + <p class="mb-2 text-center">Ingreso de usuario</p> | |
15 | + </div> | |
16 | + </div> | |
17 | + <div class="row mb-2"> | |
18 | + <div class="col px-4"> | |
19 | + <p class="mb-0 text-center">Usuario</p> | |
20 | + <input | |
21 | + class="form-control form-control-sm" | |
22 | + type="text" | |
23 | + ng-model="usuario.idUsuario" | |
24 | + ng-focus="paso = 1" | |
25 | + foca-focus="paso == 1" | |
26 | + ng-keyup="$event.keyCode == 13 && irPaso(2)" | |
27 | + ladda="loginLoading" | |
28 | + teclado-virtual | |
29 | + /> | |
30 | + </div> | |
31 | + </div> | |
32 | + <div class="row mb-3"> | |
33 | + <div class="col px-4"> | |
34 | + <p class="mb-0 text-center">Contraseña</p> | |
35 | + <input | |
36 | + class="form-control form-control-sm" | |
37 | + id="password" | |
38 | + type="password" | |
39 | + ng-model="usuario.clave" | |
40 | + foca-focus="paso == 2" | |
41 | + ng-keyup="$event.keyCode == 13 && enviar()" | |
42 | + ladda="loginLoading" | |
43 | + teclado-virtual | |
44 | + /> | |
45 | + </div> | |
46 | + </div> | |
47 | + <div class="row mb-5"> | |
48 | + <div class="col px-4"> | |
49 | + <button | |
50 | + type="button" | |
51 | + ng-click="enviar()" | |
52 | + class="btn btn-primary btn-block" | |
53 | + ladda="loginLoading"> | |
54 | + Ingresar | |
55 | + </button> | |
56 | + </div> | |
57 | + </div> | |
58 | + </form> | |
59 | + </div> | |
17 | 60 | </div> |
61 | +<<<<<<< HEAD | |
18 | 62 | <div class="login-campo"> |
19 | 63 | <label>Contraseña</label> |
20 | 64 | <input |
... | ... | @@ -34,4 +78,8 @@ |
34 | 78 | ladda="loginLoading" |
35 | 79 | >Ingresar</button> |
36 | 80 | </form> |
81 | + <img src="img/logo-foca.png" class="w-50 rounded mx-auto d-block"> | |
82 | +======= | |
83 | + </div> | |
84 | +>>>>>>> ac450d6b074c59434f538a88b6166436bff55510 | |
37 | 85 | </div> |