提交 265a2d3b authored 作者: 龙菲's avatar 龙菲

首页文物推荐完善

上级 893e8d9e
...@@ -109,7 +109,7 @@ export default { ...@@ -109,7 +109,7 @@ export default {
path: "/virtual", path: "/virtual",
}, },
{ {
name: "布展", name: "展览",
path: "/display", path: "/display",
}, },
{ {
...@@ -151,10 +151,13 @@ export default { ...@@ -151,10 +151,13 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
a { .tab-item {
a {
color: #fff; color: #fff;
text-decoration: none; text-decoration: none;
}
} }
.nav { .nav {
height: 100px; height: 100px;
width: 100%; width: 100%;
...@@ -213,16 +216,24 @@ a { ...@@ -213,16 +216,24 @@ a {
} }
.el-dropdown-menu { .el-dropdown-menu {
background-color: transparent; background-color: #fff;
// border: 1px solid #8a919f;
} }
.el-dropdown-menu__item { .el-dropdown-menu__item {
background-color: transparent; background-color: transparent;
color: #fff; // color: #fff;
color: #8a919f;
a {
text-decoration: none;
color: #8a919f;
}
} }
.el-dropdown-menu__item:focus, .el-dropdown-menu__item:focus,
.el-dropdown-menu__item:not(.is-disabled):hover { .el-dropdown-menu__item:not(.is-disabled):hover {
background-color: rgba(255, 255, 255, 0.2); // background-color: rgba(255, 255, 255, 0.2);
color: #fff; // color: #fff;
background-color: #f8f8f8;
color: #8a919f;
} }
</style> </style>
\ No newline at end of file
...@@ -127,7 +127,7 @@ ...@@ -127,7 +127,7 @@
displayDetail.exhibitionUnits.length > 0 displayDetail.exhibitionUnits.length > 0
" "
> >
<CustomTitle text="布展单元" /> <CustomTitle text="展览单元" />
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="8"> <el-col :span="8">
<!-- 只能单开 unique-opened --> <!-- 只能单开 unique-opened -->
......
...@@ -7,33 +7,38 @@ ...@@ -7,33 +7,38 @@
</div> </div>
<div class="text">文物</div> <div class="text">文物</div>
<div class="list"> <div class="list">
<!-- 1231
<el-carousel>
<el-carousel-item v-for="(item,index) in length" :key="index">
{{item}}
</el-carousel-item>
</el-carousel> -->
<el-carousel indicator-position="outside" :autoplay="false" arrow="never"> <el-carousel indicator-position="outside" :autoplay="false" arrow="never">
<el-carousel-item> <el-carousel-item v-for="(item, index) in list" :key="index">
<el-row :gutter="14"> <el-row :gutter="14">
<el-col <el-col :span="6" v-for="i in item" :key="i.crId" class="container">
:span="6" <img :src="i.faceImageUrl" alt="" width="100%" />
v-for="item in list1" <div class="info" v-show='i.faceImageUrl'>
:key="item.crId" <div class="name">{{ i.name }}</div>
class="container" <div class="sourceWay">{{ i.sourceWay }}</div>
> </div>
<img :src="item.faceImageUrl" alt="" width="100%" />
</el-col> </el-col>
</el-row> </el-row>
</el-carousel-item> </el-carousel-item>
<el-carousel-item> </el-carousel>
<el-row :gutter="14"> </div>
<!-- <el-row v-if="list.length < 9 && list.length > 0" :gutter="14">
<el-col <el-col
:span="6" :span="24 / list.length"
v-for="item in list2"
:key="item.crId"
class="container" class="container"
v-for="item in list"
:key="item.crId"
> >
<img :src="item.faceImageUrl" alt="" width="100%" />
<el-image :src="item.faceImageUrl" style="width: 100%; height: 100%" />
</el-col> </el-col>
</el-row> </el-row> -->
</el-carousel-item>
</el-carousel>
</div>
</div> </div>
</template> </template>
...@@ -42,18 +47,44 @@ import { getRecommendCr } from "@/api/culturalRelic"; ...@@ -42,18 +47,44 @@ import { getRecommendCr } from "@/api/culturalRelic";
export default { export default {
data() { data() {
return { return {
list1: [], list: [],
list2: [], length: "",
}; };
}, },
mounted() { created() {
this.loadList(); this.loadList();
}, },
// watch: {
// list: {
// handler: function (value) {
// console.log(value);
// this.list = value;
// },
// immediate: true,
// deep: true,
// },
// },
methods: { methods: {
async loadList() { async loadList() {
let res = await getRecommendCr(); let res = await getRecommendCr();
this.list1 = res.data.slice(0, 8); if (res.data.length > 8) {
this.list2 = res.data.slice(-8); this.length =
res.data.length % 8 == 0
? res.data.length / 8
: Math.floor(res.data.length / 8) + 1;
for (let i = 0; i < this.length; i++) {
let data = [];
if (i == length - 1) {
data = res.data.slice(8 * i, res.data.length);
} else {
data = res.data.slice(8 * i, (i + 1) * 8);
}
this.$set(this.list, i, data);
}
this.$set(this, "list", this.list);
} else {
this.list = res.data;
}
}, },
}, },
}; };
...@@ -100,16 +131,24 @@ export default { ...@@ -100,16 +131,24 @@ export default {
height: 226px; height: 226px;
margin-bottom: 40px; margin-bottom: 40px;
cursor: pointer; cursor: pointer;
position: relative;
img { img {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.info{
position: absolute;
right: 20px;
bottom: 10px;
font-family: Lisu;
color: #fff;
}
} }
} }
::v-deep .el-carousel__container { ::v-deep .el-carousel__container {
height: 492px; height: 492px;
} }
.el-carousel--horizontal{ .el-carousel--horizontal {
overflow: hidden; overflow: hidden;
} }
</style> </style>
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<div class="home-display"> <div class="home-display">
<div class="title">展览</div> <div class="title">展览</div>
<transition name="el-fade-in-linear"> <transition name="el-fade-in-linear">
<div class="wrapper" v-show="currentItem.exhibitionId"> <div class="wrapper" v-show="currentItem">
<div class="content"> <div class="content">
<div class="content-name">{{ currentItem.title }}</div> <div class="content-name">{{ currentItem.title }}</div>
<div class="content-intro"> <div class="content-intro">
...@@ -17,12 +17,12 @@ ...@@ -17,12 +17,12 @@
<div class="pagination"> <div class="pagination">
<ul> <ul>
<li <li
v-for="(item, index) in [1, 2, 3, 4]" v-for="(item, index) in list"
:key="index" :key="index"
:class="currentPage == item ? 'active' : ''" :class="currentItem == item ? 'active' : ''"
@click="handleChangePage(item)" @click="handleChangePage(item)"
> >
{{ item }} {{ index + 1 }}
</li> </li>
</ul> </ul>
</div> </div>
...@@ -65,7 +65,7 @@ export default { ...@@ -65,7 +65,7 @@ export default {
data() { data() {
return { return {
list: [], list: [],
currentPage: 1, // currentPage: 1,
currentItem: {}, currentItem: {},
}; };
}, },
...@@ -79,10 +79,11 @@ export default { ...@@ -79,10 +79,11 @@ export default {
this.currentItem = this.list[0]; this.currentItem = this.list[0];
}, },
handleChangePage(page) { handleChangePage(page) {
this.currentPage = page; debugger;
// this.currentPage = page;
// debugger // debugger
this.currentItem = null; // this.currentItem = null;
this.currentItem = this.list[page - 1]; this.currentItem = page;
}, },
}, },
}; };
......
...@@ -39,7 +39,8 @@ export default { ...@@ -39,7 +39,8 @@ export default {
}; };
}, },
mounted() { mounted() {
// this.changeOptions(); echarts.registerMap("guizhou", guizhou);
this.changeOptions("guizhou");
this.$nextTick(() => { this.$nextTick(() => {
this.init(); this.init();
}); });
...@@ -66,9 +67,7 @@ export default { ...@@ -66,9 +67,7 @@ export default {
} }
}); });
// 图标 // 图标
console.log("seriesList", seriesList);
const series = seriesList.map((v) => { const series = seriesList.map((v) => {
console.log("v", v);
return { return {
type: "custom", //配置显示方式为用户自定义 type: "custom", //配置显示方式为用户自定义
coordinateSystem: "geo", coordinateSystem: "geo",
...@@ -92,10 +91,6 @@ export default { ...@@ -92,10 +91,6 @@ export default {
}, },
}; };
}); });
console.log("series", series);
// debugger;
// options
this.distributionOptions = { this.distributionOptions = {
tooltip: { tooltip: {
// 提示框组件 // 提示框组件
...@@ -114,7 +109,11 @@ export default { ...@@ -114,7 +109,11 @@ export default {
item.longitude == a.value[0] && item.longitude == a.value[0] &&
item.latitude == a.value[1] item.latitude == a.value[1]
) { ) {
faceImageUrl = `<img width="200px" src="${item.faceImageUrl}" />`; faceImageUrl = `<div>
<div style="text-align:center;line-height:26px;color:#000;font-weight:bold">${item.name}
<div/>
<img width="400px" src="${item.faceImageUrl}" />
</div>`;
that.curMuseum = item; that.curMuseum = item;
return; return;
} }
...@@ -156,42 +155,73 @@ export default { ...@@ -156,42 +155,73 @@ export default {
// ], // ],
label: { label: {
normal: { normal: {
//静态的时候展示样式 show: true,
show: true, //是否显示地图省份得名称
textStyle: { textStyle: {
color: "#fff", color: "#fff",
fontSize: 10,
fontFamily: "Arial",
}, },
}, },
emphasis: { emphasis: {
// 高亮状态下的样式 textStyle: {
//动态展示的样式
color: "#fff", color: "#fff",
shadowOffsetX: 0,
shadowOffsetY: 0,
shadowBlur: 20,
borderWidth: 0,
shadowColor: "rgba(0, 0, 0, 0.5)",
}, },
}, },
},
itemStyle: { itemStyle: {
// 地图区域的多边形 图形样式。
normal: { normal: {
borderColor: "#fff", // 边框颜色 areaColor: "#013C62",
areaColor: "#2759af", // 区域颜色 shadowColor: "#182f68",
textStyle: { shadowOffsetX: 0,
// 文字颜色 shadowOffsetY: 25,
color: "#fff", borderColor: "#2ab8ff",
}, borderWidth: 1.5,
// shadowBlur: 10, // 图形阴影的模糊大小 areaColor: "#12235c",
// shadowOffsetX: 10, // 阴影水平方向上的偏移距离。
}, },
emphasis: { emphasis: {
areaColor: "#7b39e2", areaColor: "#2AB8FF",
color: "#fff", borderWidth: 0,
color: "green",
}, },
}, },
// label: {
// normal: {
// //静态的时候展示样式
// show: true, //是否显示地图省份得名称
// textStyle: {
// color: "#fff",
// fontSize: 10,
// fontFamily: "Arial",
// },
// },
// emphasis: {
// // 高亮状态下的样式
// //动态展示的样式
// color: "#fff",
// shadowOffsetX: 0,
// shadowOffsetY: 0,
// shadowBlur: 20,
// borderWidth: 0,
// shadowColor: "rgba(0, 0, 0, 0.5)",
// },
// },
// itemStyle: {
// // 地图区域的多边形 图形样式。
// normal: {
// borderColor: "#fff", // 边框颜色
// areaColor: "#2759af", // 区域颜色
// textStyle: {
// // 文字颜色
// color: "#fff",
// },
// // shadowBlur: 10, // 图形阴影的模糊大小
// // shadowOffsetX: 10, // 阴影水平方向上的偏移距离。
// },
// emphasis: {
// areaColor: "#7b39e2",
// color: "#fff",
// },
// },
}, },
}; };
}, },
...@@ -205,11 +235,30 @@ export default { ...@@ -205,11 +235,30 @@ export default {
init() { init() {
echarts.registerMap("guizhou", guizhou); echarts.registerMap("guizhou", guizhou);
this.changeOptions("guizhou"); this.changeOptions("guizhou");
let that = this;
setTimeout(() => { setTimeout(() => {
this.myChart = echarts.init(document.getElementById("map")); that.myChart = echarts.init(document.getElementById("map"));
this.myChart.setOption(this.distributionOptions); that.myChart.setOption(this.distributionOptions);
that.myChart.on("click", (params) => {
// console.log(params);
// 有标注点的地方有data
if (params.data && params.data.value) {
that.museumList.forEach((item) => {
if (
item.longitude &&
item.latitude &&
item.longitude == params.data.value[0] &&
item.latitude == params.data.value[1]
) {
that.curMuseum = item;
return;
}
});
}
that.handleClick(that.curMuseum);
});
window.onresize = () => { window.onresize = () => {
this.myChart.resize(); that.myChart.resize();
}; };
}, 500); }, 500);
}, },
...@@ -226,7 +275,7 @@ export default { ...@@ -226,7 +275,7 @@ export default {
padding: 70px 13% 114px 13%; padding: 70px 13% 114px 13%;
.title { .title {
color: #333; color: #333;
margin-bottom: 43px; // margin-bottom: 43px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
...@@ -273,7 +322,7 @@ export default { ...@@ -273,7 +322,7 @@ export default {
.map { .map {
width: 900px; width: 900px;
height: 580px; height: 820px;
} }
} }
} }
......
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
</h1> </h1>
</div> </div>
<div style="background-color: #f3ecef" id="page3" class="page"> <div style="background-color: #f3ecef" id="page3" class="page">
布展推荐 展览推荐
</div> </div>
<div style="background-color: #607271" id="page4" class="page"> <div style="background-color: #607271" id="page4" class="page">
文物推荐 文物推荐
......
<template> <template>
<!-- <child1 slot="skeleton" /> --> <!-- <child1 slot="skeleton" /> -->
<div class="home"> <div class="home">
<!-- <Boutique class="home-item" ref="Boutique" v-if="boutiqueShow" />
<Virtural class="home-item" ref="Virtural" v-if="virtualShow" />
<CulturalRelic class="home-item" ref="CulturalRelic" v-if="crShow" />
<Display class="home-item" ref="Display" v-if="displayShow" />
<MuseumMap class="home-item" ref="MuseumMap" v-if="mapShow" /> -->
<vue-lazy-component> <vue-lazy-component>
<Boutique class="home-item" /> <Boutique class="home-item" ref="Boutique" />
</vue-lazy-component> </vue-lazy-component>
<vue-lazy-component> <vue-lazy-component>
<Virtural class="home-item" /> <Virtural class="home-item" ref="Virtural" />
</vue-lazy-component> </vue-lazy-component>
<vue-lazy-component> <vue-lazy-component>
<CulturalRelic class="home-item" /> <CulturalRelic class="home-item" ref="CulturalRelic" />
</vue-lazy-component> </vue-lazy-component>
<vue-lazy-component> <vue-lazy-component>
<Display class="home-item" /> <Display class="home-item" ref="Display" />
</vue-lazy-component> </vue-lazy-component>
<vue-lazy-component> <vue-lazy-component>
<MuseumMap class="home-item" /> <MuseumMap class="home-item" ref="MuseumMap" />
</vue-lazy-component> </vue-lazy-component>
<!-- <Footer /> -->
</div> </div>
</template> </template>
<script> <script>
import NavBar from "@/components/NavBar"; // import NavBar from "@/components/NavBar";
import Footer from "@/components/Footer"; // import Footer from "@/components/Footer";
import Boutique from "./components/Boutique.vue"; import Boutique from "./components/Boutique.vue";
import MuseumMap from "./components/MuseumMap.vue"; import MuseumMap from "./components/MuseumMap.vue";
import Virtural from "./components/Virtural.vue"; import Virtural from "./components/Virtural.vue";
...@@ -31,8 +35,8 @@ import Display from "./components/Display.vue"; ...@@ -31,8 +35,8 @@ import Display from "./components/Display.vue";
import CulturalRelic from "./components/CulturalRelic.vue"; import CulturalRelic from "./components/CulturalRelic.vue";
export default { export default {
components: { components: {
NavBar, // NavBar,
Footer, // Footer,
MuseumMap, MuseumMap,
Boutique, Boutique,
Virtural, Virtural,
...@@ -41,15 +45,40 @@ export default { ...@@ -41,15 +45,40 @@ export default {
}, },
name: "Home", name: "Home",
data() { data() {
return {}; return {
boutiqueShow: true,
virtualShow: true,
crShow: true,
displayShow: true,
mapShow: true,
currentScroll:''
};
}, },
methods: { mounted() {
handleClickVitual() { // window.addEventListener("scroll", this.handleScrollbox, true);
//暂时写死
window.open(
"https://720yun.com/t/6cvkbyf7z7w?scene_id=90524980#scene_id=90524980"
);
}, },
methods: {
// handleScrollbox() {
// this.currentScroll = window.pageYOffset; //表示当前滚动的位置
// if (this.currentScroll >= this.$refs.testref.offsetTop - 600) {
// //当前滚动位置到达testref的时候,显示div(100作为调整用)
// this.testShow = true;
// }
// if (this.currentScroll >= this.$refs.test2ref.offsetTop - 440) {
// this.testShow2 = true;
// }
// if (this.currentScroll >= this.$refs.test3ref.offsetTop - 440) {
// this.testShow3 = true;
// }
// if (this.currentScroll >= this.$refs.test4ref.offsetTop - 440) {
// this.testShow4 = true;
// }
// },
// },
// beforeDestroy() {
// window.removeEventListener("scroll", this.handleScrollbox, true);
}, },
}; };
</script> </script>
......
<!-- --> <!-- -->
<template> <template>
<div class="wrapper">
<div style="height: 100px; background-color: #2069c4; width: 100%"></div>
<div class="login"> <div class="login">
<div class="title"> <div class="title">
<div class="text">登录</div> <div class="text">登录</div>
<div class="close" @click="handleCloseLogin">×</div> <div class="close" @click="handleCloseLogin">×</div>
</div> </div>
<el-form :model="loginForm" :label-position="labelPosition" ref="loginForm"> <el-form
:model="loginForm"
:label-position="labelPosition"
ref="loginForm"
>
<el-form-item :label-width="formLabelWidth" prop="username"> <el-form-item :label-width="formLabelWidth" prop="username">
<el-input <el-input
v-model="loginForm.username" v-model="loginForm.username"
...@@ -67,6 +73,7 @@ ...@@ -67,6 +73,7 @@
> >
</div> </div>
</div> </div>
</div>
</template> </template>
<script> <script>
...@@ -146,6 +153,9 @@ export default { ...@@ -146,6 +153,9 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.wrapper {
width: 100%;
}
.login { .login {
width: 500px; width: 500px;
margin: 50px auto; margin: 50px auto;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论