|
|
@@ -53,15 +53,13 @@ export default function CouponScreen() {
|
|
|
};
|
|
|
|
|
|
const handleUse = (item: CouponItem) => {
|
|
|
- if (item.scene === 'LUCK') {
|
|
|
- // Go to Box/Award
|
|
|
- router.push('/box' as any); // Adapt route as needed
|
|
|
- } else if (item.scene === 'MALL') {
|
|
|
- // Go to Mall/VIP usually
|
|
|
- router.push('/(tabs)' as any);
|
|
|
+ // Original behavior: goAward() -> /pages/award/index (Box Screen)
|
|
|
+ // We replicate this 1:1, or maintain specific routing if mall requires it.
|
|
|
+ // Given request for 1:1, we prioritize Box screen.
|
|
|
+ if (item.scene === 'MALL') {
|
|
|
+ router.push('/(tabs)/store' as any);
|
|
|
} else {
|
|
|
- // Default
|
|
|
- router.push('/(tabs)' as any);
|
|
|
+ router.push('/(tabs)/box' as any);
|
|
|
}
|
|
|
};
|
|
|
|
|
|
@@ -90,40 +88,45 @@ export default function CouponScreen() {
|
|
|
contentContainerStyle={{ paddingTop: insets.top + 50, paddingBottom: 50, paddingHorizontal: 10 }}
|
|
|
>
|
|
|
{list.length > 0 ? (
|
|
|
- list.map((item, index) => (
|
|
|
- <ImageBackground
|
|
|
- key={index}
|
|
|
- source={{ uri: Images.mine.couponBg }}
|
|
|
- style={[styles.couponItem, item.status !== 1 && styles.grayscale]}
|
|
|
- resizeMode="stretch"
|
|
|
- >
|
|
|
- <View style={styles.left}>
|
|
|
- <View style={styles.amountBox}>
|
|
|
- <Text style={styles.symbol}>¥</Text>
|
|
|
- <Text style={styles.amount}>{item.amount}</Text>
|
|
|
- </View>
|
|
|
- <Text style={styles.fullAmount}>满{item.fullAmount}可用</Text>
|
|
|
- </View>
|
|
|
-
|
|
|
- <View style={styles.divider} />
|
|
|
-
|
|
|
- <View style={styles.right}>
|
|
|
- <View style={styles.info}>
|
|
|
- <Text style={styles.name}>{item.name}</Text>
|
|
|
- <Text style={styles.time}>{formatTime(item.endTime)}过期</Text>
|
|
|
- </View>
|
|
|
- <TouchableOpacity onPress={() => handleUse(item)}>
|
|
|
- <ImageBackground
|
|
|
- source={{ uri: Images.mine.couponItemButBg }}
|
|
|
- style={styles.useBtn}
|
|
|
- resizeMode="contain"
|
|
|
- >
|
|
|
- <Text style={styles.useText}>立即使用</Text>
|
|
|
- </ImageBackground>
|
|
|
- </TouchableOpacity>
|
|
|
- </View>
|
|
|
- </ImageBackground>
|
|
|
- ))
|
|
|
+ list.map((item, index) => (
|
|
|
+ <TouchableOpacity
|
|
|
+ key={index}
|
|
|
+ activeOpacity={0.8}
|
|
|
+ onPress={() => handleUse(item)}
|
|
|
+ >
|
|
|
+ <ImageBackground
|
|
|
+ source={{ uri: Images.mine.couponBg }}
|
|
|
+ style={[styles.couponItem, item.status !== 1 && styles.grayscale]}
|
|
|
+ resizeMode="stretch"
|
|
|
+ >
|
|
|
+ <View style={styles.left}>
|
|
|
+ <View style={styles.amountBox}>
|
|
|
+ <Text style={styles.symbol}>¥</Text>
|
|
|
+ <Text style={styles.amount}>{item.amount}</Text>
|
|
|
+ </View>
|
|
|
+ <Text style={styles.fullAmount}>满{item.fullAmount}可用</Text>
|
|
|
+ </View>
|
|
|
+
|
|
|
+ <View style={styles.divider} />
|
|
|
+
|
|
|
+ <View style={styles.right}>
|
|
|
+ <View style={styles.info}>
|
|
|
+ <Text style={styles.name}>{item.name}</Text>
|
|
|
+ <Text style={styles.time}>{formatTime(item.endTime)}过期</Text>
|
|
|
+ </View>
|
|
|
+ <View>
|
|
|
+ <ImageBackground
|
|
|
+ source={{ uri: Images.mine.couponItemButBg }}
|
|
|
+ style={styles.useBtn}
|
|
|
+ resizeMode="contain"
|
|
|
+ >
|
|
|
+ <Text style={styles.useText}>立即使用</Text>
|
|
|
+ </ImageBackground>
|
|
|
+ </View>
|
|
|
+ </View>
|
|
|
+ </ImageBackground>
|
|
|
+ </TouchableOpacity>
|
|
|
+ ))
|
|
|
) : (
|
|
|
<View style={styles.emptyBox}>
|
|
|
<Text style={styles.emptyText}>暂无优惠券</Text>
|
|
|
@@ -209,7 +212,7 @@ const styles = StyleSheet.create({
|
|
|
height: 24,
|
|
|
backgroundColor: '#C3B3DF',
|
|
|
marginHorizontal: 16,
|
|
|
- opacity: 0, // Hidden in layout if image has it, just spacing
|
|
|
+ // opacity: 0, // Removed to match original design
|
|
|
},
|
|
|
right: {
|
|
|
flex: 1,
|