save
This commit is contained in:
parent
54605f59e8
commit
05b5babcbd
@ -22,4 +22,7 @@ export function privateVideo(params, data) {
|
|||||||
|
|
||||||
export function likeVideo(params, data) {
|
export function likeVideo(params, data) {
|
||||||
return request({url: '/video/like', method: 'get', params, data})
|
return request({url: '/video/like', method: 'get', params, data})
|
||||||
|
}
|
||||||
|
export function videoComments(params, data) {
|
||||||
|
return request({url: '/video/comments', method: 'get', params, data})
|
||||||
}
|
}
|
||||||
@ -133,10 +133,13 @@ import Loading from "./Loading";
|
|||||||
import Search from "./Search";
|
import Search from "./Search";
|
||||||
import {$no} from "@/utils";
|
import {$no} from "@/utils";
|
||||||
import {useBaseStore} from "@/store/pinia";
|
import {useBaseStore} from "@/store/pinia";
|
||||||
|
import {videoComments} from "@/api/videos";
|
||||||
|
import Popover from "@/pages/login/components/Tooltip.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Comment",
|
name: "Comment",
|
||||||
components: {
|
components: {
|
||||||
|
Popover,
|
||||||
AutoInput,
|
AutoInput,
|
||||||
ConfirmDialog,
|
ConfirmDialog,
|
||||||
FromBottomDialog,
|
FromBottomDialog,
|
||||||
@ -207,6 +210,8 @@ export default {
|
|||||||
this.isCall = false
|
this.isCall = false
|
||||||
},
|
},
|
||||||
async getData() {
|
async getData() {
|
||||||
|
let res = await videoComments()
|
||||||
|
console.log('res', res)
|
||||||
await this.$sleep(500)
|
await this.$sleep(500)
|
||||||
this.comments = [
|
this.comments = [
|
||||||
{
|
{
|
||||||
@ -360,7 +365,8 @@ export default {
|
|||||||
.right {
|
.right {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 12rem;
|
gap: 12rem;
|
||||||
|
position: relative;
|
||||||
|
z-index: 9;
|
||||||
svg {
|
svg {
|
||||||
background: rgb(242, 242, 242);
|
background: rgb(242, 242, 242);
|
||||||
padding: 4rem;
|
padding: 4rem;
|
||||||
|
|||||||
@ -5,6 +5,7 @@ import {BASE_URL} from "@/config";
|
|||||||
import {useBaseStore} from "@/store/pinia";
|
import {useBaseStore} from "@/store/pinia";
|
||||||
import axiosInstance from "@/utils/request";
|
import axiosInstance from "@/utils/request";
|
||||||
import MockAdapter from "axios-mock-adapter";
|
import MockAdapter from "axios-mock-adapter";
|
||||||
|
import Mock from "mockjs";
|
||||||
|
|
||||||
const mock = new MockAdapter(axiosInstance, {delayResponse: 300});
|
const mock = new MockAdapter(axiosInstance, {delayResponse: 300});
|
||||||
|
|
||||||
@ -200,5 +201,40 @@ export async function startMock() {
|
|||||||
}]
|
}]
|
||||||
})
|
})
|
||||||
|
|
||||||
|
mock.onGet(/video\/comments/).reply(async (config) => {
|
||||||
|
return new Promise(function (resolve, reject) {
|
||||||
|
setTimeout(()=>{
|
||||||
|
requestIdleCallback(() => {
|
||||||
|
let data = Mock.mock({
|
||||||
|
'list|5-50': [{
|
||||||
|
name: '@cname',
|
||||||
|
text: '@cparagraph(3)',
|
||||||
|
createTime: '@date("T")',
|
||||||
|
collect_count: '@int(3,1000)'
|
||||||
|
}]
|
||||||
|
})
|
||||||
|
|
||||||
|
data.list.map(v => [
|
||||||
|
v.children = Mock.mock({
|
||||||
|
'list|0-5': [{
|
||||||
|
name: '@cname',
|
||||||
|
text: '@cparagraph(3)',
|
||||||
|
createTime: '@date("T")',
|
||||||
|
collect_count: '@int(3,1000)'
|
||||||
|
}]
|
||||||
|
})
|
||||||
|
])
|
||||||
|
|
||||||
|
resolve([200, {
|
||||||
|
data: {
|
||||||
|
total: data.list.length,
|
||||||
|
list: data.list,
|
||||||
|
}, code: 200, msg: '',
|
||||||
|
}])
|
||||||
|
})
|
||||||
|
})
|
||||||
|
});
|
||||||
|
})
|
||||||
|
|
||||||
setTimeout(fetchData, 1000)
|
setTimeout(fetchData, 1000)
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user