diff --git a/app/page.jsx b/app/page.jsx
index 4b95110..efaa756 100644
--- a/app/page.jsx
+++ b/app/page.jsx
@@ -3,8 +3,8 @@
import React, { useState, useEffect } from "react";
import InOtherApp from "@/components/InOtherApp";
import Footer from "@/components/Footer";
-import Link from "next/link";
import IosInstallStepModal from "@/components/IosInstallStepModal/page";
+import { getCookie } from "cookies-next";
export default function Home() {
const [deviceType, setDeviceType] = useState("");
@@ -154,7 +154,7 @@ export default function Home() {
+
{deviceType !== "pc" && (
)}
- {deviceType !== "Android" && (
-
- 安装前请卸载旧版本,详情请
-
- 查看帮助
-
-
+ {deviceType === "ios" && (
+
{
+ const inviter = getCookie("inviter");
+ const url = `https://app.tiefen.fun?inviter=${inviter}`;
+ window.location.href = url;
+ }}
+ >
+ 手机网页版
+
)}
diff --git a/app/zone/[user_id]/page.jsx b/app/zone/[user_id]/page.jsx
index f42e82f..4e82895 100644
--- a/app/zone/[user_id]/page.jsx
+++ b/app/zone/[user_id]/page.jsx
@@ -11,6 +11,20 @@ import { useRouter } from "next/navigation";
export default function Zone({ params }) {
const router = useRouter();
+
+ 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 [data, setData] = useState({});
useEffect(() => {
@@ -53,18 +67,55 @@ export default function Zone({ params }) {
copy(
`【${data?.streamer_ext?.name}】『ID:${data?.streamer_ext?.user_id}』,复制此条消息,打开铁粉空间APP,查看详情https://tiefen.fun/zone/${data?.streamer_ext?.user_id}`
);
- Modal.alert({
- showCloseButton: true,
- confirmText: "前往下载",
- onConfirm: () => router.push("/"),
- content: (
-
-
- {`请打开或下载【铁粉空间】APP,根据APP内弹窗指引加入空间。如未弹出,请在APP搜索ID:${data?.streamer_ext?.user_id},加入空间。`}
-
-
- ),
- });
+ Modal.show(
+ deviceType === "ios"
+ ? {
+ showCloseButton: true,
+ closeOnAction: true,
+ actions: [
+ {
+ key: "download",
+ text: "前往下载",
+ primary: true,
+ onClick: () => router.push("/"),
+ },
+ {
+ key: "web",
+ text: "手机网页版",
+ onClick: () =>
+ router.push(
+ `https://app.tiefen.fun?inviter=${data?.streamer_ext?.user_id}`
+ ),
+ },
+ ],
+ content: (
+
+
+ {`请打开或下载【铁粉空间】APP,根据APP内弹窗指引加入空间。如未弹出,请在APP搜索ID:${data?.streamer_ext?.user_id},加入空间。`}
+
+
+ ),
+ }
+ : {
+ showCloseButton: true,
+ closeOnAction: true,
+ actions: [
+ {
+ key: "download",
+ text: "前往下载",
+ primary: true,
+ onClick: () => router.push("/"),
+ },
+ ],
+ content: (
+
+
+ {`请打开或下载【铁粉空间】APP,根据APP内弹窗指引加入空间。如未弹出,请在APP搜索ID:${data?.streamer_ext?.user_id},加入空间。`}
+
+
+ ),
+ }
+ );
};
return (
diff --git a/components/IosInstallStepModal/page.jsx b/components/IosInstallStepModal/page.jsx
index d977fc2..b5c8571 100644
--- a/components/IosInstallStepModal/page.jsx
+++ b/components/IosInstallStepModal/page.jsx
@@ -50,10 +50,10 @@ export default function IosInstallStepModal({ isVisible, setIsVisible }) {
- 请等待安装完成,然后开始设置
+ 安装前请先删除旧版APP
- 若安装后无法正常使用,请删除旧版APP
+ 请等待安装完成,然后开始设置
请务必按以下步骤进行设置,详细