Let's use AI to Earn!
TypeScript auto-publishdouyindouyin-apielectron-appelectron-reactkuaishoukwaipublishedshipinhaotoolxiaohongshu
feat: 日历完善
gaoSir2a1c24724a25
diff --git a/.gitignore b/.gitignoreindex fd3dbb57..f6966153 100644--- a/.gitignore+++ b/.gitignore@@ -34,3 +34,5 @@ yarn-error.log*# typescript*.tsbuildinfonext-env.d.ts++certificates\ No newline at end of filediff --git a/.idea/.gitignore b/.idea/.gitignoredeleted file mode 100644index 10b731c5..00000000--- a/.idea/.gitignore+++ /dev/null@@ -1,5 +0,0 @@-# 默认忽略的文件-/shelf/-/workspace.xml-# 基于编辑器的 HTTP 客户端请求-/httpRequests/diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xmlnew file mode 100644index 00000000..9d4b216a--- /dev/null+++ b/.idea/codeStyles/Project.xml@@ -0,0 +1,94 @@+<component name="ProjectCodeStyleConfiguration">+ <code_scheme name="Project" version="173">+ <HTMLCodeStyleSettings>+ <option name="HTML_SPACE_INSIDE_EMPTY_TAG" value="true" />+ </HTMLCodeStyleSettings>+ <JSCodeStyleSettings version="0">+ <option name="FORCE_SEMICOLON_STYLE" value="true" />+ <option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />+ <option name="FORCE_QUOTE_STYlE" value="true" />+ <option name="ENFORCE_TRAILING_COMMA" value="Remove" />+ <option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />+ <option name="SPACES_WITHIN_IMPORTS" value="true" />+ </JSCodeStyleSettings>+ <TypeScriptCodeStyleSettings version="0">+ <option name="FORCE_SEMICOLON_STYLE" value="true" />+ <option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />+ <option name="FORCE_QUOTE_STYlE" value="true" />+ <option name="ENFORCE_TRAILING_COMMA" value="Remove" />+ <option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />+ <option name="SPACES_WITHIN_IMPORTS" value="true" />+ </TypeScriptCodeStyleSettings>+ <VueCodeStyleSettings>+ <option name="INTERPOLATION_NEW_LINE_AFTER_START_DELIMITER" value="false" />+ <option name="INTERPOLATION_NEW_LINE_BEFORE_END_DELIMITER" value="false" />+ </VueCodeStyleSettings>+ <codeStyleSettings language="CSS">+ <indentOptions>+ <option name="INDENT_SIZE" value="2" />+ <option name="CONTINUATION_INDENT_SIZE" value="4" />+ <option name="TAB_SIZE" value="2" />+ </indentOptions>+ </codeStyleSettings>+ <codeStyleSettings language="HTML">+ <option name="LINE_COMMENT_AT_FIRST_COLUMN" value="false" />+ <option name="BLOCK_COMMENT_AT_FIRST_COLUMN" value="false" />+ <option name="SOFT_MARGINS" value="80" />+ <indentOptions>+ <option name="INDENT_SIZE" value="2" />+ <option name="CONTINUATION_INDENT_SIZE" value="2" />+ <option name="TAB_SIZE" value="2" />+ </indentOptions>+ </codeStyleSettings>+ <codeStyleSettings language="JavaScript">+ <option name="BLOCK_COMMENT_AT_FIRST_COLUMN" value="false" />+ <option name="LINE_COMMENT_ADD_SPACE" value="false" />+ <option name="SOFT_MARGINS" value="80" />+ <indentOptions>+ <option name="INDENT_SIZE" value="2" />+ <option name="CONTINUATION_INDENT_SIZE" value="2" />+ <option name="TAB_SIZE" value="2" />+ </indentOptions>+ </codeStyleSettings>+ <codeStyleSettings language="LESS">+ <indentOptions>+ <option name="CONTINUATION_INDENT_SIZE" value="4" />+ <option name="TAB_SIZE" value="2" />+ </indentOptions>+ </codeStyleSettings>+ <codeStyleSettings language="Markdown">+ <indentOptions>+ <option name="INDENT_SIZE" value="2" />+ <option name="CONTINUATION_INDENT_SIZE" value="4" />+ <option name="TAB_SIZE" value="2" />+ </indentOptions>+ </codeStyleSettings>+ <codeStyleSettings language="SASS">+ <indentOptions>+ <option name="CONTINUATION_INDENT_SIZE" value="4" />+ <option name="TAB_SIZE" value="2" />+ </indentOptions>+ </codeStyleSettings>+ <codeStyleSettings language="SCSS">+ <indentOptions>+ <option name="CONTINUATION_INDENT_SIZE" value="4" />+ <option name="TAB_SIZE" value="2" />+ </indentOptions>+ </codeStyleSettings>+ <codeStyleSettings language="TypeScript">+ <option name="BLOCK_COMMENT_AT_FIRST_COLUMN" value="false" />+ <option name="SOFT_MARGINS" value="80" />+ <indentOptions>+ <option name="INDENT_SIZE" value="2" />+ <option name="CONTINUATION_INDENT_SIZE" value="2" />+ <option name="TAB_SIZE" value="2" />+ </indentOptions>+ </codeStyleSettings>+ <codeStyleSettings language="Vue">+ <option name="SOFT_MARGINS" value="80" />+ <indentOptions>+ <option name="CONTINUATION_INDENT_SIZE" value="2" />+ </indentOptions>+ </codeStyleSettings>+ </code_scheme>+</component>\ No newline at end of filediff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xmlnew file mode 100644index 00000000..79ee123c--- /dev/null+++ b/.idea/codeStyles/codeStyleConfig.xml@@ -0,0 +1,5 @@+<component name="ProjectCodeStyleConfiguration">+ <state>+ <option name="USE_PER_PROJECT_SETTINGS" value="true" />+ </state>+</component>\ No newline at end of filediff --git a/.idea/material_theme_project_new.xml b/.idea/material_theme_project_new.xmlindex 71f9e938..2f7ddf7a 100644--- a/.idea/material_theme_project_new.xml+++ b/.idea/material_theme_project_new.xml@@ -3,9 +3,7 @@<component name="MaterialThemeProjectNewConfig"><option name="metadata"><MTProjectMetadataState>- <option name="migrated" value="true" />- <option name="pristineConfig" value="false" />- <option name="userId" value="3bd64bd8:1912071e97e:-7ffe" />+ <option name="userId" value="5a44ed5:1979c884888:-7ffa" /></MTProjectMetadataState></option></component>diff --git a/.idea/workspace.xml b/.idea/workspace.xmlnew file mode 100644index 00000000..75860b4e--- /dev/null+++ b/.idea/workspace.xml@@ -0,0 +1,102 @@+<?xml version="1.0" encoding="UTF-8"?>+<project version="4">+ <component name="AutoImportSettings">+ <option name="autoReloadType" value="SELECTIVE" />+ </component>+ <component name="ChangeListManager">+ <list default="true" id="90ed3383-49aa-4e32-95a2-9f070c0da49b" name="更改" comment="">+ <change afterPath="$PROJECT_DIR$/.idea/codeStyles/Project.xml" afterDir="false" />+ <change afterPath="$PROJECT_DIR$/.idea/codeStyles/codeStyleConfig.xml" afterDir="false" />+ <change afterPath="$PROJECT_DIR$/src/app/[lng]/accounts/components/CalendarTiming/CalendarTimingItem/CalendarTimingItem.tsx" afterDir="false" />+ <change afterPath="$PROJECT_DIR$/src/app/[lng]/accounts/components/CalendarTiming/CalendarTimingItem/calendarTimingItem.module.scss" afterDir="false" />+ <change beforePath="$PROJECT_DIR$/.gitignore" beforeDir="false" afterPath="$PROJECT_DIR$/.gitignore" afterDir="false" />+ <change beforePath="$PROJECT_DIR$/.idea/.gitignore" beforeDir="false" />+ <change beforePath="$PROJECT_DIR$/.idea/material_theme_project_new.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/material_theme_project_new.xml" afterDir="false" />+ <change beforePath="$PROJECT_DIR$/package.json" beforeDir="false" afterPath="$PROJECT_DIR$/package.json" afterDir="false" />+ <change beforePath="$PROJECT_DIR$/src/app/[lng]/accounts/components/CalendarTiming/calendarTiming.module.scss" beforeDir="false" afterPath="$PROJECT_DIR$/src/app/[lng]/accounts/components/CalendarTiming/calendarTiming.module.scss" afterDir="false" />+ <change beforePath="$PROJECT_DIR$/src/app/[lng]/accounts/components/CalendarTiming/index.tsx" beforeDir="false" afterPath="$PROJECT_DIR$/src/app/[lng]/accounts/components/CalendarTiming/index.tsx" afterDir="false" />+ <change beforePath="$PROJECT_DIR$/src/app/[lng]/hot-content/page.tsx" beforeDir="false" afterPath="$PROJECT_DIR$/src/app/[lng]/hot-content/page.tsx" afterDir="false" />+ <change beforePath="$PROJECT_DIR$/src/app/i18n/locales/en/account.json" beforeDir="false" afterPath="$PROJECT_DIR$/src/app/i18n/locales/en/account.json" afterDir="false" />+ <change beforePath="$PROJECT_DIR$/src/app/i18n/locales/zh-CN/account.json" beforeDir="false" afterPath="$PROJECT_DIR$/src/app/i18n/locales/zh-CN/account.json" afterDir="false" />+ </list>+ <option name="SHOW_DIALOG" value="false" />+ <option name="HIGHLIGHT_CONFLICTS" value="true" />+ <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />+ <option name="LAST_RESOLUTION" value="IGNORE" />+ </component>+ <component name="FileTemplateManagerImpl">+ <option name="RECENT_TEMPLATES">+ <list>+ <option value="tsx组件模板" />+ </list>+ </option>+ </component>+ <component name="Git.Settings">+ <option name="PUSH_AUTO_UPDATE" value="true" />+ <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />+ </component>+ <component name="ProjectColorInfo">{+ "customColor": "",+ "associatedIndex": 0+}</component>+ <component name="ProjectId" id="2yuI7xRxgKTi9PWPJvL0MFi17ql" />+ <component name="ProjectLevelVcsManager">+ <ConfirmationsSetting value="2" id="Add" />+ </component>+ <component name="ProjectViewState">+ <option name="hideEmptyMiddlePackages" value="true" />+ <option name="showLibraryContents" value="true" />+ </component>+ <component name="PropertiesComponent">{+ "keyToString": {+ "ASKED_SHARE_PROJECT_CONFIGURATION_FILES": "true",+ "RunOnceActivity.ShowReadmeOnStart": "true",+ "SHARE_PROJECT_CONFIGURATION_FILES": "true",+ "git-widget-placeholder": "master",+ "ignore.virus.scanning.warn.message": "true",+ "node.js.detected.package.eslint": "true",+ "node.js.detected.package.tslint": "true",+ "node.js.selected.package.eslint": "(autodetect)",+ "node.js.selected.package.tslint": "(autodetect)",+ "nodejs_package_manager_path": "npm",+ "settings.editor.selected.configurable": "project.propVCSSupport.CommitDialog",+ "ts.external.directory.path": "E:\\project-dev\\web\\艺咖\\aitoearn-web\\node_modules\\typescript\\lib",+ "vue.rearranger.settings.migration": "true"+ }+}</component>+ <component name="ReactDesignerToolWindowState">+ <option name="myId2Visible">+ <map>+ <entry key="com.intellij.reactbuddy.reactComponents" value="false" />+ <entry key="com.intellij.reactbuddy.reactInspector" value="false" />+ <entry key="com.intellij.reactbuddy.storybook" value="false" />+ </map>+ </option>+ </component>+ <component name="SharedIndexes">+ <attachedChunks>+ <set>+ <option value="bundled-js-predefined-1d06a55b98c1-0b3e54e931b4-JavaScript-WS-241.18034.50" />+ </set>+ </attachedChunks>+ </component>+ <component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="应用程序级" UseSingleDictionary="true" transferred="true" />+ <component name="TaskManager">+ <task active="true" id="Default" summary="默认任务">+ <changelist id="90ed3383-49aa-4e32-95a2-9f070c0da49b" name="更改" comment="" />+ <created>1750677868216</created>+ <option name="number" value="Default" />+ <option name="presentableId" value="Default" />+ <updated>1750677868216</updated>+ <workItem from="1750677869133" duration="3204000" />+ </task>+ <servers />+ </component>+ <component name="TypeScriptGeneratedFilesManager">+ <option name="version" value="3" />+ </component>+ <component name="VcsManagerConfiguration">+ <option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT" value="false" />+ <option name="CHECK_NEW_TODO" value="false" />+ </component>+</project>\ No newline at end of filediff --git a/@types/resources.d.ts b/@types/resources.d.tsindex 5d40e3d6..3525ce97 100644--- a/@types/resources.d.ts+++ b/@types/resources.d.ts@@ -2,7 +2,8 @@ interface Resources {"account": {"title": "账户","describe": "账户页面",- "today": "今天"+ "today": "今天",+ "addPost": "添加帖子"},"common": {"profile": "个人中心",diff --git a/package.json b/package.jsonindex 196e22ba..dc4f6028 100644--- a/package.json+++ b/package.json@@ -6,7 +6,7 @@"postbuild": "next-sitemap","dev": "next dev -p 6060","dev:https": "next dev -p 6060 --experimental-https",- "build": "next build",+ "build": "tsc && next build","start": "next start","lint": "next lint","migrateToLocize": "locize migrate --project-id=01b2e5e8-6243-47d1-b36f-963dbb8bcae3 --api-key=c9805cd1-fd50-4d98-967a-383b39066de8 --path=./app/i18n/locales",diff --git a/src/app/[lng]/accounts/components/CalendarTiming/CalendarTimingItem/CalendarTimingItem.tsx b/src/app/[lng]/accounts/components/CalendarTiming/CalendarTimingItem/CalendarTimingItem.tsxnew file mode 100644index 00000000..a8a864db--- /dev/null+++ b/src/app/[lng]/accounts/components/CalendarTiming/CalendarTimingItem/CalendarTimingItem.tsx@@ -0,0 +1,69 @@+import { ForwardedRef, forwardRef, memo } from "react";+import styles from "./calendarTimingItem.module.scss";+import { DayCellContentArg } from "@fullcalendar/core";+import { Button } from "antd";+import { useTransClient } from "@/app/i18n/client";++export interface ICalendarTimingItemRef {}++export interface ICalendarTimingItemProps {+ arg: DayCellContentArg;+}++const CalendarTimingItem = memo(+ forwardRef(+ (+ { arg }: ICalendarTimingItemProps,+ ref: ForwardedRef<ICalendarTimingItemRef>,+ ) => {+ const { t } = useTransClient("account");+ // arg.date 是当前格子的日期,Date 类型+ const today = new Date();+ // 去掉时分秒,只比较年月日+ const argDate = new Date(+ arg.date.getFullYear(),+ arg.date.getMonth(),+ arg.date.getDate(),+ );+ const nowDate = new Date(+ today.getFullYear(),+ today.getMonth(),+ today.getDate(),+ );++ return (+ <div+ className={[+ styles.calendarTimingItem,+ argDate < nowDate ? styles.calendarTimingItemPast : "",+ ].join(" ")}+ >+ <div className="calendarTimingItem-top">+ <div className="calendarTimingItem-top-day">+ {arg.date.getDate()}+ </div>+ </div>++ {argDate >= nowDate && (+ <div className="calendarTimingItem-con">+ <Button size="small">+ <div className="calendarTimingItem-con-btn1">04:12 PM</div>+ <div className="calendarTimingItem-con-btn2">+ {t("addPost")}+ </div>+ </Button>+ <Button size="small">+ <div className="calendarTimingItem-con-btn1">05:34 PM</div>+ <div className="calendarTimingItem-con-btn2">+ {t("addPost")}+ </div>+ </Button>+ </div>+ )}+ </div>+ );+ },+ ),+);++export default CalendarTimingItem;diff --git a/src/app/[lng]/accounts/components/CalendarTiming/CalendarTimingItem/calendarTimingItem.module.scss b/src/app/[lng]/accounts/components/CalendarTiming/CalendarTimingItem/calendarTimingItem.module.scssnew file mode 100644index 00000000..b87693da--- /dev/null+++ b/src/app/[lng]/accounts/components/CalendarTiming/CalendarTimingItem/calendarTimingItem.module.scss@@ -0,0 +1,46 @@+.calendarTimingItem {+ box-sizing: border-box;+ padding: 10px;+ display: flex;+ flex-direction: column;+ height: 200px;+ font-weight: 600;+ :global {+ .calendarTimingItem-top {+ display: flex;+ justify-content: space-between;+ .calendarTimingItem-top-day {+ width: 24px;+ height: 24px;+ line-height: 24px;+ text-align: center;+ border-radius: 50%;+ margin-bottom: 3px;+ }+ }+ .calendarTimingItem-con {+ .calendarTimingItem-con-btn2 {+ display: none;+ }+ button {+ width: 100%;+ margin-bottom: 8px;+ font-size: 12px;+ padding: 0;+ height: 26px !important;+ &:hover {+ .calendarTimingItem-con-btn2 {+ display: block;+ }+ .calendarTimingItem-con-btn1 {+ display: none;+ }+ }+ }+ }+ }+}++.calendarTimingItemPast {+ background: var(--grayColor1);+}\ No newline at end of filediff --git a/src/app/[lng]/accounts/components/CalendarTiming/calendarTiming.module.scss b/src/app/[lng]/accounts/components/CalendarTiming/calendarTiming.module.scssindex f20d1b28..eba2b027 100644--- a/src/app/[lng]/accounts/components/CalendarTiming/calendarTiming.module.scss+++ b/src/app/[lng]/accounts/components/CalendarTiming/calendarTiming.module.scss@@ -10,10 +10,39 @@:global {.calendarTiming-toolbar {display: flex;- align-items: center;- margin-bottom: 10px;+ justify-content: space-between;h1 {- margin: 0 10px;+ margin: 0 15px 0 10px;+ font-size: 18px;+ }+ &-left, &-right {+ display: flex;+ align-items: center;+ margin-bottom: 10px;+ }+ &-right {++ }+ }+ .fc-daygrid-day.fc-day-today {+ background: transparent;+ .calendarTimingItem-day {+ background: var(--colorPrimary5);+ color: #fff;+ }+ }+ .fc-daygrid-day-frame {+ display: flex;+ .fc-daygrid-day-top {+ display: flex;+ flex: 1;+ .fc-daygrid-day-number {+ padding: 0;+ flex: 1;+ }+ }+ .fc-daygrid-day-events {+ display: none;}}.calendarTiming-calendar {diff --git a/src/app/[lng]/accounts/components/CalendarTiming/index.tsx b/src/app/[lng]/accounts/components/CalendarTiming/index.tsxindex 92b2e222..dd447a54 100644--- a/src/app/[lng]/accounts/components/CalendarTiming/index.tsx+++ b/src/app/[lng]/accounts/components/CalendarTiming/index.tsx@@ -12,17 +12,7 @@ import { DatesSetArg } from "@fullcalendar/core";import { Button } from "antd";import { LeftOutlined, RightOutlined } from "@ant-design/icons";import { useTransClient } from "@/app/i18n/client";--const events = [{ title: "Meeting", start: new Date() }];--function renderEventContent(eventInfo: any) {- return (- <>- <b>{eventInfo.timeText}</b>- <i>{eventInfo.event.title}</i>- </>- );-}+import CalendarTimingItem from "@/app/[lng]/accounts/components/CalendarTiming/CalendarTimingItem/CalendarTimingItem";export interface ICalendarTimingRef {}export interface ICalendarTimingProps {}@@ -81,12 +71,23 @@ const CalendarTiming = memo(return (<div className={styles.calendarTiming}><div className="calendarTiming-toolbar">- <Button type="text" icon={<LeftOutlined />} onClick={handlePrev} />- <Button type="text" icon={<RightOutlined />} onClick={handleNext} />- <h1>- {currentDate.getFullYear()}-{currentDate.getMonth() + 1}- </h1>- <Button onClick={handleToday}>{t("today")}</Button>+ <div className="calendarTiming-toolbar-left">+ <Button+ type="text"+ icon={<LeftOutlined />}+ onClick={handlePrev}+ />+ <Button+ type="text"+ icon={<RightOutlined />}+ onClick={handleNext}+ />+ <h1>+ {currentDate.getFullYear()}-{currentDate.getMonth() + 1}+ </h1>+ <Button onClick={handleToday}>{t("today")}</Button>+ </div>+ <div className="calendarTiming-toolbar-right"></div></div><CSSTransitionin={!animating}@@ -103,8 +104,9 @@ const CalendarTiming = memo(initialDate={currentDate}headerToolbar={false}stickyFooterScrollbar={true}- events={events}- eventContent={renderEventContent}+ dayCellContent={(arg) => {+ return <CalendarTimingItem arg={arg} />;+ }}datesSet={handleDatesSet}/></div>diff --git a/src/app/[lng]/hot-content/page.tsx b/src/app/[lng]/hot-content/page.tsxindex 886d8bd3..f15ce1d2 100644--- a/src/app/[lng]/hot-content/page.tsx+++ b/src/app/[lng]/hot-content/page.tsx@@ -1230,7 +1230,7 @@ const HotContentNew: React.FC = () => {onMsgTypeClick={handleMsgTypeClick}onHotContentClick={handleResetExpandedStates}onViralTitleCategorySelect={handleViralTitleCategorySelect}- getImageUrl={getImageUrl}+ // getImageUrl={getImageUrl}/><div className="main-content">{!expandedStates.topic && !expandedStates.hotEvent && !expandedStates.viralTitle && !expandedStates.talk && !expandedStates.hotPlatform ? (diff --git a/src/app/i18n/locales/en/account.json b/src/app/i18n/locales/en/account.jsonindex fa00500b..c92e40d9 100644--- a/src/app/i18n/locales/en/account.json+++ b/src/app/i18n/locales/en/account.json@@ -1,5 +1,6 @@{"title": "account","describe": "account Page",- "today": "Today"+ "today": "Today",+ "addPost": "Add a Post"}\ No newline at end of filediff --git a/src/app/i18n/locales/zh-CN/account.json b/src/app/i18n/locales/zh-CN/account.jsonindex 32a8d8ae..37970bd4 100644--- a/src/app/i18n/locales/zh-CN/account.json+++ b/src/app/i18n/locales/zh-CN/account.json@@ -1,5 +1,6 @@{"title": "账户","describe": "账户页面",- "today": "今天"+ "today": "今天",+ "addPost": "添加帖子"}\ No newline at end of file