修复忘记密码和筛选功能,我的页面添加会员图标
This commit is contained in:
parent
f50939f970
commit
25a83ba8ca
|
@ -1,9 +1,9 @@
|
|||
import { get } from "@/utils/storeInfo";
|
||||
import { get, clear } from "@/utils/storeInfo";
|
||||
import requireAPI from "@/utils/requireAPI";
|
||||
import { Toast } from "antd-mobile";
|
||||
import { JSEncrypt } from "jsencrypt";
|
||||
import baseRequest from "@/utils/baseRequest";
|
||||
//关注和取关功能
|
||||
//退出登录
|
||||
export const handleLogout = async () => {
|
||||
const account = get("account");
|
||||
try {
|
||||
|
@ -20,6 +20,7 @@ export const handleLogout = async () => {
|
|||
});
|
||||
return;
|
||||
}
|
||||
clear();
|
||||
} catch (error) {
|
||||
// console.error(error);
|
||||
}
|
||||
|
|
|
@ -380,7 +380,9 @@ function Login({ handleLogin }) {
|
|||
<div className="flex justify-end">
|
||||
<span
|
||||
onClick={() =>
|
||||
router.push(`/my/setting/editPassword?forgetPassword=true`)
|
||||
router.push(
|
||||
`/my/setting/editPassword?forgetPassword=true&phone=${loginInfo.mobilePhone}`
|
||||
)
|
||||
}
|
||||
className="text-[#FF669E] text-xs mt-2 text-right"
|
||||
>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
import React, { useEffect, useState } from "react";
|
||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||
import { faAngleRight } from "@fortawesome/free-solid-svg-icons";
|
||||
import { Avatar, Image, Toast } from "antd-mobile";
|
||||
import { Avatar, Image, Toast, Space } from "antd-mobile";
|
||||
import { useRouter, useSearchParams } from "next/navigation";
|
||||
import { get } from "@/utils/storeInfo";
|
||||
import requireAPI from "@/utils/requireAPI";
|
||||
|
@ -94,7 +94,27 @@ const My = () => {
|
|||
style={{ "--size": "76px", "--border-radius": "50%" }}
|
||||
/>
|
||||
<div>
|
||||
<p className="text-2xl">{userInfo.name}</p>
|
||||
<Space align="center">
|
||||
<p
|
||||
className={`text-2xl`}
|
||||
style={{
|
||||
color: userInfo?.is_a_member === 1 ? "#FFADBE" : "white",
|
||||
}}
|
||||
>
|
||||
{userInfo.name}
|
||||
</p>
|
||||
{userInfo?.is_a_member === 1 && (
|
||||
<Image
|
||||
src={
|
||||
process.env.NEXT_PUBLIC_WEB_ASSETS_URL +
|
||||
"/icons/vipbig.png"
|
||||
}
|
||||
width={32}
|
||||
height={32}
|
||||
placeholder=""
|
||||
/>
|
||||
)}
|
||||
</Space>
|
||||
<div className="h-4 flex items-center text-xs bg-[#ffffff18] rounded-full px-2 py-2.5 mt-1 w-max">
|
||||
<Image
|
||||
src={
|
||||
|
|
|
@ -12,15 +12,17 @@ import { cryptoPassword } from "@/utils/crypto";
|
|||
import requireAPI from "@/utils/requireAPI";
|
||||
import { signOut } from "@/utils/auth";
|
||||
export default function EditPassword() {
|
||||
const [regionCode, setRegionCode] = useState("86");
|
||||
const [mobilePhone, setMobilePhone] = useState("");
|
||||
const searchParams = useSearchParams();
|
||||
const [regionCode] = useState("86");
|
||||
const [mobilePhone, setMobilePhone] = useState(
|
||||
searchParams.get("phone") || ""
|
||||
);
|
||||
const [veriCode, setVeriCode] = useState("");
|
||||
const [newPassword, setNewPassword] = useState("");
|
||||
const [confirmPassword, setConfirmPassword] = useState("");
|
||||
const [isCounting, setIsCounting] = useState(false);
|
||||
const [seconds, setSeconds] = useState(60);
|
||||
const router = useRouter();
|
||||
const searchParams = useSearchParams();
|
||||
// useEffect(() => {
|
||||
// const mobile_phone = get("mobile_phone");
|
||||
// console.log("mobile_phone",mobile_phone)
|
||||
|
@ -212,6 +214,8 @@ export default function EditPassword() {
|
|||
验证码
|
||||
</p>
|
||||
<Input
|
||||
autoComplete="off"
|
||||
onCompositionEnd={() => setVeriCode("")}
|
||||
placeholder="请输入验证码"
|
||||
onChange={(value) => setVeriCode(value)}
|
||||
value={veriCode}
|
||||
|
@ -241,11 +245,12 @@ export default function EditPassword() {
|
|||
新密码
|
||||
</p>
|
||||
<Input
|
||||
name="password"
|
||||
autocomplete="new-password"
|
||||
placeholder="请输入8-15位新密码"
|
||||
onChange={(value) => setNewPassword(value)}
|
||||
value={newPassword}
|
||||
type="password"
|
||||
autoComplete="off"
|
||||
style={{
|
||||
"--placeholder-color": "#FFFFFF80",
|
||||
"--font-size": "16px",
|
||||
|
|
|
@ -10,6 +10,7 @@ import {
|
|||
Popup,
|
||||
Radio,
|
||||
Picker,
|
||||
Space,
|
||||
} from "antd-mobile";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||
|
@ -368,7 +369,6 @@ export default function Search() {
|
|||
delete currentFilterValue.comprehensiveUsed;
|
||||
delete currentFilterValue.priceUsed;
|
||||
querryParams = currentFilterValue;
|
||||
console.log("querryParams", querryParams);
|
||||
try {
|
||||
const data = await requireAPI("POST", "/api/streamer/filter", {
|
||||
body: { ...querryParams },
|
||||
|
@ -547,7 +547,9 @@ export default function Search() {
|
|||
}}
|
||||
>
|
||||
<Popup
|
||||
destroyOnClose={true}
|
||||
closeOnMaskClick={true}
|
||||
// stopPropagation={["touchstart"]}
|
||||
maskStyle={{ backgroundColor: "#0000004d" }}
|
||||
visible={isFilterVisible.comprehensive}
|
||||
bodyStyle={{
|
||||
|
@ -561,9 +563,32 @@ export default function Search() {
|
|||
})
|
||||
}
|
||||
>
|
||||
<Space className="p-4" justify="between" align="center" block={true}>
|
||||
<p className="text-xl font-bold">综合筛选</p>
|
||||
<div
|
||||
className="p-2 rounded-xl flex justify-center items-center mr-2 bg-[#ffffff1a]"
|
||||
style={{
|
||||
width: 32,
|
||||
height: 32,
|
||||
}}
|
||||
>
|
||||
<FontAwesomeIcon
|
||||
icon={faClose}
|
||||
size="xl"
|
||||
className="text-whitex"
|
||||
onClick={() => {
|
||||
setIsFilterVisible({
|
||||
zone_admission_price: false,
|
||||
comprehensive: false,
|
||||
});
|
||||
setCurrentFiltersChangeValue(filtersValue);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</Space>
|
||||
<div
|
||||
className="overflow-y-auto"
|
||||
style={{ height: "calc(100vh - 110px)" }}
|
||||
style={{ height: "calc(100vh - 170px)" }}
|
||||
>
|
||||
{filters.map((item, index) => (
|
||||
<div
|
||||
|
@ -789,6 +814,7 @@ export default function Search() {
|
|||
</div>
|
||||
</Popup>
|
||||
<Popup
|
||||
stopPropagation={["touchstart"]}
|
||||
closeOnMaskClick={true}
|
||||
maskStyle={{ backgroundColor: "#0000004d" }}
|
||||
bodyStyle={{
|
||||
|
@ -803,9 +829,32 @@ export default function Search() {
|
|||
}
|
||||
visible={isFilterVisible.zone_admission_price}
|
||||
>
|
||||
<Space className="p-4" justify="between" align="center" block={true}>
|
||||
<p className="text-xl font-bold">价格筛选</p>
|
||||
<div
|
||||
className="p-2 rounded-xl flex justify-center items-center mr-2 bg-[#ffffff1a]"
|
||||
style={{
|
||||
width: 32,
|
||||
height: 32,
|
||||
}}
|
||||
>
|
||||
<FontAwesomeIcon
|
||||
icon={faClose}
|
||||
size="xl"
|
||||
className="text-whitex"
|
||||
onClick={() => {
|
||||
setIsFilterVisible({
|
||||
zone_admission_price: false,
|
||||
comprehensive: false,
|
||||
});
|
||||
setCurrentFiltersChangeValue(filtersValue);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</Space>
|
||||
<div
|
||||
className="overflow-y-auto"
|
||||
style={{ height: "calc(100vh - 110px)" }}
|
||||
style={{ height: "calc(100vh - 170px)" }}
|
||||
>
|
||||
{priceFilters.map((item, index) => (
|
||||
<div
|
||||
|
|
|
@ -22,9 +22,8 @@ export default function WithAuth(WrappedComponent) {
|
|||
}, [pathname]);
|
||||
const checkLogin = async () => {
|
||||
const hasToken = await get("token");
|
||||
// console.log("hasToken", hasToken);
|
||||
if(pathname.includes("wxpay_h5")){
|
||||
return
|
||||
if (pathname.includes("wxpay_h5")) {
|
||||
return;
|
||||
}
|
||||
if (hasToken) {
|
||||
const currentIsLogin = await checkAuth();
|
||||
|
|
Loading…
Reference in New Issue