切换为英文
This commit is contained in:
parent
8dbc19250b
commit
7f2d980da6
@ -1,5 +1,5 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<html lang="zh_CN">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
|
@ -3,7 +3,9 @@
|
||||
<router-link to="/">Home</router-link> |
|
||||
<router-link to="/about">About</router-link>
|
||||
</div> -->
|
||||
<router-view/>
|
||||
<a-config-provider :locale="locale">
|
||||
<router-view/>
|
||||
</a-config-provider>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
import { defineComponent } from 'vue';
|
||||
@ -12,6 +14,8 @@ import store from './store';
|
||||
import { getValue } from './utils/common';
|
||||
import { provideI18n } from "@/utils/i18n"
|
||||
import i18ninit from "@/i18n/init"
|
||||
import enUS from 'ant-design-vue/es/locale/en_US';
|
||||
import zhCN from 'ant-design-vue/es/locale/zh_CN';
|
||||
|
||||
export default defineComponent({
|
||||
setup(){
|
||||
@ -22,6 +26,9 @@ export default defineComponent({
|
||||
}else{
|
||||
router.push("/")
|
||||
}
|
||||
return{
|
||||
locale: zhCN
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
@ -901,4 +901,20 @@ export async function usersig(userid: number) {
|
||||
return '';
|
||||
}
|
||||
return res.data;
|
||||
}
|
||||
|
||||
export async function liveinfo(id: number): Promise<any>{
|
||||
const liveinfo = (await get<LiveInfo>(`live/${id}`)).data;
|
||||
return {
|
||||
liveid: liveinfo.liveid,
|
||||
title: liveinfo.title,
|
||||
img: liveinfo.img,
|
||||
fileid: liveinfo.fileid,
|
||||
fileurl: liveinfo.fileurl,
|
||||
fileduration: liveinfo.fileduration,
|
||||
dateline: liveinfo.dateline,
|
||||
livetime: liveinfo.livetime,
|
||||
livenumber: liveinfo.livenumber,
|
||||
desc: liveinfo.desc
|
||||
}
|
||||
}
|
10
src/import-png.d.ts
vendored
10
src/import-png.d.ts
vendored
@ -1,4 +1,14 @@
|
||||
declare module "*.png" {
|
||||
const value: any;
|
||||
export default value;
|
||||
}
|
||||
|
||||
declare module "ant-design-vue/es/locale/en_US" {
|
||||
const value: any;
|
||||
export default value;
|
||||
}
|
||||
|
||||
declare module "ant-design-vue/es/locale/zh_CN" {
|
||||
const value: any;
|
||||
export default value;
|
||||
}
|
4
src/types/index.d.ts
vendored
4
src/types/index.d.ts
vendored
@ -93,4 +93,6 @@ export interface LivelistInfo {
|
||||
code: number;
|
||||
msg: string;
|
||||
total: number;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -75,7 +75,7 @@
|
||||
v-model:value="form.startTime"
|
||||
placeholder="请设置您的开始时间"
|
||||
/> -->
|
||||
<a-date-picker @change="startchange" placeholder="请设置您的开始时间" />
|
||||
<a-date-picker show-time :value="form.dateline" @change="startchange" placeholder="请设置您的开始时间" />
|
||||
</a-form-item>
|
||||
<a-form-item
|
||||
label="直播时长"
|
||||
@ -161,7 +161,8 @@ import RankList from "./RankList.vue";
|
||||
import { previewCover } from "@/utils/common";
|
||||
import { FromSend, ImgInfo } from "@/types/index";
|
||||
import { uploadflie } from "@/utils/vod";
|
||||
import { liveadd } from "@/api";
|
||||
import { liveadd, liveinfo } from "@/api";
|
||||
import { useRoute } from 'vue-router';
|
||||
|
||||
export default defineComponent({
|
||||
name: "ReleaseWebcast",
|
||||
@ -173,7 +174,7 @@ export default defineComponent({
|
||||
},
|
||||
setup() {
|
||||
// 表单数据
|
||||
const form = reactive({
|
||||
const form = ref({
|
||||
title: "",
|
||||
img: "",
|
||||
fileid: "",
|
||||
@ -255,7 +256,7 @@ export default defineComponent({
|
||||
* 表单提交
|
||||
*/
|
||||
|
||||
const subdata = reactive({
|
||||
const subdata = ref({
|
||||
title: "",
|
||||
img: "",
|
||||
fileid: "",
|
||||
@ -266,7 +267,12 @@ export default defineComponent({
|
||||
livenumber: "",
|
||||
desc: "",
|
||||
});
|
||||
|
||||
const id = useRoute().query.id
|
||||
if(id != null && typeof id == 'string'){
|
||||
liveinfo(parseInt(id)).then((res)=>{
|
||||
form.value = res;
|
||||
})
|
||||
}
|
||||
const onSubmit = (e: FromSend) => {
|
||||
e.preventDefault();
|
||||
validate()
|
||||
@ -281,7 +287,7 @@ export default defineComponent({
|
||||
console.log("error", err);
|
||||
});
|
||||
};
|
||||
const isEntitled: Ref<boolean> = ref(true);
|
||||
const isEntitled: Ref<boolean> = ref(false);
|
||||
/**
|
||||
* 隐藏无资格提示
|
||||
*/
|
||||
@ -296,7 +302,7 @@ export default defineComponent({
|
||||
function startchange(e: string): void {
|
||||
const month = new Date(e).getMonth()+1
|
||||
console.log(new Date(e).getFullYear()+"-"+month+'-'+new Date(e).getDate())
|
||||
form.dateline =
|
||||
form.value.dateline =
|
||||
new Date(e).getFullYear() +
|
||||
"-" +
|
||||
month +
|
||||
@ -324,7 +330,7 @@ export default defineComponent({
|
||||
videofile.value = file.file;
|
||||
videos.value[0].addEventListener("durationchange", () => {
|
||||
console.log(videos.value[0].duration);
|
||||
form.fileduration = videos.value[0].duration;
|
||||
form.value.fileduration = videos.value[0].duration;
|
||||
});
|
||||
const res = await uploadflie(file.file, (info: any) => {
|
||||
console.log(info);
|
||||
@ -332,8 +338,8 @@ export default defineComponent({
|
||||
});
|
||||
console.log(res);
|
||||
|
||||
form.fileid = res.fileId;
|
||||
form.fileurl = res.video.url;
|
||||
form.value.fileid = res.fileId;
|
||||
form.value.fileurl = res.video.url;
|
||||
}
|
||||
|
||||
async function uploadspic(file: AntUpload) {
|
||||
@ -345,7 +351,7 @@ export default defineComponent({
|
||||
|
||||
// picinfo.fileId=res.fileId
|
||||
// picinfo.url=res.video.url
|
||||
form.img = res.video.url;
|
||||
form.value.img = res.video.url;
|
||||
}
|
||||
|
||||
return {
|
||||
|
Loading…
Reference in New Issue
Block a user