修复存在的bug

This commit is contained in:
al 2024-07-30 22:53:41 +08:00
parent 8ad2e509f9
commit 23385f633f
22 changed files with 346 additions and 92 deletions

View File

@ -28,7 +28,6 @@ export default function IncomeQuerry() {
const getData = async () => {
try {
const data = await requireAPI("POST", `/api/vas/income_page`);
console.log("------",data.data)
const weekIncom = data.data.week_dashboard?data.data.week_dashboard.reduce((total, item) => {
return total + item.income;
}, 0):0;

View File

@ -18,6 +18,43 @@ body{
--background-end-rgb: 0, 0, 0;
}
} */
.custom-tabs .adm-tabs {
border: none;
--active-line-color: #ff8383;
--active-title-color: #fff;
--title-color: #a0a0a0;
--inactive-title-color: #5c5c5c;
--tab-border-color: #ff8383;
}
/* .custom-tabs .adm-tabs .adm-tabs-tab {
color: #a0a0a0;
} */
.custom-tabs .adm-tabs .adm-tabs-tab {
/* font-weight: bold; */
font-size: 24px;
}
.custom-tabs .adm-tabs-tab-line {
background: none;
background-image: url("https://filecdn01.tiefen.fun/web_app_public/icons/tabindicator.png");
height: 34px;
background-position: -2px -18px;
background-size: cover;
background-repeat: no-repeat;
z-index: 1;
}
.custom-tabs .adm-tabs-header {
border-bottom: none;
}
.adm-list-body-inner {
/* margin-top: 8px; */
}
.adm-image-viewer-indicator{
color: #fff;
}
.text-ellipsis {
-webkit-box-orient: vertical;
overflow: hidden;

View File

@ -6,7 +6,6 @@ import BottomNav from "../components/BottomNav";
import { Provider } from "react-redux";
import store from "../store";
import withAuth from "@/components/WithAuth";
import Head from "next/head";
const inter = Inter({ subsets: ["latin"] });
const metadata = {

View File

@ -27,7 +27,7 @@ params格式
}
*/
const tabItems = [
{ key: "code", title: "验证码登录" },
{ key: "veri_code", title: "验证码登录" },
{ key: "password", title: "帐号密码登录" },
];
function Login({ handleLogin }) {
@ -128,7 +128,7 @@ function Login({ handleLogin }) {
}
: {
...body,
code: veriCode,
veri_code: veriCode,
};
try {
const data = await requireAPI(
@ -384,7 +384,7 @@ const LoginBtn = ({ loginInfo, setLoginInfo, type, handleSubmit }) => {
我已阅读并同意
<span
onClick={() =>
router.push(`webView/${encodeURIComponent("/doc/useragreement")}`)
router.push(`/webView/${encodeURIComponent("/doc/useragreement")}`)
}
className="text-[#FF669E] text-xs"
>
@ -393,7 +393,7 @@ const LoginBtn = ({ loginInfo, setLoginInfo, type, handleSubmit }) => {
<span
onClick={() =>
router.push(`webView/${encodeURIComponent("/doc/privatypolicy")}`)
router.push(`/webView/${encodeURIComponent("/doc/privatypolicy")}`)
}
className="text-[#FF669E] text-xs"
>

View File

@ -282,7 +282,7 @@ export default function MessageDetail({}) {
user: {
_id: 0,
name: "客服",
avatar: process.env.NEXT_PUBLIC_WEB_ASSETS_URL + "images/icon.png",
avatar: process.env.NEXT_PUBLIC_WEB_ASSETS_URL + "/images/icon.png",
},
};
}
@ -385,11 +385,11 @@ export default function MessageDetail({}) {
}}
/>
</div>
<p className="text-base text-center">{searchParams.get("mid")==""?"在线客服":messages?.[0]?.[0].user.name}</p>
<p className="text-base text-center">{!searchParams.get("mid")?"在线客服":messages?.[0]?.[0].user.name}</p>
</div>
<div>
<div className="my-[57px]">
{searchParams.get("mid")=="" && <div className="flex justify-center py-2">
{!searchParams.get("mid") && <div className="flex justify-center py-2">
<div className="px-3 py-2 rounded-full bg-[#FFFFFF1A]">
{loading ? (
<DotLoading />
@ -430,12 +430,12 @@ export default function MessageDetail({}) {
<div className="flex justify-end w-full">
<div
className="max-w-full rounded-lg py-2 px-3 bg-blue-500 break-words"
style={{ borderTopLeftRadius: 0,maxWidth:"calc(100% - 32px - 0.75rem)" }}
style={{ borderTopRightRadius: 0,maxWidth:"calc(100% - 32px - 0.75rem)" }}
>
{it?.text}
</div>
<Avatar
className="mr-2 w-[32px] h-[32px]"
className="ml-2 w-[32px] h-[32px]"
style={{ "--border-radius": "50px" }}
width={32}
height={32}
@ -453,7 +453,7 @@ export default function MessageDetail({}) {
{/* <InfiniteScroll loadMore={loadMore} hasMore={more} /> */}
</ul>
</div>
{searchParams.get("mid")=="" && (
{!searchParams.get("mid") && (
<div className="w-full h-16 fixed bottom-0 grid grid-cols-[1fr_68px] bg-black items-center p-2 border-t-2 border-[#ffffff2a]">
<div className="rounded bg-[#222036] px-4 py-2 mr-2">
<Input

60
app/my/addToHome/page.js Normal file
View File

@ -0,0 +1,60 @@
"use client";
import React from "react";
import { Image } from "antd-mobile";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faAngleLeft } from "@fortawesome/free-solid-svg-icons";
import { useRouter } from "next/navigation";
export default function AddToHome() {
const router = useRouter();
return (
<div>
<div className="p-4 fixed top-0 z-10 w-full bg-black">
<div className="w-9 h-9 flex items-center justify-center bg-[#FFFFFF1A] rounded-full float-left absolute">
<FontAwesomeIcon
icon={faAngleLeft}
size="xl"
onClick={() => {
router.push("/my");
}}
/>
</div>
<p className="text-base text-center leading-9">我的钱包</p>
</div>
{/* 内容 */}
<div className="p-4 mt-14">
<div>
<p className="text-base font-bold">在浏览器中如何将铁粉空间添加到主屏幕</p>
<p className="text-xs text-[red]">请勿在当前页面点击[添加到主屏幕]</p>
<p className="text-xs my-2 text-[#ffffff69]">以IOS的Safari浏览器为例</p>
</div>
<div>
<p className="text-xs mt-4 mb-2">1.在浏览器中打开主界面点击浏览器中的[分享]按钮</p>
<div className="flex justify-center">
<Image
src={"/images/addToHome1.png"}
placeholder=""
className="w-[60%]"
/>
</div>
<p className="text-xs mt-4 mb-2">2.打开分享弹框后点击[添加到主屏幕]</p>
<div className="flex justify-center">
<Image
src={"/images/addToHome2.png"}
placeholder=""
className="w-[60%]"
/>
</div>
<p className="text-xs mt-4 mb-2">3.打开添加到主屏幕弹框后点击[添加]按钮即可成功添加到主屏幕</p>
<div className="flex justify-center">
<Image
src={"/images/addToHome3.png"}
placeholder=""
className="w-[60%]"
/>
</div>
</div>
</div>
</div>
);
}

View File

@ -73,7 +73,7 @@ const My = () => {
style={{ "--size": "76px", "--border-radius": "50%" }}
/>
<div>
<p className="text-2xl font-bold">{userInfo.name}</p>
<p className="text-2xl">{userInfo.name}</p>
<div className="h-4 flex items-center text-xs bg-[#ffffff18] rounded-full px-2 py-2.5 mt-1 w-max">
<Image
src={process.env.NEXT_PUBLIC_WEB_ASSETS_URL+"/icons/info/ID.png"}
@ -340,6 +340,27 @@ const My = () => {
className="h-4 text-gray-300"
/>
</li>
<li
className="flex justify-between items-center p-3 py-2"
onClick={() => {
router.push("/my/addToHome");
}}
>
<div className="flex items-center">
<Image
className="mr-2"
width={32}
src={process.env.NEXT_PUBLIC_WEB_ASSETS_URL+"/icons/32DP/contact.png"}
placeholder=""
/>
<span className="text-base">添到主屏幕</span>
</div>
<FontAwesomeIcon
icon={faAngleRight}
size="sm"
className="h-4 text-gray-300"
/>
</li>
</ul>
</div>
</div>

View File

@ -18,6 +18,7 @@ import styles from "./index.module.scss";
import { handleFollow } from "@/api/public";
import requireAPI from "@/utils/requireAPI";
import InfiniteScrollContent from "@/components/InfiniteScrollContent";
import Empty from "@/components/Empty";
export default function Relationship() {
const [currentKey, setCurrentKey] = useState("");
const [hasMore, setHasMore] = useState(true);
@ -27,7 +28,7 @@ export default function Relationship() {
const [data, setData] = useState([]);
const [offset, setOffset] = useState(0);
// 获取屏幕高度
// const scrollHeight = 600;
const scrollHeight = 600;
useEffect(() => {
if (currentKey) {
setOffset(0);
@ -119,7 +120,7 @@ export default function Relationship() {
title="关注"
key="follow"
description={
currentKey == "all" && (
currentKey == "follow" && (
<div className="titlePinkLine relative w-full"></div>
)
}
@ -158,15 +159,21 @@ export default function Relationship() {
loadMore={() => loadMore("follow")}
hasMore={hasMore}
>
<InfiniteScrollContent hasMore={hasMore} />
<InfiniteScrollContent isEmpty={data.length==0} showNoMore={false}/>
</InfiniteScroll>
</List>
{/* {!data.length && <div
className={`flex flex-col items-center mt-20`}
style={{ height: `${scrollHeight}px` }}
>
<Empty type="nodata" />
</div>} */}
</JumboTabs.Tab>
<JumboTabs.Tab
title="粉丝"
key="fans"
description={
currentKey == "ironFan" && (
currentKey == "fans" && (
<div className="titlePinkLine relative w-full"></div>
)
}
@ -192,12 +199,12 @@ export default function Relationship() {
<p>{item.name}</p>
<p className="text-xs truncate">{item.bio}</p>
</div>
<div
{/* <div
className="text-sm leading-9 h-max bg-[#FFFFFF1A] px-2 rounded-full whitespace-nowrap flex items-center justify-center"
onClick={() => handleFollow(item.isFollowed, item.mid)}
>
{item.isFollowed ? "已关注" : "关注"}
</div>
</div> */}
</div>
</List.Item>
))}
@ -205,15 +212,9 @@ export default function Relationship() {
loadMore={() => loadMore("fans")}
hasMore={hasMore}
>
<InfiniteScrollContent hasMore={hasMore} isEmpty={data.length==0}/>
<InfiniteScrollContent hasMore={hasMore} isEmpty={data.length==0} showNoMore={false}/>
</InfiniteScroll>
</List>
{/* <div
className={`flex flex-col items-center mt-20`}
style={{ height: `${scrollHeight}px` }}
>
<Empty type="nodata" />
</div> */}
</JumboTabs.Tab>
</JumboTabs>
</div>

View File

@ -39,7 +39,7 @@ export default function AboutUs() {
<ul>
<li
className="flex justify-between items-center p-3"
onClick={() => router.push(`webView/${encodeURIComponent("/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(`webView/${encodeURIComponent("/doc/privatypolicy")}`)}
onClick={() => router.push(`/webView/${encodeURIComponent("/doc/privatypolicy")}`)}
>
<div className="flex items-center">
<FontAwesomeIcon

View File

@ -52,7 +52,7 @@ export default function Wallet() {
return (
<div className="">
<div className="p-4 fixed top-0 z-10 w-full">
<div className="w-9 h-9 flex items-center justify-center bg-[#FFFFFF1A] rounded-full float-left">
<div className="w-9 h-9 flex items-center justify-center bg-[#FFFFFF1A] rounded-full float-left absolute">
<FontAwesomeIcon
icon={faAngleLeft}
size="xl"

View File

@ -10,7 +10,6 @@ import React, {
import {
Tabs,
Swiper,
PullToRefresh,
Toast,
InfiniteScroll,
List,

View File

@ -52,7 +52,7 @@ export default function ShareSpace({ data }) {
return (
<div className="">
<div className="p-4 fixed top-0 z-10 w-full">
<div className="w-9 h-9 flex items-center justify-center bg-[#FFFFFF1A] rounded-full float-left">
<div className="w-9 h-9 flex items-center justify-center bg-[#FFFFFF1A] rounded-full float-left absolute">
<FontAwesomeIcon
icon={faAngleLeft}
size="xl"

View File

@ -166,7 +166,10 @@ export default function Setting() {
</div>
<Divider />
</li>
{streamerInfo?.refund_enable && (
{
streamerInfo?.refund_enable === 1 &&
streamerInfo?.admission_price > 0 &&
streamerInfo?.visitor_role === 0 && (
<li>
<div
onClick={() =>
@ -174,7 +177,7 @@ export default function Setting() {
}
className="flex justify-between"
>
<span className="text-base text-white">空间退款</span>
<span className="text-base text-white">申请退款</span>
<FontAwesomeIcon icon={faAngleRight} size="xl" />
</div>
<Divider />

View File

@ -103,7 +103,7 @@ export default function SpaceRefund() {
return (
<div>
<div className="p-4 fixed top-0 z-10 w-full">
<div className="w-9 h-9 flex items-center justify-center bg-[#FFFFFF1A] rounded-full float-left">
<div className="w-9 h-9 flex items-center justify-center bg-[#FFFFFF1A] rounded-full float-left absolute">
<FontAwesomeIcon
icon={faAngleLeft}
size="xl"
@ -112,7 +112,7 @@ export default function SpaceRefund() {
}}
/>
</div>
<p className="text-base text-center leading-9">空间退款</p>
<p className="text-base text-center leading-9">申请退款</p>
</div>
<div className="mt-14 p-4">
<div className="flex-row justify-between items-center">

View File

@ -3,12 +3,12 @@
import React, { useState, useEffect } from "react";
import QRCode from "qrcode";
import { Toast,Image } from "antd-mobile";
import { useRouter,useParams } from "next/navigation";
import { Toast, Image } from "antd-mobile";
import { useRouter, useParams } from "next/navigation";
import requireAPI from "@/utils/requireAPI";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faAngleLeft} from "@fortawesome/free-solid-svg-icons";
import {saveImage} from "@/utils/tools/handleFuns";
import { faAngleLeft } from "@fortawesome/free-solid-svg-icons";
import { saveImage } from "@/utils/tools/handleFuns";
import clipboard from "copy-to-clipboard";
export default function Share() {
//
@ -16,13 +16,17 @@ export default function Share() {
const [qrcodeUrl, setQrcodeUrl] = useState("");
const [isFetching, setIsFetching] = useState(true);
const router = useRouter();
const {user_id} = useParams();
const { user_id } = useParams();
useEffect(() => {
const getData = async () => {
try {
const data = await requireAPI("POST", "/api/streamer/list_ext_by_user_id", {
body:{user_id: parseInt(user_id, 10),},
});
const data = await requireAPI(
"POST",
"/api/streamer/list_ext_by_user_id",
{
body: { user_id: parseInt(user_id, 10) },
}
);
if (data.ret === -1) {
Toast.show({
content: data.msg,
@ -88,21 +92,25 @@ export default function Share() {
</span>
</p>
</div>
{/* <div className="px-2 py-1 mt-2 bg-[#FF61B030] rounded-full justify-center">
</div> */}
<p className="px-2 py-1 text-2xs text-[#FF669E]">www.tiefen.fun</p>
</div>
<div className="h-20 aspect-square ml-auto overflow-hidden rounded shrink-0">
<div className="h-24 aspect-square ml-auto overflow-hidden rounded shrink-0">
<img className="object-cover scale-110 w-full" src={qrcodeUrl} />
</div>
</div>
</div>
<button
onClick={()=>saveImage("print")}
className="btn btn-md bg-gradient-to-r from-[#FF668B] to-[#FF66F0] rounded-full text-white text-base font-medium w-full mt-4"
onClick={() => saveImage("print")}
className="btn-md bg-gradient-to-r from-[#FF668B] to-[#FF66F0] rounded-full text-white text-base font-medium w-full mt-4"
>
保存图片
</button>
<button
onClick={copyUrl}
className="btn btn-md bg-gradient-to-r from-[#FF668B] to-[#FF66F0] rounded-full text-white text-base font-medium w-full mt-4"
className="btn-md bg-gradient-to-r from-[#FF668B] to-[#FF66F0] rounded-full text-white text-base font-medium w-full mt-4"
>
复制链接
</button>
@ -143,10 +151,10 @@ export default function Share() {
</div>
{/* 内容 */}
<section className="mt-20 flex flex-1 flex-col items-center justify-center container">
<div className="w-4/5">
<Poster />
</div>
</section>
<div className="w-4/5">
<Poster />
</div>
</section>
</div>
);
}

View File

@ -6,6 +6,8 @@ import requireAPI from "@/utils/requireAPI";
import { get } from "@/utils/storeInfo";
import { useRouter } from "next/navigation";
import { getStreamerDetailInfo } from "@/api/space";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faCopy } from "@fortawesome/free-solid-svg-icons";
export default function AddWeChat({
visible,
closeMask,
@ -19,6 +21,10 @@ export default function AddWeChat({
//是否已经解锁微信
const [streamerDetailData, setStreamerDetailData] = useState(null);
const [wechat, setWechat] = useState(<DotLoading />);
//保存用户微信号
const [userWechat, setUserWechat] = useState("");
//保存用户备注
const [remarks, setRemarks] = useState("");
const router = useRouter();
useEffect(() => {
console.log("avatar", avatar);
@ -39,7 +45,7 @@ export default function AddWeChat({
});
}, [streamerDetailData]);
//点击解锁微信按钮
const unlockWechat = async () => {
const unlockWechat = async (type) => {
//余额不够就显示余额不足前往充值,够就直接购买
//先支付,支付成功后添加解锁关系,再展示解锁界面
@ -66,20 +72,104 @@ export default function AddWeChat({
}
if (userResponse?.data.account?.gold_num >= price) {
console.log("余额足够");
const data = await requireAPI("POST", "/api/vas/one_step_unlock", {
body: {
contact_product_id: "contact_wechat",
uid: streamerMid,
},
});
if (data.ret === -1) {
Toast.show({
icon: "fail",
content: data.msg,
position: "top",
if (type) {
if (!userWechat) {
Alert.alert(null, "请填写您的微信");
return;
}
//付款函数
const payCoin = async () => {
try {
//支付金币解锁微信
const unlockData = await requireAPI(
"POST",
"/api/vas/one_step_unlock",
{
body: {
contact_product_id: "contact_wechat",
uid: streamerMid,
},
}
);
if (unlockData.ret === -1) {
Toast.show({
icon: "fail",
content: unlockData.msg,
position: "top",
});
return;
}
return unlockData.data.order_id;
} catch (error) {
console.error(error);
}
};
//提交微信函数
const submitWechat = async (order_id) => {
//提交用户微信和备注
try {
const submitWechatData = await requireAPI(
"POST",
"/api/vas/consumer_fill_contact",
{
body: {
order_id: order_id,
wechat: userWechat,
note: remarks,
},
}
);
if (submitWechatData.ret === -1) {
Toast.show({
icon: "fail",
content: submitWechatData.msg,
position: "top",
});
return;
}
} catch (error) {
console.error(error);
}
};
//用户未解锁微信情况:先支付,再提交用户微信和备注
if (streamerDetailData.is_unlock_wechat === 1) {
//用户已解锁微信情况:直接提交用户微信和备注
await submitWechat(streamerData.wechat_order_id);
setStreamerDetailData({
...streamerData,
wechat_order_status: 3,
});
} else {
const order_id = await payCoin();
if (!order_id) return;
await submitWechat(order_id);
//展示解锁成功界面
// setIsWechatUnlocked(true);
setStreamerDetailData({
...streamerDetailData,wechat_order_status:3
})
return;
}
} else {
const data = await requireAPI("POST", "/api/vas/one_step_unlock", {
body: {
contact_product_id: "contact_wechat",
uid: streamerMid,
},
});
return;
if (data.ret === -1) {
Toast.show({
icon: "fail",
content: data.msg,
position: "top",
});
return;
}
}
//展示解锁界面
// setIsWechatUnlocked(true);
getStreamerDetailInfo(streamerMid).then((res) => {
@ -109,20 +199,46 @@ export default function AddWeChat({
fit="cover"
/>
<p className="text-2xl font-bold">{name}</p>
<div className="mt-2">
<div className="mt-2 w-full">
<div>
{streamerData?.streamer_ext?.wechat_lock_type === 0 ? (
<div>
<div className="flex flex-col justify-center items-center">
<div className="my-2 bg-[#FFFFFF1A] px-4 py-2 rounded-lg text-base text-center">
{streamerDetailData?.is_unlock_wechat
? wechat
: "解锁后展示"}
{!!streamerDetailData?.is_unlock_wechat && (
<FontAwesomeIcon
icon={faCopy}
// size="sm"
color="#ffffff"
className="ml-2"
/>
)}
</div>
<p className="text-[red] text-center mb-2">
添加时请备注自己铁粉空间昵称
<br />
若解锁后72小时为通过好友请联系客服
</p>
{(!streamerDetailData?.is_unlock_wechat ||
streamerDetailData?.wechat_order_status === 2) && (
<div
className="bg-primary px-4 py-2 rounded-full flex items-center justify-center"
onClick={unlockWechat}
>
{!streamerDetailData?.is_unlock_wechat && (
<span className="text-[16px] whitespace-nowrap">
解锁微信
{
streamerDetailData?.streamer_ext
?.wechat_coin_price
}
金币
</span>
)}
</div>
)}
</div>
) : (
<div>
@ -147,6 +263,8 @@ export default function AddWeChat({
<Input
placeholder="填写您的微信以便Ta主动联系您"
style={{ "--font-size": "small" }}
onChange={(value) => setUserWechat(value)}
value={userWechat}
/>
</div>
</div>
@ -156,6 +274,8 @@ export default function AddWeChat({
<TextArea
placeholder="如添加好友需填写验证信息,请将相应答案填写在此处"
style={{ "--font-size": "small" }}
onChange={(value) => setRemarks(value)}
value={remarks}
/>
</div>
</div>
@ -164,32 +284,35 @@ export default function AddWeChat({
<p className="text-xs text-center text-[#F53030] font-medium my-2">
若解锁后72小时未通过好友请联系客服
</p>
</div>
)}
{(!streamerDetailData?.is_unlock_wechat ||
streamerDetailData?.wechat_order_status === 2) && (
<div
className="bg-primary px-4 py-2 rounded-full flex items-center justify-center"
onClick={unlockWechat}
>
{!streamerDetailData?.is_unlock_wechat && (
{(!streamerDetailData?.is_unlock_wechat ||
streamerDetailData?.wechat_order_status === 2) && (
<div
className="bg-primary px-4 py-2 rounded-full flex items-center justify-center"
onClick={() => unlockWechat("sendWechat")}
>
{/* {!streamerDetailData?.is_unlock_wechat && (
<span className="text-[16px] whitespace-nowrap">
解锁微信
{streamerDetailData?.streamer_ext?.wechat_coin_price}
金币
</span>
)}
{streamerDetailData?.is_unlock_wechat === 1 && (
<span className="text-[16px] whitespace-nowrap">
提交并支付
{streamerDetailData?.streamer_ext?.wechat_coin_price}
金币
</span>
)}
{streamerDetailData?.wechat_order_status === 2 && (
<span className="text-white text-base font-medium px-4 whitespace-nowrap">
提交微信
</span>
)} */}
{!streamerDetailData?.is_unlock_wechat && (
<span className="text-[16px] whitespace-nowrap">
提交并支付
{
streamerDetailData?.streamer_ext
?.wechat_coin_price
}
金币
</span>
)}
{streamerDetailData?.wechat_order_status === 2 && (
<span className="text-white text-base font-medium px-4 whitespace-nowrap">
提交微信
</span>
)}
</div>
)}
</div>
)}

View File

@ -1,7 +1,11 @@
import React from "react";
import { DotLoading } from "antd-mobile";
import Empty from "@/components/Empty";
export default function InfiniteScrollContent({ hasMore, isEmpty }) {
export default function InfiniteScrollContent({
hasMore,
isEmpty,
showNoMore = true,
}) {
return (
<>
{hasMore ? (
@ -9,7 +13,7 @@ export default function InfiniteScrollContent({ hasMore, isEmpty }) {
<span>加载中</span>
<DotLoading />
</>
) : !isEmpty ? (
) : !showNoMore ? null : !isEmpty ? (
<span>没有更多了</span>
) : (
<div

View File

@ -7,7 +7,7 @@ import { faAngleUp, faClose} 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, data }) {
export default function Photos({ isUnlocked,mediaVisibleRange, mediaAmount, media, type, data }) {
const [seeAllPhotos, setSeeAllPhotos] = useState(false);
const [currentPhotos, setCurrentPhotos] = useState([]);
const [photos, setPhotos] = useState([]);
@ -26,13 +26,12 @@ export default function Photos({ isUnlocked, mediaAmount, media, type, data }) {
}));
let arr = [...imgArr, ...videoArr];
let newPhotos = [...arr];
if (mediaAmount && !isUnlocked) {
newPhotos = Array(mediaAmount)
.fill(null)
.map((item, index) => {
return newPhotos[index]
? newPhotos[index]
&& mediaVisibleRange ? newPhotos[index]
: { url: newPhotos[0]?.url, type: "hid" };
});
console.log("newPhotos",newPhotos)

View File

@ -147,6 +147,7 @@ export default function PostItem({
media={data.media_component}
isUnlocked={data.is_zone_moment_unlocked}
mediaAmount={data.media_amount}
mediaVisibleRange={data.media_visible_range}
type={type}
/>
)}

Binary file not shown.

After

Width:  |  Height:  |  Size: 641 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 539 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 218 KiB