index.tsx 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654
  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 };
  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. <Text style={styles.goodsSource}>从{FROM_TYPE_MAP[item.fromRelationType] || '其他'}获得</Text>
  237. </View>
  238. <Text style={styles.arrow}>{'>'}</Text>
  239. </View>
  240. </Pressable>
  241. </ImageBackground>
  242. );
  243. };
  244. const copyToClipboard = (text: string) => {
  245. showAlert(`订单号已复制: ${text}`);
  246. };
  247. const showExpress = (item: PickupItem) => {
  248. router.push({ pathname: '/store/packages' as any, params: { tradeNo: item.tradeNo } });
  249. };
  250. const renderPickupItem = ({ item }: { item: PickupItem & { groupedList?: Array<{ total: number; data: any }> } }) => {
  251. const statusInfo = STATUS_MAP[item.status] || { text: '未知', color: '#999' };
  252. return (
  253. <ImageBackground source={{ uri: Images.mine.storeItemBg }} style={styles.pickupCell} resizeMode="stretch">
  254. {/* 顶部信息 */}
  255. <View style={styles.pickupTop}>
  256. <Text style={styles.pickupTime}>下单时间:{item.createTime}</Text>
  257. <Text style={[styles.pickupStatus, { color: statusInfo.color }]}>{statusInfo.text}</Text>
  258. </View>
  259. {item.status === 0 && item.paymentTimeoutTime && (
  260. <Text style={styles.pickupTimeout}>{item.paymentTimeoutTime} 将自动取消该订单,如有优惠券,将自动退回</Text>
  261. )}
  262. {/* 收货地址 */}
  263. <View style={styles.pickupAddress}>
  264. <Text style={styles.locationIcon}>📍</Text>
  265. <View style={styles.addressInfo}>
  266. <Text style={styles.addressName}>{item.contactName},{item.contactNo}</Text>
  267. <Text style={styles.addressDetail}>{item.province}{item.city}{item.district}{item.address}</Text>
  268. </View>
  269. </View>
  270. {/* 商品列表 */}
  271. <View style={styles.pickupGoodsBox}>
  272. <ScrollView horizontal showsHorizontalScrollIndicator={false} style={styles.pickupGoodsList}>
  273. {(item.groupedList || []).map((goods, idx) => (
  274. <View key={idx} style={styles.pickupGoodsItem}>
  275. <Image source={{ uri: goods.data.cover }} style={styles.pickupGoodsImg} contentFit="contain" />
  276. <View style={styles.pickupGoodsCount}>
  277. <Text style={styles.pickupGoodsCountText}>x{goods.total}</Text>
  278. </View>
  279. </View>
  280. ))}
  281. </ScrollView>
  282. </View>
  283. {/* 订单号 */}
  284. <View style={styles.pickupOrderRow}>
  285. <Text style={styles.pickupOrderLabel}>订单号:</Text>
  286. <Text style={styles.pickupOrderNo} numberOfLines={1}>{item.tradeNo}</Text>
  287. <TouchableOpacity style={styles.copyBtn} onPress={() => copyToClipboard(item.tradeNo)}>
  288. <Text style={styles.copyBtnText}>复制</Text>
  289. </TouchableOpacity>
  290. </View>
  291. {item.paymentTime && (
  292. <View style={styles.pickupInfoRow}>
  293. <Text style={styles.pickupInfoLabel}>付款时间:</Text>
  294. <Text style={styles.pickupInfoValue}>{item.paymentTime}</Text>
  295. </View>
  296. )}
  297. {item.status === 12 && item.cancelRemark && (
  298. <View style={styles.pickupInfoRow}>
  299. <Text style={styles.pickupInfoLabel}>备注</Text>
  300. <Text style={[styles.pickupInfoValue, { color: '#ff6b00' }]}>{item.cancelRemark}</Text>
  301. </View>
  302. )}
  303. {/* 底部操作 */}
  304. <View style={styles.pickupBottom}>
  305. <Text style={styles.pickupExpressAmount}>配送费:<Text style={styles.priceText}>¥{item.expressAmount}</Text></Text>
  306. {[1, 2, 99].includes(item.status) && (
  307. <TouchableOpacity style={styles.expressBtn} onPress={() => showExpress(item)}>
  308. <Text style={styles.expressBtnText}>物流信息</Text>
  309. </TouchableOpacity>
  310. )}
  311. </View>
  312. </ImageBackground>
  313. );
  314. };
  315. const selectedCount = Object.keys(checkMap).length;
  316. return (
  317. <View style={styles.container}>
  318. <StatusBar barStyle="light-content" />
  319. <ImageBackground source={{ uri: Images.mine.kaixinMineBg }} style={styles.background} resizeMode="cover">
  320. <Image source={{ uri: Images.mine.kaixinMineHeadBg }} style={styles.headerBg} contentFit="cover" />
  321. <View style={[styles.header, { paddingTop: insets.top }]}>
  322. <TouchableOpacity style={styles.backBtn} onPress={() => router.back()}>
  323. <Text style={styles.backIcon}>‹</Text>
  324. </TouchableOpacity>
  325. <Text style={styles.title}>仓库</Text>
  326. <View style={styles.placeholder} />
  327. </View>
  328. <View style={[styles.content, { paddingTop: insets.top + 50 }]}>
  329. <View style={styles.mainTabs}>
  330. {mainTabs.map((tab, index) => {
  331. const isActive = mainTabIndex === index;
  332. // Use Yellow L bg for active, Grey (Hui) for inactive
  333. const bg = isActive ? Images.common.butBgL : Images.common.butBgHui;
  334. return (
  335. <TouchableOpacity key={index} style={styles.mainTabItem} onPress={() => setMainTabIndex(index)}>
  336. <ImageBackground source={{ uri: bg }} style={styles.mainTabBg} resizeMode="contain">
  337. <Text style={isActive ? styles.mainTabTextActive : styles.mainTabText}>{tab}</Text>
  338. </ImageBackground>
  339. </TouchableOpacity>
  340. );
  341. })}
  342. </View>
  343. {mainTabIndex === 0 && (
  344. <View style={styles.levelTabs}>
  345. {LEVEL_TABS.map((tab, index) => {
  346. const isActive = levelTabIndex === index;
  347. return (
  348. <TouchableOpacity
  349. key={index}
  350. style={[styles.levelTabItem, isActive && styles.levelTabItemActive]}
  351. onPress={() => setLevelTabIndex(index)}
  352. >
  353. {isActive && <View style={styles.decorTL} />}
  354. <Text style={[styles.levelTabText, isActive && styles.levelTabTextActive]}>{tab.title}</Text>
  355. {isActive && <View style={styles.decorBR} />}
  356. </TouchableOpacity>
  357. );
  358. })}
  359. </View>
  360. )}
  361. <FlatList
  362. data={list as any[]}
  363. renderItem={mainTabIndex === 2 ? renderPickupItem as any : renderStoreItem as any}
  364. keyExtractor={(item: any, index) => item.id || item.tradeNo || index.toString()}
  365. contentContainerStyle={styles.listContent}
  366. refreshControl={<RefreshControl refreshing={refreshing} onRefresh={handleRefresh} tintColor="#fff" />}
  367. onEndReached={handleLoadMore}
  368. onEndReachedThreshold={0.3}
  369. ListHeaderComponent={mainTabIndex === 2 ? (
  370. <View style={styles.pickupTip}>
  371. <Text style={styles.pickupTipIcon}>⚠️</Text>
  372. <Text style={styles.pickupTipText}>您的包裹一般在5个工作日内发货,如遇特殊情况可能会有延迟,敬请谅解~</Text>
  373. </View>
  374. ) : null}
  375. ListFooterComponent={loading && list.length > 0 ? <ActivityIndicator color="#fff" style={{ marginVertical: 10 }} /> : null}
  376. ListEmptyComponent={!loading ? <View style={styles.emptyBox}><Text style={styles.emptyText}>暂无物品</Text></View> : null}
  377. />
  378. </View>
  379. {mainTabIndex !== 2 && list.length > 0 && (
  380. <View style={[styles.bottomBar, { paddingBottom: insets.bottom + 10 }]}>
  381. {mainTabIndex === 1 ? (
  382. <View style={styles.buttonRow}>
  383. <TouchableOpacity
  384. style={[styles.actionBtn, styles.selectAllBtn]}
  385. onPress={handleSelectAll}
  386. >
  387. <Text style={styles.selectAllText}>
  388. {list.length > 0 && list.every(item => checkMap[item.id]) ? '取消全选' : '全选'}
  389. </Text>
  390. </TouchableOpacity>
  391. <TouchableOpacity
  392. style={[styles.actionBtn, styles.removeBtn]}
  393. onPress={handleMoveOutAll}
  394. >
  395. <ImageBackground source={{ uri: Images.common.butBgL }} style={styles.btnBg} resizeMode="stretch">
  396. <Text style={styles.removeText}>移出保险柜</Text>
  397. </ImageBackground>
  398. </TouchableOpacity>
  399. </View>
  400. ) : (
  401. <TouchableOpacity style={styles.bottomBtn} onPress={handleTakeGoods}>
  402. <ImageBackground source={{ uri: Images.common.butBgL }} style={styles.bottomBtnBg} resizeMode="stretch">
  403. <Text style={styles.bottomBtnText}>立即提货</Text>
  404. </ImageBackground>
  405. </TouchableOpacity>
  406. )}
  407. <Text style={styles.bottomInfoText}>已选 <Text style={styles.bottomInfoCount}>{selectedCount}</Text> 件商品</Text>
  408. </View>
  409. )}
  410. {/* 提货弹窗 */}
  411. <CheckoutModal
  412. visible={checkoutVisible}
  413. selectedItems={Object.values(checkMap)}
  414. onClose={() => setCheckoutVisible(false)}
  415. onSuccess={handleCheckoutSuccess}
  416. />
  417. </ImageBackground>
  418. </View>
  419. );
  420. }
  421. const styles = StyleSheet.create({
  422. container: { flex: 1, backgroundColor: '#1a1a2e' },
  423. background: { flex: 1 },
  424. headerBg: { position: 'absolute', top: 0, left: 0, width: '100%', height: 160 },
  425. header: { position: 'absolute', top: 0, left: 0, right: 0, zIndex: 100, flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', paddingHorizontal: 10, paddingBottom: 10 },
  426. backBtn: { width: 40, height: 40, justifyContent: 'center', alignItems: 'center' },
  427. backIcon: { fontSize: 32, color: '#fff', fontWeight: 'bold' },
  428. title: { color: '#fff', fontSize: 16, fontWeight: 'bold' },
  429. placeholder: { width: 40 },
  430. content: { flex: 1 },
  431. mainTabs: {
  432. flexDirection: 'row',
  433. justifyContent: 'space-between',
  434. paddingHorizontal: 12, // Reduced from 15 to match everything else
  435. paddingBottom: 2
  436. },
  437. mainTabItem: {
  438. width: '30%',
  439. height: 44, // Slightly taller
  440. justifyContent: 'center',
  441. alignItems: 'center'
  442. },
  443. mainTabBg: {
  444. width: '100%',
  445. height: '100%',
  446. justifyContent: 'center',
  447. alignItems: 'center'
  448. },
  449. mainTabText: { fontSize: 15, color: '#333', fontWeight: 'bold' },
  450. mainTabTextActive: { fontSize: 16, color: '#000', fontWeight: 'bold' },
  451. mainTabLine: { display: 'none' },
  452. levelTabs: {
  453. flexDirection: 'row',
  454. alignItems: 'center',
  455. paddingHorizontal: 10, // Add some padding back for the text content since container is full width
  456. paddingVertical: 12,
  457. borderBottomWidth: 1,
  458. borderBottomColor: 'rgba(255,255,255,0.15)'
  459. },
  460. levelTabItem: {
  461. marginRight: 25,
  462. alignItems: 'center',
  463. justifyContent: 'center',
  464. paddingHorizontal: 6,
  465. paddingVertical: 2,
  466. position: 'relative',
  467. minWidth: 40
  468. },
  469. levelTabItemActive: { backgroundColor: 'transparent' },
  470. levelTabText: { color: '#666', fontSize: 15, fontWeight: 'bold' },
  471. levelTabTextActive: {
  472. color: '#ff6b00',
  473. fontSize: 17,
  474. fontWeight: '900',
  475. textShadowColor: 'rgba(0, 0, 0, 0.3)',
  476. textShadowOffset: { width: 1, height: 1 },
  477. textShadowRadius: 1
  478. },
  479. // Corner Decorations - Larger and jagged simulation
  480. decorTL: {
  481. position: 'absolute',
  482. top: 0,
  483. left: -4,
  484. width: 0,
  485. height: 0,
  486. borderTopWidth: 8,
  487. borderRightWidth: 8,
  488. borderTopColor: '#ff6b00',
  489. borderRightColor: 'transparent',
  490. },
  491. decorBR: {
  492. position: 'absolute',
  493. bottom: 0,
  494. right: -4,
  495. width: 0,
  496. height: 0,
  497. borderBottomWidth: 8,
  498. borderLeftWidth: 8,
  499. borderBottomColor: '#ff6b00',
  500. borderLeftColor: 'transparent',
  501. },
  502. levelInd: { display: 'none' },
  503. listContent: {
  504. paddingHorizontal: 8,
  505. paddingVertical: 10,
  506. paddingBottom: 150,
  507. },
  508. cell: {
  509. marginBottom: 0,
  510. width: '100%',
  511. minHeight: 154, // 原项目 308rpx
  512. },
  513. cellContent: {
  514. paddingTop: 15,
  515. paddingBottom: 15,
  516. paddingLeft: 18,
  517. paddingRight: 18, // 原项目 36rpx
  518. },
  519. cellHeader: {
  520. flexDirection: 'row',
  521. justifyContent: 'space-between',
  522. alignItems: 'center',
  523. marginBottom: 10,
  524. paddingBottom: 10,
  525. borderBottomWidth: 1,
  526. borderBottomColor: 'rgba(0,0,0,0.15)',
  527. },
  528. headerLeft: { flexDirection: 'row', alignItems: 'center' },
  529. checkBox: { width: 16, height: 16, borderWidth: 2, borderColor: '#000', marginRight: 8, justifyContent: 'center', alignItems: 'center', backgroundColor: '#fff' },
  530. checkBoxChecked: { backgroundColor: '#000' },
  531. checkIcon: { color: '#fff', fontSize: 10, fontWeight: 'bold' },
  532. levelTitle: { fontSize: 16, fontWeight: 'bold', textShadowColor: '#000', textShadowOffset: { width: 1, height: 1 }, textShadowRadius: 0 },
  533. lockBox: { flexDirection: 'row', alignItems: 'center' },
  534. lockText: { fontSize: 12, color: '#666', marginRight: 4 },
  535. lockIcon: { width: 16, height: 16 },
  536. cellBody: {
  537. flexDirection: 'row',
  538. alignItems: 'center',
  539. },
  540. goodsImgBg: { width: 65, height: 65, justifyContent: 'center', alignItems: 'center', marginRight: 12, padding: 7 },
  541. goodsImg: { width: '100%', height: '100%' },
  542. goodsInfo: { flex: 1, justifyContent: 'center', paddingRight: 8 },
  543. goodsName: { fontSize: 15, color: '#333', fontWeight: 'bold', marginBottom: 6 },
  544. goodsDesc: { fontSize: 12, color: '#999' },
  545. arrowIcon: { fontSize: 18, color: '#ccc', marginLeft: 8 },
  546. bottomBar: {
  547. position: 'absolute',
  548. bottom: 0,
  549. left: 0,
  550. right: 0,
  551. height: 100, // Taller for Top Button / Bottom Text layout
  552. paddingBottom: 20,
  553. alignItems: 'center',
  554. justifyContent: 'center',
  555. backgroundColor: 'transparent' // Screenshot shows transparent or gradient?
  556. },
  557. bottomBtn: { width: '80%', height: 45, marginBottom: 5 },
  558. buttonRow: { flexDirection: 'row', justifyContent: 'center', width: '100%', paddingHorizontal: 20, marginBottom: 5 },
  559. actionBtn: { height: 45, borderRadius: 22, justifyContent: 'center', alignItems: 'center' },
  560. selectAllBtn: { width: '30%', backgroundColor: '#fff', marginRight: 10, borderWidth: 1, borderColor: '#ccc' },
  561. removeBtn: { width: '65%' },
  562. btnBg: { width: '100%', height: '100%', justifyContent: 'center', alignItems: 'center' },
  563. selectAllText: { fontSize: 16, fontWeight: 'bold', color: '#333' },
  564. removeText: { fontSize: 16, fontWeight: 'bold', color: '#000' },
  565. bottomBtnSecondary: { display: 'none' }, // Removed
  566. bottomBtnSecondaryText: { display: 'none' }, // Removed
  567. bottomBtnBg: { width: '100%', height: '100%', justifyContent: 'center', alignItems: 'center' },
  568. bottomBtnText: { color: '#000', fontSize: 16, fontWeight: 'bold' },
  569. bottomInfoText: { color: '#333', fontSize: 12 }, // Text below button
  570. bottomInfoCount: { fontWeight: 'bold' },
  571. emptyBox: { marginTop: 100, alignItems: 'center' },
  572. emptyText: { color: '#999', fontSize: 14 },
  573. pickupCell: { width: '100%', marginBottom: 10, padding: 12 },
  574. pickupTop: { flexDirection: 'row', justifyContent: 'space-between', paddingBottom: 8, borderBottomWidth: 1, borderBottomColor: '#eee' },
  575. pickupTime: { fontSize: 12, color: '#999' },
  576. pickupStatus: { fontSize: 12, fontWeight: 'bold' },
  577. pickupTimeout: { fontSize: 11, color: '#ff6b00', marginTop: 4 },
  578. pickupAddress: { flexDirection: 'row', paddingVertical: 10, borderBottomWidth: 1, borderBottomColor: '#eee' },
  579. locationIcon: { fontSize: 16, marginRight: 8 },
  580. addressInfo: { flex: 1 },
  581. addressName: { fontSize: 14, fontWeight: 'bold', color: '#333' },
  582. addressDetail: { fontSize: 12, color: '#666', marginTop: 4 },
  583. pickupGoodsBox: { paddingVertical: 10 },
  584. pickupGoodsList: { flexDirection: 'row' },
  585. pickupGoodsItem: { marginRight: 10, alignItems: 'center' },
  586. pickupGoodsImg: { width: 60, height: 60, borderRadius: 4 },
  587. pickupGoodsCount: { position: 'absolute', right: 0, bottom: 0, backgroundColor: 'rgba(0,0,0,0.5)', paddingHorizontal: 4, borderRadius: 4 },
  588. pickupGoodsCountText: { color: '#fff', fontSize: 10 },
  589. pickupOrderRow: { flexDirection: 'row', alignItems: 'center', paddingVertical: 8 },
  590. pickupOrderLabel: { fontSize: 12, color: '#666' },
  591. pickupOrderNo: { flex: 1, fontSize: 12, color: '#333' },
  592. copyBtn: { paddingHorizontal: 8, paddingVertical: 4, backgroundColor: '#f5f5f5', borderRadius: 4 },
  593. copyBtnText: { fontSize: 12, color: '#666' },
  594. pickupInfoRow: { flexDirection: 'row', paddingVertical: 4 },
  595. pickupInfoLabel: { fontSize: 12, color: '#666' },
  596. pickupInfoValue: { fontSize: 12, color: '#333' },
  597. pickupBottom: { flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', paddingTop: 10 },
  598. pickupExpressAmount: { fontSize: 12, color: '#333' },
  599. priceText: { color: '#ff6b00', fontWeight: 'bold' },
  600. expressBtn: { paddingHorizontal: 12, paddingVertical: 6, backgroundColor: '#fec433', borderRadius: 4 },
  601. expressBtnText: { fontSize: 12, color: '#000', fontWeight: 'bold' },
  602. pickupTip: { flexDirection: 'row', alignItems: 'center', padding: 10, backgroundColor: 'rgba(255,235,200,0.8)', marginHorizontal: 8, borderRadius: 6, marginBottom: 10 },
  603. pickupTipIcon: { fontSize: 14, marginRight: 6 },
  604. pickupTipText: { flex: 1, fontSize: 11, color: '#ff6b00' },
  605. goodsSource: { fontSize: 12, color: '#666', opacity: 0.8 },
  606. arrow: { fontSize: 18, color: '#fec433', marginLeft: 8 },
  607. });