lyxaira.glass 4 years ago
parent
commit
cb61423f22
4 changed files with 20 additions and 22 deletions
  1. 9
    9
      platforms/browser/www/index.html
  2. 1
    2
      platforms/browser/www/js/saveLocal.js
  3. 9
    9
      www/index.html
  4. 1
    2
      www/js/saveLocal.js

+ 9
- 9
platforms/browser/www/index.html View File

@@ -115,11 +115,11 @@
115 115
                     ons.getScriptPage().onInit = function () {
116 116
                         this.querySelector('ons-toolbar div.center').textContent = this.data.title;
117 117
 
118
-                        console.log("test");
119 118
 
120 119
                         //var File = this.data.title.toUpperCase() + '.json' ;
121
-                        var Esp = this.data.esp.split(';');
120
+                        var Esp = this.data.esp.split(', ');
122 121
                         var artesanos_json = this.data.json;
122
+                        console.log(artesanos_json);
123 123
 
124 124
                         //Convertir en mayuscula primera letra del string.
125 125
                         for(var i=0; i<Esp.length; i++) {
@@ -158,7 +158,7 @@
158 158
                             var searchVal = "my Name";
159 159
                             for (var i=0 ; i < artesanos_json.length ; i++)
160 160
                             {
161
-                                if (artesanos_json[i].Especificaciones1.includes(Esp[num])) {
161
+                                if (artesanos_json[i].Especificaciones.includes(Esp[num])) {
162 162
                                     results.push(artesanos_json[i]);
163 163
                                 }
164 164
                             }
@@ -196,8 +196,8 @@
196 196
               <ons-list-item expandable tappable>
197 197
                 <div class="center" >${Artesano.Nombre}</div>
198 198
                 <div class="expandable-content"> Municipio: ${Artesano.Municipio}<br>
199
-                                                 Tel\u00e9fono: ${Artesano["Telefono1"]}<br>
200
-                                                 Correo Electr\u00f3nico: ${Artesano["E-mail1"]}<br>
199
+                                                 Tel\u00e9fono: ${Artesano["Tel\u00e9fono 1"]}<br>
200
+                                                 Correo Electr\u00f3nico: ${Artesano["E-mail"]}<br>
201 201
                                                  </div>
202 202
               </ons-list-item>`
203 203
                                                     );
@@ -215,20 +215,20 @@
215 215
                             if (Artesano.Municipio.trim().length != 0) {
216 216
                                 cont ++;
217 217
                             }
218
-                            if (Artesano["Telefono1"].trim().length != 0) {
218
+                            if (Artesano["Tel\u00e9fono 1"].trim().length != 0) {
219 219
                                 cont ++;
220 220
                             }
221
-                            if (Artesano["E-mail1"].trim().length != 0) {
221
+                            if (Artesano["E-mail"].trim().length != 0) {
222 222
                                 cont ++;
223 223
                             }
224
-                            if (Artesano.Especificaciones1.trim().length != 0) {
224
+                            if (Artesano.Especificaciones.trim().length != 0) {
225 225
                                 cont ++;
226 226
                             }
227 227
 
228 228
 
229 229
                             //info a pasar
230 230
                             //'title':'${Artesano.Nombre}','esp': '${info}'
231
-                            var item = ons.createElement(`<ons-list-item onclick="myNavigator.pushPage('artesano.html', { data: { title: '${Artesano.Nombre}', mun: '${Artesano.Municipio}', tel: '${Artesano["Telefono1"]}', email: '${Artesano["E-mail1"]}', esp: '${Artesano.Especificaciones1}' } })" tappable>
231
+                            var item = ons.createElement(`<ons-list-item onclick="myNavigator.pushPage('artesano.html', { data: { title: '${Artesano.Nombre}', mun: '${Artesano.Municipio}', tel: '${Artesano["Tel\u00e9fono 1"]}', email: '${Artesano["E-mail"]}', esp: '${Artesano.Especificaciones}' } })" tappable>
232 232
                         <div class="title">${Artesano.Nombre}</div>
233 233
                     </ons-list-item>`);
234 234
 

+ 1
- 2
platforms/browser/www/js/saveLocal.js View File

@@ -28,10 +28,9 @@ try {
28 28
   if (checkDate() == false) {
29 29
 
30 30
     window.localStorage.setItem("RENGLONES", loadFile("https://136.145.181.12/renglones.json"));
31
-    window.localStorage.setItem("TODOS", loadFile("https://136.145.181.12/artesanias.json"))
32 31
 
33 32
     var renglones = JSON.parse(window.localStorage.getItem("RENGLONES"));
34
-
33
+    console.log(renglones);
35 34
     for (var i = 0; i < renglones.length; i++) {
36 35
       window.localStorage.setItem(renglones[i].Renglones, loadFile("https://136.145.181.12/" + renglones[i].Renglones + ".json"));
37 36
     }

+ 9
- 9
www/index.html View File

@@ -115,11 +115,11 @@
115 115
                     ons.getScriptPage().onInit = function () {
116 116
                         this.querySelector('ons-toolbar div.center').textContent = this.data.title;
117 117
 
118
-                        console.log("test");
119 118
 
120 119
                         //var File = this.data.title.toUpperCase() + '.json' ;
121
-                        var Esp = this.data.esp.split(';');
120
+                        var Esp = this.data.esp.split(', ');
122 121
                         var artesanos_json = this.data.json;
122
+                        console.log(artesanos_json);
123 123
 
124 124
                         //Convertir en mayuscula primera letra del string.
125 125
                         for(var i=0; i<Esp.length; i++) {
@@ -158,7 +158,7 @@
158 158
                             var searchVal = "my Name";
159 159
                             for (var i=0 ; i < artesanos_json.length ; i++)
160 160
                             {
161
-                                if (artesanos_json[i].Especificaciones1.includes(Esp[num])) {
161
+                                if (artesanos_json[i].Especificaciones.includes(Esp[num])) {
162 162
                                     results.push(artesanos_json[i]);
163 163
                                 }
164 164
                             }
@@ -196,8 +196,8 @@
196 196
               <ons-list-item expandable tappable>
197 197
                 <div class="center" >${Artesano.Nombre}</div>
198 198
                 <div class="expandable-content"> Municipio: ${Artesano.Municipio}<br>
199
-                                                 Tel\u00e9fono: ${Artesano["Telefono1"]}<br>
200
-                                                 Correo Electr\u00f3nico: ${Artesano["E-mail1"]}<br>
199
+                                                 Tel\u00e9fono: ${Artesano["Tel\u00e9fono 1"]}<br>
200
+                                                 Correo Electr\u00f3nico: ${Artesano["E-mail"]}<br>
201 201
                                                  </div>
202 202
               </ons-list-item>`
203 203
                                                     );
@@ -215,20 +215,20 @@
215 215
                             if (Artesano.Municipio.trim().length != 0) {
216 216
                                 cont ++;
217 217
                             }
218
-                            if (Artesano["Telefono1"].trim().length != 0) {
218
+                            if (Artesano["Tel\u00e9fono 1"].trim().length != 0) {
219 219
                                 cont ++;
220 220
                             }
221
-                            if (Artesano["E-mail1"].trim().length != 0) {
221
+                            if (Artesano["E-mail"].trim().length != 0) {
222 222
                                 cont ++;
223 223
                             }
224
-                            if (Artesano.Especificaciones1.trim().length != 0) {
224
+                            if (Artesano.Especificaciones.trim().length != 0) {
225 225
                                 cont ++;
226 226
                             }
227 227
 
228 228
 
229 229
                             //info a pasar
230 230
                             //'title':'${Artesano.Nombre}','esp': '${info}'
231
-                            var item = ons.createElement(`<ons-list-item onclick="myNavigator.pushPage('artesano.html', { data: { title: '${Artesano.Nombre}', mun: '${Artesano.Municipio}', tel: '${Artesano["Telefono1"]}', email: '${Artesano["E-mail1"]}', esp: '${Artesano.Especificaciones1}' } })" tappable>
231
+                            var item = ons.createElement(`<ons-list-item onclick="myNavigator.pushPage('artesano.html', { data: { title: '${Artesano.Nombre}', mun: '${Artesano.Municipio}', tel: '${Artesano["Tel\u00e9fono 1"]}', email: '${Artesano["E-mail"]}', esp: '${Artesano.Especificaciones}' } })" tappable>
232 232
                         <div class="title">${Artesano.Nombre}</div>
233 233
                     </ons-list-item>`);
234 234
 

+ 1
- 2
www/js/saveLocal.js View File

@@ -28,10 +28,9 @@ try {
28 28
   if (checkDate() == false) {
29 29
 
30 30
     window.localStorage.setItem("RENGLONES", loadFile("https://136.145.181.12/renglones.json"));
31
-    window.localStorage.setItem("TODOS", loadFile("https://136.145.181.12/artesanias.json"))
32 31
 
33 32
     var renglones = JSON.parse(window.localStorage.getItem("RENGLONES"));
34
-
33
+    console.log(renglones);
35 34
     for (var i = 0; i < renglones.length; i++) {
36 35
       window.localStorage.setItem(renglones[i].Renglones, loadFile("https://136.145.181.12/" + renglones[i].Renglones + ".json"));
37 36
     }