绿满眶商城微信小程序-uniapp
xiangpei
2025-06-03 411d3c272c5bff654e068ec1e5bf32ac892bd669
pages/tabbar/index/home.vue
@@ -8,7 +8,7 @@
      :current="currentIndex"
      @change="onSwiperChange"
    >
      <swiper-item v-for="(item, index) in videoList" :key="item.id">
      <swiper-item v-for="(item, index) in videoList" :key="item.id + index">
      <!-- 播放按钮(仅当视频暂停时显示) -->
      <view 
        class="play-icon" 
@@ -66,14 +66,14 @@
        </view>
          <view style="width: 100%;word-wrap: break-word;white-space: normal;overflow-wrap: break-word;">
           <text class="video-title">{{item.title}}</text>
           <text class="video-tag" v-for="(tag, index) in item.tagList" :key="tag">#{{tag.tagName}}</text>
           <text class="video-tag" v-for="(tag, index) in item.tagList" :key="item.id + tag.id">#{{tag.tagName}}</text>
        </view>
        </view>
        
        <!-- 右侧互动按钮 -->
       <view class="action-buttons">
         <view class="avatar-container">
            <image class="avatar" :src="item.authorAvatar" mode="aspectFill"></image>
            <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>
@@ -114,7 +114,7 @@
           暂无评论,快来发表第一条评论吧~
         </view>
         
         <view v-else class="comment-item" v-for="(comment, index) in comments" :key="comment.id">
         <view v-else class="comment-item" v-for="(comment, index) in comments" :key="comment.id + index">
         <view style="display: flex;">
            <image class="comment-avatar" :src="comment.userAvatar || '/static/default-avatar.png'"></image>
            <view class="comment-content">
@@ -130,7 +130,7 @@
         </view>
         <!-- 回复列表 -->
           <view class="reply-list" v-if="comment.replies && comment.replies.length > 0">
            <view class="reply-item" v-for="(reply, replyIndex) in comment.replies" :key="reply.id">
            <view class="reply-item" v-for="(reply, replyIndex) in comment.replies" :key="reply.id + index">
              <view class="reply-content">
               <view style="display: flex;">
                  <image class="comment-reply-avatar" :src="reply.replyUserAvatar || '/static/default-avatar.png'"></image>
@@ -251,6 +251,12 @@
    this.initVideoContexts();
  },
  methods: {
      // 跳转个人主页
      jumpToHomePage(authorId) {
         uni.navigateTo({
            url: "/pages/video/home-page?authorId=" + authorId
         })
      },
      // 取消点赞
      async cancelThumbsUp(id, commentIndex, replyIndex) {
         const data = {