|
@@ -1,29 +1,16 @@
|
|
|
<script setup>
|
|
|
import { ref, reactive, watch } from "vue";
|
|
|
+import { useMainStore } from "@/stores/store";
|
|
|
import axios from "axios";
|
|
|
import moment from "moment";
|
|
|
import Map from "@/components/Map.vue";
|
|
|
import Navbar from "@/components/Navbar.vue";
|
|
|
|
|
|
+const store = useMainStore();
|
|
|
let pageNum = ref(1); // 頁數(預設第一頁)
|
|
|
let pageAmount = ref(4); // 每頁顯示筆數
|
|
|
let totalPages = ref(1); // 總頁數
|
|
|
|
|
|
-// 取得所有課程總筆數
|
|
|
-(async () => {
|
|
|
- try {
|
|
|
- const response = await axios.get("https://cmm.ai:8088/api/get_class_name");
|
|
|
- totalPages.value = getTotalPages(response.data.classes.length, 4);
|
|
|
- } catch (error) {
|
|
|
- console.error(error);
|
|
|
- }
|
|
|
-})();
|
|
|
-
|
|
|
-// 計算頁數
|
|
|
-function getTotalPages(totalRecords, recordsPerPage) {
|
|
|
- return Math.ceil(totalRecords / recordsPerPage);
|
|
|
-}
|
|
|
-
|
|
|
// 切換分頁
|
|
|
watch(pageNum, () => {
|
|
|
getClass();
|
|
@@ -42,7 +29,7 @@ async function getClass() {
|
|
|
|
|
|
try {
|
|
|
const response = await axios.get(assignState.value ? assignUrl : url);
|
|
|
- console.log("response", response.data);
|
|
|
+ totalPages.value = store.getTotalPages(response.data.total_num, 4);
|
|
|
classes.data = response.data.classes;
|
|
|
} catch (error) {
|
|
|
console.error(error);
|
|
@@ -53,7 +40,6 @@ getClass();
|
|
|
|
|
|
// 取得特定據點課程總筆數
|
|
|
const getClassList = async (locationId) => {
|
|
|
- console.log("locationId", locationId);
|
|
|
assignState.value = true;
|
|
|
assignLocationId.value = locationId;
|
|
|
|
|
@@ -63,7 +49,7 @@ const getClassList = async (locationId) => {
|
|
|
);
|
|
|
getClass();
|
|
|
pageNum.value = 1;
|
|
|
- totalPages.value = getTotalPages(response.data.classes.length, 4);
|
|
|
+ totalPages.value = store.getTotalPages(response.data.classes.length, 4);
|
|
|
} catch (error) {
|
|
|
console.log("error", error);
|
|
|
}
|
|
@@ -77,50 +63,112 @@ const getClassList = async (locationId) => {
|
|
|
</div>
|
|
|
<Navbar />
|
|
|
|
|
|
- <v-container class="pa-0 pt-16">
|
|
|
+ <v-container class="px-md-0">
|
|
|
+ <section class="text-center intro">
|
|
|
+ <h2 class="title">臺灣工藝學校</h2>
|
|
|
+ <p class="my-10">
|
|
|
+ 以佈局具國際視野之工藝學習共享平台為目標,藉由「工藝學校」的主體概念,推動臺灣工藝學校全球學習平台,以共享、友善、全人、全民的終身工藝手作平台進行人才、課程、知識、教材之工藝資源嫁接媒合與內容設計,以在地、就近、線上、線下等多元方式提供不同型態之學習體驗內容及選擇。
|
|
|
+ </p>
|
|
|
+ <p>
|
|
|
+ With the goal of laying out a craft learning sharing platform with an
|
|
|
+ international perspective, through the main concept of "craft school",
|
|
|
+ promote the global learning platform of Taiwan craft schools, and use a
|
|
|
+ lifelong craft handicraft platform of sharing, friendliness, whole
|
|
|
+ people and the whole people to graft and match and design the craft
|
|
|
+ resources of talents, courses, knowledge and teaching materials, and
|
|
|
+ provide different types of learning experience content and choices in
|
|
|
+ local, nearby, online and offline ways.
|
|
|
+ </p>
|
|
|
+ </section>
|
|
|
+
|
|
|
<v-row>
|
|
|
<v-col cols="4">
|
|
|
- <img src="@/assets/img/home/首頁元素-12.png" alt="" />
|
|
|
+ <router-link to="/" class="img-info">
|
|
|
+ <img src="@/assets/img/home/首頁元素-12.png" alt="" />
|
|
|
+ <section>
|
|
|
+ <p>線上工藝</p>
|
|
|
+ </section>
|
|
|
+ </router-link>
|
|
|
</v-col>
|
|
|
<v-col cols="4">
|
|
|
- <img src="@/assets/img/home/首頁元素-11.png" alt="" />
|
|
|
+ <router-link to="/college-group/craft" class="img-info">
|
|
|
+ <img src="@/assets/img/home/首頁元素-11.png" alt="" />
|
|
|
+ <section>
|
|
|
+ <p>技藝工藝</p>
|
|
|
+ </section>
|
|
|
+ </router-link>
|
|
|
</v-col>
|
|
|
<v-col cols="4">
|
|
|
- <img src="@/assets/img/home/首頁元素-10.png" alt="" />
|
|
|
+ <router-link to="/college-group/repair" class="img-info">
|
|
|
+ <img src="@/assets/img/home/首頁元素-10.png" alt="" />
|
|
|
+ <section>
|
|
|
+ <p>修復工藝</p>
|
|
|
+ </section>
|
|
|
+ </router-link>
|
|
|
</v-col>
|
|
|
<v-col cols="4">
|
|
|
- <img src="@/assets/img/home/首頁元素-09.png" alt="" />
|
|
|
+ <router-link to="/college-group/cross" class="img-info">
|
|
|
+ <img src="@/assets/img/home/首頁元素-09.png" alt="" />
|
|
|
+ <section>
|
|
|
+ <p>跨域工藝</p>
|
|
|
+ </section>
|
|
|
+ </router-link>
|
|
|
</v-col>
|
|
|
<v-col cols="4" class="d-flex justify-center align-center">
|
|
|
<h3 class="title">八大工藝學群</h3>
|
|
|
</v-col>
|
|
|
<v-col cols="4">
|
|
|
- <img src="@/assets/img/home/首頁元素-05.png" alt="" />
|
|
|
+ <router-link to="/college-group/generation" class="img-info">
|
|
|
+ <img src="@/assets/img/home/首頁元素-05.png" alt="" />
|
|
|
+ <section>
|
|
|
+ <p>世代工藝</p>
|
|
|
+ </section>
|
|
|
+ </router-link>
|
|
|
</v-col>
|
|
|
<v-col cols="4">
|
|
|
- <img src="@/assets/img/home/首頁元素-06.png" alt="" />
|
|
|
+ <router-link to="/college-group/future" class="img-info">
|
|
|
+ <img src="@/assets/img/home/首頁元素-06.png" alt="" />
|
|
|
+ <section>
|
|
|
+ <p>未來工藝</p>
|
|
|
+ </section>
|
|
|
+ </router-link>
|
|
|
</v-col>
|
|
|
<v-col cols="4">
|
|
|
- <img src="@/assets/img/home/首頁元素-07.png" alt="" />
|
|
|
+ <router-link to="/" class="img-info">
|
|
|
+ <img src="@/assets/img/home/首頁元素-07.png" alt="" />
|
|
|
+ <section>
|
|
|
+ <p>生活工藝</p>
|
|
|
+ </section>
|
|
|
+ </router-link>
|
|
|
</v-col>
|
|
|
<v-col cols="4">
|
|
|
- <img src="@/assets/img/home/首頁元素-08.png" alt="" />
|
|
|
+ <router-link to="/college-group/teenager" class="img-info">
|
|
|
+ <img src="@/assets/img/home/首頁元素-08.png" alt="" />
|
|
|
+ <section>
|
|
|
+ <p>青年工藝</p>
|
|
|
+ </section>
|
|
|
+ </router-link>
|
|
|
</v-col>
|
|
|
</v-row>
|
|
|
|
|
|
<div class="map-block">
|
|
|
<h3 class="mb-10 title">全台工藝地圖</h3>
|
|
|
<div class="v-row">
|
|
|
- <v-col cols="7">
|
|
|
+ <v-col md="7" cols="12">
|
|
|
<div class="map">
|
|
|
<Map @locationId="getClassList" />
|
|
|
</div>
|
|
|
</v-col>
|
|
|
- <v-col cols="5">
|
|
|
+ <v-col md="5" cols="12">
|
|
|
<v-list lines="three" class="list pa-0">
|
|
|
<v-list-item v-for="item in classes.data" :key="item.id">
|
|
|
<div class="d-flex align-center">
|
|
|
- <img :src="item.cover_img" alt="" />
|
|
|
+ <router-link
|
|
|
+ :to="`/course-detail/${item.class_name_id}`"
|
|
|
+ class="link"
|
|
|
+ >
|
|
|
+ <img :src="item.cover_img" alt="" />
|
|
|
+ </router-link>
|
|
|
<section>
|
|
|
<h2>{{ item.name }}</h2>
|
|
|
<p>主辦單位:{{ item.organizer }}</p>
|
|
@@ -161,6 +209,13 @@ const getClassList = async (locationId) => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+.intro {
|
|
|
+ margin: 120px 0 100px;
|
|
|
+ p {
|
|
|
+ line-height: 32px;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
.title {
|
|
|
font-size: 26px;
|
|
|
font-weight: 400;
|
|
@@ -168,19 +223,61 @@ const getClassList = async (locationId) => {
|
|
|
text-align: center;
|
|
|
}
|
|
|
|
|
|
+.navbar {
|
|
|
+ margin-bottom: 0;
|
|
|
+}
|
|
|
+
|
|
|
+.img-info {
|
|
|
+ display: block;
|
|
|
+ position: relative;
|
|
|
+ section {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ position: absolute;
|
|
|
+ top: 0;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ background: rgba(167, 193, 204, 0.7);
|
|
|
+ cursor: pointer;
|
|
|
+ opacity: 0;
|
|
|
+ transition: all 0.5s;
|
|
|
+ &:hover {
|
|
|
+ opacity: 1;
|
|
|
+ }
|
|
|
+ p {
|
|
|
+ color: #fff;
|
|
|
+ font-size: 20px;
|
|
|
+ letter-spacing: 1px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
.map-block {
|
|
|
margin: 100px auto;
|
|
|
.map {
|
|
|
- height: 100vh;
|
|
|
+ height: 100%;
|
|
|
+ min-height: 100vh;
|
|
|
}
|
|
|
|
|
|
.list {
|
|
|
- img {
|
|
|
- width: 200px;
|
|
|
- height: 175px;
|
|
|
+ .link {
|
|
|
+ min-width: 180px;
|
|
|
margin-right: 20px;
|
|
|
border-radius: 5px;
|
|
|
- box-shadow: 2px 2px 4px #aaaaaa;
|
|
|
+ overflow: hidden;
|
|
|
+ img {
|
|
|
+ // width: 100%;
|
|
|
+ height: 175px;
|
|
|
+ margin-right: 20px;
|
|
|
+ border-radius: 5px;
|
|
|
+ box-shadow: 2px 2px 4px #aaaaaa;
|
|
|
+ transition: all 0.3s;
|
|
|
+ object-fit: cover;
|
|
|
+ &:hover {
|
|
|
+ transform: scale(1.1);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
h2 {
|