|
@@ -13,11 +13,14 @@
|
|
|
:format-tooltip="formatProcessToolTip"
|
|
|
@change="changeCurrentTime"
|
|
|
/>
|
|
|
- <span>{{
|
|
|
- audio.maxTime
|
|
|
- ? realFormatSecond(audio.maxTime - audio.currentTime)
|
|
|
- : ""
|
|
|
- }}</span>
|
|
|
+ <span
|
|
|
+ ><template v-if="audio.playing">-</template
|
|
|
+ >{{
|
|
|
+ audio.maxTime
|
|
|
+ ? realFormatSecond(audio.maxTime - audio.currentTime)
|
|
|
+ : ""
|
|
|
+ }}</span
|
|
|
+ >
|
|
|
</template>
|
|
|
<audio
|
|
|
ref="audio"
|
|
@@ -35,7 +38,7 @@
|
|
|
export default {
|
|
|
// import引入的组件需要注入到对象中才能使用
|
|
|
components: {},
|
|
|
- props: ["mp3", "getCurTime", "stopAudio", "width", "isRepeat","themeColor"],
|
|
|
+ props: ["mp3", "getCurTime", "stopAudio", "width", "isRepeat", "themeColor"],
|
|
|
data() {
|
|
|
// 这里存放数据
|
|
|
return {
|
|
@@ -54,7 +57,7 @@ export default {
|
|
|
},
|
|
|
// 计算属性 类似于data概念
|
|
|
computed: {
|
|
|
- sliderWidth () {
|
|
|
+ sliderWidth() {
|
|
|
let width = 0;
|
|
|
if (this.width) {
|
|
|
width = this.width;
|
|
@@ -67,7 +70,7 @@ export default {
|
|
|
// 监控data中数据变化
|
|
|
watch: {
|
|
|
stopAudio: {
|
|
|
- handler (val, oldVal) {
|
|
|
+ handler(val, oldVal) {
|
|
|
const _this = this;
|
|
|
if (val) {
|
|
|
_this.$refs.audio.pause();
|
|
@@ -77,11 +80,11 @@ export default {
|
|
|
// 深度观察监听
|
|
|
deep: true,
|
|
|
},
|
|
|
- 'audio.playing': {
|
|
|
- handler (val) {
|
|
|
- this.$emit('playChange', val);
|
|
|
- }
|
|
|
- }
|
|
|
+ "audio.playing": {
|
|
|
+ handler(val) {
|
|
|
+ this.$emit("playChange", val);
|
|
|
+ },
|
|
|
+ },
|
|
|
},
|
|
|
// 生命周期 - 创建完成(可以访问当前this实例)
|
|
|
created() {},
|
|
@@ -216,7 +219,7 @@ export default {
|
|
|
result = "0" + result;
|
|
|
}
|
|
|
} else {
|
|
|
- result = "00:" + result;
|
|
|
+ //result = "00:" + result;
|
|
|
}
|
|
|
return result;
|
|
|
},
|
|
@@ -234,7 +237,7 @@ export default {
|
|
|
<style lang="scss" scoped>
|
|
|
/* @import url(); 引入css类 */
|
|
|
.Audio {
|
|
|
- width:100%;
|
|
|
+ width: 100%;
|
|
|
.audioLine {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
@@ -267,7 +270,7 @@ export default {
|
|
|
color: #000;
|
|
|
margin-left: 8px;
|
|
|
margin-right: 12px;
|
|
|
- min-width: 70px;
|
|
|
+ min-width: 56px;
|
|
|
text-align: right;
|
|
|
}
|
|
|
}
|
|
@@ -315,23 +318,23 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-.NNPE-Big-Book-preview-green{
|
|
|
+.NNPE-Big-Book-preview-green {
|
|
|
.Audio {
|
|
|
.el-slider__bar {
|
|
|
- background: #24B99E !important;
|
|
|
+ background: #24b99e !important;
|
|
|
}
|
|
|
.el-slider__button {
|
|
|
- background: #24B99E !important;
|
|
|
+ background: #24b99e !important;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-.NNPE-Big-Book-preview-brown{
|
|
|
+.NNPE-Big-Book-preview-brown {
|
|
|
.Audio {
|
|
|
.el-slider__bar {
|
|
|
- background: #BD8865 !important;
|
|
|
+ background: #bd8865 !important;
|
|
|
}
|
|
|
.el-slider__button {
|
|
|
- background: #BD8865 !important;
|
|
|
+ background: #bd8865 !important;
|
|
|
}
|
|
|
}
|
|
|
}
|