This commit is contained in:
2025-11-22 15:46:23 +08:00
parent b2b665dfb6
commit cba231ab3d
11 changed files with 197 additions and 127 deletions

View File

@@ -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);
}
}
}
}

View File

@@ -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"
)
: "未绑定"}
</Button>
<Image
@@ -703,10 +706,14 @@ const EditProfilePage: React.FC = () => {
</View>
</View>
{/* 注销账号 */}
<View className="logout_section">
<View className="logout_button" onClick={handle_close_account}>
<Text className="logout_text"></Text>
<View className="logout_section group">
<View className="logout_button" onClick={handleCustomerService}>
<Image src={require("@/static/wallet/custom-service.svg")}></Image>
<Text className="logout_text"></Text>
</View>
<View className="logout_button" onClick={handleAddGroup}>
<Image src={require("@/static/userInfo/chat.svg")}></Image>
<Text className="logout_text"></Text>
</View>
</View>
@@ -716,6 +723,13 @@ const EditProfilePage: React.FC = () => {
<Text className="logout_text">退</Text>
</View>
</View>
{/* 注销账号 */}
<View className="logout_section">
<View className="logout_button" onClick={handle_close_account}>
<Text className="logout_text close_account"></Text>
</View>
</View>
</>
)}
</View>
@@ -741,104 +755,114 @@ const EditProfilePage: React.FC = () => {
}
/>
{/* 性别选择弹窗 */}
{gender_picker_visible && (
<PopupPicker
showHeader={true}
title="选择性别"
confirmText="保存"
options={[
[
{ text: "男", value: "0" },
{ text: "", value: "1" },
{ text: "保密", value: "2" },
],
]}
visible={gender_picker_visible}
setvisible={setGenderPickerVisible}
value={form_data.gender === "" ? ["0"] : [form_data.gender]}
onChange={handle_gender_change}
/>
)}
{
gender_picker_visible && (
<PopupPicker
showHeader={true}
title="选择性别"
confirmText="保存"
options={[
[
{ text: "", value: "0" },
{ text: "", value: "1" },
{ text: "保密", value: "2" },
],
]}
visible={gender_picker_visible}
setvisible={setGenderPickerVisible}
value={form_data.gender === "" ? ["0"] : [form_data.gender]}
onChange={handle_gender_change}
/>
)
}
{/* 生日选择弹窗 */}
{birthday_picker_visible && (
<PopupPicker
minYear={1970}
maxYear={new Date().getFullYear()}
showHeader={true}
title="选择生日"
confirmText="保存"
visible={birthday_picker_visible}
setvisible={setBirthdayPickerVisible}
value={[
new Date(form_data.birthday).getFullYear(),
new Date(form_data.birthday).getMonth() + 1,
new Date(form_data.birthday).getDate(),
]}
type="day"
onChange={handle_birthday_change}
/>
)}
{
birthday_picker_visible && (
<PopupPicker
minYear={1970}
maxYear={new Date().getFullYear()}
showHeader={true}
title="选择生日"
confirmText="保存"
visible={birthday_picker_visible}
setvisible={setBirthdayPickerVisible}
value={[
new Date(form_data.birthday).getFullYear(),
new Date(form_data.birthday).getMonth() + 1,
new Date(form_data.birthday).getDate(),
]}
type="day"
onChange={handle_birthday_change}
/>
)
}
{/* 地区选择弹窗 */}
{location_picker_visible && (
<PopupPicker
showHeader={true}
title="选择地区"
confirmText="保存"
options={cities}
visible={location_picker_visible}
setvisible={setLocationPickerVisible}
value={
form_data.country
? [form_data.country, form_data.province, form_data.city]
: getDefaultOption(cities)
}
onChange={handle_location_change}
/>
)}
{
location_picker_visible && (
<PopupPicker
showHeader={true}
title="选择地区"
confirmText="保存"
options={cities}
visible={location_picker_visible}
setvisible={setLocationPickerVisible}
value={
form_data.country
? [form_data.country, form_data.province, form_data.city]
: getDefaultOption(cities)
}
onChange={handle_location_change}
/>
)
}
{/* NTRP水平选择弹窗 */}
{ntrp_picker_visible && (
<PopupPicker
showHeader={true}
title="选择 NTRP 自评水平"
confirmText="保存"
options={[
[
{ text: "1.5", value: "1.5" },
{ text: "2.0", value: "2.0" },
{ text: "2.5", value: "2.5" },
{ text: "3.0", value: "3.0" },
{ text: "3.5", value: "3.5" },
{ text: "4.0", value: "4.0" },
{ text: "4.5", value: "4.5" },
],
]}
type="ntrp"
// img={(user_info as UserInfoType)?.avatar_url}
visible={ntrp_picker_visible}
setvisible={setNtrpPickerVisible}
value={
form_data.ntrp_level === "0" ? ["3.0"] : [form_data.ntrp_level]
}
onChange={handle_ntrp_level_change}
/>
)}
{
ntrp_picker_visible && (
<PopupPicker
showHeader={true}
title="选择 NTRP 自评水平"
confirmText="保存"
options={[
[
{ text: "1.5", value: "1.5" },
{ text: "2.0", value: "2.0" },
{ text: "2.5", value: "2.5" },
{ text: "3.0", value: "3.0" },
{ text: "3.5", value: "3.5" },
{ text: "4.0", value: "4.0" },
{ text: "4.5", value: "4.5" },
],
]}
type="ntrp"
// img={(user_info as UserInfoType)?.avatar_url}
visible={ntrp_picker_visible}
setvisible={setNtrpPickerVisible}
value={
form_data.ntrp_level === "0" ? ["3.0"] : [form_data.ntrp_level]
}
onChange={handle_ntrp_level_change}
/>
)
}
{/* 职业选择弹窗 */}
{occupation_picker_visible && (
<PopupPicker
showHeader={true}
title="选择职业"
confirmText="保存"
options={professions}
visible={occupation_picker_visible}
setvisible={setOccupationPickerVisible}
value={
form_data.occupation
? [...form_data.occupation.split(" ")]
: getDefaultOption(professions)
}
onChange={handle_occupation_change}
/>
)}
{
occupation_picker_visible && (
<PopupPicker
showHeader={true}
title="选择职业"
confirmText="保存"
options={professions}
visible={occupation_picker_visible}
setvisible={setOccupationPickerVisible}
value={
form_data.occupation
? [...form_data.occupation.split(" ")]
: getDefaultOption(professions)
}
onChange={handle_occupation_change}
/>
)
}
{/* 取消关注确认弹窗 */}
<CommonDialog
visible={showLogoutDialog}
@@ -851,7 +875,7 @@ const EditProfilePage: React.FC = () => {
contentTitle="确定要注销账号吗?"
contentDesc="你的账号将会彻底删除,该操作不可恢复。"
/>
</View>
</View >
);
};

View File

@@ -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 (
<View className="follow_page">
{/* 自定义导航栏 */}
<GeneralNavbar
<GeneralNavbar
title="粉丝"
titlePosition="left"
showBack={true}

View File

@@ -16,8 +16,10 @@ import { UserService, UserInfoType } from "@/services/userService";
import * as LoginService from "@/services/loginService";
import { useGlobalState } from "@/store/global";
import { GeneralNavbar } from "@/components";
import { useUserActions } from "@/store/userStore";
const OtherUserPage: React.FC = () => {
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 = () => {
}}
/>
{/* 主要内容 */}
<View
<View
className="other_main_content"
style={{ paddingTop: `${totalHeight}px` }}
>