绿满眶商城微信小程序-uniapp
xiangpei
2025-06-03 2e24923ed954974c3b134fae89cc23b64f4406b8
pages/video/home-page.vue
@@ -65,7 +65,7 @@
              class="video-item" 
              v-for="(item, index) in videoList" 
              :key="item.id"
              @click="playVideo(index)"
              @click="playAuthorVideo(index)"
            >
              <image class="video-cover" :src="item.coverUrl" mode="aspectFill"></image>
              <view class="video-info">
@@ -85,7 +85,7 @@
              class="video-item" 
              v-for="(item, index) in collectVideoList" 
              :key="item.id"
              @click="playVideo(index)"
              @click="playCollectVideo(index)"
            >
              <image class="video-cover" :src="item.coverUrl" mode="aspectFill"></image>
              <view class="video-info">
@@ -212,9 +212,11 @@
      getAuthorVideoPage(this.videoQuery).then(res => {
         this.videoList = res.data.data
         this.videoTotal = res.data.total
         if(res.data.data.length < this.videoQuery.pageSize) {
            this.nomoreVideo = true;
         }
      })
   },
   // 获取作品信息
    // 切换关注状态
    toggleFollow() {
      if(this.userInfo.hasSub) {
@@ -260,16 +262,37 @@
      this.collectVideoQuery.authorId = this.authorId
      getAuthorCollectVideoPage(this.collectVideoQuery).then(res => {
         this.collectVideoList = res.data.data
         if(res.data.data.length < this.collectVideoQuery.pageSize) {
            this.nomoreCollectVideo = true;
         }
      })
   },
    // 播放视频
    playVideo(index) {
      const videoItem = this.videoList[index];
    // 播放作者视频
    playAuthorVideo(index) {
     const playInfo = {
        videoList: this.videoList,
        nomore: this.nomoreVideo,
        pageNumber: this.videoQuery.pageNumber,
        playIndex: index
     }
     uni.setStorageSync("playInfo", playInfo)
      uni.navigateTo({
        url: `/pages/video/play?id=${videoItem.id}`
        url: `/pages/video/video-play?authorId=${this.authorId}&videoFrom=author`
      });
    },
    // 播放收藏视频
    playAuthorVideo(index) {
      const playInfo = {
         videoList: this.collectVideoList,
         nomore: this.nomoreCollectVideo,
         pageNumber: this.collectVideoQuery.pageNumber,
         playIndex: index
      }
      uni.setStorageSync("playInfo", playInfo)
      uni.navigateTo({
        url: `/pages/video/video-play?authorId=${this.authorId}&videoFrom=collect`
      });
    },
    // 编辑个人资料
    editProfile() {
      uni.navigateTo({