ios增加web版入口
This commit is contained in:
parent
600fa3434d
commit
88e406308c
25
app/page.jsx
25
app/page.jsx
|
@ -3,8 +3,8 @@
|
||||||
import React, { useState, useEffect } from "react";
|
import React, { useState, useEffect } from "react";
|
||||||
import InOtherApp from "@/components/InOtherApp";
|
import InOtherApp from "@/components/InOtherApp";
|
||||||
import Footer from "@/components/Footer";
|
import Footer from "@/components/Footer";
|
||||||
import Link from "next/link";
|
|
||||||
import IosInstallStepModal from "@/components/IosInstallStepModal/page";
|
import IosInstallStepModal from "@/components/IosInstallStepModal/page";
|
||||||
|
import { getCookie } from "cookies-next";
|
||||||
|
|
||||||
export default function Home() {
|
export default function Home() {
|
||||||
const [deviceType, setDeviceType] = useState("");
|
const [deviceType, setDeviceType] = useState("");
|
||||||
|
@ -154,7 +154,7 @@ export default function Home() {
|
||||||
<p className="mt-3 text-white text-sm font-normal">手机扫码下载</p>
|
<p className="mt-3 text-white text-sm font-normal">手机扫码下载</p>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div className="flex flex-col items-center">
|
<div className="flex flex-col items-center gap-2">
|
||||||
{deviceType !== "pc" && (
|
{deviceType !== "pc" && (
|
||||||
<div
|
<div
|
||||||
className="btn bg-gradient-to-r from-[#FF668B] to-[#FF66F0] rounded-full text-white text-lg font-medium w-64 h-14"
|
className="btn bg-gradient-to-r from-[#FF668B] to-[#FF66F0] rounded-full text-white text-lg font-medium w-64 h-14"
|
||||||
|
@ -173,16 +173,17 @@ export default function Home() {
|
||||||
安装
|
安装
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{deviceType !== "Android" && (
|
{deviceType === "ios" && (
|
||||||
<p className="mt-3 text-white text-sm font-normal">
|
<div
|
||||||
安装前请卸载旧版本,详情请
|
className="btn bg-[#FFFFFF1A] rounded-full text-white text-lg font-medium w-64 h-14"
|
||||||
<Link
|
onClick={() => {
|
||||||
className="link text-primary cursor-pointer"
|
const inviter = getCookie("inviter");
|
||||||
href="/doc/ioshowtoinstall"
|
const url = `https://app.tiefen.fun?inviter=${inviter}`;
|
||||||
>
|
window.location.href = url;
|
||||||
查看帮助
|
}}
|
||||||
</Link>
|
>
|
||||||
</p>
|
手机网页版
|
||||||
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -11,6 +11,20 @@ import { useRouter } from "next/navigation";
|
||||||
|
|
||||||
export default function Zone({ params }) {
|
export default function Zone({ params }) {
|
||||||
const router = useRouter();
|
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({});
|
const [data, setData] = useState({});
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
@ -53,18 +67,55 @@ export default function Zone({ params }) {
|
||||||
copy(
|
copy(
|
||||||
`【${data?.streamer_ext?.name}】『ID:${data?.streamer_ext?.user_id}』,复制此条消息,打开铁粉空间APP,查看详情https://tiefen.fun/zone/${data?.streamer_ext?.user_id}`
|
`【${data?.streamer_ext?.name}】『ID:${data?.streamer_ext?.user_id}』,复制此条消息,打开铁粉空间APP,查看详情https://tiefen.fun/zone/${data?.streamer_ext?.user_id}`
|
||||||
);
|
);
|
||||||
Modal.alert({
|
Modal.show(
|
||||||
showCloseButton: true,
|
deviceType === "ios"
|
||||||
confirmText: "前往下载",
|
? {
|
||||||
onConfirm: () => router.push("/"),
|
showCloseButton: true,
|
||||||
content: (
|
closeOnAction: true,
|
||||||
<div className="p-2">
|
actions: [
|
||||||
<p className="text-white text-base font-medium">
|
{
|
||||||
{`请打开或下载【铁粉空间】APP,根据APP内弹窗指引加入空间。如未弹出,请在APP搜索ID:${data?.streamer_ext?.user_id},加入空间。`}
|
key: "download",
|
||||||
</p>
|
text: "前往下载",
|
||||||
</div>
|
primary: true,
|
||||||
),
|
onClick: () => router.push("/"),
|
||||||
});
|
},
|
||||||
|
{
|
||||||
|
key: "web",
|
||||||
|
text: "手机网页版",
|
||||||
|
onClick: () =>
|
||||||
|
router.push(
|
||||||
|
`https://app.tiefen.fun?inviter=${data?.streamer_ext?.user_id}`
|
||||||
|
),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
content: (
|
||||||
|
<div className="p-2">
|
||||||
|
<p className="text-white text-base font-medium">
|
||||||
|
{`请打开或下载【铁粉空间】APP,根据APP内弹窗指引加入空间。如未弹出,请在APP搜索ID:${data?.streamer_ext?.user_id},加入空间。`}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
),
|
||||||
|
}
|
||||||
|
: {
|
||||||
|
showCloseButton: true,
|
||||||
|
closeOnAction: true,
|
||||||
|
actions: [
|
||||||
|
{
|
||||||
|
key: "download",
|
||||||
|
text: "前往下载",
|
||||||
|
primary: true,
|
||||||
|
onClick: () => router.push("/"),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
content: (
|
||||||
|
<div className="p-2">
|
||||||
|
<p className="text-white text-base font-medium">
|
||||||
|
{`请打开或下载【铁粉空间】APP,根据APP内弹窗指引加入空间。如未弹出,请在APP搜索ID:${data?.streamer_ext?.user_id},加入空间。`}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
),
|
||||||
|
}
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -50,10 +50,10 @@ export default function IosInstallStepModal({ isVisible, setIsVisible }) {
|
||||||
</svg>
|
</svg>
|
||||||
<div className="flex flex-col gap-1 mb-4">
|
<div className="flex flex-col gap-1 mb-4">
|
||||||
<p className="text-white text-center font-medium text-sm">
|
<p className="text-white text-center font-medium text-sm">
|
||||||
请等待安装完成,然后开始设置
|
安装前请先删除旧版APP
|
||||||
</p>
|
</p>
|
||||||
<p className="text-white text-center font-medium text-sm">
|
<p className="text-white text-center font-medium text-sm">
|
||||||
若安装后无法正常使用,请删除旧版APP
|
请等待安装完成,然后开始设置
|
||||||
</p>
|
</p>
|
||||||
<p className="text-white text-center font-medium text-sm">
|
<p className="text-white text-center font-medium text-sm">
|
||||||
请务必按以下步骤进行设置,详细
|
请务必按以下步骤进行设置,详细
|
||||||
|
|
Loading…
Reference in New Issue