|
@@ -1,9 +1,10 @@
|
|
|
import { Image } from 'expo-image';
|
|
import { Image } from 'expo-image';
|
|
|
import { useLocalSearchParams, useRouter } from 'expo-router';
|
|
import { useLocalSearchParams, useRouter } from 'expo-router';
|
|
|
-import React, { useCallback, useEffect, useState } from 'react';
|
|
|
|
|
|
|
+import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
|
import {
|
|
import {
|
|
|
ActivityIndicator,
|
|
ActivityIndicator,
|
|
|
Dimensions,
|
|
Dimensions,
|
|
|
|
|
+ ImageBackground,
|
|
|
ScrollView,
|
|
ScrollView,
|
|
|
StatusBar,
|
|
StatusBar,
|
|
|
StyleSheet,
|
|
StyleSheet,
|
|
@@ -13,6 +14,9 @@ import {
|
|
|
} from 'react-native';
|
|
} from 'react-native';
|
|
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
|
|
|
|
|
|
|
|
+import { RecordModal, RecordModalRef } from '@/app/award-detail/components/RecordModal';
|
|
|
|
|
+import { RuleModal, RuleModalRef } from '@/app/award-detail/components/RuleModal';
|
|
|
|
|
+import { Images } from '@/constants/images';
|
|
|
import { getPoolDetail } from '@/services/award';
|
|
import { getPoolDetail } from '@/services/award';
|
|
|
|
|
|
|
|
const { width: SCREEN_WIDTH } = Dimensions.get('window');
|
|
const { width: SCREEN_WIDTH } = Dimensions.get('window');
|
|
@@ -54,6 +58,9 @@ export default function AwardDetailSwipeScreen() {
|
|
|
const [products, setProducts] = useState<ProductItem[]>([]);
|
|
const [products, setProducts] = useState<ProductItem[]>([]);
|
|
|
const [currentIndex, setCurrentIndex] = useState(parseInt(index || '0', 10));
|
|
const [currentIndex, setCurrentIndex] = useState(parseInt(index || '0', 10));
|
|
|
|
|
|
|
|
|
|
+ const ruleRef = useRef<RuleModalRef>(null);
|
|
|
|
|
+ const recordRef = useRef<RecordModalRef>(null);
|
|
|
|
|
+
|
|
|
console.log(`[DEBUG-SWIPE] Init. PoolId: ${poolId}, ParamIndex: ${index}, StateIndex: ${currentIndex}`);
|
|
console.log(`[DEBUG-SWIPE] Init. PoolId: ${poolId}, ParamIndex: ${index}, StateIndex: ${currentIndex}`);
|
|
|
|
|
|
|
|
const loadData = useCallback(async () => {
|
|
const loadData = useCallback(async () => {
|
|
@@ -129,6 +136,27 @@ export default function AwardDetailSwipeScreen() {
|
|
|
</View>
|
|
</View>
|
|
|
|
|
|
|
|
<ScrollView style={styles.scrollView} showsVerticalScrollIndicator={false}>
|
|
<ScrollView style={styles.scrollView} showsVerticalScrollIndicator={false}>
|
|
|
|
|
+ <View style={styles.detailWrapper}>
|
|
|
|
|
+ {/* 侧边按钮 - 规则 */}
|
|
|
|
|
+ <TouchableOpacity style={[styles.positionBut, styles.positionRule]} onPress={() => ruleRef.current?.show()}>
|
|
|
|
|
+ <ImageBackground source={{ uri: Images.box.detail.positionBgLeft }} style={styles.positionButBg} resizeMode="contain">
|
|
|
|
|
+ <Text style={styles.positionButText}>规则</Text>
|
|
|
|
|
+ </ImageBackground>
|
|
|
|
|
+ </TouchableOpacity>
|
|
|
|
|
+
|
|
|
|
|
+ {/* 侧边按钮 - 记录 */}
|
|
|
|
|
+ <TouchableOpacity style={[styles.positionBut, styles.positionRecord]} onPress={() => recordRef.current?.show()}>
|
|
|
|
|
+ <ImageBackground source={{ uri: Images.box.detail.positionBgLeft }} style={styles.positionButBg} resizeMode="contain">
|
|
|
|
|
+ <Text style={styles.positionButText}>记录</Text>
|
|
|
|
|
+ </ImageBackground>
|
|
|
|
|
+ </TouchableOpacity>
|
|
|
|
|
+
|
|
|
|
|
+ {/* 侧边按钮 - 仓库 */}
|
|
|
|
|
+ <TouchableOpacity style={[styles.positionBut, styles.positionStore]} onPress={() => router.push('/store' as any)}>
|
|
|
|
|
+ <ImageBackground source={{ uri: Images.box.detail.positionBgRight }} style={styles.positionButBg} resizeMode="contain">
|
|
|
|
|
+ <Text style={styles.positionButTextR}>仓库</Text>
|
|
|
|
|
+ </ImageBackground>
|
|
|
|
|
+ </TouchableOpacity>
|
|
|
{/* 商品图片区域 */}
|
|
{/* 商品图片区域 */}
|
|
|
<View style={styles.imageSection}>
|
|
<View style={styles.imageSection}>
|
|
|
<Image
|
|
<Image
|
|
@@ -244,8 +272,12 @@ export default function AwardDetailSwipeScreen() {
|
|
|
)}
|
|
)}
|
|
|
</View>
|
|
</View>
|
|
|
|
|
|
|
|
- <View style={{ height: 50 }} />
|
|
|
|
|
|
|
+ </View>
|
|
|
</ScrollView>
|
|
</ScrollView>
|
|
|
|
|
+
|
|
|
|
|
+ {/* 弹窗组件 */}
|
|
|
|
|
+ <RuleModal ref={ruleRef} />
|
|
|
|
|
+ <RecordModal ref={recordRef} poolId={poolId as string} />
|
|
|
</View>
|
|
</View>
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
@@ -311,6 +343,57 @@ const styles = StyleSheet.create({
|
|
|
},
|
|
},
|
|
|
arrowText: { color: '#fff', fontSize: 18, fontWeight: 'bold' },
|
|
arrowText: { color: '#fff', fontSize: 18, fontWeight: 'bold' },
|
|
|
|
|
|
|
|
|
|
+ detailWrapper: {
|
|
|
|
|
+ position: 'relative',
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ // 侧边悬浮按钮
|
|
|
|
|
+ positionBut: {
|
|
|
|
|
+ position: 'absolute',
|
|
|
|
|
+ left: 0,
|
|
|
|
|
+ zIndex: 100,
|
|
|
|
|
+ width: 35,
|
|
|
|
|
+ height: 35,
|
|
|
|
|
+ },
|
|
|
|
|
+ positionRule: {
|
|
|
|
|
+ top: 256,
|
|
|
|
|
+ left: 0,
|
|
|
|
|
+ },
|
|
|
|
|
+ positionRecord: {
|
|
|
|
|
+ top: 300,
|
|
|
|
|
+ left: 0,
|
|
|
|
|
+ },
|
|
|
|
|
+ positionStore: {
|
|
|
|
|
+ top: 256,
|
|
|
|
|
+ right: 0,
|
|
|
|
|
+ },
|
|
|
|
|
+ positionButBg: {
|
|
|
|
|
+ width: 35,
|
|
|
|
|
+ height: 34,
|
|
|
|
|
+ justifyContent: 'center',
|
|
|
|
|
+ alignItems: 'center',
|
|
|
|
|
+ },
|
|
|
|
|
+ positionButText: {
|
|
|
|
|
+ color: '#fff',
|
|
|
|
|
+ fontSize: 12,
|
|
|
|
|
+ fontWeight: 'bold',
|
|
|
|
|
+ transform: [{ rotate: '14deg' }],
|
|
|
|
|
+ marginTop: -2,
|
|
|
|
|
+ textShadowColor: 'rgba(0,0,0,0.5)',
|
|
|
|
|
+ textShadowOffset: { width: 1, height: 1 },
|
|
|
|
|
+ textShadowRadius: 1,
|
|
|
|
|
+ },
|
|
|
|
|
+ positionButTextR: {
|
|
|
|
|
+ color: '#fff',
|
|
|
|
|
+ fontSize: 12,
|
|
|
|
|
+ fontWeight: 'bold',
|
|
|
|
|
+ transform: [{ rotate: '-16deg' }],
|
|
|
|
|
+ marginTop: -2,
|
|
|
|
|
+ textShadowColor: 'rgba(0,0,0,0.5)',
|
|
|
|
|
+ textShadowOffset: { width: 1, height: 1 },
|
|
|
|
|
+ textShadowRadius: 1,
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
// 价格区域
|
|
// 价格区域
|
|
|
priceSection: {
|
|
priceSection: {
|
|
|
backgroundColor: '#fff',
|
|
backgroundColor: '#fff',
|