index.tsx 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565
  1. import { Image } from 'expo-image';
  2. import { useLocalSearchParams, useRouter } from 'expo-router';
  3. import React, { useCallback, useEffect, useRef, useState } from 'react';
  4. import {
  5. ActivityIndicator,
  6. Animated,
  7. Dimensions,
  8. ImageBackground,
  9. ScrollView,
  10. StatusBar,
  11. StyleSheet,
  12. Text,
  13. TouchableOpacity,
  14. View,
  15. } from 'react-native';
  16. import { useSafeAreaInsets } from 'react-native-safe-area-context';
  17. import { Images } from '@/constants/images';
  18. import { useAuth } from '@/contexts/AuthContext';
  19. import {
  20. getBoxDetail,
  21. getNextBox,
  22. getPoolDetail,
  23. getPreBox,
  24. lockBox,
  25. poolIn,
  26. poolOut,
  27. previewOrder,
  28. unlockBox,
  29. } from '@/services/award';
  30. import { CheckoutModal } from '../award-detail/components/CheckoutModal';
  31. import { ProductList } from '../award-detail/components/ProductList';
  32. import { RecordModal } from '../award-detail/components/RecordModal';
  33. import { RuleModal } from '../award-detail/components/RuleModal';
  34. const { width: SCREEN_WIDTH } = Dimensions.get('window');
  35. interface PoolData {
  36. id: string;
  37. name: string;
  38. cover: string;
  39. price: number;
  40. specialPrice?: number;
  41. specialPriceFive?: number;
  42. restrictionQuantity?: number;
  43. luckGoodsList: ProductItem[];
  44. luckGoodsLevelProbabilityList?: any[];
  45. }
  46. interface ProductItem {
  47. id: string;
  48. name: string;
  49. cover: string;
  50. level: string;
  51. probability: number;
  52. price?: number;
  53. quantity?: number;
  54. }
  55. interface BoxData {
  56. number: string;
  57. leftQuantity: number;
  58. leftQuantityA: number;
  59. leftQuantityB: number;
  60. leftQuantityC: number;
  61. leftQuantityD: number;
  62. lastNumber: number;
  63. lock?: { locker: string; leftTime: number };
  64. usedStat?: Record<string, { spuId: string; quantity: number }>;
  65. prizeList?: any[];
  66. }
  67. export default function AwardDetailYfsScreen() {
  68. const { poolId } = useLocalSearchParams<{ poolId: string }>();
  69. const router = useRouter();
  70. const insets = useSafeAreaInsets();
  71. const { user } = useAuth();
  72. const [loading, setLoading] = useState(true);
  73. const [data, setData] = useState<PoolData | null>(null);
  74. const [products, setProducts] = useState<ProductItem[]>([]);
  75. const [box, setBox] = useState<BoxData | null>(null);
  76. const [boxNum, setBoxNum] = useState<string>('');
  77. const [currentIndex, setCurrentIndex] = useState(0);
  78. const [leftTime, setLeftTime] = useState(0);
  79. const [probability, setProbability] = useState<any[]>([]);
  80. const [scrollTop, setScrollTop] = useState(0);
  81. const checkoutRef = useRef<any>(null);
  82. const recordRef = useRef<any>(null);
  83. const ruleRef = useRef<any>(null);
  84. const floatAnim = useRef(new Animated.Value(0)).current;
  85. const timerRef = useRef<ReturnType<typeof setInterval> | null>(null);
  86. useEffect(() => {
  87. Animated.loop(
  88. Animated.sequence([
  89. Animated.timing(floatAnim, { toValue: 10, duration: 1500, useNativeDriver: true }),
  90. Animated.timing(floatAnim, { toValue: -10, duration: 1500, useNativeDriver: true }),
  91. ])
  92. ).start();
  93. }, []);
  94. const loadData = useCallback(async () => {
  95. if (!poolId) return;
  96. setLoading(true);
  97. try {
  98. const detail = await getPoolDetail(poolId);
  99. if (detail) {
  100. setData(detail);
  101. setProducts(detail.luckGoodsList || []);
  102. }
  103. } catch (error) {
  104. console.error('加载数据失败:', error);
  105. }
  106. setLoading(false);
  107. }, [poolId]);
  108. const loadBox = useCallback(
  109. async (num?: string) => {
  110. if (!poolId) return;
  111. try {
  112. const res = await getBoxDetail(poolId, num);
  113. if (res) handleBoxResult(res);
  114. } catch (error) {
  115. console.error('加载盒子失败:', error);
  116. }
  117. },
  118. [poolId]
  119. );
  120. const handleBoxResult = (res: any) => {
  121. const map: Record<string, any> = {};
  122. if (res.usedStat) {
  123. res.usedStat.forEach((item: any) => {
  124. map[item.spuId] = item;
  125. });
  126. }
  127. res.usedStat = map;
  128. setBox(res);
  129. setBoxNum(res.number);
  130. lockTimeStart(res);
  131. if (res.leftQuantity <= 0) {
  132. setProbability([
  133. { level: 'A', probability: 0 },
  134. { level: 'B', probability: 0 },
  135. { level: 'C', probability: 0 },
  136. { level: 'D', probability: 0 },
  137. ]);
  138. } else {
  139. setProbability([
  140. { level: 'A', probability: res.leftQuantityA / res.leftQuantity },
  141. { level: 'B', probability: res.leftQuantityB / res.leftQuantity },
  142. { level: 'C', probability: res.leftQuantityC / res.leftQuantity },
  143. { level: 'D', probability: res.leftQuantityD / res.leftQuantity },
  144. ]);
  145. }
  146. };
  147. const lockTimeStart = (boxData: BoxData) => {
  148. lockTimeEnd();
  149. if (boxData?.lock) {
  150. setLeftTime(boxData.lock.leftTime);
  151. timerRef.current = setInterval(() => {
  152. setLeftTime((prev) => {
  153. if (prev <= 1) {
  154. lockTimeEnd();
  155. loadBox();
  156. return 0;
  157. }
  158. return prev - 1;
  159. });
  160. }, 1000);
  161. }
  162. };
  163. const lockTimeEnd = () => {
  164. if (timerRef.current) {
  165. clearInterval(timerRef.current);
  166. timerRef.current = null;
  167. }
  168. setLeftTime(0);
  169. };
  170. useEffect(() => {
  171. loadData();
  172. loadBox();
  173. if (poolId) poolIn(poolId);
  174. return () => {
  175. if (poolId) poolOut(poolId);
  176. lockTimeEnd();
  177. };
  178. }, [poolId]);
  179. const handlePay = async (num: number) => {
  180. if (!poolId || !data || !box) return;
  181. try {
  182. const preview = await previewOrder(poolId, num, box.number);
  183. if (preview) checkoutRef.current?.show(num, preview, box.number);
  184. } catch (error) {
  185. console.error('预览订单失败:', error);
  186. }
  187. };
  188. const handleSuccess = () => {
  189. setTimeout(() => {
  190. loadData();
  191. loadBox(boxNum);
  192. }, 500);
  193. };
  194. const handlePreBox = async () => {
  195. if (!poolId || !boxNum || parseInt(boxNum) <= 1) return;
  196. try {
  197. const res = await getPreBox(poolId, boxNum);
  198. if (res) handleBoxResult(res);
  199. } catch (error) {
  200. console.error('获取上一个盒子失败:', error);
  201. }
  202. };
  203. const handleNextBox = async () => {
  204. if (!poolId || !box || parseInt(boxNum) >= box.lastNumber) return;
  205. try {
  206. const res = await getNextBox(poolId, boxNum);
  207. if (res) handleBoxResult(res);
  208. } catch (error) {
  209. console.error('获取下一个盒子失败:', error);
  210. }
  211. };
  212. const handleLock = async () => {
  213. if (!poolId || !boxNum) return;
  214. try {
  215. await lockBox(poolId, boxNum);
  216. loadBox(boxNum);
  217. } catch (error) {
  218. console.error('锁定失败:', error);
  219. }
  220. };
  221. const handleUnlock = async () => {
  222. if (!poolId || !boxNum) return;
  223. try {
  224. await unlockBox(poolId, boxNum);
  225. loadBox(boxNum);
  226. } catch (error) {
  227. console.error('解锁失败:', error);
  228. }
  229. };
  230. const handlePrev = () => {
  231. if (currentIndex > 0) setCurrentIndex(currentIndex - 1);
  232. };
  233. const handleNext = () => {
  234. if (currentIndex < products.length - 1) setCurrentIndex(currentIndex + 1);
  235. };
  236. const getLevelName = (level: string) => {
  237. const map: Record<string, string> = { A: '超神款', B: '欧皇款', C: '隐藏款', D: '普通款' };
  238. return map[level] || level;
  239. };
  240. const getLeftNum = (item: ProductItem) => {
  241. if (!box?.usedStat || !box.usedStat[item.id]?.quantity) {
  242. return item.quantity || 1;
  243. }
  244. return (item.quantity || 1) - box.usedStat[item.id].quantity;
  245. };
  246. const getProbability = (item: ProductItem) => {
  247. if (!box || box.leftQuantity <= 0) return '0';
  248. const leftNum = getLeftNum(item);
  249. return ((leftNum / box.leftQuantity) * 100).toFixed(2);
  250. };
  251. const leftNum = box?.lock ? (leftTime / box.lock.leftTime) * 100 : 0;
  252. const headerBg = scrollTop > 0 ? '#333' : 'transparent';
  253. if (loading) {
  254. return (
  255. <View style={styles.loadingContainer}>
  256. <ActivityIndicator size="large" color="#fff" />
  257. </View>
  258. );
  259. }
  260. if (!data) {
  261. return (
  262. <View style={styles.loadingContainer}>
  263. <Text style={styles.errorText}>奖池不存在</Text>
  264. <TouchableOpacity style={styles.backBtn2} onPress={() => router.back()}>
  265. <Text style={styles.backBtn2Text}>返回</Text>
  266. </TouchableOpacity>
  267. </View>
  268. );
  269. }
  270. const currentProduct = products[currentIndex];
  271. return (
  272. <View style={styles.container}>
  273. <StatusBar barStyle="light-content" />
  274. <ImageBackground source={{ uri: Images.common.indexBg }} style={styles.background} resizeMode="cover">
  275. {/* 顶部导航 */}
  276. <View style={[styles.header, { paddingTop: insets.top, backgroundColor: headerBg }]}>
  277. <TouchableOpacity style={styles.backBtn} onPress={() => router.back()}>
  278. <Text style={styles.backText}>{'<'}</Text>
  279. </TouchableOpacity>
  280. <Text style={styles.headerTitle} numberOfLines={1}>
  281. {data.name}
  282. </Text>
  283. <View style={styles.placeholder} />
  284. </View>
  285. <ScrollView
  286. style={styles.scrollView}
  287. showsVerticalScrollIndicator={false}
  288. onScroll={(e) => setScrollTop(e.nativeEvent.contentOffset.y)}
  289. scrollEventThrottle={16}
  290. >
  291. {/* 主商品展示区域 */}
  292. <ImageBackground source={{ uri: Images.box.detail.mainGoodsSection }} style={styles.mainGoodsSection} resizeMode="cover">
  293. <View style={{ height: 72 + insets.top }} />
  294. {/* 商品轮播区域 */}
  295. <View style={styles.mainSwiper}>
  296. {currentProduct && (
  297. <>
  298. <Animated.View style={[styles.productImageBox, { transform: [{ translateY: floatAnim }] }]}>
  299. <Image source={{ uri: currentProduct.cover }} style={styles.productImage} contentFit="contain" />
  300. </Animated.View>
  301. {/* 等级信息 */}
  302. <ImageBackground source={{ uri: Images.box.detail.detailsBut }} style={styles.detailsBut} resizeMode="contain">
  303. <View style={styles.detailsText}>
  304. <Text style={styles.levelText}>{getLevelName(currentProduct.level)}</Text>
  305. <Text style={styles.probabilityText}>({getProbability(currentProduct)}%)</Text>
  306. </View>
  307. </ImageBackground>
  308. {/* 商品名称 */}
  309. <ImageBackground source={{ uri: Images.box.detail.nameBg }} style={styles.goodsNameBg} resizeMode="contain">
  310. <Text style={styles.goodsNameText} numberOfLines={6}>
  311. {currentProduct.name}
  312. </Text>
  313. </ImageBackground>
  314. </>
  315. )}
  316. {/* 左右切换按钮 */}
  317. {currentIndex > 0 && (
  318. <TouchableOpacity style={styles.prevBtn} onPress={handlePrev}>
  319. <Image source={{ uri: Images.box.detail.left }} style={styles.arrowImg} contentFit="contain" />
  320. </TouchableOpacity>
  321. )}
  322. {currentIndex < products.length - 1 && (
  323. <TouchableOpacity style={styles.nextBtn} onPress={handleNext}>
  324. <Image source={{ uri: Images.box.detail.right }} style={styles.arrowImg} contentFit="contain" />
  325. </TouchableOpacity>
  326. )}
  327. </View>
  328. {/* 左侧装饰 */}
  329. <Image source={{ uri: Images.box.detail.positionBgleftBg }} style={styles.positionBgleftBg} contentFit="contain" />
  330. {/* 右侧装饰 */}
  331. <Image source={{ uri: Images.box.detail.positionBgRightBg }} style={styles.positionBgRightBg} contentFit="contain" />
  332. </ImageBackground>
  333. {/* 底部装饰文字 */}
  334. <Image source={{ uri: Images.box.detail.mainGoodsSectionBtext }} style={styles.mainGoodsSectionBtext} contentFit="cover" />
  335. {/* 侧边按钮 - 规则 */}
  336. <TouchableOpacity style={[styles.positionBut, styles.positionRule]} onPress={() => ruleRef.current?.show()}>
  337. <ImageBackground source={{ uri: Images.box.detail.positionBgLeft }} style={styles.positionButBg} resizeMode="contain">
  338. <Text style={styles.positionButText}>规则</Text>
  339. </ImageBackground>
  340. </TouchableOpacity>
  341. {/* 侧边按钮 - 记录 */}
  342. <TouchableOpacity style={[styles.positionBut, styles.positionRecord]} onPress={() => recordRef.current?.show()}>
  343. <ImageBackground source={{ uri: Images.box.detail.positionBgLeft }} style={styles.positionButBg} resizeMode="contain">
  344. <Text style={styles.positionButText}>记录</Text>
  345. </ImageBackground>
  346. </TouchableOpacity>
  347. {/* 侧边按钮 - 锁定/解锁 */}
  348. {box && !box.lock && (
  349. <TouchableOpacity style={[styles.positionBut, styles.positionLock]} onPress={handleLock}>
  350. <ImageBackground source={{ uri: Images.box.detail.positionBgLeft }} style={styles.positionButBg} resizeMode="contain">
  351. <Text style={styles.positionButText}>锁定</Text>
  352. </ImageBackground>
  353. </TouchableOpacity>
  354. )}
  355. {box?.lock && user && box.lock.locker === (user.userId || user.id) && (
  356. <TouchableOpacity style={[styles.positionBut, styles.positionLock]} onPress={handleUnlock}>
  357. <ImageBackground source={{ uri: Images.box.detail.positionBgLeft }} style={styles.positionButBg} resizeMode="contain">
  358. <Text style={styles.positionButText}>解锁</Text>
  359. </ImageBackground>
  360. </TouchableOpacity>
  361. )}
  362. {/* 侧边按钮 - 仓库 */}
  363. <TouchableOpacity style={[styles.positionBut, styles.positionStore]} onPress={() => router.push('/store' as any)}>
  364. <ImageBackground source={{ uri: Images.box.detail.positionBgRight }} style={styles.positionButBg} resizeMode="contain">
  365. <Text style={styles.positionButTextR}>仓库</Text>
  366. </ImageBackground>
  367. </TouchableOpacity>
  368. {/* 侧边按钮 - 刷新 */}
  369. <TouchableOpacity style={[styles.positionBut, styles.positionRefresh]} onPress={() => loadBox(boxNum)}>
  370. <ImageBackground source={{ uri: Images.box.detail.positionBgRight }} style={styles.positionButBg} resizeMode="contain">
  371. <Text style={styles.positionButTextR}>刷新</Text>
  372. </ImageBackground>
  373. </TouchableOpacity>
  374. {/* 锁定倒计时 */}
  375. {box?.lock && (
  376. <View style={styles.lockTimeBox}>
  377. <Text style={styles.lockTimeLabel}>剩余时间:</Text>
  378. <View style={styles.lockTimeBarBox}>
  379. <View style={styles.lockTimeBar}>
  380. <View style={[styles.processBar, { width: `${leftNum}%` }]} />
  381. </View>
  382. <Text style={[styles.lockTimeText, { left: `${leftNum}%` }]}>{leftTime}</Text>
  383. </View>
  384. </View>
  385. )}
  386. {/* 标题 */}
  387. <View style={styles.productTitleBox}>
  388. <Image source={{ uri: Images.box.detail.productTitle }} style={styles.productTitleImg} contentFit="contain" />
  389. </View>
  390. {/* 盒子选择器 */}
  391. <ImageBackground source={{ uri: Images.box.detail.firstBoxBg }} style={styles.boxSelector}>
  392. <TouchableOpacity style={styles.boxArrowBtn} onPress={handlePreBox} disabled={!boxNum || parseInt(boxNum) <= 1}>
  393. <Text style={[styles.boxArrowText, (!boxNum || parseInt(boxNum) <= 1) && styles.disabled]}>上一盒</Text>
  394. </TouchableOpacity>
  395. <View style={styles.boxInfo}>
  396. <Text style={styles.boxNumber}>换盒({boxNum || '-'}/{box?.lastNumber || '-'})</Text>
  397. </View>
  398. <TouchableOpacity style={styles.boxArrowBtn} onPress={handleNextBox} disabled={!box || parseInt(boxNum) >= box.lastNumber}>
  399. <Text style={[styles.boxArrowText, (!box || parseInt(boxNum) >= box.lastNumber) && styles.disabled]}>下一盒</Text>
  400. </TouchableOpacity>
  401. </ImageBackground>
  402. {/* 商品列表 */}
  403. <ProductList products={products} levelList={probability} poolId={poolId!} price={data.price} />
  404. <View style={{ height: 150 }} />
  405. </ScrollView>
  406. {/* 底部购买栏 */}
  407. <ImageBackground source={{ uri: Images.box.detail.boxDetailBott }} style={[styles.bottomBar, { paddingBottom: insets.bottom + 10 }]} resizeMode="cover">
  408. <View style={styles.bottomBtns}>
  409. <TouchableOpacity style={styles.btnItem} onPress={() => handlePay(1)} activeOpacity={0.8}>
  410. <ImageBackground source={{ uri: Images.common.butBgV }} style={styles.btnBg} resizeMode="contain">
  411. <Text style={styles.btnText}>购买一盒</Text>
  412. <Text style={styles.btnPrice}>(¥{data.specialPrice || data.price})</Text>
  413. </ImageBackground>
  414. </TouchableOpacity>
  415. <TouchableOpacity style={styles.btnItem} onPress={() => handlePay(5)} activeOpacity={0.8}>
  416. <ImageBackground source={{ uri: Images.common.butBgL }} style={styles.btnBg} resizeMode="contain">
  417. <Text style={styles.btnText}>购买五盒</Text>
  418. <Text style={styles.btnPrice}>(¥{data.specialPriceFive || data.price * 5})</Text>
  419. </ImageBackground>
  420. </TouchableOpacity>
  421. <TouchableOpacity style={styles.btnItem} onPress={() => checkoutRef.current?.showFreedom()} activeOpacity={0.8}>
  422. <ImageBackground source={{ uri: Images.common.butBgH }} style={styles.btnBg} resizeMode="contain">
  423. <Text style={styles.btnText}>购买多盒</Text>
  424. </ImageBackground>
  425. </TouchableOpacity>
  426. </View>
  427. </ImageBackground>
  428. </ImageBackground>
  429. <CheckoutModal ref={checkoutRef} data={data} poolId={poolId!} boxNumber={boxNum} onSuccess={handleSuccess} />
  430. <RecordModal ref={recordRef} poolId={poolId!} />
  431. <RuleModal ref={ruleRef} />
  432. </View>
  433. );
  434. }
  435. const styles = StyleSheet.create({
  436. container: { flex: 1, backgroundColor: '#1a1a2e' },
  437. background: { flex: 1 },
  438. loadingContainer: { flex: 1, backgroundColor: '#1a1a2e', justifyContent: 'center', alignItems: 'center' },
  439. errorText: { color: '#999', fontSize: 16 },
  440. backBtn2: { marginTop: 20, backgroundColor: '#ff6600', paddingHorizontal: 20, paddingVertical: 10, borderRadius: 8 },
  441. backBtn2Text: { color: '#fff', fontSize: 14 },
  442. header: {
  443. flexDirection: 'row',
  444. alignItems: 'center',
  445. justifyContent: 'space-between',
  446. paddingHorizontal: 10,
  447. paddingBottom: 10,
  448. position: 'absolute',
  449. top: 0,
  450. left: 0,
  451. right: 0,
  452. zIndex: 100,
  453. },
  454. backBtn: { width: 40, height: 40, justifyContent: 'center', alignItems: 'center' },
  455. backText: { color: '#fff', fontSize: 16, fontWeight: 'bold' },
  456. headerTitle: { color: '#fff', fontSize: 15, fontWeight: 'bold', flex: 1, textAlign: 'center', width: 250 },
  457. placeholder: { width: 40 },
  458. scrollView: { flex: 1 },
  459. mainGoodsSection: { width: SCREEN_WIDTH, height: 504, position: 'relative' },
  460. mainSwiper: { position: 'relative', width: '100%', height: 375, alignItems: 'center', justifyContent: 'center', marginTop: -50 },
  461. productImageBox: { width: 200, height: 300, justifyContent: 'center', alignItems: 'center' },
  462. productImage: { width: 200, height: 300 },
  463. detailsBut: { width: 120, height: 45, justifyContent: 'center', alignItems: 'center', marginTop: -30 },
  464. detailsText: { flexDirection: 'row', alignItems: 'center' },
  465. levelText: { fontSize: 14, color: '#FBC400', fontWeight: 'bold' },
  466. probabilityText: { fontSize: 10, color: '#FBC400', marginLeft: 3 },
  467. goodsNameBg: { position: 'absolute', left: 47, top: 53, width: 43, height: 100, paddingTop: 8, justifyContent: 'flex-start', alignItems: 'center' },
  468. goodsNameText: { fontSize: 12, fontWeight: 'bold', color: '#000', width: 20, textAlign: 'center' },
  469. prevBtn: { position: 'absolute', left: 35, top: '40%' },
  470. nextBtn: { position: 'absolute', right: 35, top: '40%' },
  471. arrowImg: { width: 33, height: 38 },
  472. positionBgleftBg: { position: 'absolute', left: 0, top: 225, width: 32, height: 188 },
  473. positionBgRightBg: { position: 'absolute', right: 0, top: 225, width: 32, height: 188 },
  474. mainGoodsSectionBtext: { width: SCREEN_WIDTH, height: 74, marginTop: -10 },
  475. positionBut: { position: 'absolute', zIndex: 10, width: 35, height: 34 },
  476. positionButBg: { width: 35, height: 34, justifyContent: 'center', alignItems: 'center' },
  477. positionButText: { fontSize: 12, fontWeight: 'bold', color: '#fff', transform: [{ rotate: '14deg' }], textShadowColor: '#000', textShadowOffset: { width: 1, height: 1 }, textShadowRadius: 1 },
  478. positionButTextR: { fontSize: 12, fontWeight: 'bold', color: '#fff', transform: [{ rotate: '-16deg' }], textShadowColor: '#000', textShadowOffset: { width: 1, height: 1 }, textShadowRadius: 1 },
  479. positionRule: { top: 256, left: 0 },
  480. positionRecord: { top: 300, left: 0 },
  481. positionLock: { top: 345, left: 0 },
  482. positionStore: { top: 256, right: 0 },
  483. positionRefresh: { top: 300, right: 0 },
  484. lockTimeBox: { flexDirection: 'row', alignItems: 'center', backgroundColor: '#71ccff', padding: 10, marginHorizontal: 10, borderRadius: 8, marginTop: -60 },
  485. lockTimeLabel: { color: '#000', fontSize: 12 },
  486. lockTimeBarBox: { flex: 1, height: 30, position: 'relative', justifyContent: 'center' },
  487. lockTimeBar: { height: 8, backgroundColor: 'rgba(255,255,255,0.6)', borderRadius: 4, overflow: 'hidden' },
  488. processBar: { height: '100%', backgroundColor: '#209ae5', borderRadius: 4 },
  489. lockTimeText: { position: 'absolute', top: -5, fontSize: 10, backgroundColor: '#000', color: '#fff', paddingHorizontal: 4, borderRadius: 2, marginLeft: -13 },
  490. productTitleBox: { alignItems: 'center', marginTop: -20, marginBottom: 10 },
  491. productTitleImg: { width: 121, height: 29 },
  492. boxSelector: { flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', marginHorizontal: 10, height: 50, paddingHorizontal: 15, marginBottom: 10 },
  493. boxArrowBtn: { paddingHorizontal: 10, paddingVertical: 5 },
  494. boxArrowText: { color: '#fff', fontSize: 12 },
  495. disabled: { opacity: 0.3 },
  496. boxInfo: { alignItems: 'center' },
  497. boxNumber: { color: '#fff', fontSize: 14, fontWeight: 'bold' },
  498. bottomBar: { position: 'absolute', bottom: 0, left: 0, right: 0, height: 69, paddingHorizontal: 5 },
  499. bottomBtns: { flexDirection: 'row', height: 64, alignItems: 'center', justifyContent: 'space-around' },
  500. btnItem: { flex: 1, marginHorizontal: 6 },
  501. btnBg: { width: '100%', height: 54, justifyContent: 'center', alignItems: 'center' },
  502. btnText: { fontSize: 14, fontWeight: 'bold', color: '#fff' },
  503. btnPrice: { fontSize: 9, color: '#fff' },
  504. });