|
@@ -3,7 +3,8 @@
|
|
|
<div class="swith">
|
|
|
<div class="title" @click="showLange = true">{{ langObjT[langType] }}</div>
|
|
|
<van-popup v-model:show="showLange" destroy-on-close round position="bottom">
|
|
|
- <van-picker :model-value="[langType]" :columns="langObj" @cancel="showLange = false" @confirm="langChange"/>
|
|
|
+ <van-picker :model-value="[langType]" :columns="langObj" @cancel="showLange = false"
|
|
|
+ @confirm="langChange" />
|
|
|
</van-popup>
|
|
|
</div>
|
|
|
<van-image style="width: 100%;" :src="soundbyteJpg" />
|
|
@@ -112,7 +113,6 @@ const isFile = () => {
|
|
|
return from.photo && from.photo.length;
|
|
|
};
|
|
|
const langChange = ({ selectedValues }) => {
|
|
|
-
|
|
|
langType.value = selectedValues[0];
|
|
|
showLange.value = false;
|
|
|
};
|
|
@@ -142,7 +142,7 @@ getJoinType().then((res) => {
|
|
|
})
|
|
|
})
|
|
|
|
|
|
-const filesize = () => showToast('超出文件大小限制');
|
|
|
+const filesize = () => showToast(lang[langType].fileSize);
|
|
|
const previewClick = () => {
|
|
|
let getUrl = null;
|
|
|
const file = from.photo[0].file;
|
|
@@ -168,7 +168,7 @@ const onConfirm = ({ selectedValues, selectedOptions }) => {
|
|
|
};
|
|
|
|
|
|
const beforeRead = () => {
|
|
|
- if (!isFile) showToast('请选择照片');
|
|
|
+ if (!isFile) showToast(lang[langType].changePhono);
|
|
|
const oriData = new FormData();
|
|
|
oriData.append('file', from.photo[0].file);
|
|
|
axios({
|
|
@@ -181,10 +181,11 @@ const beforeRead = () => {
|
|
|
})
|
|
|
.then(res => {
|
|
|
if (res.status !== 200 || res.data.code !== 0) {
|
|
|
- showToast('上传失败');
|
|
|
+ showToast(lang[langType].upFileError);
|
|
|
from.photoUrl = ''
|
|
|
return
|
|
|
}
|
|
|
+ showToast(lang[langType].upFileSusscess);
|
|
|
from.photoUrl = res.data.data
|
|
|
})
|
|
|
return true;
|
|
@@ -192,7 +193,7 @@ const beforeRead = () => {
|
|
|
|
|
|
// 选择权限范围
|
|
|
const onSubmit = () => {
|
|
|
- if (!isFile) showToast('请上传作品');
|
|
|
+ if (!isFile) showToast(lang[langType].selectFile);
|
|
|
saveData({
|
|
|
"name": from.name,
|
|
|
"photo": from.photoUrl,
|
|
@@ -204,7 +205,7 @@ const onSubmit = () => {
|
|
|
"participationType": from.cardType.join(','),
|
|
|
"remarks": from.message
|
|
|
}).then(() => {
|
|
|
- showToast('报名成功');
|
|
|
+ showToast(lang[langType].registration);
|
|
|
// 清空表单内容
|
|
|
from.name = '';
|
|
|
from.idCard = '';
|
|
@@ -216,7 +217,9 @@ const onSubmit = () => {
|
|
|
from.cardType = [];
|
|
|
from.photo = [];
|
|
|
from.message = '';
|
|
|
- })
|
|
|
+ }).catch(() => {
|
|
|
+ showToast(lang[langType].registrationError);
|
|
|
+ });
|
|
|
};
|
|
|
</script>
|
|
|
<style lang="scss">
|