| | |
| | | changeCollect |
| | | } from "@/api/collect.js"; |
| | | import { saveShare, saveShareClickRecord } from "@/api/share.js"; |
| | | import storage from "@/utils/storage.js"; |
| | | |
| | | export default { |
| | | computed: { |
| | | hasPlayTime() { |
| | |
| | | } |
| | | this.getKitchenTypeList(); |
| | | this.loadVideos(queryParam); |
| | | |
| | | }) |
| | | }else{ |
| | | if (option.userId && option.videoId) { |
| | |
| | | saveShareClickRecord({refId: option.videoId, shareUserId: option.userId}) |
| | | } |
| | | this.getKitchenTypeList(); |
| | | this.loadVideos(); |
| | | this.loadVideos(queryParam); |
| | | } |
| | | |
| | | }, |
| | |
| | | }) |
| | | }, |
| | | // 加载视频数据 |
| | | async loadVideos() { |
| | | async loadVideos(param) { |
| | | console.log(this.loading, this.videoNoMore,this.videoQuery) |
| | | if (this.videoQuery.pageNumber == 1) { |
| | | |
| | | } else if (this.loading || this.videoNoMore) return; |
| | | this.loading = true; |
| | | |
| | | if(param){ |
| | | console.log("二维码扫码数据执行在此处1") |
| | | console.log(this.videoQuery) |
| | | getkitchenVideoList(this.videoQuery).then(res => { |
| | | console.log(res) |
| | | // 新增一个字段用于循环时的key |
| | | const data = res.data.data.map(item => { |
| | | return { |
| | | ...item, |
| | | updateKey: item.id |
| | | } |
| | | }) |
| | | if (this.videoQuery.pageNumber === 1) { |
| | | this.videoList = data; |
| | | } else { |
| | | this.videoList = [ |
| | | ...this.videoList, |
| | | ...data.filter( |
| | | (newItem) => !this.videoList.some((oldItem) => oldItem.id === newItem.id) |
| | | ), |
| | | ]; |
| | | } |
| | | this.loading = false; |
| | | if (data.length < this.videoQuery.pageSize) { |
| | | this.videoNoMore = true; |
| | | return; |
| | | } |
| | | this.videoQuery.pageNumber++; |
| | | |
| | | }) |
| | | }else{ |
| | | |
| | | console.log("二维码扫码数据执行在此处2") |
| | | console.log(this.videoQuery) |
| | | getkitchenVideoList(this.videoQuery).then(res => { |
| | | console.log(res) |
| | | // 新增一个字段用于循环时的key |
| | | const data = res.data.data.map(item => { |
| | | return { |
| | |
| | | this.videoQuery.pageNumber++; |
| | | |
| | | }) |
| | | } |
| | | }, |
| | | |
| | | // 滑动切换视频 |