index.tsx 28 KB

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