|
@@ -14,6 +14,7 @@ import {
|
|
|
} from 'react-native';
|
|
} from 'react-native';
|
|
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
|
|
|
|
|
|
|
|
+import { MenuCell } from '@/components/mine/MenuCell';
|
|
|
import { Images } from '@/constants/images';
|
|
import { Images } from '@/constants/images';
|
|
|
import { getMagicIndex } from '@/services/award';
|
|
import { getMagicIndex } from '@/services/award';
|
|
|
import { getParamConfig, getUserInfo, UserInfo } from '@/services/user';
|
|
import { getParamConfig, getUserInfo, UserInfo } from '@/services/user';
|
|
@@ -33,6 +34,7 @@ export default function MineScreen() {
|
|
|
const [inviteShow, setInviteShow] = useState(false);
|
|
const [inviteShow, setInviteShow] = useState(false);
|
|
|
const [showCredit, setShowCredit] = useState(false);
|
|
const [showCredit, setShowCredit] = useState(false);
|
|
|
const [filingInfo, setFilingInfo] = useState<{ state: number; data: string } | null>(null);
|
|
const [filingInfo, setFilingInfo] = useState<{ state: number; data: string } | null>(null);
|
|
|
|
|
+ const [showWallet, setShowWallet] = useState(false);
|
|
|
|
|
|
|
|
const loadData = useCallback(async () => {
|
|
const loadData = useCallback(async () => {
|
|
|
try {
|
|
try {
|
|
@@ -56,6 +58,10 @@ export default function MineScreen() {
|
|
|
if (filingConfig) {
|
|
if (filingConfig) {
|
|
|
setFilingInfo({ state: filingConfig.state, data: filingConfig.data });
|
|
setFilingInfo({ state: filingConfig.state, data: filingConfig.data });
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ // 获取钱包显示配置
|
|
|
|
|
+ const walletConfig = await getParamConfig('wallet_recharge_show');
|
|
|
|
|
+ setShowWallet(walletConfig?.state === 1);
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
console.error('获取数据失败:', error);
|
|
console.error('获取数据失败:', error);
|
|
|
}
|
|
}
|
|
@@ -88,6 +94,39 @@ export default function MineScreen() {
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+ const handleMenuItemPress = (type: string) => {
|
|
|
|
|
+ if (!userInfo && type !== '4_4') {
|
|
|
|
|
+ router.push('/login' as any);
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ switch (type) {
|
|
|
|
|
+ case '1_1': // 钱包
|
|
|
|
|
+ router.push('/wallet' as any);
|
|
|
|
|
+ break;
|
|
|
|
|
+ case '2_0': // 全部订单
|
|
|
|
|
+ router.push('/orders' as any);
|
|
|
|
|
+ break;
|
|
|
|
|
+ case '6_1': // 兑换码
|
|
|
|
|
+ Alert.alert('提示', '兑换码功能');
|
|
|
|
|
+ break;
|
|
|
|
|
+ case '4_4': // 联系客服
|
|
|
|
|
+ Alert.alert('联系客服', '客服时间:10:00 ~ 18:00');
|
|
|
|
|
+ break;
|
|
|
|
|
+ case '4_3': // 地址
|
|
|
|
|
+ router.push('/address' as any);
|
|
|
|
|
+ break;
|
|
|
|
|
+ case '4_9': // 意见反馈
|
|
|
|
|
+ Alert.alert('提示', '意见反馈功能');
|
|
|
|
|
+ break;
|
|
|
|
|
+ case '4_5': // 设置
|
|
|
|
|
+ Alert.alert('提示', '设置功能');
|
|
|
|
|
+ break;
|
|
|
|
|
+ default:
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
const showNumber = (key: keyof IndexData) => {
|
|
const showNumber = (key: keyof IndexData) => {
|
|
|
if (!indexData) return '-';
|
|
if (!indexData) return '-';
|
|
|
const val = indexData[key];
|
|
const val = indexData[key];
|
|
@@ -247,6 +286,11 @@ export default function MineScreen() {
|
|
|
</View>
|
|
</View>
|
|
|
</ImageBackground>
|
|
</ImageBackground>
|
|
|
|
|
|
|
|
|
|
+ {/* 菜单列表 */}
|
|
|
|
|
+ <View style={styles.menuSection}>
|
|
|
|
|
+ <MenuCell onItemPress={handleMenuItemPress} showWallet={showWallet} />
|
|
|
|
|
+ </View>
|
|
|
|
|
+
|
|
|
{/* 备案信息 */}
|
|
{/* 备案信息 */}
|
|
|
{filingInfo && filingInfo.state !== 0 && (
|
|
{filingInfo && filingInfo.state !== 0 && (
|
|
|
<View style={styles.filingBox}>
|
|
<View style={styles.filingBox}>
|
|
@@ -428,4 +472,11 @@ const styles = StyleSheet.create({
|
|
|
fontSize: 14,
|
|
fontSize: 14,
|
|
|
textAlign: 'center',
|
|
textAlign: 'center',
|
|
|
},
|
|
},
|
|
|
|
|
+ menuSection: {
|
|
|
|
|
+ backgroundColor: '#fff',
|
|
|
|
|
+ marginHorizontal: 8,
|
|
|
|
|
+ marginTop: 10,
|
|
|
|
|
+ borderRadius: 8,
|
|
|
|
|
+ overflow: 'hidden',
|
|
|
|
|
+ },
|
|
|
});
|
|
});
|