diff-1e2c38e3cd5755eb7ec52722c0f158e9fba2d612R11">11
+ </div>
|
|
|
12
|
+ </ion-slide>
|
|
|
13
|
+ </ion-slides>
|
|
|
14
|
+ <ion-grid>
|
|
|
15
|
+ <ion-row>
|
|
|
16
|
+ <ion-col>
|
|
|
17
|
+ <ion-toolbar class="search">
|
|
|
18
|
+ <ion-searchbar placeholder="ค้นหา"></ion-searchbar>
|
|
|
19
|
+ </ion-toolbar>
|
|
|
20
|
+ </ion-col>
|
|
|
21
|
+ </ion-row>
|
|
|
22
|
+ <ion-row class="ion-justify-content-start">
|
|
|
23
|
+ <!-- <ion-col size="6">
|
|
|
24
|
+ <div class="center catshow">
|
|
|
25
|
+ <fa-icon [icon]="['fas', 'utensils']" size="3x" class="red"></fa-icon>
|
|
|
26
|
+ </div>
|
|
|
27
|
+ </ion-col>
|
|
|
28
|
+ <ion-col size="6">
|
|
|
29
|
+ <div class=" catshow center">
|
|
|
30
|
+ <fa-icon [icon]="['fas', 'spa']" size="3x"></fa-icon>
|
|
|
31
|
+ </div>
|
|
|
32
|
+ </ion-col>
|
|
|
33
|
+ <ion-col size="6">
|
|
|
34
|
+ <div class=" catshow center">
|
|
|
35
|
+ <fa-icon [icon]="['fas', 'praying-hands']" size="3x"></fa-icon>
|
|
|
36
|
+ </div>
|
|
|
37
|
+ </ion-col>
|
|
|
38
|
+ <ion-col size="6">
|
|
|
39
|
+ <div class="catshow center">
|
|
|
40
|
+ <fa-icon [icon]="['fas', 'running']" size="3x"></fa-icon>
|
|
|
41
|
+ </div>
|
|
|
42
|
+ </ion-col> -->
|
|
|
43
|
+ <ion-col size="3">
|
|
|
44
|
+ <div class="center catshow">
|
|
|
45
|
+ <a [routerLink]="['/tabs/place/']"><fa-icon [icon]="['fas', 'utensils']" size="2x" class="red"></fa-icon></a>
|
|
|
46
|
+ </div>
|
|
|
47
|
+ </ion-col>
|
|
|
48
|
+ <ion-col size="3">
|
|
|
49
|
+ <div class=" catshow center">
|
|
|
50
|
+ <fa-icon [icon]="['fas', 'spa']" size="2x"></fa-icon>
|
|
|
51
|
+ </div>
|
|
|
52
|
+ </ion-col>
|
|
|
53
|
+ <ion-col size="3">
|
|
|
54
|
+ <div class=" catshow center">
|
|
|
55
|
+ <fa-icon [icon]="['fas', 'praying-hands']" size="2x"></fa-icon>
|
|
|
56
|
+ </div>
|
|
|
57
|
+ </ion-col>
|
|
|
58
|
+ <ion-col size="3">
|
|
|
59
|
+ <div class="catshow center">
|
|
|
60
|
+ <fa-icon [icon]="['fas', 'running']" size="2x"></fa-icon>
|
|
|
61
|
+ </div>
|
|
|
62
|
+ </ion-col>
|
|
|
63
|
+ </ion-row>
|
|
|
64
|
+ <ion-row>
|
|
|
65
|
+ <ion-col>
|
|
|
66
|
+ <ion-card *ngFor="let pldata of placelasted">
|
|
|
67
|
+ <div *ngIf="$any(pldata).better_featured_image != null">
|
|
|
68
|
+ <img src="{{$any(pldata).better_featured_image.source_url}}" alt="">
|
|
|
69
|
+ </div>
|
|
|
70
|
+ <div *ngIf="$any(pldata).better_featured_image == null">
|
|
|
71
|
+ <img src="/assets/images/temp.png" />
|
|
|
72
|
+ </div>
|
|
|
73
|
+ <ion-card-header>
|
|
|
74
|
+ <a [routerLink]="['/tabs/place/', pldata.id]"><ion-card-title [innerHTML]="pldata.title.rendered"></ion-card-title>
|
|
|
75
|
+ </a>
|
|
|
76
|
+ <a [routerLink]="['/tabs/province/']">
|
|
|
77
|
+ <span [innerHTML]="pldata._embedded['wp:term'][1][0].name"></span>
|
|
|
78
|
+ </a> /
|
|
|
79
|
+ <a [routerLink]="['/tabs/place/']">
|
|
|
80
|
+ <span [innerHTML]="pldata._embedded['wp:term'][2][0].name"></span>
|
|
|
81
|
+ </a>
|
|
|
82
|
+ </ion-card-header>
|
|
|
83
|
+ </ion-card>
|
|
|
84
|
+ </ion-col>
|
|
|
85
|
+ </ion-row>
|
|
|
86
|
+ </ion-grid>
|
|
|
87
|
+</ion-content>
|
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+ion-card-title {
|
|
|
2
|
+ font-family: "IBM Plex Sans Thai", sans-serif !important;
|
|
|
3
|
+ font-weight: 600;
|
|
|
4
|
+ font-size: 20px;
|
|
|
5
|
+}
|
|
|
6
|
+
|
|
|
7
|
+ion-searchbar{
|
|
|
8
|
+ // --color:#000;
|
|
|
9
|
+ // --placeholder-color:#000;
|
|
|
10
|
+ // --background:#000;
|
|
|
11
|
+}
|
|
|
12
|
+
|
|
|
13
|
+.search{
|
|
|
14
|
+ padding: 0px !important;
|
|
|
15
|
+ // margin-bottom: 30px;
|
|
|
16
|
+ margin-top: 10px;
|
|
|
17
|
+}
|
|
|
18
|
+
|
|
|
19
|
+// .red {
|
|
|
20
|
+// color: rgb(255, 0, 0);
|
|
|
21
|
+// }
|
|
|
22
|
+
|
|
|
23
|
+.catshow {
|
|
|
24
|
+ height: 100px;
|
|
|
25
|
+ // background-color: rgb(183, 210, 236);
|
|
|
26
|
+ border: solid 1px;
|
|
|
27
|
+ border-color: cornflowerblue;
|
|
|
28
|
+}
|
|
|
29
|
+
|
|
|
30
|
+.center {
|
|
|
31
|
+ // // height: 110px;
|
|
|
32
|
+ // margin: auto;
|
|
|
33
|
+ // // width: 50%;
|
|
|
34
|
+ // border: 3px solid green;
|
|
|
35
|
+ // padding: 10px;
|
|
|
36
|
+ // display: block;
|
|
|
37
|
+ // margin-left: auto;
|
|
|
38
|
+ // margin-right: auto;
|
|
|
39
|
+ display: flex;
|
|
|
40
|
+ // height: 180px;
|
|
|
41
|
+ // background-color: #ff1124;
|
|
|
42
|
+ justify-content: center;
|
|
|
43
|
+ align-items: center;
|
|
|
44
|
+ // flex-wrap: wrap;
|
|
|
45
|
+}
|
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
|
|
2
|
+import { IonicModule } from '@ionic/angular';
|
|
|
3
|
+
|
|
|
4
|
+import { HomePage } from './home.page';
|
|
|
5
|
+
|
|
|
6
|
+describe('HomePage', () => {
|
|
|
7
|
+ let component: HomePage;
|
|
|
8
|
+ let fixture: ComponentFixture<HomePage>;
|
|
|
9
|
+
|
|
|
10
|
+ beforeEach(waitForAsync(() => {
|
|
|
11
|
+ TestBed.configureTestingModule({
|
|
|
12
|
+ declarations: [ HomePage ],
|
|
|
13
|
+ imports: [IonicModule.forRoot()]
|
|
|
14
|
+ }).compileComponents();
|
|
|
15
|
+
|
|
|
16
|
+ fixture = TestBed.createComponent(HomePage);
|
|
|
17
|
+ component = fixture.componentInstance;
|
|
|
18
|
+ fixture.detectChanges();
|
|
|
19
|
+ }));
|
|
|
20
|
+
|
|
|
21
|
+ it('should create', () => {
|
|
|
22
|
+ expect(component).toBeTruthy();
|
|
|
23
|
+ });
|
|
|
24
|
+});
|
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+import { Component, OnInit } from '@angular/core';
|
|
|
2
|
+import { NavController } from '@ionic/angular';
|
|
|
3
|
+import { WpServiceService } from '../wp-service.service';
|
|
|
4
|
+
|
|
|
5
|
+
|
|
|
6
|
+@Component({
|
|
|
7
|
+ selector: 'app-home',
|
|
|
8
|
+ templateUrl: './home.page.html',
|
|
|
9
|
+ styleUrls: ['./home.page.scss'],
|
|
|
10
|
+})
|
|
|
11
|
+export class HomePage implements OnInit {
|
|
|
12
|
+
|
|
|
13
|
+ imageslide :any = [];
|
|
|
14
|
+ placelasted :any = [];
|
|
|
15
|
+ sliderOne: any;
|
|
|
16
|
+
|
|
|
17
|
+ slideOptsOne = {
|
|
|
18
|
+ initialSlide: 0,
|
|
|
19
|
+ slidesPerView: 1,
|
|
|
20
|
+ autoplay: true
|
|
|
21
|
+ };
|
|
|
22
|
+
|
|
|
23
|
+ constructor(public navCtrl: NavController, private wpservice: WpServiceService) { }
|
|
|
24
|
+
|
|
|
25
|
+ ngOnInit() {
|
|
|
26
|
+
|
|
|
27
|
+ this.wpservice.getSlideshow().subscribe((data) => {
|
|
|
28
|
+ this.imageslide = data;
|
|
|
29
|
+ console.log('load imageslide');
|
|
|
30
|
+ });
|
|
|
31
|
+
|
|
|
32
|
+ this.wpservice.getLasted().subscribe((placedata) => {
|
|
|
33
|
+ this.placelasted = placedata;
|
|
|
34
|
+ console.log('load Place');
|
|
|
35
|
+ console.log(placedata);
|
|
|
36
|
+ });
|
|
|
37
|
+ }
|
|
|
38
|
+
|
|
|
39
|
+}
|
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+import { NgModule } from '@angular/core';
|
|
|
2
|
+import { Routes, RouterModule } from '@angular/router';
|
|
|
3
|
+
|
|
|
4
|
+import { LoginPage } from './login.page';
|
|
|
5
|
+
|
|
|
6
|
+const routes: Routes = [
|
|
|
7
|
+ {
|
|
|
8
|
+ path: '',
|
|
|
9
|
+ component: LoginPage
|
|
|
10
|
+ }
|
|
|
11
|
+];
|
|
|
12
|
+
|
|
|
13
|
+@NgModule({
|
|
|
14
|
+ imports: [RouterModule.forChild(routes)],
|
|
|
15
|
+ exports: [RouterModule],
|
|
|
16
|
+})
|
|
|
17
|
+export class LoginPageRoutingModule {}
|
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+import { NgModule } from '@angular/core';
|
|
|
2
|
+import { CommonModule } from '@angular/common';
|
|
|
3
|
+import { FormsModule } from '@angular/forms';
|
|
|
4
|
+
|
|
|
5
|
+import { IonicModule } from '@ionic/angular';
|
|
|
6
|
+
|
|
|
7
|
+import { LoginPageRoutingModule } from './login-routing.module';
|
|
|
8
|
+
|
|
|
9
|
+import { LoginPage } from './login.page';
|
|
|
10
|
+
|
|
|
11
|
+@NgModule({
|
|
|
12
|
+ imports: [
|
|
|
13
|
+ CommonModule,
|
|
|
14
|
+ FormsModule,
|
|
|
15
|
+ IonicModule,
|
|
|
16
|
+ LoginPageRoutingModule
|
|
|
17
|
+ ],
|
|
|
18
|
+ declarations: [LoginPage]
|
|
|
19
|
+})
|
|
|
20
|
+export class LoginPageModule {}
|
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+<ion-header>
|
|
|
2
|
+ <ion-toolbar>
|
|
|
3
|
+ <ion-title>Wellness Route</ion-title>
|
|
|
4
|
+ </ion-toolbar>
|
|
|
5
|
+</ion-header>
|
|
|
6
|
+
|
|
|
7
|
+<ion-content>
|
|
|
8
|
+ <ion-row>
|
|
|
9
|
+ <ion-col>
|
|
|
10
|
+ <div class="ion-text-center">
|
|
|
11
|
+ <h1>เข้าสู่ระบบ</h1>
|
|
|
12
|
+ </div>
|
|
|
13
|
+ </ion-col>
|
|
|
14
|
+ </ion-row>
|
|
|
15
|
+ <ion-row>
|
|
|
16
|
+ <ion-col>
|
|
|
17
|
+ <form>
|
|
|
18
|
+ <ion-item lines="full">
|
|
|
19
|
+ <ion-label position="floating">อีเมล์</ion-label>
|
|
|
20
|
+ <ion-input type="text" required="true" [(ngModel)]='registerForm.email' name='email' type='email'></ion-input>
|
|
|
21
|
+ </ion-item>
|
|
|
22
|
+
|
|
|
23
|
+ <ion-item lines="full">
|
|
|
24
|
+ <ion-label position="floating">รหัสผ่าน</ion-label>
|
|
|
25
|
+ <ion-input type="password" required [(ngModel)]='registerForm.password' name='password'></ion-input>
|
|
|
26
|
+ </ion-item>
|
|
|
27
|
+ </form>
|
|
|
28
|
+ </ion-col>
|
|
|
29
|
+ </ion-row>
|
|
|
30
|
+ <ion-row>
|
|
|
31
|
+ <ion-col>
|
|
|
32
|
+ <ion-button type="submit" color="success" expand="block" (click)="userLogin()">Login</ion-button>
|
|
|
33
|
+ </ion-col>
|
|
|
34
|
+ </ion-row>
|
|
|
35
|
+ <ion-row>
|
|
|
36
|
+ <ion-col class='ion-text-center'>
|
|
|
37
|
+ <a (click)="openForgotPassword()" class="small-text">ลืมรหัส</a>
|
|
|
38
|
+ </ion-col>
|
|
|
39
|
+ <ion-col class='ion-text-center'>
|
|
|
40
|
+ <a (click)="openRegister()" class="small-text">สม้ครใหม่</a>
|
|
|
41
|
+ </ion-col>
|
|
|
42
|
+ </ion-row>
|
|
|
43
|
+ <ion-row>
|
|
|
44
|
+ <ion-col>
|
|
|
45
|
+ <span class="divider line one-line">หรือ</span>
|
|
|
46
|
+ </ion-col>
|
|
|
47
|
+ </ion-row>
|
|
|
48
|
+ <ion-row>
|
|
|
49
|
+ <ion-col>
|
|
|
50
|
+ <ion-button class="log-fb-in-button" expand="block" (click)="doFbLogin()">
|
|
|
51
|
+ Log in with Facebook
|
|
|
52
|
+ </ion-button><br>
|
|
|
53
|
+ <button (click)="appleSignIn()" block [hidden]="isAndroid">
|
|
|
54
|
+ <img src="assets/images/appleid_button@2x.png">
|
|
|
55
|
+ </button>
|
|
|
56
|
+ </ion-col>
|
|
|
57
|
+ </ion-row>
|
|
|
58
|
+ <ion-col>
|
|
|
59
|
+ <a [routerLink]="['/tabs/forgot-password']">
|
|
|
60
|
+ page ลืมรหัส
|
|
|
61
|
+ </a>
|
|
|
62
|
+ </ion-col>
|
|
|
63
|
+ <ion-col>
|
|
|
64
|
+ <a [routerLink]="['/tabs/register']">
|
|
|
65
|
+ page register or signin
|
|
|
66
|
+ </a>
|
|
|
67
|
+ </ion-col>
|
|
|
68
|
+ <ion-col>
|
|
|
69
|
+ <a [routerLink]="['/tabs/reset-password']">
|
|
|
70
|
+ page reset password
|
|
|
71
|
+ </a>
|
|
|
72
|
+ </ion-col>
|
|
|
73
|
+ <ion-col>
|
|
|
74
|
+ <a [routerLink]="['/tabs/profile']">
|
|
|
75
|
+ page profile
|
|
|
76
|
+ </a>
|
|
|
77
|
+ </ion-col>
|
|
|
78
|
+</ion-content>
|
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
|
|
|
2
|
+.divider {
|
|
|
3
|
+ display: flex;
|
|
|
4
|
+
|
|
|
5
|
+ &:before,
|
|
|
6
|
+ &:after {
|
|
|
7
|
+ content: "";
|
|
|
8
|
+ flex: 1;
|
|
|
9
|
+ }
|
|
|
10
|
+ }
|
|
|
11
|
+ .line {
|
|
|
12
|
+ align-items: center;
|
|
|
13
|
+ margin: 1em -1em;
|
|
|
14
|
+ color: #5f5e5e;
|
|
|
15
|
+ &:before,
|
|
|
16
|
+ &:after {
|
|
|
17
|
+ height: 1px;
|
|
|
18
|
+ margin: 0 1em;
|
|
|
19
|
+ }
|
|
|
20
|
+ }
|
|
|
21
|
+ .one-line {
|
|
|
22
|
+ &:before,
|
|
|
23
|
+ &:after {
|
|
|
24
|
+ background: #5f5e5e;
|
|
|
25
|
+ }
|
|
|
26
|
+ }
|
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
|
|
2
|
+import { IonicModule } from '@ionic/angular';
|
|
|
3
|
+
|
|
|
4
|
+import { LoginPage } from './login.page';
|
|
|
5
|
+
|
|
|
6
|
+describe('LoginPage', () => {
|
|
|
7
|
+ let component: LoginPage;
|
|
|
8
|
+ let fixture: ComponentFixture<LoginPage>;
|
|
|
9
|
+
|
|
|
10
|
+ beforeEach(waitForAsync(() => {
|
|
|
11
|
+ TestBed.configureTestingModule({
|
|
|
12
|
+ declarations: [ LoginPage ],
|
|
|
13
|
+ imports: [IonicModule.forRoot()]
|
|
|
14
|
+ }).compileComponents();
|
|
|
15
|
+
|
|
|
16
|
+ fixture = TestBed.createComponent(LoginPage);
|
|
|
17
|
+ component = fixture.componentInstance;
|
|
|
18
|
+ fixture.detectChanges();
|
|
|
19
|
+ }));
|
|
|
20
|
+
|
|
|
21
|
+ it('should create', () => {
|
|
|
22
|
+ expect(component).toBeTruthy();
|
|
|
23
|
+ });
|
|
|
24
|
+});
|
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+import { Component, OnInit } from '@angular/core';
|
|
|
2
|
+
|
|
|
3
|
+@Component({
|
|
|
4
|
+ selector: 'app-login',
|
|
|
5
|
+ templateUrl: './login.page.html',
|
|
|
6
|
+ styleUrls: ['./login.page.scss'],
|
|
|
7
|
+})
|
|
|
8
|
+export class LoginPage implements OnInit {
|
|
|
9
|
+
|
|
|
10
|
+ registerForm = { email: "", password: "" };
|
|
|
11
|
+ isAndroid = false;
|
|
|
12
|
+
|
|
|
13
|
+ constructor() { }
|
|
|
14
|
+
|
|
|
15
|
+ ngOnInit() {
|
|
|
16
|
+ }
|
|
|
17
|
+
|
|
|
18
|
+}
|
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+import { NgModule } from '@angular/core';
|
|
|
2
|
+import { Routes, RouterModule } from '@angular/router';
|
|
|
3
|
+
|
|
|
4
|
+import { PlacePage } from './place.page';
|
|
|
5
|
+
|
|
|
6
|
+const routes: Routes = [
|
|
|
7
|
+ {
|
|
|
8
|
+ path: '',
|
|
|
9
|
+ component: PlacePage
|
|
|
10
|
+ }
|
|
|
11
|
+];
|
|
|
12
|
+
|
|
|
13
|
+@NgModule({
|
|
|
14
|
+ imports: [RouterModule.forChild(routes)],
|
|
|
15
|
+ exports: [RouterModule],
|
|
|
16
|
+})
|
|
|
17
|
+export class PlacePageRoutingModule {}
|
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+import { NgModule } from '@angular/core';
|
|
|
2
|
+import { CommonModule } from '@angular/common';
|
|
|
3
|
+import { FormsModule } from '@angular/forms';
|
|
|
4
|
+
|
|
|
5
|
+import { IonicModule } from '@ionic/angular';
|
|
|
6
|
+
|
|
|
7
|
+import { PlacePageRoutingModule } from './place-routing.module';
|
|
|
8
|
+
|
|
|
9
|
+import { PlacePage } from './place.page';
|
|
|
10
|
+
|
|
|
11
|
+@NgModule({
|
|
|
12
|
+ imports: [
|
|
|
13
|
+ CommonModule,
|
|
|
14
|
+ FormsModule,
|
|
|
15
|
+ IonicModule,
|
|
|
16
|
+ PlacePageRoutingModule
|
|
|
17
|
+ ],
|
|
|
18
|
+ declarations: [PlacePage]
|
|
|
19
|
+})
|
|
|
20
|
+export class PlacePageModule {}
|
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+<ion-header>
|
|
|
2
|
+ <ion-toolbar class="new-background-color">
|
|
|
3
|
+ <ion-title>Wellness Route</ion-title>
|
|
|
4
|
+ </ion-toolbar>
|
|
|
5
|
+</ion-header>
|
|
|
6
|
+
|
|
|
7
|
+<ion-content>
|
|
|
8
|
+ <img src="/assets/images/golf-bg.jpg">
|
|
|
9
|
+ <div class="holidaycard">
|
|
|
10
|
+ <ion-grid>
|
|
|
11
|
+ <ion-row>
|
|
|
12
|
+ <ion-col size="12">
|
|
|
13
|
+ <div class="txt-place-title">Place Category Name</div>
|
|
|
14
|
+ </ion-col>
|
|
|
15
|
+ </ion-row>
|
|
|
16
|
+ <ion-card *ngFor="let pcl of placecatlist">
|
|
|
17
|
+ <div *ngIf="$any(pcl).better_featured_image != null">
|
|
|
18
|
+ <img src="{{$any(pcl).better_featured_image.source_url}}" alt="">
|
|
|
19
|
+ </div>
|
|
|
20
|
+ <div *ngIf="$any(pcl).better_featured_image == null">
|
|
|
21
|
+ <img src="/assets/images/temp.png" />
|
|
|
22
|
+ </div>
|
|
|
23
|
+ <ion-card-header>
|
|
|
24
|
+ <a [routerLink]="['/tabs/place/', pcl.id]"><ion-card-title [innerHTML]="pcl.title.rendered"></ion-card-title></a>
|
|
|
25
|
+ </ion-card-header>
|
|
|
26
|
+ </ion-card>
|
|
|
27
|
+ </ion-grid>
|
|
|
28
|
+ </div>
|
|
|
29
|
+</ion-content>
|
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+.holidaycard {
|
|
|
2
|
+ position: absolute;
|
|
|
3
|
+ left: 0px;
|
|
|
4
|
+ // bottom: 0px;
|
|
|
5
|
+ top:200px;
|
|
|
6
|
+ min-height: 48%;
|
|
|
7
|
+ width: 100%;
|
|
|
8
|
+ padding: 5px;
|
|
|
9
|
+ border-radius: 15px ;
|
|
|
10
|
+ background: white;
|
|
|
11
|
+ --background: white;
|
|
|
12
|
+ }
|
|
|
13
|
+
|
|
|
14
|
+ ion-card-title {
|
|
|
15
|
+ font-family: "IBM Plex Sans Thai", sans-serif !important;
|
|
|
16
|
+ font-weight: 600;
|
|
|
17
|
+ font-size: 20px;
|
|
|
18
|
+ }
|
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
|
|
2
|
+import { IonicModule } from '@ionic/angular';
|
|
|
3
|
+
|
|
|
4
|
+import { PlacePage } from './place.page';
|
|
|
5
|
+
|
|
|
6
|
+describe('PlacePage', () => {
|
|
|
7
|
+ let component: PlacePage;
|
|
|
8
|
+ let fixture: ComponentFixture<PlacePage>;
|
|
|
9
|
+
|
|
|
10
|
+ beforeEach(waitForAsync(() => {
|
|
|
11
|
+ TestBed.configureTestingModule({
|
|
|
12
|
+ declarations: [ PlacePage ],
|
|
|
13
|
+ imports: [IonicModule.forRoot()]
|
|
|
14
|
+ }).compileComponents();
|
|
|
15
|
+
|
|
|
16
|
+ fixture = TestBed.createComponent(PlacePage);
|
|
|
17
|
+ component = fixture.componentInstance;
|
|
|
18
|
+ fixture.detectChanges();
|
|
|
19
|
+ }));
|
|
|
20
|
+
|
|
|
21
|
+ it('should create', () => {
|
|
|
22
|
+ expect(component).toBeTruthy();
|
|
|
23
|
+ });
|
|
|
24
|
+});
|
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+import { Component, OnInit, Input } from '@angular/core';
|
|
|
2
|
+import { ActivatedRoute, Router } from '@angular/router';
|
|
|
3
|
+import { WpServiceService } from '../wp-service.service';
|
|
|
4
|
+
|
|
|
5
|
+@Component({
|
|
|
6
|
+ selector: 'app-place',
|
|
|
7
|
+ templateUrl: './place.page.html',
|
|
|
8
|
+ styleUrls: ['./place.page.scss'],
|
|
|
9
|
+})
|
|
|
10
|
+export class PlacePage implements OnInit {
|
|
|
11
|
+
|
|
|
12
|
+ data: any;
|
|
|
13
|
+ placecatlist: any;
|
|
|
14
|
+
|
|
|
15
|
+ constructor(private wpservice: WpServiceService, private route: ActivatedRoute, private router: Router) { }
|
|
|
16
|
+
|
|
|
17
|
+ @Input() id: string;
|
|
|
18
|
+
|
|
|
19
|
+ ngOnInit() {
|
|
|
20
|
+ let id = this.route.snapshot.paramMap.get('id') || this.id;
|
|
|
21
|
+ console.log("fetching ...");
|
|
|
22
|
+ this.wpservice.getPlaceCat().subscribe((data) => {
|
|
|
23
|
+ this.placecatlist = data;
|
|
|
24
|
+ console.log("load Cat Place ...");
|
|
|
25
|
+ console.log(data);
|
|
|
26
|
+ }, error => {
|
|
|
27
|
+ console.log("errror ", error);
|
|
|
28
|
+ });
|
|
|
29
|
+ }
|
|
|
30
|
+
|
|
|
31
|
+}
|
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+import { NgModule } from '@angular/core';
|
|
|
2
|
+import { Routes, RouterModule } from '@angular/router';
|
|
|
3
|
+
|
|
|
4
|
+import { PlacedetailPage } from './placedetail.page';
|
|
|
5
|
+
|
|
|
6
|
+const routes: Routes = [
|
|
|
7
|
+ {
|
|
|
8
|
+ path: '',
|
|
|
9
|
+ component: PlacedetailPage
|
|
|
10
|
+ }
|
|
|
11
|
+];
|
|
|
12
|
+
|
|
|
13
|
+@NgModule({
|
|
|
14
|
+ imports: [RouterModule.forChild(routes)],
|
|
|
15
|
+ exports: [RouterModule],
|
|
|
16
|
+})
|
|
|
17
|
+export class PlacedetailPageRoutingModule {}
|