From 2e278e2eadfb2f4268b9a8be270d8bee060b1671 Mon Sep 17 00:00:00 2001 From: mackt <1033530438@qq.com> Date: Thu, 21 Mar 2024 17:57:51 +0800 Subject: [PATCH] feat: add new component(download-card) --- public/img/download/logo_android.png | Bin 0 -> 498 bytes public/img/download/logo_apple.png | Bin 0 -> 544 bytes public/img/download/qrcode_android.svg | 9 +++++++ src/app/download/components/download-card.tsx | 23 +++++++++++++++++ src/app/download/page.tsx | 24 +++++++++++++++++- src/types/home.d.ts | 5 ++++ src/utils/download.ts | 9 ------- 7 files changed, 60 insertions(+), 10 deletions(-) create mode 100644 public/img/download/logo_android.png create mode 100644 public/img/download/logo_apple.png create mode 100644 public/img/download/qrcode_android.svg create mode 100644 src/app/download/components/download-card.tsx create mode 100644 src/types/home.d.ts delete mode 100644 src/utils/download.ts diff --git a/public/img/download/logo_android.png b/public/img/download/logo_android.png new file mode 100644 index 0000000000000000000000000000000000000000..a6256c0d98ffed9d6b53c31dcb3b17a6227da09b GIT binary patch literal 498 zcmV77^Mmzc6-*=xY~{Izl=LKy(hGV~FqIG}gFw2#X3L)` zHu`!;vDT48d*1v|d{KN;ob+{VrMb_t>tsFt;@=ed1C4PmCwJ?RP@dvvE4KhUp1^+%+_ zaY|J4>%UF0w-+)`;dA;(ceD+2qBGKy>w#|w30Mx%H;k^O0@9=Frmq4Iuq+$b&0Eh4 opPZTgB&AJWuYJ`f_a%Qw zY=wK}?r|*;1VIo4JrR)+^TceJErx^xo-lj)HJk!C*r}XbUVbx{snB6r^!2Wiw<3)1MW)mDq2h4D?3gu=Cq*lDg^ie$e@oG~Qa?YHx$eT; zm(F)n>A7Y-9RFv6KFE1Luagx6-iqFW8NrHF_w%l8n-rm5#FEeRCG35`g6O7ATaU0H z`MkF_hZVm0Qf%$vNxKHFVJm?rZ2{IBuN^#DZzZ%2@bq5_@cxFi1*EX$y~eZ!e8QG% z(-U~m7T~?e8d!+OK1f?Y0(&vz_CYZ$NIzSNpC2`5svTF8F0?{FVrH&Axk&-;M%=q! zH>AE;>H><}#TVF1VYzLWW_MUV)broBfU)GaixxKM13zdc-P?;*3#}<)F5Ss|2OpsY ze&~!ZuN8+9X3cyd?_BN|);(&uLEa`$xoygW@AIKn1vtf(yJN1Hj9Jw@;5we~3OVjR i6ZfzSK@bGNU-<@U_TY1jkc~b70000 + + + + + + + + diff --git a/src/app/download/components/download-card.tsx b/src/app/download/components/download-card.tsx new file mode 100644 index 0000000..a717390 --- /dev/null +++ b/src/app/download/components/download-card.tsx @@ -0,0 +1,23 @@ +import Image from 'next/image'; + +export default function Footer({ platform, iconUrl, qrCode }: DownloadQrcodeCard) { + console.log({ platform, iconUrl, qrCode }); + + return ( +
+ {/* 卡片 */} +
+ {`${platform}-icon`} +
+

下载应用

+

{platform}

+
+
+ + {/* 二维码 */} +
+ {/* {qrCode && {`${platform}-qrCode`}} */} +
+
+ ); +} diff --git a/src/app/download/page.tsx b/src/app/download/page.tsx index 0ba13de..47c73e5 100644 --- a/src/app/download/page.tsx +++ b/src/app/download/page.tsx @@ -2,6 +2,21 @@ import Image from 'next/image'; +import DownloadCard from './components/download-card'; + +const qrCodeList: Array = [ + { + platform: 'APP Store', + iconUrl: '/img/download/logo_apple.svg', + qrCode: '', + }, + { + platform: 'Android', + iconUrl: '/img/download/logo_android.svg', + qrCode: '/img/download/qrcode_android.svg', + }, +]; + export default function Download() { return (
@@ -11,12 +26,19 @@ export default function Download() {

为独立音乐,雀跃

/

独立 不独于世

+ + {/* APP二维码 */} +
+ {qrCodeList.map(({ platform, iconUrl, qrCode }) => ( + + ))} +
{/* 第二屏 */}
{/* 花体字-“我们回来了” */} - wx-share + back {/* 诗歌 */}

diff --git a/src/types/home.d.ts b/src/types/home.d.ts new file mode 100644 index 0000000..5c944b9 --- /dev/null +++ b/src/types/home.d.ts @@ -0,0 +1,5 @@ +declare interface DownloadQrcodeCard { + platform: 'APP Store' | 'Android'; + iconUrl: string; + qrCode: string; +} diff --git a/src/utils/download.ts b/src/utils/download.ts deleted file mode 100644 index 2ac6387..0000000 --- a/src/utils/download.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { Hosting } from '@/utils/ua'; - -// 下载 -export const download = () => { - const ua = window?.navigator?.userAgent?.toLowerCase(); - if (!Hosting.isWX(ua)) { - window.open('//cdn.indie.cn/release/queyue.apk', '__blank'); - } -};