Commit 802976f5 authored by songrui's avatar songrui

mp3 播放修改

parent f1b2c653
<svg width="8" height="9" viewBox="0 0 8 9" xmlns="http://www.w3.org/2000/svg">
<rect x="0.158203" y="0.900391" width="2.68262" height="7.70361" rx="1"/>
<rect x="5.1582" y="0.900391" width="2.68262" height="7.70361" rx="1"/>
</svg>
\ No newline at end of file
<template>
<div class="check-btn">
</div>
</template>
<script>
export default {
name: 'CheckBtn',
props:{
}
}
</script>
<style lang="less" scoped>
</style>
......@@ -3,7 +3,8 @@
<div v-if="file.annexFileName" class="text-12 mb-1 text-ellipsis">{{ file.annexFileName }}</div>
<div class="flex items-center justify-between gap-x-2.5">
<div class="shrink-0 play-bt" @click="start(file)">
<doc-icon type="doc-play" />
<doc-icon type="doc-play" v-if="!player.playing"/>
<doc-icon type="doc-pause" v-else/>
</div>
<span class="shrink-0 time">{{timeFormat(player.duration)}}</span>
<div class="grow progress">
......@@ -49,6 +50,10 @@ export default {
methods: {
init() {
this.player = new musicPlayer(this.$refs.audio)
this.player.audioEl.onended = () => {
console.log('播放结束')
this.stop()
}
},
start(item) {
if (!item || !item.annexUrl) {
......@@ -88,6 +93,7 @@ export default {
},
onProgress(value) {
this.player.progressChange(value)
this.player.playing = true
}
}
}
......@@ -106,6 +112,7 @@ export default {
background-color: #E4F2F0;
font-size: 10px;
padding-left: 2px;
color: var(--van-primary-color);
}
.progress {
// height: 6px;
......
......@@ -159,6 +159,11 @@ const routes = [
component: () => import(/* webpackChunkName: "residentWX-nim" */ '@/residentWX/nim/Session.vue'),
}
]
},
{
path: '/test',
name: 'Test',
component: () => import(/* webpackChunkName: "test" */ '@/test/Index.vue'),
}
]
......
<template>
<div class="test">
<h4>机构选择</h4>
<div class="flex items-center">
<van-button type="primary" size="small" @click="unitData.visible = true">选择机构</van-button>
<span class="ml-2">{{unitData.value}}</span>
</div>
<DocUnit v-model:show="unitData.visible" v-model:value="unitData.value"/>
</div>
</template>
<script>
import DocUnit from '@/doctor/components/docUnit/DocUnit.vue'
export default {
components:{
DocUnit
},
data(){
return {
unitData: {
visible: false,
value: undefined
}
}
},
created() {
sessionStorage.setItem('token', 'dd16fd27-4cfc-492e-a772-c817033133bb')
}
}
</script>
<style lang="less" scoped>
</style>
......@@ -39,12 +39,12 @@ module.exports = defineConfig({
}
},
'/chronic-resident': {
target: 'http://192.168.1.125:8903',
// target: 'https://beta-tumour.zmnyjk.com',
// target: 'http://192.168.1.125:8903',
target: 'https://beta-tumour.zmnyjk.com',
changOrigin: true,
pathRewrite: {
'^/chronic-resident': '/',
// '^/chronic-resident': '/chronic-resident'
// '^/chronic-resident': '/',
'^/chronic-resident': '/chronic-resident'
}
}
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment