| @@ -6,7 +6,7 @@ import request from "@/utils/request.js"; | |||
| * @params pageNum, pageSize | |||
| * @returns data | |||
| */ | |||
| export function userPhotoVideoList(pageNum, pageSize, title) { | |||
| export function userPhotoVideoListApi(pageNum, pageSize, title) { | |||
| return request({ | |||
| url: `/api/userPhotoVideo/list?pageNum=${pageNum}&pageSize=${pageSize}&title=${title}`, | |||
| method: 'get' | |||
| @@ -18,9 +18,21 @@ export function userPhotoVideoList(pageNum, pageSize, title) { | |||
| * @params videoID | |||
| * @returns data | |||
| */ | |||
| export function delUserPhotoVideoByID(videoID) { | |||
| export function delUserPhotoVideoByIDApi(videoID) { | |||
| return request({ | |||
| url: `/api/userPhotoVideo/del?id=${videoID}`, | |||
| method: 'get' | |||
| }) | |||
| } | |||
| /** | |||
| * @description 提升画质 | |||
| * @params id | |||
| * @returns data | |||
| */ | |||
| export function videoHyApi(id) { | |||
| return request({ | |||
| url: `/api/userPhotoVideo/videoHy?id=${id}`, | |||
| method: 'get' | |||
| }) | |||
| } | |||
| @@ -74,7 +74,7 @@ export default { | |||
| searchMusic:'Search Music', | |||
| comingSoon:'coming soon', | |||
| hotMusic:'Hit song', | |||
| inputRequirement:'Please enter your requirements', | |||
| inputRequirement:'Please enter your requirements, for example: Please generate a beverage advertisement of 500 words or less', | |||
| GeneratedText:'Generated Text', | |||
| SmartText:'Smart Text', | |||
| copy:'Copy to text', | |||
| @@ -82,6 +82,7 @@ export default { | |||
| tooltip2:'Add Pause', | |||
| uploadImgTip1:'Click here to upload pictures', | |||
| uploadImgTip2:'Please ensure that the uploaded image is an open face image', | |||
| entered:'entered' | |||
| }, | |||
| // 我的视频 | |||
| @@ -104,7 +105,9 @@ export default { | |||
| manuscriptText: "Manuscript", | |||
| generatingText: "The video is generating, Please wait a moment", | |||
| generationFailedText: "Video generation failed, you can click the button below to edit the generation again ", | |||
| edit:'Edit' | |||
| edit:'Edit', | |||
| upSharpness:'Upgrade image quality', | |||
| upSharpnessTips:'If you are satisfied with the preview, you can click here to improve the video sharpness ~', | |||
| }, | |||
| // 个人账户 | |||
| @@ -74,7 +74,7 @@ export default { | |||
| searchMusic:'搜索音乐', | |||
| comingSoon:'敬请期待', | |||
| hotMusic:'热门歌曲', | |||
| inputRequirement:'请输入您的需求', | |||
| inputRequirement:'请输入您的需求,例如:请生成一个500字以内的饮料广告', | |||
| GeneratedText:'生成文本', | |||
| SmartText:'智能文本', | |||
| copy:'复制到文案', | |||
| @@ -82,6 +82,7 @@ export default { | |||
| tooltip2:'添加停顿', | |||
| uploadImgTip1:'点此上传图片', | |||
| uploadImgTip2:'请确保上传图片为无遮挡的正脸图片', | |||
| entered:'已输入', | |||
| }, | |||
| // 我的视频 | |||
| @@ -104,7 +105,9 @@ export default { | |||
| manuscriptText: "草稿", | |||
| generatingText: "视频正在生成中,请稍等哦", | |||
| generationFailedText: "视频生成失败,您可以点击下方按钮重新编辑生成", | |||
| edit:'编辑' | |||
| edit:'编辑', | |||
| upSharpness:'升级画质', | |||
| upSharpnessTips:'如果对预览效果满意,您可以点击此处来提升视频清晰度~', | |||
| }, | |||
| // 个人账户 | |||
| @@ -259,7 +259,7 @@ | |||
| <div class="text"> | |||
| <!-- 文本域 --> | |||
| <el-input | |||
| maxlength="3000" | |||
| maxlength="500" | |||
| id="textInputId" | |||
| v-model="textareaContent" | |||
| :rows="12" | |||
| @@ -291,6 +291,10 @@ | |||
| 🕗 | |||
| </el-tooltip></span | |||
| > | |||
| <i | |||
| >{{ $t("createVideo.entered") }} | |||
| {{ textareaContent.length }} / 500</i | |||
| > | |||
| </div> | |||
| </div> | |||
| <p>{{ $t("createVideo.languages") }}</p> | |||
| @@ -625,7 +629,7 @@ | |||
| <div class="text"> | |||
| <!-- 文本域 --> | |||
| <el-input | |||
| maxlength="300" | |||
| maxlength="200" | |||
| id="textInputId" | |||
| v-model="problemContent" | |||
| :rows="5" | |||
| @@ -650,12 +654,17 @@ | |||
| <div class="text" style="cursor: text"> | |||
| <!-- 文本域 --> | |||
| <el-input | |||
| maxlength="500" | |||
| id="textInputId" | |||
| v-model="answerContent" | |||
| :rows="15" | |||
| type="textarea" | |||
| disabled="" | |||
| /> | |||
| <i | |||
| >{{ $t("createVideo.entered") }} {{ answerContent.length }} / | |||
| 500</i | |||
| > | |||
| </div> | |||
| <!-- <div class="card4Btn" @click="copyAnswerContent"> | |||
| {{ $t("createVideo.copy") }} | |||
| @@ -1616,6 +1625,7 @@ function createWS() { | |||
| mySocket.close(); | |||
| return; | |||
| } | |||
| answerContent.value = answerContent.value + event.data; | |||
| }; | |||
| @@ -1630,6 +1640,13 @@ function createWS() { | |||
| }; | |||
| mySocket.onerror = (error) => { | |||
| ElMessage.error( | |||
| lanChange.value == "zh-cn" | |||
| ? `GPT服务器连接失败,请稍后重试!` | |||
| : `GPT Server connection failed, please try again later` | |||
| ); | |||
| sendLoading.value = false; | |||
| mySocket.close(); | |||
| console.error("WebSocket 错误4:", error); | |||
| }; | |||
| } | |||
| @@ -2259,6 +2276,10 @@ onUnmounted(() => { | |||
| text-align: center; | |||
| width: 40px; | |||
| } | |||
| i { | |||
| font-size: 14px; | |||
| float: right; | |||
| } | |||
| .previewAudioLoadingBox { | |||
| display: inline-block; | |||
| margin-top: -20px; | |||
| @@ -2520,7 +2541,7 @@ onUnmounted(() => { | |||
| } | |||
| .card4 { | |||
| .text { | |||
| padding: 10px; | |||
| padding: 10 px; | |||
| border: 1px solid #c0c4cc; | |||
| .el-button { | |||
| float: right; | |||
| @@ -2533,6 +2554,10 @@ onUnmounted(() => { | |||
| resize: none; | |||
| box-shadow: none; | |||
| } | |||
| i { | |||
| font-size: 14px; | |||
| float: right; | |||
| } | |||
| } | |||
| p { | |||
| @@ -148,22 +148,49 @@ | |||
| <!-- 有视频路径的页脚 --> | |||
| <div class="footer" v-if="presentItem.videoPlayUrl"> | |||
| <span class="dialog-footer"> | |||
| <!-- dialog下载按钮 --> | |||
| <!-- dialog下载按钮 upGrades--> | |||
| <button | |||
| class="elBtn" | |||
| type="primary" | |||
| @click.stop="handleDownload(presentItem.videoPlayUrl)" | |||
| > | |||
| <el-icon class="icon-delete"><i-ep-download /></el-icon | |||
| >{{ $t("myCreating.download") }} | |||
| <!-- <el-icon class="icon-delete"><i-ep-download /></el-icon> --> | |||
| {{ $t("myCreating.download") }} | |||
| </button> | |||
| <!-- 提升画质 --> | |||
| <el-tooltip | |||
| v-if="presentItem.isHy == 0" | |||
| class="box-item" | |||
| effect="light" | |||
| :content="$t('myCreating.upSharpnessTips')" | |||
| placement="top" | |||
| > | |||
| <button | |||
| class="elBtn upSharpness" | |||
| @click.stop="upGrades(presentItem.id)" | |||
| > | |||
| <div v-if="!upGradesLoading"> | |||
| <img src="../../assets//img/Upgrades.png" alt="" /> | |||
| {{ $t("myCreating.upSharpness") }} | |||
| </div> | |||
| <div v-if="upGradesLoading"> | |||
| <!-- <my-Loading-Icon | |||
| class="previewAudioLoadingBox" | |||
| v-if="!upGradesLoading" | |||
| ></my-Loading-Icon> --> | |||
| <el-icon class="is-loading" style="font-size: 16px" | |||
| ><i-ep-Loading | |||
| /></el-icon> | |||
| </div> | |||
| </button> | |||
| </el-tooltip> | |||
| <!-- dialog删除按钮 --> | |||
| <button | |||
| class="elBtn" | |||
| @click.stop="handelDelete(presentItem.id, presentItem.title)" | |||
| > | |||
| <el-icon class="icon-delete"><i-ep-delete /></el-icon | |||
| >{{ $t("myCreating.delete") }} | |||
| <!-- <el-icon class="icon-delete"><i-ep-delete /></el-icon> --> | |||
| {{ $t("myCreating.delete") }} | |||
| </button> | |||
| </span> | |||
| </div> | |||
| @@ -207,7 +234,11 @@ | |||
| </template> | |||
| <script setup> | |||
| import { userPhotoVideoList, delUserPhotoVideoByID } from "@/apis/myCreating"; | |||
| import { | |||
| userPhotoVideoListApi, | |||
| delUserPhotoVideoByIDApi, | |||
| videoHyApi, | |||
| } from "@/apis/myCreating"; | |||
| import { timestampToTime } from "@/utils/tools"; | |||
| import { useI18n } from "vue-i18n"; | |||
| import { getStatus } from "./videoStatus"; | |||
| @@ -277,11 +308,11 @@ function handleDownload(itemVideoPlayUrl) { | |||
| function goCreate() { | |||
| router.push("/createVideo"); | |||
| } | |||
| // 搜索 | |||
| function searchVideoList() { | |||
| getPhotoVideoList(pageNum.value, pageSize.value, title.value, true); | |||
| } | |||
| // 删除 | |||
| function handelDelete(id, title) { | |||
| const msg = | |||
| lanChange.value == "zh-cn" | |||
| @@ -297,13 +328,47 @@ function handelDelete(id, title) { | |||
| delPhotoVideo(id); | |||
| }); | |||
| } | |||
| // 升级画质 | |||
| const upGradesLoading = ref(false); | |||
| function upGrades(id) { | |||
| const msg = | |||
| lanChange.value == "zh-cn" | |||
| ? `确定要升级该作品吗?` | |||
| : `Are you sure you want to upgrade this work?`; | |||
| const notice = lanChange.value == "zh-cn" ? "提示" : "Notice"; | |||
| const confirm = lanChange.value == "zh-cn" ? "确定" : "Confirm"; | |||
| const cancel = lanChange.value == "zh-cn" ? "取消" : "Cancel"; | |||
| ElMessageBox.confirm(msg, notice, { | |||
| confirmButtonText: confirm, | |||
| cancelButtonText: cancel, | |||
| }).then(async () => { | |||
| upGradesLoading.value = true; | |||
| try { | |||
| const res = await videoHyApi(id); | |||
| ElMessage.error( | |||
| lanChange.value == "zh-cn" | |||
| ? `升级成功!请稍等~` | |||
| : `Upgrade successful! Please wait a moment` | |||
| ); | |||
| upGradesLoading.value = false; | |||
| getPhotoVideoList(pageNum.value, pageSize.value, title.value); | |||
| } catch (error) { | |||
| ElMessage.error( | |||
| lanChange.value == "zh-cn" | |||
| ? `升级失败,请稍后重试` | |||
| : `Upgrade failed, please try again later` | |||
| ); | |||
| upGradesLoading.value = false; | |||
| } | |||
| }); | |||
| } | |||
| /** | |||
| * @description:获取我的视频作品 | |||
| * @return: data | |||
| */ | |||
| function getPhotoVideoList(pageNum, pageSize, title, searchFlag) { | |||
| userPhotoVideoList(pageNum, pageSize, title) | |||
| userPhotoVideoListApi(pageNum, pageSize, title) | |||
| .then((res) => { | |||
| console.log(res, "res"); | |||
| res.data.list.forEach((item) => { | |||
| @@ -345,7 +410,7 @@ function getPhotoVideoList(pageNum, pageSize, title, searchFlag) { | |||
| * @return: data | |||
| */ | |||
| function delPhotoVideo(videoID) { | |||
| delUserPhotoVideoByID(videoID) | |||
| delUserPhotoVideoByIDApi(videoID) | |||
| .then((res) => { | |||
| console.log(res, "res"); | |||
| const msg = lanChange.value == "zh-cn" ? `删除成功!` : `Success !`; | |||
| @@ -671,7 +736,12 @@ onMounted(() => { | |||
| background-color: #15d1b8; | |||
| } | |||
| } | |||
| .upSharpness { | |||
| img { | |||
| width: 14px; | |||
| height: 14px; | |||
| } | |||
| } | |||
| :deep(.el-icon) { | |||
| margin-right: 5px; | |||
| font-weight: 700; | |||