|
@@ -11,8 +11,11 @@
|
|
|
{{ questionItem.question_content }}
|
|
|
</view>
|
|
|
<view class="item-answer" v-if="questionItem.reply_status === 3&&!isUserResearcher">
|
|
|
- <view class="answer" @click.stop="handleAudio(questionItem)">
|
|
|
- <template v-if="!questionItem.loading">
|
|
|
+ <view class="answer" @click.stop="handlePlayAudioByBg(questionItem)">
|
|
|
+ <!-- 改为背景音频播放 -->
|
|
|
+ <image class="music-img" :src="questionItem.community_question_id==curVoiceId&&!curAudioPaused?playImgSrc:pauseImgSrc" mode="widthFix"/>
|
|
|
+ <text>{{ moment(questionItem.audio_list[0].audio_play_seconds*1000).format("mm:ss") }}</text>
|
|
|
+ <!-- <template v-if="!questionItem.loading">
|
|
|
<image
|
|
|
class="music-img"
|
|
|
:src="questionItem.answer.isplay ? playImgSrc : pauseImgSrc"
|
|
@@ -52,8 +55,10 @@
|
|
|
<text>{{
|
|
|
moment(questionItem.answer.audioTime).format("mm:ss")
|
|
|
}}</text>
|
|
|
- </template>
|
|
|
+ </template> -->
|
|
|
</view>
|
|
|
+ <!-- 普通用户进入的音频悬浮 -->
|
|
|
+ <audioBox v-if="showAudioPop"/>
|
|
|
</view>
|
|
|
</view>
|
|
|
<text class="item-time">提问时间:{{ questionItem.create_time }}</text>
|
|
@@ -188,8 +193,8 @@
|
|
|
<view class="audio-wrap">
|
|
|
<view class="play">
|
|
|
<van-icon
|
|
|
- :name="isplay ? 'pause' : 'play'"
|
|
|
- @click="handleAudioByReplay"
|
|
|
+ :name="questionItem.community_question_id==curVoiceId&&!curAudioPaused ? 'pause' : 'play'"
|
|
|
+ @click="handlePlayAudioByBg(questionItem)"
|
|
|
color="#E6B77DFF"
|
|
|
size="64rpx"
|
|
|
style="align-items: flex-start; margin-left: -20rpx"
|
|
@@ -197,9 +202,9 @@
|
|
|
<!-- 进度条 -->
|
|
|
<view class="slider-box">
|
|
|
<slider
|
|
|
- :value="currentAudioMsg.audioCurrentTime"
|
|
|
+ :value="curTime"
|
|
|
:max="currentAudioMsg.audioTime"
|
|
|
- @change="sliderChange($event)"
|
|
|
+ @change="bgAudiosliderChange($event)"
|
|
|
@changing="sliderChanging"
|
|
|
activeColor="#E6B77DFF"
|
|
|
backgroundColor="#EBEBEBFF"
|
|
@@ -208,7 +213,7 @@
|
|
|
/>
|
|
|
<view class="slider-time">
|
|
|
<text>{{
|
|
|
- moment(currentAudioMsg.audioCurrentTime * 1000).format(
|
|
|
+ moment(curTime*1000).format(
|
|
|
"mm:ss"
|
|
|
)
|
|
|
}}</text>
|
|
@@ -222,6 +227,11 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="audio-pub disable">已发布</view>
|
|
|
+
|
|
|
+ <!-- 音频悬浮 -->
|
|
|
+ <view v-show="false">
|
|
|
+ <audioBox v-if="showAudioPop"/>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</template>
|
|
@@ -247,8 +257,33 @@ import { apiReplayAsk, apiGetQuestion, apiSetRead,apiCountAudioClick } from "@/a
|
|
|
import { apiApplyPermission} from '@/api/user';
|
|
|
import {apiGetSceneToParams} from "../api/common.js"
|
|
|
import { uploadAudioToServer } from "@/utils/upload";
|
|
|
+import audioBox from '@/components/audioBox/audioBox.vue'
|
|
|
export default {
|
|
|
mixins: [mixin],
|
|
|
+ components:{
|
|
|
+ audioBox
|
|
|
+ },
|
|
|
+ computed:{
|
|
|
+ showAudioPop(){//是否显示音频弹窗
|
|
|
+ return this.$store.state.audio.show
|
|
|
+ },
|
|
|
+ showAudioBigPop(){
|
|
|
+ return this.$store.state.audio.showBig
|
|
|
+ },
|
|
|
+ curVoiceId(){//当前正在播放的音频id
|
|
|
+ return this.$store.state.audio.questionId
|
|
|
+ },
|
|
|
+ curAudioPaused(){//当前音频是否暂停状态
|
|
|
+ return this.$store.state.audio.paused
|
|
|
+ },
|
|
|
+ curTime(){
|
|
|
+ let t=0
|
|
|
+ if(this.questionItem?.community_question_id==this.$store.state.audio.questionId){
|
|
|
+ t=this.$store.state.audio.curTime
|
|
|
+ }
|
|
|
+ return t
|
|
|
+ }
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
questionItem: null /* {
|
|
@@ -694,6 +729,11 @@ export default {
|
|
|
sliderChanging() {
|
|
|
this.isSlider = true;
|
|
|
},
|
|
|
+ // 背景音频播放的拖动
|
|
|
+ bgAudiosliderChange(e){
|
|
|
+ const value=e.detail.value
|
|
|
+ this.globalBgMusic.seek(value)
|
|
|
+ },
|
|
|
//切换当前播放音频
|
|
|
changeCurrentAudio(item) {
|
|
|
const { id } = item;
|