提交 f45b5783 authored 作者: Anix's avatar Anix

解决冲突,提交六枝梭戛

差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
......@@ -13,7 +13,7 @@
v-for="(item, index) in imgList"
:key="index"
>
<img :src="$getFullUrl(item.pressUrl)" alt="" />
<img :src="$getFullUrl(item[imgKey])" alt="" />
<div class="enlarge" @click="handelPreviewImages(imgList,index)">
<img src="@/assets/imgs/enlarge-s.png" alt="" />
</div>
......
import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/home'
import Vue from "vue";
import VueRouter from "vue-router";
import Home from "../views/home";
Vue.use(VueRouter)
Vue.use(VueRouter);
// keepAlive先全部为true 后期根据每个页面需求调整
const routes = [
{
path: '/loopswiper',
name: 'loop',
component: () => import('@/views/home/components/swiper.vue'),
path: "/loopswiper",
name: "loop",
component: () => import("@/views/home/components/swiper.vue"),
meta: {
keepAlive: true
}
keepAlive: true,
},
},
{
path: '/404',
component: () => import('@/views/404.vue'),
hidden: true
path: "/404",
component: () => import("@/views/404.vue"),
hidden: true,
},
// 首页
{
path: '/',
name: 'home',
path: "/",
name: "home",
component: Home,
meta: {
keepAlive: false
}
keepAlive: false,
},
},
// 精品展
{
path: '/boutique/:title',
name: 'boutique',
component: () => import('@/views/boutique'),
path: "/boutique/:title",
name: "boutique",
component: () => import("@/views/boutique"),
meta: {
keepAlive: true
}
keepAlive: true,
},
},
// 虚拟展厅
{
path: '/virtual',
name: 'virtual',
component: () => import('@/views/virtual'),
path: "/virtual",
name: "virtual",
component: () => import("@/views/virtual"),
meta: {
keepAlive: true
}
keepAlive: true,
},
},
// 布展
{
path: '/display',
name: 'display',
component: () => import('@/views/display'),
path: "/display",
name: "display",
component: () => import("@/views/display"),
meta: {
keepAlive: true
}
keepAlive: true,
},
},
// 布展详情页
{
path: '/display/:themeType/:exhibitionId',
name: 'displayDetail',
component: () => import('@/views/display/Detail.vue'),
path: "/display/:themeType/:exhibitionId",
name: "displayDetail",
component: () => import("@/views/display/Detail.vue"),
meta: {
keepAlive: false
}
keepAlive: false,
},
},
// 文物展
{
path: '/culturalRelic',
name: 'culturalRelic',
component: () => import('@/views/culturalRelic'),
path: "/culturalRelic",
name: "culturalRelic",
component: () => import("@/views/culturalRelic"),
meta: {
keepAlive: true
}
keepAlive: true,
},
},
// 文物详情页
{
path: '/culturalRelic/:crId',
name: 'culturalRelicDetail',
component: () => import('@/views/culturalRelic/Detail.vue'),
path: "/culturalRelic/:crId",
name: "culturalRelicDetail",
component: () => import("@/views/culturalRelic/Detail.vue"),
meta: {
keepAlive: false
}
keepAlive: false,
},
},
// 个人中心
{
path: '/personal',
name: 'personal',
component: () => import('@/views/personal'),
path: "/personal",
name: "personal",
component: () => import("@/views/personal"),
meta: {
keepAlive: true
}
keepAlive: true,
},
},
// // 登录
// {
......@@ -102,95 +102,100 @@ const routes = [
// 注册页
{
path: '/register',
name: 'register',
component: () => import('@/views/register'),
path: "/register",
name: "register",
component: () => import("@/views/register"),
meta: {
keepAlive: true
}
keepAlive: true,
},
},
// 博物馆
{
path: '/museum',
name: 'museum',
component: () => import('@/views/museum'),
path: "/museum",
name: "museum",
component: () => import("@/views/museum"),
meta: {
keepAlive: true
}
keepAlive: true,
},
},
// 博物馆详情
{
path: '/museum/:id',
name: 'museumDetail',
component: () => import('@/views/museum/Detail.vue'),
path: "/museum/:id",
name: "museumDetail",
component: () => import("@/views/museum/Detail.vue"),
meta: {
keepAlive: false
}
keepAlive: false,
},
},
// 文创
{
path: '/ccProduct',
name: 'ccProduct',
component: () => import('@/views/ccProduct'),
path: "/ccProduct",
name: "ccProduct",
component: () => import("@/views/ccProduct"),
meta: {
keepAlive: true
}
keepAlive: true,
},
},
// 文创详情
{
path: '/ccProduct/:bccpId',
name: 'ccProductDetail',
component: () => import('@/views/ccProduct/Detail.vue'),
path: "/ccProduct/:bccpId",
name: "ccProductDetail",
component: () => import("@/views/ccProduct/Detail.vue"),
meta: {
keepAlive: false
}
keepAlive: false,
},
},
{
path: '/jyycc',
name: 'JYYCC',
component: () => import('@/views/boutique/components/jyycc')
path: "/jyycc",
name: "JYYCC",
component: () => import("@/views/boutique/components/jyycc"),
},
{
path: '/sdcs',
name: 'SDCS',
component: () => import('@/views/boutique/components/SDCS')
path: "/sdcs",
name: "SDCS",
component: () => import("@/views/boutique/components/SDCS"),
},
{
path: '/zggzsgwdzjlz',
name: 'zggzsgwdzjlz',
component: () => import('@/views/boutique/components/zggzsgwdzjlz/index.vue')
path: "/jysg",
name: "JYSG",
component: () => import("@/views/boutique/components/JYSG"),
},
{
path: '/lzsg',
name: 'LZSG',
component: () => import('@/views/boutique/components/lzsg/index.vue')
path: "/zggzsgwdzjlz",
name: "zggzsgwdzjlz",
component: () =>
import("@/views/boutique/components/zggzsgwdzjlz/index.vue"),
},
{
path: "/lzsg",
name: "lzsg",
component: () =>
import("@/views/boutique/components/lzsg/index.vue"),
},
// 404
{
path: '*',
redirect: '/404',
}
]
path: "*",
redirect: "/404",
},
];
/**
* 解决重复点击同一个路由报错的问题
*/
// 获取原型对象上的push函数
const originalPush = VueRouter.prototype.push
const originalPush = VueRouter.prototype.push;
// 修改原型对象中的push方法
VueRouter.prototype.push = function push(location) {
return originalPush.call(this, location).catch(err => err)
}
return originalPush.call(this, location).catch((err) => err);
};
const router = new VueRouter({
routes,
scrollBehavior(to, from, savePosition) {
// return 期望滚动到哪个的位置
return {
y: 0
}
}
})
y: 0,
};
},
});
export default router
export default router;
差异被折叠。
......@@ -365,7 +365,6 @@ export default {
},
methods: {
handleClickUnit1(item) {
this.part1CurUnit = item;
},
......
......@@ -2,7 +2,11 @@
<div class="smgz">
<div class="face-img smgz-item">
<div class="back-img img wow animate__animated animate__fadeIn">
<img src="@/assets/imgs/boutique/smgz-5/1_faceImage/bg.png" alt="" />
<img
src="@/assets/imgs/boutique/smgz-5/1_faceImage/bg.png"
id="@/assets/imgs/boutique/smgz-5/1_faceImage/bg.png"
alt=""
/>
</div>
<div class="left-title img wow animate__animated animate__fadeInLeft">
<img
......@@ -23,7 +27,11 @@
class="ms img wow animate__animated animate__fadeInRight"
data-wow-duration="2s"
>
<img src="@/assets/imgs/boutique/smgz-5/1_faceImage/ms.png" alt="" />
<img
src="@/assets/imgs/boutique/smgz-5/1_faceImage/ms.png"
id="@/assets/imgs/boutique/smgz-5/1_faceImage/ms.png"
alt=""
/>
</div>
<div
class="more img wow animate__animated animate__fadeInUp"
......@@ -442,12 +450,34 @@ export default {
this.$nextTick(() => {
// this.scroll();
window.addEventListener("scroll", this.scroll);
this.replaceImg();
});
},
destroyed() {
window.removeEventListener("scroll", this.scroll, false);
},
methods: {
//替换从低清到高清
replaceImg() {
let imgs = document.getElementsByTagName("img");
let imgsArr = [...imgs];
imgsArr.forEach((i) => {
// url中包含了data-url压缩图的才进行替换
if (i.id && i.id.indexOf("smgz-5")) {
var imgObj = new Image(); //新建一个图片对象
let lowImgSrc = i.id;
let highImgSrc = lowImgSrc.replace("smgz-5", "smgz"); //最终显示的大图
let lowImg = document.getElementById(i.id);
imgObj.src = highImgSrc;
imgObj.onload = function () {
debugger;
lowImg.src = highImgSrc;
lowImg.classList.add('high')
};
}
});
},
handleChangeUnit(index) {
this.currentUnitPicIndex = index;
this.$refs.unitSwiper.swiper.slideTo(index, 500, true);
......
[
{
"name": "贵州古代教育史馆",
"img": "t-1.png",
"intro": "第一部分为贵州古代教育史馆,即“参差交错的贵州古代教育”,展示了原始形态教育社会(先秦到宋元)——明清时期的贵州教育(约19世纪中叶前)——地域文化馆(沙滩文化与影山文化)。尹真讲学的“务本堂”复制品及视频介绍。"
},
{
"name": "贵州近代教育史馆",
"img": "t-2.png",
"intro": "第二部分为贵州近代教育史馆,即“除旧布新的贵州近代教育”,展示了鸦片战争后贵州近代先贤促进贵州教育近代化的历程——近代学堂体系的建立——民国初期贵州教育——抗战时期教育文化内迁贵州及贵州近代教育体系建立。"
},
{
"name": "贵州现代教育史馆",
"img": "t-3.png",
"intro": "第三部分为贵州现代教育史馆,即(曲折发展的新中国初期贵州教育与快速发展的改革开放以来的贵州教育),展示了新中国初期贵州现代教育体系的建立——文革时期贵州曲折发展——改革开放后贵州教育的快速发展——十八大以来贵州教育取得的辉煌成就。"
},
{
"name": "贵州民族教育史馆",
"img": "t-4.png",
"intro": "第四部分为贵州现代教育史馆,即“多元教育模式的贵州少数民族教育概况”,展示了传统形态、封建形态、近代形态、现代形态的贵州民族教育发展概况。"
},
{
"name": "贵州名师馆",
"img": "t-5.png",
"intro": "第五部分为贵州历史上的名师,即“薪火相传的贵州近现代著名教师”,展示了明清以来贵州名师、先贤及其献身教育的精神。"
}
]
<template>
<div class="botique">
<SMGZ v-if="currentTitle == '神秘贵州'" />
<YLGDYW v-else-if="currentTitle == '夜郎国的疑问'" />
<JYYCC v-else-if="currentTitle == '记忆与传承'" />
<SDCS v-else-if="currentTitle == '四渡赤水出奇兵'" />
<div v-else class="img-container">
<!-- <img :src="require(`@/assets/imgs/boutique/${currentTitle}.jpg`)
" alt="" /> -->
<el-empty description="暂无数据"></el-empty>
</div>
<div class="botique">
<SMGZ v-if="currentTitle == '神秘贵州'" />
<YLGDYW v-else-if="currentTitle == '夜郎国的疑问'" />
<JYYCC v-else-if="currentTitle == '记忆与传承'" />
<SDCS v-else-if="currentTitle == '四渡赤水出奇兵'" />
<JYSG v-else-if="currentTitle == '贵州教育史馆'" />
<div v-else class="img-container">
<el-empty description="暂无数据"></el-empty>
</div>
</div>
</template>
<script>
......@@ -18,47 +17,47 @@ import SMGZ from "./components/SMGZ";
import YLGDYW from "./components/YLGDYW";
import JYYCC from "./components/jyycc";
import SDCS from "./components/SDCS";
import JYSG from "./components/JYSG";
export default {
components: { SMGZ, YLGDYW, JYYCC,SDCS },
watch: {
currentTitle: {
handler: function (value) {
let color = "";
if (!value) {
return;
}
switch (value) {
case "四渡赤水出奇兵":
color = "4";
break;
case "神秘贵州":
color = "5";
break;
case "记忆与传承":
color = "6";
break;
case "夜郎国的疑问":
color = "7";
break;
// case "cjm":
// color = "1";
}
this.$store.commit("app/CHANGE_NAV_COLOR", color);
},
immediate: true,
},
},
data() {
return {
currentTitle: ''
components: { SMGZ, YLGDYW, JYYCC, SDCS, JYSG },
watch: {
currentTitle: {
handler: function (value) {
let color = "";
if (!value) {
return;
}
switch (value) {
case "四渡赤水出奇兵":
color = "4";
break;
case "神秘贵州":
color = "5";
break;
case "记忆与传承":
color = "6";
break;
case "夜郎国的疑问":
color = "7";
break;
// case "cjm":
// color = "1";
}
this.$store.commit("app/CHANGE_NAV_COLOR", color);
},
immediate: true,
},
mounted() {
this.currentTitle = this.$route.params.title
}
}
},
data() {
return {
currentTitle: "",
};
},
mounted() {
this.currentTitle = this.$route.params.title;
},
};
</script>
<style>
</style>
\ No newline at end of file
......@@ -48,7 +48,6 @@ export default {
"displayType",
"displayCharacter",
]);
debugger
this.loadDetail();
},
......
//此处为配置需跳转为精品展的展览
//在此处添加title后需在@/views/boutique/index.vue中引入对应的页面组件
export var titles = [
"神秘贵州",
"四渡赤水出奇兵",
"记忆与传承",
"夜郎国的疑问",
"贵州教育史馆",
];
......@@ -24,7 +24,7 @@
v-for="(item, index) in displayDetail.imagesVo"
:key="index"
>
<img :src="$getFullUrl(item.pressUrl || item.url)" alt="" />
<img :src="$getFullUrl(item.middleUrl || item.url)" alt="" />
<div class="modal"></div>
</div>
</div>
......
......@@ -111,7 +111,7 @@ import ListBanner from "@/components/ListBanner";
import { getList, getDisplayExistDict } from "@/api/display";
import { mapGetters } from "vuex";
import { debounce } from "@/utils/index";
import { titles} from './boutiqueTitles'
export default {
name: "Display",
components: { ListBanner },
......@@ -141,12 +141,7 @@ export default {
},
],
currentType: "",
boutiqueTitles: [
"神秘贵州",
"四渡赤水出奇兵",
"记忆与传承",
"夜郎国的疑问",
],
boutiqueTitles:titles
};
},
computed: {
......@@ -217,7 +212,6 @@ export default {
handleClick(item) {
let index = this.boutiqueTitles.indexOf(item.title);
// debugger
let newPage;
if (index == -1) {
const { themeType, exhibitionId } = item;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论