From 1a89fc7d6e3b22d9e54cb889355d55fe3f881631 Mon Sep 17 00:00:00 2001 From: yezian Date: Thu, 25 Jan 2024 02:47:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=B8=BB=E6=92=AD=E4=B8=93?= =?UTF-8?q?=E5=B1=9E=E7=9A=84=E4=B8=8B=E8=BD=BD=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/download/[user_id]/page.jsx | 148 ++++++++++++++++++++++++++++++++ 1 file changed, 148 insertions(+) create mode 100644 app/download/[user_id]/page.jsx diff --git a/app/download/[user_id]/page.jsx b/app/download/[user_id]/page.jsx new file mode 100644 index 0000000..99cf95d --- /dev/null +++ b/app/download/[user_id]/page.jsx @@ -0,0 +1,148 @@ +"use client"; + +import Link from "next/link"; +import React, { useState, useEffect } from "react"; +import InOtherApp from "@/components/InOtherApp"; +import Image from "next/image"; +import download_lefttop from "@/public/images/download_lefttop.png"; +import download_righttop from "@/public/images/download_righttop.png"; +import download_rightmedium from "@/public/images/download_rightmedium.png"; +import download_leftbottom from "@/public/images/download_leftbottom.png"; +import download_rightbottom from "@/public/images/download_rightbottom.png"; +import slogan from "@/public/images/slogan.png"; +import qrcode from "@/public/images/qrcode.png"; + +export default function Download({ params }) { + const [deviceType, setDeviceType] = useState(""); + useEffect(() => { + const userAgent = navigator.userAgent; + //区分设备类型 + if (/Android/i.test(userAgent)) { + setDeviceType("Android"); + } else if (/iPhone|iPad|iPod/i.test(userAgent)) { + setDeviceType("ios"); + } else { + setDeviceType("pc"); + } + }, []); + + //点下载在剪贴板写入主播邀请信息 + const copyInviter = async () => { + try { + await navigator.clipboard.writeText( + `复制此条消息,打开铁粉空间APP,查看详情https://tiefen.fun/${params.user_id}` + ); + } catch (error) { + console.error("复制到剪贴板时出现错误:", error); + } + }; + + return ( +
+ +
+ + + + + +
+
+ + {deviceType === "pc" && ( +
+ +

+ 立即下载 +

+
+ + + +

Android

+
+
+
+

+ 扫描下方二维码 +

+
+ + + + +

ios

+
+
+
+ )} +
+ + {deviceType === "pc" && ( +

手机扫码下载

+ )} +
+
+ {deviceType !== "pc" && ( + <> + + 安装 + + + )} + {deviceType !== "Android" && ( +

+ 安装遇到困难,请 + + 查看帮助 + +

+ )} +
+
+
+ ); +}