|
@@ -1,80 +1,95 @@
|
|
|
<template>
|
|
|
<view class="question-wrap">
|
|
|
- <view class="question-top" :class="{'noAuth':!(isUserResearcher||userInfo.status&&userAuth)}">
|
|
|
- <view @click="showPopup" v-if="isUserResearcher||userInfo.status&&userAuth"
|
|
|
- style="display:flex;align-items: center;margin-left:30rpx;">
|
|
|
- <image src="../../static/question/select.png" mode="widthFix" class="menu-icon"/>
|
|
|
- <text style="color:#E3B377;font-size:28rpx;">筛选</text>
|
|
|
- </view>
|
|
|
- <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-option-list">
|
|
|
- <van-collapse :value="activeName" @change="changeSelecOption" accordion :border="false">
|
|
|
- <van-collapse-item :border="false" :title="item.ClassifyName" :name="index" v-for="(item, index) in optionList"
|
|
|
- :key="index">
|
|
|
- <view class="option-btn-wrap">
|
|
|
- <view class="option-btn"
|
|
|
- v-for=" i in item.Items" :key="i.PermissionId"
|
|
|
- @click="handleOptionClick(i)"
|
|
|
- :class="{'active':selectName===i.PermissionName,'full':i.PermissionName.length>4}"
|
|
|
- >
|
|
|
- {{ i.PermissionName }}
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- </van-collapse-item>
|
|
|
- </van-collapse>
|
|
|
- </view>
|
|
|
+ <template v-if="hasAuth">
|
|
|
+ <view class="question-top" :class="{'noAuth':!(isUserResearcher||userInfo.status&&userAuth)}">
|
|
|
+ <view @click="showPopup" v-if="isUserResearcher||userInfo.status&&userAuth"
|
|
|
+ style="display:flex;align-items: center;margin-left:30rpx;">
|
|
|
+ <image src="../../static/question/select.png" mode="widthFix" class="menu-icon"/>
|
|
|
+ <text style="color:#E3B377;font-size:28rpx;">筛选</text>
|
|
|
</view>
|
|
|
- </van-popup>
|
|
|
- </view>
|
|
|
- <view class="report-empty-box" v-if="questionList.length==0">
|
|
|
- <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-info">
|
|
|
- <view style="flex:1;" class="question-title">
|
|
|
- <text class="item-label">{{item.chart_permission_name}}</text>
|
|
|
- <!-- <text class="item-title"> -->{{ item.question_content }}<!-- </text> -->
|
|
|
+ <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-option-list">
|
|
|
+ <van-collapse :value="activeName" @change="changeSelecOption" accordion :border="false">
|
|
|
+ <van-collapse-item :border="false" :title="item.research_group_name" :name="index" v-for="(item, index) in optionList"
|
|
|
+ :key="index">
|
|
|
+ <view class="option-btn-wrap">
|
|
|
+ <view class="option-btn"
|
|
|
+ v-for=" i in item.children" :key="i.research_group_id"
|
|
|
+ @click="handleOptionClick(i)"
|
|
|
+ :class="{'active':selectName===i.research_group_name,'full':i.research_group_name.length>4}"
|
|
|
+ >
|
|
|
+ {{ i.research_group_name }}
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </van-collapse-item>
|
|
|
+ </van-collapse>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
- <view class="item-answer">
|
|
|
- <view class="answer" @click="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">
|
|
|
- <text>{{
|
|
|
- item.answer.audioTime - currentAudioMsg.audioCurrentTime>0?
|
|
|
- moment(item.answer.audioTime - currentAudioMsg.audioCurrentTime).format('mm:ss')
|
|
|
- :'00:00'}}
|
|
|
- </text>
|
|
|
+ </van-popup>
|
|
|
+ </view>
|
|
|
+ <view class="report-empty-box" v-if="questionList.length==0">
|
|
|
+ <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-info">
|
|
|
+ <view style="flex:1;" class="question-title">
|
|
|
+ <text class="item-label">{{item.research_group_second_name}}</text>
|
|
|
+ <!-- <text class="item-title"> -->{{ item.question_content }}<!-- </text> -->
|
|
|
+ </view>
|
|
|
+ <view class="item-answer">
|
|
|
+ <view class="answer" @click="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">
|
|
|
+ <text>{{
|
|
|
+ item.answer.audioTime - currentAudioMsg.audioCurrentTime>0?
|
|
|
+ moment(item.answer.audioTime - currentAudioMsg.audioCurrentTime).format('mm:ss')
|
|
|
+ :'00:00'}}
|
|
|
+ </text>
|
|
|
+ </template>
|
|
|
+ <template v-else>
|
|
|
+ <text>{{ moment(item.answer.audioTime).format('mm:ss') }}</text>
|
|
|
+ </template>
|
|
|
</template>
|
|
|
<template v-else>
|
|
|
+ <image class="load-img" src="../../static/loading.png" mode="aspectFill" />
|
|
|
<text>{{ moment(item.answer.audioTime).format('mm:ss') }}</text>
|
|
|
</template>
|
|
|
- </template>
|
|
|
- <template v-else>
|
|
|
- <image class="load-img" src="../../static/loading.png" mode="aspectFill" />
|
|
|
- <text>{{ moment(item.answer.audioTime).format('mm:ss') }}</text>
|
|
|
- </template>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
+ <text class="item-time">提问时间:{{ item.create_time }}</text>
|
|
|
</view>
|
|
|
- <text class="item-time">提问时间:{{ item.create_time }}</text>
|
|
|
</view>
|
|
|
- </view>
|
|
|
- <view class="topage-btn" @click="toPage" v-if="isUserResearcher||userInfo.status&&userAuth">
|
|
|
- <image
|
|
|
- v-if=" userInfo.is_inner!==1"
|
|
|
- src="../../static/question/askquestion.png"
|
|
|
- mode="scaleToFill"
|
|
|
- style="width:34rpx;height:34rpx;"
|
|
|
- />
|
|
|
- {{ isUserResearcher ? '待回答' : '我要提问' }} <text v-if="isUserResearcher" style="margin-left:5rpx;">{{'('+waitNum+')'}}</text>
|
|
|
- </view>
|
|
|
+ <view class="topage-btn" @click="toPage" v-if="isUserResearcher||userInfo.status&&userAuth">
|
|
|
+ <image
|
|
|
+ v-if=" userInfo.is_inner!==1"
|
|
|
+ src="../../static/question/askquestion.png"
|
|
|
+ mode="scaleToFill"
|
|
|
+ style="width:34rpx;height:34rpx;"
|
|
|
+ />
|
|
|
+ {{ isUserResearcher ? '待回答' : '我要提问' }} <text v-if="isUserResearcher" style="margin-left:5rpx;">{{'('+waitNum+')'}}</text>
|
|
|
+ </view>
|
|
|
+ </template>
|
|
|
+ <!-- 没有权限 -->
|
|
|
+ <template v-else>
|
|
|
+ <view class="noAuth-wrap">
|
|
|
+ <image class="img" :src="globalImgUrls.activityNoAuth" mode="widthFix"></image>
|
|
|
+ <view class="auth-text">您暂无权限查看问答社区</view>
|
|
|
+ <view class="auth-text" v-if="noAuthInfo.type==='contact'">若想查看可以联系对口销售</view>
|
|
|
+ <view class="auth-text" v-else>若想查看可以申请开通</view>
|
|
|
+ <view class="auth-text" v-if="noAuthInfo.type==='contact'">
|
|
|
+ {{noAuthInfo.name||''}}:<text @click="handleCallPhone(noAuthInfo.mobile+'')">{{noAuthInfo.mobile||''}}</text>
|
|
|
+ </view>
|
|
|
+ <view class="apply" @click="handleGoApply" v-else>立即申请</view>
|
|
|
+ </view>
|
|
|
+ </template>
|
|
|
<!-- 弹窗 -->
|
|
|
<van-popup :show="pupData.show" round @close="pupData.show = false" closeable :close-on-click-overlay="false">
|
|
|
<view class="global-pup">
|
|
@@ -94,7 +109,7 @@
|
|
|
|
|
|
<script>
|
|
|
import mixin from "../../mixin/questionMixin";
|
|
|
-import {apiOptionList,apiBarTotal} from '@/api/question'
|
|
|
+import {apiOptionGroupList,apiBarTotal} from '@/api/question'
|
|
|
export default {
|
|
|
mixins: [mixin],
|
|
|
data() {
|
|
@@ -107,13 +122,14 @@ export default {
|
|
|
selectName:'',
|
|
|
pauseImgSrc:'../../static/question/recordplay.png',
|
|
|
playImgSrc:'../../static/question/recordpause.png',
|
|
|
- noAuth:['潜在','流失','冻结'],
|
|
|
waitNum:0,
|
|
|
/* userInfo:{
|
|
|
is_inner:1,//0:外部客户;1内部员工
|
|
|
status:'试用',
|
|
|
- is_suspend:0,
|
|
|
- is_researcher:0
|
|
|
+ is_suspend:1,
|
|
|
+ is_researcher:0,
|
|
|
+ //seal_name:'梁娜',
|
|
|
+ //seal_mobile:123456,
|
|
|
},//mock用户信息 */
|
|
|
}
|
|
|
},
|
|
@@ -123,18 +139,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
computed:{
|
|
|
- userAuth(){
|
|
|
- //暂停试用
|
|
|
- if(this.userInfo.status==='试用'&&this.userInfo.is_suspend===1){
|
|
|
- return false
|
|
|
- }
|
|
|
- //潜在流失冻结
|
|
|
- if(this.noAuth.includes(this.userInfo.status)){
|
|
|
- return false
|
|
|
- }
|
|
|
- //有权限的
|
|
|
- return true
|
|
|
- }
|
|
|
+
|
|
|
},
|
|
|
onLoad() {
|
|
|
/* this.getVistor()
|
|
@@ -164,7 +169,7 @@ export default {
|
|
|
},
|
|
|
//获取筛选列表
|
|
|
async getOptionList(){
|
|
|
- const res = await apiOptionList()
|
|
|
+ const res = await apiOptionGroupList()
|
|
|
if(res.code===200){
|
|
|
this.optionList = res.data
|
|
|
}
|
|
@@ -180,12 +185,12 @@ export default {
|
|
|
//点击二级分类
|
|
|
handleOptionClick(item){
|
|
|
//重复点击代表取消
|
|
|
- if(this.selectId===item.PermissionId){
|
|
|
+ if(this.selectId===item.research_group_id){
|
|
|
this.selectId=-1
|
|
|
this.selectName=''
|
|
|
}else{
|
|
|
- this.selectId = item.PermissionId
|
|
|
- this.selectName = item.PermissionName
|
|
|
+ this.selectId = item.research_group_id
|
|
|
+ this.selectName = item.research_group_name
|
|
|
}
|
|
|
this.page = 1
|
|
|
this.isPopupShow = false
|
|
@@ -198,6 +203,13 @@ export default {
|
|
|
} else {
|
|
|
uni.navigateTo({ url: '/pages-question/hasQuestion' })
|
|
|
}
|
|
|
+ },
|
|
|
+ //转发分享
|
|
|
+ onShareAppMessage(){
|
|
|
+ return{
|
|
|
+ title:'问答社区',
|
|
|
+ path:'/pages/question/question'
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|