|
@@ -1,15 +1,20 @@
|
|
<script setup>
|
|
<script setup>
|
|
import{
|
|
import{
|
|
- apiOptiongroupList,
|
|
|
|
|
|
+ apiCountAudioClick,
|
|
apiQuestionList,
|
|
apiQuestionList,
|
|
apipubAsk
|
|
apipubAsk
|
|
}from '@/api/question'
|
|
}from '@/api/question'
|
|
|
|
+import {apiGetTagTree} from "@/api/common"
|
|
|
|
+import { apiApplyPermission } from '@/api/user'
|
|
import{ref,reactive} from "vue"
|
|
import{ref,reactive} from "vue"
|
|
-import {onBeforeRouteLeave} from "vue-router"
|
|
|
|
|
|
+import {onBeforeRouteLeave,useRouter} from "vue-router"
|
|
import { useElementSize } from '@vueuse/core'
|
|
import { useElementSize } from '@vueuse/core'
|
|
-import {ElMessage} from "element-plus"
|
|
|
|
|
|
+import {ElMessage,ElMessageBox} from "element-plus"
|
|
|
|
+import {useStore} from "vuex"
|
|
import moment from 'moment';
|
|
import moment from 'moment';
|
|
|
|
|
|
|
|
+const store = useStore()
|
|
|
|
+const router = useRouter()
|
|
|
|
|
|
moment.locale('zh-cn');
|
|
moment.locale('zh-cn');
|
|
//监听列表页面版心宽度
|
|
//监听列表页面版心宽度
|
|
@@ -31,10 +36,12 @@ let question = reactive({
|
|
selectedGroupId_first :0,
|
|
selectedGroupId_first :0,
|
|
// 二级分组Id
|
|
// 二级分组Id
|
|
selectedGroupId_second:0,
|
|
selectedGroupId_second:0,
|
|
- // 正在播放的音频问题索引,没有为-1
|
|
|
|
|
|
+ // 正在播放的问题音频索引,没有为-1
|
|
audioPlayingIndex:-1,
|
|
audioPlayingIndex:-1,
|
|
- // 正在播放的音频问题,没有为-1
|
|
|
|
|
|
+ // 正在播放的问题音频,没有为null
|
|
audioPlayingItem:null,
|
|
audioPlayingItem:null,
|
|
|
|
+ // 现在点击的Id 为了正确增加点击数
|
|
|
|
+ currentClickId:0,
|
|
// 是否加载完成
|
|
// 是否加载完成
|
|
isFinish:false,
|
|
isFinish:false,
|
|
// 数据是否全部加载完成
|
|
// 数据是否全部加载完成
|
|
@@ -42,8 +49,8 @@ let question = reactive({
|
|
// 是否在加载中
|
|
// 是否在加载中
|
|
isLoading:false,
|
|
isLoading:false,
|
|
noAuthorData:{},
|
|
noAuthorData:{},
|
|
- // 权限状态
|
|
|
|
- Author:0,
|
|
|
|
|
|
+ // 权限状态 0 无权限 1 无权限
|
|
|
|
+ isAuthor:1,
|
|
// 显示/隐藏 提问弹窗
|
|
// 显示/隐藏 提问弹窗
|
|
showAskDia:false,
|
|
showAskDia:false,
|
|
askForm:{
|
|
askForm:{
|
|
@@ -57,25 +64,92 @@ let timer = null
|
|
|
|
|
|
// 获取分组列表
|
|
// 获取分组列表
|
|
const getOptionList =async ()=>{
|
|
const getOptionList =async ()=>{
|
|
- const res = await apiOptiongroupList()
|
|
|
|
|
|
+ const res = await apiGetTagTree()
|
|
if(res.code===200){
|
|
if(res.code===200){
|
|
question.optionList = res.data||[]
|
|
question.optionList = res.data||[]
|
|
// 默认第一个一级分组
|
|
// 默认第一个一级分组
|
|
- question.selectedGroupId_first = question.optionList[0].research_group_id
|
|
|
|
|
|
+ question.selectedGroupId_first = question.optionList[0].classify_id
|
|
// 默认第一个一级分组的第一个二级分组
|
|
// 默认第一个一级分组的第一个二级分组
|
|
- question.selectedGroupId_second = question.optionList[0].children[0].research_group_id
|
|
|
|
- question.secondGroupList = question.optionList[0].children
|
|
|
|
|
|
+ if(!question.optionList[0].tags[0]){
|
|
|
|
+ question.selectedGroupId_second=-1
|
|
|
|
+ }else{
|
|
|
|
+ question.selectedGroupId_second = question.optionList[0].tags[0].tag_id
|
|
|
|
+ }
|
|
|
|
+ question.secondGroupList = question.optionList[0].tags
|
|
getQuestionList()
|
|
getQuestionList()
|
|
- }else if(res.code==403){
|
|
|
|
- question.isFinish=true
|
|
|
|
- question.noAuthorData = res.data
|
|
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+ // 联系销售
|
|
|
|
+const toContact = ()=>{
|
|
|
|
+ // 请求申请接口
|
|
|
|
+ if(!question.noAuthorData.hasApply){
|
|
|
|
+ toApply('auto')
|
|
|
|
+ }
|
|
|
|
+ window.location.href=`tel:${question.noAuthorData.salesMobile}`
|
|
|
|
+}
|
|
|
|
+// 去申请
|
|
|
|
+const toApply = (type='')=>{
|
|
|
|
+ if(type=='auto'){
|
|
|
|
+ apiApplyPermission({
|
|
|
|
+ company_name:question.noAuthorData.company,
|
|
|
|
+ real_name:question.noAuthorData.name,
|
|
|
|
+ source:5,
|
|
|
|
+ from_page:'问答社区',
|
|
|
|
+ }).then(res=>{
|
|
|
|
+ question.noAuthorData.hasApply=true
|
|
|
|
+ console.log('自动申请成功');
|
|
|
|
+ })
|
|
|
|
+ }else{
|
|
|
|
+ // 申请成功后将设置 has_apply
|
|
|
|
+ let storeHasApply = store.state.userInfo.has_apply || false
|
|
|
|
+ if(question.noAuthorData.hasApply || storeHasApply){
|
|
|
|
+ const htmlStr = `<p>申请已提交</p><p>请等待销售人员与您联系</p>`;
|
|
|
|
+ ElMessageBox({
|
|
|
|
+ title: "温馨提醒",
|
|
|
|
+ message: htmlStr,
|
|
|
|
+ center: true,
|
|
|
|
+ dangerouslyUseHTMLString: true,
|
|
|
|
+ confirmButtonText: "知道了",
|
|
|
|
+ confirmButtonClass: "self-elmessage-confirm-btn",
|
|
|
|
+ });
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if(question.noAuthorData.status==='流失'){
|
|
|
|
+ apiApplyPermission({
|
|
|
|
+ company_name:question.noAuthorData.company,
|
|
|
|
+ real_name:question.noAuthorData.name,
|
|
|
|
+ source:7,
|
|
|
|
+ from_page:'沙盘推演',
|
|
|
|
+ }).then(res=>{
|
|
|
|
+ question.noAuthorData.hasApply=true
|
|
|
|
+ const htmlStr = `<p>申请已提交</p><p>请等待销售人员与您联系</p>`;
|
|
|
|
+ ElMessageBox({
|
|
|
|
+ title: "温馨提醒",
|
|
|
|
+ message: htmlStr,
|
|
|
|
+ center: true,
|
|
|
|
+ dangerouslyUseHTMLString: true,
|
|
|
|
+ confirmButtonText: "知道了",
|
|
|
|
+ confirmButtonClass: "self-elmessage-confirm-btn",
|
|
|
|
+ });
|
|
|
|
+ })
|
|
|
|
+ }else{
|
|
|
|
+ // 潜在
|
|
|
|
+ router.push({
|
|
|
|
+ path:'/apply/permission',
|
|
|
|
+ query:{
|
|
|
|
+ source:7,
|
|
|
|
+ fromPage:'沙盘推演',
|
|
|
|
+ token:localStorage.getItem('token')||''
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
// 请求已回答列表
|
|
// 请求已回答列表
|
|
const getQuestionList=()=>{
|
|
const getQuestionList=()=>{
|
|
question.isLoading = true
|
|
question.isLoading = true
|
|
let params = {
|
|
let params = {
|
|
- group_id:question.selectedGroupId_second,
|
|
|
|
|
|
+ variety_tag_id:question.selectedGroupId_second,
|
|
reply_status:3,
|
|
reply_status:3,
|
|
page_index:question.page_index,
|
|
page_index:question.page_index,
|
|
page_size:question.page_size,
|
|
page_size:question.page_size,
|
|
@@ -107,14 +181,25 @@ const getQuestionList=()=>{
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ }else if(res.code==403){
|
|
|
|
+ question.isAuthor=0
|
|
|
|
+ question.noAuthorData = {
|
|
|
|
+ type:res.data.type,
|
|
|
|
+ salesName:res.data.name,
|
|
|
|
+ salesMobile:res.data.mobile,
|
|
|
|
+ hasApply:res.data.customer_info.has_apply,
|
|
|
|
+ company:res.data.customer_info.company_name,
|
|
|
|
+ name:res.data.customer_info.name,
|
|
|
|
+ status:res.data.customer_info.status
|
|
|
|
+ }
|
|
|
|
+ question.isFinish=true
|
|
}
|
|
}
|
|
- console.log(question.list);
|
|
|
|
})
|
|
})
|
|
.finally(()=>{
|
|
.finally(()=>{
|
|
question.isLoading = false
|
|
question.isLoading = false
|
|
})
|
|
})
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+// 加载更多
|
|
const loadingMore = ()=>{
|
|
const loadingMore = ()=>{
|
|
question.page_index++
|
|
question.page_index++
|
|
getQuestionList()
|
|
getQuestionList()
|
|
@@ -122,19 +207,27 @@ const loadingMore = ()=>{
|
|
|
|
|
|
// 切换一级分类
|
|
// 切换一级分类
|
|
const ChangeFirstGroup = (item)=>{
|
|
const ChangeFirstGroup = (item)=>{
|
|
-
|
|
|
|
- question.secondGroupList = item.children
|
|
|
|
- question.selectedGroupId_first = item.research_group_id
|
|
|
|
|
|
+ question.secondGroupList = item.tags
|
|
|
|
+ question.selectedGroupId_first = item.classify_id
|
|
ChangeSecGroup(question.secondGroupList[0])
|
|
ChangeSecGroup(question.secondGroupList[0])
|
|
}
|
|
}
|
|
// 切换二级分类
|
|
// 切换二级分类
|
|
const ChangeSecGroup = (item)=>{
|
|
const ChangeSecGroup = (item)=>{
|
|
question.list=[]
|
|
question.list=[]
|
|
question.page_index=1
|
|
question.page_index=1
|
|
- question.isFinish = false
|
|
|
|
question.isTotalData = false
|
|
question.isTotalData = false
|
|
question.isLoading = false
|
|
question.isLoading = false
|
|
- question.selectedGroupId_second = item.research_group_id
|
|
|
|
|
|
+ // 清除定时器
|
|
|
|
+ clearInterval(timer)
|
|
|
|
+ // 清除当前播放的音频信息和索引
|
|
|
|
+ question.audioPlayingIndex=-1
|
|
|
|
+ question.audioPlayingItem = null
|
|
|
|
+ if(!item){
|
|
|
|
+ // 没有二级分类
|
|
|
|
+ question.selectedGroupId_second = -1
|
|
|
|
+ }else{
|
|
|
|
+ question.selectedGroupId_second = item.tag_id
|
|
|
|
+ }
|
|
getQuestionList()
|
|
getQuestionList()
|
|
}
|
|
}
|
|
// 提问问题
|
|
// 提问问题
|
|
@@ -144,7 +237,6 @@ const askQuestion = ()=>{
|
|
askForm.value.resetFields()
|
|
askForm.value.resetFields()
|
|
}
|
|
}
|
|
question.showAskDia = true
|
|
question.showAskDia = true
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
|
|
// 提交问题
|
|
// 提交问题
|
|
@@ -162,15 +254,27 @@ const submit = (formEl)=>{
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+// 点击播放/暂停按钮
|
|
const audioPlay = (item,index)=>{
|
|
const audioPlay = (item,index)=>{
|
|
if(item.audio_status.isPlay){
|
|
if(item.audio_status.isPlay){
|
|
pause(item,index)
|
|
pause(item,index)
|
|
}else{
|
|
}else{
|
|
|
|
+ if(question.currentClickId != item.audio_list[0].community_question_audio_id){
|
|
|
|
+ question.currentClickId = item.audio_list[0].community_question_audio_id
|
|
|
|
+ // 增加点击数
|
|
|
|
+ apiCountAudioClick({
|
|
|
|
+ community_question_audio_id:question.currentClickId
|
|
|
|
+ }).then((res)=>{
|
|
|
|
+ if(res.code===200){
|
|
|
|
+ console.log('音频id为'+question.currentClickId+'点击次数+1')
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
play(item,index)
|
|
play(item,index)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
|
|
+// type: pause 暂停 end结束
|
|
const pause=(item,index,type='pause')=>{
|
|
const pause=(item,index,type='pause')=>{
|
|
audio.value[index].pause()
|
|
audio.value[index].pause()
|
|
clearInterval(timer)
|
|
clearInterval(timer)
|
|
@@ -183,25 +287,26 @@ const pause=(item,index,type='pause')=>{
|
|
question.audioPlayingItem = null
|
|
question.audioPlayingItem = null
|
|
item.audio_status.loading = false
|
|
item.audio_status.loading = false
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+// 播放
|
|
const play=(item,index)=>{
|
|
const play=(item,index)=>{
|
|
if(audio.value[index].readyState!=4){
|
|
if(audio.value[index].readyState!=4){
|
|
item.audio_status.loading=true
|
|
item.audio_status.loading=true
|
|
return
|
|
return
|
|
}
|
|
}
|
|
if( question.audioPlayingIndex!= -1 ){
|
|
if( question.audioPlayingIndex!= -1 ){
|
|
- console.log(question.audioPlayingIndex);
|
|
|
|
pause(question.audioPlayingItem,question.audioPlayingIndex,'end')
|
|
pause(question.audioPlayingItem,question.audioPlayingIndex,'end')
|
|
}
|
|
}
|
|
audio.value[index].play()
|
|
audio.value[index].play()
|
|
question.audioPlayingIndex = index
|
|
question.audioPlayingIndex = index
|
|
question.audioPlayingItem = item
|
|
question.audioPlayingItem = item
|
|
timer = setInterval(()=>{
|
|
timer = setInterval(()=>{
|
|
|
|
+ // 播放结束
|
|
if(audio.value[index].ended){
|
|
if(audio.value[index].ended){
|
|
item.audio_status.playedTime = 0
|
|
item.audio_status.playedTime = 0
|
|
item.audio_status.isPlay = false
|
|
item.audio_status.isPlay = false
|
|
question.audioPlayingIndex=-1
|
|
question.audioPlayingIndex=-1
|
|
question.audioPlayingItem = null
|
|
question.audioPlayingItem = null
|
|
|
|
+ question.currentClickId=0
|
|
clearInterval(timer)
|
|
clearInterval(timer)
|
|
return
|
|
return
|
|
}
|
|
}
|
|
@@ -210,27 +315,22 @@ const play=(item,index)=>{
|
|
item.audio_status.isPlay = true
|
|
item.audio_status.isPlay = true
|
|
item.audio_status.loading = false
|
|
item.audio_status.loading = false
|
|
}
|
|
}
|
|
-
|
|
|
|
-const audioWaiting = (item,index)=>{
|
|
|
|
- console.log("waiting");
|
|
|
|
|
|
+// 等待 网络差时等待资源加载
|
|
|
|
+const audioWaiting = (item)=>{
|
|
item.audio_status.loading = true
|
|
item.audio_status.loading = true
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+// 可以播放
|
|
const audioCanPlay = (item,index)=>{
|
|
const audioCanPlay = (item,index)=>{
|
|
|
|
+ console.log(item,index)
|
|
item.audio_status.loading = false
|
|
item.audio_status.loading = false
|
|
- console.log("canplay");
|
|
|
|
if(!audio.value[index].played){
|
|
if(!audio.value[index].played){
|
|
- console.log('rttt');
|
|
|
|
play(item,index)
|
|
play(item,index)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
getOptionList()
|
|
getOptionList()
|
|
onBeforeRouteLeave(()=>{
|
|
onBeforeRouteLeave(()=>{
|
|
- console.log('onBeforeRouteLeave','离开路由');
|
|
|
|
if( question.audioPlayingIndex!= -1 ){
|
|
if( question.audioPlayingIndex!= -1 ){
|
|
- console.log(question.audioPlayingIndex);
|
|
|
|
pause(question.audioPlayingItem,question.audioPlayingIndex,'end')
|
|
pause(question.audioPlayingItem,question.audioPlayingIndex,'end')
|
|
}
|
|
}
|
|
})
|
|
})
|
|
@@ -238,105 +338,128 @@ onBeforeRouteLeave(()=>{
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<template>
|
|
<template>
|
|
-
|
|
|
|
- <div class="question-list-container" ref="listPageEl">
|
|
|
|
- <div class="top-nav-box" :style="{width:width+'px'}">
|
|
|
|
- <div class="first-nav-box">
|
|
|
|
- <span
|
|
|
|
- v-for="item in question.optionList"
|
|
|
|
- :key="item.research_group_id"
|
|
|
|
- :class="item.research_group_id==question.selectedGroupId_first?'active':''"
|
|
|
|
- @click="ChangeFirstGroup(item)"
|
|
|
|
- >{{item.research_group_name}}</span>
|
|
|
|
- <span class="ask-icon" @click="askQuestion"><img src="@/assets/icon-question-ask.png" /> 我要提问 </span>
|
|
|
|
- </div>
|
|
|
|
- <div class="sec-nav-box">
|
|
|
|
- <span
|
|
|
|
- :class="['sec-item',item.research_group_id==question.selectedGroupId_second?'active':'']"
|
|
|
|
- v-for="item in question.secondGroupList.slice(0,6)"
|
|
|
|
- :key="item.research_group_id"
|
|
|
|
- @click="ChangeSecGroup(item)"
|
|
|
|
- >{{item.research_group_name}}</span>
|
|
|
|
- <el-popover
|
|
|
|
- :width="560"
|
|
|
|
- trigger="click"
|
|
|
|
- >
|
|
|
|
- <template #reference>
|
|
|
|
- <img v-if="question.secondGroupList.length>6" style="width:16px;transform: rotate(90deg);cursor: pointer" src="@/assets/icon-more.png" alt="">
|
|
|
|
- </template>
|
|
|
|
- <template #default>
|
|
|
|
- <div class="flex top-nav-filter-box">
|
|
|
|
- <div
|
|
|
|
- :class="['item',item.research_group_id == question.selectedGroupId_second&&'active']"
|
|
|
|
- v-for="item in question.secondGroupList.slice(6)"
|
|
|
|
- :key="item.research_group_id"
|
|
|
|
- @click="ChangeSecGroup(item)"
|
|
|
|
- >{{item.research_group_name}}</div>
|
|
|
|
- </div>
|
|
|
|
- </template>
|
|
|
|
- </el-popover>
|
|
|
|
|
|
+ <div class="quesiton-noAuthor" v-if="question.isAuthor == 0 && question.isFinish">
|
|
|
|
+ <img :src="$store.state.globalImgUrls.activityNoAuth" alt="无权限图" class="noAuthor">
|
|
|
|
+ <div class="noAuthor-box">
|
|
|
|
+ 您暂无权限查看问答社区
|
|
|
|
+ <template v-if="question.noAuthorData.type=='contact'">
|
|
|
|
+ <div class="noAuthor-item">
|
|
|
|
+ 若想查看请联系对口销售
|
|
|
|
+ <div class="noAuthor-sales">{{question.noAuthorData.salesName}}:
|
|
|
|
+ <span @click="toContact">{{question.noAuthorData.salesMobile}}</span>
|
|
</div>
|
|
</div>
|
|
- </div>
|
|
|
|
- <div class="question-noData" v-show="question.list.length==0 && question.isFinish">
|
|
|
|
- <img :src="$store.state.globalImgUrls.activityNoAuth" alt="没有数据">
|
|
|
|
- <span>暂无数据</span>
|
|
|
|
- </div>
|
|
|
|
- <div class="question-list" v-show = "question.list.length>0 && question.isFinish">
|
|
|
|
- <div class="question-item" v-for="(item,index) in question.list" :key="item.community_question_id">
|
|
|
|
- <div class="question-info">
|
|
|
|
- <div class="label">{{item.research_group_second_name}}</div>
|
|
|
|
- {{item.question_content}}
|
|
|
|
- </div>
|
|
|
|
- <div class="question-time">
|
|
|
|
- 提问时间:{{moment(item.create_time).format('YYYY.MM.DD')}}
|
|
|
|
- </div>
|
|
|
|
- <div class="question-audio">
|
|
|
|
- <audio :autoplay="false" :loop="false" preload ref="audio"
|
|
|
|
- @waiting="audioWaiting(item,index)" @canplay="audioCanPlay(item,index)">
|
|
|
|
- <source :src="item.audio_list[0].audio_url" type="audio/mp3" />
|
|
|
|
- <p>你的浏览器不支持 HTML5 音频,请直接下载<a :href="item.audio_list[0].audio_url">音频文件</a>。</p>
|
|
|
|
- </audio>
|
|
|
|
- <div class="audio-icon" @click="audioPlay(item,index)" v-if="!item.audio_status.loading">
|
|
|
|
- <img src="@/assets/recordplay.png" alt="播放" v-show="!item.audio_status.isPlay" />
|
|
|
|
- <img src="@/assets/recordpause.png" alt="暂停" v-show="item.audio_status.isPlay" />
|
|
|
|
- </div>
|
|
|
|
- <div class="audio-icon loading-icon" @click="pause(item,index)" v-else>
|
|
|
|
- <img class="load-img" src="@/assets/loading.png" alt="加载中">
|
|
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
|
|
+ <template v-else>
|
|
|
|
+ <div class="noAuthor-item">
|
|
|
|
+ 若想查看可以申请开通
|
|
|
|
+ <div class="apply-button" @click="toApply">立即申请</div>
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <!-- 有权限 -->
|
|
|
|
+ <template v-if="question.isAuthor == 1 && question.isFinish">
|
|
|
|
+ <div class="question-list-container" ref="listPageEl" >
|
|
|
|
+ <div class="top-nav-box" :style="{width:width+'px'}">
|
|
|
|
+ <div class="first-nav-box">
|
|
|
|
+ <span
|
|
|
|
+ v-for="item in question.optionList"
|
|
|
|
+ :key="item.classify_id"
|
|
|
|
+ :class="item.classify_id==question.selectedGroupId_first?'active':''"
|
|
|
|
+ @click="ChangeFirstGroup(item)"
|
|
|
|
+ >{{item.classify_name}}</span>
|
|
|
|
+ <span class="ask-icon" @click="askQuestion"><img src="@/assets/icon-question-ask.png" /> 我要提问 </span>
|
|
</div>
|
|
</div>
|
|
- <div class="audio-pic">
|
|
|
|
- <img src="@/assets/audio-waveform1.png">
|
|
|
|
- <img src="@/assets/audio-waveform2.png">
|
|
|
|
|
|
+ <div class="sec-nav-box">
|
|
|
|
+ <span
|
|
|
|
+ :class="['sec-item',item.tag_id==question.selectedGroupId_second?'active':'']"
|
|
|
|
+ v-for="item in question.secondGroupList.slice(0,6)"
|
|
|
|
+ :key="item.tag_id"
|
|
|
|
+ @click="ChangeSecGroup(item)"
|
|
|
|
+ >{{item.tag_name}}</span>
|
|
|
|
+ <el-popover
|
|
|
|
+ :width="560"
|
|
|
|
+ trigger="click"
|
|
|
|
+ >
|
|
|
|
+ <template #reference>
|
|
|
|
+ <img v-if="question.secondGroupList.length>6" style="width:16px;transform: rotate(90deg);cursor: pointer" src="@/assets/icon-more.png" alt="">
|
|
|
|
+ </template>
|
|
|
|
+ <template #default>
|
|
|
|
+ <div class="flex top-nav-filter-box">
|
|
|
|
+ <div
|
|
|
|
+ :class="['item',item.tag_id == question.selectedGroupId_second&&'active']"
|
|
|
|
+ v-for="item in question.secondGroupList.slice(6)"
|
|
|
|
+ :key="item.tag_id"
|
|
|
|
+ @click="ChangeSecGroup(item)"
|
|
|
|
+ >{{item.tag_name}}</div>
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
|
|
+ </el-popover>
|
|
</div>
|
|
</div>
|
|
- <div class="audio-time">{{moment((item.audio_status.audioTime - item.audio_status.playedTime)).format('mm:ss')}}</div>
|
|
|
|
- </div>
|
|
|
|
</div>
|
|
</div>
|
|
- <div class="bottom-tip-contain">
|
|
|
|
- <div class="bottom-tip-loadMore" v-show="!question.isTotalData && !question.isLoading" @click="loadingMore">加载更多</div>
|
|
|
|
- <div class="loading-text" v-show="question.isLoading">加载中······</div>
|
|
|
|
- <div class="bottom-tip-noMore" v-show="question.isTotalData && !question.isLoading">没有更多了~</div>
|
|
|
|
|
|
+ <!-- 无数据 -->
|
|
|
|
+ <div class="question-noData" v-show="question.list.length==0 && question.isFinish">
|
|
|
|
+ <img :src="$store.state.globalImgUrls.activityNoAuth" alt="没有数据">
|
|
|
|
+ <span>暂无数据</span>
|
|
</div>
|
|
</div>
|
|
- </div>
|
|
|
|
- <el-dialog title="提问详情" v-model="question.showAskDia" :close-on-click-modal="false" draggable
|
|
|
|
- :width="600" >
|
|
|
|
- <el-form :model="question.askForm" ref="askForm" class="ask-form">
|
|
|
|
- <div class="ask-label">
|
|
|
|
- 问题描述
|
|
|
|
- <el-tooltip content="实际发布的问题会以提炼出的精简内容为准" placement="bottom-start" trigger="click">
|
|
|
|
- <img src="@/assets/icon-question-askTip.png" alt="提示" />
|
|
|
|
- </el-tooltip>
|
|
|
|
|
|
+ <div class="question-list" v-show = "question.list.length>0 && question.isFinish">
|
|
|
|
+ <div class="question-item" v-for="(item,index) in question.list" :key="item.community_question_id">
|
|
|
|
+ <div class="question-info">
|
|
|
|
+ <div class="label">{{item.research_group_second_name}}</div>
|
|
|
|
+ {{item.question_content}}
|
|
|
|
+ </div>
|
|
|
|
+ <div class="question-time">
|
|
|
|
+ 提问时间:{{moment(item.create_time).format('YYYY.MM.DD')}}
|
|
|
|
+ </div>
|
|
|
|
+ <div class="question-audio">
|
|
|
|
+ <audio :autoplay="false" :loop="false" preload ref="audio"
|
|
|
|
+ @waiting="audioWaiting(item,index)" @canplay="audioCanPlay(item,index)">
|
|
|
|
+ <source :src="item.audio_list[0].audio_url" type="audio/mp3" />
|
|
|
|
+ <p>你的浏览器不支持 HTML5 音频,请直接下载<a :href="item.audio_list[0].audio_url">音频文件</a>。</p>
|
|
|
|
+ </audio>
|
|
|
|
+ <div class="audio-icon" @click="audioPlay(item,index)" v-if="!item.audio_status.loading">
|
|
|
|
+ <img src="@/assets/recordplay.png" alt="播放" v-show="!item.audio_status.isPlay" />
|
|
|
|
+ <img src="@/assets/recordpause.png" alt="暂停" v-show="item.audio_status.isPlay" />
|
|
|
|
+ </div>
|
|
|
|
+ <div class="audio-icon loading-icon" @click="pause(item,index)" v-else>
|
|
|
|
+ <img class="load-img" src="@/assets/loading.png" alt="加载中">
|
|
|
|
+ </div>
|
|
|
|
+ <div class="audio-pic">
|
|
|
|
+ <img src="@/assets/audio-waveform1.png">
|
|
|
|
+ <img src="@/assets/audio-waveform2.png">
|
|
|
|
+ </div>
|
|
|
|
+ <div class="audio-time">{{moment((item.audio_status.audioTime - item.audio_status.playedTime)).format('mm:ss')}}</div>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
- <el-form-item prop="problemDescription" :rules="{required:true,message:'提问内容不能为空',trigger:'blur'}">
|
|
|
|
- <el-input type="textarea" v-model.trim="question.askForm.problemDescription" placeholder="点击输入提问"
|
|
|
|
- resize="none" maxlength="50" rows="7"></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- <p>剩余可输入字数:{{50 - question.askForm.problemDescription.length}} 字</p>
|
|
|
|
- <div class="askForm-button">
|
|
|
|
- <el-button @click="question.showAskDia = false">取消</el-button>
|
|
|
|
- <el-button type="warning" @click="submit(askForm)">发布</el-button>
|
|
|
|
|
|
+ <div class="bottom-tip-contain">
|
|
|
|
+ <div class="bottom-tip-loadMore" v-show="!question.isTotalData && !question.isLoading" @click="loadingMore">加载更多</div>
|
|
|
|
+ <div class="loading-text" v-show="question.isLoading">加载中······</div>
|
|
|
|
+ <div class="bottom-tip-noMore" v-show="question.isTotalData && !question.isLoading">没有更多了~</div>
|
|
</div>
|
|
</div>
|
|
- </el-form>
|
|
|
|
- </el-dialog>
|
|
|
|
- </div>
|
|
|
|
|
|
+ </div>
|
|
|
|
+ <el-dialog title="提问详情" v-model="question.showAskDia" :close-on-click-modal="false" draggable
|
|
|
|
+ :width="600" >
|
|
|
|
+ <el-form :model="question.askForm" ref="askForm" class="ask-form">
|
|
|
|
+ <div class="ask-label">
|
|
|
|
+ 问题描述
|
|
|
|
+ <el-tooltip content="实际发布的问题会以提炼出的精简内容为准" placement="bottom-start" trigger="click">
|
|
|
|
+ <img src="@/assets/icon-question-askTip.png" alt="提示" />
|
|
|
|
+ </el-tooltip>
|
|
|
|
+ </div>
|
|
|
|
+ <el-form-item prop="problemDescription" :rules="{required:true,message:'提问内容不能为空',trigger:'blur'}">
|
|
|
|
+ <el-input type="textarea" v-model.trim="question.askForm.problemDescription" placeholder="点击输入提问"
|
|
|
|
+ resize="none" maxlength="50" rows="7"></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <p>剩余可输入字数:{{50 - question.askForm.problemDescription.length}} 字</p>
|
|
|
|
+ <div class="askForm-button">
|
|
|
|
+ <el-button @click="question.showAskDia = false">取消</el-button>
|
|
|
|
+ <el-button type="warning" @click="submit(askForm)">发布</el-button>
|
|
|
|
+ </div>
|
|
|
|
+ </el-form>
|
|
|
|
+ </el-dialog>
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
|
|
@@ -364,6 +487,51 @@ onBeforeRouteLeave(()=>{
|
|
background-color: #F3A52F;
|
|
background-color: #F3A52F;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+// 无权限
|
|
|
|
+.quesiton-noAuthor{
|
|
|
|
+ display: flex;
|
|
|
|
+ flex-direction: column;
|
|
|
|
+ align-items: center;
|
|
|
|
+ margin-top: 50px;
|
|
|
|
+ img{
|
|
|
|
+ height: 360px;
|
|
|
|
+ }
|
|
|
|
+ .noAuthor-box{
|
|
|
|
+ font-size: 16px;
|
|
|
|
+ font-family: PingFang SC-Regular, PingFang SC;
|
|
|
|
+ font-weight: 400;
|
|
|
|
+ color: #333333;
|
|
|
|
+ text-align: center;
|
|
|
|
+ .noAuthor-item{
|
|
|
|
+ margin-top: 10px;
|
|
|
|
+ .noAuthor-sales{
|
|
|
|
+ margin-top:4px;
|
|
|
|
+ text-align:center;
|
|
|
|
+ span{
|
|
|
|
+ color:#E3B377;
|
|
|
|
+ cursor: pointer;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .apply-button{
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ justify-content: center;
|
|
|
|
+ background: #E6B77D;
|
|
|
|
+ width: 218px;
|
|
|
|
+ border: none;
|
|
|
|
+ height: 40px;
|
|
|
|
+ border-radius: 41px;
|
|
|
|
+ margin-top: 30px;
|
|
|
|
+ font-family: 'PingFang SC';
|
|
|
|
+ font-style: normal;
|
|
|
|
+ font-weight: 500;
|
|
|
|
+ font-size: 16px;
|
|
|
|
+ color: #FFFFFF;
|
|
|
|
+ cursor: pointer;
|
|
|
|
+ }
|
|
|
|
+}
|
|
.question-list-container{
|
|
.question-list-container{
|
|
border-left: 1px solid #F2F2F2;
|
|
border-left: 1px solid #F2F2F2;
|
|
border-right: 1px solid #F2F2F2;
|
|
border-right: 1px solid #F2F2F2;
|