Browse Source

180秒限制

dev
congzc 1 year ago
parent
commit
d63119a801
1 changed files with 15 additions and 14 deletions
  1. +15
    -14
      src/views/createVideo/index.vue

+ 15
- 14
src/views/createVideo/index.vue View File

@@ -491,8 +491,8 @@
<img src="../../assets/img/tips.png" alt="" /> <img src="../../assets/img/tips.png" alt="" />
{{ {{
lanChange == "zh-cn" lanChange == "zh-cn"
? `免费用户限制为60秒!`
: `Free user limit 60 seconds!`
? `免费用户限制为${astrict}秒!`
: `Free user limit ${astrict} seconds!`
}} }}
</div> </div>
@@ -528,8 +528,8 @@
<img src="../../assets/img/tips.png" alt="" /> <img src="../../assets/img/tips.png" alt="" />
{{ {{
lanChange == "zh-cn" lanChange == "zh-cn"
? `免费用户限制为60秒!`
: `Free user limit 60 seconds!`
? `免费用户限制为${astrict}秒!`
: `Free user limit ${astrict} seconds!`
}} }}
</div> </div>
</p> </p>
@@ -628,8 +628,8 @@
<img src="../../assets/img/tips.png" alt="" /> <img src="../../assets/img/tips.png" alt="" />
{{ {{
lanChange == "zh-cn" lanChange == "zh-cn"
? `免费用户限制为60秒!`
: `Free user limit 60 seconds!`
? `免费用户限制为${astrict}秒!`
: `Free user limit ${astrict} seconds!`
}} }}
</div> </div>
<div v-if="musicTabActive == 2" class="uploadVideo"> <div v-if="musicTabActive == 2" class="uploadVideo">
@@ -1015,6 +1015,7 @@ function getImageBase64(blob) {
const title = const title =
lanChange.value == "zh-cn" ? ref("未定义标题") : ref("Undefined Title"); lanChange.value == "zh-cn" ? ref("未定义标题") : ref("Undefined Title");


const astrict=180 //限制时长
//#region 上传图片 //#region 上传图片
const imgUrl = ref(""); //图片回显路径 const imgUrl = ref(""); //图片回显路径
const imgData = ref(""); // 上传图片文件 const imgData = ref(""); // 上传图片文件
@@ -1299,11 +1300,11 @@ const startRecording = async () => {
clearInterval(getduration.value); clearInterval(getduration.value);
return; return;
} }
if (duration.value >= 60) {
if (duration.value >= astrict) {
ElMessage.error( ElMessage.error(
lanChange.value == "zh-cn" lanChange.value == "zh-cn"
? `免费用户录音时长限制为60秒!`
: `Free user recording duration is limited to 60 seconds!`
? `免费用户录音时长限制为${astrict}秒!`
: `Free user recording duration is limited to ${astrict} seconds!`
); );
clearInterval(getduration.value); clearInterval(getduration.value);
stopRecording(); stopRecording();
@@ -1397,7 +1398,7 @@ const handleFileChange = async () => {
// 进行大小时长限制 // 进行大小时长限制
await countAudioTime(audio2); await countAudioTime(audio2);
// 限制60秒 // 限制60秒
if (uploadAudioTime.value > 60) {
if (uploadAudioTime.value > astrict) {
ElMessage.error( ElMessage.error(
lanChange.value == "zh-cn" lanChange.value == "zh-cn"
? `上传音频大小或者长度超出限制,请重新上传` ? `上传音频大小或者长度超出限制,请重新上传`
@@ -1602,15 +1603,15 @@ async function saveOrUpdate(index, isSaveVideo) {
saveLoading.value = false; saveLoading.value = false;
return; return;
} }
if (res4.data.data > 60) {
if (res4.data.data > astrict) {
ElMessage.error( ElMessage.error(
lanChange.value == "zh-cn" lanChange.value == "zh-cn"
? `预计生成的视频时长约为${formatTime( ? `预计生成的视频时长约为${formatTime(
res4.data.data res4.data.data
)},免费用户生成视频时长为60秒,无法生成视频`
)},免费用户生成视频时长为${astrict}秒,无法生成视频`
: `The video generated is expected to be about ${formatTime( : `The video generated is expected to be about ${formatTime(
res4.data.data res4.data.data
)} long, and the free user-generated video is 60 seconds long and cannot be generated`
)} long, and the free user-generated video is ${astrict} seconds long and cannot be generated`
); );
createLoading.value = false; createLoading.value = false;
saveLoading.value = false; saveLoading.value = false;
@@ -1899,7 +1900,7 @@ async function uploadMusic() {
// 进行大小时长限制 // 进行大小时长限制
await countAudioTime(audio2); await countAudioTime(audio2);
// 限制60秒 // 限制60秒
if (uploadAudioTime.value > 60) {
if (uploadAudioTime.value > astrict) {
ElMessage.error( ElMessage.error(
lanChange.value == "zh-cn" lanChange.value == "zh-cn"
? `上传音频大小或者长度超出限制,请重新上传` ? `上传音频大小或者长度超出限制,请重新上传`


Loading…
Cancel
Save