From 0a729cc88a43f97e9f408bd276130a3caff0b1ff Mon Sep 17 00:00:00 2001
From: peng <peng.com>
Date: 星期三, 02 七月 2025 18:59:01 +0800
Subject: [PATCH] update 修改商品发布支持预售

---
 pages/health/healthVideo.vue |  104 ++++++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 81 insertions(+), 23 deletions(-)

diff --git a/pages/health/healthVideo.vue b/pages/health/healthVideo.vue
index 34d7f92..369fea2 100644
--- a/pages/health/healthVideo.vue
+++ b/pages/health/healthVideo.vue
@@ -1,5 +1,6 @@
 <template>
   <view class="video-container">
+    <top-bar selectedTitleIndex="health" textColor="black" @changeTab="topBarChange" class="topBar"></top-bar>
 	<!-- 瑙嗛鍔犺浇 -->
 	<zero-loading v-show="videoLoading" type="circle" color="#0ebd57" text=""></zero-loading>
     <!-- 瑙嗛鍒楄〃 -->
@@ -35,7 +36,7 @@
 				:autoplay="index === currentIndex"
 				:controls="false"
 				:loop="true"
-				:object-fit="item.objectFit"
+				:object-fit="item.videoFit"
 				:enable-progress-gesture="false"
 				:show-center-play-btn="false"
 				class="video-item"
@@ -52,6 +53,7 @@
 				@touchstart.stop="handleTouchStart"
 				@touchmove.stop="handleTouchMove"
 				@touchend.stop="handleTouchEnd"
+				:style="{bottom: marginBottom + 'px'}"
 				class="container">
 				<!-- 杩涘害鏉� - 鏁翠釜鍖哄煙鍙嫋鍔� -->
 				<view class="process-warp" :style="{ opacity: showProcess ? 1 : 0 }">
@@ -117,7 +119,7 @@
 
 
         <!-- 瑙嗛淇℃伅灞� -->
-        <view class="video-info">
+        <view class="video-info" :style="{bottom: marginBottom + 20 + 'px'}">
 		  <view>
 			  <text class="video-author">@{{item.authorName}}</text>
 		  </view>
@@ -127,30 +129,34 @@
 		  </view>
         </view>
 
-        <!-- 鍙充晶浜掑姩鎸夐挳 -->
+       <!-- 鍙充晶浜掑姩鎸夐挳 -->
        <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 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 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>
@@ -241,13 +247,24 @@
 </template>
 
 <script>
-import { getHealthRecommendVideos, savePlayRecord, subscribe, getVideoComments, addVideoComment, thubmsUpComment, cancelThubmsUpComment } from "@/api/video.js";
+import TopBar from "@/components/TopBar.vue";
+import { 
+ getHealthRecommendVideos,
+ savePlayRecord, 
+ subscribe, 
+ getVideoComments, 
+ addVideoComment, 
+ thubmsUpComment, 
+ cancelThubmsUpComment,
+ changeThumbsUp
+} from "@/api/video.js";
 import { changeCollect } from "@/api/collect.js";
 import { saveShare, saveShareClickRecord } from "@/api/share.js";
 import { silentLogin } from "@/api/connect.js";
 import { getUserInfo } from "@/api/members";
 import storage from "@/utils/storage.js";
 export default {
+  components: {TopBar},
   computed: {
 	    hasPlayTime() {
 	      return this.sliderFormatTime(this.progress > 0 ? this.duration * this.progress / 100 : 0);
@@ -322,7 +339,8 @@
 			pageNumber: 1,
 			pageSize: 10,
 			videoFrom: 'recommend'
-		}
+		},
+		marginBottom: 0 // 搴曢儴瀹夊叏鍖哄煙
     }
   },
   onShow() {
@@ -344,6 +362,7 @@
   	this.startHidenTime = Date.now()
   },
   onLoad(option) {
+	  this.marginBottom = uni.getSystemInfoSync().safeAreaInsets.bottom
 	  const token = storage.getAccessToken();
 	  if (! token) {
 		  this.wxSilentLogin(() => {
@@ -379,6 +398,17 @@
   	}
   },
   methods: {
+	  topBarChange(titleObj) {
+	  	if (titleObj.index === 'home') {
+	  		uni.switchTab({
+	  			url: titleObj.pagePath
+	  		});
+	  	} else {
+	  		uni.redirectTo({
+	  			url: titleObj.pagePath
+	  		});
+	  	}
+	  },
 	  // 闈欓粯鐧诲綍
 	  wxSilentLogin(callback) {
 		  //鑾峰彇code
@@ -788,6 +818,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);
@@ -1337,7 +1389,7 @@
 	.progress-text {
 	  margin-top: 10px;
 	  font-size: 14px;
-	  color: #666;
+	  color: #fff;
 	}
 	.swiper-box {
 	  width: 100%;
@@ -1361,4 +1413,10 @@
 	.custom-share-btn::after {
 	  border: none;
 	}
+	.topBar {
+		position: fixed;
+		top: 20rpx;
+		left: 20rpx;
+		z-index: 1000
+	}
 </style>

--
Gitblit v1.8.0