修改一些样式功能
This commit is contained in:
parent
66a2fad67e
commit
f5bd3d47e7
|
@ -131,11 +131,15 @@ function Login({ handleLogin }) {
|
|||
code: veriCode,
|
||||
};
|
||||
try {
|
||||
const data = await requireAPI("POST", `/api/login/${
|
||||
type === "password" ? "login_by_pswd" : "login_by_veri_code"
|
||||
}`, {
|
||||
body,
|
||||
});
|
||||
const data = await requireAPI(
|
||||
"POST",
|
||||
`/api/login/${
|
||||
type === "password" ? "login_by_pswd" : "login_by_veri_code"
|
||||
}`,
|
||||
{
|
||||
body,
|
||||
}
|
||||
);
|
||||
if (data.ret === -1) {
|
||||
Toast.show({
|
||||
icon: "fail",
|
||||
|
@ -148,8 +152,12 @@ function Login({ handleLogin }) {
|
|||
saveUserInfo(data, mobilePhone, regionCode);
|
||||
signIn(data);
|
||||
handleLogin({ isSignin: true, userToken: data.data.token });
|
||||
|
||||
router.push(!data?.data?.is_enabled ? "/":"/my/setting/editPassword?is_enabled="+data?.data?.is_enabled);
|
||||
|
||||
router.push(
|
||||
!data?.data?.is_enabled
|
||||
? "/"
|
||||
: "/my/setting/editPassword?is_enabled=" + data?.data?.is_enabled
|
||||
);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
|
@ -198,151 +206,159 @@ function Login({ handleLogin }) {
|
|||
};
|
||||
return (
|
||||
<div className="h-full flex justify-center items-center">
|
||||
<div className={`lg:max-w-[450px] overflow-hidden`}>
|
||||
<Image
|
||||
src={process.env.NEXT_PUBLIC_CDN_URL + "/public/images/slogan.png"}
|
||||
alt=""
|
||||
className="w-full"
|
||||
/>
|
||||
<div className="mt-6 flex justify-between items-center px-2 text-[#ffffff80] sticky top-0 z-10 bg-deepBg">
|
||||
<Tabs
|
||||
activeKey={tabItems[activeIndex].key}
|
||||
onChange={(key) => {
|
||||
const index = tabItems.findIndex((item) => item.key === key);
|
||||
setActiveIndex(index);
|
||||
swiperRef.current?.swipeTo(index);
|
||||
}}
|
||||
className={`w-full ${styles.customTabs}`}
|
||||
>
|
||||
{tabItems.map((item) => (
|
||||
<Tabs.Tab
|
||||
forceRender={false}
|
||||
title={item.title}
|
||||
key={item.key}
|
||||
className="text-left"
|
||||
/>
|
||||
))}
|
||||
</Tabs>
|
||||
</div>
|
||||
<Swiper
|
||||
className="overflow-visible mt-6 "
|
||||
direction="horizontal"
|
||||
loop
|
||||
indicator={() => null}
|
||||
ref={swiperRef}
|
||||
defaultIndex={activeIndex}
|
||||
onIndexChange={(index) => {
|
||||
setActiveIndex(index);
|
||||
}}
|
||||
>
|
||||
<Swiper.Item className="px-10">
|
||||
<div className="border-2 border-[#2c2b2f] rounded-2xl p-4">
|
||||
<div className="flex flex-row flex-nowrap items-center mb-4">
|
||||
<p className="text-base text-white mr-4">
|
||||
+{loginInfo.regionCode}
|
||||
</p>
|
||||
<Input
|
||||
clearable
|
||||
placeholder="请输入手机号"
|
||||
// disabled={true}
|
||||
type="number"
|
||||
maxLength={11}
|
||||
onChange={(value) =>
|
||||
setLoginInfo({ ...loginInfo, mobilePhone: value })
|
||||
}
|
||||
value={loginInfo.mobilePhone}
|
||||
style={{ "--color": "#FFFFFF", "--font-size": "16px","--placeholder-color": "#FFFFFF80", }}
|
||||
/>
|
||||
</div>
|
||||
<Divider />
|
||||
<div className="flex flex-row flex-nowrap items-center">
|
||||
<p className="text-base text-white mr-4 whitespace-nowrap">
|
||||
验证码
|
||||
</p>
|
||||
<Input
|
||||
placeholder="请输入验证码"
|
||||
onChange={(value) => setVeriCode(value)}
|
||||
value={veriCode}
|
||||
type="number"
|
||||
style={{
|
||||
"--placeholder-color": "#FFFFFF80",
|
||||
"--font-size": "16px",
|
||||
}}
|
||||
/>
|
||||
<Button
|
||||
shape="rounded"
|
||||
size="mini"
|
||||
disabled={isCounting}
|
||||
onClick={handleVerification}
|
||||
style={{ "--background-color": "#FF669E", color: "#FFFFFF" }}
|
||||
className="whitespace-nowrap"
|
||||
>
|
||||
{isCounting ? `(${seconds})重新发送` : "获取验证码"}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<LoginBtn
|
||||
loginInfo={loginInfo}
|
||||
setLoginInfo={setLoginInfo}
|
||||
handleSubmit={handleSubmit}
|
||||
type={activeIndex ? "password" : "mobile"}
|
||||
/>
|
||||
</Swiper.Item>
|
||||
<Swiper.Item className="px-10">
|
||||
<div className="border-2 border-[#2c2b2f] rounded-2xl p-4">
|
||||
<div className="flex flex-row flex-nowrap items-center mb-4">
|
||||
<p className="text-base text-white mr-4">
|
||||
+{loginInfo.regionCode}
|
||||
</p>
|
||||
<Input
|
||||
clearable
|
||||
placeholder="请输入手机号"
|
||||
// disabled={true}
|
||||
type="number"
|
||||
maxLength={11}
|
||||
onChange={(value) =>
|
||||
setLoginInfo({ ...loginInfo, mobilePhone: value })
|
||||
}
|
||||
value={loginInfo.mobilePhone}
|
||||
style={{ "--color": "#FFFFFF", "--font-size": "16px","--placeholder-color": "#FFFFFF80", }}
|
||||
/>
|
||||
</div>
|
||||
<Divider />
|
||||
<div className="flex flex-row flex-nowrap items-center">
|
||||
<p className="text-base text-white mr-4 whitespace-nowrap">
|
||||
密码
|
||||
</p>
|
||||
<Input
|
||||
clearable
|
||||
placeholder="请输入密码"
|
||||
onChange={(value) =>
|
||||
setLoginInfo({ ...loginInfo, password: value })
|
||||
}
|
||||
value={loginInfo.password}
|
||||
type="password"
|
||||
style={{
|
||||
"--placeholder-color": "#FFFFFF80",
|
||||
"--font-size": "16px",
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
onClick={() => router.push(`/my/setting/editPassword`)}
|
||||
className="w-full text-[#FF669E] text-xs mt-2 text-right"
|
||||
<div className={`lg:max-w-[450px] overflow-hidden mt-12`}>
|
||||
<Image
|
||||
src={process.env.NEXT_PUBLIC_CDN_URL + "/public/images/slogan.png"}
|
||||
alt=""
|
||||
className="w-full"
|
||||
/>
|
||||
<div className="mt-6 flex justify-between items-center px-2 text-[#ffffff80] sticky top-0 z-10 bg-deepBg">
|
||||
<Tabs
|
||||
activeKey={tabItems[activeIndex].key}
|
||||
onChange={(key) => {
|
||||
const index = tabItems.findIndex((item) => item.key === key);
|
||||
setActiveIndex(index);
|
||||
swiperRef.current?.swipeTo(index);
|
||||
}}
|
||||
className={`w-full ${styles.customTabs}`}
|
||||
>
|
||||
忘记密码?
|
||||
</div>
|
||||
<LoginBtn
|
||||
loginInfo={loginInfo}
|
||||
setLoginInfo={setLoginInfo}
|
||||
handleSubmit={handleSubmit}
|
||||
type={activeIndex ? "password" : "mobile"}
|
||||
/>
|
||||
</Swiper.Item>
|
||||
</Swiper>
|
||||
</div>
|
||||
{tabItems.map((item) => (
|
||||
<Tabs.Tab
|
||||
forceRender={false}
|
||||
title={item.title}
|
||||
key={item.key}
|
||||
className="text-left"
|
||||
/>
|
||||
))}
|
||||
</Tabs>
|
||||
</div>
|
||||
<Swiper
|
||||
className="overflow-visible mt-6 "
|
||||
direction="horizontal"
|
||||
loop
|
||||
indicator={() => null}
|
||||
ref={swiperRef}
|
||||
defaultIndex={activeIndex}
|
||||
onIndexChange={(index) => {
|
||||
setActiveIndex(index);
|
||||
}}
|
||||
>
|
||||
<Swiper.Item className="px-10">
|
||||
<div className="border-2 border-[#2c2b2f] rounded-2xl p-4">
|
||||
<div className="flex flex-row flex-nowrap items-center mb-4">
|
||||
<p className="text-base text-white mr-4">
|
||||
+{loginInfo.regionCode}
|
||||
</p>
|
||||
<Input
|
||||
clearable
|
||||
placeholder="请输入手机号"
|
||||
// disabled={true}
|
||||
type="number"
|
||||
maxLength={11}
|
||||
onChange={(value) =>
|
||||
setLoginInfo({ ...loginInfo, mobilePhone: value })
|
||||
}
|
||||
value={loginInfo.mobilePhone}
|
||||
style={{
|
||||
"--color": "#FFFFFF",
|
||||
"--font-size": "16px",
|
||||
"--placeholder-color": "#FFFFFF80",
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<Divider />
|
||||
<div className="flex flex-row flex-nowrap items-center">
|
||||
<p className="text-base text-white mr-4 whitespace-nowrap">
|
||||
验证码
|
||||
</p>
|
||||
<Input
|
||||
placeholder="请输入验证码"
|
||||
onChange={(value) => setVeriCode(value)}
|
||||
value={veriCode}
|
||||
type="number"
|
||||
style={{
|
||||
"--placeholder-color": "#FFFFFF80",
|
||||
"--font-size": "16px",
|
||||
}}
|
||||
/>
|
||||
<Button
|
||||
shape="rounded"
|
||||
size="mini"
|
||||
disabled={isCounting}
|
||||
onClick={handleVerification}
|
||||
style={{ "--background-color": "#FF669E", color: "#FFFFFF" }}
|
||||
className="whitespace-nowrap"
|
||||
>
|
||||
{isCounting ? `(${seconds})重新发送` : "获取验证码"}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<LoginBtn
|
||||
loginInfo={loginInfo}
|
||||
setLoginInfo={setLoginInfo}
|
||||
handleSubmit={handleSubmit}
|
||||
type={activeIndex ? "password" : "mobile"}
|
||||
/>
|
||||
</Swiper.Item>
|
||||
<Swiper.Item className="px-10">
|
||||
<div className="border-2 border-[#2c2b2f] rounded-2xl p-4">
|
||||
<div className="flex flex-row flex-nowrap items-center mb-4">
|
||||
<p className="text-base text-white mr-4">
|
||||
+{loginInfo.regionCode}
|
||||
</p>
|
||||
<Input
|
||||
clearable
|
||||
placeholder="请输入手机号"
|
||||
// disabled={true}
|
||||
type="number"
|
||||
maxLength={11}
|
||||
onChange={(value) =>
|
||||
setLoginInfo({ ...loginInfo, mobilePhone: value })
|
||||
}
|
||||
value={loginInfo.mobilePhone}
|
||||
style={{
|
||||
"--color": "#FFFFFF",
|
||||
"--font-size": "16px",
|
||||
"--placeholder-color": "#FFFFFF80",
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<Divider />
|
||||
<div className="flex flex-row flex-nowrap items-center">
|
||||
<p className="text-base text-white mr-4 whitespace-nowrap">
|
||||
密码
|
||||
</p>
|
||||
<Input
|
||||
clearable
|
||||
placeholder="请输入密码"
|
||||
onChange={(value) =>
|
||||
setLoginInfo({ ...loginInfo, password: value })
|
||||
}
|
||||
value={loginInfo.password}
|
||||
type="password"
|
||||
style={{
|
||||
"--placeholder-color": "#FFFFFF80",
|
||||
"--font-size": "16px",
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
onClick={() => router.push(`/my/setting/editPassword`)}
|
||||
className="w-full text-[#FF669E] text-xs mt-2 text-right"
|
||||
>
|
||||
忘记密码?
|
||||
</div>
|
||||
<LoginBtn
|
||||
loginInfo={loginInfo}
|
||||
setLoginInfo={setLoginInfo}
|
||||
handleSubmit={handleSubmit}
|
||||
type={activeIndex ? "password" : "mobile"}
|
||||
/>
|
||||
</Swiper.Item>
|
||||
</Swiper>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
@ -367,14 +383,18 @@ const LoginBtn = ({ loginInfo, setLoginInfo, type, handleSubmit }) => {
|
|||
<span className="text-[#FFFFFF80] font-medium text-xs ml-2">
|
||||
我已阅读并同意
|
||||
<span
|
||||
onClick={() => router.push(`webView/${encodeURIComponent("/doc/useragreement")}`)}
|
||||
onClick={() =>
|
||||
router.push(`webView/${encodeURIComponent("/doc/useragreement")}`)
|
||||
}
|
||||
className="text-[#FF669E] text-xs"
|
||||
>
|
||||
《用户协议》
|
||||
</span>
|
||||
、
|
||||
<span
|
||||
onClick={() => router.push(`webView/${encodeURIComponent("/doc/privatypolicy")}`)}
|
||||
onClick={() =>
|
||||
router.push(`webView/${encodeURIComponent("/doc/privatypolicy")}`)
|
||||
}
|
||||
className="text-[#FF669E] text-xs"
|
||||
>
|
||||
《隐私政策》
|
||||
|
|
|
@ -7,6 +7,8 @@ import { faAngleLeft } from "@fortawesome/free-solid-svg-icons";
|
|||
import { useRouter } from "next/navigation";
|
||||
import UploadImgs from "@/components/UploadImgs";
|
||||
import { get } from "@/utils/storeInfo";
|
||||
import {multiUploadImage} from "@/utils/upload";
|
||||
import requireAPI from "@/utils/requireAPI";
|
||||
export default function Feedback() {
|
||||
const [value, setValue] = useState();
|
||||
const [assets, setAssets] = useState([]);
|
||||
|
@ -22,40 +24,41 @@ export default function Feedback() {
|
|||
});
|
||||
return;
|
||||
}
|
||||
|
||||
//提交数据
|
||||
setIsSubmitting(true);
|
||||
// const media = await multiUpload(assets);
|
||||
console.log("media",{image_ids:assets,video_ids:[]})
|
||||
// //提交数据
|
||||
// setIsSubmitting(true);
|
||||
// const media = await multiUpload(assets);
|
||||
// const account = await get("account");
|
||||
// try {
|
||||
// const data = await requireAPI("POST", `/api/feedback/create`, {
|
||||
// body: {
|
||||
// mid: account.mid,
|
||||
// discription: value,
|
||||
// credentials: media,
|
||||
// },
|
||||
// });
|
||||
// if (data.ret === -1) {
|
||||
// Toast.show({
|
||||
// icon: "fail",
|
||||
// content: data.msg,
|
||||
// position: "top",
|
||||
// });
|
||||
// return;
|
||||
// }
|
||||
// //提交成功后显示Toast并返回上一页
|
||||
// Toast.show({
|
||||
// icon: "success",
|
||||
// content: "反馈提交成功",
|
||||
// position: "top",
|
||||
// });
|
||||
// router.goBack();
|
||||
// } catch (error) {
|
||||
// console.error(error);
|
||||
// } finally {
|
||||
// setIsSubmitting(false);
|
||||
// }
|
||||
const media = await multiUploadImage(assets);
|
||||
console.log("media",media)
|
||||
const account = await get("account");
|
||||
try {
|
||||
const data = await requireAPI("POST", `/api/feedback/create`, {
|
||||
body: {
|
||||
mid: account.mid,
|
||||
discription: value,
|
||||
credentials: media,
|
||||
},
|
||||
});
|
||||
if (data.ret === -1) {
|
||||
Toast.show({
|
||||
icon: "fail",
|
||||
content: data.msg,
|
||||
position: "top",
|
||||
});
|
||||
return;
|
||||
}
|
||||
//提交成功后显示Toast并返回上一页
|
||||
Toast.show({
|
||||
icon: "success",
|
||||
content: "反馈提交成功",
|
||||
position: "top",
|
||||
});
|
||||
router.back();
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
} finally {
|
||||
setIsSubmitting(false);
|
||||
}
|
||||
};
|
||||
return (
|
||||
<div>
|
||||
|
@ -84,7 +87,7 @@ export default function Feedback() {
|
|||
<p className="text-base font-medium text-white mt-4 mb-1">
|
||||
截图(最多9张)
|
||||
</p>
|
||||
<UploadImgs getImgs={setAssets} />
|
||||
<UploadImgs assets={assets} getImgs={setAssets} />
|
||||
<div className="mt-16">
|
||||
<Button
|
||||
shape="rounded"
|
||||
|
|
|
@ -95,11 +95,8 @@ export default function Wallet() {
|
|||
// title: "充值中心",
|
||||
// uri: process.env.EXPO_PUBLIC_WEB_URL + "/pay",
|
||||
// })
|
||||
|
||||
router.replace(
|
||||
process.env.NEXT_PUBLIC_WEB_URL +
|
||||
"/pay?base=" +
|
||||
encodeURIComponent(JSON.stringify(base))
|
||||
router.push(
|
||||
`/webView/${encodeURIComponent(`pay?mid=${encodeURIComponent(JSON.stringify(base))}`)}`
|
||||
)
|
||||
}
|
||||
className="flex justify-between items-center py-4 w-full"
|
||||
|
@ -145,8 +142,8 @@ export default function Wallet() {
|
|||
</div>
|
||||
<div
|
||||
onClick={() =>
|
||||
router.replace(
|
||||
`/webView/${encodeURIComponent(`withdrawal?mid=${data?.mid}&mobile_phone=${mobilePhone}&token=${temToken}`)}`
|
||||
window && window.open(
|
||||
`${process.env.NEXT_PUBLIC_WEB_URL}/withdrawal?mid=${data?.mid}&mobile_phone=${mobilePhone}&token=${temToken}`
|
||||
)
|
||||
}
|
||||
className="flex justify-between items-center py-4"
|
||||
|
|
|
@ -22,10 +22,12 @@ export default function PersonSpace() {
|
|||
<p className="text-base text-center leading-9"></p>
|
||||
</div>
|
||||
{/* 内容 */}
|
||||
<div className="mt-12">
|
||||
<iframe
|
||||
src={`${process.env.NEXT_PUBLIC_WEB_URL}/` + decodeURIComponent(src)}
|
||||
className="w-full h-[100vh]"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -3,23 +3,24 @@ import { DotLoading, Image, ImageViewer } from "antd-mobile";
|
|||
import { uploadImage, uploadVideo } from "@/utils/upload";
|
||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||
import { faAdd, faClose } from "@fortawesome/free-solid-svg-icons";
|
||||
export default function UploadImgs({ getImgs }) {
|
||||
export default function UploadImgs({assets, getImgs }) {
|
||||
const maxCount = 6;
|
||||
const [fileList, setFileList] = useState([]);
|
||||
const [loading, setLoading] = useState(false);
|
||||
const handleUploadImage = async (e) => {
|
||||
let file = e.target.files[0];
|
||||
|
||||
if (!file) return;
|
||||
setLoading(true);
|
||||
if (file.type.indexOf("image/") != -1) {
|
||||
// const image = await uploadImage(file);
|
||||
// getImgs((old) => [...old, image.id]);
|
||||
const assets = [
|
||||
...fileList,
|
||||
{ type: "img", src: URL.createObjectURL(file) },
|
||||
const newFiles = [
|
||||
...assets,
|
||||
file,
|
||||
];
|
||||
setFileList(assets);
|
||||
const newAssets = newFiles.map(item=>({ type: "img", src: URL.createObjectURL(item) }));
|
||||
setFileList(newAssets);
|
||||
getImgs(newFiles);
|
||||
} else if (file.type.indexOf("video/") != -1) {
|
||||
const videoD = document.getElementById("videoD");
|
||||
const videoC = document.getElementById("videoC");
|
||||
|
@ -42,11 +43,12 @@ export default function UploadImgs({ getImgs }) {
|
|||
// const video = await uploadVideo(file);
|
||||
// getImgs((old) => [...old, video.id]);
|
||||
// setFileList((old) => [...old, video]);
|
||||
const assets = [
|
||||
...fileList,
|
||||
{ type: "video", src: URL.createObjectURL(file) },
|
||||
const newFiles = [
|
||||
...assets,
|
||||
file,
|
||||
];
|
||||
setFileList(assets);
|
||||
const newAssets = newFiles.map(item=>({ type: "video", src: URL.createObjectURL(item) }));
|
||||
setFileList(newAssets);
|
||||
}
|
||||
|
||||
setLoading(false);
|
||||
|
@ -124,7 +126,7 @@ export default function UploadImgs({ getImgs }) {
|
|||
onChange={handleUploadImage}
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<div className="hidden">
|
||||
<video id="videoD">
|
||||
<source src={fileList[0]?.src} />
|
||||
您的浏览器不支持 Video 标签。
|
||||
|
|
|
@ -126,8 +126,9 @@ async function getFailId() {
|
|||
|
||||
//上传单张图片
|
||||
export async function uploadImage(asset) {
|
||||
console.log("uploadResponse",asset)
|
||||
|
||||
const auth = await getAuth(1);
|
||||
console.log("auth",auth)
|
||||
try {
|
||||
const formData = new FormData();
|
||||
formData.append("name", auth.filename);
|
||||
|
@ -137,11 +138,12 @@ export async function uploadImage(asset) {
|
|||
formData.append("signature", auth.signature);
|
||||
formData.append("key", auth.directory + "/" + auth.filename);
|
||||
formData.append("file", asset);
|
||||
|
||||
console.log("formData",...formData)
|
||||
const uploadResponse = await fetch(auth.host, {
|
||||
method: "POST",
|
||||
body: formData,
|
||||
});
|
||||
console.log("uploadResponse",uploadResponse)
|
||||
if (uploadResponse.status === 200) {
|
||||
// console.log(asset);
|
||||
// debugger
|
||||
|
@ -285,8 +287,9 @@ export async function multiUploadImage(assets) {
|
|||
console.log("assets",assets)
|
||||
let ids = { image_ids: [], video_ids: [] };
|
||||
await Promise.all(
|
||||
assets.forEach(async (asset) => {
|
||||
const id = await uploadImage(asset);
|
||||
assets.map(async (asset) => {
|
||||
const id = await uploadImage(asset.src);
|
||||
debugger;
|
||||
ids.image_ids.push(id);
|
||||
})
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue