From 7e6ac79baa48aa30a98e5343e013a9120f3dabae Mon Sep 17 00:00:00 2001 From: peng <peng.com> Date: 星期四, 03 七月 2025 16:28:06 +0800 Subject: [PATCH] update 移除商店中的商品显示 修改神厨页面 --- pages/health/healthVideo.vue | 82 ++++++++++++++++++++++++++++++----------- 1 files changed, 60 insertions(+), 22 deletions(-) diff --git a/pages/health/healthVideo.vue b/pages/health/healthVideo.vue index c404e82..369fea2 100644 --- a/pages/health/healthVideo.vue +++ b/pages/health/healthVideo.vue @@ -53,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 }"> @@ -118,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> @@ -128,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"></text> - </view> - </view> - <view class="action-item" @click="toggleCollect(item, index)"> - <text class="iconfont" v-if="item.collected"></text> - <text class="iconfont" v-else></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"></text> + </view> + </view> + <view class="action-item" @click="toggleThumbsUp(item, index)"> + <text class="iconfont" v-if="item.thumbsUp"></text> + <text class="iconfont" v-else></text> + <text style="font-size: 10px;font-weight: lighter;">{{item.thumbsUpNum}}</text> </view> <view class="action-item" @click="showComments(item)"> <text class="iconfont"></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"></text> - </button> - - </view> + <view class="action-item" @click="toggleCollect(item, index)"> + <text class="iconfont" v-if="item.collected"></text> + <text class="iconfont" v-else></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"></text> + </button> + </view> </view> </swiper-item> @@ -243,7 +248,16 @@ <script> import TopBar from "@/components/TopBar.vue"; -import { getHealthRecommendVideos, savePlayRecord, subscribe, getVideoComments, addVideoComment, thubmsUpComment, cancelThubmsUpComment } from "@/api/video.js"; +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"; @@ -325,7 +339,8 @@ pageNumber: 1, pageSize: 10, videoFrom: 'recommend' - } + }, + marginBottom: 0 // 搴曢儴瀹夊叏鍖哄煙 } }, onShow() { @@ -347,6 +362,7 @@ this.startHidenTime = Date.now() }, onLoad(option) { + this.marginBottom = uni.getSystemInfoSync().safeAreaInsets.bottom const token = storage.getAccessToken(); if (! token) { this.wxSilentLogin(() => { @@ -802,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); @@ -1351,7 +1389,7 @@ .progress-text { margin-top: 10px; font-size: 14px; - color: #666; + color: #fff; } .swiper-box { width: 100%; -- Gitblit v1.8.0