Przeglądaj źródła

参与预售界面UI 修改2

yangjia 1 miesiąc temu
rodzic
commit
f6d9fd2b5b

+ 1 - 1
lib/core/l10n/app_en.arb

@@ -106,7 +106,7 @@
   "financeSubscribeQty": "Subscription Amount",
   "financeAvailableIbit": "Withdrawable iBit",
   "financeCorrespondingPrice": "Price in USDT",
-  "financeIbitUnitPriceLine": "Current price: {price} USDT",
+  "financeIbitUnitPriceLine": "Current IDO presale price: {price} iBit = 1 USDT",
   "@financeIbitUnitPriceLine": {
     "placeholders": {
       "price": {}

+ 6 - 0
lib/core/l10n/app_hi.arb

@@ -150,6 +150,12 @@
   "noData": "कोई डेटा नहीं",
   "noMore": "और नहीं",
   "pullDownToLoadMore": "अधिक के लिए नीचे स्क्रॉल करें",
+  "financeIbitUnitPriceLine": "वर्तमान IDO प्रीसेल मूल्य: {price} iBit = 1 USDT",
+  "@financeIbitUnitPriceLine": {
+    "placeholders": {
+      "price": {}
+    }
+  },
   "allLoaded": "सब लोड हुआ",
   "copied": "कॉपी किया",
   "all": "सभी",

+ 6 - 0
lib/core/l10n/app_id.arb

@@ -150,6 +150,12 @@
   "noData": "Tidak Ada Data",
   "noMore": "Tidak Ada Lagi",
   "pullDownToLoadMore": "Gulir ke bawah untuk lebih banyak",
+  "financeIbitUnitPriceLine": "Harga prajual IDO saat ini: {price} iBit = 1 USDT",
+  "@financeIbitUnitPriceLine": {
+    "placeholders": {
+      "price": {}
+    }
+  },
   "allLoaded": "Semua Dimuat",
   "copied": "Disalin",
   "all": "Semua",

+ 1 - 1
lib/core/l10n/app_ja.arb

@@ -107,7 +107,7 @@
   "financeSubscribeQty": "申込数量",
   "financeAvailableIbit": "出金可能 iBit",
   "financeCorrespondingPrice": "USDT換算価格",
-  "financeIbitUnitPriceLine": "現在価格:{price} USDT",
+  "financeIbitUnitPriceLine": "現在のIDOプレセール価格:{price} iBit = 1 USDT",
   "@financeIbitUnitPriceLine": {
     "placeholders": {
       "price": {}

+ 1 - 1
lib/core/l10n/app_ko.arb

@@ -106,7 +106,7 @@
   "financeSubscribeQty": "청약 수량",
   "financeAvailableIbit": "출금 가능 iBit",
   "financeCorrespondingPrice": "USDT 환산 가격",
-  "financeIbitUnitPriceLine": "현재 가격: {price} USDT",
+  "financeIbitUnitPriceLine": "현재 IDO 프리세일 가격: {price} iBit = 1 USDT",
   "@financeIbitUnitPriceLine": {
     "placeholders": {
       "price": {}

+ 1 - 1
lib/core/l10n/app_localizations.dart

@@ -590,7 +590,7 @@ abstract class AppLocalizations {
   /// No description provided for @financeIbitUnitPriceLine.
   ///
   /// In zh, this message translates to:
-  /// **'当前价格:{price} USDT'**
+  /// **'当前价格IDO预售价格:{price}iBit = 1USDT'**
   String financeIbitUnitPriceLine(Object price);
 
   /// No description provided for @financeConfirmPresale.

+ 1 - 1
lib/core/l10n/app_localizations_en.dart

@@ -261,7 +261,7 @@ class AppLocalizationsEn extends AppLocalizations {
 
   @override
   String financeIbitUnitPriceLine(Object price) {
-    return 'Current price: $price USDT';
+    return 'Current IDO presale price: $price iBit = 1 USDT';
   }
 
   @override

+ 1 - 1
lib/core/l10n/app_localizations_hi.dart

@@ -261,7 +261,7 @@ class AppLocalizationsHi extends AppLocalizations {
 
   @override
   String financeIbitUnitPriceLine(Object price) {
-    return '当前价格:$price USDT';
+    return 'वर्तमान IDO प्रीसेल मूल्य: $price iBit = 1 USDT';
   }
 
   @override

+ 1 - 1
lib/core/l10n/app_localizations_id.dart

@@ -261,7 +261,7 @@ class AppLocalizationsId extends AppLocalizations {
 
   @override
   String financeIbitUnitPriceLine(Object price) {
-    return '当前价格:$price USDT';
+    return 'Harga prajual IDO saat ini: $price iBit = 1 USDT';
   }
 
   @override

+ 1 - 1
lib/core/l10n/app_localizations_ja.dart

@@ -260,7 +260,7 @@ class AppLocalizationsJa extends AppLocalizations {
 
   @override
   String financeIbitUnitPriceLine(Object price) {
-    return '現在価格:$price USDT';
+    return '現在のIDOプレセール価格:$price iBit = 1 USDT';
   }
 
   @override

+ 1 - 1
lib/core/l10n/app_localizations_ko.dart

@@ -260,7 +260,7 @@ class AppLocalizationsKo extends AppLocalizations {
 
   @override
   String financeIbitUnitPriceLine(Object price) {
-    return '현재 가격: $price USDT';
+    return '현재 IDO 프리세일 가격: $price iBit = 1 USDT';
   }
 
   @override

+ 2 - 2
lib/core/l10n/app_localizations_zh.dart

@@ -260,7 +260,7 @@ class AppLocalizationsZh extends AppLocalizations {
 
   @override
   String financeIbitUnitPriceLine(Object price) {
-    return '当前价格:$price USDT';
+    return '当前价格IDO预售价格:${price}iBit = 1USDT';
   }
 
   @override
@@ -3852,7 +3852,7 @@ class AppLocalizationsZhTw extends AppLocalizationsZh {
 
   @override
   String financeIbitUnitPriceLine(Object price) {
-    return '當前價格:$price USDT';
+    return '當前價格IDO預售價格:${price}iBit = 1USDT';
   }
 
   @override

+ 1 - 1
lib/core/l10n/app_zh.arb

@@ -106,7 +106,7 @@
   "financeSubscribeQty": "认购数量",
   "financeAvailableIbit": "可提现可用 iBit",
   "financeCorrespondingPrice": "对应价格",
-  "financeIbitUnitPriceLine": "当前价格:{price} USDT",
+  "financeIbitUnitPriceLine": "当前价格IDO预售价格:{price}iBit = 1USDT",
   "@financeIbitUnitPriceLine": {
     "placeholders": {
       "price": {}

+ 1 - 1
lib/core/l10n/app_zh_TW.arb

@@ -106,7 +106,7 @@
   "financeSubscribeQty": "認購數量",
   "financeAvailableIbit": "可提现可用 iBit",
   "financeCorrespondingPrice": "對應價格",
-  "financeIbitUnitPriceLine": "當前價格:{price} USDT",
+  "financeIbitUnitPriceLine": "當前價格IDO預售價格:{price}iBit = 1USDT",
   "@financeIbitUnitPriceLine": {
     "placeholders": {
       "price": {}

+ 152 - 137
lib/presentation/screens/finance/staking_screen.dart

@@ -113,158 +113,170 @@ class _StakingScreenState extends ConsumerState<StakingScreen> {
     final pageBody = ListView(
       padding: const EdgeInsets.only(bottom: 32),
       children: [
-          _HeroSection(
-            l10n: l10n,
-            rulesText: rulesText,
-            loadingRules: state.isLoadingConfig,
-          ),
-          IdoOverviewCards(
-            teamNum: state.teamNum,
-            lockedTotal: state.lockedTotal,
-            loading: state.isLoadingOverview,
-          ),
-          Padding(
-            padding: const EdgeInsets.fromLTRB(16, 0, 16, 0),
-            child: Column(
-              crossAxisAlignment: CrossAxisAlignment.start,
-              children: [
-                Text(
-                  l10n.financeJoinPresale,
-                  style: TextStyle(
-                    color: _financePrimaryText(context),
-                    fontSize: 22,
-                    fontWeight: FontWeight.w600,
-                  ),
-                ),
-                const SizedBox(height: 24),
-                _LabelRow(
-                  label: l10n.financeSubscribeQty,
-                  actionLabel: l10n.goSpotTrade,
-                  onAction:
-                      config == null ? null : () => _goToSpotTrade(config),
-                ),
-                const SizedBox(height: 12),
-                _LabelRow(label: l10n.financeCorrespondingPrice),
-                const SizedBox(height: 12),
-                _AvailableMetaRow(
-                  l10n: l10n,
-                  amount: _fmtAmount(state.fundingAvailable),
-                  unit: displayUnit,
-                  loading: state.isRefreshingBalance,
-                  onFillAll: state.isRefreshingBalance
-                      ? null
-                      : () => _fillAllAmount(state.fundingAvailable),
-                ),
-                const SizedBox(height: 12),
-                _UnitPriceMetaRow(
-                  l10n: l10n,
-                  unitPrice: unitPrice,
-                ),
-                const SizedBox(height: 12),
-                _FieldInput(
-                  controller: _amountController,
-                  suffix: displayUnit,
-                  onChanged: (_) => setState(() {}),
+        _HeroSection(
+          l10n: l10n,
+          rulesText: rulesText,
+          loadingRules: state.isLoadingConfig,
+        ),
+        IdoOverviewCards(
+          teamNum: state.teamNum,
+          lockedTotal: state.lockedTotal,
+          loading: state.isLoadingOverview,
+        ),
+        Padding(
+          padding: const EdgeInsets.fromLTRB(16, 0, 16, 0),
+          child: Column(
+            crossAxisAlignment: CrossAxisAlignment.start,
+            children: [
+              Text(
+                l10n.financeJoinPresale,
+                style: TextStyle(
+                  color: _financePrimaryText(context),
+                  fontSize: 22,
+                  fontWeight: FontWeight.w600,
                 ),
-                const SizedBox(height: 12),
-                Row(
-                  children: [
-                    Expanded(
-                      child: _FieldInput(
-                        readOnly: true,
-                        value: _priceUsdtText(unitPrice),
-                        suffix: 'USDT',
-                      ),
+              ),
+              const SizedBox(height: 24),
+              _LabelRow(
+                label: l10n.financeSubscribeQty,
+                actionLabel: l10n.goSpotTrade,
+                onAction: config == null ? null : () => _goToSpotTrade(config),
+              ),
+              const SizedBox(height: 12),
+              _LabelRow(label: l10n.financeCorrespondingPrice),
+              const SizedBox(height: 12),
+              _AvailableMetaRow(
+                l10n: l10n,
+                amount: _fmtAmount(state.fundingAvailable),
+                unit: displayUnit,
+                loading: state.isRefreshingBalance,
+                onFillAll: state.isRefreshingBalance
+                    ? null
+                    : () => _fillAllAmount(state.fundingAvailable),
+              ),
+              const SizedBox(height: 12),
+              _FieldInput(
+                controller: _amountController,
+                suffix: displayUnit,
+                onChanged: (_) => setState(() {}),
+              ),
+              const SizedBox(height: 12),
+              Row(
+                children: [
+                  Expanded(
+                    child: _FieldInput(
+                      readOnly: true,
+                      value: _priceUsdtText(unitPrice),
+                      suffix: 'USDT',
                     ),
-                    const SizedBox(width: 12),
+                  ),
+                  const SizedBox(width: 12),
+                  if (false)
                     _TransferButton(
                       label: l10n.stakingTransfer,
                       onPressed: () => _openSpotFundTransfer(isLoggedIn),
                     ),
-                  ],
-                ),
-                const SizedBox(height: 32),
-                Center(
-                  child: ConstrainedBox(
-                    constraints: const BoxConstraints(maxWidth: 360),
-                    child: SizedBox(
-                      width: double.infinity,
-                      height: 48,
-                      child: ElevatedButton(
-                        onPressed: state.isSubmitting ||
-                                config == null ||
-                                state.isLoadingConfig
-                            ? null
-                            : () => _submitStake(isLoggedIn),
-                        style: ElevatedButton.styleFrom(
-                          backgroundColor: AppColors.brand,
-                          foregroundColor: Colors.black,
-                          disabledBackgroundColor:
-                              AppColors.brand.withAlpha(128),
-                          shape: const StadiumBorder(),
-                          elevation: 0,
-                        ),
-                        child: state.isSubmitting
-                            ? const SizedBox(
-                                width: 18,
-                                height: 18,
-                                child: CircularProgressIndicator(
-                                  strokeWidth: 2,
-                                ),
-                              )
-                            : Text(
-                                l10n.financeConfirmPresale,
-                                style: const TextStyle(
-                                  fontSize: 16,
-                                  fontWeight: FontWeight.w600,
-                                ),
-                              ),
+                ],
+              ),
+              const SizedBox(height: 20),
+              Row(
+                mainAxisAlignment: MainAxisAlignment.center,
+                crossAxisAlignment: CrossAxisAlignment.center,
+                children: [
+                  _UnitPriceMetaRow(
+                    l10n: l10n,
+                    unitPrice: unitPrice,
+                  ),
+                ],
+              ),
+              const SizedBox(height: 20),
+              // const SizedBox(height: 32),
+              Center(
+                child: ConstrainedBox(
+                  constraints: const BoxConstraints(maxWidth: 360),
+                  child: SizedBox(
+                    width: double.infinity,
+                    height: 48,
+                    child: ElevatedButton(
+                      onPressed: state.isSubmitting ||
+                              config == null ||
+                              state.isLoadingConfig
+                          ? null
+                          : () => _submitStake(isLoggedIn),
+                      style: ElevatedButton.styleFrom(
+                        backgroundColor: AppColors.brand,
+                        foregroundColor: Colors.black,
+                        disabledBackgroundColor: AppColors.brand.withAlpha(128),
+                        shape: const StadiumBorder(),
+                        elevation: 0,
                       ),
+                      child: state.isSubmitting
+                          ? const SizedBox(
+                              width: 18,
+                              height: 18,
+                              child: CircularProgressIndicator(
+                                strokeWidth: 2,
+                              ),
+                            )
+                          : Text(
+                              l10n.financeConfirmPresale,
+                              style: const TextStyle(
+                                fontSize: 16,
+                                fontWeight: FontWeight.w600,
+                              ),
+                            ),
                     ),
                   ),
                 ),
-                const SizedBox(height: 20),
-                Text(
-                  state.isLoadingConfig
-                      ? l10n.financeEstimatedUnlockLine('—')
-                      : l10n.financeEstimatedUnlockLine(unlockText),
-                  textAlign: TextAlign.center,
-                  style: TextStyle(
-                    color: _financeSecondaryText(context),
-                    fontSize: 13,
+              ),
+              const SizedBox(height: 20),
+              Row(
+                crossAxisAlignment:CrossAxisAlignment.center,
+                mainAxisAlignment:MainAxisAlignment.center,
+                children: [
+                  Text(
+                    state.isLoadingConfig
+                        ? l10n.financeEstimatedUnlockLine('—')
+                        : l10n.financeEstimatedUnlockLine(unlockText),
+                    textAlign: TextAlign.center,
+                    style: TextStyle(
+                      color: _financeSecondaryText(context),
+                      fontSize: 13,
+                    ),
                   ),
-                ),
-                if (!isLoggedIn) ...[
-                  const SizedBox(height: 12),
-                  Wrap(
-                    alignment: WrapAlignment.center,
-                    crossAxisAlignment: WrapCrossAlignment.center,
-                    children: [
-                      Text(
-                        l10n.financeLoginToStake,
-                        style: TextStyle(
-                          color: _financeSecondaryText(context),
-                          fontSize: 12,
-                        ),
+                ],
+              ),
+              if (!isLoggedIn) ...[
+                const SizedBox(height: 12),
+                Wrap(
+                  alignment: WrapAlignment.center,
+                  crossAxisAlignment: WrapCrossAlignment.center,
+                  children: [
+                    Text(
+                      l10n.financeLoginToStake,
+                      style: TextStyle(
+                        color: _financeSecondaryText(context),
+                        fontSize: 12,
                       ),
-                      GestureDetector(
-                        onTap: () => context.push(
-                          '/login?redirect=${Uri.encodeComponent('/finance/ido')}',
-                        ),
-                        child: Text(
-                          l10n.login,
-                          style: const TextStyle(
-                            color: AppColors.brand,
-                            fontSize: 12,
-                          ),
+                    ),
+                    GestureDetector(
+                      onTap: () => context.push(
+                        '/login?redirect=${Uri.encodeComponent('/finance/ido')}',
+                      ),
+                      child: Text(
+                        l10n.login,
+                        style: const TextStyle(
+                          color: AppColors.brand,
+                          fontSize: 12,
                         ),
                       ),
-                    ],
-                  ),
-                ],
+                    ),
+                  ],
+                ),
               ],
-            ),
+            ],
           ),
+        ),
       ],
     );
 
@@ -364,6 +376,7 @@ class _StakingScreenState extends ConsumerState<StakingScreen> {
     String pad(int n) {
       return n.toString().padLeft(2, '0');
     }
+
     return '${date.year}/${pad(date.month)}/${pad(date.day)} '
         '${pad(date.hour)}:${pad(date.minute)}:${pad(date.second)}';
   }
@@ -658,7 +671,9 @@ class _UnitPriceMetaRow extends StatelessWidget {
         NumberFormat('#,##0.0000', 'en_US').format(unitPrice.toDouble()),
       ),
       style: TextStyle(
-        color: _financeSecondaryText(context),
+        color: _financeIsDark(context)
+            ? const Color(0xFFF0B90B)
+            : _financeSecondaryText(context),
         fontSize: 13,
       ),
     );

+ 4 - 2
lib/presentation/widgets/finance/ido_overview_cards.dart

@@ -32,7 +32,8 @@ class IdoOverviewCards extends ConsumerWidget {
     if (parsed == 0) {
       return '0';
     }
-    return NumberFormat('#,##0.${'#' * maxFrac}', 'en_US').format(parsed);
+    final pattern = maxFrac > 0 ? '#,##0.${'#' * maxFrac}' : '#,##0';
+    return NumberFormat(pattern, 'en_US').format(parsed);
   }
 
   void _goToStakingAccount(BuildContext context, WidgetRef ref) {
@@ -46,7 +47,8 @@ class IdoOverviewCards extends ConsumerWidget {
   Widget build(BuildContext context, WidgetRef ref) {
     final l10n = AppLocalizations.of(context)!;
     final isDark = Theme.of(context).brightness == Brightness.dark;
-    final primary = isDark ? Colors.white : Theme.of(context).colorScheme.onSurface;
+    final primary =
+        isDark ? Colors.white : Theme.of(context).colorScheme.onSurface;
     final labelColor = primary.withAlpha(140);
     final cardBg = primary.withAlpha(10);
     final cardBorder = primary.withAlpha(26);