|
|
@@ -2,84 +2,95 @@
|
|
2
|
2
|
<ion-page>
|
|
3
|
3
|
<ion-header>
|
|
4
|
4
|
<ion-toolbar>
|
|
5
|
|
- <ion-title>Tab 1</ion-title>
|
|
|
5
|
+ <ion-title>TMTLive</ion-title>
|
|
|
6
|
+ <ion-buttons slot="end">
|
|
|
7
|
+ <ion-button :router-link="'/tabs/search_page/'">
|
|
|
8
|
+ <ion-icon slot="icon-only" :icon="search"></ion-icon>
|
|
|
9
|
+ </ion-button>
|
|
|
10
|
+ </ion-buttons>
|
|
6
|
11
|
</ion-toolbar>
|
|
7
|
12
|
</ion-header>
|
|
8
|
13
|
<ion-content>
|
|
9
|
14
|
<ion-header collapse="condense">
|
|
10
|
15
|
<ion-toolbar>
|
|
11
|
|
- <ion-title size="large">Tab 1</ion-title>
|
|
|
16
|
+ <ion-title size="large">TMTLive</ion-title>
|
|
12
|
17
|
</ion-toolbar>
|
|
13
|
18
|
</ion-header>
|
|
|
19
|
+ <template v-if="liveObj && liveObj.result">
|
|
|
20
|
+ <div v-html="liveObj.result.embed_html"></div>
|
|
|
21
|
+ </template>
|
|
|
22
|
+ <div class='ion-padding'>
|
|
|
23
|
+ <h2>Today Programs</h2>
|
|
|
24
|
+ <swiper :slides-per-view="2" :loop="true" v-if="todays" class='ion-no-margin'>
|
|
|
25
|
+ <swiper-slide v-for="m in todays">
|
|
|
26
|
+ <CourseSchedule :course-obj="m.course_level.course" :from-time="m.from_time" :to-time='m.to_time' />
|
|
|
27
|
+ </swiper-slide>
|
|
|
28
|
+ </swiper>
|
|
|
29
|
+ </div>
|
|
|
30
|
+ <template v-if="posts">
|
|
|
31
|
+ <div class='ion-padding'>
|
|
|
32
|
+ <h2>Muaythai Techniques</h2>
|
|
|
33
|
+ <swiper :slides-per-view="2" :loop="true" class='ion-no-margin'>
|
|
|
34
|
+ <swiper-slide v-for="m in posts">
|
|
|
35
|
+ <Post :obj="m" />
|
|
|
36
|
+ </swiper-slide>
|
|
|
37
|
+ </swiper>
|
|
|
38
|
+ </div>
|
|
|
39
|
+ </template>
|
|
|
40
|
+ <template v-if="mats">
|
|
|
41
|
+ <h2>Trainings</h2>
|
|
14
|
42
|
<ion-grid>
|
|
|
43
|
+
|
|
15
|
44
|
<ion-row>
|
|
16
|
|
- <ion-col size="12" size-md="4" size-lg="2">
|
|
17
|
|
- <ion-card>
|
|
18
|
|
- <img alt="Silhouette of mountains" src="https://ionicframework.com/docs/img/demos/card-media.png" />
|
|
19
|
|
- <ion-card-header>
|
|
20
|
|
- <ion-card-title>Card Title</ion-card-title>
|
|
21
|
|
- <ion-card-subtitle>Card Subtitle</ion-card-subtitle>
|
|
22
|
|
- </ion-card-header>
|
|
23
|
|
-
|
|
24
|
|
- <ion-card-content>
|
|
25
|
|
- Here's a small text description for the card content. Nothing more, nothing less.
|
|
26
|
|
- </ion-card-content>
|
|
27
|
|
- </ion-card>
|
|
28
|
|
- </ion-col>
|
|
29
|
|
- <ion-col size="12" size-md="4" size-lg="2">
|
|
30
|
|
- <ion-card>
|
|
31
|
|
- <img alt="Silhouette of mountains" src="https://ionicframework.com/docs/img/demos/card-media.png" />
|
|
32
|
|
- <ion-card-header>
|
|
33
|
|
- <ion-card-title>Card Title</ion-card-title>
|
|
34
|
|
- <ion-card-subtitle>Card Subtitle</ion-card-subtitle>
|
|
35
|
|
- </ion-card-header>
|
|
36
|
|
-
|
|
37
|
|
- <ion-card-content>
|
|
38
|
|
- Here's a small text description for the card content. Nothing more, nothing less.
|
|
39
|
|
- </ion-card-content>
|
|
40
|
|
- </ion-card>
|
|
|
45
|
+ <ion-col size="12" size-md="4" size-lg="2" v-for="c in mats">
|
|
|
46
|
+ <CourseMat :obj="c" :course-name="c.course_name" class='ion-no-margin' />
|
|
41
|
47
|
</ion-col>
|
|
42
|
48
|
</ion-row>
|
|
43
|
49
|
</ion-grid>
|
|
44
|
|
- {{ token }}
|
|
|
50
|
+ </template>
|
|
45
|
51
|
<ion-button router-link="/tabs/detail/3/" router-direction="forward">Click Me</ion-button>
|
|
46
|
|
- {{ safeUrl }}
|
|
47
|
|
-
|
|
|
52
|
+
|
|
48
|
53
|
<div style="padding:56.25% 0 0 0;position:relative;"><iframe src="https://player.vimeo.com/video/880005259?badge=0&autopause=0&quality_selector=1&player_id=0&app_id=58479" frameborder="0" allow="autoplay; fullscreen; picture-in-picture" style="position:absolute;top:0;left:0;width:100%;height:100%;" title="Muay Thai Advance"></iframe></div>
|
|
49
|
|
-<!--
|
|
50
|
|
-<vue-core-video-player src="https://player.vimeo.com/progressive_redirect/playback/880005259/rendition/720p/file.mp4?loc=external&signature=5ddad1430211b33f65824444a3137fc0ec6fe61183d39997036d2dd3b78654f9"></vue-core-video-player> -->
|
|
51
|
|
-
|
|
52
|
|
- Video
|
|
53
|
|
-
|
|
54
|
|
-
|
|
55
|
|
-<div id="made-in-ny" ref='video'></div>
|
|
56
|
|
-
|
|
57
|
|
- <ul>
|
|
58
|
|
- <li v-for="(item, index) in items">
|
|
59
|
|
- {{ item.msg }}
|
|
60
|
|
- </li>
|
|
61
|
|
- </ul>
|
|
62
|
|
- <ion-item v-for="t in trainers" :router-link="'/detail/'+t.id">
|
|
63
|
|
- <ion-thumbnail slot="start" v-if="t.photo">
|
|
64
|
|
- <img alt="Silhouette of mountains" :src="t.photo" />
|
|
65
|
|
- </ion-thumbnail>
|
|
66
|
|
- <ion-label class='ion-text-wrap'>{{ t.name }}</ion-label>
|
|
67
|
|
- </ion-item>
|
|
68
|
|
- <ion-icon icon="heart"></ion-icon>
|
|
69
|
|
- <ion-button @click="scrollToBottom">Scroll to Bottom</ion-button>
|
|
70
|
|
- {{ mats }}
|
|
|
54
|
+ <!--
|
|
|
55
|
+ <vue-core-video-player src="https://player.vimeo.com/progressive_redirect/playback/880005259/rendition/720p/file.mp4?loc=external&signature=5ddad1430211b33f65824444a3137fc0ec6fe61183d39997036d2dd3b78654f9"></vue-core-video-player> -->
|
|
|
56
|
+
|
|
|
57
|
+ Video
|
|
|
58
|
+
|
|
|
59
|
+
|
|
|
60
|
+ <div id="made-in-ny" ref='video'></div>
|
|
|
61
|
+
|
|
|
62
|
+ <ul>
|
|
|
63
|
+ <li v-for="(item, index) in items">
|
|
|
64
|
+ {{ item.msg }}
|
|
|
65
|
+ </li>
|
|
|
66
|
+ </ul>
|
|
|
67
|
+ <ion-item v-for="t in trainers" :router-link="'/detail/'+t.id">
|
|
|
68
|
+ <ion-thumbnail slot="start" v-if="t.photo">
|
|
|
69
|
+ <img alt="Silhouette of mountains" :src="t.photo" />
|
|
|
70
|
+ </ion-thumbnail>
|
|
|
71
|
+ <ion-label class='ion-text-wrap'>{{ t.name }}</ion-label>
|
|
|
72
|
+ </ion-item>
|
|
|
73
|
+ <ion-icon icon="heart"></ion-icon>
|
|
|
74
|
+ <ion-button @click="scrollToBottom">Scroll to Bottom</ion-button>
|
|
71
|
75
|
</ion-content>
|
|
72
|
76
|
</ion-page>
|
|
73
|
77
|
</template>
|
|
74
|
78
|
|
|
75
|
79
|
<script setup lang="ts">
|
|
76
|
80
|
|
|
77
|
|
-import { IonPage, IonHeader, IonToolbar, IonTitle, IonContent, IonIcon, onIonViewWillEnter, IonButton,
|
|
78
|
|
- onIonViewWillLeave, IonItem, IonLabel, IonThumbnail, IonCol, IonGrid, IonRow, IonCard, IonCardContent, IonCardHeader, IonCardSubtitle, IonCardTitle } from '@ionic/vue';
|
|
|
81
|
+ import { IonPage, IonHeader, IonToolbar, IonTitle, IonContent, IonIcon, onIonViewWillEnter, IonButton,
|
|
|
82
|
+ onIonViewWillLeave, IonItem, IonLabel, IonThumbnail, IonCol, IonGrid, IonRow, IonCard, IonCardContent, IonCardHeader, IonCardSubtitle, IonCardTitle, onIonViewDidEnter, IonButtons } from '@ionic/vue';
|
|
|
83
|
+
|
|
79
|
84
|
import ExploreContainer from '@/components/ExploreContainer.vue';
|
|
|
85
|
+import CourseSchedule from '@/components/CourseSchedule.vue'
|
|
|
86
|
+import Post from '@/components/Post.vue'
|
|
|
87
|
+import CourseMat from '@/components/CourseMat.vue'
|
|
|
88
|
+import SearchEngine from '@/components/SearchEngine.vue'
|
|
|
89
|
+
|
|
80
|
90
|
import { CapacitorHttp } from '@capacitor/core';
|
|
81
|
91
|
import { ref } from 'vue';
|
|
82
|
|
-import { TOKEN, getProducts, setToken, getObject, getToken, getTrainers, listMats, storeAPNToken } from '@/settings';
|
|
|
92
|
+import { TOKEN, getProducts, setToken, getObject, getToken, getTrainers, listMats, storeAPNToken,
|
|
|
93
|
+getTodayProgs, getLive, getPosts} from '@/composable/settings';
|
|
83
|
94
|
//import VueCoreVideoPlayer from 'vue-core-video-player'
|
|
84
|
95
|
import { vueVimeoPlayer } from 'vue-vimeo-player'
|
|
85
|
96
|
|
|
|
@@ -89,25 +100,39 @@ import { PushNotifications } from '@capacitor/push-notifications';
|
|
89
|
100
|
|
|
90
|
101
|
import Player from '@vimeo/player';
|
|
91
|
102
|
|
|
|
103
|
+import { Autoplay, Keyboard, Pagination, Scrollbar, Zoom } from 'swiper/modules';
|
|
|
104
|
+import { Swiper, SwiperSlide } from 'swiper/vue';
|
|
|
105
|
+import 'swiper/css';
|
|
|
106
|
+import 'swiper/css/autoplay';
|
|
|
107
|
+import 'swiper/css/keyboard';
|
|
|
108
|
+import 'swiper/css/pagination';
|
|
|
109
|
+import 'swiper/css/scrollbar';
|
|
|
110
|
+import 'swiper/css/zoom';
|
|
|
111
|
+import '@ionic/vue/css/ionic-swiper.css';
|
|
|
112
|
+import { search } from 'ionicons/icons';
|
|
|
113
|
+
|
|
92
|
114
|
const safeUrl = "https://vimeo.com/880005259?share=copy"
|
|
93
|
115
|
const token = ref()
|
|
94
|
116
|
const trainers = ref([])
|
|
95
|
117
|
const mats = ref()
|
|
96
|
|
- const scrollToBottom = () => {
|
|
97
|
|
- console.log("scroll")
|
|
98
|
|
- //content.value.$el.scrollToBottom(300);
|
|
|
118
|
+const todays = ref()
|
|
|
119
|
+const posts = ref()
|
|
|
120
|
+const scrollToBottom = () => {
|
|
|
121
|
+ console.log("scroll")
|
|
|
122
|
+ //content.value.$el.scrollToBottom(300);
|
|
|
123
|
+};
|
|
|
124
|
+const items = ref([{msg: 'foo'}, {msg: 'bar2'}])
|
|
|
125
|
+
|
|
|
126
|
+const options = {
|
|
|
127
|
+ id: 59777392,
|
|
|
128
|
+ width: 640,
|
|
|
129
|
+ loop: true
|
|
99
|
130
|
};
|
|
100
|
|
- const items = ref([{msg: 'foo'}, {msg: 'bar2'}])
|
|
101
|
|
-
|
|
102
|
|
- const options = {
|
|
103
|
|
- id: 59777392,
|
|
104
|
|
- width: 640,
|
|
105
|
|
- loop: true
|
|
106
|
|
- };
|
|
107
|
131
|
//const video = ref(null)
|
|
108
|
132
|
|
|
109
|
133
|
//const player = new Player(video, options);
|
|
110
|
134
|
|
|
|
135
|
+const modules = [Autoplay, Keyboard, Pagination, Scrollbar, Zoom]
|
|
111
|
136
|
onIonViewWillEnter(async () => {
|
|
112
|
137
|
//console.log("video " ,video)
|
|
113
|
138
|
//console.log("video id", video.value.id)
|
|
|
@@ -128,16 +153,29 @@ const mats = ref()
|
|
128
|
153
|
token.value = await getToken()
|
|
129
|
154
|
trainers.value = await getTrainers()
|
|
130
|
155
|
mats.value = await listMats()
|
|
|
156
|
+ posts.value = await getPosts("muaythai-techniques")
|
|
131
|
157
|
console.log(" trainers => ", trainers)
|
|
132
|
158
|
|
|
133
|
159
|
GoogleAuth.initialize();
|
|
134
|
160
|
registerNotifications()
|
|
135
|
161
|
addListeners()
|
|
|
162
|
+
|
|
|
163
|
+ todays.value = await getTodayProgs()
|
|
136
|
164
|
})
|
|
137
|
165
|
|
|
138
|
166
|
onIonViewWillLeave(() => {
|
|
139
|
167
|
console.log("view will leave")
|
|
140
|
|
-
|
|
|
168
|
+
|
|
|
169
|
+ })
|
|
|
170
|
+
|
|
|
171
|
+const liveObj = ref()
|
|
|
172
|
+ onIonViewDidEnter(async() => {
|
|
|
173
|
+ setInterval( async () => {
|
|
|
174
|
+ console.log("did enter")
|
|
|
175
|
+ if( liveObj.value == null || liveObj.value.result == false ) {
|
|
|
176
|
+ liveObj.value = await getLive()
|
|
|
177
|
+ }
|
|
|
178
|
+ }, 1000)
|
|
141
|
179
|
})
|
|
142
|
180
|
|
|
143
|
181
|
const doGet = async () => {
|