jpsp91 6 anos atrás
pai
commit
01f83e7fbc

+ 8
- 2
Vitamin/src/app/app.module.ts Ver arquivo

@@ -11,6 +11,8 @@ import { RegisterPage } from '../pages/register/register';
11 11
 import { AlarmPage }from '../pages/alarm/alarm';
12 12
 
13 13
 import { LocalNotifications } from '@ionic-native/local-notifications';
14
+import { VitaminCPage } from '../pages/vitamin-c/vitamin-c';
15
+import { ZincPage } from '../pages/zinc/zinc';
14 16
 
15 17
 
16 18
 
@@ -20,7 +22,9 @@ import { LocalNotifications } from '@ionic-native/local-notifications';
20 22
     HomePage,
21 23
     CommonVitaminsPage,
22 24
     RegisterPage,
23
-    AlarmPage
25
+    AlarmPage,
26
+    VitaminCPage,
27
+    ZincPage
24 28
   ],
25 29
   imports: [
26 30
     BrowserModule,
@@ -32,7 +36,9 @@ import { LocalNotifications } from '@ionic-native/local-notifications';
32 36
     HomePage,
33 37
     CommonVitaminsPage,
34 38
     RegisterPage,
35
-    AlarmPage
39
+    AlarmPage,
40
+    VitaminCPage,
41
+    ZincPage
36 42
   ],
37 43
   providers: [
38 44
     StatusBar,

+ 164
- 2
Vitamin/src/pages/alarm/alarm.html Ver arquivo

@@ -9,8 +9,170 @@
9 9
 </ion-header>
10 10
 
11 11
 
12
-<ion-content padding>
12
+<ion-content text-center class = "login"> 
13
+
14
+  <!-- This adds blank space -->
15
+  <div style="clear:both; height:50px"></div>
16
+
17
+  <h1 class="item item-header">Common Vitamins</h1>
18
+
19
+    <!-- This adds blank space -->
20
+    <div style="clear:both; height:25px"></div>
21
+    
22
+
23
+
24
+
25
+
26
+
27
+  <ion-item class="item item-halfTrns">Vitamin C
28
+    <!-- Info Page -->
29
+    <button ion-button (click)="openVitaminCPage()" round item-end>
30
+        <div> <ion-icon name="information-circle"></ion-icon> </div>
31
+    </button>
32
+    <!-- Alarm Set! -->
33
+    <button ion-button color="danger" (click)="vitaminC()" round item-end>
34
+        <div> <ion-icon name="alarm"></ion-icon> </div>
35
+    </button>
36
+  </ion-item>
37
+
38
+
39
+  <ion-item class="item item-halfTrns">Zinc
40
+      <!-- Info Page -->
41
+      <button ion-button (click)="openZincPage()" round item-end>
42
+          <div> <ion-icon name="information-circle"></ion-icon> </div>
43
+      </button>
44
+      <!-- Alarm Set! -->
45
+      <button ion-button color="danger" (click)="zinc()" round item-end>
46
+          <div> <ion-icon name="alarm"></ion-icon> </div>
47
+      </button>
48
+    </ion-item>
49
+
50
+
51
+    <ion-item class="item item-halfTrns">Fish Oil
52
+        <!-- Info Page -->
53
+        <button ion-button (click)="openVitaminCPage()" round item-end>
54
+            <div> <ion-icon name="information-circle"></ion-icon> </div>
55
+        </button>
56
+        <!-- Alarm Set! -->
57
+        <button ion-button color="danger" (click)="btnPushClicked()" round item-end>
58
+            <div> <ion-icon name="alarm"></ion-icon> </div>
59
+        </button>
60
+      </ion-item>
61
+
62
+
63
+      <ion-item class="item item-halfTrns">Vitamin D
64
+          <!-- Info Page -->
65
+          <button ion-button (click)="openVitaminCPage()" round item-end>
66
+              <div> <ion-icon name="information-circle"></ion-icon> </div>
67
+          </button>
68
+          <!-- Alarm Set! -->
69
+          <button ion-button color="danger" (click)="btnPushClicked()" round item-end>
70
+              <div> <ion-icon name="alarm"></ion-icon> </div>
71
+          </button>
72
+        </ion-item>
73
+
74
+
75
+        <ion-item class="item item-halfTrns">Vitamin A
76
+            <!-- Info Page -->
77
+            <button ion-button (click)="openVitaminCPage()" round item-end>
78
+                <div> <ion-icon name="information-circle"></ion-icon> </div>
79
+            </button>
80
+            <!-- Alarm Set! -->
81
+            <button ion-button color="danger" (click)="btnPushClicked()" round item-end>
82
+                <div> <ion-icon name="alarm"></ion-icon> </div>
83
+            </button>
84
+          </ion-item>
85
+
86
+
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+
97
+
98
+
99
+
100
+
101
+          <ion-item class="item item-halfTrns">Vitamin B1
102
+              <!-- Info Page -->
103
+              <button ion-button (click)="openVitaminCPage()" round item-end>
104
+                  <div> <ion-icon name="information-circle"></ion-icon> </div>
105
+              </button>
106
+              <!-- Alarm Set! -->
107
+              <button ion-button color="danger" (click)="btnPushClicked()" round item-end>
108
+                  <div> <ion-icon name="alarm"></ion-icon> </div>
109
+              </button>
110
+            </ion-item>
111
+
112
+            <ion-item class="item item-halfTrns">Calcium
113
+                <!-- Info Page -->
114
+                <button ion-button (click)="openVitaminCPage()" round item-end>
115
+                    <div> <ion-icon name="information-circle"></ion-icon> </div>
116
+                </button>
117
+                <!-- Alarm Set! -->
118
+                <button ion-button color="danger" (click)="btnPushClicked()" round item-end>
119
+                    <div> <ion-icon name="alarm"></ion-icon> </div>
120
+                </button>
121
+              </ion-item>
122
+
123
+              <ion-item class="item item-halfTrns">Vitamin E
124
+                  <!-- Info Page -->
125
+                  <button ion-button (click)="openVitaminCPage()" round item-end>
126
+                      <div> <ion-icon name="information-circle"></ion-icon> </div>
127
+                  </button>
128
+                  <!-- Alarm Set! -->
129
+                  <button ion-button color="danger" (click)="btnPushClicked()" round item-end>
130
+                      <div> <ion-icon name="alarm"></ion-icon> </div>
131
+                  </button>
132
+                </ion-item>
133
+
134
+                <ion-item class="item item-halfTrns">Iron
135
+                    <!-- Info Page -->
136
+                    <button ion-button (click)="openVitaminCPage()" round item-end>
137
+                        <div> <ion-icon name="information-circle"></ion-icon> </div>
138
+                    </button>
139
+                    <!-- Alarm Set! -->
140
+                    <button ion-button color="danger" (click)="btnPushClicked()" round item-end>
141
+                        <div> <ion-icon name="alarm"></ion-icon> </div>
142
+                    </button>
143
+                  </ion-item>
144
+
145
+                  <ion-item class="item item-halfTrns">Vitamin K
146
+                      <!-- Info Page -->
147
+                      <button ion-button (click)="openVitaminCPage()" round item-end>
148
+                          <div> <ion-icon name="information-circle"></ion-icon> </div>
149
+                      </button>
150
+                      <!-- Alarm Set! -->
151
+                      <button ion-button color="danger" (click)="btnPushClicked()" round item-end>
152
+                          <div> <ion-icon name="alarm"></ion-icon> </div>
153
+                      </button>
154
+                    </ion-item>
155
+
156
+                    <ion-item class="item item-halfTrns">Melatonin
157
+                        <!-- Info Page -->
158
+                        <button ion-button (click)="openVitaminCPage()" round item-end>
159
+                            <div> <ion-icon name="information-circle"></ion-icon> </div>
160
+                        </button>
161
+                        <!-- Alarm Set! -->
162
+                        <button ion-button color="danger" (click)="btnPushClicked()" round item-end>
163
+                            <div> <ion-icon name="alarm"></ion-icon> </div>
164
+                        </button>
165
+                      </ion-item>
166
+
167
+
168
+
169
+
170
+
171
+
172
+                      <!-- This adds blank space -->
173
+    <div style="clear:both; height:100px"></div>
174
+
175
+
13 176
 
14
-  <button ion-button full (click)="btnPushClicked()">Schedule!!!</button>
15 177
 
16 178
 </ion-content>

+ 35
- 3
Vitamin/src/pages/alarm/alarm.scss Ver arquivo

@@ -2,16 +2,48 @@ page-alarm {
2 2
 
3 3
 
4 4
 
5
-
5
+    .login {
6
+        background: url("../assets/imgs/background.jpg");
7
+        background-repeat: no-repeat;
8
+        background-position: center;
9
+        background-size: cover;
10
+    }
6 11
 
7 12
 
8 13
 
9 14
     //this removes the scroll bar on the side
10
-.scroll-content {
11
-    overflow: hidden;
15
+// .scroll-content {
16
+//     overflow: hidden;
17
+// }
18
+
19
+    //turn background transparent
20
+.item.item-halfTrns {
21
+	border-color: rgba(134, 130, 130, 0.39);
22
+	background-color: rgba(134, 130, 130, 0.39);
23
+	color: white; 
12 24
 }
13 25
 
14 26
 
15 27
 
28
+.item.item-fullTrns {
29
+	border-color: rgba(134, 130, 130, 0.39);
30
+	background-color: rgba(134, 130, 130, 0.39);
31
+	color: white; 
32
+}
33
+
34
+
35
+
36
+
37
+
38
+.item.item-header {
39
+	border-color: rgba(134, 130, 130, 0.39);
40
+	background-color: rgba(134, 130, 130, 0);
41
+	color: rgb(17, 121, 182); 
42
+}
43
+
44
+
45
+
46
+
47
+
16 48
 
17 49
 }

+ 74
- 4
Vitamin/src/pages/alarm/alarm.ts Ver arquivo

@@ -2,6 +2,9 @@ import { Component } from '@angular/core';
2 2
 import { IonicPage, NavController, NavParams, AlertController, Platform, DateTime } from 'ionic-angular';
3 3
 
4 4
 import { LocalNotifications } from '@ionic-native/local-notifications';
5
+import { BrowserGetTestability } from '@angular/platform-browser/src/browser/testability';
6
+import { VitaminCPage } from '../vitamin-c/vitamin-c';
7
+import { ZincPage } from '../zinc/zinc';
5 8
 
6 9
 
7 10
 
@@ -13,28 +16,95 @@ import { LocalNotifications } from '@ionic-native/local-notifications';
13 16
 export class AlarmPage {
14 17
 
15 18
 
16
-  constructor(public navCtrl: NavController, private localNoti: LocalNotifications, private platform: Platform){
17
-
19
+  constructor(public navCtrl: NavController, private localNoti: LocalNotifications, private platform: Platform, public alertCtrl: AlertController){
18 20
 
19 21
   }
20 22
 
21 23
 
24
+
25
+
26
+  
22 27
   btnPushClicked(){
23 28
     this.platform.ready().then(() => {
29
+      
30
+      this.localNoti.schedule({
31
+        id: 1,
32
+        title: 'Vita-Alarm!',
33
+        text: 'It\'s Time to take your Vitamin!',
34
+        trigger: {at: new Date(new Date().getTime() + 500000)},
35
+        data: {"Good job!":""},
36
+        led: 'FF0000',
37
+        
38
+     });
39
+    });
40
+
41
+    const alert = this.alertCtrl.create({
42
+      title: 'Vita-Alarm!',
43
+      subTitle: 'Alarm has been set!',
44
+      buttons: ['OK']
45
+    });
46
+    alert.present();
47
+  }
48
+
49
+
50
+  
51
+  vitaminC(){
52
+    this.platform.ready().then(() => {
24 53
       this.localNoti.schedule({
54
+        id: 1,
25 55
         title: 'Vita-Alarm!',
26
-        text: 'Take your Vitamin!',
27
-        trigger: {at: new Date(new Date().getTime() + 3600)},
56
+        text: 'It\'s Time to take Vitamin C!',
57
+        trigger: {at: new Date(new Date().getTime() + 500000)},
58
+        data: {"Good job!":""},
28 59
         led: 'FF0000',
29 60
         
30 61
      });
31 62
     });
63
+
64
+    const alert = this.alertCtrl.create({
65
+      title: 'Vita-Alarm!',
66
+      subTitle: 'Alarm has been set!',
67
+      buttons: ['OK']
68
+    });
69
+    alert.present();
32 70
   }
33 71
 
34 72
 
35 73
 
36 74
 
37 75
 
76
+  zinc(){
77
+    this.platform.ready().then(() => {
78
+      this.localNoti.schedule({
79
+        id: 1,
80
+        title: 'Vita-Alarm!',
81
+        text: 'It\'s Time to take Zinc!',
82
+        trigger: {at: new Date(new Date().getTime() + 500000)},
83
+        data: {"Good job!":""},
84
+        led: 'FF0000',
85
+        
86
+     });
87
+    });
88
+
89
+    const alert = this.alertCtrl.create({
90
+      title: 'Vita-Alarm!',
91
+      subTitle: 'Alarm has been set!',
92
+      buttons: ['OK']
93
+    });
94
+    alert.present();
95
+  }
96
+
97
+
98
+
99
+
100
+  openVitaminCPage() {
101
+    this.navCtrl.push(VitaminCPage);
102
+  }
103
+
104
+  openZincPage() {
105
+    this.navCtrl.push(ZincPage);
106
+  }
107
+
38 108
 
39 109
 
40 110
 

+ 0
- 2
Vitamin/src/pages/home/home.scss Ver arquivo

@@ -12,8 +12,6 @@ page-home {
12 12
 
13 13
 
14 14
 
15
-
16
-
17 15
     .scroll-content {
18 16
         overflow: hidden;
19 17
     }

+ 37
- 0
Vitamin/src/pages/vitamin-c/vitamin-c.html Ver arquivo

@@ -0,0 +1,37 @@
1
+<!--
2
+  Generated template for the VitaminCPage page.
3
+
4
+  See http://ionicframework.com/docs/components/#navigation for more info on
5
+  Ionic pages and navigation.
6
+-->
7
+<ion-header>
8
+
9
+  <ion-navbar>
10
+    <ion-title>Vitamin C</ion-title>
11
+  </ion-navbar>
12
+
13
+</ion-header>
14
+
15
+
16
+<ion-content text-center class = "login">
17
+
18
+<!-- This adds blank space -->
19
+<div style="clear:both; height:100px"></div>
20
+
21
+    <ion-item class="item item-halfTrns text-center">
22
+        Benefits:
23
+        <br>
24
+        Prevent and Treat the Common Cold.
25
+        <br><br>
26
+        Recommendation:
27
+        <br>
28
+        Vitamin C is recommended for people <br>with insomnia.
29
+        <br><br>
30
+        Dosage:
31
+        <br>
32
+        75 mg /per day
33
+  </ion-item>  
34
+    
35
+
36
+
37
+</ion-content>

+ 21
- 0
Vitamin/src/pages/vitamin-c/vitamin-c.scss Ver arquivo

@@ -0,0 +1,21 @@
1
+page-vitamin-c {
2
+
3
+    .login {
4
+        background: url("../assets/imgs/background.jpg");
5
+        background-repeat: no-repeat;
6
+        background-position: center;
7
+        background-size: cover;
8
+    }
9
+
10
+    .scroll-content {
11
+        overflow: hidden;
12
+    }
13
+
14
+
15
+    .item.item-halfTrns {
16
+        border-color: rgba(134, 130, 130, 0.39);
17
+        background-color: rgba(134, 130, 130, 0.39);
18
+        color: white; 
19
+    }
20
+
21
+}

+ 24
- 0
Vitamin/src/pages/vitamin-c/vitamin-c.ts Ver arquivo

@@ -0,0 +1,24 @@
1
+import { Component } from '@angular/core';
2
+import { NavController, NavParams } from 'ionic-angular';
3
+
4
+/**
5
+ * Generated class for the VitaminCPage page.
6
+ *
7
+ * See https://ionicframework.com/docs/components/#navigation for more info on
8
+ * Ionic pages and navigation.
9
+ */
10
+
11
+@Component({
12
+  selector: 'page-vitamin-c',
13
+  templateUrl: 'vitamin-c.html',
14
+})
15
+export class VitaminCPage {
16
+
17
+  constructor(public navCtrl: NavController, public navParams: NavParams) {
18
+  }
19
+
20
+  ionViewDidLoad() {
21
+    console.log('ionViewDidLoad VitaminCPage');
22
+  }
23
+
24
+}

+ 37
- 0
Vitamin/src/pages/zinc/zinc.html Ver arquivo

@@ -0,0 +1,37 @@
1
+<!--
2
+  Generated template for the ZincPage page.
3
+
4
+  See http://ionicframework.com/docs/components/#navigation for more info on
5
+  Ionic pages and navigation.
6
+-->
7
+<ion-header>
8
+
9
+  <ion-navbar>
10
+    <ion-title>Zinc</ion-title>
11
+  </ion-navbar>
12
+
13
+</ion-header>
14
+
15
+
16
+<ion-content text-center class = "login">
17
+
18
+    <!-- This adds blank space -->
19
+    <div style="clear:both; height:100px"></div>
20
+    
21
+        <ion-item class="item item-halfTrns text-center">
22
+            Benefits:
23
+            <br>
24
+            Aids in Nutrient Absorption and <br>Digestion.
25
+            <br><br>
26
+            Recommendation:
27
+            <br>
28
+            Zinc is recommended for Vegan or <br>vegetarian.
29
+            <br><br>
30
+            Dosage:
31
+            <br>
32
+            11 mg /per day
33
+      </ion-item>  
34
+        
35
+    
36
+    
37
+    </ion-content>

+ 13
- 0
Vitamin/src/pages/zinc/zinc.module.ts Ver arquivo

@@ -0,0 +1,13 @@
1
+import { NgModule } from '@angular/core';
2
+import { IonicPageModule } from 'ionic-angular';
3
+import { ZincPage } from './zinc';
4
+
5
+@NgModule({
6
+  declarations: [
7
+    ZincPage,
8
+  ],
9
+  imports: [
10
+    IonicPageModule.forChild(ZincPage),
11
+  ],
12
+})
13
+export class ZincPageModule {}

+ 21
- 0
Vitamin/src/pages/zinc/zinc.scss Ver arquivo

@@ -0,0 +1,21 @@
1
+page-zinc {
2
+
3
+    .login {
4
+        background: url("../assets/imgs/background.jpg");
5
+        background-repeat: no-repeat;
6
+        background-position: center;
7
+        background-size: cover;
8
+    }
9
+
10
+    .scroll-content {
11
+        overflow: hidden;
12
+    }
13
+
14
+
15
+    .item.item-halfTrns {
16
+        border-color: rgba(134, 130, 130, 0.39);
17
+        background-color: rgba(134, 130, 130, 0.39);
18
+        color: white; 
19
+    }
20
+    
21
+}

+ 25
- 0
Vitamin/src/pages/zinc/zinc.ts Ver arquivo

@@ -0,0 +1,25 @@
1
+import { Component } from '@angular/core';
2
+import { IonicPage, NavController, NavParams } from 'ionic-angular';
3
+
4
+/**
5
+ * Generated class for the ZincPage page.
6
+ *
7
+ * See https://ionicframework.com/docs/components/#navigation for more info on
8
+ * Ionic pages and navigation.
9
+ */
10
+
11
+@IonicPage()
12
+@Component({
13
+  selector: 'page-zinc',
14
+  templateUrl: 'zinc.html',
15
+})
16
+export class ZincPage {
17
+
18
+  constructor(public navCtrl: NavController, public navParams: NavParams) {
19
+  }
20
+
21
+  ionViewDidLoad() {
22
+    console.log('ionViewDidLoad ZincPage');
23
+  }
24
+
25
+}