|
@@ -1,62 +1,54 @@
|
|
|
<template>
|
|
|
<view class="question-wrap">
|
|
|
<view class="question-top">
|
|
|
- <text class="text" :class="{'active':selectType==='all'}" @click="changeSelect('all')">热门问答</text>
|
|
|
- <view class="text" :class="{'active':selectType==='me'}" @click="changeSelect('me')">我的{{ vistor.type === 1 ? '回答' : '提问' }}</view>
|
|
|
<template>
|
|
|
<image src="../../static/chart/menu.png" mode="widthFix" class="menu-icon"
|
|
|
@click="showPopup" />
|
|
|
筛选
|
|
|
- </template>
|
|
|
-
|
|
|
- <van-popup :show="isPopupShow" position="bottom" round :close-on-click-overlay="false"
|
|
|
- @close="isPopupShow = false" :style="{ height: '30%' }">
|
|
|
+ </template>
|
|
|
+ <van-popup :show="isPopupShow" position="left" :close-on-click-overlay="true"
|
|
|
+ @close="isPopupShow = false"
|
|
|
+ custom-style="height: 100%;width:50%;"
|
|
|
+ @touchmove.stop.prevent>
|
|
|
<view class="pop-wrap">
|
|
|
- <view class="pop-top">
|
|
|
- <text>全部筛选</text>
|
|
|
- <text @click="isPopupShow=false">取消</text>
|
|
|
- </view>
|
|
|
<view class="pop-option-list">
|
|
|
<van-collapse :value="activeName" @change="changeSelecOption" accordion :border="false">
|
|
|
<van-collapse-item :border="false" :title="item.title" :name="index" v-for="(item, index) in optionList"
|
|
|
:key="index">
|
|
|
<view class="option-btn-wrap">
|
|
|
- <view class="option-btn" @click="selectName=i.name" :class="{'active':selectName===i.name}" v-for="(i, _index) in item.btnList" :key="_index">
|
|
|
+ <view class="option-btn" @click="()=>{selectName=i.name;isPopupShow = false}" :class="{'active':selectName===i.name,'full':i.name.length>4}" v-for="(i, _index) in item.btnList" :key="_index">
|
|
|
{{ i.name }}
|
|
|
</view>
|
|
|
</view>
|
|
|
</van-collapse-item>
|
|
|
</van-collapse>
|
|
|
</view>
|
|
|
- <view class="pop-btn" @click="changeSelect('name')">完成</view>
|
|
|
</view>
|
|
|
- </van-popup>
|
|
|
+ </van-popup>
|
|
|
</view>
|
|
|
<view class="question-list">
|
|
|
<view class="question-item" v-for="item in quesionList" :key="item.id">
|
|
|
- <text class="item-title">{{ item.question.text }}</text>
|
|
|
+ <view style="display:flex;">
|
|
|
+ <text class="item-label">{{item.label}}</text>
|
|
|
+ <text class="item-title">{{ item.question.text }}</text>
|
|
|
+ </view>
|
|
|
<text class="item-time">提问时间:{{ item.question.time }}</text>
|
|
|
<view class="item-answer">
|
|
|
- <view class="answer-img"></view>
|
|
|
- <view class="answer-other">
|
|
|
- <view class="answer-info">
|
|
|
- <text class="name">{{ item.answer.name }}</text>
|
|
|
- <text class="group">弘则{{ item.answer.group }}组研究员</text>
|
|
|
- <text class="label">{{ item.label }}</text>
|
|
|
- </view>
|
|
|
<view class="answer" @click="handleAudio(item)">
|
|
|
- <text>{{ item.answer.isplay ? '暂停' : '播放' }}</text>
|
|
|
- <template v-if="item.answer.isplay || item.answer.ispause">
|
|
|
- <text>{{ currentAudioMsg.audioCurrentTime }}/{{ item.answer.audioTime }}</text>
|
|
|
+ <template v-if="!item.loading">
|
|
|
+ <text>{{ item.answer.isplay ? '暂停' : '播放' }}</text>
|
|
|
+ <template v-if="item.answer.isplay || item.answer.ispause">
|
|
|
+ <text>{{ currentAudioMsg.audioCurrentTime }}/{{ item.answer.audioTime }}</text>
|
|
|
+ </template>
|
|
|
+ <template v-else>
|
|
|
+ <text>{{ item.answer.audioTime }}</text>
|
|
|
+ </template>
|
|
|
</template>
|
|
|
<template v-else>
|
|
|
- <text>{{ item.answer.audioTime }}</text>
|
|
|
+ <image class="load-img" src="../../static/loading.png" mode="aspectFill" />
|
|
|
</template>
|
|
|
-
|
|
|
</view>
|
|
|
- </view>
|
|
|
</view>
|
|
|
- <text class="item-time">回答时间:{{ item.answer.time }}</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="topage-btn" @click="toPage(vistor)">
|
|
@@ -121,15 +113,22 @@ export default {
|
|
|
selectName:'宏观'
|
|
|
}
|
|
|
},
|
|
|
+ watch:{
|
|
|
+ selectName(){
|
|
|
+ this.getQuestionList()
|
|
|
+ }
|
|
|
+ },
|
|
|
onLoad() {
|
|
|
this.initAudio()
|
|
|
this.getVistor()
|
|
|
+ this.getOptionList()
|
|
|
+ this.getQuestionList()
|
|
|
},
|
|
|
onShow() {
|
|
|
|
|
|
},
|
|
|
- ononUnload() {
|
|
|
- this.destoryAudio()
|
|
|
+ onUnload() {
|
|
|
+ this.destroyAudio()
|
|
|
},
|
|
|
methods: {
|
|
|
//初始化audio
|
|
@@ -138,9 +137,9 @@ export default {
|
|
|
this.handleAudioFun()
|
|
|
},
|
|
|
//销毁audio
|
|
|
- destoryAudio() {
|
|
|
+ destroyAudio() {
|
|
|
if (this.innerAudio) {
|
|
|
- this.innerAudio.destory()
|
|
|
+ this.innerAudio.destroy()
|
|
|
}
|
|
|
},
|
|
|
//获取访客信息:研究员/客户
|
|
@@ -155,11 +154,24 @@ export default {
|
|
|
canPlay: true,//是否能够播放音频
|
|
|
}
|
|
|
}
|
|
|
+ },
|
|
|
+ //获取筛选列表
|
|
|
+ getOptionList(){
|
|
|
+ },
|
|
|
+ //获取问题列表
|
|
|
+ getQuestionList(){
|
|
|
+
|
|
|
},
|
|
|
//audio事件
|
|
|
handleAudioFun() {
|
|
|
this.innerAudio.onPlay(() => {
|
|
|
console.log('开始了')
|
|
|
+ this.quesionList.map(i=>{
|
|
|
+ if(i.id===this.currentAudioMsg.id){
|
|
|
+ i.loading = false
|
|
|
+ /* uni.hideLoading(); */
|
|
|
+ }
|
|
|
+ })
|
|
|
})
|
|
|
this.innerAudio.onTimeUpdate(() => {
|
|
|
//console.log('时间更新')
|
|
@@ -238,10 +250,18 @@ export default {
|
|
|
const { source, audioTime } = item.answer
|
|
|
this.currentAudioMsg = {
|
|
|
id: id,
|
|
|
- audioCurrentTime: 0,
|
|
|
+ audioCurrentTime: moment(0 * 1000).format('mm:ss'),
|
|
|
audioTime: audioTime,
|
|
|
audioCurrentUrl: source
|
|
|
}
|
|
|
+ this.quesionList.map(i=>{
|
|
|
+ if(i.id===item.id){
|
|
|
+ i.loading = true
|
|
|
+ /* uni.showLoading({
|
|
|
+ title: '加载中'
|
|
|
+ }); */
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
//点击'热门回答'/'只看我的'/筛选弹窗的按钮
|
|
|
changeSelect(type) {
|
|
@@ -295,6 +315,7 @@ export default {
|
|
|
} else {
|
|
|
i.answer.isplay = false
|
|
|
i.answer.ispause = false
|
|
|
+ i.loading = false
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -346,7 +367,8 @@ page {
|
|
|
background-color: #FFFFFF;
|
|
|
.question-top {
|
|
|
display: flex;
|
|
|
- justify-content: space-between;
|
|
|
+ flex: auto;
|
|
|
+ justify-content: flex-end;
|
|
|
align-items: center;
|
|
|
height: 100rpx;
|
|
|
background-color: white;
|
|
@@ -375,38 +397,29 @@ page {
|
|
|
width: 40rpx;
|
|
|
}
|
|
|
.pop-wrap{
|
|
|
- padding: 50rpx 34rpx 0 34rpx;
|
|
|
- .pop-top {
|
|
|
- display: flex;
|
|
|
- justify-content: space-between;
|
|
|
- text{
|
|
|
- font-size: 32rpx;
|
|
|
- &:first-child{
|
|
|
- color: #000000;
|
|
|
- }
|
|
|
- &:last-child{
|
|
|
- color: #E3B377;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
+ height: 100%;
|
|
|
+ padding: 50rpx 34rpx;
|
|
|
.pop-option-list {
|
|
|
.option-btn-wrap {
|
|
|
display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
flex-wrap: wrap;
|
|
|
margin-bottom: 20rpx;
|
|
|
.option-btn {
|
|
|
- width: 215rpx;
|
|
|
+ min-width: 145rpx;
|
|
|
height:76rpx;
|
|
|
line-height: 76rpx;
|
|
|
text-align: center;
|
|
|
color: black;
|
|
|
background-color: #F6F6F6;
|
|
|
border-radius: 4rpx;
|
|
|
- margin: 10rpx 10rpx 0 0;
|
|
|
+ margin-top: 10rpx;
|
|
|
&.active{
|
|
|
background-color: #FAEEDE;
|
|
|
}
|
|
|
+ &.full{
|
|
|
+ width:100%;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -437,6 +450,15 @@ page {
|
|
|
background-color: #FFFFFF;
|
|
|
}
|
|
|
}
|
|
|
+ .item-label{
|
|
|
+ width: 90rpx;
|
|
|
+ height:41rpx;
|
|
|
+ font-size: 24rpx;
|
|
|
+ text-align: center;
|
|
|
+ line-height: 41rpx;
|
|
|
+ background-color: #333333;
|
|
|
+ color: #E4B478;
|
|
|
+ }
|
|
|
.item-title {
|
|
|
display: block;
|
|
|
font-size: 32rpx;
|
|
@@ -453,19 +475,19 @@ page {
|
|
|
.item-answer {
|
|
|
display: flex;
|
|
|
width:100%;
|
|
|
- height: 213rpx;
|
|
|
- background-color: #FDF8F2;
|
|
|
+ /* height: 213rpx;
|
|
|
+ background-color: #FDF8F2; */
|
|
|
box-sizing: border-box;
|
|
|
padding:20rpx;
|
|
|
align-items: center;
|
|
|
position:relative;
|
|
|
- .answer-img {
|
|
|
+ /* .answer-img {
|
|
|
width: 146rpx;
|
|
|
height: 146rpx;
|
|
|
border: 4rpx solid #FFFFFF;
|
|
|
border-radius: 50%;
|
|
|
margin-right: 20rpx;
|
|
|
- }
|
|
|
+ } */
|
|
|
|
|
|
.answer-other {
|
|
|
display: flex;
|
|
@@ -497,9 +519,8 @@ page {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
.answer {
|
|
|
- margin-top: 20rpx;
|
|
|
+ /* margin-top: 20rpx; */
|
|
|
width: 340rpx;
|
|
|
height: 74rpx;
|
|
|
box-sizing: border-box;
|
|
@@ -509,6 +530,19 @@ page {
|
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
|
color: #FFFFFF;
|
|
|
+ .load-img{
|
|
|
+ width: 44rpx;
|
|
|
+ height: 44rpx;
|
|
|
+ animation: circle 1s linear infinite;
|
|
|
+ }
|
|
|
+ @keyframes circle {
|
|
|
+ 0%{
|
|
|
+ transform: rotateZ(0);
|
|
|
+ }
|
|
|
+ 100%{
|
|
|
+ transform: rotateZ(360deg);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -516,12 +550,14 @@ page {
|
|
|
|
|
|
.topage-btn {
|
|
|
position: fixed;
|
|
|
- left:0;
|
|
|
- right:0;
|
|
|
- bottom: 0;
|
|
|
+ left:50%;
|
|
|
+ margin-left: -257rpx;
|
|
|
+ bottom: 215rpx;
|
|
|
+ width:514rpx;
|
|
|
height: 80rpx;
|
|
|
text-align: center;
|
|
|
line-height: 80rpx;
|
|
|
+ border-radius: 40rpx;
|
|
|
background-color: #333333;
|
|
|
box-shadow: 0px 4px 20px 1px rgba(160, 126, 84, 0.25);
|
|
|
color: #E3B377;
|