|
|
@@ -0,0 +1,289 @@
|
|
|
+<template>
|
|
|
+ <div class="info">
|
|
|
+ <div class="top">
|
|
|
+ <!-- 返回箭头 -->
|
|
|
+ <div class="back" @click="$router.go(-1)">
|
|
|
+ <img src="@/assets/img/arrows.png" alt="" />
|
|
|
+ </div>
|
|
|
+ <!-- 右边菜单 -->
|
|
|
+ <div class="mean" @click="meanShow = true">
|
|
|
+ <img src="@/assets/img/menu.png" alt="" />
|
|
|
+ </div>
|
|
|
+ <!-- 循环生成的模块 -->
|
|
|
+ <div class="rowBox">
|
|
|
+ <div class="row" :style="`width:${90 * leftData.length}px`">
|
|
|
+ <div
|
|
|
+ @click="pageInd = index"
|
|
|
+ v-for="(item, index) in leftData"
|
|
|
+ :key="item.id"
|
|
|
+ :class="{ active: index === pageInd }"
|
|
|
+ >
|
|
|
+ {{ item.name }}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!-- 菜单栏 -->
|
|
|
+ <div class="meanBox" v-if="meanShow">
|
|
|
+ <div class="meanTop">
|
|
|
+ <img src="@/assets/img/cancel.png" alt="" @click="meanShow = false" />
|
|
|
+ </div>
|
|
|
+ <div class="meanCon">
|
|
|
+ <div class="meanConL"></div>
|
|
|
+ <div class="meanConR">
|
|
|
+ <div
|
|
|
+ class="meanRow"
|
|
|
+ @click="cutInfo(item.id, item.children)"
|
|
|
+ :class="{ active: topDataInd === item.id }"
|
|
|
+ v-for="item in topData"
|
|
|
+ :key="item.id"
|
|
|
+ >
|
|
|
+ {{ item.name }}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!-- 下面主要内容盒子 -->
|
|
|
+ <div class="mainBox">
|
|
|
+ <Son1 @pageNext="pageNext" v-if="topDataInd === '1000'" />
|
|
|
+ <Son2 @pageNext="pageNext" v-else-if="topDataInd === '2000'" />
|
|
|
+ <Son3 @pageNext="pageNext" v-else-if="topDataInd === '3000'" />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import Son1 from "./component/son1.vue";
|
|
|
+import Son2 from "./component/son2.vue";
|
|
|
+import Son3 from "./component/son3.vue";
|
|
|
+import { getTreeMenuApi } from "@/utils/api";
|
|
|
+export default {
|
|
|
+ name: "info",
|
|
|
+ components: { Son1, Son2, Son3 },
|
|
|
+ data() {
|
|
|
+ //这里存放数据
|
|
|
+ return {
|
|
|
+ // 菜单数据
|
|
|
+ topData: [],
|
|
|
+ // 菜单的显示和隐藏
|
|
|
+ meanShow: false,
|
|
|
+ // 菜单高亮
|
|
|
+ topDataInd: "1000",
|
|
|
+ // 控制顶部数据高亮和翻页
|
|
|
+ pageInd: 0,
|
|
|
+ // 顶部数据
|
|
|
+ leftData: [],
|
|
|
+ // 页面盒子的高度
|
|
|
+ pageHei:0
|
|
|
+ };
|
|
|
+ },
|
|
|
+ //监听属性 类似于data概念
|
|
|
+ computed: {},
|
|
|
+ //监控data中的数据变化
|
|
|
+ watch: {
|
|
|
+ pageInd(val) {
|
|
|
+ // 控制顶部滑动
|
|
|
+ let dom = document.querySelector(".rowBox");
|
|
|
+ dom.scrollTo({ left: 82 * (val - 1), behavior: "smooth" });
|
|
|
+ // 控制页面滑动
|
|
|
+ let pageDom = document.querySelector('.mainBox')
|
|
|
+ pageDom.scrollTo({ top: this.pageHei * val, behavior: "smooth" });
|
|
|
+ // 切换的时候暂时视频
|
|
|
+ this.$nextTick(() => {
|
|
|
+ setTimeout(() => {
|
|
|
+ let dom = document.querySelectorAll("video");
|
|
|
+ dom.forEach((v) => {
|
|
|
+ v.pause();
|
|
|
+ });
|
|
|
+ }, 100);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ },
|
|
|
+ //方法集合
|
|
|
+ methods: {
|
|
|
+ // 子组件传过来的下一页事件
|
|
|
+ pageNext(index) {
|
|
|
+ this.pageInd = index;
|
|
|
+ },
|
|
|
+ // 点击菜单栏里面切换模块
|
|
|
+ cutInfo(id, val) {
|
|
|
+ let dom = document.querySelector(".rowBox");
|
|
|
+ dom.scrollTo({ top: 0 });
|
|
|
+ this.topDataInd = id;
|
|
|
+ this.leftData = val;
|
|
|
+ this.pageInd = 0;
|
|
|
+ this.meanShow = false;
|
|
|
+ },
|
|
|
+ },
|
|
|
+ //生命周期 - 创建完成(可以访问当前this实例)
|
|
|
+ async created() {
|
|
|
+ // 获取菜单树
|
|
|
+ let res = await getTreeMenuApi();
|
|
|
+ this.topData = res.data;
|
|
|
+ this.leftData = res.data[0].children;
|
|
|
+ }, //生命周期 - 挂载完成(可以访问DOM元素)
|
|
|
+ mounted() {
|
|
|
+ // 获取页面盒子的高度
|
|
|
+ let pageDom = document.querySelector('.mainBox')
|
|
|
+ this.pageHei=pageDom.offsetHeight
|
|
|
+ },
|
|
|
+ beforeCreate() {}, //生命周期 - 创建之前
|
|
|
+ beforeMount() {}, //生命周期 - 挂载之前
|
|
|
+ beforeUpdate() {}, //生命周期 - 更新之前
|
|
|
+ updated() {}, //生命周期 - 更新之后
|
|
|
+ beforeDestroy() {}, //生命周期 - 销毁之前
|
|
|
+ destroyed() {}, //生命周期 - 销毁完成
|
|
|
+ activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
|
|
|
+};
|
|
|
+</script>
|
|
|
+<style lang='less' scoped>
|
|
|
+.info {
|
|
|
+ width: 100vw;
|
|
|
+ height: 100vh;
|
|
|
+ padding-top: 46px;
|
|
|
+ // 主要内容盒子
|
|
|
+ .mainBox {
|
|
|
+ overflow: hidden;
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ background: url("../../assets/img/mainBg.png");
|
|
|
+ background-size: 100% 100%;
|
|
|
+ }
|
|
|
+ // 菜单栏
|
|
|
+ .meanBox {
|
|
|
+ z-index: 3;
|
|
|
+ position: absolute;
|
|
|
+ top: 0;
|
|
|
+ left: 0;
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ .meanTop {
|
|
|
+ width: 100%;
|
|
|
+ height: 48px;
|
|
|
+ text-align: right;
|
|
|
+ background-color: #fffaf1;
|
|
|
+ background-image: url("../../assets/img/meanHeng.png");
|
|
|
+ background-size: 100% 100%;
|
|
|
+ & > img {
|
|
|
+ margin-top: 9px;
|
|
|
+ margin-right: 10px;
|
|
|
+ width: 29px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .meanCon {
|
|
|
+ width: 100%;
|
|
|
+ height: calc(100% - 48px);
|
|
|
+ display: flex;
|
|
|
+ .meanConL {
|
|
|
+ position: relative;
|
|
|
+ width: 110px;
|
|
|
+ height: 100%;
|
|
|
+ background: url("../../assets/img/llBg.png");
|
|
|
+ background-size: 100% 100%;
|
|
|
+ // &::before {
|
|
|
+ // content: "";
|
|
|
+ // position: absolute;
|
|
|
+ // left: 0;
|
|
|
+ // top: 0;
|
|
|
+ // width: 100%;
|
|
|
+ // height: 100%;
|
|
|
+ // background-color: rgba(191, 176, 148, .5);
|
|
|
+ // backdrop-filter: blur(10px);
|
|
|
+ // z-index: -2;
|
|
|
+ // }
|
|
|
+ }
|
|
|
+ .meanConR {
|
|
|
+ border-top: 1px solid #bfb094;
|
|
|
+ width: calc(100% - 110px);
|
|
|
+ height: 100%;
|
|
|
+ background-color: #fffaf1;
|
|
|
+ background-image: url("../../assets/img/meanShu.png");
|
|
|
+ background-size: 100% 100%;
|
|
|
+ .meanRow {
|
|
|
+ font-size: 18px;
|
|
|
+ color: #bfb094;
|
|
|
+ height: 60px;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+ border-bottom: 1px solid #bfb094;
|
|
|
+ }
|
|
|
+ .active {
|
|
|
+ pointer-events: none;
|
|
|
+ color: #9f171c;
|
|
|
+ border-left: 5px solid #9f171c;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 顶部导航栏
|
|
|
+ .top {
|
|
|
+ position: absolute;
|
|
|
+ top: 0;
|
|
|
+ left: 0;
|
|
|
+ width: 100%;
|
|
|
+ height: 46px;
|
|
|
+ background-color: #d7c9b8;
|
|
|
+ padding-left: 45px;
|
|
|
+ padding-right: 45px;
|
|
|
+ .back {
|
|
|
+ position: absolute;
|
|
|
+ top: 0;
|
|
|
+ left: 0;
|
|
|
+ width: 40px;
|
|
|
+ height: 46px;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+ & > img {
|
|
|
+ transform: rotate(90deg);
|
|
|
+ width: 29px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .mean {
|
|
|
+ position: absolute;
|
|
|
+ top: 0;
|
|
|
+ right: 0;
|
|
|
+ width: 40px;
|
|
|
+ height: 46px;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+ & > img {
|
|
|
+ width: 29px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .rowBox::-webkit-scrollbar {
|
|
|
+ /*滚动条整体样式*/
|
|
|
+ width: 0px; /*高宽分别对应横竖滚动条的尺寸*/
|
|
|
+ height: 0px;
|
|
|
+ }
|
|
|
+ .rowBox {
|
|
|
+ width: 100%;
|
|
|
+ height: 48px;
|
|
|
+ overflow-x: auto;
|
|
|
+ .row {
|
|
|
+ display: flex;
|
|
|
+ min-width: 100%;
|
|
|
+ justify-content: space-around;
|
|
|
+ height: 46px;
|
|
|
+ & > div {
|
|
|
+ padding: 0 3px;
|
|
|
+ height: 48px;
|
|
|
+ line-height: 46px;
|
|
|
+ color: #fff;
|
|
|
+ font-size: 14px;
|
|
|
+ margin: 0 10px;
|
|
|
+ }
|
|
|
+ .active {
|
|
|
+ position: relative;
|
|
|
+ color: #9f171c;
|
|
|
+ font-weight: 700;
|
|
|
+ pointer-events: none;
|
|
|
+ border-bottom: 2px solid #9f171c;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|