| @@ -42,9 +42,9 @@ export function videoHyApi(id) { | |||||
| * @params id | * @params id | ||||
| * @returns data | * @returns data | ||||
| */ | */ | ||||
| export function checkVideoStatusApi(list, type) { | |||||
| export function checkVideoStatusApi(list) { | |||||
| return request({ | return request({ | ||||
| url: `/api/userPhotoVideo/checkVideoStatus?list=${list}&type=${type}`, | |||||
| url: `/api/userPhotoVideo/checkVideoStatus?list=${list}`, | |||||
| method: 'get' | method: 'get' | ||||
| }) | }) | ||||
| } | } | ||||
| @@ -107,6 +107,9 @@ export default { | |||||
| generating: "Generating", | generating: "Generating", | ||||
| generationFailed: "Failed", | generationFailed: "Failed", | ||||
| generationSucceed: "Succeed", | generationSucceed: "Succeed", | ||||
| videoUpSucceed: "HD", | |||||
| videoUpFailed: "UP Failed", | |||||
| videoUping:'Upgrades', | |||||
| manuscriptText: "Manuscript", | manuscriptText: "Manuscript", | ||||
| generatingText: "The video is generating, Please wait a moment", | generatingText: "The video is generating, Please wait a moment", | ||||
| generationFailedText: "Video generation failed, click Edit button to retry.", | generationFailedText: "Video generation failed, click Edit button to retry.", | ||||
| @@ -107,6 +107,9 @@ export default { | |||||
| generating: "生成中", | generating: "生成中", | ||||
| generationFailed: "生成失败", | generationFailed: "生成失败", | ||||
| generationSucceed: "生成成功", | generationSucceed: "生成成功", | ||||
| videoUping:'升级中', | |||||
| videoUpFailed: "升级失败", | |||||
| videoUpSucceed: "HD", | |||||
| manuscriptText: "草稿", | manuscriptText: "草稿", | ||||
| generatingText: "视频正在生成中,请稍等哦", | generatingText: "视频正在生成中,请稍等哦", | ||||
| generationFailedText: "视频生成失败,您可以点击下方按钮重新编辑生成", | generationFailedText: "视频生成失败,您可以点击下方按钮重新编辑生成", | ||||
| @@ -1390,18 +1390,6 @@ async function saveOrUpdate(index, isSaveVideo) { | |||||
| return; | return; | ||||
| } | } | ||||
| try { | try { | ||||
| const res2 = await saveOrUpdateApi(saveOrUpdateData); // 保存数据 | |||||
| if (res2.code == 1002) { | |||||
| } | |||||
| // 这个if判断是不是仅仅保存视频 | |||||
| if (isSaveVideo == "saveVideo") { | |||||
| ElMessage.success( | |||||
| lanChange.value == "zh-cn" ? `已保存为草稿` : `Saved as manuscript` | |||||
| ); | |||||
| createLoading.value = false; | |||||
| router.push("/myCreating"); | |||||
| return; | |||||
| } | |||||
| // 获取预估时长 | // 获取预估时长 | ||||
| const res4 = await previewAudioApi( | const res4 = await previewAudioApi( | ||||
| textareaContent.value, | textareaContent.value, | ||||
| @@ -1417,6 +1405,19 @@ async function saveOrUpdate(index, isSaveVideo) { | |||||
| createLoading.value = false; | createLoading.value = false; | ||||
| return; | return; | ||||
| } | } | ||||
| if (res4.data.data > 60) { | |||||
| ElMessage.error( | |||||
| lanChange.value == "zh-cn" | |||||
| ? `预计生成的视频时长约为${formatTime( | |||||
| res4.data.data | |||||
| )},免费用户生成视频时长为60秒,无法生成视频` | |||||
| : `The video generated is expected to be about ${formatTime( | |||||
| res4.data.data | |||||
| )} long, and the free user-generated video is 60 seconds long and cannot be generated` | |||||
| ); | |||||
| createLoading.value = false; | |||||
| return; | |||||
| } | |||||
| ElMessage.success( | ElMessage.success( | ||||
| lanChange.value == "zh-cn" | lanChange.value == "zh-cn" | ||||
| ? `预计生成的视频时长约为${formatTime(res4.data.data)}` | ? `预计生成的视频时长约为${formatTime(res4.data.data)}` | ||||
| @@ -1424,6 +1425,19 @@ async function saveOrUpdate(index, isSaveVideo) { | |||||
| res4.data.data | res4.data.data | ||||
| )} in length` | )} in length` | ||||
| ); | ); | ||||
| const res2 = await saveOrUpdateApi(saveOrUpdateData); // 保存数据 | |||||
| if (res2.code == 1002) { | |||||
| } | |||||
| // 这个if判断是不是仅仅保存视频 | |||||
| if (isSaveVideo == "saveVideo") { | |||||
| ElMessage.success( | |||||
| lanChange.value == "zh-cn" ? `已保存为草稿` : `Saved as manuscript` | |||||
| ); | |||||
| createLoading.value = false; | |||||
| router.push("/myCreating"); | |||||
| return; | |||||
| } | |||||
| // 3秒后调用生成视频 | // 3秒后调用生成视频 | ||||
| const changeHasNewCreate = setTimeout(async () => { | const changeHasNewCreate = setTimeout(async () => { | ||||
| const res3 = await createVideoApi({ id: res2.data.id }); // 生成视频 | const res3 = await createVideoApi({ id: res2.data.id }); // 生成视频 | ||||
| @@ -1665,17 +1679,17 @@ async function uploadMusic() { | |||||
| if (uploadAudioTime.value > 60) { | if (uploadAudioTime.value > 60) { | ||||
| ElMessage.error( | ElMessage.error( | ||||
| lanChange.value == "zh-cn" | lanChange.value == "zh-cn" | ||||
| ? `上传失败,免费用户上传音频时长最多为60秒` | |||||
| : `Upload failed, free users can upload audio for up to 60 seconds` | |||||
| ? `上传音频大小或者长度超出限制,请重新上传` | |||||
| : `The size or length of the uploaded audio exceeds the limit. Please upload it again` | |||||
| ); | ); | ||||
| return; | return; | ||||
| } | } | ||||
| // 限制3mb | // 限制3mb | ||||
| if (file.size / 1048576 > 3) { | |||||
| if (file.size / 1048576 > 5) { | |||||
| ElMessage.error( | ElMessage.error( | ||||
| lanChange.value == "zh-cn" | lanChange.value == "zh-cn" | ||||
| ? `上传失败,免费用户上传音频大小最大为3MB` | |||||
| : `Failed to upload. The maximum size of audio uploaded by free users is 3MB` | |||||
| ? `上传音频大小或者长度超出限制,请重新上传` | |||||
| : `The size or length of the uploaded audio exceeds the limit. Please upload it again` | |||||
| ); | ); | ||||
| return; | return; | ||||
| } | } | ||||
| @@ -66,7 +66,7 @@ | |||||
| ><i-ep-closeBold | ><i-ep-closeBold | ||||
| /></el-icon> | /></el-icon> | ||||
| <el-icon | <el-icon | ||||
| v-if="[5].includes(item.videoStatus)" | |||||
| v-if="[5, 7, 8, 9, 10, 11, 12].includes(item.videoStatus)" | |||||
| class="icon-videoPlay" | class="icon-videoPlay" | ||||
| ><i-ep-videoPlay | ><i-ep-videoPlay | ||||
| /></el-icon> | /></el-icon> | ||||
| @@ -130,15 +130,16 @@ | |||||
| center | center | ||||
| > | > | ||||
| <div class="videoBox"> | <div class="videoBox"> | ||||
| <!-- 免费用户1分钟 --> | |||||
| <div v-if="[5].includes(presentItem.videoStatus)" class="overtimeTips"> | |||||
| <!-- 免费用户1分钟 [5].includes(presentItem.videoStatus)--> | |||||
| <div | |||||
| v-if="presentItem.videoPlayUrl && presentItem.videoTime > 60" | |||||
| class="overtimeTips" | |||||
| > | |||||
| <img src="../../assets/img/tips.png" alt="" /> | <img src="../../assets/img/tips.png" alt="" /> | ||||
| {{ $t("myCreating.freeUserTip") }} | {{ $t("myCreating.freeUserTip") }} | ||||
| </div> | </div> | ||||
| <video | <video | ||||
| v-if=" | |||||
| presentItem.videoPlayUrl && [5].includes(presentItem.videoStatus) | |||||
| " | |||||
| v-if="presentItem.videoPlayUrl" | |||||
| controls="true" | controls="true" | ||||
| class="" | class="" | ||||
| :src="presentItem.videoPlayUrl" | :src="presentItem.videoPlayUrl" | ||||
| @@ -170,6 +171,7 @@ | |||||
| </button> | </button> | ||||
| <!-- 提升画质 --> | <!-- 提升画质 --> | ||||
| <el-tooltip | <el-tooltip | ||||
| style="cursor: pointer" | |||||
| v-if="presentItem.isHy == 0" | v-if="presentItem.isHy == 0" | ||||
| class="box-item" | class="box-item" | ||||
| effect="light" | effect="light" | ||||
| @@ -177,11 +179,12 @@ | |||||
| placement="top" | placement="top" | ||||
| > | > | ||||
| <button | <button | ||||
| v-if="false" | |||||
| style="cursor: pointer" | |||||
| v-if="presentItem.isHy == 0" | |||||
| class="elBtn upSharpness" | class="elBtn upSharpness" | ||||
| @click.stop="upGrades(presentItem.id)" | @click.stop="upGrades(presentItem.id)" | ||||
| > | > | ||||
| <div v-if="!upGradesLoading"> | |||||
| <div v-if="!upGradesLoading" style="cursor: pointer"> | |||||
| <img src="../../assets//img/Upgrades.png" alt="" /> | <img src="../../assets//img/Upgrades.png" alt="" /> | ||||
| {{ $t("myCreating.upSharpness") }} | {{ $t("myCreating.upSharpness") }} | ||||
| </div> | </div> | ||||
| @@ -398,15 +401,8 @@ function getPhotoVideoList(pageNum, pageSize, title, searchFlag) { | |||||
| notGenerateList.value = []; | notGenerateList.value = []; | ||||
| // 找到数组中未生成的,放入列表,为了刷新 | // 找到数组中未生成的,放入列表,为了刷新 | ||||
| res.data.list.forEach((item) => { | res.data.list.forEach((item) => { | ||||
| 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); | |||||
| } | |||||
| if ([1, 2, 4, 6, 7, 8, 10, 12].includes(item.videoStatus)) { | |||||
| notGenerateList.value.push(item.id); | |||||
| } | } | ||||
| }); | }); | ||||
| res.data.list.forEach((item) => { | res.data.list.forEach((item) => { | ||||
| @@ -467,19 +463,14 @@ const notGenerateList = ref([]); //页面上未生成的视频的id 普通视 | |||||
| const notGenerateList2 = ref([]); //页面上未生成的视频的id 升级视频 | const notGenerateList2 = ref([]); //页面上未生成的视频的id 升级视频 | ||||
| const checkVideoStatus = async () => { | const checkVideoStatus = async () => { | ||||
| // 如果列表中没有生成中的视频,不发送请求 | // 如果列表中没有生成中的视频,不发送请求 | ||||
| const intervalId = setInterval(async () => { | const intervalId = setInterval(async () => { | ||||
| // && notGenerateList2.value.length == 0; | // && notGenerateList2.value.length == 0; | ||||
| if (notGenerateList.value.length == 0) { | if (notGenerateList.value.length == 0) { | ||||
| return; | return; | ||||
| } | } | ||||
| try { | try { | ||||
| const res = await checkVideoStatusApi(notGenerateList.value, 1); | |||||
| // const res2 = checkVideoStatusApi(notGenerateList2.value, 2); | |||||
| const res = await checkVideoStatusApi(notGenerateList.value); | |||||
| // 如果有新的,则提示且更新列表 | // 如果有新的,则提示且更新列表 | ||||
| console.log(res.code); | |||||
| // console.log(res2.code); | |||||
| // || res2.code != 2115 | |||||
| if (res.code != 2115) { | if (res.code != 2115) { | ||||
| hasNewCreate.value = true; | hasNewCreate.value = true; | ||||
| const changeHasNewCreate = setTimeout(() => { | const changeHasNewCreate = setTimeout(() => { | ||||
| @@ -718,6 +709,18 @@ onMounted(() => { | |||||
| /* 生成成功 */ | /* 生成成功 */ | ||||
| background: linear-gradient(120deg, #84fab0 0%, #8fd3f4 100%); | background: linear-gradient(120deg, #84fab0 0%, #8fd3f4 100%); | ||||
| } | } | ||||
| &.videoUping { | |||||
| /* 升级中 */ | |||||
| background: linear-gradient(120deg, #4512c7 0%, #4fd334 100%); | |||||
| } | |||||
| &.videoUpFailed { | |||||
| /* HD */ | |||||
| background: linear-gradient(120deg, #ff0019 0%, #ff00c3 100%); | |||||
| } | |||||
| &.videoUpSucceed { | |||||
| /* HD */ | |||||
| background: linear-gradient(120deg, #fdeb71 0%, #d37e1a 100%); | |||||
| } | |||||
| } | } | ||||
| &:hover { | &:hover { | ||||
| .more { | .more { | ||||
| @@ -3,7 +3,7 @@ | |||||
| * @param {number} status | * @param {number} status | ||||
| * @return: statusName | * @return: statusName | ||||
| */ | */ | ||||
| // 0草稿 1246生成中 3失败 5成功 | |||||
| // 0草稿 (1246生成中) 3失败 5成功 (7 8 10 12超分中) 11超分成功 9超分失败 | |||||
| export const getStatus = status => { | export const getStatus = status => { | ||||
| if (status == 0) { | if (status == 0) { | ||||
| return "manuscript" | return "manuscript" | ||||
| @@ -13,5 +13,11 @@ export const getStatus = status => { | |||||
| return "generationFailed" | return "generationFailed" | ||||
| } else if (status == 5) { | } else if (status == 5) { | ||||
| return "generationSucceed" | return "generationSucceed" | ||||
| } else if (status == 7 || status == 8 || status == 10 || status == 12) { | |||||
| return "videoUping" | |||||
| } else if (status == 9) { | |||||
| return "videoUpFailed" | |||||
| } else if (status == 11) { | |||||
| return "videoUpSucceed" | |||||
| } | } | ||||
| } | } | ||||
| @@ -89,15 +89,15 @@ | |||||
| <div class="authority-item"> | <div class="authority-item"> | ||||
| {{ $t("shop.AIGeneratedPortrait") }}:<span>{{ | {{ $t("shop.AIGeneratedPortrait") }}:<span>{{ | ||||
| item.userPackageDetails[0].aiPortrait == 0 | item.userPackageDetails[0].aiPortrait == 0 | ||||
| ? $t("shop.yes") | |||||
| : $t("shop.no") | |||||
| ? $t("shop.no") | |||||
| : $t("shop.yes") | |||||
| }}</span> | }}</span> | ||||
| </div> | </div> | ||||
| <div class="authority-item"> | <div class="authority-item"> | ||||
| {{ $t("shop.PhotoSinging") }}:<span>{{ | {{ $t("shop.PhotoSinging") }}:<span>{{ | ||||
| item.userPackageDetails[0].photoSing == 0 | item.userPackageDetails[0].photoSing == 0 | ||||
| ? $t("shop.yes") | |||||
| : $t("shop.no") | |||||
| ? $t("shop.no") | |||||
| : $t("shop.yes") | |||||
| }}</span> | }}</span> | ||||
| </div> | </div> | ||||
| <div class="authority-item"> | <div class="authority-item"> | ||||