tum 2 年 前
コミット
ddc626d247
共有13 個のファイルを変更した158 個の追加35 個の削除を含む
  1. BIN
      Untitled
  2. 11 0
      encryption_public_key.cer
  3. 11 0
      encryption_public_key.pem
  4. 70 0
      google-services.json
  5. BIN
      pepk-src.jar
  6. BIN
      pepk.jar
  7. BIN
      private_key.pepk
  8. 1 4
      src/views/CourseDetailPage.vue
  9. 2 1
      src/views/CourseMatDetailPage.vue
  10. 17 15
      src/views/PostDetailPage.vue
  11. 9 5
      src/views/ProfilePage.vue
  12. 37 10
      src/views/Tab1Page.vue
  13. BIN
      tmt.keystore

BIN
Untitled


+ 11 - 0
encryption_public_key.cer

@@ -0,0 +1,11 @@
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

@@ -0,0 +1,11 @@
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

@@ -0,0 +1,70 @@
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,10 +82,7 @@ onIonViewWillEnter(async () => {
82 82
   };
83 83
 </script>
84 84
 
85
-<style>
86
-ion-title {
87
-  font-size:1.5rem;
88
-}
85
+<style scoped>
89 86
 #readmore {
90 87
   display:block;
91 88
   width:100%;

+ 2 - 1
src/views/CourseMatDetailPage.vue

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

+ 17 - 15
src/views/PostDetailPage.vue

@@ -9,23 +9,23 @@
9 9
           <ion-title v-if="obj">{{ obj.name }}</ion-title>
10 10
       </ion-toolbar>
11 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 15
       <div v-html="render_body" class='ion-padding'></div>
19
-
20 16
        <ion-fab slot="fixed" vertical="bottom" horizontal="end">
21
-      <ion-fab-button>
17
+      <ion-fab-button v-if="obj">
22 18
         <ion-icon :icon="shareSocial" @click="socShare"></ion-icon>
23 19
       </ion-fab-button>
24 20
     </ion-fab>
25 21
     </ion-content>
26 22
   </ion-page>
27 23
 </template>
28
-
24
+<style scoped>
25
+  h1 {
26
+    color: var(--ion-color-primary);
27
+  }
28
+</style>
29 29
 <script setup lang="ts">
30 30
 
31 31
 import { marked } from 'marked';
@@ -67,11 +67,13 @@ onIonViewWillEnter(async () => {
67 67
 })
68 68
 const socShare = async () => {
69 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 79
 </script>

+ 9 - 5
src/views/ProfilePage.vue

@@ -57,19 +57,19 @@
57 57
         <ion-grid>
58 58
           <h3 class='ion-text-center'>Login With</h3>
59 59
           <ion-row class='ion-justify-content-center'>
60
-            <ion-col size=4>
60
+            <ion-col size=12>
61 61
               <ion-button @click='fbLogin' expand='full'>
62 62
                 <ion-icon slot="start" :icon="logoFacebook"></ion-icon>
63 63
 
64 64
                 Facebook</ion-button>
65 65
             </ion-col>
66
-            <ion-col size=4>
66
+            <ion-col size=12>
67 67
               <ion-button @click='ggLoginClick' expand='full'>
68 68
 
69 69
                 <ion-icon slot="start" :icon="logoGoogle"></ion-icon>
70 70
                 Google</ion-button>
71 71
             </ion-col>
72
-            <ion-col size=4>
72
+            <ion-col size=12 v-if="isPlatform('ios')">
73 73
               <ion-button @click='onAppleLogin' expand='full'>
74 74
                 <ion-icon slot="start" :icon="logoApple"></ion-icon>
75 75
                 Apple</ion-button>
@@ -82,7 +82,7 @@
82 82
 </template>
83 83
 
84 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 86
 import ExploreContainer from '@/components/ExploreContainer.vue';
87 87
 import LoginForm from '@/components/LoginForm.vue';
88 88
 import { defineComponent, onMounted } from 'vue';
@@ -179,7 +179,7 @@ const ggLoginClick = async () => {
179 179
       await setUserToken(d.key)
180 180
       myprofile.value  = await getPref()
181 181
       refIsLogin.value = true
182
-      
182
+      location.reload();
183 183
     }catch(error) {
184 184
       console.log(error);
185 185
       formError.value = error.response.data.non_field_errors.join("\n");
@@ -203,6 +203,7 @@ const fbLogin = async () => {
203 203
       await getProfile()
204 204
       // Login successful.
205 205
       refIsLogin.value = true
206
+      location.reload();
206 207
     }catch(error) {
207 208
       formError.value = error.response.data.non_field_errors.join("\n");
208 209
     }
@@ -243,6 +244,8 @@ onIonViewWillEnter(async () => {
243 244
   refIsLogin.value = await isLogin()
244 245
   if( refIsLogin.value == true ) {
245 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,6 +341,7 @@ const onAppleLogin = async () => {
338 341
       //await getProfile()
339 342
       // Login successful.
340 343
       refIsLogin.value = true
344
+      location.reload(); 
341 345
     }catch(error) {
342 346
       console.log(error);
343 347
       formError.value = error.response.data.non_field_errors.join("\n");

+ 37 - 10
src/views/Tab1Page.vue

@@ -72,7 +72,7 @@ import SearchEngine from '@/components/SearchEngine.vue'
72 72
 import { CapacitorHttp } from '@capacitor/core';
73 73
 import { ref } from 'vue';
74 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 76
 //import VueCoreVideoPlayer from 'vue-core-video-player'
77 77
 import { vueVimeoPlayer } from 'vue-vimeo-player'
78 78
 
@@ -114,6 +114,7 @@ const options = {
114 114
       width: 640,
115 115
       loop: true
116 116
   };
117
+let myprofile = null;
117 118
  //const video = ref(null)
118 119
 
119 120
   //const player = new Player(video, options);
@@ -126,6 +127,10 @@ const modules =  [Autoplay, Keyboard, Pagination, Scrollbar, Zoom]
126 127
     if( v == false ) {
127 128
     ;
128 129
       //ionRouter.navigate('/tabs/tab4', 'forward', 'replace');
130
+    }else {
131
+    
132
+      myprofile = await getPref()
133
+      console.log("my profile ", myprofile);
129 134
     }
130 135
     //console.log("video " ,video)
131 136
     //console.log("video id", video.value.id)
@@ -161,10 +166,10 @@ const modules =  [Autoplay, Keyboard, Pagination, Scrollbar, Zoom]
161 166
     })
162 167
     console.log(" trainers => ", trainers)
163 168
 
164
-    GoogleAuth.initialize();
165
-    registerNotifications()
169
+    //GoogleAuth.initialize();
166 170
     addListeners()
167
-
171
+    registerNotifications()
172
+    
168 173
     getTodayProgs().then( (data) => {
169 174
       todays.value = data
170 175
     })
@@ -199,12 +204,6 @@ const addListeners = async () => {
199 204
   await PushNotifications.addListener('registration', token => {
200 205
     console.info('Registration token: ', token.value);
201 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 209
   await PushNotifications.addListener('registrationError', err => {
@@ -231,6 +230,34 @@ const registerNotifications = async () => {
231 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 261
   await PushNotifications.register();
235 262
 }
236 263
 

BIN
tmt.keystore