mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-22 01:06:43 +08:00
172 lines
3.1 KiB
JavaScript
172 lines
3.1 KiB
JavaScript
// ai播放器相关
|
|
|
|
/**
|
|
*
|
|
selectAllLang: [
|
|
{
|
|
key: 'ZH_CN',
|
|
srclang: 'zh-CN',
|
|
label: '中文',
|
|
name: '中文',
|
|
},
|
|
{
|
|
key: 'EN_US',
|
|
srclang: 'en-US',
|
|
label: '英语',
|
|
name: 'English',
|
|
},
|
|
{
|
|
key: 'JA_JP',
|
|
srclang: 'ja-JP',
|
|
label: '日语',
|
|
name: '日本語',
|
|
},
|
|
{
|
|
key: 'KO_KR',
|
|
srclang: 'ko-KR',
|
|
label: '韩语',
|
|
name: '한국어',
|
|
},
|
|
{
|
|
key: 'FR_FR',
|
|
srclang: 'fr-FR',
|
|
label: '法语',
|
|
name: 'français',
|
|
},
|
|
{
|
|
key: 'DE_DE',
|
|
srclang: 'de-DE',
|
|
label: '德语',
|
|
name: 'Deutsch',
|
|
},
|
|
{
|
|
key: 'ES_ES',
|
|
srclang: 'es-ES',
|
|
label: '西班牙语',
|
|
name: 'español',
|
|
},
|
|
{
|
|
key: 'RU_RU',
|
|
srclang: 'ru-RU',
|
|
label: '俄语',
|
|
name: 'русский',
|
|
},
|
|
{
|
|
key: 'PT_BR',
|
|
srclang: 'pt-BR',
|
|
label: '葡萄牙语',
|
|
name: 'português',
|
|
},
|
|
{
|
|
key: 'IT_IT',
|
|
srclang: 'it-IT',
|
|
label: '意大利语',
|
|
name: 'italiano',
|
|
},
|
|
{
|
|
key: 'AR_SA',
|
|
srclang: 'ar-SA',
|
|
label: '阿拉伯语',
|
|
name: 'العربية',
|
|
},
|
|
{
|
|
key: 'TH_TH',
|
|
srclang: 'th-TH',
|
|
label: '泰语',
|
|
name: 'ไทย',
|
|
},
|
|
{
|
|
key: 'VI_VN',
|
|
srclang: 'vi-VN',
|
|
label: '越南语',
|
|
name: 'tiếng Việt',
|
|
},
|
|
{
|
|
key: 'ID_ID',
|
|
srclang: 'id-ID',
|
|
label: '印度尼西亚语',
|
|
name: 'Bahasa Indonesia',
|
|
},
|
|
{
|
|
key: 'HI_IN',
|
|
srclang: 'hi-IN',
|
|
label: '印地语',
|
|
name: 'हिन्दी',
|
|
}
|
|
], // 全部语言列表
|
|
*/
|
|
|
|
const state = {
|
|
selectAllLang: [
|
|
{
|
|
key: 'ZH_CN',
|
|
srclang: 'zh-CN',
|
|
label: '中文',
|
|
name: '中文',
|
|
},
|
|
{
|
|
key: 'EN_US',
|
|
srclang: 'en-US',
|
|
label: '英语',
|
|
name: 'English',
|
|
},
|
|
{
|
|
key: 'VI_VN',
|
|
srclang: 'vi-VN',
|
|
label: '越南语',
|
|
name: 'tiếng Việt',
|
|
},
|
|
{
|
|
key: 'ES_ES',
|
|
srclang: 'es-ES',
|
|
label: '西班牙语',
|
|
name: 'español',
|
|
},
|
|
], // 一期语言列表
|
|
selectableLang: [], // 可选语言列表+字幕信息
|
|
currentLang: '', // 当前选中语言
|
|
currentTime: -1, // 当前视频时间
|
|
courseInfo: {},
|
|
duration: 0, // 视频时长
|
|
}
|
|
|
|
const mutations = {
|
|
SET_currentLang: (state, lang) => {
|
|
state.currentLang = lang
|
|
},
|
|
SET_selectableLang: (state, list = []) => {
|
|
let selectableLang = []
|
|
list.forEach(item => {
|
|
let selectItem = state.selectAllLang.find(selectItem => selectItem.srclang === item.language)
|
|
if (selectItem) {
|
|
selectableLang.push({
|
|
...item,
|
|
...selectItem,
|
|
})
|
|
}
|
|
})
|
|
state.selectableLang = selectableLang
|
|
},
|
|
SET_currentTime: (state, time) => {
|
|
state.currentTime = time
|
|
},
|
|
SET_courseInfo: (state, info) => {
|
|
state.courseInfo = info
|
|
},
|
|
SET_duration: (state, duration) => {
|
|
state.duration = duration
|
|
},
|
|
}
|
|
|
|
const actions = {
|
|
|
|
}
|
|
|
|
export default {
|
|
namespaced: true,
|
|
state,
|
|
mutations,
|
|
actions
|
|
}
|
|
|