diff --git a/src/components/ListLoadError/index.tsx b/src/components/ListLoadError/index.tsx index a4af789..551053f 100644 --- a/src/components/ListLoadError/index.tsx +++ b/src/components/ListLoadError/index.tsx @@ -8,16 +8,17 @@ interface IProps { errorImg?: string; btnText?: string; btnImg?: string; + height?: string } const ListLoadError = (props: IProps) => { - const { reload, text, errorImg, btnText, btnImg } = props; + const { reload, text, errorImg, btnText, btnImg, height = "unset" } = props; const handleReload = () => { reload && typeof reload === "function" && reload(); }; return ( - + void; }) { const [testFlag, setTestFlag] = useState(false); const [hasTestInLastMonth, setHasTestInLastMonth] = useState(false); - const { type, evaluateCallback } = props; + const { type, evaluateCallback, callback } = props; const userInfo = useUserInfo(); const { setCallback } = useEvaluate(); const { fetchUserInfo } = useUserActions(); @@ -41,6 +42,7 @@ function NTRPTestEntryCard(props: { if (res.code === 0) { setTestFlag(res.data.has_test_record); setHasTestInLastMonth(res.data.has_test_in_last_month); + callback?.(res.data.has_test_in_last_month); } }; init(); diff --git a/src/components/Picker/PopupPicker.tsx b/src/components/Picker/PopupPicker.tsx index ac7cdc0..3d01016 100644 --- a/src/components/Picker/PopupPicker.tsx +++ b/src/components/Picker/PopupPicker.tsx @@ -52,6 +52,7 @@ const PopupPicker = ({ const [defaultValue, setDefaultValue] = useState<(string | number)[]>([]); const [defaultOptions, setDefaultOptions] = useState([]); const [pickerCurrentValue, setPickerCurrentValue] = useState<(string | number)[]>(value); + const [tested, setTested] = useState(false) const changePicker = (options: any[], values: any, columnIndex: number) => { // 更新 Picker 的当前值 @@ -126,6 +127,9 @@ const PopupPicker = ({ } } }, [visible, value]); + const callback = (tested: boolean) => { + setTested(tested) + } return ( <> - {type === "ntrp" && ( + {type === "ntrp" && !tested && ( - + callback(flag)} type={EvaluateScene.userEdit} /> // // diff --git a/src/components/UserInfo/index.tsx b/src/components/UserInfo/index.tsx index b450031..d513b4f 100644 --- a/src/components/UserInfo/index.tsx +++ b/src/components/UserInfo/index.tsx @@ -486,7 +486,7 @@ const UserInfoCardComponent: React.FC = ({ 选择性别 ) : null} - {user_info.ntrp_level !== "0" ? ( + {user_info.ntrp_level !== "" ? ( { diff --git a/src/container/listContainer/index.tsx b/src/container/listContainer/index.tsx index 545c41d..300578d 100644 --- a/src/container/listContainer/index.tsx +++ b/src/container/listContainer/index.tsx @@ -29,6 +29,7 @@ const ListContainer = (props) => { collapse = false, defaultShowNum, evaluateFlag, + listLoadErrorHeight, } = props; const timerRef = useRef(null); const loadingStartTimeRef = useRef(null); @@ -132,7 +133,7 @@ const ListContainer = (props) => { if (hasTestInLastMonth) { return list; } - + if (list.length <= 2) { return [...list, { type: "evaluateCard" }]; } @@ -156,6 +157,7 @@ const ListContainer = (props) => { btnText={btnText} btnImg={btnImg} text={emptyText || "暂无数据"} + height={listLoadErrorHeight || ""} /> ); } diff --git a/src/main_pages/components/MyselfPageContent.tsx b/src/main_pages/components/MyselfPageContent.tsx index b1c4422..6944857 100644 --- a/src/main_pages/components/MyselfPageContent.tsx +++ b/src/main_pages/components/MyselfPageContent.tsx @@ -131,6 +131,7 @@ const MyselfPageContent: React.FC = () => { const handle_wallet = () => { (Taro as any).navigateTo({ url: "/user_pages/wallet/index", + // url: "/user_pages/other/index?userid=18", }); }; @@ -213,6 +214,7 @@ const MyselfPageContent: React.FC = () => { loadMoreMatches={() => {}} collapse={true} style={{ paddingBottom: 0, overflow: "hidden" }} + listLoadErrorHeight="320px" defaultShowNum={3} /> @@ -231,6 +233,7 @@ const MyselfPageContent: React.FC = () => { loadMoreMatches={() => {}} collapse={true} style={{ paddingBottom: "90px", overflow: "hidden" }} + listLoadErrorHeight="320px" defaultShowNum={3} /> diff --git a/src/other_pages/ntrp-evaluate/index.tsx b/src/other_pages/ntrp-evaluate/index.tsx index beea3ea..e082d04 100644 --- a/src/other_pages/ntrp-evaluate/index.tsx +++ b/src/other_pages/ntrp-evaluate/index.tsx @@ -194,9 +194,8 @@ function Intro() { }); } Taro.redirectTo({ - url: `/other_pages/ntrp-evaluate/index?stage=${type}${ - type === StageType.RESULT ? `&id=${id}` : "" - }`, + url: `/other_pages/ntrp-evaluate/index?stage=${type}${type === StageType.RESULT ? `&id=${id}` : "" + }`, }); } @@ -639,13 +638,12 @@ function Result() { } const currentPage = getCurrentFullPath(); Taro.redirectTo({ - url: `/login_pages/index/index${ - currentPage ? `?redirect=${encodeURIComponent(currentPage)}` : "" - }`, + url: `/login_pages/index/index${currentPage ? `?redirect=${encodeURIComponent(currentPage)}` : "" + }`, }); } - function handleGo() {} + function handleGo() { } return ( diff --git a/src/user_pages/edit/index.scss b/src/user_pages/edit/index.scss index 16e5ca6..6705d02 100644 --- a/src/user_pages/edit/index.scss +++ b/src/user_pages/edit/index.scss @@ -1,13 +1,17 @@ // 编辑资料页面样式 .edit_profile_page { height: 100vh; // position: relative; - background: radial-gradient( - circle at 50% 0, - /* 光晕圆心在顶部中间 */ rgba(191, 255, 239, 0.9) 0px, - /* 中间更深的浅蓝 */ rgba(191, 255, 239, 0.5) 200px, - /* 100px 处开始淡化 */ #fafafa 300px, - /* 到 200px 变成白色 */ #fafafa 100% /* 200px 以下全白 */ - ); + background: radial-gradient(circle at 50% 0, + /* 光晕圆心在顶部中间 */ + rgba(191, 255, 239, 0.9) 0px, + /* 中间更深的浅蓝 */ + rgba(191, 255, 239, 0.5) 200px, + /* 100px 处开始淡化 */ + #fafafa 300px, + /* 到 200px 变成白色 */ + #fafafa 100% + /* 200px 以下全白 */ + ); position: relative; // overflow: hidden; box-sizing: border-box; @@ -52,7 +56,7 @@ display: flex; justify-content: center; - & > .detail-navigator-back-icon { + &>.detail-navigator-back-icon { width: 32px; height: 32px; } @@ -341,6 +345,31 @@ font-size: 16px; line-height: 1.4em; color: #000000; + + &.close_account { + color: #fe3c31; + } + } + } + + &.group { + border: 1px solid rgba(0, 0, 0, 0.12); + border-radius: 16px; + overflow: hidden; + + .logout_button { + border: unset; + border-radius: unset; + + Image { + width: 20px; + height: 20px; + margin-right: 12px; + } + + &:first-child { + border-bottom: 1px solid rgba(0, 0, 0, 0.12); + } } } } @@ -360,4 +389,4 @@ color: rgba(0, 0, 0, 0.6); } } -} +} \ No newline at end of file diff --git a/src/user_pages/edit/index.tsx b/src/user_pages/edit/index.tsx index d00a6dc..c09d419 100644 --- a/src/user_pages/edit/index.tsx +++ b/src/user_pages/edit/index.tsx @@ -12,6 +12,7 @@ import CommonDialog from "@/components/CommonDialog"; import { useUserActions, useUserInfo } from "@/store/userStore"; import { UserInfoType } from "@/services/userService"; import { useCities, useProfessions } from "@/store/pickerOptionsStore"; +import { handleCustomerService } from "@/services/userService"; const EditProfilePage: React.FC = () => { const { updateUserInfo } = useUserActions(); @@ -414,6 +415,8 @@ const EditProfilePage: React.FC = () => { } }; + const handleAddGroup = () => {} + const getDefaultOption = (options) => { if (!Array.isArray(options) || options.length === 0) { return []; @@ -688,9 +691,9 @@ const EditProfilePage: React.FC = () => { > {form_data.phone ? form_data.phone.replace( - /(\d{3})(\d{4})(\d{4})/, - "$1 $2 $3" - ) + /(\d{3})(\d{4})(\d{4})/, + "$1 $2 $3" + ) : "未绑定"} { - {/* 注销账号 */} - - - 注销账号 + + + + 客服聊天 + + + + 加入社群 @@ -716,6 +723,13 @@ const EditProfilePage: React.FC = () => { 退出登录 + + {/* 注销账号 */} + + + 注销账号 + + )} @@ -741,104 +755,114 @@ const EditProfilePage: React.FC = () => { } /> {/* 性别选择弹窗 */} - {gender_picker_visible && ( - - )} + { + gender_picker_visible && ( + + ) + } {/* 生日选择弹窗 */} - {birthday_picker_visible && ( - - )} + { + birthday_picker_visible && ( + + ) + } {/* 地区选择弹窗 */} - {location_picker_visible && ( - - )} + { + location_picker_visible && ( + + ) + } {/* NTRP水平选择弹窗 */} - {ntrp_picker_visible && ( - - )} + { + ntrp_picker_visible && ( + + ) + } {/* 职业选择弹窗 */} - {occupation_picker_visible && ( - - )} + { + occupation_picker_visible && ( + + ) + } {/* 取消关注确认弹窗 */} { contentTitle="确定要注销账号吗?" contentDesc="你的账号将会彻底删除,该操作不可恢复。" /> - + ); }; diff --git a/src/user_pages/follow/index.tsx b/src/user_pages/follow/index.tsx index 4ee25a5..8e335be 100644 --- a/src/user_pages/follow/index.tsx +++ b/src/user_pages/follow/index.tsx @@ -7,6 +7,7 @@ import { FollowService, FollowUser } from '@/services/followService'; import { withAuth } from '@/components'; import './index.scss'; import CommonDialog from '@/components/CommonDialog' +import { useUserActions } from "@/store/userStore"; // 标签页类型 type TabType = 'mutual_follow' | 'following' | 'follower' | 'recommend'; @@ -20,6 +21,7 @@ const TAB_CONFIG = [ ]; const FollowPage: React.FC = () => { + const { fetchUserInfo } = useUserActions(); // 获取页面参数,支持指定默认标签页 const instance = Taro.getCurrentInstance(); const default_tab = (instance.router?.params?.tab as TabType) || 'mutual_follow'; @@ -145,6 +147,7 @@ const FollowPage: React.FC = () => { if (is_following) { await FollowService.follow_user(user_id); updateFollowStatus(user_id, is_following); + fetchUserInfo() // Taro.showToast({ // title: '关注成功', // icon: 'success' @@ -219,6 +222,7 @@ const FollowPage: React.FC = () => { await FollowService.unfollow_user(deleteConfirm.userId!); closeDeleteConfirm(); updateFollowStatus(deleteConfirm.userId!, false); + fetchUserInfo() // Taro.showToast({ // title: '取消关注成功', // icon: 'success' @@ -235,7 +239,7 @@ const FollowPage: React.FC = () => { return ( {/* 自定义导航栏 */} - { + const { fetchUserInfo } = useUserActions(); // 获取页面参数 const instance = Taro.getCurrentInstance(); const user_id = instance.router?.params?.userid; @@ -182,6 +184,7 @@ const OtherUserPage: React.FC = () => { is_following ); setIsFollowing(new_follow_status); + fetchUserInfo() Taro.showToast({ title: new_follow_status ? "关注成功" : "已取消关注", icon: "success", @@ -237,7 +240,7 @@ const OtherUserPage: React.FC = () => { }} /> {/* 主要内容 */} -