更改图片宽度

This commit is contained in:
al 2024-08-09 21:02:50 +08:00
parent 0419b405fc
commit c23977cf1e
3 changed files with 20 additions and 10 deletions

View File

@ -155,11 +155,11 @@ function Login({ handleLogin }) {
} }
); );
if (data.ret === -1) { if (data.ret === -1) {
// Toast.show({ Toast.show({
// icon: "fail", icon: "fail",
// content: data.msg, content: data.msg,
// position: "top", position: "top",
// }); });
return; return;
} }
//登录 //登录
@ -208,7 +208,7 @@ function Login({ handleLogin }) {
const mobile_phone = encrypt.encrypt(mobilePhone); const mobile_phone = encrypt.encrypt(mobilePhone);
//发送短信验证码 //发送短信验证码
try { try {
await fetch(`/api/veri_code/send`, { const data = await fetch(`/api/veri_code/send`, {
method: "POST", method: "POST",
headers: { headers: {
"Content-Type": "application/json", "Content-Type": "application/json",
@ -218,6 +218,14 @@ function Login({ handleLogin }) {
region_code: regionCode, region_code: regionCode,
}), }),
}); });
if (data.ret === -1) {
Toast.show({
icon: "fail",
content: data.msg,
position: "top",
});
return;
}
} catch (error) { } catch (error) {
console.error(error); console.error(error);
} }

View File

@ -24,7 +24,7 @@ export default function AddToHome() {
fit="cover" fit="cover"
className="rounded-md mr-3" className="rounded-md mr-3"
// src={process.env.NEXT_PUBLIC_WEB_ASSETS_URL+"/icons/nodata.png"} // src={process.env.NEXT_PUBLIC_WEB_ASSETS_URL+"/icons/nodata.png"}
src={"/images/icon.png"} src={process.env.NEXT_PUBLIC_WEB_ASSETS_URL+"/images/icon.png"}
placeholder="" placeholder=""
width={46} width={46}
height={46} height={46}
@ -66,7 +66,7 @@ export default function AddToHome() {
<Image <Image
fit="cover" fit="cover"
// src={process.env.NEXT_PUBLIC_WEB_ASSETS_URL+"/icons/nodata.png"} // src={process.env.NEXT_PUBLIC_WEB_ASSETS_URL+"/icons/nodata.png"}
src={"/icons/ios_share.png"} src={process.env.NEXT_PUBLIC_WEB_ASSETS_URL+"/icons/ios_share.png"}
placeholder="" placeholder=""
width={32} width={32}
height={32} height={32}
@ -76,7 +76,7 @@ export default function AddToHome() {
<Image <Image
fit="contain" fit="contain"
// src={process.env.NEXT_PUBLIC_WEB_ASSETS_URL+"/icons/nodata.png"} // src={process.env.NEXT_PUBLIC_WEB_ASSETS_URL+"/icons/nodata.png"}
src={"/images/addToHome.png"} src={process.env.NEXT_PUBLIC_WEB_ASSETS_URL+"/images/addToHome.png"}
placeholder="" placeholder=""
width={54} width={54}
height={70} height={70}

View File

@ -35,11 +35,13 @@ export default function Photos({
let imgArr = media.images.map((item) => ({ let imgArr = media.images.map((item) => ({
type: "img", type: "img",
url: item.urls?.[0], url: item.urls?.[0],
fullwidth:item.w>item.h
})); }));
let videoArr = media.videos.map((item) => ({ let videoArr = media.videos.map((item) => ({
type: "video", type: "video",
url: item.cover_urls?.[0], url: item.cover_urls?.[0],
mp4: item.urls?.[0], mp4: item.urls?.[0],
fullwidth:item.cover_w>item.cover_h
})); }));
let arr = [...imgArr, ...videoArr]; let arr = [...imgArr, ...videoArr];
let newPhotos = [...arr]; let newPhotos = [...arr];
@ -249,7 +251,7 @@ export default function Photos({
placeholder={ placeholder={
<div className="w-full min-h-[24vw] bg-[#1d1d1d] rounded"></div> <div className="w-full min-h-[24vw] bg-[#1d1d1d] rounded"></div>
} }
width={currentPhotos.length > 1 ? "24vw" : "46vw"} width={currentPhotos.length > 1 ? "24vw" : item.fullwidth?"100%":"46vw"}
height={currentPhotos.length > 1 ? "24vw" : "100%"} height={currentPhotos.length > 1 ? "24vw" : "100%"}
className={`rounded max-w-full ${ className={`rounded max-w-full ${
item?.type == "hid" && type == "space" ? "imageBlur" : "" item?.type == "hid" && type == "space" ? "imageBlur" : ""