From db0fcd29e4ef97c2f3fb4922215dc0e983c614c4 Mon Sep 17 00:00:00 2001 From: laiiihz Date: Thu, 17 Sep 2020 09:15:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=9D=83=E9=99=90=E6=98=BE?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ios/Runner.xcodeproj/project.pbxproj | 20 +++++++++---------- lib/constants/config.dart | 13 ++++++++++-- .../home/classify/order_preview_page.dart | 2 +- lib/pages/home/classify/sku_choose_page.dart | 9 +++------ lib/pages/home/items/goods_item_order.dart | 4 ++-- .../item/item_shopping_cart.dart | 2 +- lib/pages/tabBar/TabbarWidget.dart | 20 ++++--------------- lib/widgets/goods_item.dart | 9 ++++----- pubspec.yaml | 2 +- 9 files changed, 37 insertions(+), 44 deletions(-) diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index e33e882..62974a8 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -173,7 +173,7 @@ CreatedOnToolsVersion = 7.3.1; DevelopmentTeam = HV8WM8C68W; LastSwiftMigration = 1140; - ProvisioningStyle = Manual; + ProvisioningStyle = Automatic; SystemCapabilities = { com.apple.Push = { enabled = 1; @@ -390,8 +390,8 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CODE_SIGN_IDENTITY = "iPhone Distribution"; - CODE_SIGN_STYLE = Manual; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 145; DEVELOPMENT_TEAM = HV8WM8C68W; ENABLE_BITCODE = NO; @@ -409,7 +409,7 @@ MARKETING_VERSION = 1.1.4; PRODUCT_BUNDLE_IDENTIFIER = com.reecook.ios; PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE_SPECIFIER = recook_appstore; + PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = 1; @@ -524,8 +524,8 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CODE_SIGN_IDENTITY = "iPhone Distribution"; - CODE_SIGN_STYLE = Manual; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 145; DEVELOPMENT_TEAM = HV8WM8C68W; ENABLE_BITCODE = NO; @@ -543,7 +543,7 @@ MARKETING_VERSION = 1.1.4; PRODUCT_BUNDLE_IDENTIFIER = com.reecook.ios; PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE_SPECIFIER = recook_appstore; + PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; @@ -559,8 +559,8 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CODE_SIGN_IDENTITY = "iPhone Distribution"; - CODE_SIGN_STYLE = Manual; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 145; DEVELOPMENT_TEAM = HV8WM8C68W; ENABLE_BITCODE = NO; @@ -578,7 +578,7 @@ MARKETING_VERSION = 1.1.4; PRODUCT_BUNDLE_IDENTIFIER = com.reecook.ios; PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE_SPECIFIER = recook_appstore; + PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = 1; diff --git a/lib/constants/config.dart b/lib/constants/config.dart index 6eddd9a..cc55aba 100644 --- a/lib/constants/config.dart +++ b/lib/constants/config.dart @@ -56,7 +56,6 @@ class AppConfig { // showCommission = canShowCommission; // } - ///佣金控制显示 /// ///首先判断showExtraCommission,该值由后台控制显示 @@ -64,14 +63,24 @@ class AppConfig { ///其次未登陆和一般会员用户无法显示该值 static bool getShowCommission() { if (showExtraCommission) { + return true; + } else { if ((!UserManager.instance.haveLogin || UserLevelTool.currentRoleLevelEnum() == UserRoleLevel.Vip || UserLevelTool.currentRoleLevelEnum() == UserRoleLevel.None)) { return false; } - return true; } return showCommission; } + + static bool get commissionByRoleLevel { + if ((!UserManager.instance.haveLogin || + UserLevelTool.currentRoleLevelEnum() == UserRoleLevel.Vip || + UserLevelTool.currentRoleLevelEnum() == UserRoleLevel.None)) { + return false; + } else + return true; + } } diff --git a/lib/pages/home/classify/order_preview_page.dart b/lib/pages/home/classify/order_preview_page.dart index 4a17abd..4c90816 100644 --- a/lib/pages/home/classify/order_preview_page.dart +++ b/lib/pages/home/classify/order_preview_page.dart @@ -657,7 +657,7 @@ class _GoodsOrderPageState extends BaseStoreState { mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.stretch, children: [ - AppConfig.getShowCommission() + AppConfig.commissionByRoleLevel ? Container( alignment: Alignment.center, padding: EdgeInsets.symmetric( diff --git a/lib/pages/home/classify/sku_choose_page.dart b/lib/pages/home/classify/sku_choose_page.dart index deac745..9c1c2b8 100644 --- a/lib/pages/home/classify/sku_choose_page.dart +++ b/lib/pages/home/classify/sku_choose_page.dart @@ -167,15 +167,11 @@ class _SkuChoosePageState extends BaseStoreState { builder: (context) { final skuNotNull = _sku != null && _sku.commission != null; - final haveLogin = UserManager.instance.haveLogin; - final isNotVIP = - UserLevelTool.currentRoleLevelEnum() != - UserRoleLevel.Vip; return RichText( text: TextSpan(children: [ TextSpan( text: - "¥${_sku != null ? _sku.discountPrice.toStringAsFixed(2) : _price}${skuNotNull && haveLogin && isNotVIP ? "/" : ""}", + "¥${_sku != null ? _sku.discountPrice.toStringAsFixed(2) : _price}${skuNotNull && AppConfig.commissionByRoleLevel ? "/" : ""}", // "¥ ${_sku.discountPrice}", style: AppTextStyle.generate( ScreenAdapterUtils.setSp(18), @@ -183,7 +179,8 @@ class _SkuChoosePageState extends BaseStoreState { color: Colors.black), ), TextSpan( - text: skuNotNull && haveLogin && isNotVIP + text: skuNotNull && + AppConfig.commissionByRoleLevel ? " 赚${_sku.commission.toStringAsFixed(2)}" : "", // "¥ ${_sku.discountPrice}", diff --git a/lib/pages/home/items/goods_item_order.dart b/lib/pages/home/items/goods_item_order.dart index 88bd2d4..526c346 100644 --- a/lib/pages/home/items/goods_item_order.dart +++ b/lib/pages/home/items/goods_item_order.dart @@ -124,14 +124,14 @@ class _GoodsOrderItemState extends State { ScreenAdapterUtils.setSp(13), color: Color.fromARGB(255, 249, 62, 13), )), - AppConfig.getShowCommission() + AppConfig.commissionByRoleLevel ? TextSpan( text: " 赚:", style: AppTextStyle.generate( ScreenAdapterUtils.setSp(13), )) : TextSpan(text: ''), - AppConfig.getShowCommission() + AppConfig.commissionByRoleLevel ? TextSpan( text: '$commission', style: AppTextStyle.generate( diff --git a/lib/pages/shopping_cart/item/item_shopping_cart.dart b/lib/pages/shopping_cart/item/item_shopping_cart.dart index cda7f96..2e4b326 100644 --- a/lib/pages/shopping_cart/item/item_shopping_cart.dart +++ b/lib/pages/shopping_cart/item/item_shopping_cart.dart @@ -247,7 +247,7 @@ class _ShoppingCartItemState extends State { ), Row( children: [ - AppConfig.getShowCommission() + AppConfig.commissionByRoleLevel ? Container( decoration: BoxDecoration( border: Border.all( diff --git a/lib/pages/tabBar/TabbarWidget.dart b/lib/pages/tabBar/TabbarWidget.dart index c0a06c9..a11759b 100644 --- a/lib/pages/tabBar/TabbarWidget.dart +++ b/lib/pages/tabBar/TabbarWidget.dart @@ -44,13 +44,7 @@ class _TabBarWidgetState extends State VersionTool.checkVersionInfo(_context); }); _tabController = TabController( - length: (!UserManager.instance.haveLogin || - UserLevelTool.currentRoleLevelEnum() == - UserRoleLevel.Vip) && - !AppConfig.showExtraCommission - ? 4 - : 5, - vsync: this); + length: !AppConfig.getShowCommission() ? 4 : 5, vsync: this); _bottomBarController = BottomBarController(); UserManager.instance.login.addListener(_loginListener); @@ -82,10 +76,7 @@ class _TabBarWidgetState extends State controller: _tabController, children: // AppConfig.getShowCommission() - (!UserManager.instance.haveLogin || - UserLevelTool.currentRoleLevelEnum() == - UserRoleLevel.Vip) && - !AppConfig.showExtraCommission + !AppConfig.getShowCommission() ? [ HomePage(), BusinessPage(), @@ -107,8 +98,7 @@ class _TabBarWidgetState extends State return BottomBar( barController: _bottomBarController, tabChangeListener: (index) { - if ((!UserManager.instance.haveLogin || - UserLevelTool.currentRoleLevelEnum() == UserRoleLevel.Vip)) { + if (!AppConfig.getShowCommission()) { // if(AppConfig.getShowCommission()){ // if (index == 2) { // UserManager.instance.refreshShopPage.value = !UserManager.instance.refreshShopPage.value; @@ -190,9 +180,7 @@ class _BottomBarState extends State { iconUnSelectedColor: unSelectedColor, protrudingColor: selectedColor, // items: AppConfig.getShowCommission() - items: (!UserManager.instance.haveLogin || - UserLevelTool.currentRoleLevelEnum() == UserRoleLevel.Vip) && - !AppConfig.showExtraCommission + items: !AppConfig.getShowCommission() ? [ NavigationItemBean( textStr: '特卖', diff --git a/lib/widgets/goods_item.dart b/lib/widgets/goods_item.dart index 795d34f..684f6ae 100644 --- a/lib/widgets/goods_item.dart +++ b/lib/widgets/goods_item.dart @@ -577,10 +577,8 @@ class GoodsItemWidget extends StatelessWidget { ), ) : SizedBox(), - (UserLevelTool.currentRoleLevelEnum() == UserRoleLevel.None || - UserLevelTool.currentRoleLevelEnum() == UserRoleLevel.Vip) - ? Container() - : Container( + AppConfig.commissionByRoleLevel + ? Container( child: Stack( alignment: Alignment.center, children: [ @@ -616,7 +614,8 @@ class GoodsItemWidget extends StatelessWidget { : SizedBox(), ], ), - ), + ) + : SizedBox(), Spacer(), ], ), diff --git a/pubspec.yaml b/pubspec.yaml index 8f4f812..4287d9e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,7 +2,7 @@ name: recook description: Recook Market App. publish_to: "none" -version: 1.1.14+156 +version: 1.1.16+158 environment: sdk: ">=2.1.0 <3.0.0"