From 4e9d7c0e363d313a273700865afb8b0d665e6c69 Mon Sep 17 00:00:00 2001 From: xiangpei <xiangpei@timesnew.cn> Date: 星期三, 18 六月 2025 14:11:23 +0800 Subject: [PATCH] 视频相关页面优化、功能bug --- pages/video/home-page.vue | 73 +++++++++++++++++++++++++----------- 1 files changed, 50 insertions(+), 23 deletions(-) diff --git a/pages/video/home-page.vue b/pages/video/home-page.vue index 10be23c..76ca651 100644 --- a/pages/video/home-page.vue +++ b/pages/video/home-page.vue @@ -66,18 +66,25 @@ class="video-item" v-for="(item, index) in videoList" :key="item.id" - @click="playAuthorVideo(index)" > - <image class="video-cover" :src="item.coverUrl" mode="aspectFill"></image> + <image class="video-cover" @click="playAuthorVideo(index)" :src="item.videoContentType === 'video' ? item.coverUrl : item.imgs[0]" mode="aspectFill"></image> <view class="video-info"> <view class="video-stats"> <view class="stat"> <uni-icons type="heart" size="16" color="#fff"></uni-icons> <text>{{item.collectNum}}</text> + <view class="more-op"> + <dropdown-menu + :options="item.options" + placement="top" + theme-color="#07C160" + @change="handleChange" + ></dropdown-menu> + </view> </view> </view> </view> - </view> + </view> </view> </scroll-view> <scroll-view class="video-list" scroll-y :show-scrollbar="false" @scrolltolower="getPage" v-show="currentTab === 'likes' && collectVideoList.length > 0"> @@ -88,7 +95,7 @@ :key="item.id" @click="playCollectVideo(index)" > - <image class="video-cover" :src="item.coverUrl" mode="aspectFill"></image> + <image class="video-cover" :src="item.videoContentType === 'video' ? item.coverUrl : item.imgs[0]" mode="aspectFill"></image> <view class="video-info"> <view class="video-stats"> <view class="stat"> @@ -115,11 +122,19 @@ </template> <script> +import DropdownMenu from '@/components/dropdown-menu.vue' + import {getAuthorInfo, getAuthorVideoPage, getAuthorCollectVideoPage} from '@/api/user.js' import {subscribe, unSubscribe} from '@/api/video.js' export default { + components: {DropdownMenu}, data() { return { + options: [ + { command: 1, label: '鍖椾含' }, + { command: 2, label: '涓婃捣' }, + { command: 3, label: '骞垮窞' } + ], currentTab: 'works', // works: 浣滃搧, likes: 鍠滄 authorId: '', userInfo: { @@ -159,6 +174,9 @@ this.getAuthorVideoPage(); }, methods: { + handleChange(value) { + console.log('閫変腑鍊�:', value) + }, getPage() { if(this.currentTab === 'works') { if(this.nomoreVideo) { @@ -285,7 +303,7 @@ }); }, // 鎾斁鏀惰棌瑙嗛 - playAuthorVideo(index) { + playCollectVideo(index) { const playInfo = { videoList: this.collectVideoList, nomore: this.nomoreCollectVideo, @@ -444,16 +462,21 @@ } .video-list { - width: calc(100% - 20rpx); - padding: 0 10rpx; - height: calc(100vh - 554rpx); - background-color: #fff; + width: 100%; + padding: 0 10rpx; + height: calc(100vh - 554rpx); + background-color: #fff; +} + +.video-container { + display: flex; + flex-wrap: wrap; + justify-content: space-between; } .video-item { - width: 50%; - padding: 10rpx; - box-sizing: border-box; + width: 49%; + margin-bottom: 20rpx; position: relative; } @@ -466,11 +489,11 @@ .video-info { position: absolute; - bottom: 20rpx; - left: 20rpx; - right: 20rpx; - color: #fff; - font-size: 24rpx; + bottom: 10rpx; + left: 0; + right: 0; + padding: 0 10rpx; + box-sizing: border-box; } .video-title { @@ -484,17 +507,25 @@ .video-stats { display: flex; + width: 100%; } .stat { display: flex; + width: 100%; align-items: center; - margin-right: 20rpx; - text-shadow: 0 0 5rpx rgba(0, 0, 0, 0.5); + position: relative; +} + +.more-op { + position: absolute; + right: 0; } .stat text { margin-left: 5rpx; + color: #fff; + font-size: 14px; } .empty-state { @@ -542,8 +573,4 @@ } } -.video-container { - display: flex; - flex-wrap: wrap -} </style> \ No newline at end of file -- Gitblit v1.8.0