绿满眶商城微信小程序-uniapp
peng
2025-06-25 28167c45044ddb9ceff22b44e48a7ab496b8839a
pages/video/home-page.vue
@@ -24,47 +24,47 @@
          <text class="stat-label">获赞</text>
        </view>
      </view>
      <!-- 关注按钮 -->
      <view class="follow-btn-container" v-if="!userInfo.self">
        <button
          class="follow-btn"
          :class="{followed: userInfo.hasSub}"
        <button
          class="follow-btn"
          :class="{followed: userInfo.hasSub}"
          @click="toggleFollow"
        >
          {{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>
        <!-- 作品/喜欢切换 -->
        <view class="tab-bar">
          <view
            class="tab-item"
            :class="{active: currentTab === 'works'}"
          <view
            class="tab-item"
            :class="{active: currentTab === 'works'}"
            @click="switchTab('works')"
          >
            作品{{`(${videoTotal})`}}
          </view>
          <view
            class="tab-item"
            :class="{active: currentTab === 'likes'}"
          <view
            class="tab-item"
            :class="{active: currentTab === 'likes'}"
            @click="switchTab('likes')"
          >
            喜欢
          </view>
        </view>
        <!-- 视频列表 -->
      <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"
              class="video-item"
              v-for="(item, index) in videoList"
              :key="item.id"
            >
              <image class="video-cover" @click="playAuthorVideo(index)" :src="item.videoContentType === 'video' ? item.coverUrl : item.imgs[0]" mode="aspectFill"></image>
@@ -91,8 +91,8 @@
      <scroll-view class="video-list" scroll-y :show-scrollbar="false" @scrolltolower="getPage" v-show="currentTab === 'likes' && collectVideoList.length > 0">
         <view class="video-container">
            <view
              class="video-item"
              v-for="(item, index) in collectVideoList"
              class="video-item"
              v-for="(item, index) in collectVideoList"
              :key="item.id"
              @click="playCollectVideo(index)"
            >
@@ -105,10 +105,10 @@
                  </view>
                </view>
              </view>
            </view>
            </view>
         </view>
      </scroll-view>
        <!-- 空状态 -->
        <view class="empty-state" v-if="videoList.length === 0 && currentTab === 'works'">
          <!-- <image src="/static/images/empty.png" mode="aspectFit" class="empty-image"></image> -->
@@ -119,13 +119,13 @@
        <!-- <image src="/static/images/empty.png" mode="aspectFit" class="empty-image"></image> -->
        <text class="empty-text">还没有点赞作品哦~</text>
      </view>
      <!-- 删除视频提醒框 -->
      <uni-popup ref="delDialog" type="dialog">
         <uni-popup-dialog type="error" cancelText="取消" confirmText="删除" title="提醒" :content="`您正在删除:${opVideo.title}`" @confirm="deleteVideo"
            @close="dialogClose"></uni-popup-dialog>
      </uni-popup>
      <!-- 下架视频提醒框 -->
      <uni-popup ref="downDialog" type="dialog">
         <uni-popup-dialog type="error" cancelText="取消" confirmText="下架" title="提醒" :content="`您正在下架:${opVideo.title}`" @confirm="downVideo"
@@ -383,14 +383,14 @@
        url: `/pages/video/home-page-edit?authorId=${this.authorId}&avatar=${this.userInfo.avatar}&motto=${this.userInfo.motto || ''}&nickName=${this.userInfo.nickName}`
      });
    },
    // 跳转到粉丝/关注列表
    navigateToFollow(type) {
      uni.navigateTo({
        url: `/pages/user/follow?type=${type}`
      });
    },
    // 跳转到点赞列表
    navigateToLike() {
      uni.navigateTo({
@@ -624,15 +624,15 @@
  height: 70rpx;
  line-height: 70rpx;
  padding: 0 40rpx;
  &::after {
    border: none;
  }
  &.followed {
    background-color: #f5f5f5;
    color: #666;
  }
}
</style>
</style>