collect optimization

This commit is contained in:
mubai
2026-03-30 21:47:26 +08:00
parent 0d258e90bd
commit 8a6bc33cad
23 changed files with 827 additions and 354 deletions

View File

@@ -26,7 +26,7 @@
color: #67d9e8;
}
:deep(.btn-prev) {
:deep(.el-pagination .btn-prev) {
font-weight: bold;
width: 45px;
height: 45px;
@@ -35,7 +35,7 @@
border-radius: 50%;
}
:deep(.btn-next) {
:deep(.el-pagination .btn-next) {
font-weight: bold;
width: 45px;
height: 45px;
@@ -64,12 +64,12 @@
height: 35px;
}
:deep(.btn-prev) {
:deep(.el-pagination .btn-prev) {
width: 35px;
height: 35px;
}
:deep(.btn-next) {
:deep(.el-pagination .btn-next) {
width: 35px;
height: 35px;
}

View File

@@ -8,20 +8,20 @@
<h3>{{ data.detail.name }}</h3>
<ul class="tags">
<li style="margin: 2px 0">{{
data.detail.descriptor.classTag ? `${data.detail.descriptor.classTag}`.replaceAll(",", " | ") : '未知'
data.detail.classTag ? `${data.detail.classTag}`.replaceAll(",", " | ") : '未知'
}}
</li>
</ul>
<p><span>导演:</span> {{ data.detail.descriptor.director }}</p>
<p><span>主演:</span> {{ handleLongText(data.detail.descriptor.actor) }}</p>
<p><span>上映:</span> {{ data.detail.descriptor.releaseDate }}</p>
<p><span>地区:</span> {{ data.detail.descriptor.area }}</p>
<p v-if="data.detail.descriptor.remarks"><span>连载:</span>{{ data.detail.descriptor.remarks }}</p>
<!--<p><span>评分:</span><b id="score">{{ data.detail.descriptor.dbScore }}</b></p>-->
<p><span>导演:</span> {{ data.detail.director }}</p>
<p><span>主演:</span> {{ handleLongText(data.detail.actor) }}</p>
<p><span>上映:</span> {{ data.detail.releaseDate }}</p>
<p><span>地区:</span> {{ data.detail.area }}</p>
<p v-if="data.detail.remarks"><span>连载:</span>{{ data.detail.remarks }}</p>
<!--<p><span>评分:</span><b id="score">{{ data.detail.dbScore }}</b></p>-->
</div>
</div>
<div class="mt_content">
<p v-html="`${data.detail.descriptor.content}`.replaceAll('  ', '')"></p>
<p v-html="`${data.detail.content}`.replaceAll('  ', '')"></p>
</div>
</div>
<!-- pc端title-->
@@ -34,32 +34,33 @@
<el-icon>
<Promotion/>
</el-icon>
{{ data.detail.descriptor.cName }}
{{ data.detail.cName }}
</a>
</li>
<li v-if="data.detail.descriptor.classTag">
{{ `${data.detail.descriptor.classTag}`.replaceAll(",", "&emsp;") }}
<li v-if="data.detail.classTag">
{{ `${data.detail.classTag}`.replaceAll(",", "&emsp;") }}
</li>
<li>{{ data.detail.descriptor.year }}</li>
<li>{{ data.detail.descriptor.area }}</li>
<li>{{ data.detail.year }}</li>
<li>{{ data.detail.area }}</li>
</ul>
<p><span>导演:</span> {{ data.detail.descriptor.director }}</p>
<p><span>主演:</span> {{ data.detail.descriptor.actor }}</p>
<p><span>上映:</span> {{ data.detail.descriptor.releaseDate }}</p>
<p v-if="data.detail.descriptor.remarks"><span>连载:</span>{{ data.detail.descriptor.remarks }}</p>
<p><span>评分:</span><b id="score">{{ data.detail.descriptor.dbScore }}</b></p>
<p><span>导演:</span> {{ data.detail.director }}</p>
<p><span>主演:</span> {{ data.detail.actor }}</p>
<p><span>上映:</span> {{ data.detail.releaseDate }}</p>
<p v-if="data.detail.remarks"><span>连载:</span>{{ data.detail.remarks }}</p>
<p><span>评分:</span><b id="score">{{ data.detail.dbScore }}</b></p>
<div class="cus_wap">
<p style="min-width: 40px"><span>剧情:</span></p>
<p ref="textContent" class="text_content">
<el-button v-if="`${data.detail.descriptor.content}`.length > 140" class="multi_text"
<el-button v-if="`${data.detail.content}`.length > 140" class="multi_text"
style="color:#a574b7;"
@click="showContent(multiBtn.state)" link>{{ multiBtn.text }}
</el-button>
<span class="cus_info" v-html="data.detail.descriptor.content"></span>
<span class="cus_info" v-html="data.detail.content"></span>
</p>
</div>
<p>
<el-button type="warning" class="player" size="large" @click="play({episode:0,source:data.detail.list[0].id})" round>
<el-button type="warning" class="player" size="large" @click="play({episode:0,source:data.detail.list[0].id})"
round>
<el-icon>
<CaretRight/>
</el-icon>
@@ -69,12 +70,12 @@
</div>
<!--播放列表-->
<div class="play-module">
<div class="play-module-item" >
<div class="play-module-item">
<div class="module-heading">
<p class=" play-module-title">播放列表</p>
<div class="play-tab-group">
<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>
<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">
@@ -100,6 +101,7 @@ import {ApiGet} from "../../utils/request";
import {ElMessage} from 'element-plus'
import {Promotion, CaretRight} from "@element-plus/icons-vue";
import RelateList from "../../components/index/RelateList.vue";
// 获取路由对象
const router = useRouter()
const data = reactive({
@@ -113,29 +115,27 @@ const data = reactive({
DownFrom: '',
playList: [[]],
downloadList: '',
descriptor: {
subTitle: '',
cName: '',
enName: '',
initial: '',
classTag: '',
actor: '',
director: '',
writer: '',
blurb: '',
remarks: '',
releaseDate: '',
area: '',
language: '',
year: '',
state: '',
updateTime: '',
addTime: '',
dbId: '',
dbScore: '',
hits: '',
content: '',
},
subTitle: '',
cName: '',
enName: '',
initial: '',
classTag: '',
actor: '',
director: '',
writer: '',
blurb: '',
remarks: '',
releaseDate: '',
area: '',
language: '',
year: '',
state: '',
updateTime: '',
addTime: '',
dbId: '',
dbScore: '',
hits: '',
content: '',
list: []
},
relate: [],
@@ -155,9 +155,8 @@ const handleLongText = (t: string): string => {
}
// 播放源切换
const changeTab = (id:string)=>{
const changeTab = (id: string) => {
data.currentTabId = id
}
@@ -187,11 +186,11 @@ onBeforeMount(() => {
data.detail = resp.data.detail
// 去除影视简介中的无用内容和特殊标签格式等
data.detail.name = data.detail.name.replace(/(.*)/g, '')
data.detail.descriptor.content = data.detail.descriptor.content.replace(/(&.*;)|( )|(  )|(\n)|(<[^>]+>)/g, '')
data.detail.content = data.detail.content.replace(/(&.*;)|( )|(  )|(\n)|(<[^>]+>)/g, '')
data.relate = resp.data.relate
// 处理过长数据
data.detail.descriptor.actor = handleLongText(data.detail.descriptor.actor)
data.detail.descriptor.director = handleLongText(data.detail.descriptor.director)
data.detail.actor = handleLongText(data.detail.actor)
data.detail.director = handleLongText(data.detail.director)
data.currentTabId = resp.data.detail.list[0].id
data.loading = true
} else {
@@ -207,7 +206,6 @@ onBeforeMount(() => {
</script>
<!--移动端适配-->
<style scoped>
@media (max-width: 768px) {
@@ -284,6 +282,7 @@ onBeforeMount(() => {
width: 100%;
padding: 0 1%;
}
/*影片播放列表信息展示*/
/*顶部影片信息显示区域*/

View File

@@ -15,18 +15,18 @@
<div class="current_play_info">
<div class="play_info_left">
<h3 class="current_play_title"><a
:href="`/filmDetail?link=${data.detail.id}`">{{ data.detail.name }}</a>{{ data.current.episode }}</h3>
:href="`/filmDetail?link=${data.detail.mid}`">{{ data.detail.name }}</a>{{ data.current.episode }}</h3>
<div class="tags">
<a :href="`/filmClassifySearch?Pid=${data.detail.pid}&Category=${data.detail.cid}`">
<el-icon>
<Promotion/>
</el-icon>
{{ data.detail.descriptor.cName }}</a>
{{ data.detail.cName }}</a>
<span>{{
data.detail.descriptor.classTag ? data.detail.descriptor.classTag.replaceAll(',', '/') : '未知'
data.detail.classTag ? data.detail.classTag.replaceAll(',', '/') : '未知'
}}</span>
<span class="hidden-sm-and-down">{{ data.detail.descriptor.year }}</span>
<span class="hidden-sm-and-down">{{ data.detail.descriptor.area }}</span>
<span class="hidden-sm-and-down">{{ data.detail.year }}</span>
<span class="hidden-sm-and-down">{{ data.detail.area }}</span>
</div>
</div>
<div class="play_info_right">
@@ -103,6 +103,7 @@ const data = reactive({
loading: false,
detail: {
id: '',
mid: '',
cid: '',
pid: '',
name: '',
@@ -111,29 +112,27 @@ const data = reactive({
DownFrom: '',
playList: [[]],
downloadList: '',
descriptor: {
subTitle: '',
cName: '',
enName: '',
initial: '',
classTag: '',
actor: '',
director: '',
writer: '',
blurb: '',
remarks: '',
releaseDate: '',
area: '',
language: '',
year: '',
state: '',
updateTime: '',
addTime: '',
dbId: '',
dbScore: '',
hits: '',
content: '',
},
subTitle: '',
cName: '',
enName: '',
initial: '',
classTag: '',
actor: '',
director: '',
writer: '',
blurb: '',
remarks: '',
releaseDate: '',
area: '',
language: '',
year: '',
state: '',
updateTime: '',
addTime: '',
dbId: '',
dbScore: '',
hits: '',
content: '',
list: [],
},
current: {index: 0, episode: '', link: ''},
@@ -258,25 +257,25 @@ const saveFilmHisroy = () => {
// 处理播放历史要记录的影片相关信息
let player = document.getElementsByTagName("video")[0]
let history = cookieUtil.getCookie(COOKIE_KEY_MAP.FILM_HISTORY) ? JSON.parse(cookieUtil.getCookie(COOKIE_KEY_MAP.FILM_HISTORY)) : {}
let link = `/play?id=${data.detail.id}&source=${data.currentTabId}&episode=${data.current.index}&currentTime=${player.currentTime}`
let link = `/play?id=${data.detail.mid}&source=${data.currentTabId}&episode=${data.current.index}&currentTime=${player.currentTime}`
// 处理播放时长
let timeStamp = new Date().getTime()
let time = fmt.dateFormat(timeStamp)
let progress = `${fmt.secondToTime(player.currentTime)} / ${fmt.secondToTime(player.duration)}`
history[data.detail.id] = {
id: data.detail.id,
name: data.detail.name,
picture: data.detail.picture,
episode: data.current.episode,
time: time,
timeStamp: timeStamp,
source: data.currentTabId,
link: link,
currentTime: player.currentTime,
duration: player.duration,
progress: progress,
devices: global.isMobile
}
history[data.detail.mid] = {
id: data.detail.mid,
name: data.detail.name,
picture: data.detail.picture,
episode: data.current.episode,
time: time,
timeStamp: timeStamp,
source: data.currentTabId,
link: link,
currentTime: player.currentTime,
duration: player.duration,
progress: progress,
devices: global.isMobile
}
// 将历史记录添加到cookie中
cookieUtil.setCookie(COOKIE_KEY_MAP.FILM_HISTORY, JSON.stringify(history))
}
@@ -420,8 +419,8 @@ onBeforeMount(() => {
.tags a {
padding: 5px 10px;
/* background-color: rgba(155, 73, 231, 0.72);*/
background: linear-gradient( #9B49E7B8, #9B49E799);
/* background-color: rgba(155, 73, 231, 0.72);*/
background: linear-gradient(#9B49E7B8, #9B49E799);
color: #c4c2c2;
font-size: 13px;
border-radius: 6px;
@@ -513,7 +512,7 @@ onBeforeMount(() => {
.tags a {
padding: 5px 10px;
color: #c4c2c2;
background: linear-gradient( #9B49E7B8, #9B49E799);
background: linear-gradient(#9B49E7B8, #9B49E799);
font-size: 13px;
border-radius: 6px;
margin-right: 3px;

View File

@@ -65,7 +65,7 @@
<!--<el-table-column prop="subTitle" align="center" label="影片别名" />-->
<el-table-column prop="cName" align="center" label="所属分类">
<template #default="scope">
<el-tag type="warning" disable-transitions>{{ scope.row.cName }}</el-tag>
<el-tag type="warning" disable-transitions>{{ scope.row.cName?scope.row.cName:'暂无' }}</el-tag>
</template>
</el-table-column>
<!--<el-table-column prop="classTag" align="left" label="剧情标签" >-->

View File

@@ -1 +1,6 @@
/// <reference types="vite/client" />
declare module '*.vue' {
import type { DefineComponent } from 'vue'
const component: DefineComponent<{}, {}, any>
export default component
}