|
@@ -35,15 +35,21 @@
|
|
|
<image :src="globalImgUrls.activityNoAuth" mode="widthFix" style="width:100%;"/>
|
|
|
<view>暂无提问<text v-if="userInfo.is_inner!==1">,快试试提问功能吧</text></view>
|
|
|
</view>
|
|
|
- <view class="question-list" :class="{'last':finished}">
|
|
|
- <view class="question-item" v-for="item in questionList" :key="item.community_question_id">
|
|
|
+ <view class="question-list" :class="showAudioPop?showAudioBigPop?'list-bot3':'list-bot2':'list-bot1'">
|
|
|
+ <view class="question-item" @click="handleGoDetail(item)" v-for="item in questionList" :key="item.community_question_id">
|
|
|
<view class="question-info">
|
|
|
<view style="flex:1;" class="question-title">
|
|
|
<text class="item-label">{{item.variety_tag_name}}</text>
|
|
|
<!-- <text class="item-title"> -->{{ item.question_content }}<!-- </text> -->
|
|
|
</view>
|
|
|
<view class="item-answer">
|
|
|
- <view class="answer" @click="handleAudio(item)">
|
|
|
+ <!-- 改为背景音频播放 -->
|
|
|
+ <view class="answer" @click.stop="handlePlayAudioByBg(item)">
|
|
|
+ <image class="music-img" :src="item.community_question_id==curVoiceId&&!curAudioPaused?playImgSrc:pauseImgSrc" mode="widthFix"/>
|
|
|
+ <text>{{ moment(item.answer.audioTime).format('mm:ss') }}</text>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <!-- <view class="answer" @click.stop="handleAudio(item)">
|
|
|
<template v-if="!item.loading">
|
|
|
<image class="music-img" :src="item.answer.isplay?playImgSrc:pauseImgSrc" mode="widthFix"/>
|
|
|
<template v-if="item.answer.isplay || item.answer.ispause">
|
|
@@ -61,14 +67,14 @@
|
|
|
<image class="load-img" src="../../static/loading.png" mode="aspectFill" />
|
|
|
<text>{{ moment(item.answer.audioTime).format('mm:ss') }}</text>
|
|
|
</template>
|
|
|
- </view>
|
|
|
+ </view> -->
|
|
|
</view>
|
|
|
</view>
|
|
|
<text class="item-time">提问时间:{{ item.create_time }}</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
<template v-if="isUserResearcher">
|
|
|
- <view class="btn-wrap">
|
|
|
+ <view class="btn-wrap" :class="showAudioPop?showAudioBigPop?'btn-bot3':'btn-bot2':'btn-bot1'">
|
|
|
<view class="btn topage-button" @click="toPage('question')" v-if="userInfo.status&&userAuth">
|
|
|
<image
|
|
|
src="../../static/question/askquestion.png"
|
|
@@ -129,15 +135,24 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</van-popup>
|
|
|
+
|
|
|
+ <!-- 音频悬浮 -->
|
|
|
+ <view v-if="showPage">
|
|
|
+ <audioBox v-if="showAudioPop"/>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import mixin from "../../mixin/questionMixin";
|
|
|
-import {apiOptionGroupList,apiBarTotal} from '@/api/question'
|
|
|
+import {apiOptionGroupList,apiBarTotal,apiCountAudioClick} from '@/api/question'
|
|
|
import {apiGetTagTree} from '@/api/common'
|
|
|
+import audioBox from '@/components/audioBox/audioBox.vue'
|
|
|
export default {
|
|
|
mixins: [mixin],
|
|
|
+ components:{
|
|
|
+ audioBox
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
questionList: [],
|
|
@@ -157,6 +172,8 @@ export default {
|
|
|
//seal_name:'梁娜',
|
|
|
//seal_mobile:123456,
|
|
|
},//mock用户信息 */
|
|
|
+
|
|
|
+ showPage:false
|
|
|
}
|
|
|
},
|
|
|
watch:{
|
|
@@ -165,7 +182,18 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
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
|
|
|
+ },
|
|
|
},
|
|
|
onLoad() {
|
|
|
/* this.getVistor()
|
|
@@ -176,7 +204,11 @@ export default {
|
|
|
this.getdistributeNum()
|
|
|
this.getOptionList()
|
|
|
this.getQuestionList(3)
|
|
|
+ this.showPage=true
|
|
|
},
|
|
|
+ onHide(){
|
|
|
+ this.showPage=false
|
|
|
+ },
|
|
|
onReachBottom() {
|
|
|
if(this.finished) return
|
|
|
this.page++
|
|
@@ -189,6 +221,13 @@ export default {
|
|
|
uni.stopPullDownRefresh()
|
|
|
}, 1500);
|
|
|
},
|
|
|
+ //转发分享
|
|
|
+ onShareAppMessage(){
|
|
|
+ return{
|
|
|
+ title:'问答社区',
|
|
|
+ path:'/pages/question/question'
|
|
|
+ }
|
|
|
+ },
|
|
|
methods: {
|
|
|
//获取研究员问答列表数量统计
|
|
|
getdistributeNum() {
|
|
@@ -248,13 +287,6 @@ export default {
|
|
|
uni.navigateTo({ url: '/pages-question/answerList' })
|
|
|
}
|
|
|
},
|
|
|
- //转发分享
|
|
|
- onShareAppMessage(){
|
|
|
- return{
|
|
|
- title:'问答社区',
|
|
|
- path:'/pages/question/question'
|
|
|
- }
|
|
|
- },
|
|
|
refreshPage() {
|
|
|
this.page = 1
|
|
|
this.selectId = -1
|
|
@@ -262,6 +294,10 @@ export default {
|
|
|
this.finished = false
|
|
|
this.getQuestionList(3)
|
|
|
},
|
|
|
+ //跳转详情
|
|
|
+ handleGoDetail(item){
|
|
|
+ uni.navigateTo({ url: `/pages-question/answerDetail?id=${item.community_question_id}` })
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
@@ -379,6 +415,15 @@ page {
|
|
|
padding-bottom: 260rpx;
|
|
|
}
|
|
|
}
|
|
|
+ .list-bot1{
|
|
|
+ padding-bottom: 200rpx;
|
|
|
+ }
|
|
|
+ .list-bot2{
|
|
|
+ padding-bottom: 340rpx;
|
|
|
+ }
|
|
|
+ .list-bot3{
|
|
|
+ padding-bottom: 440rpx;
|
|
|
+ }
|
|
|
|
|
|
.topage-btn {
|
|
|
position: fixed;
|
|
@@ -410,7 +455,8 @@ page {
|
|
|
margin-left: -30rpx;
|
|
|
display: flex;
|
|
|
justify-content: center;
|
|
|
- bottom: 215rpx;
|
|
|
+ bottom: calc(120rpx + constant(safe-area-inset-bottom));
|
|
|
+ bottom: calc(120rpx + env(safe-area-inset-bottom));
|
|
|
.btn{
|
|
|
width:300rpx;
|
|
|
height:80rpx;
|
|
@@ -419,6 +465,20 @@ page {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ .btn-bot1{
|
|
|
+ bottom: calc(120rpx + constant(safe-area-inset-bottom));
|
|
|
+ bottom: calc(120rpx + env(safe-area-inset-bottom));
|
|
|
+ }
|
|
|
+ .btn-bot2{
|
|
|
+ bottom: calc(260rpx + constant(safe-area-inset-bottom));
|
|
|
+ bottom: calc(260rpx + env(safe-area-inset-bottom));
|
|
|
+ }
|
|
|
+ .btn-bot3{
|
|
|
+ bottom: calc(355rpx + constant(safe-area-inset-bottom));
|
|
|
+ bottom: calc(355rpx + env(safe-area-inset-bottom));
|
|
|
+ }
|
|
|
+
|
|
|
.global-pup{
|
|
|
.content{
|
|
|
padding:90rpx 34rpx;
|