index.tsx 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658
  1. import { Image } from 'expo-image';
  2. import { useRouter } from 'expo-router';
  3. import React, { useCallback, useEffect, useState } from 'react';
  4. import {
  5. ActivityIndicator,
  6. Alert,
  7. FlatList,
  8. ImageBackground,
  9. Platform,
  10. Pressable,
  11. RefreshControl,
  12. ScrollView,
  13. StatusBar,
  14. StyleSheet,
  15. Text,
  16. TouchableOpacity,
  17. View
  18. } from 'react-native';
  19. import { useSafeAreaInsets } from 'react-native-safe-area-context';
  20. import { Images } from '@/constants/images';
  21. import {
  22. getStore,
  23. getTakeList,
  24. moveOutSafeStore,
  25. moveToSafeStore,
  26. } from '@/services/award';
  27. import CheckoutModal from './components/CheckoutModal';
  28. const LEVEL_MAP: Record<string, { title: string; color: string }> = {
  29. A: { title: '超神', color: '#ff0000' }, // 红色
  30. B: { title: '欧皇', color: '#ffae00' }, // 黄色
  31. C: { title: '隐藏', color: '#9745e6' },
  32. D: { title: '普通', color: '#666666' },
  33. SUBSTITUTE: { title: '置换款', color: '#666666' },
  34. OTHER: { title: '其他', color: '#666666' },
  35. };
  36. const LEVEL_TABS = [
  37. { title: '全部', value: '' },
  38. { title: '普通', value: 'D' },
  39. { title: '隐藏', value: 'C' },
  40. { title: '欧皇', value: 'B' },
  41. { title: '超神', value: 'A' },
  42. { title: '其他', value: 'OTHER' },
  43. ];
  44. const FROM_TYPE_MAP: Record<string, string> = {
  45. LUCK: '奖池', MALL: '商城', LUCK_ROOM: '福利房', LUCK_WHEEL: '魔天轮',
  46. DOLL_MACHINE: '扭蛋', ACTIVITY: '活动', SUBSTITUTE: '商品置换', TRANSFER: '商品转赠',
  47. DISTRIBUTION: '分销', LUCK_PICKUP: '商品提货', LUCK_EXCHANGE: '商品兑换',
  48. RECHARGE: '充值', WITHDRAW: '提现', OFFICIAL: '官方',
  49. LUCK_ACTIVITY: '奖池活动', CONSUMPTION_ACTIVITY: '消费活动',
  50. NEW_USER_RANK_ACTIVITY: '拉新排名活动', CONSUMPTION_RANK_ACTIVITY: '消费排行榜活动',
  51. WHEEL_ACTIVITY: '大转盘活动', TA_ACTIVITY: '勇者之塔活动',
  52. ISLAND_ACTIVITY: '海岛活动', REDEEM_CODE_ACTIVITY: '兑换码活动',
  53. };
  54. interface StoreItem {
  55. id: string;
  56. level: string;
  57. safeFlag: number;
  58. magicAmount?: number;
  59. fromRelationType: string;
  60. spu: { id: string; name: string; cover: string; marketPrice?: number };
  61. }
  62. interface PickupItem {
  63. tradeNo: string;
  64. createTime: string;
  65. status: number;
  66. contactName: string;
  67. contactNo: string;
  68. province: string;
  69. city: string;
  70. district: string;
  71. address: string;
  72. expressAmount: number;
  73. paymentTime?: string;
  74. paymentTimeoutTime?: string;
  75. cancelRemark?: string;
  76. itemList: Array<{ id: string; spuId: string; level: string; cover: string }>;
  77. }
  78. const STATUS_MAP: Record<number, { text: string; color: string }> = {
  79. 0: { text: '待支付运费', color: '#ff6b00' },
  80. 1: { text: '已进仓库进行配货', color: '#ff6b00' },
  81. 2: { text: '待收货', color: '#ff6b00' },
  82. 10: { text: '已取消', color: '#ff6b00' },
  83. 11: { text: '超时取消', color: '#ff6b00' },
  84. 12: { text: '系统取消', color: '#ff6b00' },
  85. 99: { text: '已完成', color: '#52c41a' },
  86. };
  87. export default function StoreScreen() {
  88. const router = useRouter();
  89. const insets = useSafeAreaInsets();
  90. const [mainTabIndex, setMainTabIndex] = useState(0);
  91. const [levelTabIndex, setLevelTabIndex] = useState(0);
  92. const [list, setList] = useState<any[]>([]);
  93. const [loading, setLoading] = useState(false);
  94. const [refreshing, setRefreshing] = useState(false);
  95. const [page, setPage] = useState(1);
  96. const [hasMore, setHasMore] = useState(true);
  97. const [checkMap, setCheckMap] = useState<Record<string, StoreItem>>({});
  98. const [checkoutVisible, setCheckoutVisible] = useState(false);
  99. const mainTabs = ['未使用', '保险柜', '已提货'];
  100. const loadData = useCallback(async (pageNum: number, isRefresh = false) => {
  101. if (loading && !isRefresh) return;
  102. if (!hasMore && pageNum > 1 && !isRefresh) return;
  103. try {
  104. if (pageNum === 1) setLoading(true);
  105. let res: any;
  106. if (mainTabIndex === 0) {
  107. res = await getStore(pageNum, 20, 0, LEVEL_TABS[levelTabIndex].value);
  108. } else if (mainTabIndex === 1) {
  109. res = await getStore(pageNum, 20, 1);
  110. } else {
  111. res = await getTakeList(pageNum, 20);
  112. }
  113. let records = Array.isArray(res) ? res : (res?.records || res || []);
  114. // 处理已提货数据,合并相同商品
  115. if (mainTabIndex === 2 && records.length > 0) {
  116. records = records.map((item: PickupItem) => {
  117. const goodsMap: Record<string, { total: number; data: any }> = {};
  118. (item.itemList || []).forEach((goods: any) => {
  119. const key = `${goods.spuId}_${goods.level}`;
  120. if (goodsMap[key]) {
  121. goodsMap[key].total += 1;
  122. } else {
  123. goodsMap[key] = { total: 1, data: goods };
  124. }
  125. });
  126. return { ...item, groupedList: Object.values(goodsMap) };
  127. });
  128. }
  129. if (records.length < 20) setHasMore(false);
  130. if (pageNum === 1 || isRefresh) setList(records);
  131. else setList(prev => [...prev, ...records]);
  132. } catch (e) {
  133. console.error('加载仓库数据失败:', e);
  134. } finally {
  135. setLoading(false);
  136. setRefreshing(false);
  137. }
  138. }, [mainTabIndex, levelTabIndex, loading, hasMore]);
  139. useEffect(() => {
  140. setPage(1); setList([]); setHasMore(true); setCheckMap({});
  141. loadData(1, true);
  142. }, [mainTabIndex]);
  143. useEffect(() => {
  144. if (mainTabIndex === 0) {
  145. setPage(1); setList([]); setHasMore(true); setCheckMap({});
  146. loadData(1, true);
  147. }
  148. }, [levelTabIndex]);
  149. const handleRefresh = () => { setRefreshing(true); setPage(1); setHasMore(true); loadData(1, true); };
  150. const handleLoadMore = () => { if (!loading && hasMore) { const np = page + 1; setPage(np); loadData(np); } };
  151. const handleChoose = (item: StoreItem) => {
  152. if (item.safeFlag === 1 && mainTabIndex === 0) return;
  153. setCheckMap(prev => {
  154. const newMap = { ...prev };
  155. if (newMap[item.id]) delete newMap[item.id];
  156. else newMap[item.id] = item;
  157. return newMap;
  158. });
  159. };
  160. const handleLock = async (item: StoreItem, index: number) => {
  161. const res = await moveToSafeStore([item.id]);
  162. if (res) {
  163. const newList = [...list]; newList[index] = { ...item, safeFlag: 1 }; setList(newList);
  164. setCheckMap(prev => { const m = { ...prev }; delete m[item.id]; return m; });
  165. }
  166. };
  167. const handleUnlock = async (item: StoreItem, index: number) => {
  168. const res = await moveOutSafeStore([item.id]);
  169. if (res) {
  170. if (mainTabIndex === 1) setList(list.filter((_, i) => i !== index));
  171. else { const newList = [...list]; newList[index] = { ...item, safeFlag: 0 }; setList(newList); }
  172. }
  173. };
  174. const handleMoveOutAll = async () => {
  175. const selected = Object.values(checkMap);
  176. if (selected.length === 0) { showAlert('请至少选择一个商品!'); return; }
  177. const res = await moveOutSafeStore(selected.map(i => i.id));
  178. if (res) { setCheckMap({}); handleRefresh(); }
  179. };
  180. const handleTakeGoods = () => {
  181. const selected = Object.values(checkMap);
  182. if (selected.length === 0) { showAlert('请至少选择一个商品!'); return; }
  183. setCheckoutVisible(true);
  184. };
  185. const handleSelectAll = () => {
  186. const allSelected = list.every(item => checkMap[item.id]);
  187. if (allSelected) {
  188. setCheckMap({});
  189. } else {
  190. const newMap: Record<string, StoreItem> = {};
  191. list.forEach(item => {
  192. newMap[item.id] = item;
  193. });
  194. setCheckMap(newMap);
  195. }
  196. };
  197. const handleCheckoutSuccess = () => {
  198. setCheckoutVisible(false);
  199. setCheckMap({});
  200. handleRefresh();
  201. };
  202. const showAlert = (msg: string) => {
  203. if (Platform.OS === 'web') window.alert(msg);
  204. else Alert.alert('提示', msg);
  205. };
  206. const renderStoreItem = ({ item, index }: { item: StoreItem; index: number }) => {
  207. const levelInfo = LEVEL_MAP[item.level] || LEVEL_MAP.D;
  208. const isChecked = !!checkMap[item.id];
  209. const canSelect = mainTabIndex === 1 || item.safeFlag !== 1;
  210. return (
  211. <ImageBackground source={{ uri: Images.mine.storeItemBg }} style={styles.cell} resizeMode="stretch">
  212. <Pressable style={styles.cellContent} onPress={() => {
  213. console.log('[仓库store] 点击商品详情, id:', item.id);
  214. router.push({ pathname: '/store/detail', params: { id: item.id } } as any);
  215. }}>
  216. <TouchableOpacity style={styles.cellHeader} onPress={() => canSelect && handleChoose(item)}>
  217. <View style={styles.headerLeft}>
  218. {canSelect && (
  219. <View style={[styles.checkBox, isChecked && styles.checkBoxChecked]}>
  220. {isChecked && <Text style={styles.checkIcon}>✓</Text>}
  221. </View>
  222. )}
  223. <Text style={[styles.levelTitle, { color: levelInfo.color }]}>{levelInfo.title}</Text>
  224. </View>
  225. <TouchableOpacity style={styles.lockBox} onPress={() => item.safeFlag !== 1 ? handleLock(item, index) : handleUnlock(item, index)}>
  226. <Text style={styles.lockText}>{item.safeFlag !== 1 ? '锁定' : '解锁'}</Text>
  227. <Image source={{ uri: item.safeFlag !== 1 ? Images.mine.lock : Images.mine.unlock }} style={styles.lockIcon} />
  228. </TouchableOpacity>
  229. </TouchableOpacity>
  230. <View style={styles.cellBody}>
  231. <ImageBackground source={{ uri: Images.mine.storeGoodsImgBg }} style={styles.goodsImgBg}>
  232. <Image source={{ uri: item.spu?.cover }} style={styles.goodsImg} contentFit="contain" />
  233. </ImageBackground>
  234. <View style={styles.goodsInfo}>
  235. <Text style={styles.goodsName} numberOfLines={2}>{item.spu?.name}</Text>
  236. {(item.spu?.marketPrice ?? 0) > 0 && (
  237. <Text style={styles.goodsPrice}>¥{item.spu?.marketPrice}</Text>
  238. )}
  239. <Text style={styles.goodsSource}>从{FROM_TYPE_MAP[item.fromRelationType] || '其他'}获得</Text>
  240. </View>
  241. <Text style={styles.arrow}>{'>'}</Text>
  242. </View>
  243. </Pressable>
  244. </ImageBackground>
  245. );
  246. };
  247. const copyToClipboard = (text: string) => {
  248. showAlert(`订单号已复制: ${text}`);
  249. };
  250. const showExpress = (item: PickupItem) => {
  251. router.push({ pathname: '/store/packages' as any, params: { tradeNo: item.tradeNo } });
  252. };
  253. const renderPickupItem = ({ item }: { item: PickupItem & { groupedList?: Array<{ total: number; data: any }> } }) => {
  254. const statusInfo = STATUS_MAP[item.status] || { text: '未知', color: '#999' };
  255. return (
  256. <ImageBackground source={{ uri: Images.mine.storeItemBg }} style={styles.pickupCell} resizeMode="stretch">
  257. {/* 顶部信息 */}
  258. <View style={styles.pickupTop}>
  259. <Text style={styles.pickupTime}>下单时间:{item.createTime}</Text>
  260. <Text style={[styles.pickupStatus, { color: statusInfo.color }]}>{statusInfo.text}</Text>
  261. </View>
  262. {item.status === 0 && item.paymentTimeoutTime && (
  263. <Text style={styles.pickupTimeout}>{item.paymentTimeoutTime} 将自动取消该订单,如有优惠券,将自动退回</Text>
  264. )}
  265. {/* 收货地址 */}
  266. <View style={styles.pickupAddress}>
  267. <Text style={styles.locationIcon}>📍</Text>
  268. <View style={styles.addressInfo}>
  269. <Text style={styles.addressName}>{item.contactName},{item.contactNo}</Text>
  270. <Text style={styles.addressDetail}>{item.province}{item.city}{item.district}{item.address}</Text>
  271. </View>
  272. </View>
  273. {/* 商品列表 */}
  274. <View style={styles.pickupGoodsBox}>
  275. <ScrollView horizontal showsHorizontalScrollIndicator={false} style={styles.pickupGoodsList}>
  276. {(item.groupedList || []).map((goods, idx) => (
  277. <View key={idx} style={styles.pickupGoodsItem}>
  278. <Image source={{ uri: goods.data.cover }} style={styles.pickupGoodsImg} contentFit="contain" />
  279. <View style={styles.pickupGoodsCount}>
  280. <Text style={styles.pickupGoodsCountText}>x{goods.total}</Text>
  281. </View>
  282. </View>
  283. ))}
  284. </ScrollView>
  285. </View>
  286. {/* 订单号 */}
  287. <View style={styles.pickupOrderRow}>
  288. <Text style={styles.pickupOrderLabel}>订单号:</Text>
  289. <Text style={styles.pickupOrderNo} numberOfLines={1}>{item.tradeNo}</Text>
  290. <TouchableOpacity style={styles.copyBtn} onPress={() => copyToClipboard(item.tradeNo)}>
  291. <Text style={styles.copyBtnText}>复制</Text>
  292. </TouchableOpacity>
  293. </View>
  294. {item.paymentTime && (
  295. <View style={styles.pickupInfoRow}>
  296. <Text style={styles.pickupInfoLabel}>付款时间:</Text>
  297. <Text style={styles.pickupInfoValue}>{item.paymentTime}</Text>
  298. </View>
  299. )}
  300. {item.status === 12 && item.cancelRemark && (
  301. <View style={styles.pickupInfoRow}>
  302. <Text style={styles.pickupInfoLabel}>备注</Text>
  303. <Text style={[styles.pickupInfoValue, { color: '#ff6b00' }]}>{item.cancelRemark}</Text>
  304. </View>
  305. )}
  306. {/* 底部操作 */}
  307. <View style={styles.pickupBottom}>
  308. <Text style={styles.pickupExpressAmount}>配送费:<Text style={styles.priceText}>¥{item.expressAmount}</Text></Text>
  309. {[1, 2, 99].includes(item.status) && (
  310. <TouchableOpacity style={styles.expressBtn} onPress={() => showExpress(item)}>
  311. <Text style={styles.expressBtnText}>物流信息</Text>
  312. </TouchableOpacity>
  313. )}
  314. </View>
  315. </ImageBackground>
  316. );
  317. };
  318. const selectedCount = Object.keys(checkMap).length;
  319. return (
  320. <View style={styles.container}>
  321. <StatusBar barStyle="light-content" />
  322. <ImageBackground source={{ uri: Images.mine.kaixinMineBg }} style={styles.background} resizeMode="cover">
  323. <Image source={{ uri: Images.mine.kaixinMineHeadBg }} style={styles.headerBg} contentFit="cover" />
  324. <View style={[styles.header, { paddingTop: insets.top }]}>
  325. <TouchableOpacity style={styles.backBtn} onPress={() => router.back()}>
  326. <Text style={styles.backIcon}>‹</Text>
  327. </TouchableOpacity>
  328. <Text style={styles.title}>仓库</Text>
  329. <View style={styles.placeholder} />
  330. </View>
  331. <View style={[styles.content, { paddingTop: insets.top + 50 }]}>
  332. <View style={styles.mainTabs}>
  333. {mainTabs.map((tab, index) => {
  334. const isActive = mainTabIndex === index;
  335. // Use Yellow L bg for active, Grey (Hui) for inactive
  336. const bg = isActive ? Images.common.butBgL : Images.common.butBgHui;
  337. return (
  338. <TouchableOpacity key={index} style={styles.mainTabItem} onPress={() => setMainTabIndex(index)}>
  339. <ImageBackground source={{ uri: bg }} style={styles.mainTabBg} resizeMode="contain">
  340. <Text style={isActive ? styles.mainTabTextActive : styles.mainTabText}>{tab}</Text>
  341. </ImageBackground>
  342. </TouchableOpacity>
  343. );
  344. })}
  345. </View>
  346. {mainTabIndex === 0 && (
  347. <View style={styles.levelTabs}>
  348. {LEVEL_TABS.map((tab, index) => {
  349. const isActive = levelTabIndex === index;
  350. return (
  351. <TouchableOpacity
  352. key={index}
  353. style={[styles.levelTabItem, isActive && styles.levelTabItemActive]}
  354. onPress={() => setLevelTabIndex(index)}
  355. >
  356. {isActive && <View style={styles.decorTL} />}
  357. <Text style={[styles.levelTabText, isActive && styles.levelTabTextActive]}>{tab.title}</Text>
  358. {isActive && <View style={styles.decorBR} />}
  359. </TouchableOpacity>
  360. );
  361. })}
  362. </View>
  363. )}
  364. <FlatList
  365. data={list as any[]}
  366. renderItem={mainTabIndex === 2 ? renderPickupItem as any : renderStoreItem as any}
  367. keyExtractor={(item: any, index) => item.id || item.tradeNo || index.toString()}
  368. contentContainerStyle={styles.listContent}
  369. refreshControl={<RefreshControl refreshing={refreshing} onRefresh={handleRefresh} tintColor="#fff" />}
  370. onEndReached={handleLoadMore}
  371. onEndReachedThreshold={0.3}
  372. ListHeaderComponent={mainTabIndex === 2 ? (
  373. <View style={styles.pickupTip}>
  374. <Text style={styles.pickupTipIcon}>⚠️</Text>
  375. <Text style={styles.pickupTipText}>您的包裹一般在5个工作日内发货,如遇特殊情况可能会有延迟,敬请谅解~</Text>
  376. </View>
  377. ) : null}
  378. ListFooterComponent={loading && list.length > 0 ? <ActivityIndicator color="#fff" style={{ marginVertical: 10 }} /> : null}
  379. ListEmptyComponent={!loading ? <View style={styles.emptyBox}><Text style={styles.emptyText}>暂无物品</Text></View> : null}
  380. />
  381. </View>
  382. {mainTabIndex !== 2 && list.length > 0 && (
  383. <View style={[styles.bottomBar, { paddingBottom: insets.bottom + 10 }]}>
  384. {mainTabIndex === 1 ? (
  385. <View style={styles.buttonRow}>
  386. <TouchableOpacity
  387. style={[styles.actionBtn, styles.selectAllBtn]}
  388. onPress={handleSelectAll}
  389. >
  390. <Text style={styles.selectAllText}>
  391. {list.length > 0 && list.every(item => checkMap[item.id]) ? '取消全选' : '全选'}
  392. </Text>
  393. </TouchableOpacity>
  394. <TouchableOpacity
  395. style={[styles.actionBtn, styles.removeBtn]}
  396. onPress={handleMoveOutAll}
  397. >
  398. <ImageBackground source={{ uri: Images.common.butBgL }} style={styles.btnBg} resizeMode="stretch">
  399. <Text style={styles.removeText}>移出保险柜</Text>
  400. </ImageBackground>
  401. </TouchableOpacity>
  402. </View>
  403. ) : (
  404. <TouchableOpacity style={styles.bottomBtn} onPress={handleTakeGoods}>
  405. <ImageBackground source={{ uri: Images.common.butBgL }} style={styles.bottomBtnBg} resizeMode="stretch">
  406. <Text style={styles.bottomBtnText}>立即提货</Text>
  407. </ImageBackground>
  408. </TouchableOpacity>
  409. )}
  410. <Text style={styles.bottomInfoText}>已选 <Text style={styles.bottomInfoCount}>{selectedCount}</Text> 件商品</Text>
  411. </View>
  412. )}
  413. {/* 提货弹窗 */}
  414. <CheckoutModal
  415. visible={checkoutVisible}
  416. selectedItems={Object.values(checkMap)}
  417. onClose={() => setCheckoutVisible(false)}
  418. onSuccess={handleCheckoutSuccess}
  419. />
  420. </ImageBackground>
  421. </View>
  422. );
  423. }
  424. const styles = StyleSheet.create({
  425. container: { flex: 1, backgroundColor: '#1a1a2e' },
  426. background: { flex: 1 },
  427. headerBg: { position: 'absolute', top: 0, left: 0, width: '100%', height: 160 },
  428. header: { position: 'absolute', top: 0, left: 0, right: 0, zIndex: 100, flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', paddingHorizontal: 10, paddingBottom: 10 },
  429. backBtn: { width: 40, height: 40, justifyContent: 'center', alignItems: 'center' },
  430. backIcon: { fontSize: 32, color: '#fff', fontWeight: 'bold' },
  431. title: { color: '#fff', fontSize: 16, fontWeight: 'bold' },
  432. placeholder: { width: 40 },
  433. content: { flex: 1 },
  434. mainTabs: {
  435. flexDirection: 'row',
  436. justifyContent: 'space-between',
  437. paddingHorizontal: 12, // Reduced from 15 to match everything else
  438. paddingBottom: 2
  439. },
  440. mainTabItem: {
  441. width: '30%',
  442. height: 44, // Slightly taller
  443. justifyContent: 'center',
  444. alignItems: 'center'
  445. },
  446. mainTabBg: {
  447. width: '100%',
  448. height: '100%',
  449. justifyContent: 'center',
  450. alignItems: 'center'
  451. },
  452. mainTabText: { fontSize: 15, color: '#333', fontWeight: 'bold' },
  453. mainTabTextActive: { fontSize: 16, color: '#000', fontWeight: 'bold' },
  454. mainTabLine: { display: 'none' },
  455. levelTabs: {
  456. flexDirection: 'row',
  457. alignItems: 'center',
  458. paddingHorizontal: 10, // Add some padding back for the text content since container is full width
  459. paddingVertical: 12,
  460. borderBottomWidth: 1,
  461. borderBottomColor: 'rgba(255,255,255,0.15)'
  462. },
  463. levelTabItem: {
  464. marginRight: 25,
  465. alignItems: 'center',
  466. justifyContent: 'center',
  467. paddingHorizontal: 6,
  468. paddingVertical: 2,
  469. position: 'relative',
  470. minWidth: 40
  471. },
  472. levelTabItemActive: { backgroundColor: 'transparent' },
  473. levelTabText: { color: '#666', fontSize: 15, fontWeight: 'bold' },
  474. levelTabTextActive: {
  475. color: '#ff6b00',
  476. fontSize: 17,
  477. fontWeight: '900',
  478. textShadowColor: 'rgba(0, 0, 0, 0.3)',
  479. textShadowOffset: { width: 1, height: 1 },
  480. textShadowRadius: 1
  481. },
  482. // Corner Decorations - Larger and jagged simulation
  483. decorTL: {
  484. position: 'absolute',
  485. top: 0,
  486. left: -4,
  487. width: 0,
  488. height: 0,
  489. borderTopWidth: 8,
  490. borderRightWidth: 8,
  491. borderTopColor: '#ff6b00',
  492. borderRightColor: 'transparent',
  493. },
  494. decorBR: {
  495. position: 'absolute',
  496. bottom: 0,
  497. right: -4,
  498. width: 0,
  499. height: 0,
  500. borderBottomWidth: 8,
  501. borderLeftWidth: 8,
  502. borderBottomColor: '#ff6b00',
  503. borderLeftColor: 'transparent',
  504. },
  505. levelInd: { display: 'none' },
  506. listContent: {
  507. paddingHorizontal: 8,
  508. paddingVertical: 10,
  509. paddingBottom: 150,
  510. },
  511. cell: {
  512. marginBottom: 0,
  513. width: '100%',
  514. minHeight: 154, // 原项目 308rpx
  515. },
  516. cellContent: {
  517. paddingTop: 15,
  518. paddingBottom: 15,
  519. paddingLeft: 18,
  520. paddingRight: 18, // 原项目 36rpx
  521. },
  522. cellHeader: {
  523. flexDirection: 'row',
  524. justifyContent: 'space-between',
  525. alignItems: 'center',
  526. marginBottom: 10,
  527. paddingBottom: 10,
  528. borderBottomWidth: 1,
  529. borderBottomColor: 'rgba(0,0,0,0.15)',
  530. },
  531. headerLeft: { flexDirection: 'row', alignItems: 'center' },
  532. checkBox: { width: 16, height: 16, borderWidth: 2, borderColor: '#000', marginRight: 8, justifyContent: 'center', alignItems: 'center', backgroundColor: '#fff' },
  533. checkBoxChecked: { backgroundColor: '#000' },
  534. checkIcon: { color: '#fff', fontSize: 10, fontWeight: 'bold' },
  535. levelTitle: { fontSize: 16, fontWeight: 'bold', textShadowColor: '#000', textShadowOffset: { width: 1, height: 1 }, textShadowRadius: 0 },
  536. lockBox: { flexDirection: 'row', alignItems: 'center' },
  537. lockText: { fontSize: 12, color: '#666', marginRight: 4 },
  538. lockIcon: { width: 16, height: 16 },
  539. cellBody: {
  540. flexDirection: 'row',
  541. alignItems: 'center',
  542. },
  543. goodsImgBg: { width: 65, height: 65, justifyContent: 'center', alignItems: 'center', marginRight: 12, padding: 7 },
  544. goodsImg: { width: '100%', height: '100%' },
  545. goodsInfo: { flex: 1, justifyContent: 'center', paddingRight: 8 },
  546. goodsName: { fontSize: 15, color: '#333', fontWeight: 'bold', marginBottom: 4 },
  547. goodsPrice: { fontSize: 14, color: '#ff6b00', fontWeight: 'bold', marginBottom: 4 },
  548. goodsDesc: { fontSize: 12, color: '#999' },
  549. arrowIcon: { fontSize: 18, color: '#ccc', marginLeft: 8 },
  550. bottomBar: {
  551. position: 'absolute',
  552. bottom: 0,
  553. left: 0,
  554. right: 0,
  555. height: 100, // Taller for Top Button / Bottom Text layout
  556. paddingBottom: 20,
  557. alignItems: 'center',
  558. justifyContent: 'center',
  559. backgroundColor: 'transparent' // Screenshot shows transparent or gradient?
  560. },
  561. bottomBtn: { width: '80%', height: 45, marginBottom: 5 },
  562. buttonRow: { flexDirection: 'row', justifyContent: 'center', width: '100%', paddingHorizontal: 20, marginBottom: 5 },
  563. actionBtn: { height: 45, borderRadius: 22, justifyContent: 'center', alignItems: 'center' },
  564. selectAllBtn: { width: '30%', backgroundColor: '#fff', marginRight: 10, borderWidth: 1, borderColor: '#ccc' },
  565. removeBtn: { width: '65%' },
  566. btnBg: { width: '100%', height: '100%', justifyContent: 'center', alignItems: 'center' },
  567. selectAllText: { fontSize: 16, fontWeight: 'bold', color: '#333' },
  568. removeText: { fontSize: 16, fontWeight: 'bold', color: '#000' },
  569. bottomBtnSecondary: { display: 'none' }, // Removed
  570. bottomBtnSecondaryText: { display: 'none' }, // Removed
  571. bottomBtnBg: { width: '100%', height: '100%', justifyContent: 'center', alignItems: 'center' },
  572. bottomBtnText: { color: '#000', fontSize: 16, fontWeight: 'bold' },
  573. bottomInfoText: { color: '#333', fontSize: 12 }, // Text below button
  574. bottomInfoCount: { fontWeight: 'bold' },
  575. emptyBox: { marginTop: 100, alignItems: 'center' },
  576. emptyText: { color: '#999', fontSize: 14 },
  577. pickupCell: { width: '100%', marginBottom: 10, padding: 12 },
  578. pickupTop: { flexDirection: 'row', justifyContent: 'space-between', paddingBottom: 8, borderBottomWidth: 1, borderBottomColor: '#eee' },
  579. pickupTime: { fontSize: 12, color: '#999' },
  580. pickupStatus: { fontSize: 12, fontWeight: 'bold' },
  581. pickupTimeout: { fontSize: 11, color: '#ff6b00', marginTop: 4 },
  582. pickupAddress: { flexDirection: 'row', paddingVertical: 10, borderBottomWidth: 1, borderBottomColor: '#eee' },
  583. locationIcon: { fontSize: 16, marginRight: 8 },
  584. addressInfo: { flex: 1 },
  585. addressName: { fontSize: 14, fontWeight: 'bold', color: '#333' },
  586. addressDetail: { fontSize: 12, color: '#666', marginTop: 4 },
  587. pickupGoodsBox: { paddingVertical: 10 },
  588. pickupGoodsList: { flexDirection: 'row' },
  589. pickupGoodsItem: { marginRight: 10, alignItems: 'center' },
  590. pickupGoodsImg: { width: 60, height: 60, borderRadius: 4 },
  591. pickupGoodsCount: { position: 'absolute', right: 0, bottom: 0, backgroundColor: 'rgba(0,0,0,0.5)', paddingHorizontal: 4, borderRadius: 4 },
  592. pickupGoodsCountText: { color: '#fff', fontSize: 10 },
  593. pickupOrderRow: { flexDirection: 'row', alignItems: 'center', paddingVertical: 8 },
  594. pickupOrderLabel: { fontSize: 12, color: '#666' },
  595. pickupOrderNo: { flex: 1, fontSize: 12, color: '#333' },
  596. copyBtn: { paddingHorizontal: 8, paddingVertical: 4, backgroundColor: '#f5f5f5', borderRadius: 4 },
  597. copyBtnText: { fontSize: 12, color: '#666' },
  598. pickupInfoRow: { flexDirection: 'row', paddingVertical: 4 },
  599. pickupInfoLabel: { fontSize: 12, color: '#666' },
  600. pickupInfoValue: { fontSize: 12, color: '#333' },
  601. pickupBottom: { flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', paddingTop: 10 },
  602. pickupExpressAmount: { fontSize: 12, color: '#333' },
  603. priceText: { color: '#ff6b00', fontWeight: 'bold' },
  604. expressBtn: { paddingHorizontal: 12, paddingVertical: 6, backgroundColor: '#fec433', borderRadius: 4 },
  605. expressBtnText: { fontSize: 12, color: '#000', fontWeight: 'bold' },
  606. pickupTip: { flexDirection: 'row', alignItems: 'center', padding: 10, backgroundColor: 'rgba(255,235,200,0.8)', marginHorizontal: 8, borderRadius: 6, marginBottom: 10 },
  607. pickupTipIcon: { fontSize: 14, marginRight: 6 },
  608. pickupTipText: { flex: 1, fontSize: 11, color: '#ff6b00' },
  609. goodsSource: { fontSize: 12, color: '#666', opacity: 0.8 },
  610. arrow: { fontSize: 18, color: '#fec433', marginLeft: 8 },
  611. });