|
@@ -1,31 +1,25 @@
|
|
<template>
|
|
<template>
|
|
<div class="background-music-settings">
|
|
<div class="background-music-settings">
|
|
- <span class="title">{{set_bgm}}</span>
|
|
|
|
- <br>
|
|
|
|
|
|
+ <span class="title">{{ set_bgm }}</span>
|
|
|
|
+ <br />
|
|
<button v-if="!(info && info.workBackgroundMusic && info.workBackgroundMusic.name)" @click="onClickMusicSelectionBtn">
|
|
<button v-if="!(info && info.workBackgroundMusic && info.workBackgroundMusic.name)" @click="onClickMusicSelectionBtn">
|
|
<i class="iconfont icon-editor_add"></i>
|
|
<i class="iconfont icon-editor_add"></i>
|
|
- {{add_audio}}
|
|
|
|
|
|
+ {{ add_audio }}
|
|
</button>
|
|
</button>
|
|
<template v-else>
|
|
<template v-else>
|
|
<div class="music-display" @click.self="onClickCurrentMusic">
|
|
<div class="music-display" @click.self="onClickCurrentMusic">
|
|
<Audio ref="my-audio" class="audio-control" :backgroundColor="'#1A1B1D'" :myAudioUrl="info.workBackgroundMusic.ossPath"></Audio>
|
|
<Audio ref="my-audio" class="audio-control" :backgroundColor="'#1A1B1D'" :myAudioUrl="info.workBackgroundMusic.ossPath"></Audio>
|
|
- <div class="name" v-title="info.workBackgroundMusic.name" @click="onClickCurrentMusic">{{info.workBackgroundMusic.name}}</div>
|
|
|
|
|
|
+ <div class="name" v-title="info.workBackgroundMusic.name" @click="onClickCurrentMusic">{{ info.workBackgroundMusic.name }}</div>
|
|
<i class="iconfont icon-editor_list_delete" @click.stop="onClickDeleteMusicBtn"></i>
|
|
<i class="iconfont icon-editor_list_delete" @click.stop="onClickDeleteMusicBtn"></i>
|
|
</div>
|
|
</div>
|
|
<button @click="onClickMusicSelectionBtn">
|
|
<button @click="onClickMusicSelectionBtn">
|
|
<i class="iconfont icon-editor_update"></i>
|
|
<i class="iconfont icon-editor_update"></i>
|
|
- {{change_audio}}
|
|
|
|
|
|
+ {{ change_audio }}
|
|
</button>
|
|
</button>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<div class="dialog" style="z-index: 2000" v-if="isShowSelectionWindow">
|
|
<div class="dialog" style="z-index: 2000" v-if="isShowSelectionWindow">
|
|
- <MaterialSelector
|
|
|
|
- :title="select_material"
|
|
|
|
- @cancel="isShowSelectionWindow = false"
|
|
|
|
- @submit="handleSubmitFromMaterialSelector"
|
|
|
|
- :selectableType="['audio']"
|
|
|
|
- initialMaterialType="audio"
|
|
|
|
- />
|
|
|
|
|
|
+ <MaterialSelector :title="select_material" @cancel="isShowSelectionWindow = false" @submit="handleSubmitFromMaterialSelector" :selectableType="['audio']" initialMaterialType="audio" />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
@@ -34,7 +28,7 @@
|
|
import { mapGetters } from "vuex";
|
|
import { mapGetters } from "vuex";
|
|
import MaterialSelector from "@/components/materialSelector.vue";
|
|
import MaterialSelector from "@/components/materialSelector.vue";
|
|
import Audio from "@/components/audio/audioButton.vue";
|
|
import Audio from "@/components/audio/audioButton.vue";
|
|
-import {i18n} from "@/lang"
|
|
|
|
|
|
+import { i18n } from "@/lang";
|
|
|
|
|
|
export default {
|
|
export default {
|
|
components: {
|
|
components: {
|
|
@@ -43,51 +37,49 @@ export default {
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
- set_bgm:i18n.t("edit_settings.set_bgm"),
|
|
|
|
- add_audio:i18n.t("edit_settings.add_audio"),
|
|
|
|
- change_audio:i18n.t("edit_settings.change_audio"),
|
|
|
|
- select_material:i18n.t("gather.select_material"),
|
|
|
|
|
|
+ set_bgm: i18n.t("edit_settings.set_bgm"),
|
|
|
|
+ add_audio: i18n.t("edit_settings.add_audio"),
|
|
|
|
+ change_audio: i18n.t("edit_settings.change_audio"),
|
|
|
|
+ select_material: i18n.t("gather.select_material"),
|
|
isShowSelectionWindow: false,
|
|
isShowSelectionWindow: false,
|
|
- }
|
|
|
|
|
|
+ };
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
...mapGetters({
|
|
...mapGetters({
|
|
// info:'info'
|
|
// info:'info'
|
|
- info:'base/baseInfo'
|
|
|
|
|
|
+ info: "base/baseInfo",
|
|
}),
|
|
}),
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
onClickMusicSelectionBtn() {
|
|
onClickMusicSelectionBtn() {
|
|
- this.isShowSelectionWindow = true
|
|
|
|
|
|
+ this.isShowSelectionWindow = true;
|
|
},
|
|
},
|
|
onClickDeleteMusicBtn() {
|
|
onClickDeleteMusicBtn() {
|
|
- this.info.workBackgroundMusic.id = null
|
|
|
|
- this.info.workBackgroundMusic.fodderId = null
|
|
|
|
- this.info.workBackgroundMusic.name = null
|
|
|
|
- this.info.workBackgroundMusic.ossPath = null
|
|
|
|
|
|
+ this.info.workBackgroundMusic = null;
|
|
|
|
+ // this.info.workBackgroundMusic.id = null
|
|
|
|
+ // this.info.workBackgroundMusic.fodderId = null
|
|
|
|
+ // this.info.workBackgroundMusic.name = null
|
|
|
|
+ // this.info.workBackgroundMusic.ossPath = null
|
|
},
|
|
},
|
|
handleSubmitFromMaterialSelector(selected) {
|
|
handleSubmitFromMaterialSelector(selected) {
|
|
- this.isShowSelectionWindow = false
|
|
|
|
- this.info.workBackgroundMusic.fodderId = selected[0].id
|
|
|
|
- this.info.workBackgroundMusic.name = selected[0].name
|
|
|
|
- this.info.workBackgroundMusic.ossPath = selected[0].ossPath
|
|
|
|
|
|
+ this.isShowSelectionWindow = false;
|
|
|
|
+ this.info.workBackgroundMusic = {};
|
|
|
|
+ this.info.workBackgroundMusic.fodderId = selected[0].id;
|
|
|
|
+ this.info.workBackgroundMusic.name = selected[0].name;
|
|
|
|
+ this.info.workBackgroundMusic.ossPath = selected[0].ossPath;
|
|
},
|
|
},
|
|
onClickCurrentMusic() {
|
|
onClickCurrentMusic() {
|
|
- if (this.$refs['my-audio']) {
|
|
|
|
- this.$refs['my-audio'].switchPlayPause()
|
|
|
|
|
|
+ if (this.$refs["my-audio"]) {
|
|
|
|
+ this.$refs["my-audio"].switchPlayPause();
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
+ },
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
if (!this.info.workBackgroundMusic) {
|
|
if (!this.info.workBackgroundMusic) {
|
|
- this.info.workBackgroundMusic = {
|
|
|
|
- id: '',
|
|
|
|
- name: '',
|
|
|
|
- ossPath: '',
|
|
|
|
- }
|
|
|
|
|
|
+ this.info.workBackgroundMusic = null;
|
|
}
|
|
}
|
|
- }
|
|
|
|
-}
|
|
|
|
|
|
+ },
|
|
|
|
+};
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="less" scoped>
|
|
<style lang="less" scoped>
|
|
@@ -97,17 +89,17 @@ export default {
|
|
height: 546px;
|
|
height: 546px;
|
|
> .title {
|
|
> .title {
|
|
font-size: 18px;
|
|
font-size: 18px;
|
|
- color: #FFFFFF;
|
|
|
|
|
|
+ color: #ffffff;
|
|
}
|
|
}
|
|
> button {
|
|
> button {
|
|
margin-top: 16px;
|
|
margin-top: 16px;
|
|
width: 234px;
|
|
width: 234px;
|
|
height: 40px;
|
|
height: 40px;
|
|
- background: #1A1B1D;
|
|
|
|
|
|
+ background: #1a1b1d;
|
|
border-radius: 2px;
|
|
border-radius: 2px;
|
|
border: 1px solid #404040;
|
|
border: 1px solid #404040;
|
|
display: block;
|
|
display: block;
|
|
- color: #0076F6;
|
|
|
|
|
|
+ color: #0076f6;
|
|
font-size: 14px;
|
|
font-size: 14px;
|
|
cursor: pointer;
|
|
cursor: pointer;
|
|
&:hover {
|
|
&:hover {
|
|
@@ -122,7 +114,7 @@ export default {
|
|
margin-top: 16px;
|
|
margin-top: 16px;
|
|
width: 234px;
|
|
width: 234px;
|
|
height: 40px;
|
|
height: 40px;
|
|
- background: #1A1B1D;
|
|
|
|
|
|
+ background: #1a1b1d;
|
|
border-radius: 2px;
|
|
border-radius: 2px;
|
|
border: 1px solid #404040;
|
|
border: 1px solid #404040;
|
|
color: #fff;
|
|
color: #fff;
|
|
@@ -130,7 +122,7 @@ export default {
|
|
position: relative;
|
|
position: relative;
|
|
text-align: center;
|
|
text-align: center;
|
|
&:hover {
|
|
&:hover {
|
|
- color: #0076F6;
|
|
|
|
|
|
+ color: #0076f6;
|
|
border-color: @color;
|
|
border-color: @color;
|
|
> .audio-control {
|
|
> .audio-control {
|
|
display: inline-block;
|
|
display: inline-block;
|
|
@@ -164,9 +156,9 @@ export default {
|
|
transform: translateY(-50%);
|
|
transform: translateY(-50%);
|
|
right: 18px;
|
|
right: 18px;
|
|
&:hover {
|
|
&:hover {
|
|
- color: #FA5555;
|
|
|
|
|
|
+ color: #fa5555;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-</style>
|
|
|
|
|
|
+</style>
|