123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630 |
- <template>
- <div id="top">
- <div class="n_box">
- <div class="left">
- <div class="tab_main">
- <header>
- <div :class="active == 1 ? 'active_tab' : ''">课程导航</div>
- <!-- <div :class="active == 2 ? 'active_tab' : ''">报考指导</div> -->
- </header>
- <div class="content_tab scroll_style">
- <div class="tab_li" v-for="(item, index) in typeList" :key="index">
- <div class="tops">
- <span>{{ item.educationName }}</span>
- <i class="el-icon-arrow-right"></i>
- </div>
- <ul>
- <li
- v-for="(items, indexs) in item.businessList"
- :key="indexs"
- v-show="indexs < 4"
- >
- {{ items.aliasName }}
- </li>
- <li
- v-if="$store.state.TENANT_NANE == '680980002459417532'"
- @click="goLink('https://cranesystem.gdcic.net:8080/')"
- >
- 建筑施工特种作业人员<span
- v-if="item.educationName == '考前培训'"
- >(建筑电工、司索工、施工升降机)</span
- >
- </li>
- <div style="clear:both;"></div>
- </ul>
- <div class="ri_p">
- <h4>{{ typeList[index].educationName }}</h4>
- <div class="fgx" style="margin:12px 0px;"></div>
- <ul class="scroll_style">
- <li
- v-for="(it, ix) in typeList[index].businessList"
- :key="ix"
- @click="goCourse(it)"
- >
- {{ it.aliasName }}
- </li>
- <li
- v-if="$store.state.TENANT_NANE == '680980002459417532'"
- @click="goLink('https://cranesystem.gdcic.net:8080/')"
- >
- 建筑施工特种作业人员<span
- v-if="typeList[index].educationName == '考前培训'"
- >(建筑电工、司索工、施工升降机)</span
- >
- </li>
- <div style="clear:both;"></div>
- </ul>
- </div>
- </div>
- </div>
- </div>
- <div class="swiper">
- <swiper
- v-if="swiperOptions.bannerList.length > 0"
- :options="swiperOptions"
- >
- <swiper-slide
- v-for="(item, index) in swiperOptions.bannerList"
- v-bind:key="index"
- @click.native="swiperJump(item)"
- >
- <img :src="$tools.splitImgHost(item.adverUrl)" alt="" />
- </swiper-slide>
- <div class="swiper-pagination" slot="pagination"></div>
- </swiper>
- </div>
- </div>
- <div class="login">
- <template v-if="!userInfo">
- <h2 class="title">账号登录注册</h2>
- <p class="value">获取海量优质课程</p>
- <img class="ggImg" src="@/assets/new1/zshktj.png" alt="" />
- <div class="btn" @click="$refs.login.openBox()">登录/注册</div>
- </template>
- <template v-else>
- <header class="header_user">
- <div>
- <img :src="$tools.splitImgHost(userInfo.avatar)" alt="" />
- <span>{{ userInfo.realname }}</span>
- </div>
- <div>
- <span
- @click="go('/person-center/my-info')"
- style="cursor: pointer;"
- >个人中心</span
- >
- <i class="el-icon-arrow-right"></i>
- </div>
- </header>
- <div class="header_li">
- <div
- @click="go('/person-center/my-course')"
- style="cursor: pointer;"
- >
- <img src="@/assets/kc.png" alt="" />
- <p>课程</p>
- </div>
- <div @click="go('/person-center/my-bank')" style="cursor: pointer;">
- <img src="@/assets/tk.png" alt="" />
- <p>题库</p>
- </div>
- <div
- @click="go('/person-center/my-order')"
- style="cursor: pointer;"
- >
- <img src="@/assets/dd.png" alt="" />
- <p>订单</p>
- </div>
- </div>
- <div class="fgx" style="width: 100%;opacity: 0.5;"></div>
- <div class="f_box" v-if="recordList.goodsId">
- <div class="btnsy">上次播放</div>
- <div class="title" @click="goLast">{{ recordList.goodsName }}</div>
- <div class="remark">
- <span
- >已学{{
- toFixed(
- (recordList.videoCurrentTime / recordList.durationTime) *
- 100
- )
- }}%</span
- >
- <span>{{ recordList.date }}</span>
- </div>
- </div>
- </template>
- </div>
- </div>
- <login ref="login"></login>
- </div>
- </template>
- <script>
- import login from "@/components/login";
- import { swiper, swiperSlide } from "vue-awesome-swiper";
- import "swiper/swiper-bundle.css";
- import { mapGetters } from "vuex";
- export default {
- components: {
- swiper,
- swiperSlide,
- login
- },
- data() {
- return {
- recordList: {},
- active: 1,
- typeList: [],
- swiperOptions: {
- bannerList: [],
- loop: true,
- observer: true,
- observeParents: true,
- speed: 300,
- autoplayDisableOnInteraction: false,
- autoplayStopOnLast: false,
- autoplay: {
- delay: 1000,
- disableOnInteraction: false
- },
- // 显示分页
- pagination: {
- el: ".swiper-pagination",
- clickable: true //允许分页点击跳转
- },
- // 设置点击箭头
- navigation: {
- nextEl: ".swiper-button-next",
- prevEl: ".swiper-button-prev"
- }
- } //轮播
- };
- },
- computed: {
- ...mapGetters(["userInfo"]),
- toFixed: function() {
- return function(num) {
- if (num) {
- let str = String(num).indexOf(".");
- if (str != -1) {
- return +num.toFixed(2);
- } else {
- return num;
- }
- } else {
- return 0;
- }
- };
- }
- },
- watch: {
- userInfo: {
- handler(newVal, oldVal) {
- this.getRecord();
- }
- }
- },
- mounted() {
- this.advertisingList();
- this.educationTypeList();
- this.getRecord();
- },
- methods: {
- /**
- * 播放记录
- */
- getRecord() {
- this.recordList = {};
- if (this.userInfo) {
- this.$request
- .studRrecordListUserRecord({
- pageNum: 1,
- pageSize: 1
- })
- .then(res => {
- if (res.rows.length) {
- this.recordList = res.rows[0];
- }
- });
- }
- },
- go(path, query) {
- this.$router.push({
- path,
- query
- });
- },
- goLast() {
- if (this.recordList.goodsType == 6) {
- this.go("/my-live-detail/" + this.recordList.goodsId, {
- gradeId: this.recordList.gradeId,
- orderGoodsId: this.recordList.orderGoodsId,
- courseId: this.recordList.courseId
- });
- } else if (this.recordList.goodsType == 1) {
- this.$router.push({
- path: `/my-course-detail/${this.recordList.goodsId}`,
- query: {
- gradeId: this.recordList.gradeId,
- orderGoodsId: this.recordList.orderGoodsId,
- }
- });
- }
- },
- goCourse(item) {
- // if (item.topicId) {
- // this.$router.push({
- // path: "/goodsTopic",
- // query: {
- // topicId: item.topicId
- // }
- // });
- // return;
- // }
- this.$router.push({
- path: "/course-list",
- query: {
- educationId: item.educationId ? item.educationId : item.id || "",
- projectId: item.projectId || "",
- businessId: item.educationId ? item.id : ""
- }
- });
- },
- educationTypeList() {
- this.$request.educationTypeList().then(res => {
- this.typeList = res.rows || [];
- this.typeList.forEach(async (item, index) => {
- const A = await this.$request.businessList({ educationId: item.id });
- item.businessList = A.rows.filter(items => items.aliasName);
- });
- });
- },
- swiperJump(swiper) {
- if (swiper.jumpType == 1) {
- //无跳转
- return;
- } else if (swiper.jumpType == 2) {
- //url
- window.open(swiper.jumpUrl, "_blank");
- } else if (swiper.jumpType == 3) {
- //内部接口
- this.$router.push({
- path: swiper.jumpUrl
- });
- }
- },
- goLink(path) {
- window.open(path);
- },
- advertisingList() {
- this.$request
- .advertisinghomeLocationList({
- platform: 2, //1小程序2PC网站
- status: 1,
- locationKey: "home-banner" //首页轮播KEY
- })
- .then(res => {
- /**
- * 如果存在-调用轮播图列表
- */
- if (res.data.length) {
- this.$request
- .advertisingList({ locationId: res.data[0].locationId })
- .then(result => {
- this.swiperOptions.autoplay.delay =
- res.data[0].intervalTime * 1000;
- this.swiperOptions.bannerList = result.rows;
- });
- }
- });
- }
- }
- };
- </script>
- <style lang="scss" scoped>
- .scroll_style {
- &::-webkit-scrollbar {
- width: 5px;
- height: 9px;
- display: none;
- }
- /*定义滚动条轨道 内阴影+圆角*/
- &::-webkit-scrollbar-track {
- background-color: inherit;
- border: none;
- /* margin: 6px; */
- border-radius: 10px;
- /* -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
- background-color: #F5F5F5; */
- }
- /*定义滑块 内阴影+圆角*/
- &::-webkit-scrollbar-thumb {
- border-radius: 10px;
- position: relative;
- right: 2px;
- /*-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,.3);*/
- background-color: #c6c6cd;
- width: 6px;
- }
- }
- #top {
- height: 600px;
- background: url("../../assets/new1/banner.png");
- position: relative;
- .n_box {
- position: absolute;
- width: 1200px;
- height: 400px;
- top: 126px;
- left: 50%;
- transform: translateX(-50%);
- display: flex;
- align-items: center;
- & > .left {
- flex: 1;
- background-color: #fff;
- border-radius: 4px;
- overflow: hidden;
- height: 100%;
- position: relative;
- .tab_main {
- backdrop-filter: blur(10px);
- width: 300px;
- height: 400px;
- z-index: 10;
- position: absolute;
- top: 0;
- left: 0;
- background-color: rgba(0, 0, 0, 0.85);
- & > header {
- display: flex;
- align-items: center;
- height: 50px;
- color: #fff;
- user-select: none;
- & > div {
- font-size: 16px;
- flex: 1;
- text-align: center;
- height: 48px;
- line-height: 48px;
- cursor: pointer;
- font-weight: 400;
- border-bottom: 2px solid #eeeeee50;
- &:hover {
- border-color: rgb(0, 122, 255);
- font-weight: bold;
- }
- // border-bottom: 2px solid #eee;
- }
- & > .active_tab {
- border-color: rgb(0, 122, 255);
- font-weight: bold;
- }
- }
- & > .content_tab {
- height: 350px;
- overflow: auto;
- & > .tab_li {
- padding: 16px 0px;
- margin: 0px;
- color: #fff;
- border-bottom: 1px solid rgb(86, 89, 92);
- &:hover {
- color: #007aff !important;
- }
- & > .ri_p {
- visibility: hidden;
- position: absolute;
- background-color: #fff;
- top: 0px;
- left: 300px;
- width: 580px;
- height: 400px;
- // transition: all 0.3s;
- opacity: 0;
- padding: 15px 30px 0px;
- display: flex;
- flex-direction: column;
- h4 {
- font-weight: bold;
- color: #007aff;
- font-size: 16px;
- }
- ul {
- overflow: auto;
- > li {
- user-select: none;
- cursor: pointer;
- float: left;
- margin: 0px 36px 20px 0px;
- color: #007aff;
- &:hover {
- font-weight: bold;
- }
- }
- }
- }
- &:hover .ri_p {
- visibility: visible;
- opacity: 1;
- }
- &:last-child {
- border-bottom: none;
- }
- & > .tops {
- padding: 0px 20px;
- user-select: none;
- display: flex;
- align-items: center;
- justify-content: space-between;
- margin-bottom: 14px;
- font-weight: bold;
- }
- & > ul {
- padding: 0px 20px;
- & > li {
- margin: 0px 10px 6px 0px;
- float: left;
- user-select: none;
- }
- }
- }
- }
- }
- }
- & > .login {
- margin-left: 20px;
- border-radius: 4px;
- overflow: hidden;
- background-color: rgba(0, 0, 0, 0.5);
- backdrop-filter: blur(10px);
- width: 300px;
- height: 100%;
- display: flex;
- flex-direction: column;
- align-items: center;
- & > .title {
- font-size: 18px;
- font-weight: bold;
- color: #fff;
- margin-top: 50px;
- margin-bottom: 20px;
- }
- & > .value {
- font-size: 14px;
- color: #fff;
- margin-bottom: 20px;
- }
- & > .ggImg {
- border-radius: 14px;
- overflow: hidden;
- margin-bottom: 20px;
- width: 211px;
- height: 120px;
- background-color: #fff;
- }
- & > .btn {
- user-select: none;
- cursor: pointer;
- width: 211px;
- border-radius: 100px;
- color: #fff;
- background-color: rgb(0, 122, 255);
- text-align: center;
- height: 30px;
- line-height: 30px;
- transition: all 0.2s;
- &:hover {
- background-color: rgb(2, 106, 244);
- }
- }
- & > .header_user {
- display: flex;
- align-items: center;
- justify-content: space-between;
- width: 100%;
- padding: 30px;
- padding-top: 25px;
- & > div {
- display: flex;
- align-items: center;
- & > img {
- width: 40px;
- height: 40px;
- margin-right: 6px;
- overflow: hidden;
- border-radius: 50%;
- }
- & > span {
- color: #fff;
- margin-right: 6px;
- }
- & > i {
- color: #fff;
- }
- }
- }
- & > .header_li {
- width: 100%;
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding: 0px 30px;
- & > div {
- color: #fff;
- & > img {
- width: 60px;
- height: 60px;
- overflow: hidden;
- border-radius: 50%;
- margin-bottom: 15px;
- }
- & > p {
- text-align: center;
- }
- }
- }
- & > .f_box {
- user-select: none;
- padding: 20px;
- color: #fff;
- width: 100%;
- & > .btnsy {
- display: inline-block;
- border-radius: 14px;
- padding: 4px 8px;
- border: 1px solid #fff;
- margin-bottom: 20px;
- }
- & > .title {
- margin-bottom: 15px;
- cursor: pointer;
- &:hover {
- color: #409eff;
- }
- }
- & > .remark {
- display: flex;
- align-items: center;
- justify-content: space-between;
- margin-bottom: 10px;
- }
- }
- }
- }
- }
- .swiper-slide {
- cursor: pointer;
- height: 400px;
- img {
- width: 100%;
- height: 100%;
- }
- }
- .swiper-pagination {
- text-align: right;
- padding-right: 24px;
- /deep/ .swiper-pagination-bullet {
- background: rgba(255, 255, 255, 0.4);
- &-active {
- background: rgba(255, 255, 255, 1);
- }
- }
- }
- .fgx {
- margin-top: 30px;
- height: 1px;
- background-color: #eee;
- }
- </style>
|