更改vip页面图片资源;为主播专属下载页面添加引导footer

This commit is contained in:
yezian 2024-01-27 00:35:53 +08:00
parent 1a89fc7d6e
commit e4e5a57057
4 changed files with 66 additions and 7 deletions

View File

@ -11,6 +11,9 @@ 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";
import baseRequest from "@/utils/baseRequest";
import { generateSignature } from "@/utils/crypto";
import { Toast } from "antd-mobile";
export default function Download({ params }) {
const [deviceType, setDeviceType] = useState("");
@ -37,6 +40,44 @@ export default function Download({ params }) {
}
};
//
const [data, setData] = useState({});
useEffect(() => {
const getData = async () => {
try {
const base = baseRequest();
const signature = generateSignature({
user_id: parseInt(params.user_id, 10),
...base,
});
const detailResponse = await fetch(
`/api/streamer/list_ext_by_user_id?signature=${signature}`,
{
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
user_id: parseInt(params.user_id, 10),
...base,
}),
}
);
const detailData = await detailResponse.json();
if (detailData.ret === -1) {
Toast.show({
content: detailData.msg,
});
return;
}
setData(detailData.data.streamer_ext);
} catch (error) {
console.error(error);
}
};
getData();
}, []);
return (
<section className="flex flex-col container">
<InOtherApp />
@ -142,6 +183,24 @@ export default function Download({ params }) {
</p>
)}
</div>
<div className="flex flex-row items-center bg-[#13121F] fixed bottom-0 left-0 w-full rounded-t-2xl z-20 p-4">
<img
src={data?.cover?.images[0].urls[0]}
alt=""
className="w-12 h-12 rounded-full"
/>
<div className="flex flex-col flex-1 ml-4">
<p className="text-white text-base font-medium flex items-center">
{data?.name}&nbsp;
<span className="text-xs text-secondary">
ID{data?.user_id}
</span>
</p>
<p className="text-secondary text-sm font-medium">
邀请您加入铁粉空间解锁更多福利
</p>
</div>
</div>
</div>
</section>
);

View File

@ -123,13 +123,13 @@ export default function Vip() {
}
};
if (isFetching) {
return (
<section className="flex flex-1 justify-center container">
<span className="absolute top-1/2 loading loading-spinner loading-lg"></span>
</section>
);
}
// if (isFetching) {
// return (
// <section className="flex flex-1 justify-center container">
// <span className="absolute top-1/2 loading loading-spinner loading-lg"></span>
// </section>
// );
// }
return (
<section className="flex flex-1 justify-center container">

Binary file not shown.

Before

Width:  |  Height:  |  Size: 57 KiB

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 51 KiB