Ver código fonte

fix(payment-page): 移除总额度和已用额度显示

- 移除额度支付说明中的总额度和已用额度显示
- 只保留基本说明"使用信用额度支付,无需立即付款"
- 更新相关测试文件

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
yourname 3 dias atrás
pai
commit
d6b2f8f29e

+ 1 - 3
mini/src/pages/payment/index.tsx

@@ -475,9 +475,7 @@ const PaymentPage = () => {
         {selectedPaymentMethod === PaymentMethod.CREDIT && creditBalance && (
           <View className="mt-4 p-3 bg-blue-50 rounded-lg" data-testid="credit-payment-details">
             <Text className="text-xs text-blue-700">
-              • 使用信用额度支付,无需立即付款{'\n'}
-              • 总额度: ¥{creditBalance.totalLimit.toFixed(2)}{'\n'}
-              • 已用额度: ¥{creditBalance.usedAmount.toFixed(2)}
+              • 使用信用额度支付,无需立即付款
             </Text>
           </View>
         )}

+ 6 - 6
mini/tests/unit/pages/payment/credit-payment.test.tsx

@@ -262,7 +262,7 @@ describe('支付页面额度支付功能测试', () => {
     expect(screen.getByTestId('pay-button')).toHaveTextContent('额度支付 ¥100.00')
   })
 
-  test('选择额度支付时应该显示额度详情(不显示可用额度)', async () => {
+  test('选择额度支付时应该显示额度说明(不显示额度详情)', async () => {
     // Mock 额度查询返回正常数据
     const mockCreditBalance = createTestCreditBalance()
     ;(creditBalanceClient.me.$get as jest.Mock).mockResolvedValue({
@@ -285,17 +285,17 @@ describe('支付页面额度支付功能测试', () => {
     const creditOption = screen.getByTestId('credit-payment-option')
     fireEvent.click(creditOption)
 
-    // 验证显示额度详情(不包含可用额度
+    // 验证显示额度说明(不包含额度详情
     await waitFor(() => {
       // 使用data-testid查询额度详情容器
       const creditDetails = screen.getByTestId('credit-payment-details')
       expect(creditDetails).toBeInTheDocument()
 
-      // 验证容器中包含额度信息(不包含可用额度
+      // 验证容器中包含基本说明(不包含额度详情
       expect(creditDetails).toHaveTextContent(/使用信用额度支付,无需立即付款/)
-      expect(creditDetails).toHaveTextContent(/总额度: ¥1000\.00/)
-      expect(creditDetails).toHaveTextContent(/已用额度: ¥200\.00/)
-      // 不应该包含可用额度
+      // 不应该包含额度详情
+      expect(creditDetails).not.toHaveTextContent(/总额度:/)
+      expect(creditDetails).not.toHaveTextContent(/已用额度:/)
       expect(creditDetails).not.toHaveTextContent(/可用额度:/)
     })
   })