Browse Source

Temporary fix

christian 4 years ago
parent
commit
db66910ff6
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

117
                     ons.getScriptPage().onInit = function () {
117
                     ons.getScriptPage().onInit = function () {
118
                         this.querySelector('ons-toolbar div.center').textContent = this.data.title;
118
                         this.querySelector('ons-toolbar div.center').textContent = this.data.title;
119
 
119
 
120
-                        console.log("test");
121
 
120
 
122
                         //var File = this.data.title.toUpperCase() + '.json' ;
121
                         //var File = this.data.title.toUpperCase() + '.json' ;
123
-                        var Esp = this.data.esp.split(';');
122
+                        var Esp = this.data.esp.split(', ');
124
                         var artesanos_json = this.data.json;
123
                         var artesanos_json = this.data.json;
124
+                        console.log(artesanos_json);
125
 
125
 
126
                         //Convertir en mayuscula primera letra del string.
126
                         //Convertir en mayuscula primera letra del string.
127
                         for(var i=0; i<Esp.length; i++) {
127
                         for(var i=0; i<Esp.length; i++) {
160
                             var searchVal = "my Name";
160
                             var searchVal = "my Name";
161
                             for (var i=0 ; i < artesanos_json.length ; i++)
161
                             for (var i=0 ; i < artesanos_json.length ; i++)
162
                             {
162
                             {
163
-                                if (artesanos_json[i].Especificaciones1.includes(Esp[num])) {
163
+                                if (artesanos_json[i].Especificaciones.includes(Esp[num])) {
164
                                     results.push(artesanos_json[i]);
164
                                     results.push(artesanos_json[i]);
165
                                 }
165
                                 }
166
                             }
166
                             }
198
               <ons-list-item expandable tappable>
198
               <ons-list-item expandable tappable>
199
                 <div class="center" >${Artesano.Nombre}</div>
199
                 <div class="center" >${Artesano.Nombre}</div>
200
                 <div class="expandable-content"> Municipio: ${Artesano.Municipio}<br>
200
                 <div class="expandable-content"> Municipio: ${Artesano.Municipio}<br>
201
-                                                 Tel\u00e9fono: ${Artesano["Telefono1"]}<br>
202
-                                                 Correo Electr\u00f3nico: ${Artesano["E-mail1"]}<br>
201
+                                                 Tel\u00e9fono: ${Artesano["Tel\u00e9fono 1"]}<br>
202
+                                                 Correo Electr\u00f3nico: ${Artesano["E-mail"]}<br>
203
                                                  </div>
203
                                                  </div>
204
               </ons-list-item>`
204
               </ons-list-item>`
205
                                                     );
205
                                                     );
217
                             if (Artesano.Municipio.trim().length != 0) {
217
                             if (Artesano.Municipio.trim().length != 0) {
218
                                 cont ++;
218
                                 cont ++;
219
                             }
219
                             }
220
-                            if (Artesano["Telefono1"].trim().length != 0) {
220
+                            if (Artesano["Tel\u00e9fono 1"].trim().length != 0) {
221
                                 cont ++;
221
                                 cont ++;
222
                             }
222
                             }
223
-                            if (Artesano["E-mail1"].trim().length != 0) {
223
+                            if (Artesano["E-mail"].trim().length != 0) {
224
                                 cont ++;
224
                                 cont ++;
225
                             }
225
                             }
226
-                            if (Artesano.Especificaciones1.trim().length != 0) {
226
+                            if (Artesano.Especificaciones.trim().length != 0) {
227
                                 cont ++;
227
                                 cont ++;
228
                             }
228
                             }
229
 
229
 
230
 
230
 
231
                             //info a pasar
231
                             //info a pasar
232
                             //'title':'${Artesano.Nombre}','esp': '${info}'
232
                             //'title':'${Artesano.Nombre}','esp': '${info}'
233
-                            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>
233
+                            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>
234
                         <div class="title">${Artesano.Nombre}</div>
234
                         <div class="title">${Artesano.Nombre}</div>
235
                     </ons-list-item>`);
235
                     </ons-list-item>`);
236
 
236
 

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

28
   if (checkDate() == false) {
28
   if (checkDate() == false) {
29
 
29
 
30
     window.localStorage.setItem("RENGLONES", loadFile("https://136.145.181.12/renglones.json"));
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
     var renglones = JSON.parse(window.localStorage.getItem("RENGLONES"));
32
     var renglones = JSON.parse(window.localStorage.getItem("RENGLONES"));
34
-
33
+    console.log(renglones);
35
     for (var i = 0; i < renglones.length; i++) {
34
     for (var i = 0; i < renglones.length; i++) {
36
       window.localStorage.setItem(renglones[i].Renglones, loadFile("https://136.145.181.12/" + renglones[i].Renglones + ".json"));
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

117
                     ons.getScriptPage().onInit = function () {
117
                     ons.getScriptPage().onInit = function () {
118
                         this.querySelector('ons-toolbar div.center').textContent = this.data.title;
118
                         this.querySelector('ons-toolbar div.center').textContent = this.data.title;
119
 
119
 
120
-                        console.log("test");
121
 
120
 
122
                         //var File = this.data.title.toUpperCase() + '.json' ;
121
                         //var File = this.data.title.toUpperCase() + '.json' ;
123
-                        var Esp = this.data.esp.split(';');
122
+                        var Esp = this.data.esp.split(', ');
124
                         var artesanos_json = this.data.json;
123
                         var artesanos_json = this.data.json;
124
+                        console.log(artesanos_json);
125
 
125
 
126
                         //Convertir en mayuscula primera letra del string.
126
                         //Convertir en mayuscula primera letra del string.
127
                         for(var i=0; i<Esp.length; i++) {
127
                         for(var i=0; i<Esp.length; i++) {
160
                             var searchVal = "my Name";
160
                             var searchVal = "my Name";
161
                             for (var i=0 ; i < artesanos_json.length ; i++)
161
                             for (var i=0 ; i < artesanos_json.length ; i++)
162
                             {
162
                             {
163
-                                if (artesanos_json[i].Especificaciones1.includes(Esp[num])) {
163
+                                if (artesanos_json[i].Especificaciones.includes(Esp[num])) {
164
                                     results.push(artesanos_json[i]);
164
                                     results.push(artesanos_json[i]);
165
                                 }
165
                                 }
166
                             }
166
                             }
198
               <ons-list-item expandable tappable>
198
               <ons-list-item expandable tappable>
199
                 <div class="center" >${Artesano.Nombre}</div>
199
                 <div class="center" >${Artesano.Nombre}</div>
200
                 <div class="expandable-content"> Municipio: ${Artesano.Municipio}<br>
200
                 <div class="expandable-content"> Municipio: ${Artesano.Municipio}<br>
201
-                                                 Tel\u00e9fono: ${Artesano["Telefono1"]}<br>
202
-                                                 Correo Electr\u00f3nico: ${Artesano["E-mail1"]}<br>
201
+                                                 Tel\u00e9fono: ${Artesano["Tel\u00e9fono 1"]}<br>
202
+                                                 Correo Electr\u00f3nico: ${Artesano["E-mail"]}<br>
203
                                                  </div>
203
                                                  </div>
204
               </ons-list-item>`
204
               </ons-list-item>`
205
                                                     );
205
                                                     );
217
                             if (Artesano.Municipio.trim().length != 0) {
217
                             if (Artesano.Municipio.trim().length != 0) {
218
                                 cont ++;
218
                                 cont ++;
219
                             }
219
                             }
220
-                            if (Artesano["Telefono1"].trim().length != 0) {
220
+                            if (Artesano["Tel\u00e9fono 1"].trim().length != 0) {
221
                                 cont ++;
221
                                 cont ++;
222
                             }
222
                             }
223
-                            if (Artesano["E-mail1"].trim().length != 0) {
223
+                            if (Artesano["E-mail"].trim().length != 0) {
224
                                 cont ++;
224
                                 cont ++;
225
                             }
225
                             }
226
-                            if (Artesano.Especificaciones1.trim().length != 0) {
226
+                            if (Artesano.Especificaciones.trim().length != 0) {
227
                                 cont ++;
227
                                 cont ++;
228
                             }
228
                             }
229
 
229
 
230
 
230
 
231
                             //info a pasar
231
                             //info a pasar
232
                             //'title':'${Artesano.Nombre}','esp': '${info}'
232
                             //'title':'${Artesano.Nombre}','esp': '${info}'
233
-                            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>
233
+                            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>
234
                         <div class="title">${Artesano.Nombre}</div>
234
                         <div class="title">${Artesano.Nombre}</div>
235
                     </ons-list-item>`);
235
                     </ons-list-item>`);
236
 
236
 

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

28
   if (checkDate() == false) {
28
   if (checkDate() == false) {
29
 
29
 
30
     window.localStorage.setItem("RENGLONES", loadFile("https://136.145.181.12/renglones.json"));
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
     var renglones = JSON.parse(window.localStorage.getItem("RENGLONES"));
32
     var renglones = JSON.parse(window.localStorage.getItem("RENGLONES"));
34
-
33
+    console.log(renglones);
35
     for (var i = 0; i < renglones.length; i++) {
34
     for (var i = 0; i < renglones.length; i++) {
36
       window.localStorage.setItem(renglones[i].Renglones, loadFile("https://136.145.181.12/" + renglones[i].Renglones + ".json"));
35
       window.localStorage.setItem(renglones[i].Renglones, loadFile("https://136.145.181.12/" + renglones[i].Renglones + ".json"));
37
     }
36
     }