优化
This commit is contained in:
@@ -24,6 +24,7 @@
|
|||||||
|
|
||||||
:global(.nut-dialog-content) {
|
:global(.nut-dialog-content) {
|
||||||
min-width: 280px !important;
|
min-width: 280px !important;
|
||||||
|
text-align: center !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
:global(.nut-dialog-footer) {
|
:global(.nut-dialog-footer) {
|
||||||
@@ -55,11 +56,12 @@
|
|||||||
|
|
||||||
:global(.nut-dialog-footer .nut-button-default) {
|
:global(.nut-dialog-footer .nut-button-default) {
|
||||||
color: rgba(22, 24, 35, 0.75) !important;
|
color: rgba(22, 24, 35, 0.75) !important;
|
||||||
|
font-weight: 600 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
:global(.nut-dialog-footer .nut-button-primary) {
|
:global(.nut-dialog-footer .nut-button-primary) {
|
||||||
color: #161823 !important;
|
color: #fff !important;
|
||||||
|
background: theme.$primary-color !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
:global(.nut-dialog-footer .nut-button:hover) {
|
:global(.nut-dialog-footer .nut-button:hover) {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { View, Text, Image } from '@tarojs/components';
|
import { View, Text, Image } from '@tarojs/components';
|
||||||
import Taro from '@tarojs/taro';
|
import Taro from '@tarojs/taro';
|
||||||
import { FollowUser } from '@/services/followService';
|
import { FollowService, FollowUser } from '@/services/followService';
|
||||||
import './index.scss';
|
import './index.scss';
|
||||||
|
|
||||||
|
|
||||||
@@ -52,16 +52,17 @@ const FollowUserCard: React.FC<FollowUserCardProps> = ({ user, tabKey, onFollowC
|
|||||||
};
|
};
|
||||||
|
|
||||||
// 加入黑名单
|
// 加入黑名单
|
||||||
const add_to_blacklist = () => {
|
const add_to_blacklist = async () => {
|
||||||
if (isProcessing) return;
|
if (isProcessing) return;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
setIsProcessing(true);
|
setIsProcessing(true);
|
||||||
// TODO: 加入黑名单逻辑
|
const res = await FollowService.block_recommend_user(user.id);
|
||||||
Taro.showToast({
|
if (res) {
|
||||||
title: '不会再为您推荐该用户',
|
Taro.showToast({
|
||||||
icon: 'none'
|
title: '不会再为您推荐该用户',
|
||||||
});
|
icon: 'none'
|
||||||
|
});
|
||||||
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('删除推荐人员失败:', error);
|
console.error('删除推荐人员失败:', error);
|
||||||
Taro.showToast({
|
Taro.showToast({
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ export const API_CONFIG = {
|
|||||||
HOSTED_GAMES: '/user/games',
|
HOSTED_GAMES: '/user/games',
|
||||||
PARTICIPATED_GAMES: '/user/participated',
|
PARTICIPATED_GAMES: '/user/participated',
|
||||||
PARSE_PHONE: '/user/parse_phone',
|
PARSE_PHONE: '/user/parse_phone',
|
||||||
|
LOGOUT: '/user/logout',
|
||||||
},
|
},
|
||||||
|
|
||||||
// 文件上传接口
|
// 文件上传接口
|
||||||
|
|||||||
@@ -255,6 +255,24 @@ export class FollowService {
|
|||||||
return 'none';
|
return 'none';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 屏蔽推荐用户
|
||||||
|
static async block_recommend_user(user_id: number): Promise<boolean> {
|
||||||
|
try {
|
||||||
|
const response = await httpService.post<any>(
|
||||||
|
'/user_follow/block_recommend_user',
|
||||||
|
{ blocked_user_id: user_id, reason: "user_deleted", description: "用户主动删除" },
|
||||||
|
);
|
||||||
|
if (response.code === 0) {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
throw new Error(response.message || '屏蔽推荐用户失败');
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('屏蔽推荐用户失败:', error);
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default FollowService;
|
export default FollowService;
|
||||||
@@ -4,6 +4,7 @@ import httpService, { ApiResponse } from './httpService';
|
|||||||
import uploadFiles from './uploadFiles';
|
import uploadFiles from './uploadFiles';
|
||||||
import Taro from '@tarojs/taro';
|
import Taro from '@tarojs/taro';
|
||||||
import getCurrentConfig from '@/config/env';
|
import getCurrentConfig from '@/config/env';
|
||||||
|
import { clear_login_state } from "@/services/loginService";
|
||||||
|
|
||||||
|
|
||||||
// 用户详情接口
|
// 用户详情接口
|
||||||
@@ -552,6 +553,25 @@ export class UserService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 注销账户
|
||||||
|
static async logout(): Promise<void> {
|
||||||
|
try {
|
||||||
|
const response = await httpService.post<any>(API_CONFIG.USER.LOGOUT);
|
||||||
|
const { code, message } = response;
|
||||||
|
if (code === 0) {
|
||||||
|
// 清除用户数据
|
||||||
|
clear_login_state();
|
||||||
|
|
||||||
|
Taro.reLaunch({
|
||||||
|
url: "/login_pages/index/index",
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
throw new Error(message || '注销账户失败');
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('注销账户失败:', error);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 从 loginService 移过来的用户相关方法
|
// 从 loginService 移过来的用户相关方法
|
||||||
@@ -639,7 +659,7 @@ export const handleCustomerService = async (): Promise<void> => {
|
|||||||
// 客服备用方案
|
// 客服备用方案
|
||||||
const showCustomerServiceFallback = (customerInfo?: any) => {
|
const showCustomerServiceFallback = (customerInfo?: any) => {
|
||||||
const options = ['拨打客服电话', '复制邮箱地址'];
|
const options = ['拨打客服电话', '复制邮箱地址'];
|
||||||
|
|
||||||
// 如果没有客服信息,只显示通用提示
|
// 如果没有客服信息,只显示通用提示
|
||||||
if (!customerInfo?.phoneNumber && !customerInfo?.email) {
|
if (!customerInfo?.phoneNumber && !customerInfo?.email) {
|
||||||
Taro.showModal({
|
Taro.showModal({
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import { clear_login_state } from "@/services/loginService";
|
|||||||
import { convert_db_gender_to_display } from "@/utils/genderUtils";
|
import { convert_db_gender_to_display } from "@/utils/genderUtils";
|
||||||
import { EditModal } from "@/components";
|
import { EditModal } from "@/components";
|
||||||
import img from "@/config/images";
|
import img from "@/config/images";
|
||||||
|
import CommonDialog from '@/components/CommonDialog'
|
||||||
|
|
||||||
const EditProfilePage: React.FC = () => {
|
const EditProfilePage: React.FC = () => {
|
||||||
// 用户信息状态
|
// 用户信息状态
|
||||||
@@ -49,6 +50,7 @@ const EditProfilePage: React.FC = () => {
|
|||||||
|
|
||||||
// 加载状态
|
// 加载状态
|
||||||
const [loading, setLoading] = useState(true);
|
const [loading, setLoading] = useState(true);
|
||||||
|
const [showLogoutDialog, setShowLogoutDialog] = useState(false);
|
||||||
|
|
||||||
// 编辑弹窗状态
|
// 编辑弹窗状态
|
||||||
const [edit_modal_visible, setEditModalVisible] = useState(false);
|
const [edit_modal_visible, setEditModalVisible] = useState(false);
|
||||||
@@ -304,6 +306,11 @@ const EditProfilePage: React.FC = () => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 注销账户
|
||||||
|
const handle_close_account = () => {
|
||||||
|
setShowLogoutDialog(true);
|
||||||
|
}
|
||||||
|
|
||||||
const onGetPhoneNumber = async (e) => {
|
const onGetPhoneNumber = async (e) => {
|
||||||
if (!e.detail || !e.detail.code) {
|
if (!e.detail || !e.detail.code) {
|
||||||
Taro.showToast({
|
Taro.showToast({
|
||||||
@@ -580,7 +587,7 @@ const EditProfilePage: React.FC = () => {
|
|||||||
|
|
||||||
{/* 注销账号 */}
|
{/* 注销账号 */}
|
||||||
<View className="logout_section">
|
<View className="logout_section">
|
||||||
<View className="logout_button" onClick={handle_logout}>
|
<View className="logout_button" onClick={handle_close_account}>
|
||||||
<Text className="logout_text">注销账号</Text>
|
<Text className="logout_text">注销账号</Text>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
@@ -687,6 +694,16 @@ const EditProfilePage: React.FC = () => {
|
|||||||
onChange={handle_occupation_change}
|
onChange={handle_occupation_change}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
{/* 取消关注确认弹窗 */}
|
||||||
|
<CommonDialog
|
||||||
|
visible={showLogoutDialog}
|
||||||
|
cancelText="确定注销"
|
||||||
|
confirmText="再想想"
|
||||||
|
onCancel={() => {UserService.logout()}}
|
||||||
|
onConfirm={() => setShowLogoutDialog(false)}
|
||||||
|
contentTitle="确定要注销账号吗?"
|
||||||
|
contentDesc="你的账号将会彻底删除,该操作不可恢复。"
|
||||||
|
/>
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -257,11 +257,19 @@ const FollowPage: React.FC = () => {
|
|||||||
>
|
>
|
||||||
<Text className="tab_text">{tab.label}</Text>
|
<Text className="tab_text">{tab.label}</Text>
|
||||||
{tab.key === 'recommend' && (
|
{tab.key === 'recommend' && (
|
||||||
<View className="recommend_icon">
|
<View className="recommend_icon" onClick={(e) => {
|
||||||
|
e.stopPropagation();
|
||||||
|
Taro.showModal({
|
||||||
|
title: '推荐说明',
|
||||||
|
content: '我们会向你推荐一些可能感兴趣的球友,帮你更快遇见同样热爱运动的人。推荐基于公开信息与社区互动,仅用于球友推荐,不涉及个人隐私。',
|
||||||
|
showCancel: false,
|
||||||
|
confirmText: '确认',
|
||||||
|
confirmColor: '#000',
|
||||||
|
})
|
||||||
|
}}>
|
||||||
{/* 推荐图标 SVG */}
|
{/* 推荐图标 SVG */}
|
||||||
<View className="icon_container">
|
<View className="icon_container">
|
||||||
<View className="star_icon" />
|
<View className="star_icon" />
|
||||||
|
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -5,11 +5,6 @@
|
|||||||
font-style: Regular;
|
font-style: Regular;
|
||||||
color: #3C3C4399;
|
color: #3C3C4399;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
position: fixed;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
bottom: 0;
|
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
||||||
.withdrawal-container {
|
.withdrawal-container {
|
||||||
@@ -110,10 +105,13 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.withdraw_popup {
|
.withdraw_popup {
|
||||||
|
min-height: unset;
|
||||||
.popup_content {
|
.popup_content {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
user-select: none;
|
||||||
|
pointer-events: none;
|
||||||
|
|
||||||
.popup_text {
|
.popup_text {
|
||||||
font-family: DingTalk JinBuTi;
|
font-family: DingTalk JinBuTi;
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
import React, { useState, useEffect } from "react";
|
import React, { useState, useEffect, useRef } from "react";
|
||||||
import { View, Text, Input, Button } from "@tarojs/components";
|
import { View, Text, Input, Button } from "@tarojs/components";
|
||||||
import Taro, { useDidShow } from "@tarojs/taro";
|
import Taro, { useDidShow } from "@tarojs/taro";
|
||||||
|
|
||||||
import httpService from "@/services/httpService";
|
import httpService from "@/services/httpService";
|
||||||
import "./index.scss";
|
import "./index.scss";
|
||||||
import { CommonPopup } from "@/components";
|
import { CommonPopup } from "@/components";
|
||||||
|
import { useKeyboardHeight } from '@/store/keyboardStore'
|
||||||
|
|
||||||
interface WalletInfo {
|
interface WalletInfo {
|
||||||
balance: string;
|
balance: string;
|
||||||
@@ -15,6 +16,23 @@ interface WalletInfo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const Withdrawal: React.FC = () => {
|
const Withdrawal: React.FC = () => {
|
||||||
|
const inputRef = useRef(null);
|
||||||
|
// 使用全局键盘状态
|
||||||
|
const { keyboardHeight, isKeyboardVisible, addListener, initializeKeyboardListener } = useKeyboardHeight()
|
||||||
|
// 使用全局键盘状态监听
|
||||||
|
useEffect(() => {
|
||||||
|
// 初始化全局键盘监听器
|
||||||
|
initializeKeyboardListener()
|
||||||
|
|
||||||
|
// 添加本地监听器
|
||||||
|
const removeListener = addListener((height, visible) => {
|
||||||
|
console.log('AiImportPopup 收到键盘变化:', height, visible)
|
||||||
|
})
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
removeListener()
|
||||||
|
}
|
||||||
|
}, [initializeKeyboardListener, addListener])
|
||||||
const [showTips, setShowTips] = useState(false);
|
const [showTips, setShowTips] = useState(false);
|
||||||
const [tipsText, setTipsText] = useState<string>("");
|
const [tipsText, setTipsText] = useState<string>("");
|
||||||
const [inputValue, setInputValue] = useState<string>("0.00");
|
const [inputValue, setInputValue] = useState<string>("0.00");
|
||||||
@@ -33,7 +51,11 @@ const Withdrawal: React.FC = () => {
|
|||||||
load_wallet_data();
|
load_wallet_data();
|
||||||
getWithdrawErrorCodes();
|
getWithdrawErrorCodes();
|
||||||
});
|
});
|
||||||
|
useEffect(() => {
|
||||||
|
if (show_withdraw_popup && inputRef.current) {
|
||||||
|
inputRef.current.focus();
|
||||||
|
}
|
||||||
|
}, [show_withdraw_popup]);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (show_withdraw_popup) {
|
if (show_withdraw_popup) {
|
||||||
setIsFocus(true);
|
setIsFocus(true);
|
||||||
@@ -51,7 +73,7 @@ const Withdrawal: React.FC = () => {
|
|||||||
setShowTips(true);
|
setShowTips(true);
|
||||||
setTipsText("单笔提现金额不能超过 200元");
|
setTipsText("单笔提现金额不能超过 200元");
|
||||||
} else {
|
} else {
|
||||||
setShowTips(false);
|
setShowTips(false);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -191,7 +213,6 @@ const Withdrawal: React.FC = () => {
|
|||||||
content: message,
|
content: message,
|
||||||
showCancel: false,
|
showCancel: false,
|
||||||
confirmText: "确认",
|
confirmText: "确认",
|
||||||
confirmColor: "#fff",
|
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
@@ -214,6 +235,10 @@ const Withdrawal: React.FC = () => {
|
|||||||
}, 100);
|
}, 100);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
const handlePopupClick = (e) => {
|
||||||
|
e.stopPropagation();
|
||||||
|
inputRef.current!.focus();
|
||||||
|
};
|
||||||
return (
|
return (
|
||||||
<View className="withdrawal-page" >
|
<View className="withdrawal-page" >
|
||||||
<View className="withdrawal-container">
|
<View className="withdrawal-container">
|
||||||
@@ -270,8 +295,9 @@ const Withdrawal: React.FC = () => {
|
|||||||
title="提现"
|
title="提现"
|
||||||
className="withdraw_popup"
|
className="withdraw_popup"
|
||||||
hideFooter={true}
|
hideFooter={true}
|
||||||
|
style={{ bottom: isKeyboardVisible ? `${keyboardHeight}px` : undefined }}
|
||||||
>
|
>
|
||||||
<View className="popup_content">
|
<View className="popup_content" onClick={handlePopupClick}>
|
||||||
<View className="popup_text">{`¥${inputValue}`}</View>
|
<View className="popup_text">{`¥${inputValue}`}</View>
|
||||||
<View className="password_container">
|
<View className="password_container">
|
||||||
{
|
{
|
||||||
@@ -282,7 +308,7 @@ const Withdrawal: React.FC = () => {
|
|||||||
))
|
))
|
||||||
}
|
}
|
||||||
</View>
|
</View>
|
||||||
<Input focus={isFocus} type="number" style={{ width: "0", height: "0", opacity: "0" }} value={password.filter(item => item !== "").join("")} maxlength={6} onInput={handlePasswordInput} />
|
<Input ref={inputRef} focus={isFocus} type="number" adjustPosition={false} style={{ width: "0", height: "0", opacity: "0" }} value={password.filter(item => item !== "").join("")} maxlength={6} onInput={handlePasswordInput} />
|
||||||
</View>
|
</View>
|
||||||
</CommonPopup>
|
</CommonPopup>
|
||||||
</View >
|
</View >
|
||||||
|
|||||||
Reference in New Issue
Block a user