ww 3 months ago
parent bf170a0d40
commit b9f8abd1a9
  1. 18
      src/api/courseChaptersApi.ts
  2. 3
      src/api/stu.js
  3. 10
      src/api/user/user.js
  4. 54
      src/views/home/components/Lessonlist.vue
  5. 4
      src/views/home/components/Student1.vue
  6. 46
      src/views/home/components/Welcome.vue
  7. 66
      src/views/home/index.vue

@ -96,25 +96,7 @@ export const deleteCourse = (params: any) => {
// 获取详情
export const getCourseInfo = (params: any) => {
return request({
<<<<<<< HEAD
// <<<<<<< HEAD
url: '/objective_contents/' + params.id,
method: 'get',
// // params
// =======
// <<<<<<< HEAD
// url: '/api/objective_contents/' + params.id,
// method: 'get',
// params,
// =======
// url: '/objective_contents/' + params.id,
// method: "get",
// // params
// >>>>>>> 1a620e19de970965f426e07348b1dbc4be900eaf
// >>>>>>> 991fa5ab08c56c84c5a276226f8fbc2ec78f859a
=======
url: '/api/objective_contents/' + params.id,
// method: 'get',
>>>>>>> 0b7db324dad8347654933e91ae7e6ca8d2dabd05
})
}

@ -0,0 +1,3 @@
export const userStudentListService = (id) => {
return request.post('/api/coursesteacher/studentList?userId=' + id)
}

@ -63,9 +63,9 @@ export const userStudentListService = (id) => {
return request.post('/api/coursesteacher/studentList?userId=' + id)
}
//获取课程列表
// export const userLessonListService = (id) => {
// return request.post('/api/coursesteacher/studentList?userId=' + id)
// }
export const userLessonListService = (id) => {
return request.post('/api/courselearingrecord/courseList?userId=' + id)
}
//获取浏览量
export const userLookService = () => {
return request.get('/api/report/receptionBrowse')
@ -74,3 +74,7 @@ export const userLookService = () => {
export const userPicService = () => {
return request.get('/api/report/browseStatistics')
}
//获取学习最多的知识点
export const userMaxKnowService = (id) => {
return request.post('/api/knowledgelearning/studyMaxKnowledge?userId=' + id)
}

@ -1,40 +1,65 @@
<script setup>
import conheader from '@/views/home/components/ConHeader.vue'
import fe from '@/assets/images/fe.jpg'
// import { userLessonListService } from '@/api/user/user.js'
// const getLesList = async () => {
// const res = await userLessonListService()
// console.log(res)
// }
// getLesList()
import courseedit from '@/views/course/components/courseEdit.vue'
import { ref, onMounted } from 'vue'
import useUserStore from '@/store/modules/user'
import { userLessonListService, userMaxKnowService } from '@/api/user/user.js'
const userStore = useUserStore()
// console.log(userStore.data.id, 'sfa')
const loading = ref(false)
const lessonList = ref([])
const getLesList = async () => {
loading.value = true
const res = await userLessonListService(userStore.data.id)
lessonList.value = res.data
loading.value = false
// console.log(res.data, 'less')
}
//
const maxKnow = ref('')
const getmaxKnow = async () => {
const res = await userMaxKnowService(userStore.data.id)
maxKnow.value = res.data
// console.log(res.data.label, 'max')
}
getmaxKnow()
onMounted(() => {
getLesList()
getmaxKnow()
})
</script>
<template>
<div class="lesson_container" style="width: 95%; height: 90%">
<div
class="lesson_container"
style="width: 95%; height: 90%"
v-loading="loading"
>
<conheader
:title="`课程列表`"
:urouter="'/curriculumCenter/basicCourseInformation'"
></conheader>
<div class="lessonlist-content">
<div class="lessonlist-item" v-for="item in 4" :key="item">
<div class="lessonlist-item" v-for="item in lessonList" :key="item.id">
<div class="lessonlist-item-img">
<img
src=""
alt=""
:src="item.img"
style="width: 100%; height: 125px; border-radius: 10px 10px 0px 0px"
/>
</div>
<div class="lessonlist-item-info">
<h3>软件构造</h3>
<h3>{{ item.name }}</h3>
<div class="p"><p>编辑</p></div>
</div>
</div>
</div>
</div>
<courseedit @click="open"></courseedit>
</template>
<style scoped>
.lesson_container {
/* background-color: purple; */
overflow: hidden;
display: flex;
flex-direction: column;
justify-content: space-between;
@ -59,12 +84,12 @@ import fe from '@/assets/images/fe.jpg'
flex-direction: column;
justify-content: space-between;
border: 1px solid #e8e8f2;
/* border-radius: 6px 6px 6px 6px; */
/* box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); */
margin: 10px 0px;
}
.lessonlist-item-info {
box-sizing: border-box;
padding: 6px 5px;
/* background-color: pink; */
/* padding: 10px; */
/* display: flex;
@ -85,6 +110,7 @@ import fe from '@/assets/images/fe.jpg'
/* width: 100%; */
display: flex;
justify-content: end;
cursor: pointer;
}
.lessonlist-item-info p {
font-size: 12px;

@ -4,6 +4,8 @@ import { ref, computed } from 'vue'
import { useRouter } from 'vue-router'
import { userStudentListService } from '@/api/user/user'
import useUserStore from '@/store/modules/user'
import defImg from '@/assets/images/default.png'
const userStore = useUserStore()
const router = useRouter()
const loading = ref(false)
@ -30,7 +32,7 @@ getStuList()
<div class="stu_content" v-loading="loading">
<ul>
<li class="stu-item" v-for="(item, index) in stuList" :key="index">
<img :src="item.icon" class="stu-item-img" />
<img :src="item.icon || defImg" class="stu-item-img" />
<div class="stu-item-info">
<h4>{{ item.name }}</h4>
<h4 style="color: #666">{{ item.number }}</h4>

@ -36,15 +36,32 @@ const passFormVisible = ref(false)
//dialog
const form = ref({})
const formLabelWidth = '80px'
//dialog
const openInfo = () => {
dialogFormVisible.value = true
form.value = { ...props.userData }
// console.log(form.value, 'form')
}
const openPass = () => {
passFormVisible.value = true
}
//
const checkOldSame = (rule, value, callback) => {
if (value === props.userData.password) {
callback(new Error('新密码不能与旧密码相同'))
} else {
callback()
}
}
const checkNewSame = (rule, value, cb) => {
if (value !== pwdForm.value.new_pwd) {
cb(new Error('新密码和确认再次输入的新密码不一样!'))
} else {
cb()
}
}
//
const infoRules = {
phone: [
@ -64,23 +81,6 @@ const infoRules = {
},
],
}
// ---
//
const checkOldSame = (rule, value, callback) => {
if (value === props.userData.password) {
callback(new Error('新密码不能与旧密码相同'))
} else {
callback()
}
}
const checkNewSame = (rule, value, cb) => {
if (value !== pwdForm.value.new_pwd) {
cb(new Error('新密码和确认再次输入的新密码不一样!'))
} else {
cb()
}
}
// ---
//
const rules = {
//
@ -118,13 +118,13 @@ const infoRef = ref()
//
const emit = defineEmits(['get-message'])
const changeInfo = async () => {
await infoRef.value.validate()
const userInfo = {
phone: form.value.phone,
id: form.value.id,
nickName: form.value.nickName,
}
const jsonData = JSON.stringify(userInfo)
// const valid = await infoRef.value.validate()
await userChangeService(jsonData).then(() => {
ElMessage.success('修改成功')
emit('get-message', form.value.nickName)
@ -158,7 +158,7 @@ const onSubmit = async () => {
const onReset = () => {
pwdForm.value = {}
}
//
const username = computed(() => {
if (props.userData.nickName) {
return props.userData.nickName
@ -212,12 +212,8 @@ onMounted(() => {
title="登录信息"
style="width: 800px; text-align: center"
>
<el-form :rules="infoRules" ref="infoRef" :model="form">
<el-form-item
label="用户名"
:label-width="formLabelWidth"
prop="username"
>
<el-form :rules="infoRules" ref="infoRef" :data="form">
<el-form-item label="用户名" :label-width="formLabelWidth">
<el-input :disabled="true" v-model="form.username" autocomplete="off" />
</el-form-item>
<el-form-item label="昵称" :label-width="formLabelWidth" prop="nickName">

@ -9,11 +9,16 @@ import lessonlist from './components/Lessonlist.vue'
import Student1 from './components/Student1.vue'
// import Class2 from './components/Class2.vue'
// import Student2 from './components/Student2.vue'
import { userNewLikeService, userLookService } from '@/api/user/user'
import {
userNewLikeService,
userLookService,
userMaxKnowService,
} from '@/api/user/user'
import useUserStore from '@/store/modules/user'
import fe from '@/assets/images/fe.jpg'
import { ref, onMounted } from 'vue'
import { useRouter } from 'vue-router'
// import { Picture } from 'element-plus/icons-vue'
const router = useRouter()
const userStore = useUserStore()
const username = ref()
@ -39,6 +44,14 @@ const courselist = ref([])
const img = ref()
const courseName = ref()
const courseTea = ref()
//
const maxKnow = ref([])
const getmaxKnow = async () => {
const res = await userMaxKnowService(userStore.data.id)
maxKnow.value = res.data
console.log(maxKnow.value, 'max')
}
onMounted(() => {
// getData()
username.value = userStore.userName
@ -60,16 +73,18 @@ onMounted(() => {
// // console.log(res, '')
// })
//
const res = userNewLikeService(userStore.data.id).then((res) => {
console.log(res.data.id, '最新收藏的课程')
userNewLikeService(userStore.data.id).then((res) => {
console.log(res.data, '最新收藏的课程')
courselist.value = res.data
// console.log(courselist.value.id, 'course')
img.value = res.data.img
courseName.value = res.data.name
courseTea.value = res.data.teacher
// img.value = res.data.img
// courseName.value = res.data.name
// courseTea.value = res.data.teacher
})
//echart
userLookService()
//
getmaxKnow()
})
</script>
<template>
@ -111,8 +126,8 @@ onMounted(() => {
style="
font-size: 14px;
display: flex;
margin: 0px auto;
margin: 0px 30px;
/* margin: 0px auto; */
margin: 0px 10px;
"
>
<conheader
@ -121,8 +136,8 @@ onMounted(() => {
></conheader>
</a>
<div class="con">
<p class="button" round v-for="item in 30" :key="item">
Spring clould
<p class="button" round v-for="item in maxKnow" :key="item.id">
{{ item.label }}
</p>
</div>
</div>
@ -152,9 +167,10 @@ onMounted(() => {
<ul>
<li class="lessonlist-item" v-for="item in 4" :key="item">
<img :src="fe" class="lessonlist-item-img" />
<div class="lessonlist-item-info">
<h5>{{ courseName }}</h5>
<p>{{ courseTea }}</p>
<h5>课程名称</h5>
<p>教师</p>
</div>
</li>
</ul>
@ -171,11 +187,15 @@ onMounted(() => {
</a>
<div class="con">
<ul>
<li class="lessonlist-item" v-for="item in courselist" :key="item">
<img :src="img" class="lessonlist-item-img" />
<li
class="lessonlist-item"
v-for="item in courselist"
:key="item.id"
>
<img :src="item.img || fe" class="lessonlist-item-img" />
<div class="lessonlist-item-info">
<h5>{{ courseName }}</h5>
<p>{{ courseTea }}</p>
<h5>{{ item.name }}</h5>
<p>{{ item.teacher }}</p>
</div>
</li>
</ul>
@ -227,10 +247,12 @@ onMounted(() => {
justify-content: space-between;
}
.lesson {
// background-color: pink;
padding-top: 5px;
background-color: pink;
padding-top: 30px;
// padding-bottom: 30px;
padding: 30px 10px 0px 10px;
margin-bottom: 16px;
height: 290px;
height: 317px;
background: #ffffff;
box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.1);
border-radius: 6px 6px 6px 6px;
@ -261,6 +283,7 @@ onMounted(() => {
line-height: 30px;
margin: 5px 10px;
border: 2px solid #ccc;
width: 40%;
}
a {
text-decoration: none;
@ -313,13 +336,14 @@ ul {
align-items: center;
}
.lessonlist-item-info {
margin-left: 5px;
margin-left: 15px;
width: 80%;
height: 40px;
background-color: #ffffff;
display: flex;
flex-direction: column;
justify-content: space-evenly;
justify-content: space-between;
// align-items: flex-start;
h3 {
font-weight: bold;
}

Loading…
Cancel
Save