jwyu hace 2 años
padre
commit
5a82dca1a3

+ 7 - 7
pages/video/components/comment.vue → components/videoComment/comment.vue

@@ -73,7 +73,7 @@
 import {apiSetLike,apiHotComment,apiMyComment,apiPublishComment,apiDelComment} from '@/api/question'
 export default {
     props:{
-        videoInfo:null
+        videoInfo:null,//{source:2-视频社区\3-路演视频,id:视频社区id\路演视频id,...其他数据}
     },
     data() {
         return {
@@ -120,10 +120,10 @@ export default {
         // 获取评论
         async getComment(flag){
             const params={
-                community_question_id:this.info.community_video_id,
+                community_question_id:this.info.id,
                 curr_page: 1,
                 page_size: 10000,
-                source:2
+                source:this.info.source
             }
             const { code,data } = this.select_comment_type===1 ? await apiHotComment(params) : await apiMyComment(params);
             if(code !== 200) return
@@ -182,8 +182,8 @@ export default {
             if(!this.comment_cont) return wx.showToast({title: '请输入留言内容',icon: 'none'})
             const { code } = await apiPublishComment({
                 content: this.comment_cont,
-                community_question_id: this.info.community_video_id,
-                source:2,
+                community_question_id: this.info.id,
+                source:this.info.source,
             })
             if(code===200){
                 wx.showToast({title: '发布成功'});
@@ -195,10 +195,10 @@ export default {
         //吐槽/点赞
         async handleSetLike(type){
             const res=await apiSetLike({
-                community_question_id:this.info.community_video_id,
+                community_question_id:this.info.id,
                 op_type: type,
                 enable: type === 1 ? Number(this.info.op_type!==1) : Number(this.info.op_type!==2),
-                source:2
+                source:this.info.source
             })
             if(res.code===200){
                 const { enabled,op_type,like_total,tease_total } = res.data;

+ 3 - 2
pages/roadShow/video/list.vue

@@ -42,6 +42,8 @@
                     :data-item="item">
                     <image class="share-img" src="@/static/share-icon.png" mode="aspectFill"/>
                 </button>
+                <view class="time">发布时间:{{item.publish_time}}</view>
+                <view class="user-name">{{item.admin_real_name}}</view>
                 <video
                     autoplay
                     object-fit="contain"
@@ -54,8 +56,7 @@
                     v-if="item.road_video_id==curVideoId"
                 ></video>
                 <image @click="handelClickPlay(item)" v-else class="poster" :src="item.cover_img_url" mode="aspectFill" lazy-load/>
-                <view class="time">发布时间:{{item.publish_time}}</view>
-                <view class="user-name">{{item.admin_real_name}}</view>
+                
             </view>
         </view>
 

+ 11 - 3
pages/video/videoList.vue

@@ -51,7 +51,7 @@
                     v-if="item.community_video_id==curVideoId"
                 ></video>
                 <image @click="handelClickPlay(item)" v-else class="poster" :src="item.cover_img_url" mode="aspectFill" lazy-load/>
-                <commnet :videoInfo="item"></commnet>
+                <comment :videoInfo="getCommentData(item)"></comment>
             </view>
         </view>
 
@@ -113,11 +113,11 @@ import {apiOptionList} from '@/api/question'
 import {apiGetSceneToParams,apiGetTagTree} from '@/api/common'
 import noAuth from './components/noAuth.vue'
 import dragButton from '@/components/dragButton/dragButton.vue'
-import commnet from './components/comment.vue'
+import comment from '@/components/videoComment/comment.vue'
 export default {
     components:{
         noAuth,
-        commnet,
+        comment,
         dragButton
     },
     data() {
@@ -187,6 +187,14 @@ export default {
         this.getList()
     },
     methods: {
+        // 处理评论模块需要的数据
+        getCommentData(item){
+            return {
+                source:2,
+                id:item.community_video_id,
+                ...item
+            }
+        },
         async init(options){
             if(options.scene){
                 const resScene=await apiGetSceneToParams({scene_key:options.scene})

+ 11 - 3
pages/video/videoSearch.vue

@@ -42,7 +42,7 @@
                     v-if="item.community_video_id==curVideoId"
                 ></video>
                 <image @click="handelClickPlay(item)" v-else class="poster" :src="item.cover_img_url" mode="aspectFill" lazy-load/>
-                <commnet :videoInfo="item"></commnet>
+                <comment :videoInfo="getCommentData(item)"></comment>
             </view>
         </view>
     </view>
@@ -51,11 +51,11 @@
 <script>
 import searchBox from '@/components/searchBox/searchBox.vue'
 import {apiVideoList,apiVideoPlayLog} from '@/api/video'
-import commnet from './components/comment.vue'
+import comment from '@/components/videoComment/comment.vue'
 export default {
     components: {
         searchBox,
-        commnet
+        comment
     },
     data() {
         return {
@@ -92,6 +92,14 @@ export default {
         }
     },
     methods: {
+        // 处理评论模块需要的数据
+        getCommentData(item){
+            return {
+                source:2,
+                id:item.community_video_id,
+                ...item
+            }
+        },
         onChange(e){
             this.searchVal=e
         },