congzc 1 year ago
parent
commit
616cfcad06
5 changed files with 67 additions and 26 deletions
  1. +1
    -0
      src/lang/package/en.ts
  2. +1
    -0
      src/lang/package/zh-cn.ts
  3. +6
    -4
      src/views/createVideo/index.vue
  4. +57
    -20
      src/views/myAccount/index.vue
  5. +2
    -2
      src/views/myCreating/index.vue

+ 1
- 0
src/lang/package/en.ts View File

@@ -128,6 +128,7 @@ export default {
submit:'Submit',
noListOrder: "No data available",
noListInvite: "No data, please invite more people to join us",
compressLoad:'Images are being compressed',
},

// 商店


+ 1
- 0
src/lang/package/zh-cn.ts View File

@@ -128,6 +128,7 @@ export default {
submit:'提交',
noListOrder: "暂无数据",
noListInvite: "没有数据哦,快去邀请更多人加入我们吧~",
compressLoad:'图片正在压缩',
},

// 商店


+ 6
- 4
src/views/createVideo/index.vue View File

@@ -251,6 +251,7 @@
<!-- <span>GPT</span> -->
<img src="../../assets/img/gpttotext.png" alt="" />
</div>

<el-tabs @tab-click="clickTab4" type="border-card" class="tabs">
<!-- ----------------------------- 1 -->
<el-tab-pane :label="$t('createVideo.typeScript')">
@@ -435,8 +436,8 @@
</div>
</div>
<!-- <div class="AudioBox" v-if="audioUrl">
<audio controls :src="audioUrl" id="uploadAudio"></audio>
</div> -->
<audio controls :src="audioUrl" id="uploadAudio"></audio>
</div> -->
<!-- 保存视频 -->
<el-button
@click="saveOrUpdate(2, 'saveVideo')"
@@ -630,8 +631,8 @@
/>
</div>
<!-- <div class="card4Btn" @click="copyAnswerContent">
{{ $t("createVideo.copy") }}
</div> -->
{{ $t("createVideo.copy") }}
</div> -->
<el-button color="#000" @click="copyAnswerContent">
{{ $t("createVideo.copy") }}
</el-button>
@@ -2151,6 +2152,7 @@ onUnmounted(() => {
min-height: 100%;
padding: 20px 20px 0px 20px;
border-radius: 20px;
position: relative;

.card1 {
.text {


+ 57
- 20
src/views/myAccount/index.vue View File

@@ -175,10 +175,18 @@
<el-row>
<el-col :span="4"> {{ $t("public.avatar") }}: </el-col>
<el-col :span="20">
<div class="dialogAvatar">
<input accept="image/*" type="file" @change="chooseImg" />
<div class="add">+</div>
<img v-if="dialogAvatarUrl" :src="dialogAvatarUrl" alt="" />
<div class="flex">
<div class="dialogAvatar">
<input accept="image/*" type="file" @change="chooseImg" />
<div class="add">+</div>
<img v-if="dialogAvatarUrl" :src="dialogAvatarUrl" alt="" />
</div>
<div class="compressLoadBox" v-if="compressImgLoadIng">
<el-icon class="is-loading">
<i-ep-Loading />
</el-icon>
<div class="tips">{{ $t("account.compressLoad") }}</div>
</div>
</div>
</el-col>
</el-row>
@@ -239,23 +247,36 @@ function resetPassWord() {
router.push({ name: "login", query: { type: 4 } });
}
// 选择图片

const compressImgLoadIng = ref(false);
async function chooseImg(e) {
if (e.target.files[0]) {
dialogAvatarUrl.value = null;
dialogAvatarData.value = null;
// 压缩配置
const options = {
maxSizeMB: 2, // 最大压缩大小为 2MB
useWebWorker: false, // 使用 Web Worker 进行压缩,提高性能
};
const compressedFile = await imageCompression(e.target.files[0], options);
dialogAvatarUrl.value = URL.createObjectURL(compressedFile);
dialogAvatarData.value = compressedFile;
// 不压缩图片
// dialogAvatarUrl.value = e.target.files[0];
// dialogAvatarData.value = e.target.files[0];
} else {
return;
try {
if (e.target.files[0]) {
dialogAvatarUrl.value = null;
dialogAvatarData.value = null;
compressImgLoadIng.value = true;
// 压缩配置
const options = {
maxSizeMB: 2, // 最大压缩大小为 2MB
useWebWorker: false, // 使用 Web Worker 进行压缩,提高性能
};
const compressedFile = await imageCompression(e.target.files[0], options);
dialogAvatarUrl.value = URL.createObjectURL(compressedFile);
dialogAvatarData.value = compressedFile;
compressImgLoadIng.value = false;
// 不压缩图片
// dialogAvatarUrl.value = URL.createObjectURL(e.target.files[0]);
// dialogAvatarData.value = e.target.files[0];
} else {
return;
}
} catch (error) {
ElMessage.error(
lanChange.value == "zh-cn"
? `上传失败,请稍后重试`
: `Upload failure. Please try again later`
);
compressImgLoadIng.value = false;
}
}
const submitUserInfoLoading = ref(false);
@@ -271,6 +292,7 @@ async function submitUserInfo() {
name: userNameinput.value,
avatarUrl: res1.data.url,
};

try {
const res2 = await updUserInfoApi(data);
ElMessage.success(
@@ -888,6 +910,21 @@ function routerTo(url) {
transition: all 0.3s;
}
}
.compressLoadBox {
// align-items: center;
padding-top: 40px;
text-align: center;
flex: 1;
.el-icon {
font-size: 20px;
color: #909393;
}
.tips {
// display: inline-block;
flex: 1;
line-height: 50px;
}
}
}
// 公共类名
.bigWord {


+ 2
- 2
src/views/myCreating/index.vue View File

@@ -135,10 +135,10 @@
<div v-else class="insteadVideo">
{{ $t("myCreating." + presentItem.statusName + "Text") }}

<p v-if="lanChange == 'zh-cn'">
<p v-if="lanChange == 'zh-cn' && presentItem.videoStatus == 3">
错误原因: {{ presentItem.videoMsg }}
</p>
<p v-if="lanChange == 'en'">
<p v-if="lanChange == 'en' && presentItem.videoStatus == 3">
Error cause: {{ presentItem.videoMsg }}
</p>
<!-- <span v-if="presentItem.videoStatus == 3">{{


Loading…
Cancel
Save