develop #4

Merged
myxiaowei merged 2 commits from develop into master 2 years ago
  1. 18
      public/index.html
  2. 7
      src/api/user.js
  3. 22
      src/assets/css/base.css
  4. 15
      src/assets/css/m.css
  5. BIN
      src/assets/fine_logo_dynamic.gif
  6. BIN
      src/assets/img/fcrp2022.png
  7. 146
      src/components/AvatarDropDown.vue
  8. 905
      src/components/Header-old.vue
  9. 484
      src/components/Header.vue
  10. 305
      src/components/TeacherApply/TeacherApplyModal - old.vue
  11. 130
      src/components/TeacherApply/TeacherApplyModal.vue
  12. 28
      src/components/banner.vue
  13. 26
      src/main.js
  14. 6
      src/router.js
  15. 19
      src/utils/advertisementSDK.js
  16. 275
      src/views/class/class.vue
  17. 19
      src/views/class/classMenu.vue
  18. 137
      src/views/class/class_homework.vue
  19. 101
      src/views/class/class_lesson.vue
  20. 645
      src/views/class/indexClass.vue
  21. 195
      src/views/class/play.vue
  22. 186
      src/views/video/indexVideo.vue
  23. 2
      src/views/video/play.vue

18
public/index.html

@ -267,12 +267,18 @@
<script> <script>
var _hmt = _hmt || []; var _hmt = _hmt || [];
(function() { (function(c, l, a, r, i, t, y) {
var hm = document.createElement("script"); c[a] =
hm.src = "https://hm.baidu.com/hm.js?f4d7d83c565e698bd7cedfe9c6297055"; c[a] ||
var s = document.getElementsByTagName("script")[0]; function() {
s.parentNode.insertBefore(hm, s); (c[a].q = c[a].q || []).push(arguments);
})(); };
t = l.createElement(r);
t.async = 1;
t.src = "https://www.clarity.ms/tag/" + i;
y = l.getElementsByTagName(r)[0];
y.parentNode.insertBefore(t, y);
})(window, document, "clarity", "script", "h6euw7u8lp");
</script> </script>
</body> </body>
</html> </html>

7
src/api/user.js

@ -10,6 +10,13 @@ export function getTicketToken(params) {
}) })
} }
// 获取用户资料
export function getUserInfoShequ(uid) {
return request({
url: `/v1/user/getUserinfo/?uid=${uid}`,
method: "get",
})
}
// 获取用户资料(转发通行证v2接口) // 获取用户资料(转发通行证v2接口)
export function getUserInfo() { export function getUserInfo() {

22
src/assets/css/base.css

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

15
src/assets/css/m.css

@ -31,8 +31,18 @@
.m-db { .m-db {
display: block !important; display: block !important;
} }
.m-f12{font-size: 12px !important;} .m-f12 {
.m-f14{font-size: 14px !important;} 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) { @media screen and (max-width: 800px) {
@ -48,7 +58,6 @@
--van-red: #0082fc; --van-red: #0082fc;
} }
// 移动端 // 移动端
@media screen and (max-width: 500px) { @media screen and (max-width: 500px) {
.m-dn-500 { .m-dn-500 {

BIN
src/assets/fine_logo_dynamic.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 474 KiB

BIN
src/assets/img/fcrp2022.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 536 KiB

146
src/components/AvatarDropDown.vue

@ -0,0 +1,146 @@
<template>
<div class="user-pop-index">
<ul>
<div class="dr-nav-popover-inner-section">
<div class="avatar-wrapper">
<div class="detail-wrapper">
<div class="username-info">{{ user.username }}</div>
<div class="ant-space css-1me4733 ant-space-horizontal ant-space-align-center uid-info" style="gap: 8px">
<div class="ant-space-item" style="">uid:</div>
<div class="ant-space-item">{{ uid }}</div>
</div>
<div class="ant-space css-1me4733 ant-space-horizontal ant-space-align-center" style="gap: 40px">
<div class="ant-space-item" style="">
<a href="https://fanruanclub.com/#/info/" target="_blank" class="col167">个人资料</a>
</div>
<div class="ant-space-item">
<a href="https://fanruanclub.com/#/info/auth" target="_blank" class="col167">账号认证</a>
</div>
</div>
</div>
<div>
<img class="dr-nav-popover-inner-logo-big" :src="'https://bbs.fanruan.com/uc_server/avatar.php?uid=' + uid + '&amp;size=small'" />
</div>
</div>
</div>
<div class="dr-nav-popover-inner-section">
<div class="ant-row css-1me4733">
<div class="ant-col ant-col-12 css-1me4733">
<a class="section-item" :href="'https://bbs.fanruan.com/u/' + uid" target="_blank"> <img class="section-item-icon" src="https://hwobs.fanruan.com/ui/digit-fe/header/header-user.png" />我的主页 </a>
</div>
<div class="ant-col ant-col-12 css-1me4733">
<a class="section-item" href="https://bbs.fanruan.com/task-my.html" target="_blank"> <img class="section-item-icon" src="https://hwobs.fanruan.com/ui/digit-fe/header/header-calendar.png" />我的任务 </a>
</div>
<div class="ant-col ant-col-12 css-1me4733">
<a class="section-item" href="https://edu.fanruan.com/class" target="_blank"> <img class="section-item-icon" src="https://hwobs.fanruan.com/ui/digit-fe/header/header-report.png" />我的班级 </a>
</div>
</div>
</div>
<div class="dr-nav-popover-inner-section" style="border-bottom: none;">
<a class="section-item" :href="com_id_url + '/login/token/logout?referrer=' + com_edu_url + $route.fullPath"> <img class="section-item-icon" src="https://hwobs.fanruan.com/ui/digit-fe/header/header-logout.png" />退出登录 </a>
</div>
</ul>
</div>
</template>
<script>
import { reactive, toRefs } from "vue";
import { getUid } from "@/utils/cookie";
import { getUserInfoShequ } from "@/api/user";
export default {
setup() {
const state = reactive({
uid: getUid(),
user: {},
});
const resGetUserInfoShequ = async () => {
const res = await getUserInfoShequ(state.uid);
if (res.code === 200) {
state.user = res.data;
console.log(state.user);
}
};
resGetUserInfoShequ();
return {
...toRefs(state),
};
},
};
</script>
<style lang="scss">
.user-pop-index {
line-height: 1.5714285714285714;
}
.dr-nav-popover-inner-section {
padding: 20px 0;
border-bottom: 1px solid #e8eaed;
}
.dr-nav-popover-inner-section .avatar-wrapper {
display: flex;
align-items: center;
justify-content: space-between;
}
.dr-nav-popover-inner-section .avatar-wrapper .detail-wrapper {
width: 160px;
}
.dr-nav-popover-inner-section .avatar-wrapper .detail-wrapper .username-info {
width: 100%;
font-size: 14px;
color: #333;
color: var(--dr-text-black);
margin-bottom: 4px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.dr-nav-popover-inner-section .avatar-wrapper .detail-wrapper .uid-info {
color: #c5c7ce;
margin-bottom: 4px;
}
.ant-space {
display: inline-flex;
align-items: cente;
.ant-space-item {
font-size: 14px;
}
}
.dr-nav-popover-inner-logo-big {
width: 72px;
height: 72px;
border-radius: 50%;
}
.col167 {
color: #1677ff !important;
}
.ant-row {
display: flex;
flex-flow: row wrap;
min-width: 0;
}
.ant-col:not(:nth-last-of-type(-n + 2)) {
margin-bottom: 16px !important;
display: block;
flex: 0 0 50%;
max-width: 50%;
}
.dr-nav-popover-inner-section .section-item {
color: #8097ad;
font-size: 14px;
cursor: pointer;
transition: all 0.3s;
display: flex;
align-items: center;
}
.dr-nav-popover-inner-section .section-item-icon {
width: 16px;
height: 16px;
margin-right: 5px;
}
.dr-nav-popover-inner-section:not(:first-child) {
padding: 15px 0;
}
</style>

905
src/components/Header-old.vue

@ -0,0 +1,905 @@
<template>
<header class="header" id="myheader">
<div class="wrapper">
<!-- left -->
<nav class="nav">
<a class="nav-item item-lf" v-for="item in leftMenu" :key="item.id" :href="item.url" :class="{ active: item.name === '学院' }">{{ item.name }}</a>
</nav>
<!-- center -->
<div class="search-box flex-1">
<form class="searchform" method="get" autocomplete="off" action="https://search.fanruan.com/?q=" target="_blank" v-if="is_search">
<div class="el-input el-input--small el-input--suffix topsearch flex-1">
<input class="el-input__inner" name="q" type="text" autocomplete="off" tabindex="" aria-label="" placeholder="请输入关键词" @focus="isfocus('focus')" @blur="isfocus('blur')" v-on:input="isinput" />
<button class="el-input__suffix search_sub" type="submit" :class="{ active_btn: kwbtn }">
<span class="el-input__suffix-inner search_btn">
<i class="iconfont icon-icon_icon-53 icon-ss" :class="{ active: kwfocus }"></i>
</span>
</button>
</div>
</form>
<div class="searchform" v-else>
<div class="el-input el-input--small el-input--suffix topsearch flex-1">
<div class="el-input__inner" style="color: #B5C1D0; line-height: 30px;">登录后方可搜索</div>
<button class="el-input__suffix search_sub" type="submit" :class="{ active_btn: kwbtn }">
<span class="el-input__suffix-inner search_btn">
<i class="iconfont icon-icon_icon-53 icon-ss" :class="{ active: kwfocus }"></i>
</span>
</button>
</div>
</div>
</div>
<!-- rigt -->
<nav class="infomation">
<template v-for="item in rightMenu" :key="item.id">
<template v-if="!item.children">
<a class="nav-item item-rt" :href="item.url">{{ item.name }}</a>
</template>
<template v-else>
<el-dropdown :show-timeout="0">
<span class="el-dropdown-link item-rt"> {{ item.name }}<i class="el-icon-arrow-down el-icon--right"></i> </span>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item v-for="child in item.children" :key="child.id" style="padding: 0;">
<a class="nav-item" :href="child.url" style="display:block;">{{ child.name }}</a>
</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
</template>
</template>
<!-- <div class="app_qrcode_box">
<el-dropdown trigger="hover">
<div class="toptxt flex-1">
<i class="el-dropdown-link iconfont icon-M-phone"></i>
<span>下载APP</span>
</div>
<template #dropdown>
<el-dropdown-menu>
<div class="qrcode-box">
<div class="top-txt flex-4">
<span>帆软社区APP</span>
<a href="https://bbs.fanruan.com/thread-135870-1-1.html" target="_blank">更新说明</a>
</div>
<img class="codeimg" width="162"
src="https://bbs.fanruan.com/source/plugin/app_download/img/new_ios_qrcode.png" />
<div class="foot-txt-gift flex-4">
<img class="img-gift" width="24" src="https://bbs.fanruan.com/static/img/icon_fundction_gift.png" />
<a href="https://bbs.fanruan.com/thread-135868-1-1.html" target="_blank">连续签到,赢取千元大奖</a>
</div>
</div>
</el-dropdown-menu>
</template>
</el-dropdown>
</div> -->
<div class="notice_box">
<el-dropdown trigger="hover">
<el-badge :is-dot="is_dot" class="item badge" type="danger">
<i class="el-dropdown-link iconfont icon-icon_icon-66"></i>
</el-badge>
<template #dropdown>
<el-dropdown-menu class="i_item">
<a :href="com_shequ_url + '/home.php?mod=space&do=notice&view=system'" target="_blank">
<el-dropdown-item class="clearfix">
<span class="i_txt">我的通知</span>
<el-badge class="mark" :value="u_notice" type="danger" />
</el-dropdown-item>
</a>
</el-dropdown-menu>
</template>
</el-dropdown>
</div>
<el-dropdown v-if="com_user_token" class="personal" ref="userDropdown">
<span class="el-dropdown-link">
<el-avatar :src="avatarUrl + uid" :size="32" fit="cover" icon="el-icon-user-solid"></el-avatar>
<i class="el-icon-arrow-down el-icon--right"></i>
</span>
<template #dropdown>
<el-dropdown-menu class="avatar_down">
<el-dropdown-item v-for="(item, i) in avatarMenu.baseMenu" :key="i" :icon="item.icon">
<a class="item-nav" :href="item.url">{{ item.name }}</a>
</el-dropdown-item>
<el-divider></el-divider>
<el-dropdown-item v-for="(item, i) in avatarMenu.navMenu" :key="i" :icon="item.icon">
<a class="item-nav" :href="item.url">{{ item.name }}</a>
</el-dropdown-item>
<el-divider></el-divider>
<el-dropdown>
<teacherApplyModal :uid="uid" />
</el-dropdown>
<el-divider></el-divider>
<el-dropdown-item v-for="(item, i) in avatarMenu.adminMenu" :key="i" :icon="item.icon">
<a class="item-nav" :href="item.url">{{ item.name }}</a>
</el-dropdown-item>
<el-divider v-if="avatarMenu.adminMenu?.length > 0"></el-divider>
<el-dropdown-item v-for="(item, i) in avatarMenu.footerMenu" :key="i" :icon="item.icon">
<a class="item-nav" :href="item.url">{{ item.name }}</a>
</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
<div v-else class="loginReg flex-1">
<a class="loginbtn" :href="com_id_url + '/cas/login?service=' + com_edu_url + '/v1/user/cas/edu/login/?redirect=' + $route.fullPath">登录</a>
</div>
</nav>
</div>
</header>
<div class="edu-nav-box" v-if="isPc">
<div class="mainbox">
<div class="edu-head">
<router-link class="logo" to="/"><img src="@/assets/logo.png"/></router-link>
<div class="edu-nav">
<router-link to="/">首页</router-link>
<router-link to="/studypath/finereport" :class="$route.meta.active == 'studypath' ? 'active' : ''">学习路径 </router-link>
<router-link to="/video" :class="$route.meta.active == 'video' ? 'active' : ''">视频课</router-link>
<router-link to="/class" :class="$route.meta.active == 'class' ? 'active' : ''">学习班</router-link>
<router-link to="/live" :class="$route.meta.active == 'live' ? 'active' : ''">直播</router-link>
<router-link to="/cityclass" :class="$route.meta.active == 'cityclass' ? 'active' : ''">城市课堂</router-link>
<!-- <router-link to="/more" :class="$route.meta.active == 'more' ? 'active' : ''">资源导航</router-link> -->
</div>
</div>
</div>
</div>
<!-- 移动端 -->
<div class="edu-nav-box-m dn" v-else>
<!-- search -->
<div class="ss-main-box dn" :class="{ showss: ssOpen }">
<div class="search-box-m">
<form class="searchform" method="get" autocomplete="off" action="https://search.fanruan.com/?q=" target="_blank" v-if="is_search">
<div class="el-input el-input--small el-input--suffix topsearch flex-1">
<input class="el-input__inner" name="q" type="text" autocomplete="off" tabindex="" aria-label="" placeholder="请输入关键词" @focus="isfocus('focus')" @blur="isfocus('blur')" v-on:input="isinput" />
<button class="el-input__suffix search_sub" type="submit" :class="{ active_btn: kwbtn }">
<span class="el-input__suffix-inner search_btn">
<i class="iconfont icon-search icon-ss" :class="{ active: kwfocus }"></i>
</span>
</button>
</div>
</form>
<div class="searchform" v-else>
<div class="el-input el-input--small el-input--suffix topsearch flex-1">
<div class="el-input__inner" style="color: #B5C1D0; line-height: 30px;">登录后方可搜索</div>
<button class="el-input__suffix search_sub" type="submit" :class="{ active_btn: kwbtn }">
<span class="el-input__suffix-inner search_btn">
<i class="iconfont icon-search icon-ss" :class="{ active: kwfocus }"></i>
</span>
</button>
</div>
</div>
</div>
</div>
<div class="m-box flex-2">
<div class="flex-3 flex-1">
<!-- left -->
<div @click="drawer = true">
<i class="iconfont icon-zhankai1 ff18" style="margin-right: 10px;"></i>
<span class="f18">帆软学院</span>
</div>
<!-- right -->
<div class="flex-1">
<!-- search-btn -->
<div class="ss-btn-m">
<i v-if="!ssOpen" class="iconfont icon-search ff18 col617 cur-p" @click="funssOpen(false)"></i>
<i
v-else
class="iconfont icon-cuohao1 ff18 col617 cur-p"
@click="
funssOpen(true);
isfocus('blur');
"
></i>
</div>
<el-dropdown v-if="com_user_token" class="personal" ref="userDropdown" trigger="click" style="margin-left: 26px;">
<span class="el-dropdown-link">
<el-avatar :src="avatarUrl + uid" :size="32" fit="cover" icon="el-icon-user-solid"></el-avatar>
</span>
<template #dropdown>
<el-dropdown-menu class="avatar_down">
<el-dropdown-item v-for="(item, i) in avatarMenu.baseMenu" :key="i" :icon="item.icon">
<a class="item-nav" :href="item.url">{{ item.name }}</a>
</el-dropdown-item>
<el-divider></el-divider>
<el-dropdown-item v-for="(item, i) in avatarMenu.navMenu" :key="i" :icon="item.icon">
<a class="item-nav" :href="item.url">{{ item.name }}</a>
</el-dropdown-item>
<el-divider></el-divider>
<el-dropdown>
<teacherApplyModal :uid="uid" />
</el-dropdown>
<el-divider></el-divider>
<el-dropdown-item v-for="(item, i) in avatarMenu.adminMenu" :key="i" :icon="item.icon">
<a class="item-nav" :href="item.url">{{ item.name }}</a>
</el-dropdown-item>
<el-divider v-if="avatarMenu.adminMenu?.length > 0"></el-divider>
<el-dropdown-item v-for="(item, i) in avatarMenu.footerMenu" :key="i" :icon="item.icon">
<a class="item-nav" :href="item.url">{{ item.name }}</a>
</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
<div v-else class="loginReg flex-1">
<a class="loginbtn" :href="com_login_url">登录</a>
</div>
</div>
</div>
</div>
</div>
<el-drawer v-model="drawer" title="我的帆软" direction="ltr" custom-class="drawerHead" size="55%">
<div class="lf-nav-box-m">
<el-scrollbar style="height: 100%; width: 99%; position: absolute;">
<el-menu default-active="2-1" class="el-menu-lf" @open="handleOpen" @close="handleClose">
<li v-for="item in allMenu" :key="item.id">
<el-submenu index="item.id" v-if="item.ident === 'edu'">
<template #title>
<span class="col008 f16">
{{ item.name }}
</span>
</template>
<el-menu-item-group>
<el-menu-item index="2-1">
<router-link to="/" class="lfnav-item" @click="drawer = false">学院首页</router-link>
</el-menu-item>
<el-menu-item index="2-2">
<router-link to="/studypath/finereport" @click="drawer = false" class="lfnav-item" :class="$route.meta.active == 'studypath' ? 'active' : ''">学习路径 </router-link>
</el-menu-item>
<el-menu-item>
<router-link to="/video" @click="drawer = false" class="lfnav-item" :class="$route.meta.active == 'video' ? 'active' : ''">视频课 </router-link>
</el-menu-item>
<el-menu-item>
<router-link to="/class" @click="drawer = false" class="lfnav-item" :class="$route.meta.active == 'class' ? 'active' : ''">学习班 </router-link>
</el-menu-item>
<el-menu-item>
<router-link to="/live" @click="drawer = false" class="lfnav-item" :class="$route.meta.active == 'live' ? 'active' : ''">直播 </router-link>
</el-menu-item>
<el-menu-item>
<router-link to="/cityclass" @click="drawer = false" class="lfnav-item" :class="$route.meta.active == 'cityclass' ? 'active' : ''"> 城市课堂</router-link>
</el-menu-item>
<!-- <el-menu-item>
<router-link to="/more" @click="drawer = false" class="lfnav-item" :class="$route.meta.active == 'more' ? 'active' : ''">资源导航 </router-link>
</el-menu-item> -->
</el-menu-item-group>
</el-submenu>
<el-menu-item :index="item.id" v-if="!item.children && item.ident != 'edu'">
<template #title>
<a class="lfnav-item" :href="item.url">{{ item.name }}</a>
</template>
</el-menu-item>
<el-submenu :index="item.id" v-else-if="item.ident != 'edu'">
<template #title>
<span>{{ item.name }}</span>
</template>
<el-menu-item-group>
<el-menu-item v-for="child in item.children" :key="child.id">
<a class="lfnav-item" :href="child.url">{{ child.name }}</a>
</el-menu-item>
</el-menu-item-group>
</el-submenu>
</li>
</el-menu>
</el-scrollbar>
</div>
</el-drawer>
</template>
<script>
import { defineComponent, reactive, toRefs, ref, getCurrentInstance } from "vue";
import teacherApplyModal from "@/components/TeacherApply/TeacherApplyModal";
import { getMenuList } from "@/api/nav";
import { getNotice, avatarMenu } from "@/api/user";
import store from "@/store";
import { onBeforeRouteUpdate } from "vue-router";
export default defineComponent({
components: {
teacherApplyModal,
},
name: "Header",
setup() {
const { proxy } = getCurrentInstance();
const state = reactive({
isPc: document.body.clientWidth > 1200,
allMenu: [],
leftMenu: [],
rightMenu: [],
userInfo: {},
kwfocus: 0,
kwbtn: 0,
u_notice: 0,
is_dot: false,
avatarMenu: [],
is_search: false,
drawer: false,
ssOpen: false,
avatarUrl: "https://bbs.fanruan.com/uc_server/avatar.php?uid=",
uid: 0,
wwwUrl: "",
});
state.wwwUrl = window.location.href;
onBeforeRouteUpdate((to) => {
state.wwwUrl = proxy.$root.com_edu_url + to.path;
});
window.addEventListener("resize", function() {
state.isPc = document.body.clientWidth > 1200;
});
const fetchMenuList = async () => {
const res = await getMenuList();
if (res.code === 1) {
state.menuList = res.data;
const arr = res.data;
state.allMenu = arr;
arr.forEach((item) => {
if (item.position) {
state.rightMenu.push(item);
} else {
state.leftMenu.push(item);
}
});
}
};
fetchMenuList();
//
const fetchavatarMenu = async () => {
const res = await avatarMenu();
if (res.code === 200) {
state.avatarMenu = res.data;
}
};
//
const resNotice = async () => {
const res = await getNotice();
if (res.code === 200) {
state.u_notice = res.data.system;
if (state.u_notice > 0) {
state.is_dot = true;
}
}
};
if (store.getters.get_uid) {
resNotice();
state.uid = store.getters.get_uid;
state.is_search = true;
setTimeout(function() {
fetchavatarMenu();
}, 500);
} else {
state.is_search = false;
}
function isfocus(k) {
if (k == "focus") {
state.kwfocus = 1;
} else {
state.kwfocus = 0;
}
}
function isinput(e) {
const { value } = e.target;
if (value) {
state.kwbtn = 1;
} else {
state.kwbtn = 0;
}
}
function funssOpen(o) {
if (o == true) {
state.ssOpen = false;
} else {
state.ssOpen = true;
}
}
return {
...toRefs(state),
input: ref(""),
isfocus,
isinput,
funssOpen,
};
},
});
</script>
<style lang="scss" scoped>
.el-divider--horizontal {
margin: 8px 0;
}
.app_qrcode_box {
.toptxt {
i {
font-size: 20px;
margin-top: 3px;
}
span {
font-size: 16px;
}
}
}
.qrcode-box {
width: 220px;
font-size: 14px;
.codeimg {
display: block;
margin: 0 auto;
}
.top-txt {
height: 40px;
a {
color: #8c8c8c;
margin-left: 12px;
}
}
.foot-txt-gift {
height: 40px;
a {
color: #ff7a45;
margin-left: 8px;
}
}
}
.header {
height: 48px;
background: #fff;
padding: 0 40px 0 20px;
.wrapper {
height: 100%;
background: #fff;
min-width: 1100px;
display: flex;
align-items: flex-start;
justify-content: space-between;
.nav {
min-width: 400px;
}
.nav {
position: relative;
height: 100%;
display: flex;
align-items: center;
font-size: 16px;
.nav-item {
font-size: 16px;
color: #333;
&:hover {
color: #0082fc;
}
}
.item-lf {
margin-left: 26px;
&.active {
color: #0082fc;
}
}
.item-rt {
margin-right: 26px;
}
}
.infomation {
position: relative;
height: 100%;
display: flex;
align-items: center;
justify-content: flex-end;
font-size: 16px;
.nav-item {
font-size: 16px;
color: #333;
&:hover {
color: #0082fc;
}
}
.item-lf {
margin-right: 20px;
}
.item-rt {
margin-right: 26px;
}
::v-deep .el-dropdown.personal {
width: 32px;
height: 32px;
margin-left: 24px;
border-radius: 50%;
overflow: hidden;
z-index: 99;
}
}
.search-box {
height: 48px;
margin: 0 auto;
width: 40%;
transition: all 0.2s;
.searchform {
width: 100%;
}
.search_sub {
border-radius: 0px 20px 20px 0px;
height: 32px;
cursor: pointer;
background: none;
border: none;
right: 0;
}
.search_btn {
display: inline-block;
color: #617288;
width: 48px;
.active {
color: #0082fc;
}
}
.active_btn {
background-color: #0082fc;
.icon-ss {
color: #fff;
}
}
.el-input__inner {
border: none;
border: 1px solid #eef3fa;
background-color: #eef3fa;
border-radius: 100px;
font-size: 14px;
}
.el-input__inner:focus {
border: 1px solid #0082fc;
background-color: #fff;
}
::placeholder {
color: #8496ab !important;
}
}
}
}
/*响应式-小屏幕*/
@media screen and (max-width: 1800px) {
.search-box {
width: 36% !important;
}
}
@media screen and (max-width: 1700px) {
.search-box {
width: 32% !important;
}
}
@media screen and (max-width: 1600px) {
.search-box {
width: 28% !important;
}
}
@media screen and (max-width: 1500px) {
.search-box {
width: 25% !important;
}
}
@media screen and (max-width: 1400px) {
.search-box {
width: 20% !important;
}
}
@media screen and (max-width: 1300px) {
.search-box {
width: 15% !important;
}
}
.el-popper {
.nav-item {
padding: 0 20px;
color: #8496ab;
&:hover {
color: #0082fc;
}
}
}
.el-dropdown-selfdefine {
font-size: 16px;
color: #333;
}
.avatar_down {
width: 234px;
display: flex;
justify-content: space-between;
flex-wrap: wrap;
.item-nav {
display: inline-block;
}
}
.avatar_down li:hover {
background: none;
}
.loginReg {
padding-left: 26px;
span {
color: #ddd;
padding: 0 8px;
}
.loginbtn {
border-radius: 20px;
font-size: 14px;
color: #fff;
padding: 5px 20px;
background: linear-gradient(270deg, #0082fc 0%, #00bbfe 100%);
@keyframes gradientBG {
0% {
background-position: 0% 50%;
}
50% {
background-position: 100% 50%;
}
100% {
background-position: 0% 50%;
}
}
&:hover {
color: #fff;
background: linear-gradient(60deg, #0070d8, #0082fc, #00bbfe, #0ec4fc, #0082fc, #0070d8);
background-size: 400% 400%;
animation: gradientBG 4s ease infinite;
}
}
a {
color: #8496ab;
}
a:hover {
color: #0082fc;
}
}
.notice_box {
padding: 4px 0 0 0px;
.icon-icon_icon-66 {
font-size: 26px;
color: #333;
margin: 0;
}
}
.i_item {
.i_txt {
padding-right: 30px;
}
}
::v-deep .el-badge__content {
background-color: #ff3d23 !important;
border: none;
margin: 6px 4px 0 0;
}
</style>
<style lang="scss">
.edu-head {
height: 70px;
background: #fff;
display: flex;
justify-content: space-between;
align-items: center;
}
.edu-head .logo img {
height: 34px;
}
.edu-nav a {
margin-left: 40px;
font-size: 18px;
}
.edu-nav-box {
background: #fff;
box-shadow: 0px 4px 6px -3px rgba(179, 193, 211, 0.3);
z-index: 6;
position: relative;
}
.el-dropdown-menu__item {
min-width: 117px;
}
</style>
<style lang="scss">
/*响应式-移动端*/
.edu-nav-box-m {
background: #fff;
box-shadow: 0px 4px 6px -3px rgba(179, 193, 211, 0.3);
z-index: 6;
position: relative;
height: 50px;
}
.m-box {
height: 50px;
padding: 0 20px;
}
.ss-main-box {
position: absolute;
background-color: #fff;
width: 100%;
padding: 0 20px;
transition: all 0.3s;
margin-top: 0;
box-shadow: 0px 4px 6px -3px rgba(179, 193, 211, 0.3);
z-index: -1px;
}
.showss {
transition: all 0.3s;
margin-top: 50px;
display: block !important;
}
.search-box-m {
height: 48px;
padding-top: 3px;
width: 100%;
transition: all 0.2s;
.searchform {
width: 100%;
}
.search_sub {
border-radius: 0px 20px 20px 0px;
height: 32px;
cursor: pointer;
background: none;
border: none;
right: 0;
}
.search_btn {
display: inline-block;
color: #617288;
width: 48px;
.active {
color: #0082fc;
}
}
.active_btn {
background-color: #0082fc;
.icon-ss {
color: #fff;
}
}
.el-input__inner {
border: none;
border: 1px solid #eef3fa;
background-color: #eef3fa;
border-radius: 100px;
font-size: 14px;
}
.el-input__inner:focus {
border: 1px solid #0082fc;
background-color: #fff;
}
::placeholder {
color: #8496ab !important;
}
}
/* 导航 */
.lfnav-item {
display: block;
font-size: 15px;
}
.drawerHead {
text-align: left;
.el-submenu__icon-arrow,
.el-icon-arrow-down,
.el-icon-close {
font-size: 16px;
}
.el-drawer__header {
margin-bottom: 0;
border-bottom: 1px solid #eee;
padding-top: 10px;
padding-bottom: 10px;
font-weight: 700;
color: #333;
letter-spacing: 2px;
}
.el-menu-item,
.el-submenu__title {
height: 48px;
line-height: 48px;
}
.el-menu-item-group__title {
padding: 0;
}
.el-menu {
border: none;
}
}
</style>

484
src/components/Header.vue

@ -2,11 +2,17 @@
<header class="header" id="myheader"> <header class="header" id="myheader">
<div class="wrapper"> <div class="wrapper">
<!-- left --> <!-- left -->
<nav class="nav"> <div class="nav-lf flex-1">
<a class="nav-item item-lf" v-for="item in leftMenu" :key="item.id" :href="item.url" :class="{ active: item.name === '学院' }">{{ item.name }}</a> <div class="nav-logo">
</nav> <a href="https://home.fanruan.com/"><img src="@/assets/fine_logo_dynamic.gif" class="logo-img"/></a>
</div>
<div class="nav-line"></div>
<router-link to="/" class="nav-title">帆软学院</router-link>
</div>
<!-- center --> <!-- rigt -->
<div class="nav-rt">
<!-- search -->
<div class="search-box flex-1"> <div class="search-box flex-1">
<form class="searchform" method="get" autocomplete="off" action="https://search.fanruan.com/?q=" target="_blank" v-if="is_search"> <form class="searchform" method="get" autocomplete="off" action="https://search.fanruan.com/?q=" target="_blank" v-if="is_search">
<div class="el-input el-input--small el-input--suffix topsearch flex-1"> <div class="el-input el-input--small el-input--suffix topsearch flex-1">
@ -31,119 +37,66 @@
</div> </div>
</div> </div>
<!-- rigt -->
<nav class="infomation"> <nav class="infomation">
<template v-for="item in rightMenu" :key="item.id"> <el-dropdown v-if="com_user_token" class="personal" placement="bottom-end" popper-class="new-dropdown" show-timeout="0">
<template v-if="!item.children">
<a class="nav-item item-rt" :href="item.url">{{ item.name }}</a>
</template>
<template v-else>
<el-dropdown :show-timeout="0">
<span class="el-dropdown-link item-rt"> {{ item.name }}<i class="el-icon-arrow-down el-icon--right"></i> </span>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item v-for="child in item.children" :key="child.id" style="padding: 0;">
<a class="nav-item" :href="child.url" style="display:block;">{{ child.name }}</a>
</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
</template>
</template>
<!-- <div class="app_qrcode_box">
<el-dropdown trigger="hover">
<div class="toptxt flex-1">
<i class="el-dropdown-link iconfont icon-M-phone"></i>
<span>下载APP</span>
</div>
<template #dropdown>
<el-dropdown-menu>
<div class="qrcode-box">
<div class="top-txt flex-4">
<span>帆软社区APP</span>
<a href="https://bbs.fanruan.com/thread-135870-1-1.html" target="_blank">更新说明</a>
</div>
<img class="codeimg" width="162"
src="https://bbs.fanruan.com/source/plugin/app_download/img/new_ios_qrcode.png" />
<div class="foot-txt-gift flex-4">
<img class="img-gift" width="24" src="https://bbs.fanruan.com/static/img/icon_fundction_gift.png" />
<a href="https://bbs.fanruan.com/thread-135868-1-1.html" target="_blank">连续签到,赢取千元大奖</a>
</div>
</div>
</el-dropdown-menu>
</template>
</el-dropdown>
</div> -->
<div class="notice_box">
<el-dropdown trigger="hover">
<el-badge :is-dot="is_dot" class="item badge" type="danger">
<i class="el-dropdown-link iconfont icon-icon_icon-66"></i>
</el-badge>
<template #dropdown>
<el-dropdown-menu class="i_item">
<a :href="com_shequ_url + '/home.php?mod=space&do=notice&view=system'" target="_blank">
<el-dropdown-item class="clearfix">
<span class="i_txt">我的通知</span>
<el-badge class="mark" :value="u_notice" type="danger" />
</el-dropdown-item>
</a>
</el-dropdown-menu>
</template>
</el-dropdown>
</div>
<el-dropdown v-if="com_user_token" class="personal" ref="userDropdown">
<span class="el-dropdown-link"> <span class="el-dropdown-link">
<el-avatar :src="avatarUrl + uid" :size="32" fit="cover" icon="el-icon-user-solid"></el-avatar> <el-avatar :src="avatarUrl + uid" :size="32" fit="cover" icon="el-icon-user-solid"></el-avatar>
<i class="el-icon-arrow-down el-icon--right"></i> <i class="el-icon-arrow-down el-icon--right"></i>
</span> </span>
<template #dropdown> <template #dropdown>
<el-dropdown-menu class="avatar_down"> <el-dropdown-menu class="avatar_down">
<el-dropdown-item v-for="(item, i) in avatarMenu.baseMenu" :key="i" :icon="item.icon"> <avatarDropDown />
<a class="item-nav" :href="item.url">{{ item.name }}</a>
</el-dropdown-item>
<el-divider></el-divider>
<el-dropdown-item v-for="(item, i) in avatarMenu.navMenu" :key="i" :icon="item.icon">
<a class="item-nav" :href="item.url">{{ item.name }}</a>
</el-dropdown-item>
<el-divider></el-divider>
<el-dropdown>
<teacherApplyModal :uid="uid" />
</el-dropdown>
<el-divider></el-divider>
<el-dropdown-item v-for="(item, i) in avatarMenu.adminMenu" :key="i" :icon="item.icon">
<a class="item-nav" :href="item.url">{{ item.name }}</a>
</el-dropdown-item>
<el-divider v-if="avatarMenu.adminMenu?.length > 0"></el-divider>
<el-dropdown-item v-for="(item, i) in avatarMenu.footerMenu" :key="i" :icon="item.icon">
<a class="item-nav" :href="item.url">{{ item.name }}</a>
</el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</template> </template>
</el-dropdown> </el-dropdown>
<div v-else class="loginReg flex-1"> <div v-else class="loginReg flex-1">
<a class="loginbtn" :href="com_id_url + '/cas/login?service=' + com_edu_url + '/v1/user/cas/edu/login/?redirect=' + $route.fullPath">登录</a> <a class="loginbtn" :href="com_id_url + '/cas/login?service=' + com_edu_url + '/v1/user/cas/edu/login/?redirect=' + $route.fullPath">登录</a>
</div> </div>
<!-- 消息 -->
<a class="nav-icon-item my-icon-msg" href="https://home.fanruan.com/message" target="_blank" v-if="com_user_token">
<div class="icon-wrapper">
<span class="nav-badge">
<span class="anticon anticon-bell icon">
<svg viewBox="64 64 896 896" focusable="false" data-icon="bell" width="1em" height="1em" fill="currentColor" aria-hidden="true">
<path d="M816 768h-24V428c0-141.1-104.3-257.7-240-277.1V112c0-22.1-17.9-40-40-40s-40 17.9-40 40v38.9c-135.7 19.4-240 136-240 277.1v340h-24c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h216c0 61.8 50.2 112 112 112s112-50.2 112-112h216c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM512 888c-26.5 0-48-21.5-48-48h96c0 26.5-21.5 48-48 48zM304 768V428c0-55.6 21.6-107.8 60.9-147.1S456.4 220 512 220c55.6 0 107.8 21.6 147.1 60.9S720 372.4 720 428v340H304z"></path>
</svg>
</span>
<sup id="sub_num_box" class="nav-badge-count-sm" v-if="is_dot">
<span>{{ u_notice }}</span>
</sup>
</span>
</div>
<div class="icon-wrapper-tips">通知</div>
</a>
<!-- 账户 -->
<a class="nav-icon-item" href="https://fanruanclub.com/" target="_blank" v-if="com_user_token">
<div class="icon-wrapper">
<span role="img" aria-label="idcard" class="anticon anticon-idcard icon">
<svg viewBox="64 64 896 896" focusable="false" data-icon="idcard" width="1em" height="1em" fill="currentColor" aria-hidden="true">
<path d="M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-40 632H136V232h752v560zM610.3 476h123.4c1.3 0 2.3-3.6 2.3-8v-48c0-4.4-1-8-2.3-8H610.3c-1.3 0-2.3 3.6-2.3 8v48c0 4.4 1 8 2.3 8zm4.8 144h185.7c3.9 0 7.1-3.6 7.1-8v-48c0-4.4-3.2-8-7.1-8H615.1c-3.9 0-7.1 3.6-7.1 8v48c0 4.4 3.2 8 7.1 8zM224 673h43.9c4.2 0 7.6-3.3 7.9-7.5 3.8-50.5 46-90.5 97.2-90.5s93.4 40 97.2 90.5c.3 4.2 3.7 7.5 7.9 7.5H522a8 8 0 008-8.4c-2.8-53.3-32-99.7-74.6-126.1a111.8 111.8 0 0029.1-75.5c0-61.9-49.9-112-111.4-112s-111.4 50.1-111.4 112c0 29.1 11 55.5 29.1 75.5a158.09 158.09 0 00-74.6 126.1c-.4 4.6 3.2 8.4 7.8 8.4zm149-262c28.5 0 51.7 23.3 51.7 52s-23.2 52-51.7 52-51.7-23.3-51.7-52 23.2-52 51.7-52z"></path>
</svg>
</span>
</div>
<div>账户</div>
</a>
</nav> </nav>
</div> </div>
</div>
</header> </header>
<div class="edu-nav-box" v-if="isPc"> <div class="edu-nav-box" v-if="isPc">
<div class="mainbox"> <div class="mainbox">
<div class="edu-head"> <div class="edu-head">
<router-link class="logo" to="/"><img src="@/assets/logo.png"/></router-link>
<div class="edu-nav"> <div class="edu-nav">
<router-link to="/">首页</router-link> <router-link class="item" to="/">首页</router-link>
<router-link to="/studypath/finereport" :class="$route.meta.active == 'studypath' ? 'active' : ''">学习路径 </router-link> <router-link class="item" to="/studypath/finereport" :class="$route.meta.active == 'studypath' ? 'active' : ''">学习路径 </router-link>
<router-link to="/video" :class="$route.meta.active == 'video' ? 'active' : ''">视频课</router-link> <router-link class="item" to="/video" :class="$route.meta.active == 'video' ? 'active' : ''">视频课</router-link>
<router-link to="/class" :class="$route.meta.active == 'class' ? 'active' : ''">学习班</router-link> <router-link class="item" to="/class" :class="$route.meta.active == 'class' ? 'active' : ''">学习班</router-link>
<router-link to="/live" :class="$route.meta.active == 'live' ? 'active' : ''">直播</router-link> <router-link class="item" to="/live" :class="$route.meta.active == 'live' ? 'active' : ''">直播</router-link>
<router-link to="/cityclass" :class="$route.meta.active == 'cityclass' ? 'active' : ''">城市课堂</router-link> <router-link class="item" to="/cityclass" :class="$route.meta.active == 'cityclass' ? 'active' : ''">城市课堂</router-link>
<!-- <router-link to="/more" :class="$route.meta.active == 'more' ? 'active' : ''">资源导航</router-link> --> <teacherApplyModal :uid="uid" />
</div> </div>
</div> </div>
</div> </div>
@ -201,33 +154,13 @@
></i> ></i>
</div> </div>
<el-dropdown v-if="com_user_token" class="personal" ref="userDropdown" trigger="click" style="margin-left: 26px;"> <el-dropdown v-if="com_user_token" class="personal" popper-class="new-dropdown" trigger="click" style="margin-left: 26px;">
<span class="el-dropdown-link"> <span class="el-dropdown-link">
<el-avatar :src="avatarUrl + uid" :size="32" fit="cover" icon="el-icon-user-solid"></el-avatar> <el-avatar :src="avatarUrl + uid" :size="32" fit="cover" icon="el-icon-user-solid"></el-avatar>
</span> </span>
<template #dropdown> <template #dropdown>
<el-dropdown-menu class="avatar_down"> <el-dropdown-menu class="avatar_down">
<el-dropdown-item v-for="(item, i) in avatarMenu.baseMenu" :key="i" :icon="item.icon"> <avatarDropDown />
<a class="item-nav" :href="item.url">{{ item.name }}</a>
</el-dropdown-item>
<el-divider></el-divider>
<el-dropdown-item v-for="(item, i) in avatarMenu.navMenu" :key="i" :icon="item.icon">
<a class="item-nav" :href="item.url">{{ item.name }}</a>
</el-dropdown-item>
<el-divider></el-divider>
<el-dropdown>
<teacherApplyModal :uid="uid" />
</el-dropdown>
<el-divider></el-divider>
<el-dropdown-item v-for="(item, i) in avatarMenu.adminMenu" :key="i" :icon="item.icon">
<a class="item-nav" :href="item.url">{{ item.name }}</a>
</el-dropdown-item>
<el-divider v-if="avatarMenu.adminMenu?.length > 0"></el-divider>
<el-dropdown-item v-for="(item, i) in avatarMenu.footerMenu" :key="i" :icon="item.icon">
<a class="item-nav" :href="item.url">{{ item.name }}</a>
</el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</template> </template>
</el-dropdown> </el-dropdown>
@ -306,10 +239,13 @@ import { getMenuList } from "@/api/nav";
import { getNotice, avatarMenu } from "@/api/user"; import { getNotice, avatarMenu } from "@/api/user";
import store from "@/store"; import store from "@/store";
import { onBeforeRouteUpdate } from "vue-router"; import { onBeforeRouteUpdate } from "vue-router";
import axios from "axios";
import avatarDropDown from "@/components/AvatarDropDown";
export default defineComponent({ export default defineComponent({
components: { components: {
teacherApplyModal, teacherApplyModal,
avatarDropDown,
}, },
name: "Header", name: "Header",
setup() { setup() {
@ -369,14 +305,15 @@ export default defineComponent({
// //
const resNotice = async () => { const resNotice = async () => {
const res = await getNotice(); const res = await axios.get("https://home.fanruan.com/message/open/api/unread/" + store.getters.get_uid);
if (res.code === 200) { if (res.status === 200) {
state.u_notice = res.data.system; state.u_notice = res.data.data;
if (state.u_notice > 0) { if (state.u_notice > 0) {
state.is_dot = true; state.is_dot = true;
} }
} }
}; };
if (store.getters.get_uid) { if (store.getters.get_uid) {
resNotice(); resNotice();
state.uid = store.getters.get_uid; state.uid = store.getters.get_uid;
@ -425,137 +362,50 @@ export default defineComponent({
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.el-divider--horizontal {
margin: 8px 0;
}
.app_qrcode_box {
.toptxt {
i {
font-size: 20px;
margin-top: 3px;
}
span {
font-size: 16px;
}
}
}
.qrcode-box {
width: 220px;
font-size: 14px;
.codeimg {
display: block;
margin: 0 auto;
}
.top-txt {
height: 40px;
a {
color: #8c8c8c;
margin-left: 12px;
}
}
.foot-txt-gift {
height: 40px;
a {
color: #ff7a45;
margin-left: 8px;
}
}
}
.header { .header {
height: 48px; height: 48px;
background: #fff; background: #fff;
padding: 0 40px 0 20px; z-index: 201;
.wrapper { .wrapper {
height: 100%; width: 1200px;
background: #fff; background: #fff;
min-width: 1100px; margin: 0 auto;
display: flex; display: flex;
align-items: flex-start; align-items: center;
justify-content: space-between; justify-content: space-between;
.nav { .nav-lf {
min-width: 400px; .nav-line {
width: 1px;
height: 24px;
background-color: #dbe3ea;
margin: 0 20px;
} }
.nav-logo {
.nav { width: 128px;
position: relative; height: 36px;
overflow: hidden;
.logo-img {
width: 100%;
height: 100%; height: 100%;
display: flex;
align-items: center;
font-size: 16px;
.nav-item {
font-size: 16px;
color: #333;
&:hover {
color: #0082fc;
} }
} }
.nav-title {
.item-lf { font-size: 18px;
margin-left: 26px; color: #17243e;
font-weight: 500;
&.active { text-decoration: none !important;
color: #0082fc; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
}
}
.item-rt {
margin-right: 26px;
} }
} }
.nav-rt {
.infomation { display: inline-flex;
position: relative;
height: 100%;
display: flex;
align-items: center; align-items: center;
justify-content: flex-end;
font-size: 16px;
.nav-item {
font-size: 16px;
color: #333;
&:hover {
color: #0082fc;
}
}
.item-lf {
margin-right: 20px;
}
.item-rt {
margin-right: 26px;
}
::v-deep .el-dropdown.personal {
width: 32px;
height: 32px;
margin-left: 24px;
border-radius: 50%;
overflow: hidden;
z-index: 99;
}
}
.search-box { .search-box {
height: 48px; height: 48px;
margin: 0 auto; margin: 0 auto;
width: 40%; width: 460px;
transition: all 0.2s; transition: all 0.2s;
.searchform { .searchform {
@ -606,43 +456,111 @@ export default defineComponent({
color: #8496ab !important; color: #8496ab !important;
} }
} }
.infomation {
position: relative;
height: 100%;
display: flex;
align-items: center;
justify-content: flex-end;
font-size: 16px;
gap: 24px;
.nav-icon-item {
font-size: 12px;
line-height: 15px;
cursor: pointer;
color: #5f7188;
text-decoration: none !important;
&.my-icon-msg {
line-height: 13px;
} }
.icon {
font-size: 18px;
color: #5f7188;
}
.icon-wrapper {
color: #5f7188;
display: flex;
align-items: center;
justify-content: center;
} }
/*响应式-小屏幕*/ .nav-badge {
@media screen and (max-width: 1800px) { position: relative;
.search-box { }
width: 36% !important; .nav-badge-count-sm {
position: absolute;
top: 0px;
inset-inline-end: 0;
transform: translate(50%, -50%);
transform-origin: 100% 0%;
min-width: 14px;
height: 14px;
font-size: 12px;
line-height: 14px;
border-radius: 7px;
background: #ff4d4f;
color: #fff;
text-align: center;
} }
} }
@media screen and (max-width: 1700px) { ::v-deep .el-dropdown.personal {
.search-box { width: 32px;
width: 32% !important; height: 32px;
margin-left: 24px;
border-radius: 50%;
overflow: hidden;
z-index: 99;
}
}
}
} }
} }
@media screen and (max-width: 1600px) { .el-divider--horizontal {
.search-box { margin: 8px 0;
width: 28% !important;
} }
.app_qrcode_box {
.toptxt {
i {
font-size: 20px;
margin-top: 3px;
} }
@media screen and (max-width: 1500px) { span {
.search-box { font-size: 16px;
width: 25% !important; }
} }
} }
@media screen and (max-width: 1400px) { .qrcode-box {
.search-box { width: 220px;
width: 20% !important; font-size: 14px;
.codeimg {
display: block;
margin: 0 auto;
}
.top-txt {
height: 40px;
a {
color: #8c8c8c;
margin-left: 12px;
} }
} }
@media screen and (max-width: 1300px) { .foot-txt-gift {
.search-box { height: 40px;
width: 15% !important;
a {
color: #ff7a45;
margin-left: 8px;
}
} }
} }
@ -663,14 +581,10 @@ export default defineComponent({
} }
.avatar_down { .avatar_down {
width: 234px; width: 340px;
display: flex; padding: 0 20px;
justify-content: space-between; background-color: #ffffff;
flex-wrap: wrap; background-clip: padding-box;
.item-nav {
display: inline-block;
}
} }
.avatar_down li:hover { .avatar_down li:hover {
@ -747,28 +661,30 @@ export default defineComponent({
</style> </style>
<style lang="scss"> <style lang="scss">
.edu-head {
height: 70px;
background: #fff;
display: flex;
justify-content: space-between;
align-items: center;
}
.edu-head .logo img { .edu-head .logo img {
height: 34px; height: 34px;
} }
.edu-nav a {
margin-left: 40px;
font-size: 18px;
}
.edu-nav-box { .edu-nav-box {
background: #fff; background: #fff;
box-shadow: 0px 4px 6px -3px rgba(179, 193, 211, 0.3); box-shadow: 0px 5px 6px -3px rgba(179, 193, 211, 0.3);
z-index: 6; z-index: 200;
position: relative; position: relative;
.edu-head {
height: 48px;
background: #fff;
display: flex;
align-items: center;
.edu-nav {
display: inline-flex;
align-items: center;
gap: 24px;
.item {
font-size: 16px;
}
}
}
} }
.el-dropdown-menu__item { .el-dropdown-menu__item {
@ -903,3 +819,21 @@ export default defineComponent({
} }
} }
</style> </style>
<style lang="scss">
@media screen and (max-width: 600px) {
.avatar_down {
width: 300px !important;
}
}
</style>
<style>
.new-dropdown {
position: absolute !important;
z-index: 2003 !important;
border: none !important;
border-radius: 8px;
box-shadow: 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 9px 28px 8px rgba(0, 0, 0, 0.05);
}
</style>

305
src/components/TeacherApply/TeacherApplyModal - old.vue

@ -0,0 +1,305 @@
<template>
<a :href="com_edu_url + '/v2'" class="til f16 fw600" v-if="isTeacher" target="_blank">
<div class="item-nav apply_trigger_btn">
<i class="iconfont icon-icon_icon-37" />
讲师工作台
</div>
</a>
<div @click="showModal" class="item-nav apply_trigger_btn" v-else>
<i class="iconfont icon-icon_icon-37" />
讲师入驻
<span class="apply_trigger_btn_watting_text" v-if="form.teacherId && form.status === 0">审核中</span>
</div>
<el-dialog custom-class="teacher-apply-dialog" v-model="qrDialogVisible">
<template #title>
<p class="success-dialog__title">
<img src="../../assets/teacherapply/watting.png" class="icon" />
申请已提交待管理员审核
</p>
</template>
<div>
<p>请联系管理员 放大镜微信号frfangdajing</p>
<img src="@/assets/teacherapply/fangdajing_qrcode.png" class="qrimg"/>
<p>微信扫一扫添加管理员微信</p>
<el-button class="success-dialog__btn" type="primary" @click="qrDialogVisible = false">我知道了</el-button>
</div>
</el-dialog>
<el-dialog :width="640" :close-on-click-modal="false" custom-class="teacher-apply-dialog" v-model="dialogVisible" title="申请讲师入驻">
<div class="teacher-apply-dialog_tips">
<i class="iconfont icon-tanhao1" />提交申请后请联系放大镜微信号frfangdajing</div>
<div class="teacher-apply-dialog_form">
<el-form label-suffix=":" :rules="rules" :model="form" ref="ruleFormRef">
<el-form-item label="讲师名称" :label-width="formLabelWidth" required prop="name">
<el-input show-word-limit v-model="form.name" autocomplete="off" placeholder="请输入" maxlength="50"/>
</el-form-item>
<el-form-item label="讲师头像" :label-width="formLabelWidth" prop="avatar">
<teacherApplyUpload @onDelete="deleteAvatar" @onUpload="handleFileSuccess" :default-avatar="form.avatar"/>
</el-form-item>
<el-form-item label="联系电话" :label-width="formLabelWidth" prop="phone">
<div class="mobile_row">
{{form.avatar}}
<span v-if="form.phone" class="mobile_number">
{{form.phone}}
</span>
<span v-else>请先绑定手机号</span>
仅对管理员可见便于管理员联系您
</div>
<div class="mobile_row tips_text" v-if="form.phone">
手机号不对请至<a :href="com_id_url+'/#/info/'" target="_blank">账号中心</a>修改
</div>
</el-form-item>
<el-form-item label="讲师介绍" :label-width="formLabelWidth" required prop="introduction">
<el-input type="textarea" show-word-limit v-model="form.introduction" autocomplete="off" placeholder="请输入" maxlength="500"/>
</el-form-item>
</el-form>
</div>
<template #footer>
<span class="dialog-footer">
<el-button @click="dialogVisible = false">取消</el-button>
<el-button :loading="submitLoading" type="primary" @click="submitForm(ruleFormRef)"
>确定</el-button
>
</span>
</template>
</el-dialog>
</template>
<script lang="ts">
import {defineComponent, reactive, ref} from 'vue'
import teacherApplyUpload from './Upload/TeacherApplyUpload';
import { ElMessage } from 'element-plus'
import { addTeacher, getTeacherInfo, editTeacher, judgeIsTeacher } from "../../api/teacher"
export default defineComponent({
name: 'TeacherApplyModal',
props:{
uid:undefined
},
components:{
teacherApplyUpload
},
setup(props) {
const isTeacher = ref(false);
const dialogVisible = ref(false);
const qrDialogVisible = ref(false);
const submitLoading = ref(false);
const ruleFormRef = ref();
const form = reactive({
status: 0,
teacherId: '',
name: '',
phone: '',
introduction: '',
avatar:'',
})
const judgeIfTeacher = async () => {
const judgeRes = await judgeIsTeacher(props.uid)
if (judgeRes.code === 200){
isTeacher.value = judgeRes.data;
}
}
judgeIfTeacher();
const getInfo = async () => {
console.log('获取用户资料');
const res = await getTeacherInfo();
if (res.code === 200 && res.data){
const {name = '', avatar = '',introduction = '', id= '', phone=''} = res.data;
form.phone = phone;
form.name = name;
form.avatar = avatar;
form.introduction = introduction;
form.teacherId = id;
form.status=res.data.approvalState;
}
}
const showModal = () => {
getInfo();
dialogVisible.value = true
}
//
const rules = reactive({
name: [
{ required: true, message: '请输入讲师姓名', trigger: 'blur' },
{ min: 0, max: 50, message: '字符长度在0-50', trigger: 'blur' },
],
introduction: [
{ required: true, message: '请输入讲师介绍', trigger: 'blur' },
{ min: 0, max: 500, message: '字符长度在0-500', trigger: 'blur' },
],
phone: [
{ required: true, message: '请填写手机号', trigger: 'blur' },
],
})
const handleFileSuccess = (response) => {
console.log('上传成功收到回调');
console.log(response);
form.avatar = response.path;
}
const deleteAvatar = () => {
form.avatar = '';
}
const submitForm = async (formEl) => {
if (!formEl) return
await formEl.validate(async (valid) => {
if (valid) {
console.log('submit!');
console.log(form);
submitLoading.value=true;
try {
let res;
if (form.teacherId){
res = await editTeacher(form.teacherId,{...form});
} else {
res = await addTeacher({...form});
}
if (res.code === 200 && res.message === 'success'){
submitLoading.value=false;
dialogVisible.value = false;
qrDialogVisible.value=true;
} else {
ElMessage({
message: '提交申请失败,请稍后重试',
type: 'warning',
})
submitLoading.value=false;
}
} catch (e) {
ElMessage({
message: '提交申请失败,请稍后重试',
type: 'warning',
})
submitLoading.value=false;
}
}
})
}
return {
isTeacher,
dialogVisible,
form,
ruleFormRef,
formLabelWidth: 140,
submitForm,
rules,
qrDialogVisible,
submitLoading,
handleFileSuccess,
deleteAvatar,
showModal,
}
}
})
</script>
<style lang="scss">
.apply_trigger_btn{
font-size: 14px;
font-weight: 400;
color: #606266;
cursor: pointer;
display: flex;
align-items: center;
margin: 10px 0;
margin-left: 20px;
user-select: none;
i{
margin-right: 5px;
}
&:hover{
color: #0082FC;
}
&_watting_text{
color: #FFA940;
margin-left: 5px;
}
}
.teacher-apply-dialog{
&_tips{
background-color: #FFFBE6;
height: 40px;
display: flex;
align-items: center;
font-size: 14px;
color: #515a6e;
padding-left: 24px;
i{
margin-right: 16px;
color: #FFA940;
}
}
.el-dialog__body{
padding: 0;
}
.el-dialog__header{
text-align: left;
}
.el-dialog__footer{
border-top:1px solid #E8E8E8;
padding: 10px 16px;
}
.success-dialog__title{
font-size: 16px;
font-weight: bold;
color: #17243e;
line-height: 22px;
display: flex;
align-items: center;
justify-content: center;
.icon{
margin-right: 10px;
width: 20px;
height: 20px;
}
}
.success-dialog__btn{
margin: 24px 0;
}
.qrimg{
margin-top: 16px;
width: 115px;
height: 115px;
margin-bottom: 8px;
}
&_form{
padding-left: 24px;
padding-right: 120px;
padding-top: 16px;
.tips_text{
color: #c5c7ce;
}
.el-upload-dragger{
border: none;
width: auto;
height: auto;
//position: relative;
//right: 25px;
}
.el-upload__tip{
color: #c5c7ce;
margin-top: 0;
text-align: left;
line-height: 20px;
flex: 1;
.delete_btn{
color: #0082fc;
cursor: pointer;
margin-top: 20px;
&:hover{
opacity: 0.6;
}
}
}
.mobile_row{
display: flex;
align-items: center;
font-size:14px;
a{
color: #0082FC;
}
.mobile_number{
color: #262626;
margin-right: 10px;
}
}
}
}
</style>

130
src/components/TeacherApply/TeacherApplyModal.vue

@ -1,15 +1,16 @@
<template> <template>
<a :href="com_edu_url + '/v2'" class="til f16 fw600" v-if="isTeacher" target="_blank"> <div v-if="com_user_token">
<div class="item-nav apply_trigger_btn"> <a :href="com_edu_url + '/v2'" class="讲师工作台" v-if="isTeacher">
<i class="iconfont icon-icon_icon-37" />
讲师工作台 讲师工作台
</div>
</a> </a>
<div @click="showModal" class="item-nav apply_trigger_btn" v-else> <a href="javascript:;" @click="showModal" class="item" v-else>
<i class="iconfont icon-icon_icon-37" />
讲师入驻 讲师入驻
<span class="apply_trigger_btn_watting_text" v-if="form.teacherId && form.status === 0">审核中</span> </a>
</div>
<div v-else>
<a class="item" :href="com_login_url">讲师入驻</a>
</div> </div>
<el-dialog custom-class="teacher-apply-dialog" v-model="qrDialogVisible"> <el-dialog custom-class="teacher-apply-dialog" v-model="qrDialogVisible">
<template #title> <template #title>
<p class="success-dialog__title"> <p class="success-dialog__title">
@ -24,9 +25,9 @@
<el-button class="success-dialog__btn" type="primary" @click="qrDialogVisible = false">我知道了</el-button> <el-button class="success-dialog__btn" type="primary" @click="qrDialogVisible = false">我知道了</el-button>
</div> </div>
</el-dialog> </el-dialog>
<el-dialog :width="640" :close-on-click-modal="false" custom-class="teacher-apply-dialog" v-model="dialogVisible" title="申请讲师入驻"> <el-dialog :width="640" :close-on-click-modal="false" custom-class="teacher-apply-dialog" v-model="dialogVisible" title="申请讲师入驻">
<div class="teacher-apply-dialog_tips"> <div class="teacher-apply-dialog_tips"><i class="iconfont icon-tanhao1" />提交申请后请联系放大镜微信号frfangdajing</div>
<i class="iconfont icon-tanhao1" />提交申请后请联系放大镜微信号frfangdajing</div>
<div class="teacher-apply-dialog_form"> <div class="teacher-apply-dialog_form">
<el-form label-suffix=":" :rules="rules" :model="form" ref="ruleFormRef"> <el-form label-suffix=":" :rules="rules" :model="form" ref="ruleFormRef">
<el-form-item label="讲师名称" :label-width="formLabelWidth" required prop="name"> <el-form-item label="讲师名称" :label-width="formLabelWidth" required prop="name">
@ -44,9 +45,7 @@
<span v-else>请先绑定手机号</span> <span v-else>请先绑定手机号</span>
仅对管理员可见便于管理员联系您 仅对管理员可见便于管理员联系您
</div> </div>
<div class="mobile_row tips_text" v-if="form.phone"> <div class="mobile_row tips_text" v-if="form.phone">手机号不对请至<a :href="com_id_url + '/#/info/'" target="_blank">账号中心</a>修改</div>
手机号不对请至<a :href="com_id_url+'/#/info/'" target="_blank">账号中心</a>修改
</div>
</el-form-item> </el-form-item>
<el-form-item label="讲师介绍" :label-width="formLabelWidth" required prop="introduction"> <el-form-item label="讲师介绍" :label-width="formLabelWidth" required prop="introduction">
<el-input type="textarea" show-word-limit v-model="form.introduction" autocomplete="off" placeholder="请输入" maxlength="500" /> <el-input type="textarea" show-word-limit v-model="form.introduction" autocomplete="off" placeholder="请输入" maxlength="500" />
@ -56,26 +55,24 @@
<template #footer> <template #footer>
<span class="dialog-footer"> <span class="dialog-footer">
<el-button @click="dialogVisible = false">取消</el-button> <el-button @click="dialogVisible = false">取消</el-button>
<el-button :loading="submitLoading" type="primary" @click="submitForm(ruleFormRef)" <el-button :loading="submitLoading" type="primary" @click="submitForm(ruleFormRef)">确定</el-button>
>确定</el-button
>
</span> </span>
</template> </template>
</el-dialog> </el-dialog>
</template> </template>
<script lang="ts"> <script lang="ts">
import {defineComponent, reactive, ref} from 'vue' import { defineComponent, reactive, ref } from "vue";
import teacherApplyUpload from './Upload/TeacherApplyUpload'; import teacherApplyUpload from "./Upload/TeacherApplyUpload";
import { ElMessage } from 'element-plus' import { ElMessage } from "element-plus";
import { addTeacher, getTeacherInfo, editTeacher, judgeIsTeacher } from "../../api/teacher" import { addTeacher, getTeacherInfo, editTeacher, judgeIsTeacher } from "../../api/teacher";
export default defineComponent({ export default defineComponent({
name: 'TeacherApplyModal', name: "TeacherApplyModal",
props: { props: {
uid:undefined uid: undefined,
}, },
components: { components: {
teacherApplyUpload teacherApplyUpload,
}, },
setup(props) { setup(props) {
const isTeacher = ref(false); const isTeacher = ref(false);
@ -85,24 +82,24 @@ export default defineComponent({
const ruleFormRef = ref(); const ruleFormRef = ref();
const form = reactive({ const form = reactive({
status: 0, status: 0,
teacherId: '', teacherId: "",
name: '', name: "",
phone: '', phone: "",
introduction: '', introduction: "",
avatar:'', avatar: "",
}) });
const judgeIfTeacher = async () => { const judgeIfTeacher = async () => {
const judgeRes = await judgeIsTeacher(props.uid) const judgeRes = await judgeIsTeacher(props.uid);
if (judgeRes.code === 200) { if (judgeRes.code === 200) {
isTeacher.value = judgeRes.data; isTeacher.value = judgeRes.data;
} }
} };
judgeIfTeacher(); judgeIfTeacher();
const getInfo = async () => { const getInfo = async () => {
console.log('获取用户资料'); console.log("获取用户资料");
const res = await getTeacherInfo(); const res = await getTeacherInfo();
if (res.code === 200 && res.data) { if (res.code === 200 && res.data) {
const {name = '', avatar = '',introduction = '', id= '', phone=''} = res.data; const { name = "", avatar = "", introduction = "", id = "", phone = "" } = res.data;
form.phone = phone; form.phone = phone;
form.name = name; form.name = name;
form.avatar = avatar; form.avatar = avatar;
@ -110,39 +107,37 @@ export default defineComponent({
form.teacherId = id; form.teacherId = id;
form.status = res.data.approvalState; form.status = res.data.approvalState;
} }
} };
const showModal = () => { const showModal = () => {
getInfo(); getInfo();
dialogVisible.value = true dialogVisible.value = true;
} };
// //
const rules = reactive({ const rules = reactive({
name: [ name: [
{ required: true, message: '请输入讲师姓名', trigger: 'blur' }, { required: true, message: "请输入讲师姓名", trigger: "blur" },
{ min: 0, max: 50, message: '字符长度在0-50', trigger: 'blur' }, { min: 0, max: 50, message: "字符长度在0-50", trigger: "blur" },
], ],
introduction: [ introduction: [
{ required: true, message: '请输入讲师介绍', trigger: 'blur' }, { required: true, message: "请输入讲师介绍", trigger: "blur" },
{ min: 0, max: 500, message: '字符长度在0-500', trigger: 'blur' }, { min: 0, max: 500, message: "字符长度在0-500", trigger: "blur" },
], ],
phone: [ phone: [{ required: true, message: "请填写手机号", trigger: "blur" }],
{ required: true, message: '请填写手机号', trigger: 'blur' }, });
],
})
const handleFileSuccess = (response) => { const handleFileSuccess = (response) => {
console.log('上传成功收到回调'); console.log("上传成功收到回调");
console.log(response); console.log(response);
form.avatar = response.path; form.avatar = response.path;
} };
const deleteAvatar = () => { const deleteAvatar = () => {
form.avatar = ''; form.avatar = "";
} };
const submitForm = async (formEl) => { const submitForm = async (formEl) => {
if (!formEl) return if (!formEl) return;
await formEl.validate(async (valid) => { await formEl.validate(async (valid) => {
if (valid) { if (valid) {
console.log('submit!'); console.log("submit!");
console.log(form); console.log(form);
submitLoading.value = true; submitLoading.value = true;
try { try {
@ -152,27 +147,27 @@ export default defineComponent({
} else { } else {
res = await addTeacher({ ...form }); res = await addTeacher({ ...form });
} }
if (res.code === 200 && res.message === 'success'){ if (res.code === 200 && res.message === "success") {
submitLoading.value = false; submitLoading.value = false;
dialogVisible.value = false; dialogVisible.value = false;
qrDialogVisible.value = true; qrDialogVisible.value = true;
} else { } else {
ElMessage({ ElMessage({
message: '提交申请失败,请稍后重试', message: "提交申请失败,请稍后重试",
type: 'warning', type: "warning",
}) });
submitLoading.value = false; submitLoading.value = false;
} }
} catch (e) { } catch (e) {
ElMessage({ ElMessage({
message: '提交申请失败,请稍后重试', message: "提交申请失败,请稍后重试",
type: 'warning', type: "warning",
}) });
submitLoading.value = false; submitLoading.value = false;
} }
} }
}) });
} };
return { return {
isTeacher, isTeacher,
dialogVisible, dialogVisible,
@ -186,9 +181,9 @@ export default defineComponent({
handleFileSuccess, handleFileSuccess,
deleteAvatar, deleteAvatar,
showModal, showModal,
} };
} },
}) });
</script> </script>
<style lang="scss"> <style lang="scss">
.apply_trigger_btn { .apply_trigger_btn {
@ -205,16 +200,17 @@ export default defineComponent({
margin-right: 5px; margin-right: 5px;
} }
&:hover { &:hover {
color: #0082FC; color: #0082fc;
} }
&_watting_text { &_watting_text {
color: #FFA940; color: #ffa940;
margin-left: 5px; margin-left: 5px;
} }
} }
.teacher-apply-dialog { .teacher-apply-dialog {
z-index: 100;
&_tips { &_tips {
background-color: #FFFBE6; background-color: #fffbe6;
height: 40px; height: 40px;
display: flex; display: flex;
align-items: center; align-items: center;
@ -223,7 +219,7 @@ export default defineComponent({
padding-left: 24px; padding-left: 24px;
i { i {
margin-right: 16px; margin-right: 16px;
color: #FFA940; color: #ffa940;
} }
} }
.el-dialog__body { .el-dialog__body {
@ -233,7 +229,7 @@ export default defineComponent({
text-align: left; text-align: left;
} }
.el-dialog__footer { .el-dialog__footer {
border-top:1px solid #E8E8E8; border-top: 1px solid #e8e8e8;
padding: 10px 16px; padding: 10px 16px;
} }
.success-dialog__title { .success-dialog__title {
@ -293,7 +289,7 @@ export default defineComponent({
align-items: center; align-items: center;
font-size: 14px; font-size: 14px;
a { a {
color: #0082FC; color: #0082fc;
} }
.mobile_number { .mobile_number {
color: #262626; color: #262626;

28
src/components/banner.vue

@ -112,15 +112,7 @@
</div> </div>
<div class="mbg ad-m dn"> <div class="mbg ad-m dn">
<a :href="cover.click_url" target="_blank"> <div id="AD-M-1d4b2f969fcd43a99205e88c53b05d8d"></div>
<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> </div>
</template> </template>
@ -155,7 +147,20 @@ export default {
// fetchgetCover(); // fetchgetCover();
// banner 广 // 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.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 fetchgetcateHot = async (class1) => {
const res = await getcateHot(class1); const res = await getcateHot(class1);
@ -425,5 +430,10 @@ export default {
margin: 0 auto; margin: 0 auto;
display: block; display: block;
} }
::v-deep .ad-m-banner {
width: 100% !important;
height: auto !important;
border-radius: 8px;
}
} }
</style> </style>

26
src/main.js

@ -33,17 +33,17 @@ app.use(VueWechatTitle)
app.use(jsSeamlessScroll) app.use(jsSeamlessScroll)
app.mount('#app') app.mount('#app')
router.afterEach(() => { router.afterEach(() => {
setTimeout(() => { // setTimeout(() => {
//百度统计 // //百度统计
var _hmt = _hmt || []; // var _hmt = _hmt || [];
(function () { // (function () {
//每次执行前,先移除上次插入的代码 // //每次执行前,先移除上次插入的代码
document.getElementById('baidu_tj') && document.getElementById('baidu_tj').remove(); // document.getElementById('baidu_tj') && document.getElementById('baidu_tj').remove();
var hm = document.createElement("script"); // var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?f4d7d83c565e698bd7cedfe9c6297055"; // hm.src = "https://hm.baidu.com/hm.js?f4d7d83c565e698bd7cedfe9c6297055";
hm.id = "baidu_tj" // hm.id = "baidu_tj"
var s = document.getElementsByTagName("script")[0]; // var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s); // s.parentNode.insertBefore(hm, s);
})(); // })();
}, 0); // }, 0);
}); });

6
src/router.js

@ -73,6 +73,7 @@ const routes = [
component: () => import('@/views/class/indexClass.vue'), component: () => import('@/views/class/indexClass.vue'),
meta: { meta: {
title: '学习班 - 帆软学院', title: '学习班 - 帆软学院',
isMobile: 1,
}, },
}, },
@ -86,6 +87,7 @@ const routes = [
meta: { meta: {
title: '课程章节 - 学习班', title: '课程章节 - 学习班',
active: 'class', active: 'class',
isMobile: 1,
}, },
children: [ children: [
{ {
@ -96,6 +98,7 @@ const routes = [
title: '课程章节 - 学习班', title: '课程章节 - 学习班',
active: 'class', active: 'class',
tab: 'class_lesson', tab: 'class_lesson',
isMobile: 1,
}, },
}, },
{ {
@ -105,6 +108,7 @@ const routes = [
meta: { meta: {
title: '我的作业 - 学习班', title: '我的作业 - 学习班',
active: 'class', active: 'class',
isMobile: 1,
}, },
}, },
{ {
@ -115,6 +119,7 @@ const routes = [
title: '班级论坛 - 学习班', title: '班级论坛 - 学习班',
active: 'class', active: 'class',
tab: 'class_forum', tab: 'class_forum',
isMobile: 1,
}, },
}, },
{ {
@ -125,6 +130,7 @@ const routes = [
title: '班级论坛 - 学习班', title: '班级论坛 - 学习班',
active: 'class', active: 'class',
tab: 'class_forum', 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 adId2 如果adId没有匹配到则显示第二个广告位
* @param top 顶边距 * @param top 顶边距
* @param bottom 底边距 * @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 { debug, dev } = fineAd.options;
const dataPath = dev ? 'test' : 'prod'; 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) { .then(function (res) {
var isAdId = false; var isAdId = false;
res.data.forEach((item) => { res.data.forEach((item) => {
@ -49,9 +54,11 @@ const getAdvertisement = async ({adId, adId2, top, bottom}) => {
console.log('picSize',getSize); console.log('picSize',getSize);
console.log('top',top); console.log('top',top);
console.log('bottom',bottom); console.log('bottom',bottom);
console.log('className',className);
console.log('needMobile',needMobile);
console.groupEnd(); console.groupEnd();
} }
let adDomId = document.getElementById('AD-' + adId); let adDomId = document.getElementById(fineAd.options.domId + adId);
adDomId.innerHTML=''; adDomId.innerHTML='';
window.fineAd.adMargin({ adId:adId, top:top }); window.fineAd.adMargin({ adId:adId, top:top });
// 无链接图片广告 // 无链接图片广告
@ -60,7 +67,7 @@ const getAdvertisement = async ({adId, adId2, top, bottom}) => {
} }
// 有链接图片广告 // 有链接图片广告
if(item.adLink && item.type===1){ 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){ if(item.adLink && item.type===2){
@ -84,7 +91,7 @@ const getAdvertisement = async ({adId, adId2, top, bottom}) => {
console.log('bottom',bottom); console.log('bottom',bottom);
console.groupEnd(); console.groupEnd();
} }
let adDomId = document.getElementById('AD-' + adId2); let adDomId = document.getElementById(fineAd.options.domId + adId2);
adDomId.innerHTML=''; adDomId.innerHTML='';
window.fineAd.adMargin({ adId:adId2, top:top }); window.fineAd.adMargin({ adId:adId2, top:top });
// 有链接图片广告 // 有链接图片广告
@ -112,7 +119,7 @@ const getAdvertisement = async ({adId, adId2, top, bottom}) => {
* @param bottom 底边距 * @param bottom 底边距
*/ */
const adMargin = ({ adId, top = 0, bottom = 0 }) => { const adMargin = ({ adId, top = 0, bottom = 0 }) => {
let adDomId = document.getElementById('AD-' + adId); let adDomId = document.getElementById(fineAd.options.domId + adId);
if(top > 0){ if(top > 0){
adDomId.innerHTML+=`<div style="height:${top}px;"></div>`; adDomId.innerHTML+=`<div style="height:${top}px;"></div>`;
}else if(bottom > 0){ }else if(bottom > 0){

275
src/views/class/class.vue

@ -8,9 +8,8 @@
</div> </div>
<div class="ress flex-3" v-if="topInfo.progress_learning"> <div class="ress flex-3" v-if="topInfo.progress_learning">
<div class="ressbox study-progress flex-2"> <div class="ressbox study-progress flex-2">
<p class="fw500">我的学习进度 {{topInfo.progress_learning.progress}}/{{topInfo.progress_learning.total}}</p> <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 class="progress" :show-text="false" color="#0082FC" :percentage="topInfo.proLearning"> </el-progress>
</el-progress>
<div class="last-class f12 flex-1"> <div class="last-class f12 flex-1">
<span class="col617">上次学至</span> <span class="col617">上次学至</span>
@ -19,23 +18,39 @@
<span>{{ topInfo.last_study.title }}</span> <span>{{ topInfo.last_study.title }}</span>
</el-tooltip> </el-tooltip>
</a> </a>
</div> </div>
</div> </div>
<div class="ressbox task-progress flex-2"> <div class="ressbox task-progress flex-2">
<p class="fw500">我的作业进度 {{topInfo.progress_homework.progress}}/{{topInfo.progress_homework.total}}</p> <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 class="progress" :show-text="false" color="#27C346" :percentage="topInfo.proHomework"> </el-progress>
</el-progress>
<div class="meta flex-1"> <div class="meta flex-1">
<div class="li col617 flex-1" style="margin-right: 38px;"><span>我的作业平均分</span> <div class="li col617 flex-1" style="margin-right: 38px;">
<span>我的作业平均分</span>
<strong>{{ topInfo.average }}</strong> <strong>{{ topInfo.average }}</strong>
</div> </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>
</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> </div>
</div> </div>
@ -48,42 +63,27 @@
<!-- 左侧布局 --> <!-- 左侧布局 -->
<div class="lf-box"> <div class="lf-box">
<div v-if="topInfo.teacher === 1"> <div v-if="topInfo.teacher === 1">
<el-menu :router="true" :default-active=" $route.name === 'class_lesson' ? `/class/${classid}` : 0" <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">
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><a :href="'https://bbs.fanruan.com/classroom/'+classid+'/student'" target="_blank">学生管理</a></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><a :href="'https://bbs.fanruan.com/classroom/'+classid+'/homework'" target="_blank">批改作业</a></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><a :href="'https://bbs.fanruan.com/classroom/'+classid+'/schedule'" target="_blank">教学进度管理</a></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-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>
</el-menu> </el-menu>
</div> </div>
<div v-else> <div v-else>
<el-menu :router="true" :default-active=" $route.name === 'class_lesson' ? `/class/${classid}` : 0" <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">
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/'+classid" :class="$route.name === 'class_lesson' ? 'is-active':'' ">课程章节 <el-menu-item :index="'/class/homework/' + classid" :class="$route.name === 'class_homework' ? 'is-active' : ''">我的作业</el-menu-item>
</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-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> </el-menu>
</div> </div>
<router-view /> <router-view />
</div> </div>
<!-- 右侧布局 --> <!-- 右侧布局 -->
<div class="rt-box"> <div class="rt-box m-dn">
<classRight @getCertId="getCertId" /> <classRight @getCertId="getCertId" />
</div> </div>
</div> </div>
</div> </div>
</div> </div>
@ -91,14 +91,11 @@
<div v-else> <div v-else>
<el-empty :image-size="200" :description="msg" v-if="empty"></el-empty> <el-empty :image-size="200" :description="msg" v-if="empty"></el-empty>
</div> </div>
</template> </template>
<script> <script>
import { useRoute } from 'vue-router' import { useRoute } from "vue-router";
import { getPublicTop } from "@/api/study"; import { getPublicTop, getClassInfo } from "@/api/study";
import { reactive, toRefs } from "vue"; import { reactive, toRefs } from "vue";
import classRight from "@/views/class/classRight.vue"; import classRight from "@/views/class/classRight.vue";
import msgLogin from "@/components/msgLogin"; import msgLogin from "@/components/msgLogin";
@ -108,7 +105,7 @@
msgLogin, msgLogin,
}, },
setup() { setup() {
const route = useRoute() const route = useRoute();
const classid = route.params.classid; const classid = route.params.classid;
const state = reactive({ const state = reactive({
topInfo: [], topInfo: [],
@ -116,8 +113,31 @@
msg: 0, msg: 0,
empty: false, empty: false,
certId: undefined, // id 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 resPublicTop = async () => {
const res = await getPublicTop(classid); const res = await getPublicTop(classid);
if (res.code === 200) { if (res.code === 200) {
@ -146,24 +166,171 @@
const getCertId = (res) => { const getCertId = (res) => {
state.certId = res; state.certId = res;
} };
return { return {
classid, classid,
getCertId, getCertId,
calcProgress, calcProgress,
...toRefs(state), ...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 {
white-space: nowrap;
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> <style lang="scss" scoped>
.main { .main {
width: 100%; width: 100%;
height: 204px; height: 204px;
background: #F1F8FF; background: #f1f8ff;
margin-bottom: 24px; margin-bottom: 24px;
} }
@ -171,7 +338,7 @@
height: 204px; height: 204px;
display: flex; display: flex;
align-items: center; 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%; background-size: auto 100%;
} }
@ -194,9 +361,8 @@
height: 24px; height: 24px;
padding: 0 10px; padding: 0 10px;
border-radius: 4px; border-radius: 4px;
background: linear-gradient(90deg, #00B8FE 0%, #0082FC 100%); background: linear-gradient(90deg, #00b8fe 0%, #0082fc 100%);
} }
} }
.ress { .ress {
@ -207,7 +373,7 @@
height: 68px; height: 68px;
.el-progress-bar__outer { .el-progress-bar__outer {
background-color: #BBD8FA; background-color: #bbd8fa;
} }
.last-til { .last-til {
@ -232,12 +398,9 @@
color: #333; color: #333;
} }
} }
} }
} }
} }
} }
.rt-box { .rt-box {
@ -268,17 +431,17 @@
} }
.el-tabs__nav-wrap::after { .el-tabs__nav-wrap::after {
background-color: #CEDDF2; background-color: #ceddf2;
height: 1px; height: 1px;
} }
.el-menu.el-menu--horizontal { .el-menu.el-menu--horizontal {
border-bottom: solid 1px #CEDDF2; border-bottom: solid 1px #ceddf2;
} }
</style> </style>
<style> <style>
.ressbox .el-progress-bar__outer { .ressbox .el-progress-bar__outer {
background-color: #BBD8FA; background-color: #bbd8fa;
} }
</style> </style>

19
src/views/class/classMenu.vue

@ -2,22 +2,21 @@
<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 :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/' + 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="'/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-item><a :href="com_shequ_url + '/certification'" target="_blank">相关认证</a></el-menu-item>
</el-menu> </el-menu>
</template> </template>
<script> <script>
import { useRoute } from 'vue-router' import { useRoute } from "vue-router";
export default { export default {
setup() { setup() {
const route = useRoute() const route = useRoute();
const classid = route.params.classid; const classid = route.params.classid;
return { return {
classid classid,
} };
} },
} };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@ -40,11 +39,11 @@
} }
.el-tabs__nav-wrap::after { .el-tabs__nav-wrap::after {
background-color: #CEDDF2; background-color: #ceddf2;
height: 1px; height: 1px;
} }
.el-menu.el-menu--horizontal { .el-menu.el-menu--horizontal {
border-bottom: solid 1px #CEDDF2; border-bottom: solid 1px #ceddf2;
} }
</style> </style>

137
src/views/class/class_homework.vue

@ -1,5 +1,4 @@
<template> <template>
<el-skeleton :loading="loading" animated> <el-skeleton :loading="loading" animated>
<template #template> <template #template>
<el-skeleton-item variant="h1" style="margin-top: 24px;" animated /> <el-skeleton-item variant="h1" style="margin-top: 24px;" animated />
@ -7,8 +6,7 @@
</template> </template>
<template #default> <template #default>
<table class="worktab"> <table class="worktab" v-if="isPc">
<tr> <tr>
<th style=" border-radius: 8px 0 0 8px ;">作业列表</th> <th style=" border-radius: 8px 0 0 8px ;">作业列表</th>
<th width="120">作业得分</th> <th width="120">作业得分</th>
@ -18,16 +16,13 @@
<tr v-for="(item, i) in looplist" :key="i"> <tr v-for="(item, i) in looplist" :key="i">
<td> <td>
<a :href="com_shequ_url+'/classroom/download/'+classid+'/'+item.id" target="_blank"> <a :href="com_shequ_url + '/classroom/download/' + classid + '/' + item.id" target="_blank"> <i class="iconfont icon-icon_attachment"></i> {{ item.title }} </a>
<i class="iconfont icon-icon_attachment"></i> {{item.title}}
</a>
</td> </td>
<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> <div class="col617" v-else>--</div>
</td> </td>
<td> <td>
<div class="ptlist"> <div class="ptlist">
<li v-for="(item, i) in item.data" :key="i"> <li v-for="(item, i) in item.data" :key="i">
{{ item.post_time }} {{ item.post_time }}
@ -35,20 +30,15 @@
<a :href="item.obsurl" target="_blank" class="col008" v-if="item.obsurl"> <a :href="item.obsurl" target="_blank" class="col008" v-if="item.obsurl">
查看作业 查看作业
</a> </a>
<a :href="com_shequ_url+'/plugin.php?id=fr_class:dload&lod='+item.downloadId+'&kid='+classid" <a :href="com_shequ_url + '/plugin.php?id=fr_class:dload&lod=' + item.downloadId + '&kid=' + classid" target="_blank" class="col008" v-else>
target="_blank" class="col008" v-else>
查看作业 查看作业
</a> </a>
</el-tooltip> </el-tooltip>
</li> </li>
</div> </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-upload class="upload-demo" <el-button size="mini" class="frbtn min-pd"><i class="iconfont icon-shangchuan1 ico-lf f14"></i>提交作业 </el-button>
: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> </el-upload>
</td> </td>
@ -64,12 +54,53 @@
</div> </div>
</td> </td>
</tr> </tr>
</table> </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> </template>
</el-skeleton> </el-skeleton>
<el-dialog title="老师评语" v-model="isShowItem" width="600px"> <el-dialog title="老师评语" v-model="isShowItem" width="600px">
<el-scrollbar> <el-scrollbar>
<div class="infobox"> <div class="infobox">
@ -81,19 +112,18 @@
<el-empty :image-size="150" description=" " v-if="isdata"> <el-empty :image-size="150" description=" " v-if="isdata">
<div class="col617">当前班级下暂无作业</div> <div class="col617">当前班级下暂无作业</div>
</el-empty> </el-empty>
</template> </template>
<script> <script>
import { useRoute } from 'vue-router' import { useRoute } from "vue-router";
import { myHomeWork } from "@/api/study"; import { myHomeWork } from "@/api/study";
import { toRefs, reactive, getCurrentInstance } from 'vue'; import { toRefs, reactive, getCurrentInstance } from "vue";
import store from '@/store' import store from "@/store";
export default { export default {
name: 'class_homework', name: "class_homework",
setup() { setup() {
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance();
const route = useRoute() const route = useRoute();
const classid = route.params.classid; const classid = route.params.classid;
const state = reactive({ const state = reactive({
looplist: [], looplist: [],
@ -106,9 +136,14 @@
isdata: false, isdata: false,
loading: true, loading: true,
headers: { 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 reshomeWork = async () => {
const res = await myHomeWork(classid); const res = await myHomeWork(classid);
@ -131,27 +166,57 @@
// item // item
const setItem = (item) => { const setItem = (item) => {
state.item = item state.item = item;
state.isShowItem = true state.isShowItem = true;
} };
const UploadSuccess = (res) => { const UploadSuccess = (res) => {
proxy.$message({ proxy.$message({
type: res.status=='-1' ? 'error' : 'success', type: res.status == "-1" ? "error" : "success",
message: res.message, message: res.message,
center: true center: true,
}); });
} };
return { return {
classid, classid,
...toRefs(state), ...toRefs(state),
setItem, setItem,
UploadSuccess, 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> <style lang="scss" scoped>
.worktab { .worktab {
@ -163,7 +228,7 @@
font-size: 14px; font-size: 14px;
padding-left: 18px; padding-left: 18px;
text-align: left; text-align: left;
background: #F3F8FF; background: #f3f8ff;
border-collapse: separate; border-collapse: separate;
} }
@ -171,11 +236,11 @@
height: 60px; height: 60px;
padding: 16px 0 16px 18px; padding: 16px 0 16px 18px;
text-align: left; text-align: left;
border-bottom: 1px solid #CEDDF2; border-bottom: 1px solid #ceddf2;
} }
tr:hover { tr:hover {
background-color: #F3F8FF; background-color: #f3f8ff;
} }
} }

101
src/views/class/class_lesson.vue

@ -1,5 +1,4 @@
<template> <template>
<el-skeleton :loading="loading" animated> <el-skeleton :loading="loading" animated>
<template #template> <template #template>
<el-skeleton-item variant="h1" style="margin-top: 24px;" animated /> <el-skeleton-item variant="h1" style="margin-top: 24px;" animated />
@ -15,24 +14,20 @@
<el-skeleton-item variant="h3" style="width: 20px; margin-right: 12px;" animated /> <el-skeleton-item variant="h3" style="width: 20px; margin-right: 12px;" animated />
<el-skeleton-item variant="h3" style="width: 80%" animated /> <el-skeleton-item variant="h3" style="width: 80%" animated />
</div> </div>
</template> </template>
<template #default> <template #default>
<div class="lesson"> <div class="lesson">
<div class="looplist" v-for="(item, i) in lessonList" :key="i"> <div class="looplist" v-for="(item, i) in lessonList" :key="i">
<div class="otile flex-1"> <div class="otile flex-1">
<h2>{{ item.title }}</h2> <h2>{{ item.title }}</h2>
<span>{{item.num_video}}课时 {{item.video_time}}</span> <span class="til-rt-info">{{ item.num_video }}课时 {{ item.video_time }}</span>
</div> </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"> <ul class="vlist">
<li class="item" v-for="(item, i) in item.video" :key="i"> <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> <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-if="item.title.length > 40">{{ item.title.substring(0, 40) }}...</div>
@ -48,37 +43,45 @@
</router-link> </router-link>
<div class="rtinfo flex-1"> <div class="rtinfo flex-1">
<el-tooltip v-if="item.attachmentId" effect="dark" content="下载课件" placement="top"> <el-tooltip v-if="item.attachmentId" effect="dark" content="下载课件" placement="top">
<a class="zip" :href="'https://bbs.fanruan.com/classroom/download/'+classid+'/'+item.attachmentId" <a class="zip" :href="'https://bbs.fanruan.com/classroom/download/' + classid + '/' + item.attachmentId" target="_blank"></a>
target="_blank"></a>
</el-tooltip> </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> </div>
</li> </li>
</ul> </ul>
</div> </div>
</div> </div>
</template> </template>
</el-skeleton> </el-skeleton>
</template> </template>
<script> <script>
import { useRoute } from 'vue-router' import { useRoute } from "vue-router";
import { getLessonList } from "@/api/study"; import { getLessonList } from "@/api/study";
import { toRefs, reactive } from 'vue'; import { toRefs, reactive } from "vue";
export default { export default {
name: 'listLesson', name: "listLesson",
setup() { setup() {
const route = useRoute() const route = useRoute();
const classid = route.params.classid; const classid = route.params.classid;
const state = reactive({ const state = reactive({
lessonList: [], lessonList: [],
activeIndex: 1, activeIndex: 1,
loading: true, loading: true,
}) isMobile: document.body.clientWidth < 600,
});
window.addEventListener("resize", function() {
state.isMobile = document.body.clientWidth < 600;
});
const resLessonList = async () => { const resLessonList = async () => {
const res = await getLessonList(classid); const res = await getLessonList(classid);
@ -96,14 +99,56 @@
}; };
resLessonList(); resLessonList();
return { return {
classid, classid,
...toRefs(state), ...toRefs(state),
};
},
};
</script>
<style lang="scss">
/*响应式-移动端*/
@media screen and (max-width: 1200px) {
.looplist {
.vlist {
.item {
padding-left: 6px;
} }
} }
} }
</script> }
</style>
<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> <style lang="scss" scoped>
.looplist { .looplist {
@ -112,7 +157,7 @@
.otile { .otile {
padding: 0 18px; padding: 0 18px;
height: 40px; height: 40px;
background: #F3F8FF; background: #f3f8ff;
border-radius: 8px; border-radius: 8px;
h2 { h2 {
@ -123,7 +168,7 @@
span { span {
margin-left: 18px; margin-left: 18px;
font-size: 14px; font-size: 14px;
color: #7E8FA3; color: #7e8fa3;
} }
} }
@ -144,7 +189,6 @@
border-bottom: none; border-bottom: none;
} }
.a-play { .a-play {
padding: 26px 0; padding: 26px 0;
border-radius: 6px; border-radius: 6px;
@ -156,7 +200,7 @@
.icon-bofang2 { .icon-bofang2 {
font-size: 14px; font-size: 14px;
color: #B3C1D3; color: #b3c1d3;
margin-right: 12px; margin-right: 12px;
} }
@ -165,7 +209,6 @@
width: 100px; width: 100px;
position: relative; position: relative;
span { span {
text-align: center; text-align: center;
position: absolute; position: absolute;
@ -178,7 +221,7 @@
background: #0082fc; background: #0082fc;
border-radius: 3px; border-radius: 3px;
padding: 1px 2px; padding: 1px 2px;
transition: all .6s; transition: all 0.6s;
i { i {
position: absolute; position: absolute;
@ -187,7 +230,6 @@
left: 15px; left: 15px;
} }
} }
} }
.rtinfo { .rtinfo {
@ -195,20 +237,17 @@
.zip { .zip {
display: inline-block; display: inline-block;
background: url('~@/assets/class/zip.png'); background: url("~@/assets/class/zip.png");
background-size: 100% auto; background-size: 100% auto;
height: 22px; height: 22px;
width: 22px; width: 22px;
margin-right: 20px; margin-right: 20px;
} }
.time { .time {
color: #7E8FA3; color: #7e8fa3;
} }
} }
} }
} }
} }

645
src/views/class/indexClass.vue

@ -1,8 +1,6 @@
<template> <template>
<div class="style-page"> <div class="style-page">
<div class="wrapper"> <div class="wrapper">
<div class="top-title"> <div class="top-title">
<span class="line left"></span> <span class="line left"></span>
<p>我参加的学习班</p> <p>我参加的学习班</p>
@ -17,62 +15,94 @@
<div v-if="!com_user_token" style=" background-color: #fff; border-radius: 8px"> <div v-if="!com_user_token" style=" background-color: #fff; border-radius: 8px">
<el-empty :image-size="150" description=" "> <el-empty :image-size="150" description=" ">
<div class="col617">登录后才能查看您参加的学习班哦 <div class="col617">
登录后才能查看您参加的学习班哦
<a :href="com_login_url" class="col008">马上登录</a> <a :href="com_login_url" class="col008">马上登录</a>
</div> </div>
</el-empty> </el-empty>
</div> </div>
<el-skeleton :loading="loading" animated v-if="com_user_token"> <el-skeleton :loading="loading" animated v-if="com_user_token">
<template #template> <template #template>
<div class="w1200 flex-1" style="height: 230px; background-color: #fff; border-radius: 8px;"> <div class="mine-wrapper">
<el-skeleton-item variant="image" <ul class="mine">
style="width: 276px; height:184px; margin-left: 24px; border-radius: 8px;" /> <li class="item">
<el-skeleton :rows="2" variant="text" style="margin-left: 30px; width: 60%; height: 40px;" animated /> <div class="thumb">
<el-skeleton-item variant="image" class="img" />
</div>
<div class="content"><el-skeleton :rows="2" variant="text" style="margin-top: 30px;" animated /></div>
</li>
</ul>
</div> </div>
</template> </template>
<template #default> <template #default>
<div class="mine-wrapper" v-if="com_user_token"> <div class="mine-wrapper" v-if="com_user_token">
<ul class="mine"> <ul class="mine">
<li class="item" v-for="(item, i) in personalStudyList" :key="i"> <li class="item" v-for="(item, i) in personalStudyList" :key="i">
<div v-if="isPc">
<div class="thumb"> <div class="thumb">
<el-image class="img" :src="item.class_img" :alt="item.class_title"></el-image> <el-image class="img" :src="item.class_img" :alt="item.class_title"></el-image>
</div> </div>
<div class="content"> <div class="content">
<div class="left-content"> <div class="left-content">
<h4 class="title">{{item.class_title}}</h4> <h4 class="title hide-txt">{{ item.class_title }}</h4>
<div class="meta flex-1"> <div class="meta flex-1">
<span class="one">已更新{{ item.class_update }}节课({{ item.class_total }}课时)</span> <span class="one">已更新{{ item.class_update }}节课({{ item.class_total }}课时)</span>
<span> <span class="sp-my-average">
<em>我的作业平均</em> <strong>{{ item.average }}</strong> <em>我的作业平均</em> <strong>{{ item.average }}</strong>
</span> </span>
<span> <span class="sp-class-rank">
<em>班级排名</em> <strong>{{ item.class_rank }}</strong> <em>班级排名</em> <strong>{{ item.class_rank }}</strong>
</span> </span>
</div> </div>
<div class="study-progress"> <div class="study-progress">
<p>我的学习进度 ({{ item.progress_learning.progress }} / {{ item.progress_learning.total }} )</p> <p>我的学习进度 ({{ item.progress_learning.progress }} / {{ item.progress_learning.total }} )</p>
<el-progress class="progress" :stroke-width="8" :show-text="false" color="#409eff" <el-progress class="progress" :stroke-width="8" :show-text="false" color="#409eff" :percentage="item.proLearning"> </el-progress>
:percentage="item.proLearning">
</el-progress>
</div> </div>
<div class="task-progress"> <div class="task-progress">
<p>我的作业进度 ({{ item.progress_homework.progress }} / {{ item.progress_homework.total }} )</p> <p>我的作业进度 ({{ item.progress_homework.progress }} / {{ item.progress_homework.total }} )</p>
<el-progress class="progress" :stroke-width="8" :show-text="false" color="#5cb87a" <el-progress class="progress" :stroke-width="8" :show-text="false" color="#5cb87a" :percentage="item.proHomework"> </el-progress>
:percentage="item.proHomework">
</el-progress>
</div> </div>
</div> </div>
<div class="right-content"> <div class="right-content m-dn">
<div class="btn gray"> <i class="iconfont icon-icon_icon-23 ico-lf col-23"></i>{{item.end_time}} <div class="btn gray"><i class="iconfont icon-icon_icon-23 ico-lf col-23"></i>{{ item.end_time }}</div>
</div>
<router-link class="btn-008 primary" :to="'/class/' + item.class_id">进入班级</router-link> <router-link class="btn-008 primary" :to="'/class/' + item.class_id">进入班级</router-link>
<div class="btn-fff primary"><a :href="item.course_url" target="_blank">课程介绍</a></div> <div class="btn-fff primary"><a :href="item.course_url" target="_blank">课程介绍</a></div>
</div> </div>
</div> </div>
</div>
<!-- 移动端需要整块加链接 所以只能拆分成两块 -->
<div v-else>
<router-link :to="'/class/' + item.class_id">
<div class="thumb">
<el-image class="img" :src="item.class_img" :alt="item.class_title"></el-image>
</div>
<div class="content">
<div class="left-content">
<h4 class="title hide-txt">{{ item.class_title }}</h4>
<div class="meta flex-1">
<span class="one">已更新{{ item.class_update }}节课({{ item.class_total }}课时)</span>
<span class="sp-my-average">
<em>我的作业平均</em> <strong>{{ item.average }}</strong>
</span>
<span class="sp-class-rank">
<em>班级排名</em> <strong>{{ item.class_rank }}</strong>
</span>
</div>
<div class="study-progress">
<p>我的学习进度 ({{ item.progress_learning.progress }} / {{ item.progress_learning.total }} )</p>
<el-progress class="progress" :stroke-width="6" :show-text="false" color="#409eff" :percentage="item.proLearning"> </el-progress>
</div>
<div class="task-progress">
<p>我的作业进度 ({{ item.progress_homework.progress }} / {{ item.progress_homework.total }} )</p>
<el-progress class="progress" :stroke-width="6" :show-text="false" color="#5cb87a" :percentage="item.proHomework"> </el-progress>
</div>
</div>
</div>
</router-link>
</div>
</li> </li>
</ul> </ul>
</div> </div>
@ -80,7 +110,6 @@
</el-skeleton> </el-skeleton>
<el-skeleton :loading="loading_course" animated> <el-skeleton :loading="loading_course" animated>
<template #template> <template #template>
<div class="course-wrapper"> <div class="course-wrapper">
<div class="top-title"> <div class="top-title">
@ -100,7 +129,6 @@
</template> </template>
<template #default> <template #default>
<div class="course-wrapper"> <div class="course-wrapper">
<div class="top-title"> <div class="top-title">
<span class="line left"></span> <span class="line left"></span>
@ -120,7 +148,6 @@
<span class="week">{{ item.semester }}</span> <span class="week">{{ item.semester }}</span>
<span class="week">{{ item.num_people }}人学习</span> <span class="week">{{ item.num_people }}人学习</span>
</el-space> </el-space>
</div> </div>
<div class="description">{{ item.description }}</div> <div class="description">{{ item.description }}</div>
<div class="price"> <div class="price">
@ -135,27 +162,22 @@
<small>{{ item.start_day }}开课</small> <small>{{ item.start_day }}开课</small>
</a> </a>
</div> </div>
</li> </li>
</ul> </ul>
</div> </div>
</template> </template>
</el-skeleton> </el-skeleton>
</div> </div>
<div class="adinfo"> <div class="adinfo">
<div class="w1200"> <div class="w1200">
<div class="top-title"> <div class="top-title">
<span class="line left"></span> <span class="line left"></span>
<p>学员认可的服务模式</p> <p>学员认可的服务模式</p>
<span class="line right"></span> <span class="line right"></span>
</div> </div>
<div class="service flex-6" style="margin-bottom: 40px;"> <div class="service">
<li> <li class="itemli">
<p class="icon flex-5"> <p class="icon flex-5">
<i class="iconfont icon-icon_icon-29"></i> <i class="iconfont icon-icon_icon-29"></i>
</p> </p>
@ -163,7 +185,7 @@
<p class="txt">支持电脑和APP可自由安排学习时间<br />每周完成老师布置的课时和作业</p> <p class="txt">支持电脑和APP可自由安排学习时间<br />每周完成老师布置的课时和作业</p>
</li> </li>
<li> <li class="itemli">
<p class="icon flex-5"> <p class="icon flex-5">
<i class="iconfont icon-icon_icon-10"></i> <i class="iconfont icon-icon_icon-10"></i>
</p> </p>
@ -174,65 +196,59 @@
</p> </p>
</li> </li>
<li> <li class="itemli">
<p class="icon flex-5"> <p class="icon flex-5">
<i class="iconfont icon-book"></i> <i class="iconfont icon-book"></i>
</p> </p>
<h5>认证考试辅导</h5> <h5>认证考试辅导</h5>
<p class="txt">帆软职业资格认证考试考前辅导<br /> <p class="txt">
助你考试通过率直线飙升</p> 帆软职业资格认证考试考前辅导<br />
助你考试通过率直线飙升
</p>
</li> </li>
<li> <li class="itemli">
<p class="icon flex-5"> <p class="icon flex-5">
<i class="iconfont icon-icon_icon"></i> <i class="iconfont icon-icon_icon"></i>
</p> </p>
<h5>人才就业服务</h5> <h5>人才就业服务</h5>
<p class="txt">考试通过即可进入数据人才库<br /> <p class="txt">
升职加薪换工作更easy</p> 考试通过即可进入数据人才库<br />
升职加薪换工作更easy
</p>
</li> </li>
</div> </div>
<div class="top-title"> <div class="top-title">
<span class="line left"></span> <span class="line left"></span>
<p>学员上课流程</p> <p>学员上课流程</p>
<span class="line right"></span> <span class="line right"></span>
</div> </div>
<div class=" txt-c" style="margin-bottom: 40px;"> <div class=" txt-c" style="margin-bottom: 40px;">
<img src="@/assets/img/liucheng.png" style="width: 90%;"> <img src="@/assets/img/liucheng.png" style="width: 90%;" />
</div> </div>
<div class="top-title"> <div class="top-title">
<span class="line left"></span> <span class="line left"></span>
<p>备受行业认可的职业资格证书</p> <p>备受行业认可的职业资格证书</p>
<span class="line right"></span> <span class="line right"></span>
</div> </div>
<div class="cere"> <div class="cere">
<div class="fcrp"></div> <img class="fcrp" src="@/assets/img/fcrp2022.png" />
<div class="ibox"> <div class="ibox">
<p>通过认证可以充分展示您的知识和技能 <p>通过认证可以充分展示您的知识和技能 充实您的职业生涯</p>
充实您的职业生涯</p>
<a class="el-btn mypd" href="https://bbs.fanruan.com/certification" target="_blank">点击了解详情</a> <a class="el-btn mypd" href="https://bbs.fanruan.com/certification" target="_blank">点击了解详情</a>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import { getPersonalStudyList, getStudyList } from "@/api/study"; import { getPersonalStudyList, getStudyList } from "@/api/study";
import { defineComponent, reactive, toRefs } from "vue"; import { defineComponent, reactive, toRefs } from "vue";
import dateFormat from '@/utils/dateFormat'; import dateFormat from "@/utils/dateFormat";
export default defineComponent({ export default defineComponent({
setup() { setup() {
const state = reactive({ const state = reactive({
@ -241,6 +257,10 @@
loading: true, loading: true,
nodata: false, nodata: false,
loading_course: true, loading_course: true,
isPc: document.body.clientWidth > 1200,
});
window.addEventListener("resize", function() {
state.isPc = document.body.clientWidth > 1200;
}); });
const fetchPersonalSudyList = async () => { const fetchPersonalSudyList = async () => {
const res = await getPersonalStudyList(); const res = await getPersonalStudyList();
@ -254,7 +274,7 @@
}, 500); }, 500);
}); });
} }
if (res.status == '-1') { if (res.status == "-1") {
state.nodata = true; state.nodata = true;
state.loading = false; state.loading = false;
} }
@ -278,10 +298,9 @@
}; };
fetchStydyList(); fetchStydyList();
const createSetInterVal = (item, i) => { const createSetInterVal = (item, i) => {
const { end_time } = item; const { end_time } = item;
state.studyList[i].time = dateFormat(end_time, 'f16', 'f20'); state.studyList[i].time = dateFormat(end_time, "f16", "f20");
setTimeout(() => { setTimeout(() => {
createSetInterVal(item, i); createSetInterVal(item, i);
}, 1000); }, 1000);
@ -295,6 +314,473 @@
}); });
</script> </script>
<style lang="scss">
/*响应式-移动端*/
@import "~@/assets/css/m.css";
@media screen and (max-width: 1200px) {
html,
body {
background-color: #fff;
}
.wrapper {
width: 100% !important;
padding: 0 20px;
}
.adinfo {
.service {
margin-bottom: 0 !important;
.itemli {
width: 48% !important;
margin-bottom: 44px;
h5 {
font-size: 16px !important;
}
}
}
}
.cere {
width: auto !important;
height: 220px !important;
background: rgb(238, 243, 250, 0.6);
border-radius: 8px;
margin-top: 40px;
margin-bottom: 100px;
margin-left: 40px !important;
margin-right: 30px !important;
position: relative;
.fcrp {
margin: -38px 0 0 -16px;
}
.ibox {
height: 100%;
margin-left: 24px !important;
margin-right: 24px;
p {
width: 100% !important;
font-size: 16px !important;
line-height: 26px;
padding: 20px 0 30px !important;
}
.mypd {
padding: 14px 80px !important;
font-size: 16px;
}
}
}
.top-title {
position: relative;
text-align: center;
padding: 40px 0;
font-size: 16px !important;
color: #333;
.line {
display: inline-block;
vertical-align: middle;
width: 30px;
height: 1px !important;
top: 50%;
line-height: 30px;
background-color: #555;
&.left {
margin-left: 0 !important;
}
&.right {
margin-right: 0 !important;
}
}
p {
display: inline-block;
padding: 0 18px;
}
}
/* 我参加的学习班 */
.mine-wrapper {
.mine {
position: relative;
width: 100%;
.item {
position: relative;
height: 176px !important;
margin-bottom: 46px;
background-color: #fff;
border-radius: 8px;
&:hover {
box-shadow: 0px 1px 12px 0px #ccd5f0;
}
.thumb {
position: absolute;
bottom: 0;
width: 288px !important;
height: 176px !important;
border-radius: 8px;
.img {
transition: all 0.3s;
width: 288px !important;
height: 176px !important;
border-radius: 8px;
margin-top: -16px;
margin-left: 16px;
}
}
.content {
display: flex;
justify-content: space-between;
margin-left: 304px !important;
height: 100%;
padding: 0 20px;
box-sizing: border-box;
.left-content {
flex: 1;
width: 100%;
height: 100%;
.title {
font-size: 15px !important;
margin: 10px 0 8px !important;
font-weight: 500 !important;
}
.meta {
margin: 8px 0 16px !important;
span {
font-size: 12px;
color: #617288;
margin-right: 15px;
&.one {
padding-top: 0 !important;
}
strong {
padding-left: 4px;
font-weight: normal;
font-size: 16px !important;
padding-top: 4px;
color: #ff3c23;
}
}
}
.study-progress,
.task-progress {
margin-top: 14px !important;
p {
font-size: 12px !important;
}
.progress {
width: auto !important;
margin: 4px 0 10px !important;
}
}
}
}
}
}
}
/* 即将开班的课程 */
.course-wrapper {
padding-bottom: 20px;
> .title {
position: relative;
text-align: center;
padding: 15px 0;
font-weight: 600;
font-size: 24px;
color: #333;
.line {
position: absolute;
width: 30px;
height: 1px;
top: 27px;
line-height: 30px;
background-color: #000;
&.left {
left: 50%;
margin-left: 95px;
}
&.right {
right: 50%;
margin-right: 95px;
}
}
}
.course-list {
width: 100%;
display: flex;
justify-content: center;
flex-wrap: wrap;
.course-item {
width: 360px !important;
height: 690px;
background: #ffffff;
border-radius: 8px;
margin-bottom: 28px;
/* margin-right: 31px; */
box-sizing: border-box;
margin: 0 10px 24px 10px;
&:hover {
box-shadow: 0px 1px 12px 0px #ccd5f0;
.enroll {
background: linear-gradient(-45deg, #eb443e, #f12f59, #fc9550, #ff4b72, #eb443e);
background-size: 400% 400%;
animation: gradientBG 4s ease infinite;
}
.thumb .img {
margin-top: -10px;
}
}
.btbox {
padding: 0 24px;
}
.thumb {
width: 360px !important;
height: 230px;
border-radius: 8px 8px 0 0;
position: relative;
.img {
position: absolute;
width: 100%;
height: 100%;
border-radius: 8px;
transition: all 0.3s;
}
}
.title {
position: relative;
padding: 15px 0 10px;
font-weight: 600;
font-size: 18px;
color: #333;
}
.meta {
width: 328px;
color: #617288;
span {
font-size: 14px;
color: #617288;
white-space: nowrap;
}
}
.description {
height: 110px;
font-size: 14px;
line-height: 1.5;
margin: 20px 0;
}
.price::before {
content: "";
position: absolute;
top: -15px;
width: 100%;
height: 1px;
background-color: #ceddf2;
}
.enroll {
width: 100%;
height: 44px !important;
border-radius: 8px;
color: #fff;
transition: all 0.3s;
margin: 22px auto 0 auto;
span {
font-size: 16px !important;
line-height: 22px;
}
small {
font-size: 16px;
}
&:hover {
width: 96%;
height: 40px !important;
margin-top: 24px !important;
}
}
}
}
}
}
</style>
<style lang="scss">
@media screen and (max-width: 700px) {
.cere {
width: auto !important;
height: auto !important;
background: rgb(238, 243, 250, 0.6);
border-radius: 8px;
margin-top: 0 !important;
margin-bottom: 100px;
margin-left: 20px !important;
margin-right: 20px !important;
display: block !important;
padding: 20px;
.fcrp {
width: 100% !important;
margin: 0 !important;
}
.ibox {
height: 100%;
margin: 0 !important;
p {
width: 100% !important;
font-size: 16px !important;
line-height: 26px;
margin: 10px 0px !important;
padding: 0 !important;
}
.mypd {
display: block;
text-align: center;
width: 100% !important;
padding: 12px 0 !important;
font-size: 16px;
}
}
}
.mine-wrapper {
.mine {
position: relative;
width: 100%;
.item {
position: relative;
height: 104px !important;
margin-bottom: 46px;
background-color: #fff;
border-radius: 8px;
&:hover {
box-shadow: 0px 1px 12px 0px #ccd5f0;
}
.thumb {
position: absolute;
bottom: 0;
width: 152px !important;
height: 92px !important;
border-radius: 8px;
.img {
transition: all 0.3s;
width: 152px !important;
height: 100px !important;
border-radius: 8px;
margin-top: -16px !important;
margin-left: 10px !important;
}
}
.content {
display: flex;
justify-content: space-between;
margin-left: 156px !important;
height: 100%;
padding: 0 20px;
box-sizing: border-box;
.left-content {
flex: 1;
width: 100%;
height: 100%;
.title {
font-size: 14px !important;
margin: 10px 0 0px !important;
font-weight: 500 !important;
}
.meta {
margin: 6px 0 12px !important;
span {
font-size: 12px;
color: #617288;
margin-right: 15px;
&.one {
padding-top: 0 !important;
}
strong {
padding-left: 4px;
font-weight: normal;
font-size: 16px !important;
padding-top: 4px;
color: #ff3c23;
}
}
.sp-my-average,
.sp-class-rank {
display: none;
}
}
.study-progress,
.task-progress {
margin-top: 0 !important;
p {
font-size: 12px !important;
}
.progress {
width: auto !important;
margin: 4px 0 10px !important;
}
}
.task-progress {
display: none !important;
}
}
}
}
}
}
}
</style>
<style lang="scss" scoped> <style lang="scss" scoped>
em { em {
font-style: normal; font-style: normal;
@ -363,7 +849,7 @@
border-radius: 8px; border-radius: 8px;
.img { .img {
transition: all .3s; transition: all 0.3s;
width: 376px; width: 376px;
height: 230px; height: 230px;
border-radius: 8px; border-radius: 8px;
@ -386,7 +872,7 @@
.title { .title {
font-size: 20px; font-size: 20px;
margin: 20px 0 12px; margin: 20px 0 0;
font-weight: 600; font-weight: 600;
} }
@ -407,7 +893,7 @@
font-weight: normal; font-weight: normal;
font-size: 20px; font-size: 20px;
padding-top: 4px; padding-top: 4px;
color: #FF3C23; color: #ff3c23;
} }
} }
} }
@ -437,7 +923,7 @@
margin-top: 12px; margin-top: 12px;
.col-23 { .col-23 {
color: #B3C1D3; color: #b3c1d3;
} }
.primary { .primary {
@ -458,8 +944,6 @@
border-radius: 20px; border-radius: 20px;
} }
&.ghost { &.ghost {
width: 220px; width: 220px;
border-radius: 8px; border-radius: 8px;
@ -509,7 +993,6 @@
justify-content: center; justify-content: center;
flex-wrap: wrap; flex-wrap: wrap;
.course-item { .course-item {
width: 380px; width: 380px;
height: 690px; height: 690px;
@ -524,7 +1007,7 @@
box-shadow: 0px 1px 12px 0px #ccd5f0; box-shadow: 0px 1px 12px 0px #ccd5f0;
.enroll { .enroll {
background: linear-gradient(-45deg, #eb443e, #f12f59, #fc9550, #ff4b72, #eb443e, ); background: linear-gradient(-45deg, #eb443e, #f12f59, #fc9550, #ff4b72, #eb443e);
background-size: 400% 400%; background-size: 400% 400%;
animation: gradientBG 4s ease infinite; animation: gradientBG 4s ease infinite;
} }
@ -549,7 +1032,7 @@
width: 100%; width: 100%;
height: 100%; height: 100%;
border-radius: 8px; border-radius: 8px;
transition: all .3s; transition: all 0.3s;
} }
} }
@ -585,7 +1068,7 @@
top: -15px; top: -15px;
width: 100%; width: 100%;
height: 1px; height: 1px;
background-color: #CEDDF2; background-color: #ceddf2;
} }
.price, .price,
@ -602,7 +1085,7 @@
} }
span { span {
color: #FF3D23; color: #ff3d23;
font-size: 24px; font-size: 24px;
em { em {
@ -622,7 +1105,7 @@
background: linear-gradient(270deg, #ff7c6b 0%, #ff4b72 100%); background: linear-gradient(270deg, #ff7c6b 0%, #ff4b72 100%);
border-radius: 8px; border-radius: 8px;
color: #fff; color: #fff;
transition: all .3s; transition: all 0.3s;
margin: 22px auto 0 auto; margin: 22px auto 0 auto;
span { span {
@ -664,9 +1147,12 @@
background-color: #fff; background-color: #fff;
.service { .service {
margin-bottom: 20px; margin-bottom: 40px;
display: flex;
li { justify-content: center;
flex-wrap: wrap;
.itemli {
width: 25%;
text-align: center; text-align: center;
h5 { h5 {
@ -683,7 +1169,7 @@
i { i {
font-size: 50px; font-size: 50px;
color: #0082FC; color: #0082fc;
} }
} }
@ -697,27 +1183,22 @@
} }
.cere { .cere {
width: 1060px; width: 100%;
height: 268px;
background: rgb(238, 243, 250, 0.6); background: rgb(238, 243, 250, 0.6);
border-radius: 8px; border-radius: 8px;
margin-left: 76px;
margin-top: 40px; margin-top: 40px;
margin-bottom: 100px; margin-bottom: 100px;
position: relative; display: flex;
.fcrp { .fcrp {
position: absolute;
background: url('~@/assets/img/FCRP.png');
width: 400px; width: 400px;
height: 284px; height: auto;
margin: -38px 0 0 -16px; margin: -38px 0 20px -16px;
background-size: 100% auto;
} }
.ibox { .ibox {
width: 630px; width: auto;
height: 100%; height: 100%;
margin-left: auto; margin-left: 45px;
p { p {
width: 450px; width: 450px;
font-size: 24px; font-size: 24px;

195
src/views/class/play.vue

@ -10,7 +10,8 @@
<div class="viewtil" style="min-height:8%"> <div class="viewtil" style="min-height:8%">
<el-page-header @back="goBack" title="返回班级" :content="video.title"> </el-page-header> <el-page-header @back="goBack" title="返回班级" :content="video.title"> </el-page-header>
</div> </div>
<div id="VideoPlay" style=" width:100%; height: 92%; margin-top: auto;"></div> <div :class="{ affix: is_scroll }"></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="autotime" v-show="showAutoBox">
<div class="pssbox flex-5"> <div class="pssbox flex-5">
@ -39,7 +40,7 @@
</div> </div>
<div class="navbox" id="videoList"> <div class="navbox" id="videoList">
<div class="classtil"> <div class="classtil m-dn">
<router-link :to="'/class/' + classid">{{ video.className }}</router-link> <router-link :to="'/class/' + classid">{{ video.className }}</router-link>
</div> </div>
@ -62,7 +63,14 @@
<i class="iconfont icon-bofang2" v-else></i> <i class="iconfont icon-bofang2" v-else></i>
<div class="title hide-txt">{{ item.title }}</div> <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> </a>
<!-- </el-tooltip> --> <!-- </el-tooltip> -->
</li> </li>
@ -134,6 +142,12 @@ export default {
showAutoBox: false, showAutoBox: false,
is_duration: true, is_duration: true,
playThisId: route.params.videoid, playThisId: route.params.videoid,
is_scroll: false,
isMobile: document.body.clientWidth < 1200,
});
window.addEventListener("resize", function() {
state.isMobile = document.body.clientWidth < 1200;
}); });
// MARKET-4168 // MARKET-4168
@ -424,6 +438,15 @@ export default {
setTimeout("top.location.href = '" + target.href + "'", 100); 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(() => { onUnmounted(() => {
@ -556,7 +579,7 @@ body {
.main { .main {
position: absolute; position: absolute;
top: 118px; top: 96px;
left: 0; left: 0;
bottom: 0; bottom: 0;
right: 0; right: 0;
@ -696,3 +719,167 @@ body {
color: #0082fc; color: #0082fc;
} }
</style> </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>

186
src/views/video/indexVideo.vue

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

2
src/views/video/play.vue

@ -583,7 +583,7 @@ body {
.main { .main {
position: absolute; position: absolute;
top: 118px; top: 96px;
left: 0; left: 0;
bottom: 0; bottom: 0;
right: 0; right: 0;

Loading…
Cancel
Save