|
|
@@ -37,7 +37,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- 视频列表 -->
|
|
|
- <div class="Box">
|
|
|
+ <div class="Box" v-if="lang.lang == 'cn'">
|
|
|
<div
|
|
|
class="video_box video_box2"
|
|
|
:class="{ 'selected': isVideoSelected(item) }"
|
|
|
@@ -72,6 +72,42 @@
|
|
|
</div>
|
|
|
<div v-if="data.length == 0" class="no_data">{{ lang.ssNoData }}</div>
|
|
|
</div>
|
|
|
+ <div class="Box" v-else>
|
|
|
+ <div
|
|
|
+ class="video_box video_box2"
|
|
|
+ :class="{ 'selected': isVideoSelected(item) }"
|
|
|
+ v-for="(item, index) in paginatedData"
|
|
|
+ :key="index"
|
|
|
+ @click="toggleVideoSelection(item)"
|
|
|
+ >
|
|
|
+ <div class="video-checkbox" @click.stop>
|
|
|
+ <el-checkbox
|
|
|
+ :value="isVideoSelected(item)"
|
|
|
+ @change="toggleVideoSelection(item)"
|
|
|
+ ></el-checkbox>
|
|
|
+ </div>
|
|
|
+ <span class="name" v-html="item.channel.title"></span>
|
|
|
+ <span class="detail">{{ item.description || '' }}</span>
|
|
|
+ <div class="video-info">
|
|
|
+ <span class="author">{{ lang.ssAut }}:{{ item.channel.title || '' }}</span>
|
|
|
+ <span class="duration">{{ lang.ssDuration }}:{{ item.length || '' }}</span>
|
|
|
+ </div>
|
|
|
+ <div class="tag" v-if="item.badges && typeof item.badges === 'string' && item.badges.split(',').length > 0">
|
|
|
+ <el-tooltip :content="badges" placement="top" effect="dark" v-for="(tag, index) in item.badges.split(',').slice(0, 5)" :key="index">
|
|
|
+ <span>{{ tag }}</span>
|
|
|
+ </el-tooltip>
|
|
|
+ </div>
|
|
|
+ <div class="external-link" @click.stop="openUrl(item.id)" :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>
|
|
|
+ <path d="M894.293 174.293a42.667 42.667 0 0 0-60.586 0L591.147 417.707a42.667 42.667 0 0 0 60.586 60.586L894.293 234.88a42.667 42.667 0 0 0 0-60.587z" fill="#909399" p-id="4994"></path>
|
|
|
+ </svg>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div v-if="data.length == 0" class="no_data">{{ lang.ssNoData }}</div>
|
|
|
+ </div>
|
|
|
+
|
|
|
<!-- 分页控件 -->
|
|
|
<div class="pagination-box" v-if="data.length > 0">
|
|
|
<el-button
|
|
|
@@ -198,10 +234,10 @@ export default {
|
|
|
this.ajax.post(`https://gpt4.cocorobo.cn/get_network_search`, {
|
|
|
engine: "youtubeNew",
|
|
|
keyword: msg,
|
|
|
- // page: 1,
|
|
|
- // page_size: 20,
|
|
|
+ page: 1,
|
|
|
+ page_size: 50,
|
|
|
order: this.navActive,
|
|
|
- // duration: 0,
|
|
|
+ duration: 0,
|
|
|
}).then(response => {
|
|
|
console.log(response);
|
|
|
// _this.data = [..._this.data,...response.data.FunctionResponse]
|
|
|
@@ -254,17 +290,18 @@ export default {
|
|
|
// 添加单个视频
|
|
|
addSingleVideo(item) {
|
|
|
const videoTitle = item.title.replace(/<[^>]*>?/gm, ''); // 移除HTML标签
|
|
|
+ let url = '';
|
|
|
if (this.lang.lang == 'cn') {
|
|
|
url = `//player.bilibili.com/player.html?isOutside=true&bvid=${item.bvid}`;
|
|
|
} else {
|
|
|
- url = 'https://www.youtube.com/embed/'+item.bvid;
|
|
|
+ url = 'https://www.youtube.com/embed/'+item.id;
|
|
|
}
|
|
|
const videoData = {
|
|
|
name: "链接",
|
|
|
title: item.title.replace(/<[^>]*>?/gm, ''),
|
|
|
url: url,
|
|
|
id: new Date().getTime(),
|
|
|
- bvid: item.bvid,
|
|
|
+ bvid: this.lang.lang == 'cn' ? item.bvid : item.id,
|
|
|
type: 75 // B站视频使用type 75
|
|
|
};
|
|
|
this.$emit('addVideo', videoData);
|
|
|
@@ -274,11 +311,21 @@ export default {
|
|
|
},
|
|
|
// 检查视频是否被选中
|
|
|
isVideoSelected(item) {
|
|
|
- return this.selectedVideos.some(v => v.bvid === item.bvid);
|
|
|
+ if (this.lang.lang == 'cn') {
|
|
|
+ return this.selectedVideos.some(v => v.bvid === item.bvid);
|
|
|
+ } else {
|
|
|
+ return this.selectedVideos.some(v => v.id === item.id);
|
|
|
+ }
|
|
|
},
|
|
|
// 切换视频选择状态
|
|
|
toggleVideoSelection(item) {
|
|
|
- const index = this.selectedVideos.findIndex(v => v.bvid === item.bvid);
|
|
|
+ let index = 0;
|
|
|
+ if (this.lang.lang == 'cn') {
|
|
|
+ index = this.selectedVideos.findIndex(v => v.bvid === item.bvid);
|
|
|
+ } else {
|
|
|
+ index = this.selectedVideos.findIndex(v => v.id === item.id);
|
|
|
+ }
|
|
|
+ // this.selectedVideos.findIndex(v => v.bvid === item.bvid);
|
|
|
if (index > -1) {
|
|
|
this.selectedVideos.splice(index, 1);
|
|
|
} else {
|
|
|
@@ -293,17 +340,18 @@ export default {
|
|
|
}
|
|
|
this.selectedVideos.forEach(video => {
|
|
|
const videoTitle = video.title.replace(/<[^>]*>?/gm, ''); // 移除HTML标签
|
|
|
+ let url = '';
|
|
|
if (this.lang.lang == 'cn') {
|
|
|
url = `//player.bilibili.com/player.html?isOutside=true&bvid=${video.bvid}`;
|
|
|
} else {
|
|
|
- url = 'https://www.youtube.com/embed/'+video.bvid;
|
|
|
+ url = 'https://www.youtube.com/embed/'+video.id;
|
|
|
}
|
|
|
const videoData = {
|
|
|
name: this.lang.ssLink,
|
|
|
title: video.title.replace(/<[^>]*>?/gm, ''),
|
|
|
url: url,
|
|
|
id: new Date().getTime(),
|
|
|
- bvid: video.bvid,
|
|
|
+ bvid: this.lang.lang == 'cn' ? video.bvid : video.id,
|
|
|
type: 75 // B站视频使用type 75
|
|
|
};
|
|
|
this.$emit('addVideo', videoData);
|