From 9d928b12c49b7b604c0b52ce1d98846813d5b613 Mon Sep 17 00:00:00 2001 From: xiangpei <xiangpei@timesnew.cn> Date: 星期日, 15 六月 2025 19:30:13 +0800 Subject: [PATCH] 视频发布支持多商品 --- pages/video/home-page.vue | 73 ++++++++++++++++++++++++------------ 1 files changed, 48 insertions(+), 25 deletions(-) diff --git a/pages/video/home-page.vue b/pages/video/home-page.vue index 11cc980..1e29861 100644 --- a/pages/video/home-page.vue +++ b/pages/video/home-page.vue @@ -4,9 +4,6 @@ <view class="user-header"> <view class="user-avatar-container"> <image class="user-avatar" :src="userInfo.avatar" mode="aspectFill"></image> - <view class="edit-icon" @click="editProfile" v-if="isSelf"> - <uni-icons type="compose" size="20" color="#666"></uni-icons> - </view> </view> <view class="user-info"> <view class="user-name">{{userInfo.nickName}}</view> @@ -38,6 +35,10 @@ {{userInfo.hasSub ? '鍙栨秷鍏虫敞' : '鍏虫敞'}} </button> </view> + + <view class="edit-icon" @click="editInfo" v-if="userInfo.self"> + <uni-icons type="compose" size="20" color="#666"></uni-icons>缂栬緫涓婚〉淇℃伅 + </view> </view> <!-- 浣滃搧/鍠滄鍒囨崲 --> @@ -60,23 +61,28 @@ <!-- 瑙嗛鍒楄〃 --> <scroll-view class="video-list" scroll-y :show-scrollbar="false" @scrolltolower="getPage" v-show="currentTab === 'works' && videoList.length > 0"> - <view class="video-container"> <view 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.coverUrl" 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> </scroll-view> <scroll-view class="video-list" scroll-y :show-scrollbar="false" @scrolltolower="getPage" v-show="currentTab === 'likes' && collectVideoList.length > 0"> @@ -114,11 +120,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: { @@ -149,12 +163,18 @@ nomoreCollectVideo: false } }, + onShow() { + this.getAuthorInfo(); + }, onLoad(option) { this.authorId = option.authorId; this.getAuthorInfo(); this.getAuthorVideoPage(); }, methods: { + handleChange(value) { + console.log('閫変腑鍊�:', value) + }, getPage() { if(this.currentTab === 'works') { if(this.nomoreVideo) { @@ -294,9 +314,9 @@ }); }, // 缂栬緫涓汉璧勬枡 - editProfile() { + editInfo() { uni.navigateTo({ - url: '/pages/user/edit' + url: `/pages/video/home-page-edit?authorId=${this.authorId}&avatar=${this.userInfo.avatar}&motto=${this.userInfo.motto || ''}&nickName=${this.userInfo.nickName}` }); }, @@ -351,16 +371,13 @@ .edit-icon { position: absolute; - right: 0; - bottom: 0; + right: 30rpx; + top: 30rpx; background-color: #fff; - border-radius: 50%; - width: 40rpx; height: 40rpx; display: flex; justify-content: center; align-items: center; - box-shadow: 0 0 10rpx rgba(0, 0, 0, 0.1); } .user-info { @@ -464,12 +481,15 @@ } .video-info { + display: flex; + height: 60rpx; + align-items: center; + font-size: 24rpx; + width: 100%; + padding-right: 20rpx; + box-sizing: border-box; position: absolute; bottom: 20rpx; - left: 20rpx; - right: 20rpx; - color: #fff; - font-size: 24rpx; } .video-title { @@ -483,17 +503,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 { @@ -539,11 +567,6 @@ background-color: #f5f5f5; color: #666; } -} - -/* 濡傛灉鏄嚜宸辩殑涓婚〉锛岄殣钘忓叧娉ㄦ寜閽� */ -.user-header { - position: relative; } .video-container { -- Gitblit v1.8.0