tum 4 vuotta sitten
vanhempi
commit
e8aedc54fe
6 muutettua tiedostoa jossa 15603 lisäystä ja 25 poistoa
  1. 15550 0
      package-lock.json
  2. 8 4
      package.json
  3. 16 14
      src/app/app.module.ts
  4. 8 6
      src/app/home/home.page.html
  5. 14 0
      src/app/home/home.page.ts
  6. 7 1
      src/app/wp-service.service.ts

File diff suppressed because it is too large
+ 15550 - 0
package-lock.json


+ 8 - 4
package.json

@@ -26,14 +26,13 @@
26 26
     "@fortawesome/free-brands-svg-icons": "^5.15.4",
27 27
     "@fortawesome/free-regular-svg-icons": "^5.15.4",
28 28
     "@fortawesome/free-solid-svg-icons": "^5.15.4",
29
-    "@ionic-native/core": "^5.36.0",
30 29
     "@ionic-native/call-number": "^5.22.0-beta-1",
30
+    "@ionic-native/core": "^5.36.0",
31 31
     "@ionic-native/email-composer": "^5.36.0",
32 32
     "@ionic-native/geolocation": "^5.36.0",
33 33
     "@ionic-native/http": "^5.36.0",
34 34
     "@ionic-native/native-geocoder": "^5.36.0",
35 35
     "@ionic/angular": "^5.5.2",
36
-    "cordova-ios": "^4.0.1",
37 36
     "ionic-img-viewer": "^2.9.0",
38 37
     "rxjs": "~6.6.0",
39 38
     "tslib": "^2.2.0",
@@ -56,9 +55,12 @@
56 55
     "@typescript-eslint/eslint-plugin": "4.16.1",
57 56
     "@typescript-eslint/parser": "4.16.1",
58 57
     "call-number": "^1.0.1",
58
+    "cordova-ios": "^6.2.0",
59 59
     "cordova-plugin-add-swift-support": "^1.7.2",
60
+    "cordova-plugin-advanced-http": "^3.2.0",
60 61
     "cordova-plugin-device": "2.0.2",
61 62
     "cordova-plugin-email-composer": "^0.9.2",
63
+    "cordova-plugin-file": "^6.0.2",
62 64
     "cordova-plugin-geolocation": "^4.1.0",
63 65
     "cordova-plugin-googlemaps": "^2.7.1",
64 66
     "cordova-plugin-googlemaps-sdk": "github:mapsplugin/cordova-plugin-googlemaps-sdk",
@@ -80,6 +82,7 @@
80 82
     "karma-coverage-istanbul-reporter": "~3.0.2",
81 83
     "karma-jasmine": "~4.0.0",
82 84
     "karma-jasmine-html-reporter": "^1.5.0",
85
+    "mx.ferreyra.callnumber": "0.0.2",
83 86
     "protractor": "~7.0.0",
84 87
     "ts-node": "~8.3.0",
85 88
     "typescript": "~4.2.4"
@@ -98,10 +101,11 @@
98 101
         "LOCATION_WHEN_IN_USE_DESCRIPTION": "Use geocoder service"
99 102
       },
100 103
       "mx.ferreyra.callnumber": {},
101
-      "cordova-plugin-email-composer": {}
104
+      "cordova-plugin-email-composer": {},
105
+      "call-number": {}
102 106
     },
103 107
     "platforms": [
104 108
       "ios"
105 109
     ]
106 110
   }
107
-}
111
+}

+ 16 - 14
src/app/app.module.ts

@@ -21,6 +21,7 @@ import { NativeGeocoder } from '@ionic-native/native-geocoder/ngx';
21 21
 
22 22
 import { CallNumber } from '@ionic-native/call-number/ngx';
23 23
 import { EmailComposer } from '@ionic-native/email-composer/ngx';
24
+import { HTTP } from '@ionic-native/http/ngx';
24 25
 
25 26
 // import { IonicImageViewerModule } from 'ionic-img-viewer';
26 27
 
@@ -28,21 +29,22 @@ import { EmailComposer } from '@ionic-native/email-composer/ngx';
28 29
 // library.add(fas,far,fab);
29 30
 
30 31
 @NgModule({
31
-  declarations: [AppComponent],
32
-  entryComponents: [],
33
-  imports: [HttpClientModule, BrowserModule, IonicModule.forRoot(), AppRoutingModule, FontAwesomeModule],
34
-  providers: [
35
-    Geolocation,
36
-    NativeGeocoder,
37
-    CallNumber,
38
-    EmailComposer,
39
-    { provide: RouteReuseStrategy, useClass: IonicRouteStrategy }
40
-  ],
41
-  bootstrap: [AppComponent],
32
+    declarations: [AppComponent],
33
+    entryComponents: [],
34
+    imports: [HttpClientModule, BrowserModule, IonicModule.forRoot(), AppRoutingModule, FontAwesomeModule],
35
+    providers: [
36
+        Geolocation,
37
+        NativeGeocoder,
38
+        CallNumber,
39
+        EmailComposer,
40
+        HTTP,
41
+        { provide: RouteReuseStrategy, useClass: IonicRouteStrategy }
42
+    ],
43
+    bootstrap: [AppComponent],
42 44
 })
43 45
 export class AppModule {
44
-constructor(library: FaIconLibrary) {
45
-  library.addIconPacks(fas, fab, far);
46
-}
46
+    constructor(library: FaIconLibrary) {
47
+        library.addIconPacks(fas, fab, far);
48
+    }
47 49
 
48 50
 }

+ 8 - 6
src/app/home/home.page.html

@@ -42,6 +42,7 @@
42 42
           <fa-icon [icon]="['fas', 'running']" size="3x"></fa-icon>
43 43
         </div>
44 44
       </ion-col> -->
45
+      {{ stores }}
45 46
       <ion-col size="3">
46 47
         <div class="center catshow">
47 48
           <a [routerLink]="['/tabs/place/']">
@@ -67,7 +68,7 @@
67 68
     </ion-row>
68 69
     <ion-row>
69 70
       <ion-col>
70
-        <ion-card *ngFor="let pldata of placelasted">
71
+        <ion-card *ngFor="let pldata of stores">
71 72
           <div *ngIf="pldata.better_featured_image != null">
72 73
             <img src="{{pldata.better_featured_image.source_url}}" alt="">
73 74
           </div>
@@ -76,17 +77,18 @@
76 77
           </div>
77 78
           <ion-card-header>
78 79
             <a [routerLink]="['/tabs/place/', pldata.id]">
79
-              <ion-card-title [innerHTML]="pldata.title.rendered"></ion-card-title>
80
+                <ion-card-title>{{ pldata.fields.name }}</ion-card-title>
80 81
             </a>
81 82
             <a [routerLink]="['/tabs/province/']">
82
-              <span [innerHTML]="pldata._embedded['wp:term'][1][0].name"></span>
83
+                <span>{{ pldata.fields.province }}</span>
83 84
             </a> /
85
+            
84 86
             <a [routerLink]="['/tabs/place/']">
85
-              <span [innerHTML]="pldata._embedded['wp:term'][2][0].name"></span>
86
-            </a>
87
+                <span>{{ pldata.fields.store_cat }}</span>
88
+            </a> 
87 89
           </ion-card-header>
88 90
         </ion-card>
89 91
       </ion-col>
90 92
     </ion-row>
91 93
   </ion-grid>
92
-</ion-content>
94
+</ion-content>

+ 14 - 0
src/app/home/home.page.ts

@@ -20,6 +20,8 @@ export class HomePage implements OnInit {
20 20
     autoplay: true
21 21
   };
22 22
 
23
+    stores: any;
24
+
23 25
   constructor(public navCtrl: NavController, private wpservice: WpServiceService) { }
24 26
 
25 27
   ngOnInit() {
@@ -36,4 +38,16 @@ export class HomePage implements OnInit {
36 38
     });        
37 39
   }
38 40
 
41
+    ionViewWillEnter() {
42
+        this.wpservice.getStores().then( res => {
43
+            console.log(res);
44
+            this.stores = JSON.parse(res['data']);
45
+            //this.stores = JSON.parse(abc['stores']);
46
+            console.log(this.stores);
47
+        },
48
+        error => {
49
+                console.log(error);
50
+        }); 
51
+    }
52
+
39 53
 }

+ 7 - 1
src/app/wp-service.service.ts

@@ -1,12 +1,14 @@
1 1
 import { Injectable } from '@angular/core';
2 2
 import { HttpClient,HttpClientModule } from '@angular/common/http';
3
+import { HTTP } from '@ionic-native/http/ngx';
3 4
 
4 5
 @Injectable({
5 6
   providedIn: 'root'
6 7
 })
7 8
 export class WpServiceService {
8 9
 
9
-  constructor(private http: HttpClient) { }
10
+  URLBASE = "http://192.168.1.141:8000/wellness/api/";
11
+  constructor(private http: HttpClient, private httpNative: HTTP) { }
10 12
 
11 13
   getSlideshow() {
12 14
     return this.http.get(
@@ -15,6 +17,10 @@ export class WpServiceService {
15 17
     );
16 18
   }
17 19
 
20
+    getStores() {
21
+        return this.httpNative.get(this.URLBASE + "stores", {}, {});
22
+    }
23
+
18 24
   getLasted() {
19 25
     return this.http.get(
20 26
       "/assets/json/place.json"