Browse Source

yb5.0需求池相关

cxmo 2 years ago
parent
commit
a03c53f1b5
6 changed files with 409 additions and 158 deletions
  1. 6 0
      api/question.js
  2. 70 5
      mixin/questionMixin.js
  3. 139 10
      pages-question/answerDetail.vue
  4. 73 58
      pages-question/answerList.vue
  5. 97 85
      pages/question/question.vue
  6. 24 0
      style/common.scss

+ 6 - 0
api/question.js

@@ -15,6 +15,12 @@ import { httpGet, httpPost } from "@/utils/request.js";
  export const apiOptionList=params=>{
     return httpGet('/company/permission/tree',params)
 }
+/**
+ * 研究方向分组列表 
+ */
+export const apiOptionGroupList = params=>{
+    return httpGet('/community/question/research_group',params)
+}
 /**
  * 发布提问
  * @param question_content

+ 70 - 5
mixin/questionMixin.js

@@ -27,9 +27,36 @@ export default {
             pageSize: 20,
             finished: false,
             selectId: -1,
+            noAuth:['潜在','流失','冻结'],
+            hasAuth:true,//是否有该页面权限
+            noAuthInfo:null,/* {
+                name:'梁娜',
+                mobile:123456,
+                type:'apply',//apply||contact||''
+                customer_info:{
+                    company_name:'',
+                    name:'客户a',
+                    mobile:'',
+                    status:'冻结',
+                    is_suspend:0,
+                    has_apply:false
+                }
+            }, *///无权限用户信息
         }
     },
     computed:{
+        userAuth(){
+			//暂停试用
+			if(this.userInfo.status==='试用'&&this.userInfo.is_suspend===1){
+				return false
+			}
+			//潜在流失冻结
+			if(this.noAuth.includes(this.userInfo.status)){
+				return false
+			}
+			//有权限的
+			return true
+		},
         isUserResearcher(){
 			//内部人员+研究员
 			if(this.userInfo.is_inner===1&&this.userInfo.is_researcher===1){
@@ -150,7 +177,8 @@ export default {
             const res = await apiQuestionList({
                 page_index: this.page,
                 page_size: this.pageSize,
-                chart_permission_id: this.selectId === -1 ? '' : this.selectId,
+                /* chart_permission_id: this.selectId === -1 ? '' : this.selectId, */
+                group_id: this.selectId === -1 ? '' : this.selectId,
                 reply_status: status,
                 only_mine:onlyMine
             })
@@ -161,6 +189,11 @@ export default {
                     this.finished = true
                 }
             }
+            //没权限
+            if(res.code ===403){
+                this.hasAuth = false
+                this.noAuthInfo = res.data
+            }
             let tempArr = []
             questionData.forEach(item => {
                 let temp = item
@@ -192,10 +225,10 @@ export default {
         //点击某条音频
         handleAudio(item) {
             //如果没有权限,弹窗并return
-            if (!item.auth_ok) {
+           /*  if (!item.auth_ok) {
             	this.initPupData(item)
             	return
-            }
+            } */
             const {
                 source,
                 isplay
@@ -255,13 +288,13 @@ export default {
         //拨号
         handleCallPhone(tel) {
             uni.makePhoneCall({
-                phoneNumber: tel ? tel : '123456',
+                phoneNumber: tel ? tel : ' ',
                 success: () => {
                     this.pupData.show = false
                 }
             });
         },
-        //申请权限
+        //弹窗申请权限
         async handleApply() {
             if (this.pupData.customer_info.has_apply) { //已经申请过
                 this.pupData.content = `<p>您已提交过申请,请耐心等待</p>`
@@ -291,5 +324,37 @@ export default {
                 }
             }
         },
+        //申请权限
+        async handleGoApply(){
+            const {customer_info} = this.noAuthInfo
+            if (customer_info.has_apply) { //已经申请过
+                uni.showToast({
+                  title:'您已提交过申请,请耐心等待',
+                  icon:'none'
+                })
+            } else {
+                if (!customer_info.status || customer_info.status != '流失') {
+                    uni.navigateTo({
+                        url: "/pages-applyPermission/applyPermission?source=5&form_page=问答社区"
+                    })
+                } else { //主动调一次申请权限接口 
+                    const res = await apiApplyPermission({
+                        company_name: customer_info.company_name,
+                        real_name: customer_info.name,
+                        source: 5,
+                        from_page: '问答社区'
+                    })
+                    if (res.code === 200) {
+                        uni.showToast({
+                            title:'您已提交过申请,请耐心等待',
+                            icon:'none'
+                        })
+                        const pages = getCurrentPages();
+                        const page = pages[pages.length - 1];
+                        page.onShow();
+                    }
+                }
+            }
+        },
     }
 }

+ 139 - 10
pages-question/answerDetail.vue

@@ -1,6 +1,6 @@
 <template>
   <view class="answerdetail-page flex-column">
-    <template v-if="questionItem">
+    <template v-if="questionItem&&hasAuth">
       <view class="question-wrap">
         <view class="question-item">
           <view class="question-info">
@@ -10,7 +10,7 @@
               }}</text>
               {{ questionItem.question_content }}
             </view>
-            <view class="item-answer" v-if="questionItem.reply_status === 3">
+            <view class="item-answer" v-if="questionItem.reply_status === 3&&!isUserResearcher">
               <view class="answer" @click.stop="handleAudio(questionItem)">
                 <template v-if="!questionItem.loading">
                   <image
@@ -183,6 +183,60 @@
           <view class="audio-pub" @click="handleRecode('pub')">发布</view>
         </view>
       </view>
+      <view class="record-wrap flex-column" v-if="questionItem.reply_status===3&&isUserResearcher">
+        <view class="record-play" v-if="questionItem.recordStatus === 4">
+          <view class="audio-wrap">
+            <view class="play">
+              <van-icon
+                :name="isplay ? 'pause' : 'play'"
+                @click="handleAudioByReplay"
+                color="#E6B77DFF"
+                size="64rpx"
+                style="align-items: flex-start; margin-left: -20rpx"
+              />
+              <!-- 进度条 -->
+              <view class="slider-box">
+                <slider
+                  :value="currentAudioMsg.audioCurrentTime"
+                  :max="currentAudioMsg.audioTime"
+                  @change="sliderChange($event)"
+                  @changing="sliderChanging"
+                  activeColor="#E6B77DFF"
+                  backgroundColor="#EBEBEBFF"
+                  block-color="#E6B77DFF"
+                  block-size="12"
+                />
+                <view class="slider-time">
+                  <text>{{
+                    moment(currentAudioMsg.audioCurrentTime * 1000).format(
+                      "mm:ss"
+                    )
+                  }}</text>
+                  <text>{{
+                      moment(questionItem.answer.audioTime * 1000).format(
+                        "mm:ss"
+                      )
+                    }}</text>
+                </view>
+              </view>
+            </view>
+          </view>
+          <view class="audio-pub disable">已发布</view>
+        </view>
+      </view>
+    </template>
+    <!-- 没有该问题权限 -->
+    <template v-else-if="!hasAuth">
+      <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>
   </view>
 </template>
@@ -190,6 +244,7 @@
 <script>
 import mixin from "../mixin/questionMixin";
 import { apiReplayAsk, apiGetQuestion, apiSetRead } from "@/api/question";
+import { apiApplyPermission} from '@/api/user';
 import { uploadAudioToServer } from "@/utils/upload";
 export default {
   mixins: [mixin],
@@ -197,6 +252,17 @@ export default {
     return {
       questionItem: null /* {
         recordStatus: 1, //1:未录音;2:正在录音;3:已暂停;4:完成录音
+        permission_info:{
+          type:'',
+          name:'梁娜',
+          mobile:'123456',
+          customer_info:{
+            has_apply:false,
+            company_name:'',
+            name:'',
+            status:'流失',
+          }
+        }
       }, */,
       pauseImgSrc: "../static/question/recordplay.png",
       playImgSrc: "../static/question/recordpause.png",
@@ -215,10 +281,10 @@ export default {
       //globalRecorder:uni.getRecorderManager(),
       /* userInfo:{
 				is_inner:1,//0:外部客户;1内部员工
-				status:'试用',
-				is_suspend:0,
-				is_researcher:0
-			},//mock用户信息 */
+				status:'流失',
+				is_suspend:1,
+				is_researcher:0,
+			}, *///mock用户信息
     };
   },
   onLoad(options) {
@@ -256,7 +322,7 @@ export default {
       this.setAudio(this.audioSrc,this.audioCount)
     }
     },
-    //录音完成or从其他app切回本页面,初始化音频
+    //录音完成or从其他app切回本页面,初始化音频
     setAudio(src,audioCount){
       this.innerAudio.stop();
       this.isplay = false;
@@ -398,7 +464,7 @@ export default {
         if (audio_list.length > 0) {
           temp = {
             source: res.data.audio_list[0].audio_url,
-            audioTime: parseInt(res.data.audio_list[0].audio_play_seconds),
+            audioTime: parseInt(res.data.audio_list[0].audio_play_seconds)||0,
             isplay: false,
             ispause: false,
           };
@@ -426,6 +492,22 @@ export default {
         this.questionItem.answer = temp;
         this.questionItem.loading = false;
         this.questionItem.recordStatus = res.data.reply_status === 3 ? 4 : 1;
+        //研究员查看已回复的问题,初始化音频
+        if(res.data.reply_status===3&&this.isUserResearcher){
+          this.innerAudio.src = res.data.audio_list[0].audio_url
+          this.audioSrc = res.data.audio_list[0].audio_url
+          this.audioCount = parseInt(res.data.audio_list[0].audio_play_seconds)*1000
+          this.changeCurrentAudio({
+            id: "",
+            answer: {
+              source: res.data.audio_list[0].audio_url,
+              audioTime: parseInt(res.data.audio_list[0].audio_play_seconds)||0,
+            },
+          });
+        }
+      }else if(res.code===403){
+        this.hasAuth=false
+        this.noAuthInfo = res.data
       }else{
         //问题被删除的情况,返回小程序首页
         setTimeout(()=>{
@@ -595,7 +677,6 @@ export default {
         audioCurrentUrl: source,
       };
       if (id) {
-        console.log("?");
         this.questionItem.loading = true;
       }
     },
@@ -621,7 +702,51 @@ export default {
     handleScrolltolower(){
       console.log('a',this.scrollTop)
       this.scrollTop-=150;
-    }
+    },
+    //权限相关
+    handleContact(mobile){
+      uni.makePhoneCall({
+        phoneNumber: mobile+''
+      });
+    },
+    async handleGoApply(){
+      const {customer_info} = this.questionItem.permission_info
+      const {community_question_id} = this.questionItem
+      if (customer_info.has_apply) { //已经申请过
+          uni.showToast({
+            title:'您已提交过申请,请耐心等待',
+            icon:'none'
+          })
+      } else {
+          if (!customer_info.status || customer_info.status != '流失') {
+              uni.navigateTo({
+                  url: "/pages-applyPermission/applyPermission?source=5&form_page=问答社区"
+              })
+          } else { //主动调一次申请权限接口 
+              const res = await apiApplyPermission({
+                  company_name: customer_info.company_name,
+                  real_name: customer_info.name,
+                  source: 5,
+                  from_page: '问答社区'
+              })
+              if (res.code === 200) {
+                uni.showToast({
+                  title:'您已提交过申请,请耐心等待',
+                  icon:'none'
+                })
+                uni.redirectTo({url: `/pages-question/answerDetail?id=${community_question_id}`})
+              }
+          }
+      }
+    },
+    //转发分享
+		onShareAppMessage(){
+      const {community_question_id} = this.questionItem
+			return{
+				title:'问答详情',
+				path:`/pages-question/answerDetail?id=${community_question_id}`
+			}
+		}
   },
 };
 </script>
@@ -797,6 +922,10 @@ export default {
         width: 390rpx;
         left: 50%;
         margin-left: -170rpx;
+        &.disable{
+          background-color:#999999ff;
+          color: #fff;
+        }
       }
     }
   }

+ 73 - 58
pages-question/answerList.vue

@@ -1,70 +1,85 @@
 <template>
   <view class="answer-page">
-    <view class="answer-bar">
-      <view
-        class="bar-item"
-        :class="{ active: item.key === selectKey }"
-        @click="changeBar(item)"
-        v-for="item in barList"
-        :key="item.key"
-        >{{ item.label + "(" + item.num + ")" }}</view
-      >
-    </view>
-    <view class="answer-list">
-      <view class="report-empty-box" v-if="questionList.length == 0">
-        <image :src="globalImgUrls.activityNoAuth" mode="widthFix" style="width:100%;"/>
-        <view>暂无数据</view>
+    <template v-if="hasAuth">
+      <view class="answer-bar">
+        <view
+          class="bar-item"
+          :class="{ active: item.key === selectKey }"
+          @click="changeBar(item)"
+          v-for="item in barList"
+          :key="item.key"
+          >{{ item.label + "(" + item.num + ")" }}</view
+        >
       </view>
-      <view
-        class="question-item"
-        v-for="item in questionList"
-        :key="item.community_question_id"
-        @click="toDetail(item)"
-      >
-        <view class="question-info">
-          <view style="flex: 1" class="question-title">
-            <text
-              class="item-label"
-              v-if="isUserResearcher || item.reply_status === 3"
-              >{{ item.chart_permission_name }}</text
-            >
-            {{ item.question_content }}
-          </view>
-          <view class="item-answer" v-if="item.reply_status === 3">
-            <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">
-									<text>{{
-										item.answer.audioTime - currentAudioMsg.audioCurrentTime>0?
-										moment(item.answer.audioTime - currentAudioMsg.audioCurrentTime).format('mm:ss')
-										:'00:00'}}
-									</text>
-								</template>
+      <view class="answer-list">
+        <view class="report-empty-box" v-if="questionList.length == 0">
+          <image :src="globalImgUrls.activityNoAuth" mode="widthFix" style="width:100%;"/>
+          <view>暂无数据</view>
+        </view>
+        <view
+          class="question-item"
+          v-for="item in questionList"
+          :key="item.community_question_id"
+          @click="toDetail(item)"
+        >
+          <view class="question-info">
+            <view style="flex: 1" class="question-title">
+              <text
+                class="item-label"
+                v-if="isUserResearcher || item.reply_status === 3"
+                >{{ item.chart_permission_name }}</text
+              >
+              {{ item.question_content }}
+            </view>
+            <view class="item-answer" v-if="item.reply_status === 3">
+              <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">
+                    <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>
-                  <text>{{
-                    moment(item.answer.audioTime).format("mm:ss")
-                  }}</text>
+                  <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>
+    </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"

+ 97 - 85
pages/question/question.vue

@@ -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'
+			}
 		}
 	}
 }

+ 24 - 0
style/common.scss

@@ -173,4 +173,28 @@ view{
         display: block;
     }
     
+}
+/* 问答模块无权限样式 */
+.noAuth-wrap{
+    display: flex;
+    flex-direction: column;
+    align-items: center;
+    .auth-text{
+        color:#999999;
+        text-align: center;
+        text{
+            margin-left: 15rpx;
+            color:#E6B77D;
+        }
+    }
+    .apply{
+        margin-top: 40rpx;
+        width:390rpx;
+        height:80rpx;
+        background-color: #E6B77D;
+        color: #FFFFFF;
+        text-align: center;
+        line-height: 80rpx;
+        border-radius: 40rpx;
+    }
 }