|
|
@@ -1,20 +1,20 @@
|
|
|
<template>
|
|
|
<el-dialog
|
|
|
- title="Bilibili视频检索"
|
|
|
+ :title="lang.ssBilibiliVideoSearch"
|
|
|
:visible.sync="dialogVisible"
|
|
|
:append-to-body="true"
|
|
|
width="660px"
|
|
|
:before-close="handleClose"
|
|
|
class="dialog_diy bilibili-search-dialog"
|
|
|
>
|
|
|
- <div style="box-sizing:border-box;padding:15px" v-loading="loading" element-loading-text="正在检索中,请稍等...">
|
|
|
+ <div style="box-sizing:border-box;padding:15px" v-loading="loading" :element-loading-text="lang.ssBilibiliVideoSearchLoading">
|
|
|
<!-- 搜索和筛选区域 -->
|
|
|
<div class="search-filter-box">
|
|
|
<div class="search-item">
|
|
|
<div class="search-input-wrapper">
|
|
|
<el-input
|
|
|
class="inputC"
|
|
|
- placeholder="搜索视频关键字(如需搜索多个可,隔开)"
|
|
|
+ :placeholder="lang.ssBilibiliVideoSearchKeyword"
|
|
|
v-model="searchKeyword"
|
|
|
@keyup.enter.native="handleSearch"
|
|
|
></el-input>
|
|
|
@@ -24,16 +24,16 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="filter-item">
|
|
|
- <el-select v-model="navActive" @change="navClick" placeholder="综合排序" class="sort-select">
|
|
|
- <el-option label="综合排序" :value="0"></el-option>
|
|
|
- <el-option label="最多播放" :value="1"></el-option>
|
|
|
- <el-option label="最新发布" :value="2"></el-option>
|
|
|
- <el-option label="最多弹幕" :value="3"></el-option>
|
|
|
- <el-option label="最多收藏" :value="4"></el-option>
|
|
|
+ <el-select v-model="navActive" @change="navClick" :placeholder="lang.ssBiSort" class="sort-select">
|
|
|
+ <el-option :label="lang.ssBiSort" :value="0"></el-option>
|
|
|
+ <el-option :label="lang.ssBiPlay" :value="1"></el-option>
|
|
|
+ <el-option :label="lang.ssBiRelease" :value="2"></el-option>
|
|
|
+ <el-option :label="lang.ssBitDanmaku" :value="3"></el-option>
|
|
|
+ <el-option :label="lang.ssBiFavorite" :value="4"></el-option>
|
|
|
</el-select>
|
|
|
</div>
|
|
|
<div class="add-item">
|
|
|
- <el-button type="primary" @click="batchAdd" :disabled="selectedVideos.length === 0">加入</el-button>
|
|
|
+ <el-button type="primary" @click="batchAdd" :disabled="selectedVideos.length === 0">{{ lang.ssAddbl }}</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- 视频列表 -->
|
|
|
@@ -54,15 +54,15 @@
|
|
|
<span class="name" v-html="item.title"></span>
|
|
|
<span class="detail">{{ item.description || '' }}</span>
|
|
|
<div class="video-info">
|
|
|
- <span class="author">作者:{{ item.author || '' }}</span>
|
|
|
- <span class="duration">时长:{{ item.duration || '' }}</span>
|
|
|
+ <span class="author">{{ lang.ssAut }}:{{ item.author || '' }}</span>
|
|
|
+ <span class="duration">{{ lang.ssDuration }}:{{ item.duration || '' }}</span>
|
|
|
</div>
|
|
|
<div class="tag" v-if="item.tag && typeof item.tag === 'string' && item.tag.split(',').length > 0">
|
|
|
<el-tooltip :content="tag" placement="top" effect="dark" v-for="(tag, index) in item.tag.split(',').slice(0, 5)" :key="index">
|
|
|
<span>{{ tag }}</span>
|
|
|
</el-tooltip>
|
|
|
</div>
|
|
|
- <div class="external-link" @click.stop="openUrl(item.bvid)" title="查看">
|
|
|
+ <div class="external-link" @click.stop="openUrl(item.bvid)" :title="lang.ssView">
|
|
|
<svg t="1755224440400" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4991" width="16" height="16">
|
|
|
<path d="M853.333 469.333a42.667 42.667 0 0 0-42.666 42.667v256a42.667 42.667 0 0 1-42.667 42.667H256a42.667 42.667 0 0 1-42.667-42.667V256a42.667 42.667 0 0 1 42.667-42.667h256a42.667 42.667 0 0 0 0-85.333H256a128 128 0 0 0-128 128v512a128 128 0 0 0 128 128h512a128 128 0 0 0 128-128V512a42.667 42.667 0 0 0-42.667-42.667z" fill="#909399" p-id="4992"></path>
|
|
|
<path d="M682.667 213.333h270.933v270.933a42.667 42.667 0 1 0 85.334 0V170.667a42.667 42.667 0 0 0-42.667-42.667H682.667a42.667 42.667 0 0 0 0 85.333z" fill="#909399" p-id="4993"></path>
|
|
|
@@ -70,7 +70,7 @@
|
|
|
</svg>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div v-if="data.length == 0" class="no_data">暂无数据</div>
|
|
|
+ <div v-if="data.length == 0" class="no_data">{{ lang.ssNoData }}</div>
|
|
|
</div>
|
|
|
<!-- 分页控件 -->
|
|
|
<div class="pagination-box" v-if="data.length > 0">
|
|
|
@@ -78,17 +78,17 @@
|
|
|
:disabled="currentPage === 1"
|
|
|
@click="prevPage"
|
|
|
size="small"
|
|
|
- >←上一页</el-button>
|
|
|
- <span class="page-info">第 {{ currentPage }} / {{ totalPages }} 页</span>
|
|
|
+ >←{{ lang.ssPrevPage }}</el-button>
|
|
|
+ <span class="page-info">{{ lang.ssPageInfo.replace('*', currentPage / totalPages) }}</span>
|
|
|
<el-button
|
|
|
:disabled="currentPage >= totalPages"
|
|
|
@click="nextPage"
|
|
|
size="small"
|
|
|
- >下一页→</el-button>
|
|
|
+ >{{ lang.ssNextPage }}→</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
- <el-button @click="handleClose">关 闭</el-button>
|
|
|
+ <el-button @click="handleClose">{{ lang.ssClose }}</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
</template>
|
|
|
@@ -165,7 +165,7 @@ export default {
|
|
|
// 搜索视频
|
|
|
async handleSearch() {
|
|
|
if (!this.searchKeyword) {
|
|
|
- this.$message.error("请输入关键字");
|
|
|
+ this.$message.error(this.lang.ssEnterKeyword);
|
|
|
return;
|
|
|
}
|
|
|
try {
|
|
|
@@ -189,7 +189,7 @@ export default {
|
|
|
} catch (error) {
|
|
|
console.log(error);
|
|
|
this.loading = false;
|
|
|
- this.$message.error("搜索失败,请重试");
|
|
|
+ this.$message.error(this.lang.ssSearchFail);
|
|
|
}
|
|
|
},
|
|
|
// Bilibili搜索接口
|
|
|
@@ -237,7 +237,7 @@ export default {
|
|
|
type: 75 // B站视频使用type 75
|
|
|
};
|
|
|
this.$emit('addVideo', videoData);
|
|
|
- this.$message.success('加入成功');
|
|
|
+ this.$message.success(this.lang.ssAddSuccess);
|
|
|
// 添加成功后关闭弹窗
|
|
|
this.handleClose();
|
|
|
},
|
|
|
@@ -257,13 +257,13 @@ export default {
|
|
|
// 批量添加选中的视频
|
|
|
batchAdd() {
|
|
|
if (this.selectedVideos.length === 0) {
|
|
|
- this.$message.warning('请先选择要添加的视频');
|
|
|
+ this.$message.warning(this.lang.ssSelectVideo);
|
|
|
return;
|
|
|
}
|
|
|
this.selectedVideos.forEach(video => {
|
|
|
const videoTitle = video.title.replace(/<[^>]*>?/gm, ''); // 移除HTML标签
|
|
|
const videoData = {
|
|
|
- name: "链接",
|
|
|
+ name: this.lang.ssLink,
|
|
|
title: video.title.replace(/<[^>]*>?/gm, ''),
|
|
|
url: `//player.bilibili.com/player.html?isOutside=true&bvid=${video.bvid}`,
|
|
|
id: new Date().getTime(),
|
|
|
@@ -272,7 +272,7 @@ export default {
|
|
|
};
|
|
|
this.$emit('addVideo', videoData);
|
|
|
});
|
|
|
- this.$message.success(`成功添加 ${this.selectedVideos.length} 个视频`);
|
|
|
+ this.$message.success(this.lang.ssAddSuccessVideo.replace('*', this.selectedVideos.length));
|
|
|
this.selectedVideos = [];
|
|
|
// 批量添加成功后关闭弹窗
|
|
|
this.handleClose();
|