From d3d0b4dbb4f1f8c4784c834e0a39feba8aa5afa5 Mon Sep 17 00:00:00 2001
From: peng <peng.com>
Date: 星期三, 02 七月 2025 10:41:08 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev' into dev

---
 pages/kitchen/KitchenVideo.vue |   85 +++++++++++++++++++++++++++++++-----------
 1 files changed, 62 insertions(+), 23 deletions(-)

diff --git a/pages/kitchen/KitchenVideo.vue b/pages/kitchen/KitchenVideo.vue
index 43b3432..8bafd83 100644
--- a/pages/kitchen/KitchenVideo.vue
+++ b/pages/kitchen/KitchenVideo.vue
@@ -134,29 +134,33 @@
 
         <!-- 鍙充晶浜掑姩鎸夐挳 -->
         <view class="action-buttons" v-if="false">
-          <view class="avatar-container">
-            <image class="avatar" @click="jumpToHomePage(item.authorId)" :src="item.authorAvatar" mode="aspectFill"></image>
-            <!-- 鍏虫敞鍥炬爣 - 浣跨敤缁濆瀹氫綅 -->
-            <view v-if="!item.subscribeThisAuthor" class="follow-icon" @click="subscribeAuth(index, item.authorId)">
-              <text class="iconfont">&#xe629;</text>
-            </view>
-          </view>
-          <view class="action-item" @click="toggleCollect(item, index)">
-            <text class="iconfont" v-if="item.collected">&#xe605;</text>
-            <text class="iconfont" v-else>&#xe601;</text>
-            <text style="font-size: 10px;font-weight: lighter;">{{item.collectNum}}</text>
-          </view>
+		   <view class="avatar-container">
+			   <image class="avatar" @click="jumpToHomePage(item.authorId)" :src="item.authorAvatar" mode="aspectFill"></image>
+			   <!-- 鍏虫敞鍥炬爣 - 浣跨敤缁濆瀹氫綅 -->
+			   <view v-if="!item.subscribeThisAuthor" class="follow-icon" @click="subscribeAuth(index, item.authorId)">
+				 <text class="iconfont">&#xe629;</text>
+			   </view>
+		   </view>
+           <view class="action-item" @click="toggleThumbsUp(item, index)">
+        			<text class="iconfont" v-if="item.thumbsUp">&#xe605;</text>
+        			<text class="iconfont" v-else>&#xe601;</text>
+        			<text style="font-size: 10px;font-weight: lighter;">{{item.thumbsUpNum}}</text>
+           </view>
           <view class="action-item" @click="showComments(item)">
-            <text class="iconfont">&#xe7f7;</text>
-            <text style="font-size: 10px;font-weight: lighter;">{{item.commentNum}}</text>
-          </view>
-          <view class="action-item">
-            <button open-type="share" class="custom-share-btn" :data-obj="item">
-              <text class="iconfont">&#xe602;</text>
-            </button>
-
-          </view>
-        </view>
+             <text class="iconfont">&#xe7f7;</text>
+             <text style="font-size: 10px;font-weight: lighter;">{{item.commentNum}}</text>
+           </view>
+		  <view class="action-item" @click="toggleCollect(item, index)">
+			 <text class="iconfont" v-if="item.collected">&#xeb9d;</text>
+			 <text class="iconfont" v-else>&#xe603;</text>
+			 <text style="font-size: 10px;font-weight: lighter;">{{item.collectNum}}</text>
+		   </view>
+		  <view class="action-item">
+			  <button open-type="share" class="custom-share-btn" :data-obj="item">
+				<text class="iconfont">&#xe602;</text>
+			  </button>
+		  </view>
+         </view>
 
       </swiper-item>
     </swiper>
@@ -262,7 +266,8 @@
   getVideoComments,
   addVideoComment,
   thubmsUpComment,
-  cancelThubmsUpComment
+  cancelThubmsUpComment,
+  changeThumbsUp
 } from "@/api/video.js";
 import {
   changeCollect
@@ -776,6 +781,28 @@
         }
       })
     },
+	// 鐐硅禐/鍙栨秷鐐硅禐
+	toggleThumbsUp(item, index) {
+	  let data = {
+		  refId: item.id,
+		  thumbsUpType: 'video'
+	  }
+	  const beforeThumbsUp = item.thumbsUp
+	  const beforeThumbsUpNum = item.thumbsUpNum
+	  if(item.thumbsUp) {
+		  this.videoList[index].thumbsUp = false
+		  this.videoList[index].thumbsUpNum -= 1
+	  } else {
+		  this.videoList[index].thumbsUp = true
+		  this.videoList[index].thumbsUpNum += 1
+	  }
+	  changeThumbsUp(data).then(res => {
+		  if(res.data.code !== 200) {
+			  this.videoList[index].thumbsUp = beforeThumbsUp
+			  this.videoList[index].thumbsUpNum = beforeThumbsUpNum
+		  }
+	  })
+	},
     // 鍗曞嚮灞忓箷锛氭殏鍋滄垨缁х画鎾斁
     togglePlay(index) {
       console.log("鍗曞嚮瑙嗛", index);
@@ -1423,4 +1450,16 @@
   background-color: lightpink !important;
 
 }
+
+.custom-share-btn {
+  font-size: unset;
+  background: none;
+  padding: 0;
+  margin: 0;
+  line-height: normal;
+  border: none;
+}
+.custom-share-btn::after {
+  border: none;
+}
 </style>

--
Gitblit v1.8.0