tum il y a 2 ans
Parent
commit
ddc626d247

BIN
Untitled


+ 11 - 0
encryption_public_key.cer

1
+-----BEGIN PUBLIC KEY-----
2
+MIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAsXkzFk29X2yup2o2FaCC
3
+J9QHMcalVBG/cshQTSQoU3bM1+v+A9735uVTOmBXTIS7xKJ/nCWL5rq/0Fq71Myk
4
+2P2gFy0GPwl+WJLMm5fb9GNlLsyn/eWIHwD8XH31O6XQPZz3xM9EZskp29WfwNpe
5
+5OA8vLWRASJ4bRG9f8+/igIlZ6KTSyx9UJmX3PYOcP9EGjX7NUIJJ6oH5y4mt+XA
6
+Jf/If3Mj9RTIkZrZ4l7lAyB7tB65P/qrPKkm+duQRv7eZI09fgyZDSfg+We9CZ+X
7
+trpexgp0nWFBQfSWagI5/CikkJTRI9hO/b9fWzLwPmaqB8negqCfGfGSq889BhHj
8
+o6yVm+GE3c1cIFlaTKJlHG4q2mlkxggWaXSceo8Fro1DJ/ImsgiXV+S1wRi7qzV+
9
+muRTgdYoXmGxbfdHUWdfVDrAXlCPQu83IGOm3x4B+tkkmD0s0zZ1sSQLE7kxsdKK
10
+4D1Vvn2bsMALrQBS0IOBMxKZ8KmhXnRJXGT+y3mUnbGPAgMBAAE=
11
+-----END PUBLIC KEY-----

+ 11 - 0
encryption_public_key.pem

1
+-----BEGIN PUBLIC KEY-----
2
+MIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAsXkzFk29X2yup2o2FaCC
3
+J9QHMcalVBG/cshQTSQoU3bM1+v+A9735uVTOmBXTIS7xKJ/nCWL5rq/0Fq71Myk
4
+2P2gFy0GPwl+WJLMm5fb9GNlLsyn/eWIHwD8XH31O6XQPZz3xM9EZskp29WfwNpe
5
+5OA8vLWRASJ4bRG9f8+/igIlZ6KTSyx9UJmX3PYOcP9EGjX7NUIJJ6oH5y4mt+XA
6
+Jf/If3Mj9RTIkZrZ4l7lAyB7tB65P/qrPKkm+duQRv7eZI09fgyZDSfg+We9CZ+X
7
+trpexgp0nWFBQfSWagI5/CikkJTRI9hO/b9fWzLwPmaqB8negqCfGfGSq889BhHj
8
+o6yVm+GE3c1cIFlaTKJlHG4q2mlkxggWaXSceo8Fro1DJ/ImsgiXV+S1wRi7qzV+
9
+muRTgdYoXmGxbfdHUWdfVDrAXlCPQu83IGOm3x4B+tkkmD0s0zZ1sSQLE7kxsdKK
10
+4D1Vvn2bsMALrQBS0IOBMxKZ8KmhXnRJXGT+y3mUnbGPAgMBAAE=
11
+-----END PUBLIC KEY-----

+ 70 - 0
google-services.json

1
+{
2
+  "project_info": {
3
+    "project_number": "214019008700",
4
+    "project_id": "tmtlive-557ac",
5
+    "storage_bucket": "tmtlive-557ac.appspot.com"
6
+  },
7
+  "client": [
8
+    {
9
+      "client_info": {
10
+        "mobilesdk_app_id": "1:214019008700:android:3bf8cbb4e812fdf9c088b9",
11
+        "android_client_info": {
12
+          "package_name": "net.simplico.tmtlive"
13
+        }
14
+      },
15
+      "oauth_client": [
16
+        {
17
+          "client_id": "214019008700-62hfn39h1k01nmt038v6g126j4bvsf18.apps.googleusercontent.com",
18
+          "client_type": 1,
19
+          "android_info": {
20
+            "package_name": "net.simplico.tmtlive",
21
+            "certificate_hash": "b83cf800b46961f5311d9438872d34ea544dcb53"
22
+          }
23
+        },
24
+        {
25
+          "client_id": "214019008700-96jleh7b9rautj8l9rv3jdcri04e6c75.apps.googleusercontent.com",
26
+          "client_type": 1,
27
+          "android_info": {
28
+            "package_name": "net.simplico.tmtlive",
29
+            "certificate_hash": "be6da5e1f06456f6ab5bf89094568f4b67dc2a8a"
30
+          }
31
+        },
32
+        {
33
+          "client_id": "214019008700-l8i681i0rr5p6burfakaa62ruhh2kp66.apps.googleusercontent.com",
34
+          "client_type": 1,
35
+          "android_info": {
36
+            "package_name": "net.simplico.tmtlive",
37
+            "certificate_hash": "34a1080575bbb1801481f773ce549d7d9538ab53"
38
+          }
39
+        },
40
+        {
41
+          "client_id": "214019008700-7d2rl1u56edjj1s8lk9fvk9934ook9r3.apps.googleusercontent.com",
42
+          "client_type": 3
43
+        }
44
+      ],
45
+      "api_key": [
46
+        {
47
+          "current_key": "AIzaSyDjUZhCBH_8PrLs9grBlQmZZTy3b9F3jcs"
48
+        }
49
+      ],
50
+      "services": {
51
+        "appinvite_service": {
52
+          "other_platform_oauth_client": [
53
+            {
54
+              "client_id": "214019008700-7d2rl1u56edjj1s8lk9fvk9934ook9r3.apps.googleusercontent.com",
55
+              "client_type": 3
56
+            },
57
+            {
58
+              "client_id": "214019008700-gp7946dkoaa2icbdghii3lrpp88cb1qf.apps.googleusercontent.com",
59
+              "client_type": 2,
60
+              "ios_info": {
61
+                "bundle_id": "net.simplico.tmtlive"
62
+              }
63
+            }
64
+          ]
65
+        }
66
+      }
67
+    }
68
+  ],
69
+  "configuration_version": "1"
70
+}

BIN
pepk-src.jar


BIN
pepk.jar


BIN
private_key.pepk


+ 1 - 4
src/views/CourseDetailPage.vue

82
   };
82
   };
83
 </script>
83
 </script>
84
 
84
 
85
-<style>
86
-ion-title {
87
-  font-size:1.5rem;
88
-}
85
+<style scoped>
89
 #readmore {
86
 #readmore {
90
   display:block;
87
   display:block;
91
   width:100%;
88
   width:100%;

+ 2 - 1
src/views/CourseMatDetailPage.vue

6
           <ion-buttons slot="start">
6
           <ion-buttons slot="start">
7
             <ion-back-button></ion-back-button>
7
             <ion-back-button></ion-back-button>
8
           </ion-buttons>
8
           </ion-buttons>
9
-          <ion-title>Material Detail</ion-title>
9
+          <!--
10
+          <ion-title>Material Detail</ion-title> -->
10
       </ion-toolbar>
11
       </ion-toolbar>
11
     </ion-header>
12
     </ion-header>
12
     <ion-content class='ion-text-wrap'>
13
     <ion-content class='ion-text-wrap'>

+ 17 - 15
src/views/PostDetailPage.vue

9
           <ion-title v-if="obj">{{ obj.name }}</ion-title>
9
           <ion-title v-if="obj">{{ obj.name }}</ion-title>
10
       </ion-toolbar>
10
       </ion-toolbar>
11
     </ion-header>
11
     </ion-header>
12
-    <ion-content :fullscreen="true">
13
-      <ion-header collapse="condense">
14
-        <ion-toolbar>
15
-          <ion-title size="large" v-if="obj">{{ obj.name }}</ion-title>
16
-        </ion-toolbar>
17
-      </ion-header>
12
+    <ion-content>
13
+      <h1   v-if="obj">{{ obj.name }}</h1>
14
+      <div v-html="obj.embed_html" v-if="obj"></div>
18
       <div v-html="render_body" class='ion-padding'></div>
15
       <div v-html="render_body" class='ion-padding'></div>
19
-
20
        <ion-fab slot="fixed" vertical="bottom" horizontal="end">
16
        <ion-fab slot="fixed" vertical="bottom" horizontal="end">
21
-      <ion-fab-button>
17
+      <ion-fab-button v-if="obj">
22
         <ion-icon :icon="shareSocial" @click="socShare"></ion-icon>
18
         <ion-icon :icon="shareSocial" @click="socShare"></ion-icon>
23
       </ion-fab-button>
19
       </ion-fab-button>
24
     </ion-fab>
20
     </ion-fab>
25
     </ion-content>
21
     </ion-content>
26
   </ion-page>
22
   </ion-page>
27
 </template>
23
 </template>
28
-
24
+<style scoped>
25
+  h1 {
26
+    color: var(--ion-color-primary);
27
+  }
28
+</style>
29
 <script setup lang="ts">
29
 <script setup lang="ts">
30
 
30
 
31
 import { marked } from 'marked';
31
 import { marked } from 'marked';
67
 })
67
 })
68
 const socShare = async () => {
68
 const socShare = async () => {
69
   console.log('share social')
69
   console.log('share social')
70
-  await Share.share({
71
-    title: 'See cool stuff',
72
-    text: 'Really awesome thing you need to see right meow',
73
-    url: 'http://ionicframework.com/',
74
-    dialogTitle: 'Share with buddies',
75
-  });
70
+  if( obj ) {
71
+    await Share.share({
72
+      title: obj.value.name,
73
+      text: obj.value.description,
74
+      url: 'https://www.tigermuaythai.live/posts_detail/'+obj.value.id,
75
+      dialogTitle: 'TigerMuayThai.live',
76
+    });
77
+  }
76
 }
78
 }
77
 </script>
79
 </script>

+ 9 - 5
src/views/ProfilePage.vue

57
         <ion-grid>
57
         <ion-grid>
58
           <h3 class='ion-text-center'>Login With</h3>
58
           <h3 class='ion-text-center'>Login With</h3>
59
           <ion-row class='ion-justify-content-center'>
59
           <ion-row class='ion-justify-content-center'>
60
-            <ion-col size=4>
60
+            <ion-col size=12>
61
               <ion-button @click='fbLogin' expand='full'>
61
               <ion-button @click='fbLogin' expand='full'>
62
                 <ion-icon slot="start" :icon="logoFacebook"></ion-icon>
62
                 <ion-icon slot="start" :icon="logoFacebook"></ion-icon>
63
 
63
 
64
                 Facebook</ion-button>
64
                 Facebook</ion-button>
65
             </ion-col>
65
             </ion-col>
66
-            <ion-col size=4>
66
+            <ion-col size=12>
67
               <ion-button @click='ggLoginClick' expand='full'>
67
               <ion-button @click='ggLoginClick' expand='full'>
68
 
68
 
69
                 <ion-icon slot="start" :icon="logoGoogle"></ion-icon>
69
                 <ion-icon slot="start" :icon="logoGoogle"></ion-icon>
70
                 Google</ion-button>
70
                 Google</ion-button>
71
             </ion-col>
71
             </ion-col>
72
-            <ion-col size=4>
72
+            <ion-col size=12 v-if="isPlatform('ios')">
73
               <ion-button @click='onAppleLogin' expand='full'>
73
               <ion-button @click='onAppleLogin' expand='full'>
74
                 <ion-icon slot="start" :icon="logoApple"></ion-icon>
74
                 <ion-icon slot="start" :icon="logoApple"></ion-icon>
75
                 Apple</ion-button>
75
                 Apple</ion-button>
82
 </template>
82
 </template>
83
 
83
 
84
 <script setup lang="ts">
84
 <script setup lang="ts">
85
-import { IonPage, IonHeader, IonToolbar, IonTitle, IonContent, IonButton, onIonViewWillEnter, IonRow, IonCol, IonGrid, IonToggle, IonLabel, IonChip, IonIcon, IonSelect, IonSelectOption, IonList, IonListHeader, IonItem, IonText, IonImg } from '@ionic/vue';
85
+import { IonPage, IonHeader, IonToolbar, IonTitle, IonContent, IonButton, onIonViewWillEnter, IonRow, IonCol, IonGrid, IonToggle, IonLabel, IonChip, IonIcon, IonSelect, IonSelectOption, IonList, IonListHeader, IonItem, IonText, IonImg, isPlatform } from '@ionic/vue';
86
 import ExploreContainer from '@/components/ExploreContainer.vue';
86
 import ExploreContainer from '@/components/ExploreContainer.vue';
87
 import LoginForm from '@/components/LoginForm.vue';
87
 import LoginForm from '@/components/LoginForm.vue';
88
 import { defineComponent, onMounted } from 'vue';
88
 import { defineComponent, onMounted } from 'vue';
179
       await setUserToken(d.key)
179
       await setUserToken(d.key)
180
       myprofile.value  = await getPref()
180
       myprofile.value  = await getPref()
181
       refIsLogin.value = true
181
       refIsLogin.value = true
182
-      
182
+      location.reload();
183
     }catch(error) {
183
     }catch(error) {
184
       console.log(error);
184
       console.log(error);
185
       formError.value = error.response.data.non_field_errors.join("\n");
185
       formError.value = error.response.data.non_field_errors.join("\n");
203
       await getProfile()
203
       await getProfile()
204
       // Login successful.
204
       // Login successful.
205
       refIsLogin.value = true
205
       refIsLogin.value = true
206
+      location.reload();
206
     }catch(error) {
207
     }catch(error) {
207
       formError.value = error.response.data.non_field_errors.join("\n");
208
       formError.value = error.response.data.non_field_errors.join("\n");
208
     }
209
     }
243
   refIsLogin.value = await isLogin()
244
   refIsLogin.value = await isLogin()
244
   if( refIsLogin.value == true ) {
245
   if( refIsLogin.value == true ) {
245
     myprofile.value  = await getPref()
246
     myprofile.value  = await getPref()
247
+    noti.liveNoti = myprofile.value.live_noti;
248
+    noti.newsNoti = myprofile.value.news_noti;
246
   }
249
   }
247
 
250
 
248
 })
251
 })
338
       //await getProfile()
341
       //await getProfile()
339
       // Login successful.
342
       // Login successful.
340
       refIsLogin.value = true
343
       refIsLogin.value = true
344
+      location.reload(); 
341
     }catch(error) {
345
     }catch(error) {
342
       console.log(error);
346
       console.log(error);
343
       formError.value = error.response.data.non_field_errors.join("\n");
347
       formError.value = error.response.data.non_field_errors.join("\n");

+ 37 - 10
src/views/Tab1Page.vue

72
 import { CapacitorHttp } from '@capacitor/core';
72
 import { CapacitorHttp } from '@capacitor/core';
73
 import { ref } from 'vue';
73
 import { ref } from 'vue';
74
 import { TOKEN, getProducts, setToken, getObject, getToken, getTrainers, listMats, storeAPNToken,
74
 import { TOKEN, getProducts, setToken, getObject, getToken, getTrainers, listMats, storeAPNToken,
75
-getTodayProgs, getLive, getPosts, initAPI, clearPref, isLogin} from '@/composable/settings';
75
+getTodayProgs, getLive, getPosts, initAPI, clearPref, isLogin, getPref } from '@/composable/settings';
76
 //import VueCoreVideoPlayer from 'vue-core-video-player'
76
 //import VueCoreVideoPlayer from 'vue-core-video-player'
77
 import { vueVimeoPlayer } from 'vue-vimeo-player'
77
 import { vueVimeoPlayer } from 'vue-vimeo-player'
78
 
78
 
114
       width: 640,
114
       width: 640,
115
       loop: true
115
       loop: true
116
   };
116
   };
117
+let myprofile = null;
117
  //const video = ref(null)
118
  //const video = ref(null)
118
 
119
 
119
   //const player = new Player(video, options);
120
   //const player = new Player(video, options);
126
     if( v == false ) {
127
     if( v == false ) {
127
     ;
128
     ;
128
       //ionRouter.navigate('/tabs/tab4', 'forward', 'replace');
129
       //ionRouter.navigate('/tabs/tab4', 'forward', 'replace');
130
+    }else {
131
+    
132
+      myprofile = await getPref()
133
+      console.log("my profile ", myprofile);
129
     }
134
     }
130
     //console.log("video " ,video)
135
     //console.log("video " ,video)
131
     //console.log("video id", video.value.id)
136
     //console.log("video id", video.value.id)
161
     })
166
     })
162
     console.log(" trainers => ", trainers)
167
     console.log(" trainers => ", trainers)
163
 
168
 
164
-    GoogleAuth.initialize();
165
-    registerNotifications()
169
+    //GoogleAuth.initialize();
166
     addListeners()
170
     addListeners()
167
-
171
+    registerNotifications()
172
+    
168
     getTodayProgs().then( (data) => {
173
     getTodayProgs().then( (data) => {
169
       todays.value = data
174
       todays.value = data
170
     })
175
     })
199
   await PushNotifications.addListener('registration', token => {
204
   await PushNotifications.addListener('registration', token => {
200
     console.info('Registration token: ', token.value);
205
     console.info('Registration token: ', token.value);
201
     storeAPNToken(token.value)
206
     storeAPNToken(token.value)
202
-    
203
-    FCM.subscribeTo({ topic: "TMT" })
204
-    .then((r) => {
205
-      console.log("subsribe to topic ", r)
206
-    })
207
-    .catch((err) => console.log(err));
208
   });
207
   });
209
 
208
 
210
   await PushNotifications.addListener('registrationError', err => {
209
   await PushNotifications.addListener('registrationError', err => {
231
     throw new Error('User denied permissions!');
230
     throw new Error('User denied permissions!');
232
   }
231
   }
233
 
232
 
233
+    if( myprofile ) {
234
+      if( myprofile.live_noti == true ) {
235
+        FCM.subscribeTo({ topic: "LIVE" })
236
+        .then((r) => {
237
+          console.log("subsribe to topic ", r)
238
+        })
239
+        .catch((err) => console.log(err));
240
+      }else {
241
+        FCM.unsubscribeFrom({ topic: "LIVE" })
242
+        .then((r) => {
243
+          console.log("unsubsribe to topic ", r)
244
+        })
245
+        .catch((err) => console.log(err));
246
+      }
247
+      if( myprofile.news_noti == true ) {
248
+        FCM.subscribeTo({ topic: "NEWS" })
249
+        .then((r) => {
250
+          console.log("subsribe to topic ", r)
251
+        })
252
+        .catch((err) => console.log(err));
253
+      }else {
254
+        FCM.unsubscribeFrom({ topic: "NEWS" })
255
+        .then((r) => {
256
+          console.log("unsubsribe to topic ", r)
257
+        })
258
+        .catch((err) => console.log(err));
259
+      }
260
+    }
234
   await PushNotifications.register();
261
   await PushNotifications.register();
235
 }
262
 }
236
 
263
 

BIN
tmt.keystore