提交 cb92fbc6 authored 作者: 龙菲's avatar 龙菲

红色主题动效

上级 986d8eef
......@@ -23,7 +23,6 @@
"sass-loader": "^13.0.2",
"svgo": "^2.8.0",
"vue": "^2.6.14",
"vue-awesome-swiper": "^3.1.3",
"vue-router": "^3.5.1",
"vuex": "^3.6.2",
"wowjs": "^1.1.3"
......@@ -45,6 +44,7 @@
"sass": "^1.32.7",
"svg-sprite-loader": "^6.0.11",
"terser-webpack-plugin": "^5.3.3",
"vue-awesome-swiper": "^3.1.3",
"vue-template-compiler": "^2.6.14"
}
},
......@@ -5300,6 +5300,7 @@
"version": "2.1.5",
"resolved": "https://registry.npmmirror.com/dom7/-/dom7-2.1.5.tgz",
"integrity": "sha512-xnhwVgyOh3eD++/XGtH+5qBwYTgCm0aW91GFgPJ3XG+jlsRLyJivnbP0QmUBFhI+Oaz9FV0s7cxgXHezwOEBYA==",
"dev": true,
"dependencies": {
"ssr-window": "^2.0.0"
}
......@@ -5307,7 +5308,8 @@
"node_modules/dom7/node_modules/ssr-window": {
"version": "2.0.0",
"resolved": "https://registry.npmmirror.com/ssr-window/-/ssr-window-2.0.0.tgz",
"integrity": "sha512-NXzN+/HPObKAx191H3zKlYomE5WrVIkoCB5IaSdvKokxTpjBdWfr0RaP+1Z5KOfDT0ZVz+2tdtiBkhsEQ9p+0A=="
"integrity": "sha512-NXzN+/HPObKAx191H3zKlYomE5WrVIkoCB5IaSdvKokxTpjBdWfr0RaP+1Z5KOfDT0ZVz+2tdtiBkhsEQ9p+0A==",
"dev": true
},
"node_modules/domelementtype": {
"version": "2.3.0",
......@@ -12609,7 +12611,8 @@
"node_modules/ssr-window": {
"version": "1.0.1",
"resolved": "https://registry.npmmirror.com/ssr-window/-/ssr-window-1.0.1.tgz",
"integrity": "sha512-dgFqB+f00LJTEgb6UXhx0h+SrG50LJvti2yMKMqAgzfUmUXZrLSv2fjULF7AWGwK25EXu8+smLR3jYsJQChPsg=="
"integrity": "sha512-dgFqB+f00LJTEgb6UXhx0h+SrG50LJvti2yMKMqAgzfUmUXZrLSv2fjULF7AWGwK25EXu8+smLR3jYsJQChPsg==",
"dev": true
},
"node_modules/ssri": {
"version": "8.0.1",
......@@ -13238,6 +13241,7 @@
"version": "4.5.1",
"resolved": "https://registry.npmmirror.com/swiper/-/swiper-4.5.1.tgz",
"integrity": "sha512-se6I7PWWu950NAMXXT+ENtF/6SVb8mPyO+bTfNxbQBILSeLqsYp3Ndap+YOA0EczOIUlea274PKejT6gKZDseA==",
"dev": true,
"hasInstallScript": true,
"dependencies": {
"dom7": "^2.1.3",
......@@ -13974,6 +13978,7 @@
"version": "3.1.3",
"resolved": "https://registry.npmmirror.com/vue-awesome-swiper/-/vue-awesome-swiper-3.1.3.tgz",
"integrity": "sha512-E7suzkyApO8vNZbgdEnjSmnpsmQZyRvSVXJ7sey3XYwKPOkLhH3+GnHroBw+5PZIQXvWBwdCeQsPG1xQ1r1Rhg==",
"dev": true,
"dependencies": {
"object-assign": "^4.1.1",
"swiper": "^4.0.7"
......@@ -18979,6 +18984,7 @@
"version": "2.1.5",
"resolved": "https://registry.npmmirror.com/dom7/-/dom7-2.1.5.tgz",
"integrity": "sha512-xnhwVgyOh3eD++/XGtH+5qBwYTgCm0aW91GFgPJ3XG+jlsRLyJivnbP0QmUBFhI+Oaz9FV0s7cxgXHezwOEBYA==",
"dev": true,
"requires": {
"ssr-window": "^2.0.0"
},
......@@ -18986,7 +18992,8 @@
"ssr-window": {
"version": "2.0.0",
"resolved": "https://registry.npmmirror.com/ssr-window/-/ssr-window-2.0.0.tgz",
"integrity": "sha512-NXzN+/HPObKAx191H3zKlYomE5WrVIkoCB5IaSdvKokxTpjBdWfr0RaP+1Z5KOfDT0ZVz+2tdtiBkhsEQ9p+0A=="
"integrity": "sha512-NXzN+/HPObKAx191H3zKlYomE5WrVIkoCB5IaSdvKokxTpjBdWfr0RaP+1Z5KOfDT0ZVz+2tdtiBkhsEQ9p+0A==",
"dev": true
}
}
},
......@@ -24755,7 +24762,8 @@
"ssr-window": {
"version": "1.0.1",
"resolved": "https://registry.npmmirror.com/ssr-window/-/ssr-window-1.0.1.tgz",
"integrity": "sha512-dgFqB+f00LJTEgb6UXhx0h+SrG50LJvti2yMKMqAgzfUmUXZrLSv2fjULF7AWGwK25EXu8+smLR3jYsJQChPsg=="
"integrity": "sha512-dgFqB+f00LJTEgb6UXhx0h+SrG50LJvti2yMKMqAgzfUmUXZrLSv2fjULF7AWGwK25EXu8+smLR3jYsJQChPsg==",
"dev": true
},
"ssri": {
"version": "8.0.1",
......@@ -25271,6 +25279,7 @@
"version": "4.5.1",
"resolved": "https://registry.npmmirror.com/swiper/-/swiper-4.5.1.tgz",
"integrity": "sha512-se6I7PWWu950NAMXXT+ENtF/6SVb8mPyO+bTfNxbQBILSeLqsYp3Ndap+YOA0EczOIUlea274PKejT6gKZDseA==",
"dev": true,
"requires": {
"dom7": "^2.1.3",
"ssr-window": "^1.0.1"
......@@ -25863,6 +25872,7 @@
"version": "3.1.3",
"resolved": "https://registry.npmmirror.com/vue-awesome-swiper/-/vue-awesome-swiper-3.1.3.tgz",
"integrity": "sha512-E7suzkyApO8vNZbgdEnjSmnpsmQZyRvSVXJ7sey3XYwKPOkLhH3+GnHroBw+5PZIQXvWBwdCeQsPG1xQ1r1Rhg==",
"dev": true,
"requires": {
"object-assign": "^4.1.1",
"swiper": "^4.0.7"
......@@ -24,7 +24,6 @@
"sass-loader": "^13.0.2",
"svgo": "^2.8.0",
"vue": "^2.6.14",
"vue-awesome-swiper": "^3.1.3",
"vue-router": "^3.5.1",
"vuex": "^3.6.2",
"wowjs": "^1.1.3"
......@@ -46,6 +45,7 @@
"sass": "^1.32.7",
"svg-sprite-loader": "^6.0.11",
"terser-webpack-plugin": "^5.3.3",
"vue-awesome-swiper": "^3.1.3",
"vue-template-compiler": "^2.6.14"
},
"eslintConfig": {
......
<template>
<div>
<audio
@timeupdate="updateProgress"
controls
ref="audioRef"
style="display: none"
>
<source :src="fileurl" type="audio/mpeg" />
您的浏览器不支持音频播放
</audio>
<div class="audio-right">
<i
:class="
audioStatus !== 'pause' ? 'el-icon-video-play' : 'el-icon-video-pause'
"
@click="playAudio"
class="dialogAudioPlay"
></i>
<div class="progress-bar-bg" id="progressBarBg" v-dragto="setAudioIcon">
<div class="progress-bar" id="progressBar"></div>
</div>
<div class="audio-time" style="min-height: 10px">
<span class="audio-length-current" id="audioCurTime">{{
audioStart
}}</span
>/
<span class="audio-length-total">{{ duration }}</span>
</div>
<div class="volume">
<div
@click.stop="
() => {
return false;
}
"
class="volume-progress"
v-show="audioHuds"
>
<div
class="volume-bar-bg"
id="volumeBarBg"
v-adjuster="handleShowMuteIcon"
>
<div class="volume-bar" id="volumeBar"></div>
</div>
</div>
<i
class="iconfont pl-1"
:class="audioIcon"
@click.stop="audioHuds = !audioHuds"
>
</i>
</div>
</div>
</div>
</template>
<script>
export default {
name: "NormalPlayer",
props: {
fileurl: {
trpe: String,
},
},
data() {
return {
audioStatus: "play",
audioStart: "0:00",
duration: "0:00",
audioVolume: 0.5,
audioHuds: false,
};
},
directives: {
dragto: {
inserted: function (el, binding, vnode) {
el.addEventListener(
"click",
(e) => {
let wdiv = document.getElementById("progressBarBg").clientWidth;
let audio = vnode.context.$refs.audioRef;
// 只有音乐开始播放后才可以调节,已经播放过但暂停了的也可以
let ratemin = e.offsetX / wdiv;
let rate = ratemin * 100;
document.getElementById("progressBar").style.width = rate + "%";
audio.currentTime = audio.duration * ratemin;
audio.play();
binding.value();
},
false
);
},
},
adjuster: {
inserted: function (el, binding, vnode) {
el.addEventListener(
"click",
(e) => {
let hdiv = document.getElementById("volumeBarBg").clientHeight;
let audio = vnode.context.$refs.audioRef;
// 只有音乐开始播放后才可以调节,已经播放过但暂停了的也可以
let ratemin = e.offsetY / hdiv;
let rate = ratemin * 100;
document.getElementById("volumeBar").style.height = rate + "%";
audio.volume = ratemin;
binding.value(rate / 100);
},
false
);
},
},
},
computed: {
audioIcon() {
if (this.audioHuds) {
return this.audioVolume < 0.01
? "checked icon-jingyin"
: "checked icon-shengyin";
} else {
return "icon-shengyin";
}
},
},
mounted() {
this.fetch();
},
methods: {
fetch() {
let that = this;
var myVid = this.$refs.audioRef;
myVid.loop = false;
// 监听音频播放完毕
myVid.addEventListener(
"ended",
function () {
that.audioStatus = "play"; // 显示播放icon
document.getElementById("progressBar").style.width = "0%"; // 进度条初始化
},
false
);
if (myVid != null) {
myVid.oncanplay = function () {
that.duration = that.transTime(myVid.duration); // 计算音频时长
};
myVid.volume = 0.5; // 设置音量50%
}
},
// 播放暂停控制
playAudio() {
let recordAudio = this.$refs.audioRef; // 获取audio元素
if (recordAudio.paused) {
recordAudio.play();
this.audioStatus = "pause";
} else {
recordAudio.pause();
this.audioStatus = "play";
}
},
// 更新进度条与当前播放时间
updateProgress(e) {
var value = e.target.currentTime / e.target.duration;
if (document.getElementById("progressBar")) {
document.getElementById("progressBar").style.width = value * 100 + "%";
if (e.target.currentTime === e.target.duration) {
this.audioStatus = "pause";
}
} else {
this.audioStatus = "pause";
}
this.audioStart = this.transTime(this.$refs.audioRef.currentTime);
},
/**
* 音频播放时间换算
* @param {number} value - 音频当前播放时间,单位秒
*/
transTime(time) {
var duration = parseInt(time);
var minute = parseInt(duration / 60);
var sec = (duration % 60) + "";
var isM0 = ":";
if (minute === 0) {
minute = "00";
} else if (minute < 10) {
minute = "0" + minute;
}
if (sec.length === 1) {
sec = "0" + sec;
}
return minute + isM0 + sec;
},
setAudioIcon() {
this.audioStatus = "pause";
},
handleShowMuteIcon(val) {
this.audioVolume = val;
},
},
};
</script>
<style lang="scss" scoped>
.volume {
position: relative;
.volume-progress {
position: absolute;
top: -150px;
width: 32px;
height: 140px;
background: #f6f6f6;
border-radius: 4px;
padding-top: 10px;
}
.volume-bar-bg {
margin: 0 auto;
width: 6px;
height: 120px;
background: #dcdcdc;
border-radius: 100px;
flex: 1;
position: relative;
transform: rotate(180deg);
cursor: pointer;
.volume-bar {
width: 6px;
height: 50%;
background: #56bf8b;
border-radius: 100px;
}
}
.checked {
color: #56bf8b;
}
}
.audio-right {
width: 100%;
height: 49px;
line-height: 49px;
background: #f5f5f9;
border-radius: 6px;
display: flex;
padding: 0 15px;
.dialogAudioPlay {
cursor: pointer;
color: #5c5e66;
display: flex;
align-items: center;
color: #2069c4;
font-size: 38px;
}
.progress-bar-bg {
background-color: #fff;
flex: 1;
position: relative;
height: 10px;
top: 50%;
transform: translateY(-50%);
margin-top: -1px;
cursor: pointer;
margin: 0 10px;
}
.progress-bar {
background-color: #2069c4;
width: 0%;
height: 10px;
border-radius: 5px;
}
.audio-time {
overflow: hidden;
font-size: 14px;
.audio-length-total {
float: right;
}
.audio-length-current {
float: left;
}
}
}
</style>
......@@ -26,8 +26,9 @@ export default {
.custom-title {
width: 100%;
padding: 8px;
font-size: 18px;
border-bottom: 1px solid rgba($color: #000000, $alpha: 0.3);
font-size: 32px;
border-bottom: 1px solid rgba($color: #b8b8b8, $alpha: 0.3);
margin-bottom: 32px;
font-family: "KaiTi";
}
</style>
<!-- -->
<template>
<el-menu
v-if="items.length>0"
class="sidebar-el-menu"
default-active=""
@open="handleOpen"
......@@ -56,4 +57,16 @@ export default {
</script>
<style lang="scss" scoped>
.el-menu{
border-right: none;
}
.el-menu-item {
background-color: #f5f5f9;
// color: #2069c4;
&:hover {
background-color: #2069c4;
color: #fff;
}
}
</style>
......@@ -25,6 +25,7 @@
class="el-image-container"
:src="$getFullUrl(item.url)"
fit="contain"
></el-image>
</el-carousel-item>
</el-carousel>
......
......@@ -75,7 +75,7 @@
:sourceId="displayDetail.exhibitionId"
:title="displayDetail.title"
:sourceType="'biz_exhibition'"
@reload="loadDetail"
@reload="reload"
/>
</div>
</div>
......@@ -128,7 +128,10 @@
</div>
</div>
</div>
<div class="content-item units">
<div
class="content-item units"
v-if="displayDetail.exhibitionUnits.length > 0"
>
<div class="wrapper">
<div class="custom-title">
<div class="custom-title-prefix">
......@@ -140,30 +143,7 @@
</div>
</div>
<div class="units-content">
<ul>
<li
v-for="(item, index) in displayDetail.exhibitionUnits"
:key="index"
>
<div class="unit-title">{{ item.title }}</div>
<div class="unit-intro">{{ item.intro }}</div>
<div
class="unit-imgs"
v-if="item.imagesVo && item.imagesVo.length > 0"
>
<div
class="img-item"
v-for="(i, idx) in item.imagesVo"
:key="idx"
>
<img :src="$getFullUrl(i.url)" alt="" />
</div>
</div>
</li>
</ul>
</div>
<ChStyleUnit :units="displayDetail.exhibitionUnits" />
</div>
</div>
<div class="content-item lts">
......@@ -222,14 +202,15 @@
</template>
</el-table-column>
</el-table>
<!-- <div class="title">
</div>
<div class="lts-item"></div> -->
</div>
</div>
</div>
</div>
<el-image-viewer
v-if="imgViewerVisible"
:on-close="closeImgViewer"
:url-list="imgList"
/>
</div>
</template>
......@@ -238,11 +219,9 @@ import AudioPlayer from "@/components/AudioPlayer";
import ReaderOperations from "@/components/ReaderOperations";
import Card from "@/views/personal/components/Card";
import Video from "@/components/Video";
import QRCode from "qrcodejs2";
import { getDisplayById } from "@/api/display";
import MenuList from "@/components/MenuList";
import { mapGetters } from "vuex";
import { previewFile } from "@/utils/index";
import ChStyleUnit from "./ChStyleUnit.vue";
export default {
components: {
AudioPlayer,
......@@ -250,41 +229,34 @@ export default {
MenuList,
Video,
Card,
ChStyleUnit,
"el-image-viewer": () =>
import("element-ui/packages/image/src/image-viewer"),
},
props: {
displayDetail: {
type: Object,
default: () => ({}),
},
dicts: {
type: Object,
default: () => ({}),
},
},
data() {
return {
options: [
{
value: "name",
label: "文物名称",
},
],
selectValue: "",
keyword: "",
displayDetail: {},
slideImageWidth: 0, //单个图片的宽度
sildeGroupWidth: 0, //整个轮播的宽度
slideGroupleft: 0, //整个轮播距离父亲盒子的距离(中间view区域)
imgViewerVisible: false,
relateRelics: [],
curUnit: [],
imgsDom: null,
moveLeft: true,
moveRight: true,
audioPlaying: true,
};
},
computed: {
...mapGetters(["dicts"]),
},
async mounted() {
await this.$store.dispatch("dict/getDictList", [
"display_type",
"display_character",
]);
this.loadDetail();
},
destroyed() {
......@@ -296,19 +268,7 @@ export default {
},
methods: {
async loadDetail() {
let exhibitionId = this.$route.params.exhibitionId;
if (exhibitionId) {
let res = await getDisplayById({ exhibitionId });
if (res.code == 0) {
this.displayDetail = res.data;
if (
this.displayDetail.exhibitionUnits &&
this.displayDetail.exhibitionUnits.length > 0
) {
this.curUnit = this.displayDetail.exhibitionUnits[0];
}
processUnit(this.displayDetail.exhibitionUnits);
function processUnit(list) {
for (let o of list || []) {
if (o.children) {
......@@ -331,8 +291,6 @@ export default {
this.$refs.AudioPlayer.play();
}
});
}
}
},
loadWidth() {
......@@ -458,6 +416,10 @@ export default {
this.$refs["AudioPlayer"].pause();
}
},
reload() {
this.$emit("reload");
},
},
};
</script>
......@@ -496,7 +458,7 @@ export default {
overflow-x: hidden;
.content {
width: 100%;
overflow-y: hidden;
overflow-x: hidden;
.content-item {
width: 100%;
}
......@@ -571,7 +533,7 @@ export default {
padding: 60px;
position: relative;
.title {
font-size: 62px;
font-size: 54px;
font-family: KaiTi;
font-weight: 400;
color: #0f0f0f;
......@@ -584,6 +546,7 @@ export default {
display: flex;
.item {
display: flex;
margin-right: 16px;
.label,
.value {
font-size: 18px;
......@@ -749,6 +712,7 @@ export default {
width: 100%;
height: 569px;
background-image: url("@/assets/imgs/display/lts-bg.png");
overflow-x: hidden;
}
}
}
......
<!-- -->
<template>
<div class="units-content">
<div class="units-content-item" v-for="(unit, index) in units" :key="index">
<div class="unit-title">{{ unit.title }}</div>
<div class="unit-intro">{{ unit.intro }}</div>
<div class="unit-imgs" v-if="unit.imagesVo && unit.imagesVo.length > 0">
<div class="img-item" v-for="(i, idx) in unit.imagesVo" :key="idx">
<img :src="$getFullUrl(i.url)" />
</div>
</div>
<ChStyleUnit
:units="unit.children"
v-if="unit.children && unit.children.length > 0"
/>
</div>
</div>
</template>
<script>
export default {
name: "ChStyleUnit",
props: {
units: {
type: Array,
default: () => [],
},
},
};
</script>
<style lang="scss" scoped>
.units-content-item {
margin-bottom: 20px;
.unit-title {
font-size: 36px;
font-family: KaiTi;
font-weight: 400;
color: #4e392c;
line-height: 83px;
display: flex;
justify-content: center;
}
.unit-intro {
font-size: 16px;
font-family: Microsoft YaHei;
font-weight: 400;
color: #444444;
text-indent: 36px;
margin-bottom: 10px;
line-height: 32px;
}
.unit-imgs {
width: 100%;
.img-item {
width: 100%;
img {
width: 100%;
}
}
}
}
</style>
差异被折叠。
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论