修改样式
This commit is contained in:
parent
0339587d23
commit
a19c17170a
|
@ -150,7 +150,7 @@ body{
|
|||
height:32px;
|
||||
}
|
||||
.adm-image-viewer-slides .adm-image-viewer-slide{
|
||||
margin-right: 0;
|
||||
/* margin-right: 0; */
|
||||
}
|
||||
|
||||
.videoMask{
|
||||
|
@ -233,4 +233,8 @@ body{
|
|||
height: max-content;
|
||||
width: max-content;
|
||||
border-radius: 0.25rem;
|
||||
}
|
||||
|
||||
.photos-bodyBox{
|
||||
width: 100vw;
|
||||
}
|
|
@ -365,14 +365,14 @@ const LoginBtn = ({ loginInfo, setLoginInfo, type, handleSubmit }) => {
|
|||
<span className="text-[#FFFFFF80] font-medium text-xs ml-2">
|
||||
我已阅读并同意
|
||||
<span
|
||||
onClick={() => router.push(`/doc/useragreement`)}
|
||||
onClick={() => router.push(`webView/${encodeURIComponent("/doc/useragreement")}`)}
|
||||
className="text-[#FF669E] text-xs"
|
||||
>
|
||||
《用户协议》
|
||||
</span>
|
||||
、
|
||||
<span
|
||||
onClick={() => router.push(`/doc/useragreement`)}
|
||||
onClick={() => router.push(`webView/${encodeURIComponent("/doc/privatypolicy")}`)}
|
||||
className="text-[#FF669E] text-xs"
|
||||
>
|
||||
《隐私政策》
|
||||
|
|
|
@ -39,7 +39,7 @@ export default function AboutUs() {
|
|||
<ul>
|
||||
<li
|
||||
className="flex justify-between items-center p-3"
|
||||
onClick={() => router.push(`/doc/useragreement`)}
|
||||
onClick={() => router.push(`webView/${encodeURIComponent("/doc/useragreement")}`)}
|
||||
>
|
||||
<div className="flex items-center">
|
||||
<FontAwesomeIcon
|
||||
|
@ -57,7 +57,7 @@ export default function AboutUs() {
|
|||
</li>
|
||||
<li
|
||||
className="flex justify-between items-center p-3"
|
||||
onClick={() => router.push(`/doc/privatypolicy`)}
|
||||
onClick={() => router.push(`webView/${encodeURIComponent("/doc/privatypolicy")}`)}
|
||||
>
|
||||
<div className="flex items-center">
|
||||
<FontAwesomeIcon
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
"use client";
|
||||
|
||||
import React, { useEffect, useRef, useState } from "react";
|
||||
import { Image, Divider } from "antd-mobile";
|
||||
import { Image, Divider, Toast } from "antd-mobile";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||
import {
|
||||
|
@ -11,12 +11,40 @@ import {
|
|||
faPrint,
|
||||
faDollar,
|
||||
} from "@fortawesome/free-solid-svg-icons";
|
||||
import baseRequest from "@/utils/baseRequest";
|
||||
import { get, save } from "@/utils/storeInfo";
|
||||
import require from "@/utils/require";
|
||||
export default function Wallet() {
|
||||
const tokenCache = get("token");
|
||||
const temToken = encodeURIComponent(tokenCache);
|
||||
const mobilePhone = get("mobile_phone");
|
||||
const base = baseRequest();
|
||||
const router = useRouter();
|
||||
const [visible, setVisible] = useState(false);
|
||||
const [data, setData] = useState("");
|
||||
// 获取屏幕高度
|
||||
// const scrollHeight = 600;
|
||||
useEffect(() => {}, []);
|
||||
useEffect(() => {
|
||||
getData()
|
||||
}, []);
|
||||
const getData = async () => {
|
||||
try {
|
||||
//获取账号基本信息
|
||||
const data =
|
||||
await require("POST", "/api/account/list_by_mid", null, true);
|
||||
if (data.ret === -1) {
|
||||
Toast.show({
|
||||
icon: "fail",
|
||||
content: data.msg,
|
||||
position: "top",
|
||||
});
|
||||
return;
|
||||
}
|
||||
save("account", data.data.account);
|
||||
setData(data.data.account);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
};
|
||||
return (
|
||||
<div className="">
|
||||
<div className="p-4 fixed top-0 z-10 w-full">
|
||||
|
@ -41,7 +69,7 @@ export default function Wallet() {
|
|||
width={48}
|
||||
height={48}
|
||||
/>
|
||||
<p className="text-2xl font-semibold text-white">0</p>
|
||||
<p className="text-2xl font-semibold text-white">{data?.gold_num || 0}</p>
|
||||
<p className="text-sm text-white">金币</p>
|
||||
</div>
|
||||
<Divider
|
||||
|
@ -55,19 +83,25 @@ export default function Wallet() {
|
|||
width={48}
|
||||
height={48}
|
||||
/>
|
||||
<p className="text-2xl font-semibold text-white">0</p>
|
||||
<p className="text-2xl font-semibold text-white">{data?.diamond_num || 0}</p>
|
||||
<p className="text-sm text-white">钻石</p>
|
||||
</div>
|
||||
</div>
|
||||
<div className="relative px-4">
|
||||
<div className="absolute top-8 left-0 w-full rounded-2xl px-4 bg-[#13121F]">
|
||||
<div
|
||||
// onPress={() =>
|
||||
// navigation.navigate("WebWithHeader", {
|
||||
// title: "充值中心",
|
||||
// uri: process.env.EXPO_PUBLIC_WEB_URL + "/pay",
|
||||
// })
|
||||
// }
|
||||
onClick={() =>
|
||||
// navigation.navigate("WebWithHeader", {
|
||||
// title: "充值中心",
|
||||
// uri: process.env.EXPO_PUBLIC_WEB_URL + "/pay",
|
||||
// })
|
||||
|
||||
router.replace(
|
||||
process.env.NEXT_PUBLIC_WEB_URL +
|
||||
"/pay?base=" +
|
||||
encodeURIComponent(JSON.stringify(base))
|
||||
)
|
||||
}
|
||||
className="flex justify-between items-center py-4 w-full"
|
||||
>
|
||||
<div className="flex-row items-center">
|
||||
|
@ -81,13 +115,10 @@ export default function Wallet() {
|
|||
充值
|
||||
</span>
|
||||
</div>
|
||||
<FontAwesomeIcon
|
||||
icon={faAngleRight}
|
||||
size="xl"
|
||||
/>
|
||||
<FontAwesomeIcon icon={faAngleRight} size="xl" />
|
||||
</div>
|
||||
<div
|
||||
// onPress={() =>
|
||||
// onClick={() =>
|
||||
// navigation.navigate("WebWithHeader", {
|
||||
// title: "收支明细",
|
||||
// uri: process.env.EXPO_PUBLIC_WEB_URL + "/bill/recharge",
|
||||
|
@ -110,17 +141,14 @@ export default function Wallet() {
|
|||
收支明细
|
||||
</span>
|
||||
</div>
|
||||
<FontAwesomeIcon
|
||||
icon={faAngleRight}
|
||||
size="xl"
|
||||
/>
|
||||
<FontAwesomeIcon icon={faAngleRight} size="xl" />
|
||||
</div>
|
||||
<div
|
||||
// onPress={() =>
|
||||
// Linking.openURL(
|
||||
// `${process.env.EXPO_PUBLIC_WEB_URL}/withdrawal?mid=${data?.mid}&mobile_phone=${tokenAndMobilePhone?.mobile_phone}&token=${tokenAndMobilePhone?.token}`
|
||||
// )
|
||||
// }
|
||||
onClick={() =>
|
||||
router.replace(
|
||||
`/webView/${encodeURIComponent(`withdrawal?mid=${data?.mid}&mobile_phone=${mobilePhone}&token=${temToken}`)}`
|
||||
)
|
||||
}
|
||||
className="flex justify-between items-center py-4"
|
||||
>
|
||||
<div className="flex-row items-center">
|
||||
|
@ -134,10 +162,7 @@ export default function Wallet() {
|
|||
提现
|
||||
</span>
|
||||
</div>
|
||||
<FontAwesomeIcon
|
||||
icon={faAngleRight}
|
||||
size="xl"
|
||||
/>
|
||||
<FontAwesomeIcon icon={faAngleRight} size="xl" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -22,6 +22,7 @@ import AddWeChat from "@/components/AddWeChat";
|
|||
import SeeTiefen from "@/components/SeeTiefen";
|
||||
import DefaultMask from "@/components/DefaultMask";
|
||||
import { getSpaceData, getStreamerInfo } from "@/api/space";
|
||||
import baseRequest from "@/utils/baseRequest";
|
||||
const anchors = [
|
||||
window.innerHeight - 280,
|
||||
window.innerHeight - 280,
|
||||
|
@ -29,6 +30,7 @@ const anchors = [
|
|||
];
|
||||
|
||||
export default function PersonSpace() {
|
||||
const base = baseRequest();
|
||||
const router = useRouter();
|
||||
const { id } = useParams();
|
||||
const contentBox = useRef();
|
||||
|
@ -192,7 +194,8 @@ export default function PersonSpace() {
|
|||
ct: streamerInfo?.streamer_ext?.ct,
|
||||
user_id: streamerInfo?.streamer_ext?.user_id,
|
||||
name: streamerInfo?.streamer_ext?.name,
|
||||
avatar: streamerInfo?.streamer_ext?.cover?.images[0]?.urls[0],
|
||||
avatar:
|
||||
streamerInfo?.streamer_ext?.cover?.images[0]?.urls[0],
|
||||
})
|
||||
)
|
||||
)
|
||||
|
@ -305,7 +308,16 @@ export default function PersonSpace() {
|
|||
onClick={() => {
|
||||
streamerInfo?.is_superfanship_unlocked === 1
|
||||
? setCurrentKey("chaofen")
|
||||
: router.push("/pay");
|
||||
: router.push(
|
||||
"/webView/" +
|
||||
encodeURIComponent(
|
||||
"/zone/pay/" +
|
||||
data?.id +
|
||||
"/h5_zone_superfanship/0" +
|
||||
"?base=" +
|
||||
encodeURIComponent(base)
|
||||
)
|
||||
);
|
||||
}}
|
||||
>
|
||||
<div className="w-9 h-9 flex items-center justify-center bg-[#1d1d1d71] rounded-full mb-1">
|
||||
|
|
|
@ -12,7 +12,9 @@ import {
|
|||
} from "@fortawesome/free-solid-svg-icons";
|
||||
import AddWeChat from "@/components/AddWeChat";
|
||||
import { getStreamerInfo } from "@/api/space";
|
||||
import baseRequest from "@/utils/baseRequest";
|
||||
export default function PersonSpaceIntroduce() {
|
||||
const base = baseRequest();
|
||||
const router = useRouter();
|
||||
const contentBox = useRef();
|
||||
// 获取屏幕高度
|
||||
|
@ -294,9 +296,14 @@ export default function PersonSpaceIntroduce() {
|
|||
// router.push("/pay");
|
||||
router.push(
|
||||
process.env.NEXT_PUBLIC_WEB_URL +
|
||||
"/zone/pay/" +
|
||||
data?.id +
|
||||
"/h5_zone_admission/0"
|
||||
"/webView/" +
|
||||
encodeURIComponent(
|
||||
"/zone/pay/" +
|
||||
data?.id +
|
||||
"/h5_zone_admission/0" +
|
||||
"?base=" +
|
||||
encodeURIComponent(base)
|
||||
)
|
||||
);
|
||||
}
|
||||
}}
|
||||
|
|
|
@ -3,9 +3,7 @@
|
|||
import React from "react";
|
||||
import { useRouter, useParams } from "next/navigation";
|
||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||
import {
|
||||
faAngleLeft,
|
||||
} from "@fortawesome/free-solid-svg-icons";
|
||||
import { faAngleLeft } from "@fortawesome/free-solid-svg-icons";
|
||||
export default function PersonSpace() {
|
||||
const { src } = useParams();
|
||||
const router = useRouter();
|
||||
|
@ -24,7 +22,10 @@ export default function PersonSpace() {
|
|||
<p className="text-base text-center leading-9"></p>
|
||||
</div>
|
||||
{/* 内容 */}
|
||||
<iframe src={`${process.env.NEXT_PUBLIC_WEB_URL}/doc/`+src} className="w-full h-[100vh]"/>
|
||||
<iframe
|
||||
src={`${process.env.NEXT_PUBLIC_WEB_URL}/` + decodeURIComponent(src)}
|
||||
className="w-full h-[100vh]"
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
|
@ -2,19 +2,23 @@
|
|||
|
||||
import React, { useRef, useState } from "react";
|
||||
import { Image } from "antd-mobile";
|
||||
|
||||
import { useRouter } from "next/navigation";
|
||||
import baseRequest from "@/utils/baseRequest";
|
||||
export default function PaySpacePost({
|
||||
type = "ironFan",
|
||||
status = 0,
|
||||
data = {},
|
||||
isCreator,
|
||||
}) {
|
||||
const base = baseRequest();
|
||||
const router = useRouter();
|
||||
return (
|
||||
<>
|
||||
{isCreator ? (
|
||||
<div
|
||||
className={`w-full flex flex-col px-2 py-2 my-2 rounded-md ${type === "ironFan" ? "bg-primary-500" : "bg-super-500"}`}
|
||||
|
||||
className={`w-full flex flex-col px-2 py-2 my-2 rounded-md ${
|
||||
type === "ironFan" ? "bg-primary-500" : "bg-super-500"
|
||||
}`}
|
||||
>
|
||||
<div className="flex flex-row justify-between items-center">
|
||||
<div className="flex flex-row items-center">
|
||||
|
@ -27,20 +31,25 @@ export default function PaySpacePost({
|
|||
className="w-4 mr-1"
|
||||
/>
|
||||
<span
|
||||
className={`text-base font-semibold ml-1 text-[${data.is_ironfan_visible === 1 ? "#FF669E" : "#FFD685"}]`}
|
||||
className={`text-base font-semibold ml-1 text-[${
|
||||
data.is_ironfan_visible === 1 ? "#FF669E" : "#FFD685"
|
||||
}]`}
|
||||
>
|
||||
{data.price / 100}
|
||||
</span>
|
||||
<span
|
||||
className={`text-sm font-medium text-[${data.is_ironfan_visible === 1 ? "#FF669E" : "#FFD685"}]`}
|
||||
|
||||
className={`text-sm font-medium text-[${
|
||||
data.is_ironfan_visible === 1 ? "#FF669E" : "#FFD685"
|
||||
}]`}
|
||||
>
|
||||
元
|
||||
</span>
|
||||
</div>
|
||||
<div className="flex flex-row items-center">
|
||||
<p
|
||||
className={`text-sm font-medium text-[${data.is_ironfan_visible === 1 ? "#FF669E" : "#FFD685"}]`}
|
||||
className={`text-sm font-medium text-[${
|
||||
data.is_ironfan_visible === 1 ? "#FF669E" : "#FFD685"
|
||||
}]`}
|
||||
>
|
||||
共{data.buyer_cnt}人购买
|
||||
</p>
|
||||
|
@ -85,7 +94,19 @@ export default function PaySpacePost({
|
|||
</div>
|
||||
<div className="flex items-center">
|
||||
{!data.is_zone_moment_unlocked ? (
|
||||
<span>
|
||||
<span
|
||||
onClick={() =>
|
||||
router.push(
|
||||
"/webView/" +
|
||||
encodeURIComponent(
|
||||
"/zone/pay/" +
|
||||
data?.id +
|
||||
"/h5_zone_moment/" +
|
||||
data?.id+"?base="+encodeURIComponent(base)
|
||||
)
|
||||
)
|
||||
}
|
||||
>
|
||||
{data.is_ironfan_visible === 1
|
||||
? "铁粉免费查看"
|
||||
: data.is_superfanship_enabled === 1
|
||||
|
|
|
@ -6,12 +6,13 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|||
import { faAngleUp, faClose, faSave } from "@fortawesome/free-solid-svg-icons";
|
||||
import { saveFile } from "@/utils/tools/handleFuns";
|
||||
import { useRouter } from "next/navigation";
|
||||
|
||||
import baseRequest from "@/utils/baseRequest";
|
||||
export default function Photos({ isUnlocked, mediaAmount, media, type }) {
|
||||
const [seeAllPhotos, setSeeAllPhotos] = useState(false);
|
||||
const [currentPhotos, setCurrentPhotos] = useState([]);
|
||||
const [photos, setPhotos] = useState([]);
|
||||
const router = useRouter();
|
||||
const base = baseRequest();
|
||||
useEffect(() => {
|
||||
if (media) {
|
||||
let imgArr = media.images.map((item) => ({
|
||||
|
@ -46,7 +47,9 @@ export default function Photos({ isUnlocked, mediaAmount, media, type }) {
|
|||
const showPhotos = (photos, index) => {
|
||||
const mediaDom = document.createElement("div");
|
||||
document.body.appendChild(mediaDom);
|
||||
mediaDom.className = `${photos[index]?.type == "hid" ? "mediaDom photos-body" : "mediaDom"}`;
|
||||
mediaDom.className = `${
|
||||
photos[index]?.type == "hid" ? "mediaDom photos-body" : "mediaDom"
|
||||
}`;
|
||||
ImageViewer.Multi.show({
|
||||
images: photos.map((item) => item?.url),
|
||||
defaultIndex: index,
|
||||
|
@ -61,6 +64,7 @@ export default function Photos({ isUnlocked, mediaAmount, media, type }) {
|
|||
afterClose: () => {
|
||||
mediaDom.remove();
|
||||
},
|
||||
classNames: { body: "photos-bodyBox" },
|
||||
});
|
||||
};
|
||||
const handleShowVideo = (video) => {
|
||||
|
@ -129,7 +133,17 @@ export default function Photos({ isUnlocked, mediaAmount, media, type }) {
|
|||
className="rounded-full bg-[#131313d4] -mt-[50vh] h-max w-max px-4 py-2 text-primary"
|
||||
onClick={() => {
|
||||
fatherDom && fatherDom.remove();
|
||||
router.push("/pay");
|
||||
router.push(
|
||||
"/webView/" +
|
||||
encodeURIComponent(
|
||||
"/zone/pay/" +
|
||||
data?.zid +
|
||||
"/h5_zone_moment/" +
|
||||
data?.id +
|
||||
"?base=" +
|
||||
encodeURIComponent(base)
|
||||
)
|
||||
);
|
||||
}}
|
||||
>
|
||||
此内容暂未解锁,立即解锁
|
||||
|
@ -152,15 +166,15 @@ export default function Photos({ isUnlocked, mediaAmount, media, type }) {
|
|||
key={index}
|
||||
onClick={() => {
|
||||
if (item?.type == "video") {
|
||||
if (!isUnlocked) {
|
||||
if (!isUnlocked && type == "space") {
|
||||
const mediaDom = document.createElement("div");
|
||||
document.body.appendChild(mediaDom);
|
||||
ImageViewer.show({
|
||||
image: item.url,
|
||||
maxZoom: 8,
|
||||
classNames: { body: "customize-body" },
|
||||
getContainer:mediaDom,
|
||||
renderFooter: () => renderFooter(true,mediaDom),
|
||||
getContainer: mediaDom,
|
||||
renderFooter: () => renderFooter(true, mediaDom),
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
@ -181,8 +195,7 @@ export default function Photos({ isUnlocked, mediaAmount, media, type }) {
|
|||
height={currentPhotos.length > 1 ? "24vw" : "auto"}
|
||||
className={`rounded max-w-full ${
|
||||
item?.type == "hid" ||
|
||||
(
|
||||
item?.type == "video" && !isUnlocked && type=="space")
|
||||
(item?.type == "video" && !isUnlocked && type == "space")
|
||||
? "imageBlur"
|
||||
: ""
|
||||
}`}
|
||||
|
|
|
@ -1,15 +1,19 @@
|
|||
import { checkAuth } from "@/utils/auth";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useRouter, usePathname } from "next/navigation";
|
||||
import { useEffect } from "react";
|
||||
import { get } from "@/utils/storeInfo";
|
||||
import { Toast } from "antd-mobile";
|
||||
export default function WithAuth(WrappedComponent) {
|
||||
const router = useRouter();
|
||||
const pathname = usePathname();
|
||||
useEffect(() => {
|
||||
|
||||
if(!pathname.includes("webView") && !pathname.includes("login") )
|
||||
checkLogin();
|
||||
// console.log("isLogin",isLogin)
|
||||
}, []);
|
||||
console.log("isLogin",!pathname.includes("webView") && !pathname.includes("login"))
|
||||
}, [pathname]);
|
||||
const checkLogin = async () => {
|
||||
const hasToken = get("token");
|
||||
const hasToken = await get("token");
|
||||
console.log("hasToken", hasToken);
|
||||
if (hasToken) {
|
||||
const hasToken = get("token");
|
||||
|
@ -17,11 +21,21 @@ export default function WithAuth(WrappedComponent) {
|
|||
if (hasToken) {
|
||||
const currentIsLogin = await checkAuth();
|
||||
if (!currentIsLogin) {
|
||||
router.push("/login")
|
||||
Toast.show({
|
||||
icon: "fail",
|
||||
content: "当前登录失效,请重新登录",
|
||||
position: "top",
|
||||
});
|
||||
router.push("/login");
|
||||
}
|
||||
}
|
||||
}else{
|
||||
router.push("/login")
|
||||
} else {
|
||||
Toast.show({
|
||||
icon: "fail",
|
||||
content:"当前登录失效,请重新登录",
|
||||
position: "top",
|
||||
});
|
||||
router.push("/login");
|
||||
}
|
||||
};
|
||||
return WrappedComponent;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import baseRequest from "./baseRequest";
|
||||
import { get } from "./storeInfo";
|
||||
import { Toast } from "antd-mobile";
|
||||
|
||||
// import { useRouter } from "next/navigation";
|
||||
// import webviewBaseRequest from "@/utils/webviewBaseRequest";
|
||||
|
||||
|
@ -20,10 +20,11 @@ export default function customFetch(method, url, options = {}, mid) {
|
|||
};
|
||||
let newBody = { ...options?.body };
|
||||
if (mid) {
|
||||
newBody.mid = get("account").mid;
|
||||
let mid = get("account").mid;
|
||||
newBody.mid = mid;
|
||||
}
|
||||
const body = JSON.stringify({ ...base, ...newBody });
|
||||
console.log("newBody",body)
|
||||
console.log("newBody", body);
|
||||
|
||||
// 合并选项
|
||||
const mergedOptions = { ...defaultOptions, body };
|
||||
|
@ -44,12 +45,12 @@ export default function customFetch(method, url, options = {}, mid) {
|
|||
resolve(data);
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log("error",error)
|
||||
Toast.show({
|
||||
icon: "fail",
|
||||
content: error.toString(),
|
||||
position: "top",
|
||||
});
|
||||
console.log("error", error);
|
||||
// Toast.show({
|
||||
// icon: "fail",
|
||||
// content: error.toString(),
|
||||
// position: "top",
|
||||
// });
|
||||
// 请求失败,拒绝 Promise
|
||||
reject(error);
|
||||
});
|
||||
|
|
|
@ -1,11 +1,16 @@
|
|||
export function save(key,value){
|
||||
localStorage.setItem(key,value)
|
||||
if(typeof(value)=="object"){
|
||||
localStorage.setItem(key,JSON.stringify(value))
|
||||
}else{
|
||||
localStorage.setItem(key,value)
|
||||
}
|
||||
|
||||
}
|
||||
export function get(key){
|
||||
let data = localStorage.getItem(key);
|
||||
// console.log(key,data)
|
||||
console.log(key,data)
|
||||
|
||||
return data ? JSON.parse(data) : null;
|
||||
return data?.indexOf("{")!=-1 ? JSON.parse(data) : data;
|
||||
}
|
||||
export function remove(key){
|
||||
localStorage.removeItem(key)
|
||||
|
|
Loading…
Reference in New Issue