Let's use AI to Earn!
TypeScript auto-publishdouyindouyin-apielectron-appelectron-reactkuaishoukwaipublishedshipinhaotoolxiaohongshu
tishi
bulaienaofutuojiesenzhang364e72cf7dfa
diff --git a/src/app/[lng]/accounts/accountCore.tsx b/src/app/[lng]/accounts/accountCore.tsxindex 0d600a27..92725958 100644--- a/src/app/[lng]/accounts/accountCore.tsx+++ b/src/app/[lng]/accounts/accountCore.tsx@@ -13,6 +13,9 @@ import { SocialAccount } from "@/api/types/account.type";import AllPlatIcon from "@/app/[lng]/accounts/components/CalendarTiming/AllPlatIcon";import { useTransClient } from "@/app/i18n/client";import { useUserStore } from "@/store/user";+import Image from "next/image";++import rightArrow from "@/assets/images/jiantou.png";interface AccountPageCoreProps {searchParams?: {@@ -43,6 +46,8 @@ export default function AccountPageCore({// 移动端下载提示弹窗开关const [showMobileDownload, setShowMobileDownload] = useState(false);+ // 微信浏览器提示弹窗开关+ const [showWechatBrowserTip, setShowWechatBrowserTip] = useState(false);useEffect(() => {accountInit();@@ -68,18 +73,39 @@ export default function AccountPageCore({}}, [searchParams]);+ /**+ * 检测是否为微信浏览器+ */+ const isWechatBrowser = () => {+ if (typeof window === "undefined") return false;+ const ua = window.navigator.userAgent.toLowerCase();+ return ua.includes('micromessenger');+ };+/*** 在移动端首次进入 accounts 页面时,展示下载提示弹窗* - 条件:屏幕宽度 <= 768* - 只在当前会话展示一次(使用 sessionStorage 标记)+ * - 如果是微信浏览器,先显示微信浏览器提示*/useEffect(() => {if (typeof window === "undefined") return;const isMobile = window.innerWidth <= 768;const hasShown = sessionStorage.getItem("accountsMobileDownloadShown");+ const hasShownWechatTip = sessionStorage.getItem("accountsWechatTipShown");+if (isMobile) {- setShowMobileDownload(true);- sessionStorage.setItem("accountsMobileDownloadShown", "1");+ // 如果是微信浏览器且未显示过微信提示,先显示微信提示+ if (isWechatBrowser() && !hasShownWechatTip) {+ setShowWechatBrowserTip(true);+ sessionStorage.setItem("accountsWechatTipShown", "1");+ } else if (!hasShown) {+ // 非微信浏览器或已显示过微信提示,显示下载提示+ setShowMobileDownload(true);+ sessionStorage.setItem("accountsMobileDownloadShown", "1");+ }++}}, []);@@ -88,6 +114,19 @@ export default function AccountPageCore({*/const closeMobileDownload = () => setShowMobileDownload(false);+ /**+ * 关闭微信浏览器提示弹窗+ */+ const closeWechatBrowserTip = () => {+ setShowWechatBrowserTip(false);+ // 关闭微信提示后,显示下载提示+ const hasShown = sessionStorage.getItem("accountsMobileDownloadShown");+ if (!hasShown) {+ setShowMobileDownload(true);+ sessionStorage.setItem("accountsMobileDownloadShown", "1");+ }+ };+/*** 生成下载链接(根据语言)*/@@ -114,6 +153,22 @@ export default function AccountPageCore({};})();+ const wechatBrowserTexts = (() => {+ const lang = userStore.lang;+ if (lang === "zh-CN") {+ return {+ title: "请在浏览器中打开",+ desc: "请点击右上角,通过浏览器打开",+ cta: "我知道了",+ };+ }+ return {+ title: "Please open in browser",+ desc: "Please click the top-right corner to open via browser",+ cta: "I understand",+ };+ })();+const handleAddAccountSuccess = (accountInfo: SocialAccount) => {setAddAccountModalOpen(false);// 可以在这里添加成功提示或其他逻辑@@ -176,6 +231,41 @@ export default function AccountPageCore({autoTriggerPlatform={targetPlatform}/>+ {/* 微信浏览器提示(遮罩 + 箭头指向右上角) */}+ {showWechatBrowserTip && (+ <>+ <div className={styles.mobileDownloadOverlay} onClick={closeWechatBrowserTip} />+ <Image src={rightArrow} alt="rightArrow" width={120} height={120} className={styles.rightArrow} />+ <div className={styles.wechatTipContainer}>+ <div className={styles.wechatTipContent}>+ <div className={styles.wechatTipTitle}>{wechatBrowserTexts.title}</div>+ <div className={styles.wechatTipSteps}>+ <div className={styles.wechatTipStep}>+ <span className={styles.stepNumber}>1</span>+ <span className={styles.stepText}>+ {userStore.lang === "zh-CN" ? "点击右上角的" : "Click the top-right corner's"}+ <span className={styles.dotsButton}>⋯</span>+ {userStore.lang === "zh-CN" ? "按钮" : "button"}+ </span>+ </div>+ <div className={styles.wechatTipStep}>+ <span className={styles.stepNumber}>2</span>+ <span className={styles.stepText}>+ {userStore.lang === "zh-CN" ? "选择" : "Select"}+ <span className={styles.browserButton}>🌐</span>+ {userStore.lang === "zh-CN" ? "在浏览器中打开" : "Open in browser"}+ </span>+ </div>+ </div>+ <button className={styles.wechatTipClose} onClick={closeWechatBrowserTip}>+ {wechatBrowserTexts.cta}+ </button>+ </div>++ </div>+ </>+ )}+{/* 移动端下载提示(遮罩 + 底部弹窗) */}{showMobileDownload && (<>diff --git a/src/app/[lng]/accounts/accounts.module.scss b/src/app/[lng]/accounts/accounts.module.scssindex 958f1ff7..341fae9d 100644--- a/src/app/[lng]/accounts/accounts.module.scss+++ b/src/app/[lng]/accounts/accounts.module.scss@@ -98,4 +98,139 @@@keyframes fadeIn {from { opacity: 0; }to { opacity: 1; }+}++// 微信浏览器提示:容器+.wechatTipContainer {+ position: fixed;+ inset: 0;+ z-index: 1001;+ display: flex;+ align-items: center;+ justify-content: center;+ pointer-events: none;+}++// 微信浏览器提示:内容区域+.wechatTipContent {+ background: rgba(255, 255, 255, 0.95);+ border-radius: 16px;+ padding: 24px;+ margin: 20px;+ max-width: 320px;+ box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);+ backdrop-filter: blur(10px);+ pointer-events: auto;+ animation: tipFadeIn 0.3s ease-out;+}++.wechatTipTitle {+ font-size: 18px;+ font-weight: 700;+ color: #111827;+ text-align: center;+ margin-bottom: 20px;+}++.wechatTipSteps {+ margin-bottom: 20px;+}++.wechatTipStep {+ display: flex;+ align-items: center;+ gap: 12px;+ margin-bottom: 12px;+ font-size: 14px;+ color: #374151;+ line-height: 1.5;+}++.stepNumber {+ background: #4f46e5;+ color: white;+ width: 24px;+ height: 24px;+ border-radius: 50%;+ display: flex;+ align-items: center;+ justify-content: center;+ font-size: 12px;+ font-weight: 600;+ flex-shrink: 0;+}++.stepText {+ flex: 1;+}++.dotsButton {+ background: #374151;+ color: white;+ padding: 2px 8px;+ border-radius: 4px;+ font-size: 12px;+ margin: 0 4px;+ display: inline-block;+}++.browserButton {+ background: #374151;+ color: white;+ padding: 2px 6px;+ border-radius: 4px;+ font-size: 12px;+ margin: 0 4px;+ display: inline-block;+}++.wechatTipClose {+ width: 100%;+ background: #4f46e5;+ color: white;+ border: none;+ padding: 12px;+ border-radius: 8px;+ font-weight: 600;+ cursor: pointer;+ transition: background 0.2s ease;++ &:hover {+ background: #4338ca;+ }+}++// 微信浏览器提示:箭头指向右上角+.rightArrow {+ position: fixed;+ top: 10%;+ right: 20px;+ z-index: 1002;+ pointer-events: none;+ background-color: #E9F6FF;+ animation: arrowPulse 2s ease-in-out infinite;+ border-radius: 50%;+ padding: 10px;+}++@keyframes arrowPulse {+ 0%, 100% {+ opacity: 0.8;+ transform: translateY(-50%) scale(1);+ }+ 50% {+ opacity: 1;+ transform: translateY(-50%) scale(1.1);+ }+}++@keyframes tipFadeIn {+ from {+ opacity: 0;+ transform: scale(0.9);+ }+ to {+ opacity: 1;+ transform: scale(1);+ }}\ No newline at end of filediff --git a/src/assets/images/jiantou.png b/src/assets/images/jiantou.pngnew file mode 100644index 00000000..63cf38a0Binary files /dev/null and b/src/assets/images/jiantou.png differ