|
|
@@ -1,131 +1,15 @@
|
|
|
-<template>
|
|
|
- <cl-page>
|
|
|
- <img src="/static/home/2.png" alt="" class="w-full h-full object-cover">
|
|
|
- <!-- 精灵图动画 -->
|
|
|
- <cl-image src="/static/home/3.gif" mode="heightFix" class="!absolute bottom-0 left-0 !w-[44vh] !h-[55vh] z-[1]" />
|
|
|
- <!-- <view class="sprite-animation"></view> -->
|
|
|
- <view>
|
|
|
-
|
|
|
- </view>
|
|
|
- <cl-button @tap="handleLogin" class="!absolute top-10 left-10 z-[1]">登录</cl-button>
|
|
|
- <!-- 顶部右侧光标签 -->
|
|
|
- <view class="light-tag" @tap="visible = true">
|
|
|
- <image class="light-icon" :src="catalog?.fileList?.[0]?.url"></image>
|
|
|
- <text class="light-text">{{ catalog?.name }}</text>
|
|
|
- <cl-icon name="arrow-left-right-line" color="primary"></cl-icon>
|
|
|
- </view>
|
|
|
- <view class="boxs">
|
|
|
- <scroll-view class="scroll-view_H" direction="horizontal" :scroll-left="120" :show-scrollbar="false">
|
|
|
- <view class="scroll-view-item_H bg-[white]" v-for="course in catalog?.courseList || []" :key="course.id">
|
|
|
- <cl-image :src="course?.fileList?.[0]?.url" mode="heightFix"
|
|
|
- class="!w-full !h-[26vh] mb-[2px] rounded-xl"></cl-image>
|
|
|
- <text class="text-[16px] font-bold">{{
|
|
|
- course.mainTitle }}</text>
|
|
|
- <text class="text-[14px] text-[#666]">{{
|
|
|
- course.assistantTitle }}</text>
|
|
|
- <view>
|
|
|
- <Progress :progress="30" />
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- </scroll-view>
|
|
|
- </view>
|
|
|
- <cl-popup v-model="visible" :show-header="false" direction="center" :size="500">
|
|
|
- <view class="p-4">
|
|
|
- <cl-row :gutter="0">
|
|
|
- <cl-col :span="6" v-for="item in dataList" :key="item.id" :pt="{
|
|
|
- className: '!p-2'
|
|
|
- }" @tap="handleSelect(item)">
|
|
|
- <view class="select-item" :class="{ selected: item.id === catalog?.id }">
|
|
|
- <image :src="item?.fileList?.[0]?.url" class="w-[30rpx] h-[30rpx] mb-[2px]"></image>
|
|
|
- <text>{{ item.name }}</text>
|
|
|
- </view>
|
|
|
- </cl-col>
|
|
|
- </cl-row>
|
|
|
- </view>
|
|
|
- </cl-popup>
|
|
|
- </cl-page>
|
|
|
-</template>
|
|
|
-
|
|
|
<script lang="ts" setup>
|
|
|
-import { ref, onMounted } from 'vue'
|
|
|
-import { fetchSubjectConfigInfo } from '@/api/subject/info'
|
|
|
-import type { SubjectCatalogResult } from '@/api/subject/catalog'
|
|
|
-import Progress from './components/progress.uvue'
|
|
|
-
|
|
|
-function handleLogin() {
|
|
|
+function handleLogin(url) {
|
|
|
uni.navigateTo({
|
|
|
- url: '/pages/user/login'
|
|
|
+ url
|
|
|
})
|
|
|
}
|
|
|
-const visible = ref<boolean>(false)
|
|
|
-const dataList = ref<SubjectCatalogResult[]>([])
|
|
|
-const catalog = ref<SubjectCatalogResult>()
|
|
|
-async function getDataList() {
|
|
|
- const res = await fetchSubjectConfigInfo({ id: '69afc7e048070409048c06b6' })
|
|
|
- dataList.value = res.catalogList || []
|
|
|
- catalog.value = res?.catalogList?.[0]
|
|
|
-}
|
|
|
-onMounted(() => {
|
|
|
- getDataList()
|
|
|
-})
|
|
|
-function handleSelect(item: SubjectCatalogResult) {
|
|
|
- catalog.value = item
|
|
|
- visible.value = false
|
|
|
-}
|
|
|
</script>
|
|
|
+<template>
|
|
|
+ <cl-page>
|
|
|
+ <cl-button @tap="handleLogin('/pages/user/login')">登录</cl-button>
|
|
|
|
|
|
-<style lang="scss" scoped>
|
|
|
-.boxs {
|
|
|
- @apply w-[100vw] h-[50vh] absolute top-1/2 left-[50vh] z-[1];
|
|
|
- transform: translateY(-50%);
|
|
|
-}
|
|
|
-
|
|
|
-.scroll-view_H {
|
|
|
- width: 100%;
|
|
|
- flex-direction: row;
|
|
|
-}
|
|
|
-
|
|
|
-.scroll-view-item_H {
|
|
|
- @apply w-[40vh] h-[50vh] mr-[20px] rounded-2xl border-[5px] border-[#1D4BD9] border-solid border-b-[10px] p-1 flex items-center;
|
|
|
-}
|
|
|
-
|
|
|
-.light-tag {
|
|
|
- @apply absolute top-5 right-5 z-[1] flex flex-row items-center bg-white px-3 py-2 font-bold rounded-full shadow-md;
|
|
|
-
|
|
|
- .light-icon {
|
|
|
- width: 20px;
|
|
|
- height: 20px;
|
|
|
- margin-right: 3px;
|
|
|
- }
|
|
|
-
|
|
|
- .light-text {
|
|
|
- font-size: 16px;
|
|
|
- width: 70px;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-.select-item {
|
|
|
- @apply flex items-center justify-center rounded-xl border-[3px] border-[#1D4BD9] border-solid border-b-[5px] px-4 py-2 font-bold;
|
|
|
-}
|
|
|
-
|
|
|
-.selected {
|
|
|
- @apply border-green-500;
|
|
|
-}
|
|
|
-
|
|
|
-.sprite-animation {
|
|
|
- @apply absolute bottom-0 left-0 w-[42vh] h-[60vh] z-[1] bg-[url('https://oss.xiaoxiongcode.com/static/home/sprite.png')] bg-no-repeat;
|
|
|
- background-size: 1460% 1000%;
|
|
|
- background-position: 0 0;
|
|
|
- animation: sprite-animation 3s steps(13) infinite;
|
|
|
-}
|
|
|
-
|
|
|
-@keyframes sprite-animation {
|
|
|
- from {
|
|
|
- background-position: 0 0;
|
|
|
- }
|
|
|
-
|
|
|
- to {
|
|
|
- background-position: calc(-42vh * 13) 0;
|
|
|
- }
|
|
|
-}
|
|
|
-</style>
|
|
|
+ <cl-button @tap="handleLogin('/pages/catalog/index')">物理课</cl-button>
|
|
|
+ </cl-page>
|
|
|
+</template>
|
|
|
+<style lang="scss" scoped></style>
|