congzc 1 year ago
parent
commit
c2fd50f5df
2 changed files with 29 additions and 7 deletions
  1. +2
    -2
      src/apis/myCreating.js
  2. +27
    -5
      src/views/myCreating/index.vue

+ 2
- 2
src/apis/myCreating.js View File

@@ -42,9 +42,9 @@ export function videoHyApi(id) {
* @params id
* @returns data
*/
export function checkVideoStatusApi(list) {
export function checkVideoStatusApi(list, type) {
return request({
url: `/api/userPhotoVideo/checkVideoStatus?list=${list}`,
url: `/api/userPhotoVideo/checkVideoStatus?list=${list}&type=${type}`,
method: 'get'
})
}

+ 27
- 5
src/views/myCreating/index.vue View File

@@ -345,6 +345,14 @@ function handelDelete(id, title) {
// 升级画质
const upGradesLoading = ref(false);
function upGrades(id) {
if ((upGradesLoading.value = true)) {
ElMessage.error(
lanChange.value == "zh-cn"
? `正在升级,请稍后~`
: `Upgrading, please wait ~`
);
return;
}
const msg =
lanChange.value == "zh-cn"
? `确定要升级该作品吗?`
@@ -389,8 +397,15 @@ function getPhotoVideoList(pageNum, pageSize, title, searchFlag) {
notGenerateList.value = [];
// 找到数组中未生成的,放入列表,为了刷新
res.data.list.forEach((item) => {
if ([1, 2, 4, 6].includes(item.videoStatus)) {
notGenerateList.value.push(item.id);
if (item.isHy == 0) {
if ([1, 2, 4, 6].includes(item.videoStatus)) {
notGenerateList.value.push(item.id);
}
}
if (item.isHy == 1) {
if ([1, 2, 4, 6].includes(item.videoStatus)) {
notGenerateList2.value.push(item.id);
}
}
});
res.data.list.forEach((item) => {
@@ -447,12 +462,19 @@ function delPhotoVideo(videoID) {
}
//#region 定时刷新
const hasNewCreate = ref(false); //提示框显示隐藏
const notGenerateList = ref([]); //页面上未生成的视频的id
const notGenerateList = ref([]); //页面上未生成的视频的id 普通视频
const notGenerateList2 = ref([]); //页面上未生成的视频的id 升级视频
const checkVideoStatus = async () => {
// 如果列表中没有生成中的视频,不发送请求
if (notGenerateList.value.length == 0 && notGenerateList2.value.length == 0) {
return;
}
const intervalId = setInterval(async () => {
try {
const res = await checkVideoStatusApi(notGenerateList.value);
if (res.code != 2115) {
const res = await checkVideoStatusApi(notGenerateList.value, 1);
const res2 = await checkVideoStatusApi(notGenerateList2.value, 2);
// 如果有新的,则提示且更新列表
if (res.code != 2115 || res2.code != 2115) {
hasNewCreate.value = true;
const changeHasNewCreate = setTimeout(() => {
hasNewCreate.value = false;


Loading…
Cancel
Save