// 全局音频背景播放状态管理模块 const audioModules = { namespaced: true, state: { show: false, //是否显示音频弹窗 list: [], //[{url:音频地址,time:音频时长,title:音频标题,}] activityId: 0, //当前是哪个报告的音频 活动的id reportId: 0, //文章的id indexId: 0, //素材库的id paused: true, //当前是否音频正在播放 true暂停状态 curTime: 0, //当前正在播放的音频播放的时间 activityTitle: "", multiple: 1, //倍数 parseIntShow: true, // isDragSlide: false, //是否在拖动进度条 isAudioEnded: false, // recordList: {}, //记录音频播放的数据 }, mutations: { addAudio(state, payload) { state.show = true; state.list = payload.list; state.recordList = payload.recordList; state.activityTitle = payload.activityTitle; state.activityId = payload.activityId || 0; state.reportId = payload.reportId || 0; state.indexId = payload.indexId || 0; }, // 音频状态 updateAudioPause(state, payload) { state.paused = payload; }, setMultiple(state, payload) { state.multiple = payload; }, // 更新音频播放进度 updateAudioTime(state, payload) { state.curTime = Number(payload); }, //删除当前音频播放 removeAudio(state, payload) { state.show = false; state.list = []; state.recordList = {}; state.activityId = 0; state.reportId = 0; state.indexId = 0; state.curTime = 0; state.paused = true; }, parseIntAudio(state, payload) { state.parseIntShow = payload; }, setSlide(state, payload) { state.isDragSlide = payload; }, setAudioEnd(state, payload) { state.isAudioEnded = payload; }, }, }; export default audioModules;