123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251 |
- <script setup>
- import { ref, reactive } from "vue";
- import { useMainStore } from "@/stores/store";
- import axios from "axios";
- import moment from "moment";
- const store = useMainStore();
- let token = store.token;
- console.log("學習護照", store.token);
- let register = reactive({
- list: [],
- });
- (async () => {
- try {
- const response = await axios.get(
- `https://cmm.ai:8088/api/get_registration?access_token=${token}`
- );
- register.list = response.data.registrations;
- console.log("response", response.data.registrations);
- } catch (error) {
- console.error(error);
- }
- })();
- </script>
- <template>
- <v-card class="h-100">
- <div class="title">
- <h4>學習護照</h4>
- </div>
- <p class="text-center">
- 凡在平台選擇「學習時數課程」並報名 <br />
- 即可累積點數,兌換精美好禮-工藝材料包
- </p>
- <v-row class="main-info mt-10">
- <v-col cols="12" lg="6" class="d-flex flex-column align-center">
- <h5>累積學習<span>時數</span></h5>
- <div class="d-flex align-center position-relative">
- <p>
- 自 2023 年起至今 <br />
- 完成課程時數
- </p>
- <img src="@/assets/img/passport/icon-01.png" alt="" class="icon" />
- </div>
- <div class="record-item">
- <img src="@/assets/img/passport/icon-03.png" alt="" />
- <p>
- 總共 <br />
- <strong> 102 </strong> <small>小時</small>
- </p>
- </div>
- </v-col>
- <v-col cols="12" lg="6" class="d-flex flex-column align-center">
- <h5>累積學習<span>點數</span></h5>
- <div class="d-flex align-center position-relative">
- <p>
- 累積 20 點即可兌換 1 份 <br />
- 工藝材料包
- </p>
- <img src="@/assets/img/passport/icon-02.png" alt="" class="icon" />
- </div>
- <div class="record-item">
- <img src="@/assets/img/passport/icon-03.png" alt="" />
- <p>
- 總共 <br />
- <strong> 33 </strong> <small>點</small>
- </p>
- </div>
- </v-col>
- <v-col cols="12" class="my-16">
- <div class="main-table">
- <h6 class="table-title">報名中課程</h6>
- <table>
- <thead>
- <tr>
- <th>名稱</th>
- <th width="30%">日期</th>
- <th width="15%">時數</th>
- <th width="15%">報名完成</th>
- </tr>
- </thead>
- <tbody v-if="register.list.length">
- <!-- <tr v-if="!register.list.length">
- <p class="hint-item">
- 目前沒有報名紀錄喔!點擊開始探索您的專屬課程!
- </p>
- </tr> -->
- <tr v-for="(item, index) in register.list" :key="index">
- <td>{{ item.class_name }}</td>
- <td>
- {{ moment(`${item.start_time}`).format("YYYY/MM/DD H:mm") }}
- <br />
- ~ <br />
- {{ moment(`${item.end_time}`).format("YYYY/MM/DD H:mm") }}
- </td>
- <td>3 小時</td>
- <td>
- <span class="finish-icon" v-if="item.reg_confirm">
- <v-icon icon="mdi-check" class="pb-1"></v-icon>
- </span>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <router-link
- v-if="!register.list.length"
- to="/course-list"
- class="hint-item"
- >
- 目前沒有報名紀錄喔! <br />
- 點擊開始探索您的專屬課程!
- </router-link>
- </v-col>
- <v-col cols="12" class="my-16">
- <div class="main-table">
- <h6 class="table-title">上課紀錄</h6>
- <table>
- <thead>
- <tr>
- <th>名稱</th>
- <th width="30%">日期</th>
- <th width="15%">時數</th>
- <th width="15%">報名完成</th>
- </tr>
- </thead>
- <tbody>
- <tr></tr>
- </tbody>
- </table>
- </div>
- </v-col>
- <div class="dot-item">
- <span class="t-dot"></span>
- <span class="r-dot"></span>
- <span class="b-dot"></span>
- <span class="l-dot"></span>
- </div>
- </v-row>
- </v-card>
- </template>
- <style lang="scss" scoped>
- p {
- line-height: 30px;
- }
- .main-info {
- margin: 30px;
- padding: 50px;
- position: relative;
- border: 2px solid var(--blue);
- border-radius: 20px;
- @media (max-width: 600px) {
- margin: 0;
- padding: 50px 20px 100px;
- }
- h5 {
- display: flex;
- flex-direction: column;
- align-items: center;
- font-size: 20px;
- font-weight: 500;
- letter-spacing: 1px;
- span {
- display: block;
- margin: 5px 0 15px;
- font-size: 36px;
- }
- }
- p {
- text-align: center;
- line-height: 22px;
- @media (max-width: 490px) {
- font-size: 14px;
- }
- }
- .icon {
- width: 50px;
- position: absolute;
- right: -50px;
- }
- .record-item {
- margin-top: 20px;
- position: relative;
- p {
- width: 100%;
- position: absolute;
- z-index: 100;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%);
- color: #fff;
- font-size: 30px;
- }
- strong {
- display: inline-block;
- margin: 25px 0;
- font-size: 56px;
- font-weight: 500;
- @media (max-width: 600px) {
- font-size: 50px;
- }
- }
- small {
- font-size: 20px;
- }
- img {
- max-width: 260px;
- @media (max-width: 600px) {
- max-width: 220px;
- }
- }
- }
- }
- .table-title {
- background-color: var(--blue);
- }
- table {
- thead {
- border-bottom: 2px solid var(--blue);
- }
- tbody {
- td {
- border-bottom: 1px solid var(--blue);
- line-height: 24px;
- padding: 15px;
- }
- }
- .finish-icon {
- padding: 8px;
- border: 2px solid var(--blue);
- border-radius: 100px;
- .v-icon {
- color: var(--blue);
- }
- }
- }
- </style>
|