|
@@ -1,6 +1,13 @@
|
|
|
<template>
|
|
|
<view class="answerdetail-page flex-column">
|
|
|
<template v-if="questionItem&&hasAuth">
|
|
|
+ <template v-if="questionItem.replier_user_id!=userInfo.user_id">
|
|
|
+ <view style="padding-top:100rpx;text-align:center">
|
|
|
+ <image style="width:200rpx;margin-bottom:20rpx" :src="globalImgUrls.chartWait" mode="widthFix" lazy-load="false" binderror="" bindload="" />
|
|
|
+ <view>问题已转移!</view>
|
|
|
+ </view>
|
|
|
+ </template>
|
|
|
+ <template v-else>
|
|
|
<view class="question-wrap">
|
|
|
<view class="question-item">
|
|
|
<view class="question-info">
|
|
@@ -76,6 +83,9 @@
|
|
|
style="width: 90rpx; height: 180rpx"
|
|
|
/>
|
|
|
<view>无录音(录音时长超过三分钟自动结束)</view>
|
|
|
+
|
|
|
+ <view class="black-btn" style="margin-top:100rpx" @click.stop="showRemoveQ=true">转移问题</view>
|
|
|
+ <view class="black-btn" style="margin-top:50rpx" @click.stop="stopQuestion.show=true">终止问答</view>
|
|
|
</view>
|
|
|
<!-- <view class="record-time" v-else>{{ audioTime }}</view> -->
|
|
|
<view class="recode-image" v-else>
|
|
@@ -234,6 +244,7 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
+ </template>
|
|
|
</template>
|
|
|
<!-- 没有该问题权限 -->
|
|
|
<template v-else-if="!hasAuth">
|
|
@@ -248,20 +259,46 @@
|
|
|
<view class="apply" @click="handleGoApply" v-else>立即申请</view>
|
|
|
</view>
|
|
|
</template>
|
|
|
+
|
|
|
+ <!-- 终止问答弹窗 -->
|
|
|
+ <van-dialog
|
|
|
+ use-slot
|
|
|
+ title="终止问答"
|
|
|
+ :show="stopQuestion.show"
|
|
|
+ show-cancel-button
|
|
|
+ confirm-button-open-type="getUserInfo"
|
|
|
+ @close="stopQuestion.show=false;stopQuestion.reason=''"
|
|
|
+ @confirm="handleConfirmStopQuestion"
|
|
|
+ >
|
|
|
+ <view style="padding:48rpx">
|
|
|
+ <textarea
|
|
|
+ style="background: #F7F8FA;border-radius: 8px;padding: 20rpx;display:block;box-sizing:border-box;width:100%"
|
|
|
+ maxlength="-1"
|
|
|
+ cols="30"
|
|
|
+ rows="10"
|
|
|
+ placeholder="请输入终止理由"
|
|
|
+ v-model="stopQuestion.reason"
|
|
|
+ ></textarea>
|
|
|
+ </view>
|
|
|
+ </van-dialog>
|
|
|
+ <!-- 转移问答弹窗 -->
|
|
|
+ <removeQuestionDig :show="showRemoveQ" :qid="qid" @close="showRemoveQ=false" ></removeQuestionDig>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import mixin from "../mixin/questionMixin";
|
|
|
-import { apiReplayAsk, apiGetQuestion, apiSetRead,apiCountAudioClick } from "@/api/question";
|
|
|
+import { apiReplayAsk, apiGetQuestion, apiSetRead,apiCountAudioClick,apiQuestionStop } from "@/api/question";
|
|
|
import { apiApplyPermission} from '@/api/user';
|
|
|
import {apiGetSceneToParams} from "../api/common.js"
|
|
|
import { uploadAudioToServer } from "@/utils/upload";
|
|
|
import audioBox from '@/components/audioBox/audioBox.vue'
|
|
|
+import removeQuestionDig from './components/removeQuestionDig.vue'
|
|
|
export default {
|
|
|
mixins: [mixin],
|
|
|
components:{
|
|
|
- audioBox
|
|
|
+ audioBox,
|
|
|
+ removeQuestionDig
|
|
|
},
|
|
|
computed:{
|
|
|
showAudioPop(){//是否显示音频弹窗
|
|
@@ -286,6 +323,7 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ qid:0,
|
|
|
questionItem: null /* {
|
|
|
recordStatus: 1, //1:未录音;2:正在录音;3:已暂停;4:完成录音
|
|
|
permission_info:{
|
|
@@ -321,6 +359,12 @@ export default {
|
|
|
is_suspend:1,
|
|
|
is_researcher:0,
|
|
|
}, *///mock用户信息
|
|
|
+
|
|
|
+ stopQuestion:{
|
|
|
+ show:false,
|
|
|
+ reason:'',
|
|
|
+ },//终止问答
|
|
|
+ showRemoveQ:false,//展示转移问题弹窗
|
|
|
};
|
|
|
},
|
|
|
async onLoad(options) {
|
|
@@ -333,6 +377,7 @@ export default {
|
|
|
obj=JSON.parse(res.data)
|
|
|
}
|
|
|
}
|
|
|
+ this.qid=obj.id || options.id
|
|
|
this.getQuestionItem(obj.id || options.id);
|
|
|
},
|
|
|
onShow(){
|
|
@@ -510,7 +555,7 @@ export default {
|
|
|
question_id: id,
|
|
|
});
|
|
|
if (res.code === 200) {
|
|
|
- this.questionItem = res.data;
|
|
|
+ this.questionItem = {...res.data,recordStatus:1};
|
|
|
const { audio_list } = res.data;
|
|
|
let temp = {};
|
|
|
if (audio_list.length > 0) {
|
|
@@ -756,6 +801,7 @@ export default {
|
|
|
//录音计时
|
|
|
clockTime() {
|
|
|
console.log("开始录音计时");
|
|
|
+ if(this.timer) return
|
|
|
this.timer = setInterval(() => {
|
|
|
if (this.timer) {
|
|
|
this.audioCount += 30;
|
|
@@ -767,7 +813,8 @@ export default {
|
|
|
//清除录音计时
|
|
|
cleanTime() {
|
|
|
console.log("结束录音计时");
|
|
|
- clearTimeout(this.timer);
|
|
|
+ clearInterval(this.timer);
|
|
|
+ this.timer=null
|
|
|
this.playIconKey++; //更新录音暂停播放图标
|
|
|
//this.audioTime = this.dayjs(this.audioCount).format("mm:ss.SS");
|
|
|
},
|
|
@@ -812,6 +859,37 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
+ // 终止问答
|
|
|
+ async handleConfirmStopQuestion(){
|
|
|
+ console.log('stop question');
|
|
|
+ if(!this.stopQuestion.reason){
|
|
|
+ uni.showToast({
|
|
|
+ title:"请填写终止理由",
|
|
|
+ icon:"none"
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ const res=await apiQuestionStop({
|
|
|
+ community_question_id:this.questionItem.community_question_id,
|
|
|
+ reason:this.stopQuestion.reason
|
|
|
+ })
|
|
|
+ if(res.code===200){
|
|
|
+ uni.showToast({
|
|
|
+ title:"成功终止",
|
|
|
+ icon:"success"
|
|
|
+ })
|
|
|
+ setTimeout(() => {
|
|
|
+ uni.navigateBack({
|
|
|
+ delta:1,
|
|
|
+ fail(){
|
|
|
+ uni.switchTab({
|
|
|
+ url: '/pages/question/question'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }, 1500);
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
@@ -842,10 +920,22 @@ export default {
|
|
|
text-align: center;
|
|
|
color: #999999ff;
|
|
|
font-size: 28rpx;
|
|
|
- height:130rpx;
|
|
|
+ // height:130rpx;
|
|
|
image {
|
|
|
width: 94rpx;
|
|
|
}
|
|
|
+
|
|
|
+ .black-btn{
|
|
|
+ width: 100%;
|
|
|
+ height: 80rpx;
|
|
|
+ line-height: 80rpx;
|
|
|
+ background: #333333;
|
|
|
+ box-shadow: 0px 4rpx 20rpx rgba(160, 126, 84, 0.25);
|
|
|
+ border-radius: 40rpx;
|
|
|
+ color: #E3B377;
|
|
|
+ text-align: center;
|
|
|
+ font-size: 32rpx;
|
|
|
+ }
|
|
|
}
|
|
|
/* .record-time {
|
|
|
justify-self: flex-end;
|