mirror of
https://github.com/ProudMuBai/GoFilm.git
synced 2026-02-03 22:44:47 +08:00
ABS v1 test
This commit is contained in:
@@ -115,7 +115,7 @@ const nav = reactive({
|
||||
|
||||
// 获取站点信息
|
||||
const getBasicInfo = ()=>{
|
||||
ApiGet(`/manage/config/basic`).then((resp: any) => {
|
||||
ApiGet(`/config/basic`).then((resp: any) => {
|
||||
if (resp.code === 0) {
|
||||
data.site = resp.data
|
||||
} else {
|
||||
@@ -126,13 +126,9 @@ const getBasicInfo = ()=>{
|
||||
onMounted(() => {
|
||||
ApiGet('/navCategory').then((resp: any) => {
|
||||
if (resp.status === 'ok') {
|
||||
// nav.tv = resp.data.tv
|
||||
// nav.film = resp.data.film
|
||||
// nav.cartoon = resp.data.cartoon
|
||||
// nav.variety = resp.data.variety
|
||||
data.nav = resp.data
|
||||
} else {
|
||||
ElMessage.error({message: "请先输入影片名称关键字再进行搜索", duration: 1000})
|
||||
ElMessage.error({message: "导航分类信息获取失败", duration: 1000})
|
||||
}
|
||||
})
|
||||
getBasicInfo()
|
||||
|
||||
@@ -73,14 +73,14 @@
|
||||
<div class="module-heading">
|
||||
<p class=" play-module-title">播放列表</p>
|
||||
<div class="play-tab-group">
|
||||
<a href="javascript:;" :class="`play-tab-item ${data.currentTabIndex ==i ? 'tab-active':''}`"
|
||||
v-for="(item,i) in data.detail.playList" @click="changeTab(i)" >{{`播放地址${i+1}`}}</a>
|
||||
<a href="javascript:;" :class="`play-tab-item ${data.currentTabId == item.id ? 'tab-active':''}`"
|
||||
v-for="item in data.detail.list" @click="changeTab(item.id)" >{{ item.name }}</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="play-list">
|
||||
<div class="play-list-item" v-show="data.currentTabIndex == i" v-for="(l,i) in data.detail.playList">
|
||||
<a class="play-link" v-for="(item,index) in l" href="javascript:;"
|
||||
@click="play({source: i, episode: index})">{{ item.episode }}</a>
|
||||
<div class="play-list-item" v-show="data.currentTabId == item.id " v-for="item in data.detail.list">
|
||||
<a class="play-link" v-for="(v,i) in item.linkList" href="javascript:;"
|
||||
@click="play({source: item.id, episode: i})">{{ v.episode }}</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -136,11 +136,12 @@ const data = reactive({
|
||||
dbScore: '',
|
||||
hits: '',
|
||||
content: '',
|
||||
}
|
||||
},
|
||||
list: []
|
||||
},
|
||||
relate: [],
|
||||
loading: false,
|
||||
currentTabIndex: 0,
|
||||
currentTabId: '',
|
||||
})
|
||||
|
||||
// 对部分信息过长进行处理
|
||||
@@ -157,7 +158,7 @@ const handleLongText = (t: string): string => {
|
||||
onBeforeMount(() => {
|
||||
let link = router.currentRoute.value.query.link
|
||||
ApiGet('/filmDetail', {id: link}).then((resp: any) => {
|
||||
if (resp.status === "ok") {
|
||||
if (resp.code === 0) {
|
||||
data.detail = resp.data.detail
|
||||
// 去除影视简介中的无用内容和特殊标签格式等
|
||||
data.detail.name = data.detail.name.replace(/(~.*~)/g, '')
|
||||
@@ -166,12 +167,13 @@ onBeforeMount(() => {
|
||||
// 处理过长数据
|
||||
data.detail.descriptor.actor = handleLongText(data.detail.descriptor.actor)
|
||||
data.detail.descriptor.director = handleLongText(data.detail.descriptor.director)
|
||||
data.currentTabId = resp.data.detail.list[0].id
|
||||
data.loading = true
|
||||
} else {
|
||||
ElMessage({
|
||||
type: "error",
|
||||
dangerouslyUseHTMLString: true,
|
||||
message: resp.message,
|
||||
message: resp.msg,
|
||||
})
|
||||
}
|
||||
})
|
||||
@@ -179,12 +181,12 @@ onBeforeMount(() => {
|
||||
})
|
||||
|
||||
// 播放源切换
|
||||
const changeTab = (index:number)=>{
|
||||
data.currentTabIndex = index
|
||||
const changeTab = (id:string)=>{
|
||||
data.currentTabId = id
|
||||
}
|
||||
|
||||
// 选集播放点击事件
|
||||
const play = (change: { source: number, episode: number }) => {
|
||||
const play = (change: { source: string, episode: number }) => {
|
||||
router.push({path: `/play`, query: {id: `${router.currentRoute.value.query.link}`, ...change}})
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<template>
|
||||
<div class="container">
|
||||
<div class="content_item" v-for="item in data.info.content">
|
||||
<template v-if="item.nav.name !='综艺' & item.nav.name !='综艺片'">
|
||||
<template v-if="item.nav.show">
|
||||
<el-row class="row-bg cus_nav" justify="space-between">
|
||||
<el-col :span="12" class="title">
|
||||
<span :class="`iconfont ${item.nav.name.search('电影') != -1?'icon-film':item.nav.name.search('剧') != -1?'icon-tv':'icon-cartoon'}`"
|
||||
<span :class="`iconfont ${item.nav.name.search('电影') != -1?'icon-film':item.nav.name.search('剧') != -1?'icon-tv':item.nav.name.search('动漫')!= -1?'icon-cartoon':'icon-variety'}`"
|
||||
style="color: #79bbff;font-size: 32px;margin-right: 10px; line-height: 130%"/>
|
||||
<a :href="`/filmClassify?Pid=${item.nav.id}`">{{ item.nav.name }}</a>
|
||||
</el-col>
|
||||
|
||||
@@ -42,16 +42,14 @@
|
||||
<div class="module-heading">
|
||||
<p class=" play-module-title">播放列表</p>
|
||||
<div class="play-tab-group">
|
||||
<a href="javascript:;" :class="`play-tab-item ${data.currentTabIndex ==i ? 'tab-active':''}`"
|
||||
v-for="(item,i) in data.detail.playList" @click="changeTab(i)">{{ `播放地址${i + 1}` }}</a>
|
||||
<a href="javascript:;" :class="`play-tab-item ${data.currentTabId == item.id ? 'tab-active':''}`"
|
||||
v-for="item in data.detail.list" @click="changeTab(item.id)">{{ item.name }}</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="play-list">
|
||||
<div class="play-list-item" v-show="data.currentTabIndex == i" v-for="(l,i) in data.detail.playList">
|
||||
<a :class="`play-link ${item.link == data.current.link?'play-link-active':''}`" v-for="(item,index) in l"
|
||||
|
||||
href="javascript:;"
|
||||
@click="playChange({sourceIndex: i, episodeIndex: index, target: this})">{{ item.episode }}</a>
|
||||
<div class="play-list-item" v-show="data.currentTabId == item.id" v-for="item in data.detail.list">
|
||||
<a :class="`play-link ${v.link == data.current.link?'play-link-active':''}`" v-for="(v,i) in item.linkList"
|
||||
href="javascript:;" @click="playChange({sourceId: item.id, episodeIndex: i, target: this})">{{ v.episode }}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -85,8 +83,8 @@ import {VideoPlayer} from '@videojs-player/vue'
|
||||
import 'video.js/dist/video-js.css'
|
||||
|
||||
// 播放源切换事件
|
||||
const changeTab = (index: number) => {
|
||||
data.currentTabIndex = index
|
||||
const changeTab = (id: string) => {
|
||||
data.currentTabId = id
|
||||
}
|
||||
|
||||
// 播放页所需数据
|
||||
@@ -124,14 +122,14 @@ const data = reactive({
|
||||
dbScore: '',
|
||||
hits: '',
|
||||
content: '',
|
||||
}
|
||||
},
|
||||
list: [],
|
||||
},
|
||||
current: {index: 0, episode: '', link: ''},
|
||||
currentTabName: '',
|
||||
currentPlayFrom: 0,
|
||||
currentEpisode: 0,
|
||||
relate: [],
|
||||
currentTabIndex: 0,
|
||||
currentTabId: '', // 当前播放源ID
|
||||
// @videojs-player 播放属性设置
|
||||
autoplay: true,
|
||||
options: {
|
||||
@@ -142,40 +140,52 @@ const data = reactive({
|
||||
},
|
||||
})
|
||||
//
|
||||
const hasNext = computed(() => data.current.index != data.detail.playList[data.currentPlayFrom].length - 1)
|
||||
const hasNext = computed(() => {
|
||||
let flag = false
|
||||
data.detail.list.forEach((item:any)=>{
|
||||
if (data.currentTabId == item.id) {
|
||||
flag = data.current.index != item.linkList.length - 1
|
||||
}
|
||||
})
|
||||
return flag
|
||||
})
|
||||
|
||||
// 获取路由信息
|
||||
const router = useRouter()
|
||||
onBeforeMount(() => {
|
||||
let query = router.currentRoute.value.query
|
||||
ApiGet(`/filmPlayInfo`, {id: query.id, playFrom: query.source, episode: query.episode}).then((resp: any) => {
|
||||
if (resp.status === 'ok') {
|
||||
if (resp.code === 0) {
|
||||
data.detail = resp.data.detail
|
||||
data.current = {index: resp.data.currentEpisode, ...resp.data.current}
|
||||
data.currentPlayFrom = resp.data.currentPlayFrom
|
||||
// data.currentPlayFrom = resp.data.currentPlayFrom
|
||||
data.currentEpisode = resp.data.currentEpisode
|
||||
data.relate = resp.data.relate
|
||||
// 设置当前选中的播放源
|
||||
data.currentTabName = `tab-${query.source}`
|
||||
// 设置当前的视频播放url
|
||||
data.options.src = data.current.link
|
||||
// 设置当前播放源ID信息
|
||||
data.currentTabId = resp.data.currentPlayFrom
|
||||
data.loading = true
|
||||
} else {
|
||||
ElMessage.error("影片信息加载失败,请尝试刷新页面!!!")
|
||||
ElMessage.error({message: resp.msg})
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
// 点击播集数播放对应影片
|
||||
const playChange = (play: { sourceIndex: number, episodeIndex: number, target: any }) => {
|
||||
let currPlay = data.detail.playList[play.sourceIndex][play.episodeIndex]
|
||||
data.current = {index: play.episodeIndex, episode: currPlay.episode, link: currPlay.link}
|
||||
data.currentEpisode = play.episodeIndex
|
||||
data.options.src = currPlay.link
|
||||
data.options.title = data.detail.name + " " + currPlay.episode
|
||||
data.currentPlayFrom = play.sourceIndex
|
||||
data.currentTabIndex = play.sourceIndex
|
||||
|
||||
const playChange = (play: { sourceId: string, episodeIndex: number, target: any }) => {
|
||||
data.detail.list.forEach((item:any)=>{
|
||||
if (item.id == play.sourceId) {
|
||||
let currPlay =item.linkList[play.episodeIndex]
|
||||
data.current = {index: play.episodeIndex, episode: currPlay.episode, link: currPlay.link}
|
||||
data.currentEpisode = play.episodeIndex
|
||||
data.options.src = currPlay.link
|
||||
data.options.title = data.detail.name + " " + currPlay.episode
|
||||
data.currentTabId = play.sourceId
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// player相关事件
|
||||
@@ -212,10 +222,11 @@ const isAutoPlay = () => {
|
||||
}
|
||||
// 点击下一集按钮
|
||||
const playNext = () => {
|
||||
if (data.current.index == data.detail.playList[data.currentPlayFrom].length - 1) {
|
||||
// 如果不存在下一集信息则直接返回
|
||||
if (!hasNext.value) {
|
||||
return
|
||||
}
|
||||
playChange({sourceIndex: data.currentPlayFrom, episodeIndex: data.current.index + 1, target: ''})
|
||||
playChange({sourceId: data.currentTabId, episodeIndex: data.current.index + 1, target: ''})
|
||||
if (data.autoplay) {
|
||||
setTimeout(() => {
|
||||
document.getElementsByTagName("video")[0].play()
|
||||
|
||||
@@ -18,9 +18,7 @@ onMounted(()=>{
|
||||
|
||||
<style scoped>
|
||||
.container {
|
||||
//background: url("/src/assets/image/managebg.png");
|
||||
//width: 100vw;
|
||||
//height: 100vh;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -78,9 +78,7 @@ provide('collapse', {
|
||||
--el-table-border-color: #9b49e733;
|
||||
}
|
||||
|
||||
:deep(.el-table th) {
|
||||
//color: skyblue;
|
||||
}
|
||||
|
||||
|
||||
:deep(.el-radio-group) {
|
||||
--el-color-primary: #9b49e7;
|
||||
|
||||
@@ -37,6 +37,13 @@
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="grade" align="center" label="采集间隔">
|
||||
<template #default="scope">
|
||||
<el-tag disable-transitions type="success">
|
||||
{{scope.row.interval >0 ?`${scope.row.interval} ms`:`无限制` }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="采集方式">
|
||||
<template #default="scope">
|
||||
<el-select v-model="scope.row.cd" class="m-2" placeholder="Select" size="small">
|
||||
@@ -71,6 +78,11 @@
|
||||
<el-form-item label="接口地址">
|
||||
<el-input v-model="form.add.uri" placeholder="资源采集链接,本站只采集综合资源或m3u8资源"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="间隔时长">
|
||||
<el-tooltip class="box-item" effect="dark" content="单次采集请求的时间间隔, 单位/ms" placement="top">
|
||||
<el-input-number v-model="form.add.interval" :step="100" step-strictly />
|
||||
</el-tooltip>
|
||||
</el-form-item>
|
||||
<el-form-item label="接口类型">
|
||||
<el-radio-group v-model="form.add.resultModel">
|
||||
<el-radio :label="0">JSON</el-radio>
|
||||
@@ -98,6 +110,7 @@
|
||||
<el-form-item label="是否启用">
|
||||
<el-switch v-model="form.add.state" inline-prompt active-text="启用" inactive-text="禁用"/>
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
@@ -116,6 +129,11 @@
|
||||
<el-form-item label="接口地址">
|
||||
<el-input v-model="form.edit.uri" placeholder="资源采集链接,本站只采集综合资源或m3u8资源"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="间隔时长">
|
||||
<el-tooltip class="box-item" effect="dark" content="单次采集请求的时间间隔, 单位/ms" placement="top">
|
||||
<el-input-number v-model="form.edit.interval" :step="100" step-strictly />
|
||||
</el-tooltip>
|
||||
</el-form-item>
|
||||
<el-form-item label="接口类型">
|
||||
<el-radio-group v-model="form.edit.resultModel">
|
||||
<el-radio :label="0">JSON</el-radio>
|
||||
@@ -211,8 +229,8 @@ interface FilmSource {
|
||||
}
|
||||
|
||||
const form = reactive({
|
||||
add: {name: '', uri: '', resultModel: 0, grade: 1, collectType: 0, syncPictures: false, state: false,},
|
||||
edit: {id:'', name: '', uri: '', resultModel: 0, grade: 1, collectType: 0, syncPictures: false, state: false,},
|
||||
add: {name: '', uri: '', resultModel: 0, grade: 1, collectType: 0, syncPictures: false, state: false, interval: 0},
|
||||
edit: {id:'', name: '', uri: '', resultModel: 0, grade: 1, collectType: 0, syncPictures: false, state: false,interval:0},
|
||||
batch: {ids:[],time: 0},
|
||||
options:[]
|
||||
|
||||
@@ -352,7 +370,7 @@ const cancelDialog = ()=>{
|
||||
dialogV.editV = false
|
||||
dialogV.batchV = false
|
||||
// 还原表单状态
|
||||
form.add = {name: '', uri: '', resultModel: 0, grade: 1, collectType: 0, syncPictures: false, state: false,}
|
||||
form.add = {name: '', uri: '', resultModel: 0, grade: 1, collectType: 0, syncPictures: false, state: false, interval: 0}
|
||||
}
|
||||
|
||||
const getCollectList = ()=>{
|
||||
|
||||
@@ -7,31 +7,31 @@ import {ElementPlusResolver} from "unplugin-vue-components/resolvers";
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
// 本地测试环境
|
||||
// server: {
|
||||
// host: '0.0.0.0',
|
||||
// port: 3600,
|
||||
// proxy: {
|
||||
// "/api": {
|
||||
// target: `http://127.0.0.1:3601`,
|
||||
// changeOrigin: true, // 允许跨域
|
||||
// rewrite: path => path.replace(/^\/api/, '')
|
||||
// }
|
||||
// },
|
||||
// },
|
||||
|
||||
// nginx发布构建时使用此配置
|
||||
server: {
|
||||
host: 'localhost',
|
||||
host: '0.0.0.0',
|
||||
port: 3600,
|
||||
proxy: {
|
||||
"/api": {
|
||||
target: `http://localhost`,
|
||||
target: `http://127.0.0.1:3601`,
|
||||
changeOrigin: true, // 允许跨域
|
||||
rewrite: path => path.replace(/^\/api/,'')
|
||||
rewrite: path => path.replace(/^\/api/, '')
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
// nginx发布构建时使用此配置
|
||||
// server: {
|
||||
// host: 'localhost',
|
||||
// port: 3600,
|
||||
// proxy: {
|
||||
// "/api": {
|
||||
// target: `http://localhost`,
|
||||
// changeOrigin: true, // 允许跨域
|
||||
// rewrite: path => path.replace(/^\/api/,'')
|
||||
// }
|
||||
// },
|
||||
// },
|
||||
|
||||
plugins: [
|
||||
vue(),
|
||||
AutoImport({
|
||||
|
||||
Reference in New Issue
Block a user