| | |
| | | @font-face { |
| | | font-family: 'iconfont'; /* Project id 4921691 */ |
| | | src: |
| | | url('//at.alicdn.com/t/c/font_4921691_3vdxatwdwe9.woff2?t=1750062394172') format('woff2'), |
| | | url('//at.alicdn.com/t/c/font_4921691_3vdxatwdwe9.woff?t=1750062394172') format('woff'), |
| | | url('//at.alicdn.com/t/c/font_4921691_3vdxatwdwe9.ttf?t=1750062394172') format('truetype'); |
| | | url('//at.alicdn.com/t/c/font_4921691_rij5xwhwslo.woff2?t=1751356364172') format('woff2'), |
| | | url('//at.alicdn.com/t/c/font_4921691_rij5xwhwslo.woff?t=1751356364172') format('woff'), |
| | | url('//at.alicdn.com/t/c/font_4921691_rij5xwhwslo.ttf?t=1751356364172') format('truetype'); |
| | | } |
| | | .iconfont { |
| | | /* font-family需要和自定义的相同 */ |
| | |
| | | } |
| | | |
| | | /** |
| | | * 获取视频主页-作者点赞的视频分页 |
| | | * |
| | | * @param params |
| | | */ |
| | | export function getAuthorLikeVideoPage(params) { |
| | | return http.request({ |
| | | url: "/lmk/video/author-like-video-page", |
| | | method: Method.GET, |
| | | needToken: true, |
| | | params: params |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * 保存视频主页信息编辑 |
| | | * |
| | | * @param params |
| | |
| | | needToken: true |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * 点赞视频/取消点赞 |
| | | * |
| | | * @param params |
| | | */ |
| | | export function changeThumbsUp(data) { |
| | | return http.request({ |
| | | url: "/lmk/video/change/thumbs-up", |
| | | method: Method.POST, |
| | | data: data, |
| | | needToken: true |
| | | }); |
| | | } |
| | |
| | | <text class="iconfont"></text> |
| | | </view> |
| | | </view> |
| | | <view class="action-item" @click="toggleCollect(item, index)"> |
| | | <text class="iconfont" v-if="item.collected"></text> |
| | | <view class="action-item" @click="toggleThumbsUp(item, index)"> |
| | | <text class="iconfont" v-if="item.thumbsUp"></text> |
| | | <text class="iconfont" v-else></text> |
| | | <text style="font-size: 10px;font-weight: lighter;">{{item.collectNum}}</text> |
| | | <text style="font-size: 10px;font-weight: lighter;">{{item.thumbsUpNum}}</text> |
| | | </view> |
| | | <view class="action-item" @click="showComments(item)"> |
| | | <text class="iconfont"></text> |
| | | <text style="font-size: 10px;font-weight: lighter;">{{item.commentNum}}</text> |
| | | </view> |
| | | <view class="action-item" @click="toggleCollect(item, index)"> |
| | | <text class="iconfont" v-if="item.collected"></text> |
| | | <text class="iconfont" v-else></text> |
| | | <text style="font-size: 10px;font-weight: lighter;">{{item.collectNum}}</text> |
| | | </view> |
| | | <view class="action-item"> |
| | | <button open-type="share" class="custom-share-btn" :data-obj="item"> |
| | | <text class="iconfont"></text> |
| | | </button> |
| | | |
| | | </view> |
| | | </view> |
| | | |
| | |
| | | |
| | | <script> |
| | | import TopBar from "@/components/TopBar.vue"; |
| | | import { getHealthRecommendVideos, savePlayRecord, subscribe, getVideoComments, addVideoComment, thubmsUpComment, cancelThubmsUpComment } from "@/api/video.js"; |
| | | import { |
| | | getHealthRecommendVideos, |
| | | savePlayRecord, |
| | | subscribe, |
| | | getVideoComments, |
| | | addVideoComment, |
| | | thubmsUpComment, |
| | | cancelThubmsUpComment, |
| | | changeThumbsUp |
| | | } from "@/api/video.js"; |
| | | import { changeCollect } from "@/api/collect.js"; |
| | | import { saveShare, saveShareClickRecord } from "@/api/share.js"; |
| | | import { silentLogin } from "@/api/connect.js"; |
| | |
| | | } |
| | | }) |
| | | }, |
| | | // 点赞/取消点赞 |
| | | toggleThumbsUp(item, index) { |
| | | let data = { |
| | | refId: item.id, |
| | | thumbsUpType: 'video' |
| | | } |
| | | const beforeThumbsUp = item.thumbsUp |
| | | const beforeThumbsUpNum = item.thumbsUpNum |
| | | if(item.thumbsUp) { |
| | | this.videoList[index].thumbsUp = false |
| | | this.videoList[index].thumbsUpNum -= 1 |
| | | } else { |
| | | this.videoList[index].thumbsUp = true |
| | | this.videoList[index].thumbsUpNum += 1 |
| | | } |
| | | changeThumbsUp(data).then(res => { |
| | | if(res.data.code !== 200) { |
| | | this.videoList[index].thumbsUp = beforeThumbsUp |
| | | this.videoList[index].thumbsUpNum = beforeThumbsUpNum |
| | | } |
| | | }) |
| | | }, |
| | | // 单击屏幕:暂停或继续播放 |
| | | togglePlay(index) { |
| | | console.log("单击视频", index); |
| | |
| | | <text class="iconfont"></text> |
| | | </view> |
| | | </view> |
| | | <view class="action-item" @click="toggleCollect(item, index)"> |
| | | <text class="iconfont" v-if="item.collected"></text> |
| | | <view class="action-item" @click="toggleThumbsUp(item, index)"> |
| | | <text class="iconfont" v-if="item.thumbsUp"></text> |
| | | <text class="iconfont" v-else></text> |
| | | <text style="font-size: 10px;font-weight: lighter;">{{item.collectNum}}</text> |
| | | <text style="font-size: 10px;font-weight: lighter;">{{item.thumbsUpNum}}</text> |
| | | </view> |
| | | <view class="action-item" @click="showComments(item)"> |
| | | <text class="iconfont"></text> |
| | | <text style="font-size: 10px;font-weight: lighter;">{{item.commentNum}}</text> |
| | | </view> |
| | | <view class="action-item" @click="toggleCollect(item, index)"> |
| | | <text class="iconfont" v-if="item.collected"></text> |
| | | <text class="iconfont" v-else></text> |
| | | <text style="font-size: 10px;font-weight: lighter;">{{item.collectNum}}</text> |
| | | </view> |
| | | <view class="action-item"> |
| | | <button open-type="share" class="custom-share-btn" :data-obj="item"> |
| | | <text class="iconfont"></text> |
| | | </button> |
| | | |
| | | </view> |
| | | </view> |
| | | |
| | |
| | | getVideoComments, |
| | | addVideoComment, |
| | | thubmsUpComment, |
| | | cancelThubmsUpComment |
| | | cancelThubmsUpComment, |
| | | changeThumbsUp |
| | | } from "@/api/video.js"; |
| | | import { |
| | | changeCollect |
| | |
| | | if (res.data.code !== 200) { |
| | | this.videoList[index].collected = beforeCollected |
| | | this.videoList[index].collectNum = beforeCollectNum |
| | | } |
| | | }) |
| | | }, |
| | | // 点赞/取消点赞 |
| | | toggleThumbsUp(item, index) { |
| | | let data = { |
| | | refId: item.id, |
| | | thumbsUpType: 'video' |
| | | } |
| | | const beforeThumbsUp = item.thumbsUp |
| | | const beforeThumbsUpNum = item.thumbsUpNum |
| | | if(item.thumbsUp) { |
| | | this.videoList[index].thumbsUp = false |
| | | this.videoList[index].thumbsUpNum -= 1 |
| | | } else { |
| | | this.videoList[index].thumbsUp = true |
| | | this.videoList[index].thumbsUpNum += 1 |
| | | } |
| | | changeThumbsUp(data).then(res => { |
| | | if(res.data.code !== 200) { |
| | | this.videoList[index].thumbsUp = beforeThumbsUp |
| | | this.videoList[index].thumbsUpNum = beforeThumbsUpNum |
| | | } |
| | | }) |
| | | }, |
| | |
| | | background-color: lightpink !important; |
| | | |
| | | } |
| | | |
| | | .custom-share-btn { |
| | | font-size: unset; |
| | | background: none; |
| | | padding: 0; |
| | | margin: 0; |
| | | line-height: normal; |
| | | border: none; |
| | | } |
| | | .custom-share-btn::after { |
| | | border: none; |
| | | } |
| | | </style> |
| | |
| | | <text class="iconfont"></text> |
| | | </view> |
| | | </view> |
| | | <view class="action-item" @click="toggleCollect(item, index)"> |
| | | <text class="iconfont" v-if="item.collected"></text> |
| | | <view class="action-item" @click="toggleThumbsUp(item, index)"> |
| | | <text class="iconfont" v-if="item.thumbsUp"></text> |
| | | <text class="iconfont" v-else></text> |
| | | <text style="font-size: 10px;font-weight: lighter;">{{item.collectNum}}</text> |
| | | <text style="font-size: 10px;font-weight: lighter;">{{item.thumbsUpNum}}</text> |
| | | </view> |
| | | <view class="action-item" @click="showComments(item)"> |
| | | <text class="iconfont"></text> |
| | | <text style="font-size: 10px;font-weight: lighter;">{{item.commentNum}}</text> |
| | | </view> |
| | | <view class="action-item" @click="toggleCollect(item, index)"> |
| | | <text class="iconfont" v-if="item.collected"></text> |
| | | <text class="iconfont" v-else></text> |
| | | <text style="font-size: 10px;font-weight: lighter;">{{item.collectNum}}</text> |
| | | </view> |
| | | <view class="action-item"> |
| | | <button open-type="share" class="custom-share-btn" :data-obj="item"> |
| | | <text class="iconfont"></text> |
| | | </button> |
| | | |
| | | </view> |
| | | </view> |
| | | |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { getRecommendVideos, savePlayRecord, subscribe, getVideoComments, addVideoComment, thubmsUpComment, cancelThubmsUpComment } from "@/api/video.js"; |
| | | import { |
| | | getRecommendVideos, |
| | | savePlayRecord, |
| | | subscribe, |
| | | getVideoComments, |
| | | addVideoComment, |
| | | thubmsUpComment, |
| | | cancelThubmsUpComment, |
| | | changeThumbsUp, |
| | | } from "@/api/video.js"; |
| | | import { changeCollect } from "@/api/collect.js"; |
| | | import { saveShare, saveShareClickRecord } from "@/api/share.js"; |
| | | import { silentLogin } from "@/api/connect.js"; |
| | |
| | | } |
| | | }) |
| | | }, |
| | | // 点赞/取消点赞 |
| | | toggleThumbsUp(item, index) { |
| | | let data = { |
| | | refId: item.id, |
| | | thumbsUpType: 'video' |
| | | } |
| | | const beforeThumbsUp = item.thumbsUp |
| | | const beforeThumbsUpNum = item.thumbsUpNum |
| | | if(item.thumbsUp) { |
| | | this.videoList[index].thumbsUp = false |
| | | this.videoList[index].thumbsUpNum -= 1 |
| | | } else { |
| | | this.videoList[index].thumbsUp = true |
| | | this.videoList[index].thumbsUpNum += 1 |
| | | } |
| | | changeThumbsUp(data).then(res => { |
| | | if(res.data.code !== 200) { |
| | | this.videoList[index].thumbsUp = beforeThumbsUp |
| | | this.videoList[index].thumbsUpNum = beforeThumbsUpNum |
| | | } |
| | | }) |
| | | }, |
| | | // 单击屏幕:暂停或继续播放 |
| | | togglePlay(index) { |
| | | console.log("单击视频", index); |
| | |
| | | </view> |
| | | <view |
| | | class="tab-item" |
| | | :class="{active: currentTab === 'collect'}" |
| | | @click="switchTab('collect')" |
| | | > |
| | | 收藏 |
| | | </view> |
| | | <view |
| | | class="tab-item" |
| | | :class="{active: currentTab === 'likes'}" |
| | | @click="switchTab('likes')" |
| | | > |
| | |
| | | </view> |
| | | </view> |
| | | </scroll-view> |
| | | <scroll-view class="video-list" scroll-y :show-scrollbar="false" @scrolltolower="getPage" v-show="currentTab === 'likes' && collectVideoList.length > 0"> |
| | | <scroll-view class="video-list" scroll-y :show-scrollbar="false" @scrolltolower="getPage" v-show="currentTab === 'collect' && collectVideoList.length > 0"> |
| | | <view class="video-container"> |
| | | <view |
| | | class="video-item" |
| | | v-for="(item, index) in collectVideoList" |
| | | :key="item.id" |
| | | @click="playCollectVideo(index)" |
| | | > |
| | | <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"> |
| | | <uni-icons type="heart" size="16" color="#fff"></uni-icons> |
| | | <text>{{item.collectNum}}</text> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </scroll-view> |
| | | <scroll-view class="video-list" scroll-y :show-scrollbar="false" @scrolltolower="getPage" v-show="currentTab === 'likes' && likeVideoList.length > 0"> |
| | | <view class="video-container"> |
| | | <view |
| | | class="video-item" |
| | | v-for="(item, index) in likeVideoList" |
| | | :key="item.id" |
| | | @click="playLikeVideo(index)" |
| | | > |
| | | <image class="video-cover" :src="item.videoContentType === 'video' ? item.coverUrl : item.imgs[0]" mode="aspectFill"></image> |
| | | <view class="video-info"> |
| | |
| | | <text class="empty-text">还未发布作品哦~</text> |
| | | </view> |
| | | <!-- 空状态 --> |
| | | <view class="empty-state" v-if="collectVideoList.length === 0 && currentTab === 'likes'"> |
| | | <view class="empty-state" v-if="collectVideoList.length === 0 && currentTab === 'collect'"> |
| | | <!-- <image src="/static/images/empty.png" mode="aspectFit" class="empty-image"></image> --> |
| | | <text class="empty-text">还没有收藏作品哦~</text> |
| | | </view> |
| | | <!-- 空状态 --> |
| | | <view class="empty-state" v-if="likeVideoList.length === 0 && currentTab === 'likes'"> |
| | | <!-- <image src="/static/images/empty.png" mode="aspectFit" class="empty-image"></image> --> |
| | | <text class="empty-text">还没有点赞作品哦~</text> |
| | | </view> |
| | |
| | | <script> |
| | | import DropdownMenu from '@/components/dropdown-menu.vue' |
| | | |
| | | import {getAuthorInfo, getAuthorVideoPage, getAuthorCollectVideoPage} from '@/api/user.js' |
| | | import {getAuthorInfo, getAuthorVideoPage, getAuthorCollectVideoPage, getAuthorLikeVideoPage} from '@/api/user.js' |
| | | import {subscribe, unSubscribe, delVideo, updateVideo, userDownVideo} from '@/api/video.js' |
| | | export default { |
| | | components: {DropdownMenu}, |
| | |
| | | pageNumber: 1, |
| | | pageSize: 10 |
| | | }, |
| | | likeVideoQuery: { |
| | | authorId: '', |
| | | pageNumber: 1, |
| | | pageSize: 10 |
| | | }, |
| | | videoTotal: 0, |
| | | videoList: [], // 作品 |
| | | collectVideoList: [], // 收藏 |
| | | likeVideoList: [], // 点赞 |
| | | nomoreVideo: false, |
| | | nomoreCollectVideo: false |
| | | nomoreCollectVideo: false, |
| | | nomoreLikeVideo: false, |
| | | } |
| | | }, |
| | | onShow() { |
| | | this.getAuthorInfo(); |
| | | if (this.currentTab === 'works') { |
| | | this.videoQuery.pageNumber = 1 |
| | | this.nomoreVideo = false |
| | | this.getAuthorVideoPage(); |
| | | } else if (this.currentTab === 'collect') { |
| | | this.collectVideoQuery.pageNumber = 1 |
| | | this.nomoreCollectVideo = false |
| | | this.getAuthorCollectVideoPage() |
| | | } else if (this.currentTab === 'likes') { |
| | | this.likeVideoQuery.pageNumber = 1 |
| | | this.nomoreLikeVideo = false |
| | | this.getAuthorLikeVideoPage() |
| | | } |
| | | }, |
| | | onLoad(option) { |
| | | this.authorId = option.authorId; |
| | |
| | | this.videoQuery.pageNumber += 1; |
| | | } |
| | | }) |
| | | } else if(this.currentTab === 'likes') { |
| | | } else if(this.currentTab === 'collect') { |
| | | if(this.nomoreCollectVideo) { |
| | | return; |
| | | } |
| | |
| | | this.nomoreCollectVideo = true; |
| | | } else { |
| | | this.collectVideoQuery.pageNumber += 1; |
| | | } |
| | | }) |
| | | } else if(this.currentTab === 'likes') { |
| | | if(this.nomoreLikeVideo) { |
| | | return; |
| | | } |
| | | getAuthorLikeVideoPage(this.likeVideoQuery).then(res => { |
| | | if(this.likeVideoQuery.pageNumber === 1) { |
| | | this.likeVideoList = res.data.data |
| | | } else { |
| | | this.likeVideoList = [ |
| | | ...this.likeVideoList, |
| | | ...res.data.data.filter( |
| | | (newItem) => !this.likeVideoList.some((oldItem) => oldItem.id === newItem.id) |
| | | ), |
| | | ]; |
| | | } |
| | | if(res.data.data.length < this.likeVideoQuery.pageSize) { |
| | | this.nomoreLikeVideo = true; |
| | | } else { |
| | | this.likeVideoQuery.pageNumber += 1; |
| | | } |
| | | }) |
| | | } |
| | |
| | | this.currentTab = tab; |
| | | if(tab === 'works') { |
| | | this.collectVideoList = [] |
| | | this.likeVideoList = [] |
| | | this.videoQuery.pageNumber = 1 |
| | | this.nomoreVideo = false |
| | | this.getAuthorVideoPage() |
| | | } else if(tab === 'collect') { |
| | | this.videoList = [] |
| | | this.likeVideoList = [] |
| | | this.collectVideoQuery.pageNumber = 1 |
| | | this.nomoreCollectVideo = false |
| | | this.getAuthorCollectVideoPage() |
| | | } else if(tab === 'likes') { |
| | | this.videoList = [] |
| | | this.collectVideoQuery.pageNumber = 1 |
| | | this.getAuthorCollectVideoPage() |
| | | this.collectVideoList = [] |
| | | this.likeVideoQuery.pageNumber = 1 |
| | | this.nomoreLikeVideo = false |
| | | this.getAuthorLikeVideoPage() |
| | | } |
| | | }, |
| | | // 获取作者喜欢的视频 |
| | | async getAuthorLikeVideoPage() { |
| | | this.likeVideoQuery.authorId = this.authorId |
| | | getAuthorLikeVideoPage(this.likeVideoQuery).then(res => { |
| | | this.likeVideoList = res.data.data |
| | | if(res.data.data.length < this.likeVideoQuery.pageSize) { |
| | | this.nomoreLikeVideo = true; |
| | | } |
| | | }) |
| | | }, |
| | | // 获取作者的收藏视频 |
| | | async getAuthorCollectVideoPage() { |
| | |
| | | url: `/pages/video/video-play?authorId=${this.authorId}&videoFrom=collect` |
| | | }); |
| | | }, |
| | | // 播放点赞视频 |
| | | playLikeVideo(index) { |
| | | const playInfo = { |
| | | videoList: this.likeVideoList, |
| | | nomore: this.nomoreLikeVideo, |
| | | pageNumber: this.likeVideoQuery.pageNumber, |
| | | playIndex: index |
| | | } |
| | | uni.setStorageSync("playInfo", playInfo) |
| | | uni.navigateTo({ |
| | | url: `/pages/video/video-play?authorId=${this.authorId}&videoFrom=like` |
| | | }); |
| | | }, |
| | | // 编辑个人资料 |
| | | editInfo() { |
| | | uni.navigateTo({ |
| | |
| | | <text class="iconfont"></text> |
| | | </view> |
| | | </view> |
| | | <view class="action-item" @click="toggleCollect(item, index)"> |
| | | <text class="iconfont" v-if="item.collected"></text> |
| | | <view class="action-item" @click="toggleThumbsUp(item, index)"> |
| | | <text class="iconfont" v-if="item.thumbsUp"></text> |
| | | <text class="iconfont" v-else></text> |
| | | <text style="font-size: 10px;font-weight: lighter;">{{item.collectNum}}</text> |
| | | <text style="font-size: 10px;font-weight: lighter;">{{item.thumbsUpNum}}</text> |
| | | </view> |
| | | <view class="action-item" @click="showComments(item)"> |
| | | <text class="iconfont"></text> |
| | | <text style="font-size: 10px;font-weight: lighter;">{{item.commentNum}}</text> |
| | | </view> |
| | | <view class="action-item" @click="toggleCollect(item, index)"> |
| | | <text class="iconfont" v-if="item.collected"></text> |
| | | <text class="iconfont" v-else></text> |
| | | <text style="font-size: 10px;font-weight: lighter;">{{item.collectNum}}</text> |
| | | </view> |
| | | <view class="action-item"> |
| | | <button open-type="share" class="custom-share-btn" :data-obj="item"> |
| | | <text class="iconfont"></text> |
| | | </button> |
| | | |
| | | </view> |
| | | </view> |
| | | |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { getRecommendVideos, savePlayRecord, subscribe, getVideoComments, addVideoComment, thubmsUpComment, cancelThubmsUpComment } from "@/api/video.js"; |
| | | import { |
| | | getRecommendVideos, |
| | | savePlayRecord, |
| | | subscribe, |
| | | getVideoComments, |
| | | addVideoComment, |
| | | thubmsUpComment, |
| | | cancelThubmsUpComment, |
| | | changeThumbsUp, |
| | | } from "@/api/video.js"; |
| | | import { changeCollect } from "@/api/collect.js"; |
| | | import { saveShare } from "@/api/share.js"; |
| | | import storage from "@/utils/storage.js"; |
| | |
| | | } |
| | | }) |
| | | }, |
| | | // 点赞/取消点赞 |
| | | toggleThumbsUp(item, index) { |
| | | let data = { |
| | | refId: item.id, |
| | | thumbsUpType: 'video' |
| | | } |
| | | const beforeThumbsUp = item.thumbsUp |
| | | const beforeThumbsUpNum = item.thumbsUpNum |
| | | if(item.thumbsUp) { |
| | | this.videoList[index].thumbsUp = false |
| | | this.videoList[index].thumbsUpNum -= 1 |
| | | } else { |
| | | this.videoList[index].thumbsUp = true |
| | | this.videoList[index].thumbsUpNum += 1 |
| | | } |
| | | changeThumbsUp(data).then(res => { |
| | | if(res.data.code !== 200) { |
| | | this.videoList[index].thumbsUp = beforeThumbsUp |
| | | this.videoList[index].thumbsUpNum = beforeThumbsUpNum |
| | | } |
| | | }) |
| | | }, |
| | | // 单击屏幕:暂停或继续播放 |
| | | togglePlay(index) { |
| | | console.log("单击视频", index); |