Skip to content

Let's use AI to Earn!

style: 1

yikaJasonMic1d3a669d3848
diff --git a/electron/main/test/controller.ts b/electron/main/test/controller.ts
index 149d65d3..12643713 100644
--- a/electron/main/test/controller.ts
+++ b/electron/main/test/controller.ts
@@ -1,7 +1,7 @@
/*
* @Author: nevin
* @Date: 2025-01-20 22:02:54
- * @LastEditTime: 2025-02-24 14:31:25
+ * @LastEditTime: 2025-03-03 13:45:00
* @LastEditors: nevin
* @Description: Test test
*/
@@ -36,7 +36,8 @@ export class TestController {
'https://help-static-aliyun-doc.aliyuncs.com/assets/img/zh-CN/6069415171/p792953.png',
title: '元宵节快乐',
topics: ['元宵节'],
- timingTime: getNowTimeStamp() + '',
+ timingTime: getNowTimeStamp(),
+ visibility_type: 0,
},
() => {},
);
@@ -84,7 +85,8 @@ export class TestController {
cover: coverPath,
title: '元宵节快乐',
topics: ['元宵节'],
- timingTime: getNowTimeStamp() + '',
+ timingTime: getNowTimeStamp(),
+ visibility_type: 0,
},
() => {},
);
diff --git a/src/views/trending/index.tsx b/src/views/trending/index.tsx
index 3236d5d2..a6c2d808 100644
--- a/src/views/trending/index.tsx
+++ b/src/views/trending/index.tsx
@@ -348,76 +348,6 @@ const Trending: React.FC = () => {
}
};
- // 处理专题分类点击
- const handleTopicCategoryClick = async (category: string) => {
- setSelectedTopicCategory(category);
- setTopicLoading(true);
-
- try {
- // 获取子分类
- const subCategories = await platformApi.getSubCategories(category);
- setTopicSubCategories(subCategories);
-
- if (subCategories.length > 0) {
- const firstSubCategory = subCategories[0];
- setSelectedTopicSubCategory(firstSubCategory);
-
- // 获取专题内容
- const response = await platformApi.getAllTopics({
- category,
- subCategory: firstSubCategory,
- startTime: selectedDate,
- endTime: selectedDate,
- });
-
- console.log('------ response', response);
-
- setTopicContents(response.items || []);
- if (response.meta) {
- setTopicPagination({
- currentPage: response.meta.currentPage || 1,
- totalPages: response.meta.totalPages || 1,
- totalItems: response.meta.totalItems || 0,
- itemsPerPage: response.meta.itemsPerPage || 20,
- });
- }
- }
- } catch (error) {
- console.error('获取专题数据失败:', error);
- } finally {
- setTopicLoading(false);
- }
- };
-
- // 处理专题子分类点击
- const handleTopicSubCategoryClick = async (subCategory: string) => {
- setSelectedTopicSubCategory(subCategory);
- setTopicLoading(true);
-
- try {
- const response = await platformApi.getAllTopics({
- category: selectedTopicCategory,
- subCategory,
- startTime: selectedDate,
- endTime: selectedDate,
- });
-
- setTopicContents(response.items || []);
- if (response.meta) {
- setTopicPagination({
- currentPage: response.meta.currentPage || 1,
- totalPages: response.meta.totalPages || 1,
- totalItems: response.meta.totalItems || 0,
- itemsPerPage: response.meta.itemsPerPage || 20,
- });
- }
- } catch (error) {
- console.error('获取专题数据失败:', error);
- } finally {
- setTopicLoading(false);
- }
- };
-
return (
<>
<div className="flex h-full bg-gray-50">
@@ -497,43 +427,43 @@ const Trending: React.FC = () => {
try {
// 获取所有热点事件
- const hotTopicsData = await platformApi.getAllTopics({
- category: '体娱',
- });
+ const hotTopicsData = await platformApi.getAllTopics(
+ {},
+ );
console.log('------- sdasds', hotTopicsData);
console.log(JSON.stringify(hotTopicsData));
// 处理数据并显示
- if (hotTopicsData && hotTopicsData.length > 0) {
+ if (hotTopicsData && hotTopicsData.items.length > 0) {
// 将平台数据和话题数据整合
- const processedData = [];
- hotTopicsData.forEach((platformData) => {
- const platform = platformData.platform;
+ const processedData: any[] = [];
+ hotTopicsData.items.forEach((platformData) => {
+ // const platform = platformData.platform;
const topics = platformData.topics || [];
- topics.forEach((topic) => {
- processedData.push({
- id: topic._id,
- title: topic.title,
- content: topic.title,
- cover: platform.icon || '',
- category: platform.name,
- subCategory: '',
- createTime:
- topic.createTime || topic.fetchTime,
- url: topic.url,
- hotValue: topic.hotValue,
- rank: topic.rank,
- stats: {
- viewCount: topic.hotValue || 0,
- likeCount: 0,
- commentCount: 0,
- shareCount: 0,
- collectCount: 0,
- },
- });
- });
+ // topics.forEach((topic) => {
+ // processedData.push({
+ // id: topic._id,
+ // title: topic.title,
+ // content: topic.title,
+ // cover: platform.icon || '',
+ // category: platform.name,
+ // subCategory: '',
+ // createTime:
+ // topic.createTime || topic.fetchTime,
+ // url: topic.url,
+ // hotValue: topic.hotValue,
+ // rank: topic.rank,
+ // stats: {
+ // viewCount: topic.hotValue || 0,
+ // likeCount: 0,
+ // commentCount: 0,
+ // shareCount: 0,
+ // collectCount: 0,
+ // },
+ // });
+ // });
});
setTopicContents(processedData);