From 55c7f75b0cc056d3ab96daf829e14299dac351cf Mon Sep 17 00:00:00 2001 From: laiiihz Date: Thu, 25 Mar 2021 11:55:04 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E5=BC=B9=E7=AA=97=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/main.dart | 4 +++- lib/pages/home/home_page.dart | 22 +++++++++++++++++-- .../upgradeCard/upgrade_card_unused_view.dart | 8 ++++++- .../upgradeCard/upgrade_card_used_view.dart | 2 +- lib/pages/user/invite/my_group_page_v2.dart | 8 +------ pubspec.yaml | 2 +- 6 files changed, 33 insertions(+), 13 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 0393e64..64341b7 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -14,6 +14,7 @@ import 'package:hive/hive.dart'; import 'package:hive_flutter/hive_flutter.dart'; import 'package:oktoast/oktoast.dart'; +import 'package:package_info/package_info.dart'; import 'package:package_signature/package_signature.dart'; import 'package:raw_toast/raw_toast.dart'; import 'package:recook/constants/api.dart'; @@ -43,7 +44,8 @@ List cameras; void main() async { WidgetsFlutterBinding.ensureInitialized(); cameras = await availableCameras(); - + PackageInfo _packageInfo = await PackageInfo.fromPlatform(); + AppConfig.versionNumber = _packageInfo.buildNumber; //初始化AMap AmapLocation.instance.init(iosKey: 'e8a8057cfedcdcadcf4e8f2c7f8de982'); diff --git a/lib/pages/home/home_page.dart b/lib/pages/home/home_page.dart index 3cce580..c45d286 100644 --- a/lib/pages/home/home_page.dart +++ b/lib/pages/home/home_page.dart @@ -1550,6 +1550,7 @@ class _HomePageState extends BaseStoreState for (var item in noticeList) { final int gold = item['gold']; final int silver = item['silver']; + final int id = item['id']; String goldValue = ''; String silverValue = ''; if (gold != null && gold != 0) goldValue = '$gold张黄金卡'; @@ -1563,13 +1564,30 @@ class _HomePageState extends BaseStoreState await Get.dialog(Center( child: GestureDetector( onTap: () async { - await HttpManager.post(APIV2.userAPI.confirmUserCardChange, {}); + await HttpManager.post( + APIV2.userAPI.confirmUserCardChange, + {"noticeId": id}, + ); await Get.to(UpgradeCardPageV2()); Get.back(); }, child: Container( margin: EdgeInsets.symmetric(horizontal: 50.w), - child: Center(child: Text('您有$result已退至您的卡包')), + child: Center( + child: Material( + color: Colors.transparent, + child: Transform.translate( + offset: Offset(0, 20.w), + child: Text( + '您有$result已退至您的卡包', + style: TextStyle( + fontSize: 14.sp, + color: Colors.white, + fontWeight: FontWeight.bold, + ), + ), + ), + )), decoration: BoxDecoration( image: DecorationImage( image: AssetImage(R.ASSETS_USER_NOTICE_CARD_PNG), diff --git a/lib/pages/upgradeCard/upgrade_card_unused_view.dart b/lib/pages/upgradeCard/upgrade_card_unused_view.dart index 91abb58..51809e7 100644 --- a/lib/pages/upgradeCard/upgrade_card_unused_view.dart +++ b/lib/pages/upgradeCard/upgrade_card_unused_view.dart @@ -130,6 +130,12 @@ class _UserCard extends StatelessWidget { return ''; } + String get _cardFace { + if (model.type == 1) return R.ASSETS_USER_UPGRADE_GOLD_CARD_WEBP; + if (model.type == 2) return R.ASSETS_USER_UPGRADE_SILVER_CARD_WEBP; + return ''; + } + @override Widget build(BuildContext context) { return Container( @@ -242,7 +248,7 @@ class _UserCard extends StatelessWidget { ), decoration: BoxDecoration( image: DecorationImage( - image: AssetImage(R.ASSETS_USER_UPGRADE_SILVER_CARD_WEBP), + image: AssetImage(_cardFace), ), ), ); diff --git a/lib/pages/upgradeCard/upgrade_card_used_view.dart b/lib/pages/upgradeCard/upgrade_card_used_view.dart index 6440f85..9e939b5 100644 --- a/lib/pages/upgradeCard/upgrade_card_used_view.dart +++ b/lib/pages/upgradeCard/upgrade_card_used_view.dart @@ -99,7 +99,7 @@ class _userCard extends StatelessWidget { String typeValue = ''; if (type == 1) typeValue = '黄金卡'; if (type == 2) typeValue = '白银卡'; - bool used = status == 1; + bool used = status != 2; return Material( color: Colors.white, borderRadius: BorderRadius.circular(5.w), diff --git a/lib/pages/user/invite/my_group_page_v2.dart b/lib/pages/user/invite/my_group_page_v2.dart index aa62265..8ff95b0 100644 --- a/lib/pages/user/invite/my_group_page_v2.dart +++ b/lib/pages/user/invite/my_group_page_v2.dart @@ -204,13 +204,7 @@ class _MyGroupPageV2State extends State { 20.wb, ], ), - ..._models.map((e) => GroupInviteCard(model: e)).toList().sepWidget( - separate: Divider( - indent: 65.w, - endIndent: 15.w, - height: 1.w, - thickness: 1.w, - )), + ..._models.map((e) => GroupInviteCard(model: e)).toList(), ], ), margin: EdgeInsets.symmetric(horizontal: 16.w), diff --git a/pubspec.yaml b/pubspec.yaml index aebbf6d..89d6c5d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,7 +2,7 @@ name: recook description: Recook Market App. publish_to: "none" -version: 1.6.0-vip+270 +version: 1.6.1-vip+271 environment: sdk: ">=2.10.0 <3.0.0"