tum лет назад: 4
Родитель
Сommit
e8aedc54fe
6 измененных файлов с 15603 добавлено и 25 удалено
  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

Разница между файлами не показана из-за своего большого размера
+ 15550 - 0
package-lock.json


+ 8 - 4
package.json

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

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

21
 
21
 
22
 import { CallNumber } from '@ionic-native/call-number/ngx';
22
 import { CallNumber } from '@ionic-native/call-number/ngx';
23
 import { EmailComposer } from '@ionic-native/email-composer/ngx';
23
 import { EmailComposer } from '@ionic-native/email-composer/ngx';
24
+import { HTTP } from '@ionic-native/http/ngx';
24
 
25
 
25
 // import { IonicImageViewerModule } from 'ionic-img-viewer';
26
 // import { IonicImageViewerModule } from 'ionic-img-viewer';
26
 
27
 
28
 // library.add(fas,far,fab);
29
 // library.add(fas,far,fab);
29
 
30
 
30
 @NgModule({
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
 export class AppModule {
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
           <fa-icon [icon]="['fas', 'running']" size="3x"></fa-icon>
42
           <fa-icon [icon]="['fas', 'running']" size="3x"></fa-icon>
43
         </div>
43
         </div>
44
       </ion-col> -->
44
       </ion-col> -->
45
+      {{ stores }}
45
       <ion-col size="3">
46
       <ion-col size="3">
46
         <div class="center catshow">
47
         <div class="center catshow">
47
           <a [routerLink]="['/tabs/place/']">
48
           <a [routerLink]="['/tabs/place/']">
67
     </ion-row>
68
     </ion-row>
68
     <ion-row>
69
     <ion-row>
69
       <ion-col>
70
       <ion-col>
70
-        <ion-card *ngFor="let pldata of placelasted">
71
+        <ion-card *ngFor="let pldata of stores">
71
           <div *ngIf="pldata.better_featured_image != null">
72
           <div *ngIf="pldata.better_featured_image != null">
72
             <img src="{{pldata.better_featured_image.source_url}}" alt="">
73
             <img src="{{pldata.better_featured_image.source_url}}" alt="">
73
           </div>
74
           </div>
76
           </div>
77
           </div>
77
           <ion-card-header>
78
           <ion-card-header>
78
             <a [routerLink]="['/tabs/place/', pldata.id]">
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
             </a>
81
             </a>
81
             <a [routerLink]="['/tabs/province/']">
82
             <a [routerLink]="['/tabs/province/']">
82
-              <span [innerHTML]="pldata._embedded['wp:term'][1][0].name"></span>
83
+                <span>{{ pldata.fields.province }}</span>
83
             </a> /
84
             </a> /
85
+            
84
             <a [routerLink]="['/tabs/place/']">
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
           </ion-card-header>
89
           </ion-card-header>
88
         </ion-card>
90
         </ion-card>
89
       </ion-col>
91
       </ion-col>
90
     </ion-row>
92
     </ion-row>
91
   </ion-grid>
93
   </ion-grid>
92
-</ion-content>
94
+</ion-content>

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

20
     autoplay: true
20
     autoplay: true
21
   };
21
   };
22
 
22
 
23
+    stores: any;
24
+
23
   constructor(public navCtrl: NavController, private wpservice: WpServiceService) { }
25
   constructor(public navCtrl: NavController, private wpservice: WpServiceService) { }
24
 
26
 
25
   ngOnInit() {
27
   ngOnInit() {
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
 import { Injectable } from '@angular/core';
1
 import { Injectable } from '@angular/core';
2
 import { HttpClient,HttpClientModule } from '@angular/common/http';
2
 import { HttpClient,HttpClientModule } from '@angular/common/http';
3
+import { HTTP } from '@ionic-native/http/ngx';
3
 
4
 
4
 @Injectable({
5
 @Injectable({
5
   providedIn: 'root'
6
   providedIn: 'root'
6
 })
7
 })
7
 export class WpServiceService {
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
   getSlideshow() {
13
   getSlideshow() {
12
     return this.http.get(
14
     return this.http.get(
15
     );
17
     );
16
   }
18
   }
17
 
19
 
20
+    getStores() {
21
+        return this.httpNative.get(this.URLBASE + "stores", {}, {});
22
+    }
23
+
18
   getLasted() {
24
   getLasted() {
19
     return this.http.get(
25
     return this.http.get(
20
       "/assets/json/place.json"
26
       "/assets/json/place.json"