jwyu 2 年之前
父節點
當前提交
b50006486e
共有 3 個文件被更改,包括 59 次插入27 次删除
  1. 7 0
      pages-question/answerDetail.vue
  2. 30 24
      pages-question/answerList.vue
  3. 22 3
      pages-question/components/removeQuestionDig.vue

+ 7 - 0
pages-question/answerDetail.vue

@@ -1,6 +1,12 @@
 <template>
   <view class="answerdetail-page flex-column">
     <template v-if="questionItem&&hasAuth">
+      <template v-if="questionItem.replier_user_id!=userInfo.user_id">
+        <view>
+          该问题已转移
+        </view>
+      </template>
+      <template v-else>
       <view class="question-wrap">
         <view class="question-item">
           <view class="question-info">
@@ -237,6 +243,7 @@
           </view>
         </view>
       </view>
+      </template>
     </template>
     <!-- 没有该问题权限 -->
     <template v-else-if="!hasAuth">

+ 30 - 24
pages-question/answerList.vue

@@ -26,7 +26,6 @@
             <view style="flex: 1" class="question-title">
               <text
                 class="item-label"
-                v-if="(item.reply_status === 3 || item.replier_user_id == userInfo.user_id) && questionStatus!=2"
                 >{{ item.variety_tag_name }}</text
               >
               {{ item.question_content }}
@@ -189,27 +188,29 @@ export default {
     },
     //点击bar
     changeBar({ key }) {
-		if (key === this.selectKey) return;
-		this.selectKey = key;
-		this.questionList = [];
-		this.page = 1;
-		// 重新获取数量
-		apiBarTotal().then(res=>{
-		  if(res.code == 200){
-			  const { replied, wait, total,distribute } = res.data;
-			  for (const bar of this.barList) {
-				if(bar.label == '已回答'){
-				  bar.num = replied
-				}else if(bar.label == '未回答'){
-				  bar.num = wait
-				}else if(bar.label == '全部'){
-				  bar.num = total
-				}else if(bar.label == '待回答'){
-				  bar.num = distribute
-				}
-			  }
-		  }
-		});
+      if (key === this.selectKey) return;
+      this.selectKey = key;
+      this.questionList = [];
+      this.page = 1;
+      // 重新获取数量
+      apiBarTotal().then(res=>{
+        if(res.code == 200){
+          const { replied, wait, total,distribute,stop } = res.data;
+          for (const bar of this.barList) {
+            if(bar.label == '已回答'){
+              bar.num = replied
+            }else if(bar.label == '未回答'){
+              bar.num = wait
+            }else if(bar.label == '全部'){
+              bar.num = total
+            }else if(bar.label == '待回答'){
+              bar.num = distribute
+            }else if(bar.label=='已终止'){
+              bar.num=stop
+            }
+          }
+        }
+      });
       this.resetAudio();
       this.getQuestionData();
     },
@@ -223,7 +224,7 @@ export default {
     async getBarList() {
       const res = await apiBarTotal();
       if (res.code !== 200) return;
-      const { replied, wait, total,distribute } = res.data;
+      const { replied, wait, total,distribute,stop } = res.data;
       //客户: 已回答 未回答 全部
       const customBar = [
         {
@@ -259,6 +260,11 @@ export default {
           key: "Replied",
           num: replied,
         },
+        {
+          label: "已终止",
+          key: "Stop",
+          num: stop,
+        },
         {
           label: "全部",
           key: "Total",
@@ -268,7 +274,7 @@ export default {
       this.barList = this.isUserResearcher ? researBar : customBar;
     },
     async getQuestionData() {
-      const reply_status = { Wait: 2, Replied: 3, Total: 0 ,Distribute:4};
+      const reply_status = { Wait: 2, Replied: 3, Total: 0 ,Distribute:4,Stop:5};
 	  this.questionStatus = reply_status[this.selectKey]
       await this.getQuestionList(reply_status[this.selectKey],1);
       this.setQuestionsRead()

+ 22 - 3
pages-question/components/removeQuestionDig.vue

@@ -15,7 +15,7 @@
                         :class="['item',index==fIndex&&'active']" 
                         v-for="(item,index) in opts" 
                         :key="item.classify_id" 
-                        @click="fIndex=index"
+                        @click="fIndex=index,adminId=0,secIndex=0"
                     >{{item.classify_name}}</view>
                 </view>
                 <view class="center">
@@ -23,7 +23,7 @@
                         :class="['item',index==secIndex&&'active']" 
                         v-for="(item,index) in opts[fIndex].tags" 
                         :key="item.tag_id" 
-                        @click="secIndex=index"
+                        @click="secIndex=index,adminId=0"
                     >{{item.tag_name}}</view>
                 </view>
                 <view class="right">
@@ -95,8 +95,27 @@ export default {
             }
             const res=await apiQuestionTransfer({
                 community_question_id:Number(this.qid),
-                variety_classify_id:
+                variety_classify_id:this.opts[this.fIndex].classify_id,
+                variety_tag_id:this.opts[this.fIndex].tags[this.secIndex].tag_id,
+                admin_id:this.adminId
             })
+            if(res.code===200){
+                uni.showToast({
+                    title:"转移成功",
+                    icon:'none'
+                })
+                this.handleClose()
+                setTimeout(()=>{
+                    uni.navigateBack({
+                        delta:1,
+                        fail(){
+                            uni.switchTab({
+                                url: '/pages/question/question'
+                            })
+                        }
+                    })
+                },1500)
+            }
         },