Browse Source

feat DP-1212 学习班响应式

pull/4/head
Wangwei 2 years ago
parent
commit
d6b93cecbf
  1. 24
      src/assets/css/base.css
  2. 17
      src/assets/css/m.css
  3. BIN
      src/assets/img/fcrp2022.png
  4. 28
      src/components/banner.vue
  5. 6
      src/router.js
  6. 19
      src/utils/advertisementSDK.js
  7. 342
      src/views/class/class.vue
  8. 45
      src/views/class/classMenu.vue
  9. 193
      src/views/class/class_homework.vue
  10. 129
      src/views/class/class_lesson.vue
  11. 715
      src/views/class/indexClass.vue
  12. 190
      src/views/class/play.vue
  13. 280
      src/views/video/indexVideo.vue

24
src/assets/css/base.css

@ -120,6 +120,14 @@ a:hover {
flex-direction: row;
}
/* 列表 */
.flex-7 {
display: flex;
justify-content: space-between;
flex-wrap: wrap;
}
/* 文字居中 */
.font-center {
@ -407,6 +415,9 @@ a:hover {
.colf26 {
color: #f26c4f;
}
.colffa {
color: #ffa940;
}
.col28c {
color: #28c346;
@ -414,12 +425,21 @@ a:hover {
.col27c {
color: #27c346;
}
.col52c {
color: #52c41a;
}
.col333 {
color: #333;
}
.col000 {
color: #000;
}
.col808 {
color: #808696;
}
.col515 {
color: #515a6e;
}
.mt24 {
margin-top: 24px;
@ -566,10 +586,10 @@ a:hover {
width: 200px;
height: 44px;
line-height: 44px;
background: linear-gradient(270deg, #FF7C6B 0%, #FF4B72 100%);
background: linear-gradient(270deg, #ff7c6b 0%, #ff4b72 100%);
border-radius: 8px;
}
.btn-hot:hover{
.btn-hot:hover {
color: #fff;
}

17
src/assets/css/m.css

@ -3,7 +3,7 @@
width: 100%;
padding: 0 20px;
}
.m-pd20{
.m-pd20 {
padding: 0 20px;
}
@ -31,8 +31,18 @@
.m-db {
display: block !important;
}
.m-f12{font-size: 12px !important;}
.m-f14{font-size: 14px !important;}
.m-f12 {
font-size: 12px !important;
}
.m-f14 {
font-size: 14px !important;
}
.m-bd-box {
width: 100%;
background: #fff;
border-radius: 8px;
border: 1px solid #ceddf2;
}
}
@media screen and (max-width: 800px) {
@ -48,7 +58,6 @@
--van-red: #0082fc;
}
// 移动端
@media screen and (max-width: 500px) {
.m-dn-500 {

BIN
src/assets/img/fcrp2022.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 536 KiB

28
src/components/banner.vue

@ -112,15 +112,7 @@
</div>
<div class="mbg ad-m dn">
<a :href="cover.click_url" target="_blank">
<el-image :src="cover.img_url" style=" width: 100%; position: static">
<template #error>
<div style="width: 100%; height: 200px;" class="flex-5">
<i class="el-icon-loading f24 colb3c"></i>
</div>
</template>
</el-image>
</a>
<div id="AD-M-1d4b2f969fcd43a99205e88c53b05d8d"></div>
</div>
</template>
@ -155,7 +147,20 @@ export default {
// fetchgetCover();
// banner 广
let needMobile = document.body.clientWidth < 1200;
if (needMobile) {
window.fineAd.getAdvertisement({ adId: "1d4b2f969fcd43a99205e88c53b05d8d", needMobile: needMobile, className: "ad-m-banner" });
} else {
window.fineAd.getAdvertisement({ adId: "1d4b2f969fcd43a99205e88c53b05d8d" });
}
window.addEventListener("resize", function() {
let needMobile = document.body.clientWidth < 1200;
if (needMobile) {
window.fineAd.getAdvertisement({ adId: "1d4b2f969fcd43a99205e88c53b05d8d", needMobile: needMobile, className: "ad-m-banner", resize: true });
} else {
window.fineAd.getAdvertisement({ adId: "1d4b2f969fcd43a99205e88c53b05d8d", resize: true });
}
});
const fetchgetcateHot = async (class1) => {
const res = await getcateHot(class1);
@ -425,5 +430,10 @@ export default {
margin: 0 auto;
display: block;
}
::v-deep .ad-m-banner {
width: 100% !important;
height: auto !important;
border-radius: 8px;
}
}
</style>

6
src/router.js

@ -73,6 +73,7 @@ const routes = [
component: () => import('@/views/class/indexClass.vue'),
meta: {
title: '学习班 - 帆软学院',
isMobile: 1,
},
},
@ -86,6 +87,7 @@ const routes = [
meta: {
title: '课程章节 - 学习班',
active: 'class',
isMobile: 1,
},
children: [
{
@ -96,6 +98,7 @@ const routes = [
title: '课程章节 - 学习班',
active: 'class',
tab: 'class_lesson',
isMobile: 1,
},
},
{
@ -105,6 +108,7 @@ const routes = [
meta: {
title: '我的作业 - 学习班',
active: 'class',
isMobile: 1,
},
},
{
@ -115,6 +119,7 @@ const routes = [
title: '班级论坛 - 学习班',
active: 'class',
tab: 'class_forum',
isMobile: 1,
},
},
{
@ -125,6 +130,7 @@ const routes = [
title: '班级论坛 - 学习班',
active: 'class',
tab: 'class_forum',
isMobile: 1,
},
},
],

19
src/utils/advertisementSDK.js

@ -32,11 +32,16 @@ const config = ({ debug = false, dev = false, adApiUrl }) => {
* @param adId2 如果adId没有匹配到则显示第二个广告位
* @param top 顶边距
* @param bottom 底边距
* @param needMobile 兼容移动端ID显示广告
* @param className 样式名称
*/
const getAdvertisement = async ({adId, adId2, top, bottom}) => {
const getAdvertisement = async ({adId, adId2, top, bottom, needMobile, className, resize = false}) => {
const { debug, dev } = fineAd.options;
const dataPath = dev ? 'test' : 'prod';
await axios.get("https://shequ-oss.obs.cn-east-2.myhuaweicloud.com/digit/ad/data/" + dataPath + "/advertisement.json?v=" + Date.now())
const getClassName = className ? `class="${className}"` : '';
const dateNow = resize ? '1' : Date.now();
fineAd.options.domId = needMobile ? 'AD-M-' : 'AD-';
await axios.get("https://shequ-oss.obs.cn-east-2.myhuaweicloud.com/digit/ad/data/" + dataPath + "/advertisement.json?v=" + dateNow)
.then(function (res) {
var isAdId = false;
res.data.forEach((item) => {
@ -49,9 +54,11 @@ const getAdvertisement = async ({adId, adId2, top, bottom}) => {
console.log('picSize',getSize);
console.log('top',top);
console.log('bottom',bottom);
console.log('className',className);
console.log('needMobile',needMobile);
console.groupEnd();
}
let adDomId = document.getElementById('AD-' + adId);
let adDomId = document.getElementById(fineAd.options.domId + adId);
adDomId.innerHTML='';
window.fineAd.adMargin({ adId:adId, top:top });
// 无链接图片广告
@ -60,7 +67,7 @@ const getAdvertisement = async ({adId, adId2, top, bottom}) => {
}
// 有链接图片广告
if(item.adLink && item.type===1){
adDomId.innerHTML+=`<a onClick="window.fineAd.advertisementHits('${adId}');" href="${item.adLink}" target="_blank"><img width="${getSize.w}" height="${getSize.h}" src="${item.picUrl}"></a>`;
adDomId.innerHTML+=`<a onClick="window.fineAd.advertisementHits('${adId}');" href="${item.adLink}" target="_blank"><img ${getClassName} width="${getSize.w}" height="${getSize.h}" src="${item.picUrl}"></a>`;
}
// 有链接文本广告
if(item.adLink && item.type===2){
@ -84,7 +91,7 @@ const getAdvertisement = async ({adId, adId2, top, bottom}) => {
console.log('bottom',bottom);
console.groupEnd();
}
let adDomId = document.getElementById('AD-' + adId2);
let adDomId = document.getElementById(fineAd.options.domId + adId2);
adDomId.innerHTML='';
window.fineAd.adMargin({ adId:adId2, top:top });
// 有链接图片广告
@ -112,7 +119,7 @@ const getAdvertisement = async ({adId, adId2, top, bottom}) => {
* @param bottom 底边距
*/
const adMargin = ({ adId, top = 0, bottom = 0 }) => {
let adDomId = document.getElementById('AD-' + adId);
let adDomId = document.getElementById(fineAd.options.domId + adId);
if(top > 0){
adDomId.innerHTML+=`<div style="height:${top}px;"></div>`;
}else if(bottom > 0){

342
src/views/class/class.vue

@ -3,39 +3,54 @@
<div class="mainbox topbox">
<div class="infobox">
<div class="til flex-1">
<h1>{{topInfo.class_title}}</h1>
<div class="end_time f12 colfff flex-1" v-if="topInfo.end_time">{{topInfo.end_time}}</div>
<h1>{{ topInfo.class_title }}</h1>
<div class="end_time f12 colfff flex-1" v-if="topInfo.end_time">{{ topInfo.end_time }}</div>
</div>
<div class="ress flex-3" v-if="topInfo.progress_learning">
<div class="ressbox study-progress flex-2">
<p class="fw500">我的学习进度 {{topInfo.progress_learning.progress}}/{{topInfo.progress_learning.total}}</p>
<el-progress class="progress" :show-text="false" color="#0082FC" :percentage="topInfo.proLearning">
</el-progress>
<p class="fw500 my-progress-text">我的学习进度 {{ topInfo.progress_learning.progress }}/{{ topInfo.progress_learning.total }}</p>
<el-progress class="progress" :show-text="false" color="#0082FC" :percentage="topInfo.proLearning"> </el-progress>
<div class="last-class f12 flex-1">
<span class="col617">上次学至</span>
<a class="last-til col008" :href="'play/'+classid+'/'+topInfo.last_study.lid">
<el-tooltip class="item" effect="dark" :content="'点击继续学习:'+topInfo.last_study.title" placement="bottom">
<span>{{topInfo.last_study.title}}</span>
<a class="last-til col008" :href="'play/' + classid + '/' + topInfo.last_study.lid">
<el-tooltip class="item" effect="dark" :content="'点击继续学习:' + topInfo.last_study.title" placement="bottom">
<span>{{ topInfo.last_study.title }}</span>
</el-tooltip>
</a>
</div>
</div>
<div class="ressbox task-progress flex-2">
<p class="fw500">我的作业进度 {{topInfo.progress_homework.progress}}/{{topInfo.progress_homework.total}}</p>
<el-progress class="progress" :show-text="false" color="#27C346" :percentage="topInfo.proHomework">
</el-progress>
<p class="fw500 my-progress-text">我的作业进度 {{ topInfo.progress_homework.progress }}/{{ topInfo.progress_homework.total }}</p>
<el-progress class="progress" :show-text="false" color="#27C346" :percentage="topInfo.proHomework"> </el-progress>
<div class="meta flex-1">
<div class="li col617 flex-1" style="margin-right: 38px;"><span>我的作业平均分</span>
<strong>{{topInfo.average}}</strong>
<div class="li col617 flex-1" style="margin-right: 38px;">
<span>我的作业平均分</span>
<strong>{{ topInfo.average }}</strong>
</div>
<div class="li col617 flex-1"><span>班级排名</span> <strong>{{topInfo.class_rank}}</strong></div>
<div class="li col617 flex-1">
<span>班级排名</span> <strong>{{ topInfo.class_rank }}</strong>
</div>
</div>
</div>
</div>
<div>
</div>
<div></div>
</div>
</div>
<div class="mainbox mian-news-box" v-if="isAuth && com_user_token && classNews.length > 0">
<div class="m-bd-box dn m-db">
<div class="clss-news-box">
<h3 class="til">课程须知</h3>
<ul class="flex-7 ul-box">
<li class="item" v-for="(item, i) in classNews" :key="i">
<a v-if="item.url" :href="item.url" target="_blank" class="col008 f12">
<div v-html="item.title" class="hide-txt"></div>
</a>
<div v-else><span v-html="item.title" class="hide-txt"></span></div>
</li>
</ul>
</div>
</div>
</div>
@ -47,43 +62,28 @@
<div class="listbox flex-3">
<!-- 左侧布局 -->
<div class="lf-box">
<div v-if="topInfo.teacher===1">
<el-menu :router="true" :default-active=" $route.name === 'class_lesson' ? `/class/${classid}` : 0"
class="el-menu-demo" mode="horizontal" text-color="#617288" active-text-color="#0082fc">
<!--
<el-menu-item><a :href="'https://bbs.fanruan.com/classroom/'+classid+'/student'" target="_blank">学生管理</a></el-menu-item>
<el-menu-item><a :href="'https://bbs.fanruan.com/classroom/'+classid+'/homework'" target="_blank">批改作业</a></el-menu-item>
<el-menu-item><a :href="'https://bbs.fanruan.com/classroom/'+classid+'/schedule'" target="_blank">教学进度管理</a></el-menu-item>
<el-menu-item><a :href="'https://bbs.fanruan.com/classroom/'+classid+'/board'" target="_blank">公告栏管理</a></el-menu-item> -->
<el-menu-item :index="'/class/'+classid" :class="$route.name === 'class_lesson' ? 'is-active':'' ">课程章节
</el-menu-item>
<el-menu-item :index="'/class/admin/student/'+classid"
:class="$route.name === 'student_admin_class' ? 'is-active':'' ">学生管理</el-menu-item>
<el-menu-item :index="'/class/admin/homework/'+classid"
:class="$route.name === 'homework_admin_class' ? 'is-active':'' ">批改作业</el-menu-item>
<el-menu-item :index="'/class/admin/schedule/'+classid"
:class="$route.name === 'schedule_admin_class' ? 'is-active':'' ">教学进度管理</el-menu-item>
<el-menu-item :index="'/class/admin/notice/'+classid"
:class="$route.name === 'notice_admin_class' ? 'is-active':'' ">公告栏管理</el-menu-item>
<div v-if="topInfo.teacher === 1">
<el-menu :router="true" :default-active="$route.name === 'class_lesson' ? `/class/${classid}` : 0" class="el-menu-demo" mode="horizontal" text-color="#617288" active-text-color="#0082fc">
<el-menu-item :index="'/class/' + classid" :class="$route.name === 'class_lesson' ? 'is-active' : ''">课程章节 </el-menu-item>
<el-menu-item :index="'/class/admin/student/' + classid" :class="$route.name === 'student_admin_class' ? 'is-active' : ''" v-if="isPc">学生管理</el-menu-item>
<el-menu-item :index="'/class/admin/homework/' + classid" :class="$route.name === 'homework_admin_class' ? 'is-active' : ''" v-if="isPc">批改作业</el-menu-item>
<el-menu-item :index="'/class/admin/schedule/' + classid" :class="$route.name === 'schedule_admin_class' ? 'is-active' : ''" v-if="isPc">教学进度管理</el-menu-item>
<el-menu-item :index="'/class/admin/notice/' + classid" :class="$route.name === 'notice_admin_class' ? 'is-active' : ''" v-if="isPc">公告栏管理</el-menu-item>
</el-menu>
</div>
<div v-else>
<el-menu :router="true" :default-active=" $route.name === 'class_lesson' ? `/class/${classid}` : 0"
class="el-menu-demo" mode="horizontal" text-color="#617288" active-text-color="#0082fc">
<el-menu-item :index="'/class/'+classid" :class="$route.name === 'class_lesson' ? 'is-active':'' ">课程章节
</el-menu-item>
<el-menu-item :index="'/class/homework/'+classid"
:class="$route.name === 'class_homework' ? 'is-active':'' ">我的作业</el-menu-item>
<el-menu-item index="4"><a :href="certId? com_cert_url+'/detail/'+certId : com_cert_url" target="_blank" style="vertical-align: top;">相关认证</a></el-menu-item>
<el-menu :router="true" :default-active="$route.name === 'class_lesson' ? `/class/${classid}` : 0" class="el-menu-demo" mode="horizontal" text-color="#617288" active-text-color="#0082fc">
<el-menu-item :index="'/class/' + classid" :class="$route.name === 'class_lesson' ? 'is-active' : ''">课程章节 </el-menu-item>
<el-menu-item :index="'/class/homework/' + classid" :class="$route.name === 'class_homework' ? 'is-active' : ''">我的作业</el-menu-item>
<li class="el-menu-item"><a :href="certId ? com_cert_url + '/detail/' + certId : com_cert_url" target="_blank" style="vertical-align: top;">相关认证</a></li>
</el-menu>
</div>
<router-view />
</div>
<!-- 右侧布局 -->
<div class="rt-box">
<classRight @getCertId="getCertId"/>
<div class="rt-box m-dn">
<classRight @getCertId="getCertId" />
</div>
</div>
</div>
</div>
@ -91,24 +91,21 @@
<div v-else>
<el-empty :image-size="200" :description="msg" v-if="empty"></el-empty>
</div>
</template>
<script>
import { useRoute } from 'vue-router'
import { getPublicTop } from "@/api/study";
import { reactive, toRefs } from "vue";
import classRight from "@/views/class/classRight.vue";
import msgLogin from "@/components/msgLogin";
export default {
import { useRoute } from "vue-router";
import { getPublicTop, getClassInfo } from "@/api/study";
import { reactive, toRefs } from "vue";
import classRight from "@/views/class/classRight.vue";
import msgLogin from "@/components/msgLogin";
export default {
components: {
classRight,
msgLogin,
},
setup() {
const route = useRoute()
const route = useRoute();
const classid = route.params.classid;
const state = reactive({
topInfo: [],
@ -116,8 +113,31 @@
msg: 0,
empty: false,
certId: undefined, // id
isPc: document.body.clientWidth > 1200,
classNews: [],
needResNews: true,
});
window.addEventListener("resize", function() {
state.isPc = document.body.clientWidth > 1200;
if (!state.isPc && state.needResNews && state.classNews.length <= 0) {
resPublicRight();
}
});
const resPublicRight = async () => {
const res = await getClassInfo(classid);
if (res.code === 200) {
state.classNews = res.data["classNews"];
if (state.classNews.length <= 0) {
state.needResNews = false;
}
}
};
if (!state.isPc) {
resPublicRight();
}
const resPublicTop = async () => {
const res = await getPublicTop(classid);
if (res.code === 200) {
@ -131,7 +151,7 @@
state.isAuth = true;
}
setTimeout(function () {
setTimeout(function() {
state.topInfo.proLearning = calcProgress(res.data.progress_learning.progress, res.data.progress_learning.total);
state.topInfo.proHomework = calcProgress(res.data.progress_homework.progress, res.data.progress_homework.total);
}, 500);
@ -146,36 +166,182 @@
const getCertId = (res) => {
state.certId = res;
}
};
return {
classid,
getCertId,
calcProgress,
...toRefs(state),
};
},
};
</script>
<style lang="scss">
/*响应式-移动端*/
@import "~@/assets/css/m.css";
@media screen and (max-width: 1200px) {
.listbox {
padding: 0 20px;
}
.lf-box {
width: 100% !important;
.otile {
height: 36px !important;
h2 {
font-size: 14px !important;
font-weight: 500 !important;
}
}
}
</script>
.el-menu-item {
height: 44px !important;
line-height: 46px !important;
font-size: 16px !important;
}
.mian-news-box {
margin-bottom: 12px;
}
.clss-news-box {
padding: 12px;
.til {
font-size: 14px;
margin-bottom: 6px;
}
.ul-box {
.item {
width: 48%;
padding: 6px 0;
}
}
}
.infobox {
height: 160px;
display: flex;
justify-content: space-around;
flex-direction: column;
.til {
padding: 6px 0 12px !important;
h1 {
font-size: 18px !important;
line-height: 20px;
margin-right: 4px !important;
font-weight: 600;
}
.end_time {
height: 22px !important;
padding: 0 8px !important;
border-radius: 4px;
background: linear-gradient(90deg, #00b8fe 0%, #0082fc 100%);
}
}
.ress {
width: 100% !important;
display: block !important;
.ressbox {
width: 280px;
height: 60px !important;
.el-progress-bar__outer {
background-color: #bbd8fa;
}
&.study-progress {
margin-bottom: 12px;
}
.my-progress-text {
font-size: 12px;
}
.last-til {
display: inline-block;
padding-left: 8px;
width: 230px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.meta {
.li {
span {
padding-right: 10px;
font-size: 12px;
}
strong {
font-weight: 500;
font-size: 18px;
color: #333;
}
}
}
}
}
}
}
</style>
<style lang="scss">
@media screen and (max-width: 600px) {
.topbox {
background: #f1f8ff right center no-repeat !important;
}
.clss-news-box {
.ul-box {
.item {
width: 98% !important;
}
}
}
.lf-box {
width: 100% !important;
.otile {
height: 36px !important;
h2 {
display: inline-block;
width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-size: 14px !important;
font-weight: 500 !important;
}
.til-rt-info {
display: none;
}
}
}
}
</style>
<style lang="scss" scoped>
.main {
.main {
width: 100%;
height: 204px;
background: #F1F8FF;
background: #f1f8ff;
margin-bottom: 24px;
}
}
.topbox {
.topbox {
height: 204px;
display: flex;
align-items: center;
background: #F1F8FF url("~@/assets/class/classtop.png") right center no-repeat;
background: #f1f8ff url("~@/assets/class/classtop.png") right center no-repeat;
background-size: auto 100%;
}
}
.infobox {
.infobox {
height: 160px;
display: flex;
justify-content: space-around;
@ -194,9 +360,8 @@
height: 24px;
padding: 0 10px;
border-radius: 4px;
background: linear-gradient(90deg, #00B8FE 0%, #0082FC 100%);
background: linear-gradient(90deg, #00b8fe 0%, #0082fc 100%);
}
}
.ress {
@ -207,7 +372,7 @@
height: 68px;
.el-progress-bar__outer {
background-color: #BBD8FA;
background-color: #bbd8fa;
}
.last-til {
@ -232,31 +397,28 @@
color: #333;
}
}
}
}
}
}
}
.rt-box {
.rt-box {
margin-top: 56px;
}
}
::v-deep .edu-nav-box {
::v-deep .edu-nav-box {
box-shadow: none;
}
}
/* menu */
.el-menu-item {
/* menu */
.el-menu-item {
height: 56px;
line-height: 56px;
font-size: 20px;
border-bottom: none !important;
}
}
.el-menu-item.is-active::after {
.el-menu-item.is-active::after {
content: "";
position: absolute;
width: 50%;
@ -265,20 +427,20 @@
bottom: -1px;
background-color: #0082fc;
height: 2px;
}
}
.el-tabs__nav-wrap::after {
background-color: #CEDDF2;
.el-tabs__nav-wrap::after {
background-color: #ceddf2;
height: 1px;
}
}
.el-menu.el-menu--horizontal {
border-bottom: solid 1px #CEDDF2;
}
.el-menu.el-menu--horizontal {
border-bottom: solid 1px #ceddf2;
}
</style>
<style>
.ressbox .el-progress-bar__outer {
background-color: #BBD8FA;
}
.ressbox .el-progress-bar__outer {
background-color: #bbd8fa;
}
</style>

45
src/views/class/classMenu.vue

@ -1,34 +1,33 @@
<template>
<el-menu :router="true" :default-active=" $route.name === 'class_lesson' ? `/class/${classid}` : 0" class="el-menu-demo" mode="horizontal" text-color="#617288" active-text-color="#0082fc">
<el-menu-item :index="'/class/'+classid" :class="$route.name === 'class_lesson' ? 'is-active':'' ">课程章节</el-menu-item>
<el-menu-item :index="'/class/homework/'+classid" :class="$route.name === 'class_homework' ? 'is-active':'' ">我的作业</el-menu-item>
<el-menu-item index="4"><a :href="com_shequ_url+'/certification'" target="_blank">相关认证</a></el-menu-item>
<el-menu :router="true" :default-active="$route.name === 'class_lesson' ? `/class/${classid}` : 0" class="el-menu-demo" mode="horizontal" text-color="#617288" active-text-color="#0082fc">
<el-menu-item :index="'/class/' + classid" :class="$route.name === 'class_lesson' ? 'is-active' : ''">课程章节</el-menu-item>
<el-menu-item :index="'/class/homework/' + classid" :class="$route.name === 'class_homework' ? 'is-active' : ''">我的作业</el-menu-item>
<el-menu-item><a :href="com_shequ_url + '/certification'" target="_blank">相关认证</a></el-menu-item>
</el-menu>
</template>
<script>
import { useRoute } from 'vue-router'
export default{
import { useRoute } from "vue-router";
export default {
setup() {
const route = useRoute()
const route = useRoute();
const classid = route.params.classid;
return{
classid
}
}
}
return {
classid,
};
},
};
</script>
<style lang="scss" scoped>
.el-menu-item {
.el-menu-item {
height: 56px;
line-height: 56px;
font-size: 20px;
border-bottom: none !important;
}
}
.el-menu-item.is-active::after {
.el-menu-item.is-active::after {
content: "";
position: absolute;
width: 50%;
@ -37,14 +36,14 @@
bottom: -1px;
background-color: #0082fc;
height: 2px;
}
}
.el-tabs__nav-wrap::after {
background-color: #CEDDF2;
.el-tabs__nav-wrap::after {
background-color: #ceddf2;
height: 1px;
}
}
.el-menu.el-menu--horizontal {
border-bottom: solid 1px #CEDDF2;
}
.el-menu.el-menu--horizontal {
border-bottom: solid 1px #ceddf2;
}
</style>

193
src/views/class/class_homework.vue

@ -1,5 +1,4 @@
<template>
<el-skeleton :loading="loading" animated>
<template #template>
<el-skeleton-item variant="h1" style="margin-top: 24px;" animated />
@ -7,8 +6,7 @@
</template>
<template #default>
<table class="worktab">
<table class="worktab" v-if="isPc">
<tr>
<th style=" border-radius: 8px 0 0 8px ;">作业列表</th>
<th width="120">作业得分</th>
@ -18,62 +16,95 @@
<tr v-for="(item, i) in looplist" :key="i">
<td>
<a :href="com_shequ_url+'/classroom/download/'+classid+'/'+item.id" target="_blank">
<i class="iconfont icon-icon_attachment"></i> {{item.title}}
</a>
<a :href="com_shequ_url + '/classroom/download/' + classid + '/' + item.id" target="_blank"> <i class="iconfont icon-icon_attachment"></i> {{ item.title }} </a>
</td>
<td>
<div class="colff3" v-if="item.zuoye?.fenshu">{{item.zuoye?.fenshu}}</div>
<div class="colff3" v-if="item.zuoye?.fenshu">{{ item.zuoye?.fenshu }}</div>
<div class="col617" v-else>--</div>
</td>
<td>
<div class="ptlist">
<li v-for="(item, i) in item.data" :key="i">
{{item.post_time}}
{{ item.post_time }}
<el-tooltip :content="item.til" placement="left">
<a :href="item.obsurl" target="_blank" class="col008" v-if="item.obsurl">
查看作业
</a>
<a :href="com_shequ_url+'/plugin.php?id=fr_class:dload&lod='+item.downloadId+'&kid='+classid"
target="_blank" class="col008" v-else>
<a :href="com_shequ_url + '/plugin.php?id=fr_class:dload&lod=' + item.downloadId + '&kid=' + classid" target="_blank" class="col008" v-else>
查看作业
</a>
</el-tooltip>
</li>
</div>
<el-upload class="upload-demo"
:action="'/v1/edu/studyclass/postHomeWork/'+classid+'/?filetype=file&pid='+item.pid+'&zid='+item.id"
:headers="headers" :on-success="UploadSuccess">
<el-button size="mini" class="frbtn min-pd"><i class="iconfont icon-shangchuan1 ico-lf f14"></i>提交作业
</el-button>
<el-upload class="upload-demo" :action="'/v1/edu/studyclass/postHomeWork/' + classid + '/?filetype=file&pid=' + item.pid + '&zid=' + item.id" :headers="headers" :on-success="UploadSuccess">
<el-button size="mini" class="frbtn min-pd"><i class="iconfont icon-shangchuan1 ico-lf f14"></i>提交作业 </el-button>
</el-upload>
</td>
<td class="ifprt">
<div class="f14" v-if="item.zuoye?.info.length>50">
<div class="f14" v-if="item.zuoye?.info.length > 50">
<div class="cur-p" @click="setItem(item)">
{{item.zuoye?.info.substring(0,30)}}...
{{ item.zuoye?.info.substring(0, 30) }}...
<em class="col008">查看详情</em>
</div>
</div>
<div class="f14" v-else>
{{item.zuoye?.info}}
{{ item.zuoye?.info }}
</div>
</td>
</tr>
</table>
<!-- 移动端 -->
<div class="my-work" v-else>
<ul>
<li class="item m-bd-box" v-for="(item, i) in looplist" :key="i">
<div class="t-plate">
<a class="til f14" :href="com_shequ_url + '/classroom/download/' + classid + '/' + item.id" target="_blank">
<div class="hide-txt"><i class="iconfont icon-icon_attachment"></i> {{ item.title }}</div>
</a>
<el-upload class="upload-demo" :action="'/v1/edu/studyclass/postHomeWork/' + classid + '/?filetype=file&pid=' + item.pid + '&zid=' + item.id" :headers="headers" :on-success="UploadSuccess">
<el-button size="mini" class="frbtn min-pd"><i class="iconfont icon-shangchuan1 ico-lf f14"></i>提交作业 </el-button>
</el-upload>
<div class="ptlist">
<li v-for="(item, i) in item.data" :key="i">
{{ item.post_time }}
<el-tooltip :content="item.til" placement="left">
<a :href="item.obsurl" target="_blank" class="col008" v-if="item.obsurl">
查看作业
</a>
<a :href="com_shequ_url + '/plugin.php?id=fr_class:dload&lod=' + item.downloadId + '&kid=' + classid" target="_blank" class="col008" v-else>
查看作业
</a>
</el-tooltip>
</li>
</div>
</div>
<div class="b-plate">
<div class="col808 f14">
作业得分
<span class="col515" v-if="item.zuoye?.fenshu">{{ item.zuoye?.fenshu }}</span>
<span class="col515" v-else>--</span>
</div>
<div class="col808 f14">
老师评语
<div class="col515" v-if="item.zuoye?.info">{{ item.zuoye?.info }}</div>
<div class="col515" v-else>暂无评语</div>
</div>
</div>
</li>
</ul>
</div>
</template>
</el-skeleton>
<el-dialog title="老师评语" v-model="isShowItem" width="600px">
<el-scrollbar>
<div class="infobox">
{{item.zuoye.info}}
{{ item.zuoye.info }}
</div>
</el-scrollbar>
</el-dialog>
@ -81,19 +112,18 @@
<el-empty :image-size="150" description=" " v-if="isdata">
<div class="col617">当前班级下暂无作业</div>
</el-empty>
</template>
<script>
import { useRoute } from 'vue-router'
import { myHomeWork } from "@/api/study";
import { toRefs, reactive, getCurrentInstance } from 'vue';
import store from '@/store'
export default {
name: 'class_homework',
import { useRoute } from "vue-router";
import { myHomeWork } from "@/api/study";
import { toRefs, reactive, getCurrentInstance } from "vue";
import store from "@/store";
export default {
name: "class_homework",
setup() {
const { proxy } = getCurrentInstance()
const route = useRoute()
const { proxy } = getCurrentInstance();
const route = useRoute();
const classid = route.params.classid;
const state = reactive({
looplist: [],
@ -106,9 +136,14 @@
isdata: false,
loading: true,
headers: {
'authentication': store.getters.get_authentication
authentication: store.getters.get_authentication,
},
})
isPc: document.body.clientWidth > 1200,
});
window.addEventListener("resize", function() {
state.isPc = document.body.clientWidth > 1200;
});
const reshomeWork = async () => {
const res = await myHomeWork(classid);
@ -131,30 +166,60 @@
// item
const setItem = (item) => {
state.item = item
state.isShowItem = true
}
state.item = item;
state.isShowItem = true;
};
const UploadSuccess = (res) => {
proxy.$message({
type: res.status=='-1' ? 'error' : 'success',
type: res.status == "-1" ? "error" : "success",
message: res.message,
center: true
center: true,
});
}
};
return {
classid,
...toRefs(state),
setItem,
UploadSuccess,
};
},
};
</script>
<style lang="scss">
/*响应式-pad端*/
@media screen and (max-width: 1200px) {
.my-work {
width: 100%;
.item {
margin-top: 16px;
.t-plate {
padding: 12px;
line-height: 24px;
.til {
margin-bottom: 6px;
}
}
.b-plate {
line-height: 24px;
padding: 12px;
border-top: 1px solid #ceddf2;
}
</script>
}
}
}
</style>
<style lang="scss">
/*响应式-移动端*/
@media screen and (max-width: 600px) {
}
</style>
<style lang="scss" scoped>
.worktab {
.worktab {
width: 100%;
margin-top: 24px;
@ -163,7 +228,7 @@
font-size: 14px;
padding-left: 18px;
text-align: left;
background: #F3F8FF;
background: #f3f8ff;
border-collapse: separate;
}
@ -171,15 +236,15 @@
height: 60px;
padding: 16px 0 16px 18px;
text-align: left;
border-bottom: 1px solid #CEDDF2;
border-bottom: 1px solid #ceddf2;
}
tr:hover {
background-color: #F3F8FF;
}
background-color: #f3f8ff;
}
}
.ptlist {
.ptlist {
padding: 6px 0;
overflow-y: auto;
font-size: 14px;
@ -187,41 +252,41 @@
li {
padding: 2px 0;
}
}
}
.ifprt {
.ifprt {
padding-right: 10px !important;
}
}
.infobox {
.infobox {
line-height: 24px;
padding: 0 20px;
}
}
.scrollbar {
.scrollbar {
height: 106px;
overflow: hidden;
}
}
.min-pd {
.min-pd {
padding: 6px 10px;
}
}
::v-deep .el-scrollbar__wrap {
::v-deep .el-scrollbar__wrap {
max-height: 300px;
overflow-x: hidden;
}
}
::v-deep .el-icon-close {
::v-deep .el-icon-close {
display: none !important;
}
::v-deep .el-icon-close-tip {
}
::v-deep .el-icon-close-tip {
display: none !important;
}
}
</style>
<style>
.el-dialog__body {
.el-dialog__body {
padding: 20px 30px 30px 30px;
}
}
</style>

129
src/views/class/class_lesson.vue

@ -1,5 +1,4 @@
<template>
<el-skeleton :loading="loading" animated>
<template #template>
<el-skeleton-item variant="h1" style="margin-top: 24px;" animated />
@ -15,70 +14,74 @@
<el-skeleton-item variant="h3" style="width: 20px; margin-right: 12px;" animated />
<el-skeleton-item variant="h3" style="width: 80%" animated />
</div>
</template>
<template #default>
<div class="lesson">
<div class="looplist" v-for="(item, i) in lessonList" :key="i">
<div class="otile flex-1">
<h2>{{item.title}}</h2>
<span>{{item.num_video}}课时 {{item.video_time}}</span>
<h2>{{ item.title }}</h2>
<span class="til-rt-info">{{ item.num_video }}课时 {{ item.video_time }}</span>
</div>
<div v-if="item.video.length===0" class="novideo col617">等待老师发布...</div>
<div v-if="item.video.length === 0" class="novideo col617">等待老师发布...</div>
<ul class="vlist">
<li class="item" v-for="(item, i) in item.video" :key="i">
<router-link class="a-play flex-1" :to="'/class/play/'+classid+'/'+item.id">
<router-link class="a-play flex-1" :to="'/class/play/' + classid + '/' + item.id">
<i class="iconfont icon-bofang2"></i>
<div class="vdtitle" v-if="item.title.length > 40">{{item.title.substring(0,40)}}...</div>
<div class="vdtitle" v-else>{{item.title}}</div>
<div class="vdtitle" v-if="item.title.length > 40">{{ item.title.substring(0, 40) }}...</div>
<div class="vdtitle" v-else>{{ item.title }}</div>
<div class="progress" v-if="item.play_progress">
<el-progress :show-text="false" color="#0082FC" :percentage="item.progress"></el-progress>
<span :style="'left:'+item.progress+'%'">
<div v-if="item.play_progress===100">已看完</div>
<div v-else>{{item.progress}}%</div>
<span :style="'left:' + item.progress + '%'">
<div v-if="item.play_progress === 100">已看完</div>
<div v-else>{{ item.progress }}%</div>
<i class="el-icon-caret-bottom"></i>
</span>
</div>
</router-link>
<div class="rtinfo flex-1">
<el-tooltip v-if="item.attachmentId" effect="dark" content="下载课件" placement="top">
<a class="zip" :href="'https://bbs.fanruan.com/classroom/download/'+classid+'/'+item.attachmentId"
target="_blank"></a>
<a class="zip" :href="'https://bbs.fanruan.com/classroom/download/' + classid + '/' + item.attachmentId" target="_blank"></a>
</el-tooltip>
<div class="time">{{item.videoTime}}</div>
<div v-if="isMobile">
<div v-if="item.progress" class="f12">
<div v-if="item.play_progress === 100" class="col52c">已看完</div>
<div v-else class="colffa">已看 {{ item.play_progress }}%</div>
</div>
<div class="time" v-else>{{ item.videoTime }}</div>
</div>
<div class="time" v-else>{{ item.videoTime }}</div>
</div>
</li>
</ul>
</div>
</div>
</template>
</el-skeleton>
</template>
<script>
import { useRoute } from 'vue-router'
import { getLessonList } from "@/api/study";
import { toRefs, reactive } from 'vue';
export default {
name: 'listLesson',
import { useRoute } from "vue-router";
import { getLessonList } from "@/api/study";
import { toRefs, reactive } from "vue";
export default {
name: "listLesson",
setup() {
const route = useRoute()
const route = useRoute();
const classid = route.params.classid;
const state = reactive({
lessonList: [],
activeIndex: 1,
loading: true,
})
isMobile: document.body.clientWidth < 600,
});
window.addEventListener("resize", function() {
state.isMobile = document.body.clientWidth < 600;
});
const resLessonList = async () => {
const res = await getLessonList(classid);
@ -87,7 +90,7 @@
state.loading = false;
state.lessonList.forEach((item, index) => {
state.lessonList[index].video.forEach((item, i) => {
setTimeout(function () {
setTimeout(function() {
state.lessonList[index].video[i].progress = item.play_progress;
}, 500);
});
@ -96,23 +99,65 @@
};
resLessonList();
return {
classid,
...toRefs(state),
};
},
};
</script>
<style lang="scss">
/*响应式-移动端*/
@media screen and (max-width: 1200px) {
.looplist {
.vlist {
.item {
padding-left: 6px;
}
}
}
</script>
}
</style>
<style lang="scss" scoped>
<style lang="scss">
/*响应式-移动端*/
@media screen and (max-width: 600px) {
.looplist {
.vlist {
.item {
.progress {
display: none;
}
.a-play {
width: 80%;
.vdtitle {
display: inline-block;
width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
.rtinfo {
.zip {
margin-left: 2px !important;
}
}
}
}
}
}
</style>
<style lang="scss" scoped>
.looplist {
margin-top: 24px;
.otile {
padding: 0 18px;
height: 40px;
background: #F3F8FF;
background: #f3f8ff;
border-radius: 8px;
h2 {
@ -123,7 +168,7 @@
span {
margin-left: 18px;
font-size: 14px;
color: #7E8FA3;
color: #7e8fa3;
}
}
@ -144,7 +189,6 @@
border-bottom: none;
}
.a-play {
padding: 26px 0;
border-radius: 6px;
@ -156,7 +200,7 @@
.icon-bofang2 {
font-size: 14px;
color: #B3C1D3;
color: #b3c1d3;
margin-right: 12px;
}
@ -165,7 +209,6 @@
width: 100px;
position: relative;
span {
text-align: center;
position: absolute;
@ -178,7 +221,7 @@
background: #0082fc;
border-radius: 3px;
padding: 1px 2px;
transition: all .6s;
transition: all 0.6s;
i {
position: absolute;
@ -187,7 +230,6 @@
left: 15px;
}
}
}
.rtinfo {
@ -195,26 +237,23 @@
.zip {
display: inline-block;
background: url('~@/assets/class/zip.png');
background: url("~@/assets/class/zip.png");
background-size: 100% auto;
height: 22px;
width: 22px;
margin-right: 20px;
}
.time {
color: #7E8FA3;
color: #7e8fa3;
}
}
}
}
}
}
</style>
<style>
/* .el-progress-bar__outer {
/* .el-progress-bar__outer {
overflow: visible;
}

715
src/views/class/indexClass.vue

File diff suppressed because it is too large Load Diff

190
src/views/class/play.vue

@ -10,7 +10,7 @@
<div class="viewtil" style="min-height:8%">
<el-page-header @back="goBack" title="返回班级" :content="video.title"> </el-page-header>
</div>
<div id="VideoPlay" style=" width:100%; height: 92%; margin-top: auto;"></div>
<div id="VideoPlay" style=" width:100%; height: 92%; margin-top: auto;" :class="{ affixcss: is_scroll }"></div>
<div class="autotime" v-show="showAutoBox">
<div class="pssbox flex-5">
@ -62,7 +62,14 @@
<i class="iconfont icon-bofang2" v-else></i>
<div class="title hide-txt">{{ item.title }}</div>
<div class="time">{{ item.videoTime }}</div>
<div v-if="isMobile" class="time">
<div v-if="item.play_progress" class="f12">
<div v-if="item.play_progress === 100" class="col52c">已看完</div>
<div v-else class="colffa">已看 {{ item.play_progress }}%</div>
</div>
<div v-else>{{ item.videoTime }}</div>
</div>
<div class="time" v-else>{{ item.videoTime }}</div>
</a>
<!-- </el-tooltip> -->
</li>
@ -134,6 +141,12 @@ export default {
showAutoBox: false,
is_duration: true,
playThisId: route.params.videoid,
is_scroll: false,
isMobile: document.body.clientWidth < 1200,
});
window.addEventListener("resize", function() {
state.isMobile = document.body.clientWidth < 1200;
});
// MARKET-4168
@ -424,6 +437,15 @@ export default {
setTimeout("top.location.href = '" + target.href + "'", 100);
}
}
window.addEventListener("scroll", function() {
var scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
if (scrollTop > 50) {
state.is_scroll = true;
} else {
state.is_scroll = false;
}
});
});
onUnmounted(() => {
@ -696,3 +718,167 @@ body {
color: #0082fc;
}
</style>
<style lang="scss">
/*响应式-移动端*/
@import "~@/assets/css/m.css";
@media screen and (max-width: 1200px) {
.affix {
height: 35vh;
background-color: #fff;
}
.affixcss {
position: fixed !important;
top: 0 !important;
z-index: 8;
}
.main {
position: static !important;
.flex-2 {
display: block !important;
}
.autotime {
height: 35vh;
top: 50px;
}
#VideoPlay {
height: 35vh !important;
}
.videoBox {
position: static !important;
width: auto !important;
.viewtil {
position: absolute;
top: 0;
left: 0;
z-index: 99;
background-color: #fff;
color: #333;
height: 50px;
padding-top: 13px !important;
min-height: auto !important;
overflow: hidden;
.el-page-header__left {
min-width: 80px;
}
.el-page-header__content {
color: #333;
flex: 1;
display: inline-block;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
}
.navbox {
position: static !important;
width: 100%;
background-color: #fff;
.cate {
background-color: #fff;
color: #333;
border-bottom: solid 1px #ceddf2;
}
}
.looplist {
.otile {
border-bottom: solid 1px #ceddf2;
padding-bottom: 12px;
color: #333;
}
.vlist {
.item {
margin-left: 20px;
border-bottom: solid 1px #ceddf2;
color: #333;
.icon-bofang2 {
color: #b3c1d3 !important;
}
}
}
}
}
.nullData {
position: absolute;
z-index: 999999 !important;
top: 20vh;
font-size: 16px !important;
.ff18 {
font-size: 14px !important;
}
.medium {
padding: 6px 12px !important;
}
}
.m-footr {
margin-top: 0;
}
}
</style>
<style lang="scss">
@media screen and (max-width: 700px) {
.main {
.videoBox {
.viewtil {
width: 100%;
}
}
.looplist {
.otile {
border-bottom: solid 1px #ceddf2;
padding-bottom: 12px;
color: #333;
}
.vlist {
.item {
margin-left: 10px !important;
border-bottom: solid 1px #ceddf2;
color: #333;
.icon-bofang2 {
color: #b3c1d3 !important;
}
a {
padding: 10px 0;
width: 100%;
color: #617288;
.title {
padding-left: 6px;
width: 77% !important;
}
.time {
margin-left: auto;
}
}
}
}
}
}
}
</style>

280
src/views/video/indexVideo.vue

@ -1,21 +1,18 @@
<template>
<div v-wechat-title="class1_title+' - '+class2_title+$route.meta.title" v-if="class1_title && class2_title"></div>
<div v-wechat-title="class1_title+' - '+$route.meta.title" v-if="class1_title && !class2_title"></div>
<div v-wechat-title="class2_title+' - '+$route.meta.title" v-if="class2_title && !class1_title"></div>
<div v-wechat-title="class1_title + ' - ' + class2_title + $route.meta.title" v-if="class1_title && class2_title"></div>
<div v-wechat-title="class1_title + ' - ' + $route.meta.title" v-if="class1_title && !class2_title"></div>
<div v-wechat-title="class2_title + ' - ' + $route.meta.title" v-if="class2_title && !class1_title"></div>
<div v-wechat-title="$route.meta.title" v-if="!class1_title && !class2_title"></div>
<div class="video-page w1200 m-dn">
<div class="type">
<div class="category">
<div class="wrapper">
<span class="title">课程方向</span>
<ul>
<li class="category-item" :class="{active: query.class1 === 0}" @click="changeCategory(0)">全部</li>
<li class="category-item" v-for="(item,i) in class1_list" :key="i"
:class="{active: query.class1 === item.id}" @click="changeCategory(item.id,item.name)">
{{item.name}}
<li class="category-item" :class="{ active: query.class1 === 0 }" @click="changeCategory(0)">全部</li>
<li class="category-item" v-for="(item, i) in class1_list" :key="i" :class="{ active: query.class1 === item.id }" @click="changeCategory(item.id, item.name)">
{{ item.name }}
</li>
</ul>
</div>
@ -25,10 +22,9 @@
<div class="wrapper">
<span class="title">课程标签</span>
<ul>
<li class="category-item" :class="{active: query.class2 === 0 }" @click="changeCategory2(0)">全部</li>
<li class="category-item" v-for="(item,i) in class2_list" :key="i"
:class="{active: query.class2 === item.id}" @click="changeCategory2(item.id,item.name)">
{{item.name}}
<li class="category-item" :class="{ active: query.class2 === 0 }" @click="changeCategory2(0)">全部</li>
<li class="category-item" v-for="(item, i) in class2_list" :key="i" :class="{ active: query.class2 === item.id }" @click="changeCategory2(item.id, item.name)">
{{ item.name }}
</li>
</ul>
</div>
@ -38,16 +34,14 @@
<div class="wrapper">
<span class="title">课程价格</span>
<ul>
<li class="category-item" v-for="(item,i) in priceList" :key="i" :class="{active: query.price === item.id}"
@click="changePrice(item.id)">{{item.name}}</li>
<li class="category-item" v-for="(item, i) in priceList" :key="i" :class="{ active: query.price === item.id }" @click="changePrice(item.id)">{{ item.name }}</li>
</ul>
</div>
</div>
<div class="sort flex-1">
<div class="wrapper">
<ul>
<li class="category-item" v-for="(item,i) in sortList" :key="i" :class="{active: query.sort === item.id}"
@click="changeSort(item.id)">
<li class="category-item" v-for="(item, i) in sortList" :key="i" :class="{ active: query.sort === item.id }" @click="changeSort(item.id)">
<el-tooltip :content="item.label" placement="top">
<span>{{ item.name }} <i :class="item.icon"></i></span>
</el-tooltip>
@ -60,7 +54,6 @@
<!-- v-if="onresize > 1200" 暂时不需要这个判断 -->
<el-skeleton :loading="loading" animated class="m-dn">
<template #template>
<div class="w1200 video-page">
<div class="video-wrap">
@ -75,27 +68,21 @@
</template>
<template #default>
<div class="video-page w1200 m-dn">
<div class="video-wrap">
<ul class="video-list">
<li class="video-item" v-for="(item,i) in videoList" :key="i">
<router-link :to="'/video/'+item.id" target="_blank">
<li class="video-item" v-for="(item, i) in videoList" :key="i">
<router-link :to="'/video/' + item.id" target="_blank">
<div class="imgps">
<el-image class="img" :src="item.it618_picbig" :alt="item.it618_name"></el-image>
</div>
<h2 class="hide-txt2 f16">{{ item.it618_name }}</h2>
<div v-if="item.it618_saleprice" class="saleprice">
<span class="colff3">
<i class="f14"></i>{{item.it618_saleprice}}
</span>
<del>{{item.it618_price}}</del>
<span class="colff3"> <i class="f14"></i>{{ item.it618_saleprice }} </span>
<del>{{ item.it618_price }}</del>
</div>
<div class="tag" v-else>{{ item.it618_saleprice ? item.it618_saleprice:"免费" }}</div>
<div class="tag" v-else>{{ item.it618_saleprice ? item.it618_saleprice : "免费" }}</div>
<div class="info flex-3">
<span>{{ item.it618_videocount }}课时</span>
@ -103,35 +90,31 @@
</div>
</router-link>
</li>
<div v-if="[2,6,10,14].includes(videoList.length) " style="width: 276px;"></div>
<div v-if="[2, 6, 10, 14].includes(videoList.length)" style="width: 276px;"></div>
</ul>
</div>
<el-empty :image-size="90" description="暂无数据" v-if="videoList.length<=0">
</el-empty>
<el-empty :image-size="90" description="暂无数据" v-if="videoList.length <= 0"> </el-empty>
<div style="margin: 30px 0 10px">
<el-pagination class="pagination" v-model:currentPage="query.page" background layout="prev, pager, next"
@current-change="handleCurrentChange" :total="total" :page-size="query.perpage" />
<el-pagination class="pagination" v-model:currentPage="query.page" background layout="prev, pager, next" @current-change="handleCurrentChange" :total="total" :page-size="query.perpage" />
</div>
</div>
</template>
</el-skeleton>
<!-- 移动端 -->
<div class="tool-box-m dn m-db">
<div class="flex-3">
<div>
<el-dropdown trigger="click" style="height: 44px;" class="flex-2">
<span class="el-dropdown-link col008">
<span style="margin-right: 5px;">{{curSortName}}</span>
<span style="margin-right: 5px;">{{ curSortName }}</span>
<i class="iconfont icon-paixu f14"></i>
</span>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item class="category-item" v-for="(item,i) in sortList" :key="i"
:class="{col008: query.sort === item.id}" @click="changeSort(item.id,item.name)">
<el-dropdown-item class="category-item" v-for="(item, i) in sortList" :key="i" :class="{ col008: query.sort === item.id }" @click="changeSort(item.id, item.name)">
<span>{{ item.name }}</span>
</el-dropdown-item>
</el-dropdown-menu>
@ -139,19 +122,15 @@
</el-dropdown>
</div>
<div @click="videDrawer=true" style="height: 44px;" class="flex-1 f14 col008">
<div @click="videDrawer = true" style="height: 44px;" class="flex-1 f14 col008">
<span style="margin-right: 6px; margin-top: -2px;">筛选课程</span>
<i class="iconfont icon-shaixuan1 f14"></i>
</div>
</div>
</div>
<!-- 移动端视频列表 -->
<el-skeleton :loading="loading" animated class="dn m-db">
<template #template>
<div class="w1200 video-page">
<div class="video-wrap">
@ -171,23 +150,20 @@
<template #default>
<div class="dn m-db">
<van-list v-model:loading="loading_m" :finished="max_total" :offset="0" finished-text="没有更多了" error-text="请求失败点击重新加载" @load="loadVlist">
<div class="video-list-m">
<li class="item" v-for="(item, i) in videoList" :key="i">
<router-link :to="'/video/'+item.id" class="flex-3" target="_blank">
<router-link :to="'/video/' + item.id" class="flex-3" target="_blank">
<div class="imgps">
<el-image class="img" :src="item.it618_picbig" :alt="item.it618_name"></el-image>
</div>
<div class="rtbox">
<h2 class="hide-txt f16">{{item.it618_name}}</h2>
<h2 class="hide-txt f16">{{ item.it618_name }}</h2>
<div v-if="item.it618_saleprice" class="saleprice">
<span class="colff3">
<i class="f14"></i>{{item.it618_saleprice}}
</span>
<del>{{item.it618_price}}</del>
<span class="colff3"> <i class="f14"></i>{{ item.it618_saleprice }} </span>
<del>{{ item.it618_price }}</del>
</div>
<div class="tag" v-else>免费</div>
@ -200,26 +176,20 @@
</li>
</div>
</van-list>
</div>
</template>
</el-skeleton>
<!-- 筛选抽屉 -->
<el-drawer v-model="videDrawer" :with-header="false" title="筛选课程" direction="btt" custom-class="video-drawer"
size="86%">
<el-drawer v-model="videDrawer" :with-header="false" title="筛选课程" direction="btt" custom-class="video-drawer" size="86%">
<el-scrollbar style=" position: absolute; height: 90%; margin:14px 6px 0;" height="300" always>
<div class="category">
<div class="wrapper-video-m">
<div class="title">课程方向</div>
<ul>
<li class="category-item" :class="{active: query.class1 === 0}" @click="changeCategory(0)">全部</li>
<li class="category-item" v-for="(item,i) in class1_list" :key="i"
:class="{active: query.class1 === item.id}" @click="screening_memory(item.id,'class1')">
{{item.name}}
<li class="category-item" :class="{ active: query.class1 === 0 }" @click="changeCategory(0)">全部</li>
<li class="category-item" v-for="(item, i) in class1_list" :key="i" :class="{ active: query.class1 === item.id }" @click="screening_memory(item.id, 'class1')">
{{ item.name }}
</li>
</ul>
</div>
@ -229,10 +199,9 @@
<div class="wrapper-video-m">
<div class="title">课程标签</div>
<ul>
<li class="category-item" :class="{active: query.class2 === 0 }" @click="changeCategory2(0)">全部</li>
<li class="category-item" v-for="(item,i) in class2_list" :key="i"
:class="{active: query.class2 === item.id}" @click="screening_memory(item.id,'class2')">
{{item.name}}
<li class="category-item" :class="{ active: query.class2 === 0 }" @click="changeCategory2(0)">全部</li>
<li class="category-item" v-for="(item, i) in class2_list" :key="i" :class="{ active: query.class2 === item.id }" @click="screening_memory(item.id, 'class2')">
{{ item.name }}
</li>
</ul>
</div>
@ -242,8 +211,7 @@
<div class="wrapper-video-m">
<div class="title">课程价格</div>
<ul>
<li class="category-item" v-for="(item,i) in priceList" :key="i" :class="{active: query.price === item.id}"
@click="changePrice(item.id)">{{item.name}}</li>
<li class="category-item" v-for="(item, i) in priceList" :key="i" :class="{ active: query.price === item.id }" @click="changePrice(item.id)">{{ item.name }}</li>
</ul>
</div>
</div>
@ -251,21 +219,37 @@
<div class="vtool-foot-box">
<div class="vtool-foot-m flex-3">
<div class="chongzhi" @click="videDrawer=flase; changeCategory(0);changeCategory2(0);changePrice(0);">重置</div>
<div class="queding" @click="screening(); videDrawer=false">确定</div>
<div
class="chongzhi"
@click="
videDrawer = flase;
changeCategory(0);
changeCategory2(0);
changePrice(0);
"
>
重置
</div>
<div
class="queding"
@click="
screening();
videDrawer = false;
"
>
确定
</div>
</div>
</div>
</el-drawer>
</template>
<script>
import { reactive, toRefs } from "vue";
import { getVideoList, getCourseDirection, getCourseTag } from "@/api/video";
import { useRoute, useRouter } from 'vue-router';
import { Button, List, Cell } from 'vant';
export default {
import { reactive, toRefs } from "vue";
import { getVideoList, getCourseDirection, getCourseTag } from "@/api/video";
import { useRoute, useRouter } from "vue-router";
import { Button, List, Cell } from "vant";
export default {
name: "videoindex",
components: {
[Button.name]: Button,
@ -273,8 +257,8 @@
[Cell.name]: Cell,
},
setup() {
const route = useRoute()
const router = useRouter()
const route = useRoute();
const router = useRouter();
let get_class1 = route.query.class1 ? parseInt(route.query.class1) : 0;
let get_class2 = route.query.class2 ? parseInt(route.query.class2) : 0;
let get_sort = route.query.sort ? parseInt(route.query.sort) : 0;
@ -312,14 +296,14 @@
},
loading: true,
loading_m: false,
class1_title: '',
class2_title: '',
curSortName: '默认排序',
class1_title: "",
class2_title: "",
curSortName: "默认排序",
videDrawer: false,
video_total: 0,
max_total: false,
start_perpage: 16,
onresize: '',
onresize: "",
});
//
@ -337,7 +321,7 @@
state.query.price = params;
break;
}
}
};
//
const screening = () => {
@ -346,7 +330,7 @@
...state.query,
};
fetVideoList(params);
}
};
const changeCategory = (id, title) => {
state.class1_title = title;
@ -356,8 +340,8 @@
query: {
class1: id,
class2: state.query.class2,
}
})
},
});
getClass2(id);
state.query.class1 = id;
state.query.class2 = 0;
@ -376,8 +360,8 @@
query: {
class1: state.query.class1,
class2: id,
}
})
},
});
state.query.class2 = id;
state.query.page = 1;
const params = {
@ -441,18 +425,17 @@
//
const getClass2 = async (class1_id) => {
let getId = class1_id > 0 ? class1_id : '';
let getId = class1_id > 0 ? class1_id : "";
const params = {
directionTag: getId
}
directionTag: getId,
};
console.log(params);
const res = await getCourseTag(params)
const res = await getCourseTag(params);
if (res.code === 200) {
state.class2_list = res.data;
}
}
};
//
const fetVideoList = async (query) => {
@ -473,7 +456,6 @@
} else {
state.max_total = false;
}
}
};
@ -483,14 +465,13 @@
const handleCurrentChange = (val) => {
const params = {
...state.query,
page: val
page: val,
};
fetVideoList(params)
fetVideoList(params);
window.scrollTo(0, 0);
// setTimeout(function () {
// toTop();
// }, 300);
};
// const toTop = () => {
@ -514,19 +495,18 @@
//
const loadVlist = () => {
setTimeout(() => {
state.start_perpage += 8
state.start_perpage += 8;
const params = {
...state.query,
perpage: state.start_perpage
perpage: state.start_perpage,
};
// if (state.onresize < 1200) {
state.videoList.push(fetVideoList(params));
// }
state.loading_m = false;
}, 800);
}
};
return {
calcNum,
@ -541,11 +521,11 @@
screening,
};
},
};
};
</script>
<style lang="scss" scoped>
.video-page {
.video-page {
height: 100%;
margin: auto;
display: flex;
@ -556,7 +536,7 @@
flex-direction: column;
justify-content: space-around;
border-radius: 8px;
border: 1px solid #CEDDF2;
border: 1px solid #ceddf2;
padding: 14px 24px 6px 24px;
margin: 30px 0 24px;
font-size: 14px;
@ -605,7 +585,7 @@
&:hover {
color: #0082fc;
background-color: #D9ECFF;
background-color: #d9ecff;
}
}
@ -625,7 +605,7 @@
right: 0;
margin: auto;
height: 1px;
background-color: #CEDDF2;
background-color: #ceddf2;
}
}
@ -640,20 +620,19 @@
padding-top: 10px;
&:after {
content: ' ';
content: " ";
width: 276px;
}
.video-item {
transition: all .3s;
transition: all 0.3s;
width: 276px;
height: 342px;
border-radius: 8px;
margin-bottom: 22px;
&:hover {
box-shadow: 0px 1px 12px 0px #DCE5FF;
box-shadow: 0px 1px 12px 0px #dce5ff;
}
&.video-item:hover .img {
@ -671,8 +650,7 @@
width: 276px;
height: 184px;
border-radius: 8px;
transition: all .3s;
transition: all 0.3s;
}
h2 {
@ -691,7 +669,7 @@
text-align: center;
background: rgba(40, 195, 70, 0.08);
border-radius: 12px;
color: #28C346;
color: #28c346;
}
.saleprice {
@ -700,13 +678,11 @@
del {
margin-left: 8px;
color: #B3C1D3;
color: #b3c1d3;
font-size: 14px;
}
}
.info {
width: 260px;
padding: 16px 18px 0 18px;
@ -722,7 +698,6 @@
}
}
.video-item {
width: 276px;
height: 342px;
@ -791,32 +766,31 @@
height: 40px;
text-align: center;
}
}
}
</style>
<style lang="scss">
/*响应式-移动端*/
@import '~@/assets/css/m.css';
@media screen and (max-width: 1200px) {
/*响应式-移动端*/
@import "~@/assets/css/m.css";
@media screen and (max-width: 1200px) {
html,
body {
background-color: #f3f8ff;
}
}
}
/* end screen */
/* end screen */
.tool-box-m {
.tool-box-m {
margin: 0 20px;
margin-top: 20px;
background-color: #fff;
border-radius: 8px;
padding: 0 20px;
}
}
.wrapper-video-m {
.wrapper-video-m {
padding: 0 20px;
.title {
@ -850,7 +824,7 @@
&:hover {
color: #0082fc;
background-color: #D9ECFF;
background-color: #d9ecff;
}
}
@ -858,15 +832,15 @@
text-align: center;
}
}
}
}
.video-drawer {
.video-drawer {
.el-drawer__header {
margin-bottom: 20px;
}
}
}
.vtool-foot-box {
.vtool-foot-box {
position: absolute;
width: 100%;
height: 10%;
@ -893,10 +867,10 @@
border-top: 1px solid #0082fc;
}
}
}
}
/* 移动端视频列表 */
.video-list-m {
/* 移动端视频列表 */
.video-list-m {
display: flex;
justify-content: space-between;
flex-wrap: wrap;
@ -906,7 +880,7 @@
margin-top: 20px;
.item {
transition: all .3s;
transition: all 0.3s;
width: 49% !important;
height: 110px !important;
border-radius: 8px;
@ -914,7 +888,7 @@
margin-bottom: 18px;
&:hover {
box-shadow: 0px 1px 12px 0px #DCE5FF;
box-shadow: 0px 1px 12px 0px #dce5ff;
}
.rtbox,
@ -951,8 +925,7 @@
width: 160px !important;
height: 110px !important;
border-radius: 8px;
transition: all .3s;
transition: all 0.3s;
}
h2 {
@ -970,7 +943,7 @@
text-align: center;
background: rgba(40, 195, 70, 0.08);
border-radius: 12px;
color: #28C346;
color: #28c346;
}
.info {
@ -987,20 +960,18 @@
color: #333;
}
}
}
}
.v_lod_txt {
.v_lod_txt {
text-align: center;
color: #7E8FA3;
color: #7e8fa3;
margin-top: 14px;
font-size: 14px;
letter-spacing: 2px;
}
}
@media screen and (max-width: 800px) {
/* 视频看列表 */
@media screen and (max-width: 800px) {
/* 视频课列表 */
.video-list-m {
display: flex;
justify-content: space-around !important;
@ -1012,7 +983,7 @@
}
.item {
transition: all .3s;
transition: all 0.3s;
width: 100% !important;
height: 100px !important;
border-radius: 8px;
@ -1020,7 +991,7 @@
margin-bottom: 16px;
&:hover {
box-shadow: 0px 1px 12px 0px #DCE5FF;
box-shadow: 0px 1px 12px 0px #dce5ff;
}
.rtbox,
@ -1055,8 +1026,7 @@
width: 150px !important;
height: 100px !important;
border-radius: 8px;
transition: all .3s;
transition: all 0.3s;
}
h2 {
@ -1074,7 +1044,7 @@
text-align: center;
background: rgba(40, 195, 70, 0.08);
border-radius: 12px;
color: #28C346;
color: #28c346;
}
.info {
@ -1096,7 +1066,7 @@
}
}
}
}
}
/* end-phone */
/* end-phone */
</style>
Loading…
Cancel
Save