From 4904337e972160c42ab73fea582737e56a5536ad Mon Sep 17 00:00:00 2001 From: hailin Date: Wed, 4 Mar 2026 05:57:24 -0800 Subject: [PATCH] =?UTF-8?q?revert(app):=20=E5=9B=9E=E6=BB=9A=20C2C=20?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E7=9A=84=E5=8D=96=E5=87=BA=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit C2C 卖出的是积分值,不是积分股,不受预种卖出限制约束。 Co-Authored-By: Claude Sonnet 4.6 --- .../pages/c2c/c2c_publish_page.dart | 51 +++++-------------- 1 file changed, 13 insertions(+), 38 deletions(-) diff --git a/frontend/mining-app/lib/presentation/pages/c2c/c2c_publish_page.dart b/frontend/mining-app/lib/presentation/pages/c2c/c2c_publish_page.dart index 2a64afce..deeff72d 100644 --- a/frontend/mining-app/lib/presentation/pages/c2c/c2c_publish_page.dart +++ b/frontend/mining-app/lib/presentation/pages/c2c/c2c_publish_page.dart @@ -711,10 +711,9 @@ class _C2cPublishPageState extends ConsumerState { final isSell = _selectedType == 1; final capabilities = ref.watch(capabilitiesProvider).valueOrNull ?? CapabilityMap.defaultAll(); final c2cEnabled = capabilities.c2cEnabled; - final isSellRestricted = isSell && (ref.watch(sellRestrictionProvider).valueOrNull ?? false); // #11: 价格固定为1,数量最小为1 - bool isValid = c2cEnabled && !isSellRestricted && quantity >= 1; + bool isValid = c2cEnabled && quantity >= 1; if (isSell) { // 如果选择了其他支付方式,还需要填写收款账号和姓名 if (_selectedPaymentMethods.any((m) => m != 'GREEN_POINTS')) { @@ -726,39 +725,17 @@ class _C2cPublishPageState extends ConsumerState { return Padding( padding: const EdgeInsets.symmetric(horizontal: 16), - child: Column( - children: [ - if (isSellRestricted) - Container( - width: double.infinity, - padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8), - margin: const EdgeInsets.only(bottom: 8), - decoration: BoxDecoration( - color: _red.withOpacity(0.08), - borderRadius: BorderRadius.circular(8), - border: Border.all(color: _red.withOpacity(0.3)), - ), - child: const Text( - '预种积分股暂时不可卖出,请先完成预种合并(满5份合成1棵树后即可卖出)', - style: TextStyle(fontSize: 12, color: _red), - textAlign: TextAlign.center, - ), - ), - SizedBox( - width: double.infinity, - height: 50, - child: ElevatedButton( - onPressed: isValid && !c2cState.isLoading - ? _handlePublish - : isSellRestricted - ? () => ScaffoldMessenger.of(context).showSnackBar( - const SnackBar(content: Text('预种积分股暂时不可卖出,请先完成预种合并'), backgroundColor: _red), - ) - : !c2cEnabled - ? () => ScaffoldMessenger.of(context).showSnackBar( - const SnackBar(content: Text('您的C2C交易功能已被限制'), backgroundColor: _red), - ) - : null, + child: SizedBox( + width: double.infinity, + height: 50, + child: ElevatedButton( + onPressed: isValid && !c2cState.isLoading + ? _handlePublish + : !c2cEnabled + ? () => ScaffoldMessenger.of(context).showSnackBar( + const SnackBar(content: Text('您的C2C交易功能已被限制'), backgroundColor: _red), + ) + : null, style: ElevatedButton.styleFrom( backgroundColor: _selectedType == 0 ? _green : _red, foregroundColor: Colors.white, @@ -784,9 +761,7 @@ class _C2cPublishPageState extends ConsumerState { fontWeight: FontWeight.bold, ), ), - ), - ), - ], + ), ), ); }