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" && ( +

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

+ )} +
+
+
+ ); +}