edana 6 months ago
commit e3fa89776b
  1. 105
      src/views/MyCourseStudy/ContainerCla.vue
  2. 88
      src/views/MyCourseStudy/courseCollections.vue

@ -2,7 +2,7 @@
<!-- 课程收藏页面 -->
<el-tab-pane label="课程收藏" name="first">
<div class="Container_Cla">
<div class="item_1" v-for="(item_1, index) in 12" :key="index">
<div class="item_1" v-for="(item_1, index) in datalist" :key="index">
<!-- 课程图片盒子 -->
<div class="ClassImg">
<!-- 更多图片盒子 -->
@ -10,16 +10,16 @@
<img src="../../assets/icons/更多.svg" width="100%" height="100%" />
</div>
<!-- 课程图片 -->
<img src="../../assets/images/kctp.png" />
<img :src="item_1.img" />
</div>
<div class="ClaCon">
<div class="Con">
<h3>软件项目管理{{ item_1 }}</h3>
<p>讲师:王兴</p>
<h3>{{ item_1.name }}</h3>
<p>讲师:{{ item_1.teacher }}</p>
<p>
<span>32</span>
<span>{{ item_1.classhours }}</span>
学时 &nbsp; | &nbsp;
<span>2.0</span>
<span>{{ item_1.credit }}</span>
学分
</p>
</div>
@ -27,18 +27,89 @@
</div>
</div>
<div class="Page-1">
<el-pagination v-model:current-page="currentPage4" v-model:page-size="pageSize4" :page-sizes="[1, 2, 3, 4]"
:small="small" :disabled="disabled" :background="background" layout="total, sizes, prev, pager, next, jumper"
:total="400" @size-change="handleSizeChange" @current-change="handleCurrentChange" />
<el-pagination
v-model:current-page="params.current"
v-model:page-size="params.pageSize"
:page-sizes="[6, 8, 12, 15]"
layout="total, sizes, prev, pager, next, jumper"
:total="total"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
</div>
</el-tab-pane>
</template>
<script lang="ts" setup>
import { ref } from 'vue'
import { SeCourseFavourControllerService } from '../../../generated/services/SeCourseFavourControllerService'
import { CourseFavourQueryRequest } from 'generated/models/CourseFavourQueryRequest'
const total = ref(0)
const datalist = ref([
{
/**
* 课程学时
*/
classhours: '',
/**
* 课程学分
*/
credit: '',
id: '',
img: '',
name: '',
/**
* 教师id
*/
teacher: '',
},
])
/**
* 表单信息
*/
let params = ref<CourseFavourQueryRequest>({
current: 1,
pageSize: 12,
sortField: '',
sortOrder: '',
userId: 2,
})
const getDatalist = async () => {
const res = await SeCourseFavourControllerService.listPostByPageUsingPost(
params.value,
)
datalist.value = res.data.records
console.log('datalist ' + datalist.value[0].name)
total.value = res.data.total
console.log('pages ' + total.value)
console.log('datalist ' + datalist.value[0].img)
}
getDatalist()
const handleSizeChange = (size: any) => {
// console.log(size)
params.value.current = 1
params.value.pageSize = size
//
getDatalist()
}
const handleCurrentChange = (page: any) => {
console.log(page)
params.value.current = page
//
// getCourseList()
getDatalist()
}
</script>
<style lang="scss" scoped>
.el-pagination {
justify-content: center;
}
.example-pagination-block+.example-pagination-block {
.example-pagination-block + .example-pagination-block {
margin-top: 10px;
}
@ -68,6 +139,7 @@
}
.Container_Cla {
min-height: 750px;
width: 100%;
height: 100%;
display: grid;
@ -96,7 +168,7 @@
border-bottom: 1px solid rgb(217, 217, 217);
}
.ClassImg>img {
.ClassImg > img {
width: 100%;
height: 180px;
}
@ -104,7 +176,6 @@
.item_1:hover {
.ClassGd {
display: block;
}
}
@ -131,14 +202,14 @@
justify-content: space-around;
}
.Con>h3 {
.Con > h3 {
margin-left: 15px;
font-size: 25px;
font-weight: 600;
cursor: pointer;
}
.Con>p {
.Con > p {
margin-left: 15px;
margin-top: 5px;
font-size: 13px;
@ -146,14 +217,14 @@
cursor: pointer;
}
.Con>p>span {
.Con > p > span {
margin-left: 5px;
margin-right: 5px;
color: rgb(94, 188, 231);
font-weight: 600;
}
.Con>button {
.Con > button {
width: 45px;
height: 20px;
font-size: 9px;
@ -165,4 +236,4 @@
width: 100%;
justify-content: center;
}
</style >
</style>

@ -1,6 +1,12 @@
<template>
<div class="curse-collection">
<el-tabs v-model="activeName" type="card" class="demo-tabs" @tab-click="handleClick" style="padding-top: 0">
<el-tabs
v-model="activeName"
type="card"
class="demo-tabs"
@tab-click="handleClick"
style="padding-top: 0"
>
<!-- 课程收藏页面 -->
<ContainerCla />
<!-- 资源收藏页面 -->
@ -86,8 +92,7 @@
<p>文本名称-----{{ item }}</p>
</div>
</div>
<div>
</div>
<div></div>
</div>
<div class="Res_con" v-show="activeIndex == 5">
<div class="item_2-5" v-for="(item, index) in 10" :key="index">
@ -100,10 +105,8 @@
<p>音频名称-----{{ item }}</p>
</div>
</div>
</div>
<div class="Page-2">
</div>
<div class="Page-2"></div>
</el-tab-pane>
<!-- 知识点收藏页面 -->
<el-tab-pane label="知识点收藏" name="third">
@ -140,8 +143,6 @@
<script lang="ts" setup>
import { ref } from 'vue'
import type { TabsPaneContext } from 'element-plus'
import { SeCourseFavourControllerService } from '../../../generated/services/SeCourseFavourControllerService'
import { CourseFavourQueryRequest } from 'generated/models/CourseFavourQueryRequest'
import ContainerCla from './ContainerCla.vue'
// import ContainerRes from "./ContainerRes.vue";
// import { getDataListApi } from '@/api/user/corc.js'
@ -155,69 +156,6 @@ const activeName = ref('first')
const handleClick = (tab: TabsPaneContext, event: Event) => {
console.log(tab, event)
}
// const params = ref({
// page: 1,
// pageNum: 12
// })
const total = ref(0)
const datalist = ref([
{
/**
* 课程学时
*/
classhours: '',
/**
* 课程学分
*/
credit: '',
id: '',
img: '',
name: '',
/**
* 教师id
*/
teacher: '',
},
])
/**
* 表单信息
*/
let params = ref<CourseFavourQueryRequest>({
current: 1,
pageSize: 12,
sortField: '',
sortOrder: '',
userId: 2,
})
const getDatalist = async () => {
const res = await SeCourseFavourControllerService.listPostByPageUsingPost(
params.value,
)
datalist.value = res.data.records
console.log('datalist ' + datalist.value[0].name)
total.value = res.data.pages
console.log('pages ' + total.value)
console.log('datalist ' + datalist.value[0].img)
}
getDatalist()
const handleSizeChange = (size: any) => {
// console.log(size)
params.value.page = 1
params.value.pageNum = size
//
getDatalist()
}
const handleCurrentChange = (page: any) => {
console.log(page)
params.value.page = page
//
// getCourseList()
getDatalist()
}
</script>
<style lang="scss" scoped>
@ -225,7 +163,7 @@ const handleCurrentChange = (page: any) => {
justify-content: center;
}
.example-pagination-block+.example-pagination-block {
.example-pagination-block + .example-pagination-block {
margin-top: 10px;
}
@ -361,7 +299,7 @@ const handleCurrentChange = (page: any) => {
align-items: center;
}
.ResClaDic>p {
.ResClaDic > p {
font-family: Inter, Inter;
font-weight: 500;
font-size: 20px;
@ -423,7 +361,7 @@ const handleCurrentChange = (page: any) => {
justify-content: space-around;
}
.KnoBtn>img {
.KnoBtn > img {
padding-top: 20px;
cursor: pointer;
}
@ -451,7 +389,7 @@ const handleCurrentChange = (page: any) => {
flex-direction: column;
}
.Knowledge_point>ul>li {
.Knowledge_point > ul > li {
display: inline-block;
margin-top: 5px;
margin-bottom: 5px;

Loading…
Cancel
Save