Ver código fonte

Merge branch 'yb11.2'

jwyu 2 anos atrás
pai
commit
b858cb6246

+ 11 - 10
pages/video/components/comment.vue → components/videoComment/comment.vue

@@ -28,6 +28,7 @@
 			title="视频评论"
 			@close="closeCommentHandle"
 			@clickOverlay="isShowComment=false"
+            z-index="99999"
 		>
 			<view class="comment-cont" @touchmove.stop>
 			   <view class="commment-top">
@@ -59,7 +60,7 @@
                         :show-confirm-bar="false"
                         :cursor-spacing="20"
                         class="write-ipt"
-                        @blur="setWritePosition(50)"
+                        @blur="setWritePosition(0)"
                         @focus="checkNickHandle"
                     />
 				    <view class="confirm-btn" @click="publishMessageHandle">发布</view>
@@ -73,7 +74,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 {
@@ -86,7 +87,7 @@ export default {
 
             isShowComment: false,
 			comment_cont: '',
-			writeBottom: 50,
+			writeBottom: 0,
 			select_comment_type:1,//默认全部
 			comment_obj: {
 				title: '全部评论',
@@ -120,10 +121,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
@@ -170,7 +171,7 @@ export default {
 
         setWritePosition(val=50) {
             console.log(val)
-            this.writeBottom = val < 50 ? 50 : val-8;
+            this.writeBottom = val < 50 ? 0 : val-8;
         },
 
         checkNickHandle(e){
@@ -182,8 +183,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 +196,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;

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

@@ -48,6 +48,10 @@
                     :data-item="item">
                     <image class="share-img" src="@/static/share-icon.png" mode="aspectFill"/>
                 </button>
+                <view style="padding-top:20rpx">
+                    <view class="time">发布时间:{{item.publish_time}}</view>
+                    <view class="user-name">{{item.admin_real_name}}</view>
+                </view>
                 <video
                     autoplay
                     object-fit="contain"
@@ -61,8 +65,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>
+                <comment :videoInfo="getCommentData(item)"></comment>
             </view>
         </view>
 
@@ -123,11 +126,13 @@ import {apiRoadShowVideoList,apiRoadShowVideoPlayLog} from '@/api/roadShow'
 import {apiGetSceneToParams,apiUserBindPermission} from '@/api/common'
 import noAuth from './components/noAuth.vue'
 import dragButton from '@/components/dragButton/dragButton.vue'
+import comment from '@/components/videoComment/comment.vue'
 import collectBox from '@/components/collectBox/collectBox.vue'
 export default {
     components:{
         noAuth,
         dragButton,
+        comment,
         collectBox
     },
     data() {

+ 16 - 3
pages-roadShow/video/search.vue

@@ -35,6 +35,10 @@
                     :data-item="item">
                     <image class="share-img" src="@/static/share-icon.png" mode="aspectFill"/>
                 </button>
+                <view style="padding-top:20rpx">
+                    <view class="time">发布时间:{{item.publish_time}}</view>
+                    <view class="user-name">{{item.admin_real_name}}</view>
+                </view>
                 <video
                     autoplay
                     object-fit="contain"
@@ -50,8 +54,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>
+                <comment :videoInfo="getCommentData(item)"></comment>
             </view>
         </view>
     </view>
@@ -60,12 +63,14 @@
 <script>
 import searchBox from '@/components/searchBox/searchBox.vue'
 import {apiRoadShowVideoList,apiRoadShowVideoPlayLog} from '@/api/roadShow'
+import comment from '@/components/videoComment/comment.vue'
 import {apiViewLogUpdate} from '@/api/common'
 import collectBox from '@/components/collectBox/collectBox.vue'
 export default {
     components: {
         searchBox,
-        collectBox
+        collectBox,
+        comment
     },
     data() {
         return {
@@ -104,6 +109,14 @@ export default {
         }
     },
     methods: {
+        // 处理评论模块需要的数据
+        getCommentData(item){
+            return {
+                source:3,
+                id:item.road_video_id,
+                ...item
+            }
+        },
         onChange(e){
             this.searchVal=e
         },

+ 4 - 3
pages/question/question.vue

@@ -150,6 +150,7 @@
 			title="问答评论"
 			@close="closeCommentHandle"
 			@clickOverlay="isShowComment=false"
+			z-index="99999"
 		>
 			<view class="comment-cont" @touchmove.stop>
 			   <view class="commment-top">
@@ -184,7 +185,7 @@
                   :show-confirm-bar="false"
                   :cursor-spacing="20"
                   class="write-ipt"
-                  @blur="setWritePosition(50)"
+                  @blur="setWritePosition(0)"
 					@focus="checkNickHandle"
                />
 				  <view class="confirm-btn" @click="publishMessageHandle">发布</view>
@@ -242,7 +243,7 @@ export default {
 			
 			isShowComment: false,
 			comment_cont: '',
-			writeBottom: 50,
+			writeBottom: 0,
 			select_comment_type:1,//默认全部
 			select_question_item: {},
 			comment_obj: {
@@ -439,7 +440,7 @@ export default {
       
       setWritePosition(val=50) {
          console.log(val)
-         this.writeBottom = val < 50 ? 50 : val;
+         this.writeBottom = val < 50 ? 0 : val;
       },
 	  
       

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

@@ -48,6 +48,10 @@
                     :data-item="item">
                     <image class="share-img" src="@/static/share-icon.png" mode="aspectFill"/>
                 </button>
+                <view style="padding-top:20rpx">
+                    <view class="time">发布时间:{{item.publish_time}}</view>
+                    <view class="user-name">{{item.admin_real_name}}</view>
+                </view>
                 <video
                     autoplay
                     object-fit="contain"
@@ -63,8 +67,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>
+                <comment :videoInfo="getCommentData(item)"></comment>
             </view>
         </view>
 
@@ -125,11 +128,13 @@ import {apiRoadShowVideoList,apiRoadShowVideoPlayLog} from '@/api/roadShow'
 import {apiGetSceneToParams,apiUserBindPermission,apiViewLogUpdate} from '@/api/common'
 import noAuth from './components/noAuth.vue'
 import dragButton from '@/components/dragButton/dragButton.vue'
+import comment from '@/components/videoComment/comment.vue'
 import collectBox from '@/components/collectBox/collectBox.vue'
 export default {
     components:{
         noAuth,
         dragButton,
+        comment,
         collectBox
     },
     data() {
@@ -204,6 +209,14 @@ export default {
         this.getList()
     },
     methods: {
+        // 处理评论模块需要的数据
+        getCommentData(item){
+            return {
+                source:3,
+                id:item.road_video_id,
+                ...item
+            }
+        },
         async init(options){
             if(options.scene){
                 const resScene=await apiGetSceneToParams({scene_key:options.scene})

+ 11 - 3
pages/video/videoList.vue

@@ -60,7 +60,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>
 
@@ -122,12 +122,12 @@ import {apiOptionList} from '@/api/question'
 import {apiGetSceneToParams,apiGetTagTree,apiViewLogUpdate} 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'
 import collectBox from '@/components/collectBox/collectBox.vue'
 export default {
     components:{
         noAuth,
-        commnet,
+        comment,
         dragButton,
         collectBox
     },
@@ -200,6 +200,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

@@ -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>
     </view>
@@ -61,12 +61,12 @@
 import searchBox from '@/components/searchBox/searchBox.vue'
 import {apiVideoList,apiVideoPlayLog} from '@/api/video'
 import {apiViewLogUpdate} from '@/api/common'
-import commnet from './components/comment.vue'
+import comment from '@/components/videoComment/comment.vue'
 import collectBox from '@/components/collectBox/collectBox.vue'
 export default {
     components: {
         searchBox,
-        commnet,
+        comment,
         collectBox
     },
     data() {
@@ -106,6 +106,14 @@ export default {
         }
     },
     methods: {
+        // 处理评论模块需要的数据
+        getCommentData(item){
+            return {
+                source:2,
+                id:item.community_video_id,
+                ...item
+            }
+        },
         onChange(e){
             this.searchVal=e
         },