|
@@ -11,6 +11,7 @@
|
|
|
:modules="modules"
|
|
|
:slides-per-view="1"
|
|
|
:free-mode="true"
|
|
|
+ @paginationRender="handlePageRender"
|
|
|
>
|
|
|
<swiper-slide
|
|
|
v-for="(item, index) in currentTag.imageTextInfo.imageList"
|
|
@@ -21,7 +22,7 @@
|
|
|
</Swiper>
|
|
|
<div class="audio-control" v-if="hasAudio">
|
|
|
<ui-icon
|
|
|
- @click="pauseAudio"
|
|
|
+ @click.prevent="pauseAudio"
|
|
|
type="player_pause"
|
|
|
v-if="isPlaying"
|
|
|
></ui-icon>
|
|
@@ -50,6 +51,7 @@ import {
|
|
|
computed,
|
|
|
onUnmounted,
|
|
|
unref,
|
|
|
+ watchEffect,
|
|
|
} from "vue";
|
|
|
import { useStore } from "vuex";
|
|
|
import { useI18n, getLocale } from "@/i18n";
|
|
@@ -67,10 +69,12 @@ const currentTag = computed(() => store.getters["tags/currentTag"]);
|
|
|
|
|
|
const modules = ref([Pagination, Navigation]);
|
|
|
const hasAudio = computed(
|
|
|
- () => currentTag.value.imageTextInfo.audio.ossPath.length > 0
|
|
|
+ () =>
|
|
|
+ currentTag.value.imageTextInfo.audio.ossPath &&
|
|
|
+ currentTag.value.imageTextInfo.audio.ossPath.length > 0
|
|
|
);
|
|
|
const time = ref("00:00");
|
|
|
-const audioAllTime = ref("");
|
|
|
+const audioAllTime = ref("00:00");
|
|
|
const isPlaying = ref(false);
|
|
|
|
|
|
function transTime(time) {
|
|
@@ -135,6 +139,13 @@ const pauseAudio = () => {
|
|
|
onUnmounted(() => {
|
|
|
pauseAudio();
|
|
|
});
|
|
|
+
|
|
|
+function handlePageRender(_, el) {
|
|
|
+ if (unref(hasAudio)) {
|
|
|
+ el.style.left = "20%";
|
|
|
+ el.style.transform = "translateX(-20%)";
|
|
|
+ }
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss">
|
|
@@ -175,16 +186,18 @@ onUnmounted(() => {
|
|
|
|
|
|
.audio-control {
|
|
|
position: absolute;
|
|
|
+ z-index: 10000;
|
|
|
bottom: 50px;
|
|
|
border-radius: 8px;
|
|
|
background: rgba(0, 0, 0, 0.6);
|
|
|
width: 122px;
|
|
|
height: 32px;
|
|
|
+ word-spacing: -2px;
|
|
|
background: rgba(0, 0, 0, 0.4);
|
|
|
opacity: 1;
|
|
|
border: 1px solid rgba(255, 255, 255, 0.2);
|
|
|
- left:70%;
|
|
|
- transform: translateX(-70%);
|
|
|
+ left: 75%;
|
|
|
+ transform: translateX(-75%);
|
|
|
line-height: 32px;
|
|
|
display: flex;
|
|
|
justify-content: center;
|
|
@@ -231,8 +244,8 @@ onUnmounted(() => {
|
|
|
border: 1px solid rgba(255, 255, 255, 0.2);
|
|
|
color: #fff;
|
|
|
border-radius: 15px;
|
|
|
- left: 20%;
|
|
|
- transform: translateX(-20%);
|
|
|
+ left: 50%;
|
|
|
+ transform: translateX(-50%);
|
|
|
bottom: 50px;
|
|
|
.swiper-pagination-total {
|
|
|
color: #858586;
|