congzc преди 1 година
родител
ревизия
14a1d77a49
променени са 7 файла, в които са добавени 76 реда и са изтрити 47 реда
  1. +2
    -2
      src/apis/myCreating.js
  2. +3
    -0
      src/lang/package/en.ts
  3. +3
    -0
      src/lang/package/zh-cn.ts
  4. +31
    -17
      src/views/createVideo/index.vue
  5. +26
    -23
      src/views/myCreating/index.vue
  6. +7
    -1
      src/views/myCreating/videoStatus.js
  7. +4
    -4
      src/views/myStore/index.vue

+ 2
- 2
src/apis/myCreating.js Целия файл

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

+ 3
- 0
src/lang/package/en.ts Целия файл

@@ -107,6 +107,9 @@ export default {
generating: "Generating",
generationFailed: "Failed",
generationSucceed: "Succeed",
videoUpSucceed: "HD",
videoUpFailed: "UP Failed",
videoUping:'Upgrades',
manuscriptText: "Manuscript",
generatingText: "The video is generating, Please wait a moment",
generationFailedText: "Video generation failed, click Edit button to retry.",


+ 3
- 0
src/lang/package/zh-cn.ts Целия файл

@@ -107,6 +107,9 @@ export default {
generating: "生成中",
generationFailed: "生成失败",
generationSucceed: "生成成功",
videoUping:'升级中',
videoUpFailed: "升级失败",
videoUpSucceed: "HD",
manuscriptText: "草稿",
generatingText: "视频正在生成中,请稍等哦",
generationFailedText: "视频生成失败,您可以点击下方按钮重新编辑生成",


+ 31
- 17
src/views/createVideo/index.vue Целия файл

@@ -1390,18 +1390,6 @@ async function saveOrUpdate(index, isSaveVideo) {
return;
}
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(
textareaContent.value,
@@ -1417,6 +1405,19 @@ async function saveOrUpdate(index, isSaveVideo) {
createLoading.value = false;
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(
lanChange.value == "zh-cn"
? `预计生成的视频时长约为${formatTime(res4.data.data)}`
@@ -1424,6 +1425,19 @@ async function saveOrUpdate(index, isSaveVideo) {
res4.data.data
)} 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秒后调用生成视频
const changeHasNewCreate = setTimeout(async () => {
const res3 = await createVideoApi({ id: res2.data.id }); // 生成视频
@@ -1665,17 +1679,17 @@ async function uploadMusic() {
if (uploadAudioTime.value > 60) {
ElMessage.error(
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;
}
// 限制3mb
if (file.size / 1048576 > 3) {
if (file.size / 1048576 > 5) {
ElMessage.error(
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;
}


+ 26
- 23
src/views/myCreating/index.vue Целия файл

@@ -66,7 +66,7 @@
><i-ep-closeBold
/></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"
><i-ep-videoPlay
/></el-icon>
@@ -130,15 +130,16 @@
center
>
<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="" />
{{ $t("myCreating.freeUserTip") }}
</div>
<video
v-if="
presentItem.videoPlayUrl && [5].includes(presentItem.videoStatus)
"
v-if="presentItem.videoPlayUrl"
controls="true"
class=""
:src="presentItem.videoPlayUrl"
@@ -170,6 +171,7 @@
</button>
<!-- 提升画质 -->
<el-tooltip
style="cursor: pointer"
v-if="presentItem.isHy == 0"
class="box-item"
effect="light"
@@ -177,11 +179,12 @@
placement="top"
>
<button
v-if="false"
style="cursor: pointer"
v-if="presentItem.isHy == 0"
class="elBtn upSharpness"
@click.stop="upGrades(presentItem.id)"
>
<div v-if="!upGradesLoading">
<div v-if="!upGradesLoading" style="cursor: pointer">
<img src="../../assets//img/Upgrades.png" alt="" />
{{ $t("myCreating.upSharpness") }}
</div>
@@ -398,15 +401,8 @@ function getPhotoVideoList(pageNum, pageSize, title, searchFlag) {
notGenerateList.value = [];
// 找到数组中未生成的,放入列表,为了刷新
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) => {
@@ -467,19 +463,14 @@ const notGenerateList = ref([]); //页面上未生成的视频的id 普通视
const notGenerateList2 = ref([]); //页面上未生成的视频的id 升级视频
const checkVideoStatus = async () => {
// 如果列表中没有生成中的视频,不发送请求

const intervalId = setInterval(async () => {
// && notGenerateList2.value.length == 0;
if (notGenerateList.value.length == 0) {
return;
}
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) {
hasNewCreate.value = true;
const changeHasNewCreate = setTimeout(() => {
@@ -718,6 +709,18 @@ onMounted(() => {
/* 生成成功 */
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 {
.more {


+ 7
- 1
src/views/myCreating/videoStatus.js Целия файл

@@ -3,7 +3,7 @@
* @param {number} status
* @return: statusName
*/
// 0草稿 1246生成中 3失败 5成功
// 0草稿 (1246生成中) 3失败 5成功 (7 8 10 12超分中) 11超分成功 9超分失败
export const getStatus = status => {
if (status == 0) {
return "manuscript"
@@ -13,5 +13,11 @@ export const getStatus = status => {
return "generationFailed"
} else if (status == 5) {
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"
}
}

+ 4
- 4
src/views/myStore/index.vue Целия файл

@@ -89,15 +89,15 @@
<div class="authority-item">
{{ $t("shop.AIGeneratedPortrait") }}:<span>{{
item.userPackageDetails[0].aiPortrait == 0
? $t("shop.yes")
: $t("shop.no")
? $t("shop.no")
: $t("shop.yes")
}}</span>
</div>
<div class="authority-item">
{{ $t("shop.PhotoSinging") }}:<span>{{
item.userPackageDetails[0].photoSing == 0
? $t("shop.yes")
: $t("shop.no")
? $t("shop.no")
: $t("shop.yes")
}}</span>
</div>
<div class="authority-item">


Зареждане…
Отказ
Запис