jwyu před 2 roky
rodič
revize
3ff506f2e2

+ 1 - 0
api/question/index.js

@@ -75,6 +75,7 @@ export const apiDelComment = params => {
  * HotStatus 精选状态 -1:全部 0-未精选,1-已精选
  * CurrentIndex
  * PageSize
+ * 来源(CommunityQuestionCommentId>0也需要传):1-问答社区; 2-视频社区
  */
 export const apiCommentList = params => {
    return  httpGet('/yb/community/question/comment/list',params)

+ 25 - 10
pages-approve/search/index.vue

@@ -63,14 +63,18 @@
 						navBarTitle = '客户搜索'
 						this.placeholder = '客户名称'
 						break;
-               case 'question':
-               	navBarTitle = '分配提问'
-               	this.placeholder = '提问内容'
-               	break;
-               case 'comment':
-               	navBarTitle = '评论管理'
-               	this.placeholder = '评论管理'
-               	break;
+					case 'question':
+						navBarTitle = '分配提问'
+						this.placeholder = '提问内容'
+						break;
+					case 'comment':
+						navBarTitle = '评论管理'
+						this.placeholder = '评论管理'
+						break;
+					case 'videoComment':
+						navBarTitle = '评论管理'
+						this.placeholder = '评论管理'
+						break;
 				}
 				uni.setNavigationBarTitle({
 					title: navBarTitle
@@ -170,6 +174,16 @@
             });
          },
 
+		 //跳回视频社区问题
+		 videoBackHandle(){
+			uni.$emit('videoCommentUpdate', {
+               key_word: this.value
+            })
+            uni.navigateBack({
+            	delta: 1
+            });
+		 },
+
 			onSearch() {
 				if(!this.value){
 					uni.showToast({
@@ -184,8 +198,9 @@
 					contract: this.handleContract,
 					seal: this.handleSeal,
 					roadshow: this.companySearchHandle,
-               question: this.questionBackHandle,
-               comment: this.questionBackHandle
+					question: this.questionBackHandle,
+					comment: this.questionBackHandle,
+					videoComment:this.videoBackHandle
 				}
 				
 				handleFn[this.type]();

+ 1 - 1
pages-question/detail/index.vue

@@ -159,7 +159,7 @@
            const {code,data} = this.type==='question' 
                ? await $api.apiQuestionList({...params,ReplyStatus: this.status,
                CommunityQuestionId: Number(this.id) || '',})
-               : await $api.apiCommentList({...params,HotStatus: this.status,CommunityQuestionCommentId: Number(this.id)});
+               : await $api.apiCommentList({...params,Source:1,HotStatus: this.status,CommunityQuestionCommentId: Number(this.id)});
            
            if(code !== 200) return
            this.finished = this.page_no >= data.Paging.Pages;

+ 33 - 16
pages-todomessages/list/list.vue

@@ -18,14 +18,25 @@
                   </template>
                   
                   <!-- 评论 -->
+				  <!-- 由于问答评论和视频社区的评论都在一个入口所以根据list返回数据的sourceType来区分 6:问答社区 7:视频社区 -->
                   <template v-else-if="type === 6">
-                     <view class="title">{{item.ApprovalInfo.Title}}</view>
-                     <view class="info">所属提问:{{item.ApprovalInfo.Content}}</view>
-                     <view class="info">评论人:{{item.ApprovalInfo.ApplyName}}</view>
-                     <view class="info">客户信息:{{item.ApprovalInfo.CompanyName}}</view>
-                     <view class="info">评论时间:{{item.ApprovalInfo.ApplyTime|formatTime}}</view>
-                     <image src="@/static/icon-look.png" mode="aspectFill" class="new-status" v-if="item.ApprovalStatus === 1"></image>
-                     
+					<template v-if="item.SourceType===6">
+						<view class="title">{{item.ApprovalInfo.Title}}</view>
+						<view class="info">所属提问:{{item.ApprovalInfo.Content}}</view>
+						<view class="info">评论人:{{item.ApprovalInfo.ApplyName}}</view>
+						<view class="info">客户信息:{{item.ApprovalInfo.CompanyName}}</view>
+						<view class="info">评论时间:{{item.ApprovalInfo.ApplyTime|formatTime}}</view>
+						<image src="@/static/icon-look.png" mode="aspectFill" class="new-status" v-if="item.ApprovalStatus === 1"></image>
+                     </template>
+					 <template v-if="item.SourceType===7">
+						<view class="title">{{item.ApprovalInfo.Title}}</view>
+						<view class="info">视频标题:{{item.ApprovalInfo.Content}}</view>
+						<view class="info">所属标签:{{item.ApprovalInfo.Extra}}</view>
+						<view class="info">评论人:{{item.ApprovalInfo.ApplyName}}</view>
+						<view class="info">客户信息:{{item.ApprovalInfo.CompanyName}}</view>
+						<view class="info">评论时间:{{item.ApprovalInfo.ApplyTime|formatTime}}</view>
+						<image src="@/static/icon-look.png" mode="aspectFill" class="new-status" v-if="item.ApprovalStatus === 1"></image>
+                     </template>
                   </template>
                   
                   <template v-else> 
@@ -102,15 +113,21 @@
 			},
 
 			handleGoDetail(e){
-            const urlMap = {
-               'custome': '/pages-approve/custome/detail?id='+e.CompanyApprovalId,
-               'contract': `/pages-approve/contract/detail?ContractApprovalId=0&ContractId=0&ContractApprovalRecordId=${e.CompanyApprovalId}`,
-               'seal': `/pages-approve/seal/detail?ContractApprovalId=0&ContractApprovalRecordId=${e.CompanyApprovalId}`,
-               'question':`/pages-question/detail/index?type=question&id=${e.CompanyApprovalId}`,
-               'questionComment':`/pages-question/detail/index?type=comment&id=${e.CompanyApprovalId}`,
-            }
-            	
-            uni.navigateTo({url:urlMap[this.typeName]})
+				const urlMap = {
+				'custome': '/pages-approve/custome/detail?id='+e.CompanyApprovalId,
+				'contract': `/pages-approve/contract/detail?ContractApprovalId=0&ContractId=0&ContractApprovalRecordId=${e.CompanyApprovalId}`,
+				'seal': `/pages-approve/seal/detail?ContractApprovalId=0&ContractApprovalRecordId=${e.CompanyApprovalId}`,
+				'question':`/pages-question/detail/index?type=question&id=${e.CompanyApprovalId}`,
+				'questionComment':`/pages-question/detail/index?type=comment&id=${e.CompanyApprovalId}`,
+				}
+
+				// 如果是questionComment 则如果是视频则跳转到视频
+				if(this.typeName=='questionComment'&&e.SourceType===7){
+					uni.navigateTo({url:`/pages-video/comment/list?id=${e.CompanyApprovalId}`})
+					return
+				}
+				
+				uni.navigateTo({url:urlMap[this.typeName]})
 			},
 			
 			//获取列表数据

+ 169 - 0
pages-video/comment/list.vue

@@ -0,0 +1,169 @@
+<template>
+    <view class="video-comment-list-page">
+        <van-sticky v-if="!id">
+            <view @click="goSearch">
+                <van-search :value="key_word" shape="round" placeholder="评论内容" disabled />
+            </view>
+        </van-sticky>
+        <view class="list-wrap">
+            <view class="question-item" v-for="(item,index) in list" :key="item.CommunityQuestionCommentId">
+                <view class="cont">
+                    <veiw class="item-title">{{item.Content}}</veiw>
+                    <view class="row">视频标题:{{item.QuestionContent}}</view>
+                    <view class="row">所属标签:{{item.TagName}}</view>
+                    <view class="row">评论人:{{item.UserName}}</view>
+                    <view class="row">客户信息:{{item.CompanyName}} <text v-if="item.CompanyProductStatus">({{item.CompanyProductStatus}})</text> </view>
+                    <view class="row">评论时间:{{item.CreateTime | formatTime}}</view>
+                </view>
+                <view class="action-bot flex">
+                    <text class="red-color" @click="delHandle(item,index)">删除</text>
+                </view>
+            </view>
+        </view>
+          
+    </view>
+</template>
+
+<script>
+import {apiCommentList,apiDelComment} from '@/api/question/index'
+export default {
+    data() {
+        return {
+            id:0,
+            key_word:'',
+            page:1,
+            pageSize:20,
+            list:[],
+            finished:false
+        }
+    },
+    onLoad(options){
+        this.id=options.id||0
+        this.getList()
+
+        // 搜索返回 
+         uni.$on('videoCommentUpdate',({key_word})=>{
+            this.key_word = key_word;
+            this.page = 1;
+            this.list=[]
+            this.finished=false
+            this.getList()
+         })
+    },
+    onUnload() {
+         uni.$off('videoCommentUpdate')
+    },
+    onPullDownRefresh() {
+      	this.page=1
+      	this.finished=false
+      	this.list=[]
+      	this.getList()
+      	setTimeout(()=>{
+      		uni.stopPullDownRefresh()
+      	},1500)
+    },
+    onReachBottom() {
+      	if(this.finished) return
+      	this.page++
+      	this.getList()
+    },
+    methods: {
+        async getList(){
+            const res=await apiCommentList({
+                Keyword:this.key_word,
+                CurrentIndex:this.page,
+                PageSize:this.pageSize,
+                Source:2,
+                HotStatus:-1,
+                CommunityQuestionCommentId:Number(this.id)
+            })
+            if(res.code===200){
+                this.finished=res.data.Paging.IsEnd
+                this.list=[...this.list,...res.data.List]
+            }
+        },
+
+        /* 删除 */
+        delHandle(item,index) {
+            wx.showModal({
+               title: "",
+               content: `评论删除后不可恢复,确认删除吗`,
+               confirmColor: "#EE3636",
+               cancelColor: '#333',
+               success: async (res) => {
+                  if(res.cancel) return
+                  
+                  const { CommunityQuestionCommentId } = item;
+                  const { code } = await apiDelComment({ CommunityQuestionCommentId: CommunityQuestionCommentId });
+                  if( code !== 200 ) return
+                  
+                  wx.showToast({title: '删除成功'})
+                  this.list.splice(index,1)
+               }
+            })
+        },
+
+        /* 搜索 */
+        goSearch() {
+            uni.navigateTo({
+               url: `/pages-approve/search/index?type=videoComment`,
+            })
+        },
+    },
+}
+</script>
+
+<style lang="scss" scoped>
+.red-color {
+   color: #D63535;
+}
+.list-wrap{
+    padding: 40rpx 20rpx;
+}
+.flex {
+   display: flex;
+   align-items: center;
+}
+.question-item {
+   background: #fff;
+   padding: 20rpx 0 0;
+   border-radius: 8rpx;
+   font-size: 28rpx;
+   margin-bottom: 20rpx;
+   color: #666;
+   .cont {
+      padding: 0 20rpx;
+   }
+   .item-title {
+      color: #333;
+      font-size: 32rpx;
+   }
+   .row {
+      margin: 15rpx 0;
+   }
+   .item-bottom {
+      justify-content: space-between;
+      .select-wrapper {
+         width: 250rpx;
+         border: 1px solid #F1F2F6;
+         padding: 0 40rpx 0 20rpx;
+         position: relative;
+         .ipt {
+            height: 80rpx;
+            line-height: 80rpx;
+         }
+      }
+   }
+   .action-bot {
+      border-top: 1px solid #EAEAEA;
+      margin-top: 30rpx;
+      text {
+         padding: 24rpx 0;
+         flex: 1;
+         text-align: center;
+         border-right: 1px solid #EAEAEA;
+         &:last-child { border: none; }
+      }
+   }
+}
+</style>

+ 12 - 0
pages.json

@@ -194,6 +194,18 @@
             }
          }
       ]
+    },
+    {
+      "root": "pages-video",//视频社区
+      "pages": [
+         {
+            "path": "comment/list",
+            "style": {
+              "navigationBarTitleText": "评论管理",
+              "enablePullDownRefresh": true
+            }
+         }
+      ]
     }
   ],
   "globalStyle": {

+ 25 - 15
pages/workbench/index.vue

@@ -56,21 +56,31 @@
 							}
 						]
 					},
-               {
-               	label: '问答社区',
-               	child: [
-               		{
-               			label: '分配提问',
-               			url: '/pages-question/detail/index?type=question',
-               			img: require('@/static/icon-question.png')
-               		},
-               		{
-               			label: '评论管理',
-               			url: '/pages-question/detail/index?type=comment',
-               			img: require('@/static/icon-comment.png')
-               		}
-               	]
-               }
+					{
+						label: '问答社区',
+						child: [
+							{
+								label: '分配提问',
+								url: '/pages-question/detail/index?type=question',
+								img: require('@/static/icon-question.png')
+							},
+							{
+								label: '评论管理',
+								url: '/pages-question/detail/index?type=comment',
+								img: require('@/static/icon-comment.png')
+							}
+						]
+					},
+					{
+						label: '视频社区',
+						child: [
+							{
+								label: '评论管理',
+								url: '/pages-video/comment/list',
+								img: require('@/static/icon-comment-video.png')
+							}
+						]
+					}
 				]
 			}
 		},

binární
static/icon-comment-video.png