ExplainSection.tsx 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. import React, { useEffect, useState } from 'react';
  2. import { StyleSheet, Text, View } from 'react-native';
  3. import { getMessages } from '@/services/base';
  4. interface ExplainSectionProps {
  5. poolId: string;
  6. rules?: string;
  7. }
  8. export const ExplainSection: React.FC<ExplainSectionProps> = ({ rules }) => {
  9. const [shippingRule, setShippingRule] = useState('全国所有地区每单运费15元,满五件享快递包邮服务。默认5个工作日内发货;若遇缺货需补货,预计需要10个工作日。');
  10. useEffect(() => {
  11. loadShippingRule();
  12. }, []);
  13. const loadShippingRule = async () => {
  14. try {
  15. const res = await getMessages(0, 10);
  16. if (res && res.length > 0 && res[0].content) {
  17. setShippingRule(res[0].content);
  18. }
  19. } catch (error) {
  20. console.error('获取发货规则失败:', error);
  21. }
  22. };
  23. return (
  24. <View style={styles.container}>
  25. {/* 关于签收货 */}
  26. <View style={styles.section}>
  27. <Text style={styles.title}>1关于签收货:</Text>
  28. <View style={styles.content}>
  29. <Text style={styles.text}>
  30. 1.在签收快件时,请本人亲自在不拆封商品包装的情况下,在快递前当面验货,确认无误后再签收
  31. </Text>
  32. <Text style={styles.text}>2.商品的退款请参考商品售后条款</Text>
  33. </View>
  34. </View>
  35. {/* 关于发货 */}
  36. <View style={styles.section}>
  37. <Text style={styles.title}>关于发货:</Text>
  38. <View style={styles.content}>
  39. <Text style={styles.text}>1.{shippingRule}</Text>
  40. <Text style={styles.text}>
  41. 2.商品的可配送区域为中国大陆地区(除特殊偏远地区)
  42. </Text>
  43. <Text style={styles.text}>
  44. 3.平台统一采用高规格包装和配送,最大程度保护商品在配送过程中的安全
  45. </Text>
  46. <Text style={styles.text}>
  47. 4.为确保包裹配送成功,平台会根据发货地和收件地匹配合适的物流公司,合作物流可能为顺丰、京东、EMS、申通、中通、邮政等
  48. </Text>
  49. </View>
  50. </View>
  51. {/* 售后 */}
  52. <View style={styles.section}>
  53. <Text style={styles.title}>售后:</Text>
  54. <View style={styles.content}>
  55. <Text style={styles.text}>
  56. 1."一番赏""无限赏"作为盲盒类商品,根据《消费者权益保护法》第25条之规定,因产品售出后,无法按照售卖规则二次销售不适用7天无理由退换的规定,请谨慎、理性购买。
  57. </Text>
  58. <Text style={styles.text}>
  59. 2.收到的商品如遇质量问题,可联系客服,凭有效的售后凭证,我司提供包含补偿、换货、退款在内的方式进行售后处理。若商品存在损坏、少件或遗失,在提供有效凭证,证明签收时即存在上述问题。若您发现有任何断件或缺件问题,请勿再打开内包装,并第一时间联系客服。
  60. </Text>
  61. <Text style={styles.text}>
  62. 3.对于需要退换货的商品,若因产品质量问题退换货,来回运费均由平台承担
  63. </Text>
  64. </View>
  65. </View>
  66. {/* 关于配送 */}
  67. {rules ? (
  68. <View style={styles.section}>
  69. <Text style={styles.title}>关于配送:</Text>
  70. <View style={styles.content}>
  71. <Text style={styles.text}>{rules}</Text>
  72. </View>
  73. </View>
  74. ) : null}
  75. </View>
  76. );
  77. };
  78. const styles = StyleSheet.create({
  79. container: {
  80. paddingHorizontal: 14,
  81. paddingBottom: 50,
  82. },
  83. section: {
  84. marginTop: 15,
  85. },
  86. title: {
  87. fontSize: 14,
  88. color: '#fff',
  89. fontWeight: 'bold',
  90. },
  91. content: {
  92. marginTop: 10,
  93. },
  94. text: {
  95. fontSize: 12,
  96. color: '#999',
  97. lineHeight: 20,
  98. marginBottom: 5,
  99. },
  100. });