From da0f79718492e2e8daeadb383791d42af981406d Mon Sep 17 00:00:00 2001 From: w-R <953969641@qq.com> Date: Fri, 30 Jul 2021 20:44:03 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/home/huixiang_brand_page.dart | 11 +++- lib/mine/vip_detail_page.dart | 96 ++++++++++++++++--------------- 2 files changed, 58 insertions(+), 49 deletions(-) diff --git a/lib/home/huixiang_brand_page.dart b/lib/home/huixiang_brand_page.dart index f729718a..c3c55f00 100644 --- a/lib/home/huixiang_brand_page.dart +++ b/lib/home/huixiang_brand_page.dart @@ -22,6 +22,7 @@ import 'package:huixiang/view_widget/round_button.dart'; import 'package:huixiang/view_widget/store_title_tab.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:shared_preferences/shared_preferences.dart'; +import 'package:sharesdk_plugin/sharesdk_interface.dart'; class BrandPage extends StatefulWidget { @override @@ -76,9 +77,11 @@ class _BrandPage extends State apiService = ApiService(Dio(), context: context, token: value.getString('token')), queryHome(), - if(value.getBool("isFristLogin")){ + if(value.getBool("isFristLogin") == null){ + value.setBool("isFristLogin",true), showAlertDialog(), - }}); + } + }); eventBus.on().listen((event) { print("object: BrandPage"); @@ -607,7 +610,9 @@ class _BrandPage extends State textColor: Colors.white, fontSize: 12, callback: () { - Navigator.of(context).pop(); + SharesdkPlugin.uploadPrivacyPermissionStatus(1, (success) => { + Navigator.of(context).pop(), + }); }, padding: EdgeInsets.only( top: 10.h, diff --git a/lib/mine/vip_detail_page.dart b/lib/mine/vip_detail_page.dart index 7eff8e74..26844ae7 100644 --- a/lib/mine/vip_detail_page.dart +++ b/lib/mine/vip_detail_page.dart @@ -163,10 +163,10 @@ class _VipDetailPage extends State { itemBuilder: (context, position) { return GestureDetector( onTap: () {}, - child: shopItem(), + child: shopItem(orderInfos[position]), ); }, - // itemCount: orderInfos != null ? orderInfos.length : 0, + itemCount: orderInfos != null ? orderInfos.length : 0, ), ), ), @@ -284,7 +284,7 @@ class _VipDetailPage extends State { children: [ TextSpan( text: - "¥${vipCard != null ? vipCard.balance : ""}", + "¥${vipCard != null ? vipCard.balance : ""}", style: TextStyle( fontSize: 24.sp, fontWeight: FontWeight.w500, @@ -369,10 +369,10 @@ class _VipDetailPage extends State { child: Text( vipCard != null ? "${vipCard.id.substring(0, 4)} " - "${vipCard.id.substring(4, 8)} " - "${vipCard.id.substring(8, 12)} " - "${vipCard.id.substring(12, 16)} " - "${vipCard.id.substring(16, vipCard.id.length)}" + "${vipCard.id.substring(4, 8)} " + "${vipCard.id.substring(8, 12)} " + "${vipCard.id.substring(12, 16)} " + "${vipCard.id.substring(16, vipCard.id.length)}" : "", maxLines: 1, textAlign: TextAlign.center, @@ -382,11 +382,11 @@ class _VipDetailPage extends State { wordSpacing: vipCard == null ? 10 : (MediaQuery.of(context).size.width - 64.w) / - (((vipCard.id.length) * 4)), + (((vipCard.id.length) * 4)), letterSpacing: vipCard == null ? 8 : (MediaQuery.of(context).size.width - 64.w) / - (((vipCard.id.length) * 4)), + (((vipCard.id.length) * 4)), ), ), ), @@ -407,7 +407,7 @@ class _VipDetailPage extends State { ); } - Widget shopItem() { + Widget shopItem(OrderInfo orderInfo) { return Container( margin: EdgeInsets.all(16.w), child: Column( @@ -420,7 +420,7 @@ class _VipDetailPage extends State { Expanded( flex: 1, child: Text( - "百年川椒重庆老火锅(汉街店)", + (orderInfo != null) ? orderInfo.storeName : "", style: TextStyle( fontSize: 14.sp, fontWeight: FontWeight.bold, @@ -429,7 +429,7 @@ class _VipDetailPage extends State { )), GestureDetector( onTap: (){ - Navigator.of(context).pushNamed('/router/union_detail_page'); + Navigator.of(context).pushNamed('/router/union_detail_page',arguments: {"id": orderInfo.storeId}); }, child:Text( "查看", @@ -462,6 +462,7 @@ class _VipDetailPage extends State { ), Text( "楚河汉街第一街区万达总部国际C座对面", + overflow: TextOverflow.ellipsis, style: TextStyle( fontSize: 12.sp, fontWeight: FontWeight.w400, @@ -487,7 +488,10 @@ class _VipDetailPage extends State { Expanded( flex: 1, child: Text( - "10:00-22:00", + (orderInfo.storeVO.openStartTime == null && + orderInfo.storeVO.openEndTime == null) + ? S.of(context).quantian + : "${orderInfo.storeVO.openStartTime.substring(0, orderInfo.storeVO.openStartTime.lastIndexOf(":"))}-${orderInfo.storeVO.openEndTime.substring(0, orderInfo.storeVO.openEndTime.lastIndexOf(":"))}", style: TextStyle( fontSize: 12.sp, fontWeight: FontWeight.w400, @@ -530,40 +534,40 @@ class _VipDetailPage extends State { return products .map( (e) => Container( - margin: EdgeInsets.symmetric(horizontal: 2.w), - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceAround, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - MImage( - e.skuImg, - width: 75.w, - height: 75.h, - fit: BoxFit.contain, - errorSrc: "assets/image/default_1.png", - fadeSrc: "assets/image/default_1.png", - ), - SizedBox( - height: 4.h, - ), - if (isRemake) - Container( - width: 75.w, - child: Text( - e.productName, - maxLines: 1, - textAlign: TextAlign.center, - overflow: TextOverflow.ellipsis, - style: TextStyle( - fontSize: 10.sp, - color: Color(0xFF353535), - ), - ), - ), - ], + margin: EdgeInsets.symmetric(horizontal: 2.w), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + MImage( + e.skuImg, + width: 75.w, + height: 75.h, + fit: BoxFit.contain, + errorSrc: "assets/image/default_1.png", + fadeSrc: "assets/image/default_1.png", ), - ), - ) + SizedBox( + height: 4.h, + ), + if (isRemake) + Container( + width: 75.w, + child: Text( + e.productName, + maxLines: 1, + textAlign: TextAlign.center, + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 10.sp, + color: Color(0xFF353535), + ), + ), + ), + ], + ), + ), + ) .toList(); } } From b85edb43b46849999217b5276f2eb7fe379d2bea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=93=88=E5=93=88=E5=93=88?= Date: Sun, 1 Aug 2021 09:45:33 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ios/Runner.xcodeproj/project.pbxproj | 12 +- lib/generated/intl/messages_en.dart | 4 + lib/generated/intl/messages_zh_CN.dart | 4 + lib/generated/intl/messages_zh_Hans_CN.dart | 4 + lib/generated/intl/messages_zh_Hant_CN.dart | 4 + lib/generated/intl/messages_zh_TW.dart | 4 + lib/generated/l10n.dart | 40 +++++ lib/home/home_page.dart | 41 ----- lib/home/huixiang_brand_page.dart | 184 ++------------------ lib/l10n/intl_en.arb | 4 + lib/l10n/intl_zh_CN.arb | 4 + lib/l10n/intl_zh_Hans_CN.arb | 4 + lib/l10n/intl_zh_Hant_CN.arb | 4 + lib/l10n/intl_zh_TW.arb | 4 + lib/login/login_page.dart | 176 +++++++++++++++++-- pubspec.lock | 4 +- 16 files changed, 266 insertions(+), 231 deletions(-) diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index cfc6988f..80541706 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -846,7 +846,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 23; + CURRENT_PROJECT_VERSION = 24; DEVELOPMENT_TEAM = YF3Q8DVP52; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -880,7 +880,7 @@ "$(PROJECT_DIR)/UniMPSDK/Libs", "$(PROJECT_DIR)/wx/Libs", ); - MARKETING_VERSION = 1.0.23; + MARKETING_VERSION = 1.0.24; ONLY_ACTIVE_ARCH = NO; OTHER_LDFLAGS = ( "$(inherited)", @@ -1045,7 +1045,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 23; + CURRENT_PROJECT_VERSION = 24; DEVELOPMENT_TEAM = YF3Q8DVP52; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -1079,7 +1079,7 @@ "$(PROJECT_DIR)/UniMPSDK/Libs", "$(PROJECT_DIR)/wx/Libs", ); - MARKETING_VERSION = 1.0.23; + MARKETING_VERSION = 1.0.24; ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = ( "$(inherited)", @@ -1137,7 +1137,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 23; + CURRENT_PROJECT_VERSION = 24; DEVELOPMENT_TEAM = YF3Q8DVP52; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -1171,7 +1171,7 @@ "$(PROJECT_DIR)/UniMPSDK/Libs", "$(PROJECT_DIR)/wx/Libs", ); - MARKETING_VERSION = 1.0.23; + MARKETING_VERSION = 1.0.24; ONLY_ACTIVE_ARCH = NO; OTHER_LDFLAGS = ( "$(inherited)", diff --git a/lib/generated/intl/messages_en.dart b/lib/generated/intl/messages_en.dart index 6e60f92b..5c355c3f 100644 --- a/lib/generated/intl/messages_en.dart +++ b/lib/generated/intl/messages_en.dart @@ -217,6 +217,7 @@ class MessageLookup extends MessageLookupByLibrary { "jituanchuangshiren" : MessageLookupByLibrary.simpleMessage("集团创始人"), "jixuduihuan" : MessageLookupByLibrary.simpleMessage("继续兑换"), "jixuzhifu" : MessageLookupByLibrary.simpleMessage("继续支付"), + "jujue" : MessageLookupByLibrary.simpleMessage("拒绝"), "kabao" : MessageLookupByLibrary.simpleMessage("卡包"), "kaiqiquanxian" : MessageLookupByLibrary.simpleMessage("开启权限"), "kaitongriqi" : m11, @@ -369,6 +370,7 @@ class MessageLookup extends MessageLookupByLibrary { "tijiao" : MessageLookupByLibrary.simpleMessage("提交"), "tingchewei" : MessageLookupByLibrary.simpleMessage("停车位"), "tixian" : MessageLookupByLibrary.simpleMessage("提现"), + "tongyibingjixu" : MessageLookupByLibrary.simpleMessage("同意并继续"), "tongzhi" : MessageLookupByLibrary.simpleMessage("通知"), "tongzhitishixinxi" : MessageLookupByLibrary.simpleMessage("为了您可以及时收到我们的活动信息,推荐您在使用HISAPP时打开通知的接收"), "touxiang" : MessageLookupByLibrary.simpleMessage("头像"), @@ -426,6 +428,8 @@ class MessageLookup extends MessageLookupByLibrary { "yinshi" : MessageLookupByLibrary.simpleMessage("饮食"), "yinsishengming" : MessageLookupByLibrary.simpleMessage("隐私声明"), "yinsixieyi" : MessageLookupByLibrary.simpleMessage("《隐私协议》"), + "yinsizhengce1" : MessageLookupByLibrary.simpleMessage(" 感谢您使用一心回乡APP。我们非常重视您的个人信息和隐私保护。为了更好地保证您的个人权益,在您使用我们的产品前,请务必仔细阅读一心回乡"), + "yinsizhengce2" : MessageLookupByLibrary.simpleMessage("     在您同意后,我们才会根据您的使用需求,收集部分可能涉及的数据(地理位置、相机、存储等信息)。"), "yiqiandao" : MessageLookupByLibrary.simpleMessage("已签到"), "yiquxiao" : MessageLookupByLibrary.simpleMessage(" 已取消 "), "yishijiao" : MessageLookupByLibrary.simpleMessage("已失效"), diff --git a/lib/generated/intl/messages_zh_CN.dart b/lib/generated/intl/messages_zh_CN.dart index 8adaa59b..9d557796 100644 --- a/lib/generated/intl/messages_zh_CN.dart +++ b/lib/generated/intl/messages_zh_CN.dart @@ -216,6 +216,7 @@ class MessageLookup extends MessageLookupByLibrary { "jituanchuangshiren" : MessageLookupByLibrary.simpleMessage("集团创始人"), "jixuduihuan" : MessageLookupByLibrary.simpleMessage("继续兑换"), "jixuzhifu" : MessageLookupByLibrary.simpleMessage("继续支付"), + "jujue" : MessageLookupByLibrary.simpleMessage("拒绝"), "kabao" : MessageLookupByLibrary.simpleMessage("卡包"), "kaiqiquanxian" : MessageLookupByLibrary.simpleMessage("开启权限"), "kaitongriqi" : m11, @@ -368,6 +369,7 @@ class MessageLookup extends MessageLookupByLibrary { "tijiao" : MessageLookupByLibrary.simpleMessage("提交"), "tingchewei" : MessageLookupByLibrary.simpleMessage("停车位"), "tixian" : MessageLookupByLibrary.simpleMessage("提现"), + "tongyibingjixu" : MessageLookupByLibrary.simpleMessage("同意并继续"), "tongzhi" : MessageLookupByLibrary.simpleMessage("通知"), "tongzhitishixinxi" : MessageLookupByLibrary.simpleMessage("为了您可以及时收到我们的活动信息,推荐您在使用HISAPP时打开通知的接收"), "touxiang" : MessageLookupByLibrary.simpleMessage("头像"), @@ -425,6 +427,8 @@ class MessageLookup extends MessageLookupByLibrary { "yinshi" : MessageLookupByLibrary.simpleMessage("饮食"), "yinsishengming" : MessageLookupByLibrary.simpleMessage("隐私声明"), "yinsixieyi" : MessageLookupByLibrary.simpleMessage("《隐私协议》"), + "yinsizhengce1" : MessageLookupByLibrary.simpleMessage(" 感谢您使用一心回乡APP。我们非常重视您的个人信息和隐私保护。为了更好地保证您的个人权益,在您使用我们的产品前,请务必仔细阅读一心回乡"), + "yinsizhengce2" : MessageLookupByLibrary.simpleMessage("     在您同意后,我们才会根据您的使用需求,收集部分可能涉及的数据(地理位置、相机、存储等信息)。"), "yiqiandao" : MessageLookupByLibrary.simpleMessage("已签到"), "yiquxiao" : MessageLookupByLibrary.simpleMessage(" 已取消 "), "yishijiao" : MessageLookupByLibrary.simpleMessage("已失效"), diff --git a/lib/generated/intl/messages_zh_Hans_CN.dart b/lib/generated/intl/messages_zh_Hans_CN.dart index b29c5314..49105d1b 100644 --- a/lib/generated/intl/messages_zh_Hans_CN.dart +++ b/lib/generated/intl/messages_zh_Hans_CN.dart @@ -216,6 +216,7 @@ class MessageLookup extends MessageLookupByLibrary { "jituanchuangshiren" : MessageLookupByLibrary.simpleMessage("集团创始人"), "jixuduihuan" : MessageLookupByLibrary.simpleMessage("继续兑换"), "jixuzhifu" : MessageLookupByLibrary.simpleMessage("继续支付"), + "jujue" : MessageLookupByLibrary.simpleMessage("拒绝"), "kabao" : MessageLookupByLibrary.simpleMessage("卡包"), "kaiqiquanxian" : MessageLookupByLibrary.simpleMessage("开启权限"), "kaitongriqi" : m11, @@ -368,6 +369,7 @@ class MessageLookup extends MessageLookupByLibrary { "tijiao" : MessageLookupByLibrary.simpleMessage("提交"), "tingchewei" : MessageLookupByLibrary.simpleMessage("停车位"), "tixian" : MessageLookupByLibrary.simpleMessage("提现"), + "tongyibingjixu" : MessageLookupByLibrary.simpleMessage("同意并继续"), "tongzhi" : MessageLookupByLibrary.simpleMessage("通知"), "tongzhitishixinxi" : MessageLookupByLibrary.simpleMessage("为了您可以及时收到我们的活动信息,推荐您在使用HISAPP时打开通知的接收"), "touxiang" : MessageLookupByLibrary.simpleMessage("头像"), @@ -425,6 +427,8 @@ class MessageLookup extends MessageLookupByLibrary { "yinshi" : MessageLookupByLibrary.simpleMessage("饮食"), "yinsishengming" : MessageLookupByLibrary.simpleMessage("隐私声明"), "yinsixieyi" : MessageLookupByLibrary.simpleMessage("《隐私协议》"), + "yinsizhengce1" : MessageLookupByLibrary.simpleMessage(" 感谢您使用一心回乡APP。我们非常重视您的个人信息和隐私保护。为了更好地保证您的个人权益,在您使用我们的产品前,请务必仔细阅读一心回乡"), + "yinsizhengce2" : MessageLookupByLibrary.simpleMessage("     在您同意后,我们才会根据您的使用需求,收集部分可能涉及的数据(地理位置、相机、存储等信息)。"), "yiqiandao" : MessageLookupByLibrary.simpleMessage("已签到"), "yiquxiao" : MessageLookupByLibrary.simpleMessage(" 已取消 "), "yishijiao" : MessageLookupByLibrary.simpleMessage("已失效"), diff --git a/lib/generated/intl/messages_zh_Hant_CN.dart b/lib/generated/intl/messages_zh_Hant_CN.dart index 1c87745d..1cae0f95 100644 --- a/lib/generated/intl/messages_zh_Hant_CN.dart +++ b/lib/generated/intl/messages_zh_Hant_CN.dart @@ -216,6 +216,7 @@ class MessageLookup extends MessageLookupByLibrary { "jituanchuangshiren" : MessageLookupByLibrary.simpleMessage("集團創始人"), "jixuduihuan" : MessageLookupByLibrary.simpleMessage("继续兑换"), "jixuzhifu" : MessageLookupByLibrary.simpleMessage("繼續支付"), + "jujue" : MessageLookupByLibrary.simpleMessage("拒絕"), "kabao" : MessageLookupByLibrary.simpleMessage("卡包"), "kaiqiquanxian" : MessageLookupByLibrary.simpleMessage("開啓權限"), "kaitongriqi" : m11, @@ -368,6 +369,7 @@ class MessageLookup extends MessageLookupByLibrary { "tijiao" : MessageLookupByLibrary.simpleMessage("提交"), "tingchewei" : MessageLookupByLibrary.simpleMessage("停車位"), "tixian" : MessageLookupByLibrary.simpleMessage("提現"), + "tongyibingjixu" : MessageLookupByLibrary.simpleMessage("同意並繼續"), "tongzhi" : MessageLookupByLibrary.simpleMessage("通知"), "tongzhitishixinxi" : MessageLookupByLibrary.simpleMessage("為了您可以及時收到我們的活動資訊,推薦您在使用HISAPP時打開通知的接收 "), "touxiang" : MessageLookupByLibrary.simpleMessage("頭像"), @@ -425,6 +427,8 @@ class MessageLookup extends MessageLookupByLibrary { "yinshi" : MessageLookupByLibrary.simpleMessage("飲食"), "yinsishengming" : MessageLookupByLibrary.simpleMessage("隱私聲明"), "yinsixieyi" : MessageLookupByLibrary.simpleMessage("《隱私協議》"), + "yinsizhengce1" : MessageLookupByLibrary.simpleMessage(" 感謝您使用一心回鄉APP。我們非常的重視您的個人信息和隱私保護。為了更好地保證您的個人權益,在您使用我們的產品前,請務必仔細閱讀一心回鄉"), + "yinsizhengce2" : MessageLookupByLibrary.simpleMessage("     在您同意後,我們才會根據您的使用需求,收集部分可能涉及(地理位置、相機、存儲等信息)的數據。"), "yiqiandao" : MessageLookupByLibrary.simpleMessage("已簽到"), "yiquxiao" : MessageLookupByLibrary.simpleMessage(" 已取消 "), "yishijiao" : MessageLookupByLibrary.simpleMessage("已失效"), diff --git a/lib/generated/intl/messages_zh_TW.dart b/lib/generated/intl/messages_zh_TW.dart index ea3a40bd..3c1c1fba 100644 --- a/lib/generated/intl/messages_zh_TW.dart +++ b/lib/generated/intl/messages_zh_TW.dart @@ -216,6 +216,7 @@ class MessageLookup extends MessageLookupByLibrary { "jituanchuangshiren" : MessageLookupByLibrary.simpleMessage("集團創始人"), "jixuduihuan" : MessageLookupByLibrary.simpleMessage("继续兑换"), "jixuzhifu" : MessageLookupByLibrary.simpleMessage("繼續支付"), + "jujue" : MessageLookupByLibrary.simpleMessage("拒絕"), "kabao" : MessageLookupByLibrary.simpleMessage("卡包"), "kaiqiquanxian" : MessageLookupByLibrary.simpleMessage("開啓權限"), "kaitongriqi" : m11, @@ -368,6 +369,7 @@ class MessageLookup extends MessageLookupByLibrary { "tijiao" : MessageLookupByLibrary.simpleMessage("提交"), "tingchewei" : MessageLookupByLibrary.simpleMessage("停車位"), "tixian" : MessageLookupByLibrary.simpleMessage("提現"), + "tongyibingjixu" : MessageLookupByLibrary.simpleMessage("同意並繼續"), "tongzhi" : MessageLookupByLibrary.simpleMessage("通知"), "tongzhitishixinxi" : MessageLookupByLibrary.simpleMessage("為了您可以及時收到我們的活動資訊,推薦您在使用HISAPP時打開通知的接收 "), "touxiang" : MessageLookupByLibrary.simpleMessage("頭像"), @@ -425,6 +427,8 @@ class MessageLookup extends MessageLookupByLibrary { "yinshi" : MessageLookupByLibrary.simpleMessage("飲食"), "yinsishengming" : MessageLookupByLibrary.simpleMessage("隱私聲明"), "yinsixieyi" : MessageLookupByLibrary.simpleMessage("《隱私協議》"), + "yinsizhengce1" : MessageLookupByLibrary.simpleMessage(" 感謝您使用一心回鄉APP。我們非常的重視您的個人信息和隱私保護。為了更好地保證您的個人權益,在您使用我們的產品前,請務必仔細閱讀一心回鄉"), + "yinsizhengce2" : MessageLookupByLibrary.simpleMessage("     在您同意後,我們才會根據您的使用需求,收集部分可能涉及(地理位置、相機、存儲等信息)的數據。"), "yiqiandao" : MessageLookupByLibrary.simpleMessage("已簽到"), "yiquxiao" : MessageLookupByLibrary.simpleMessage(" 已取消 "), "yishijiao" : MessageLookupByLibrary.simpleMessage("已失效"), diff --git a/lib/generated/l10n.dart b/lib/generated/l10n.dart index 0c5b25c6..4c09e8d0 100644 --- a/lib/generated/l10n.dart +++ b/lib/generated/l10n.dart @@ -3985,6 +3985,46 @@ class S { ); } + /// `同意并继续` + String get tongyibingjixu { + return Intl.message( + '同意并继续', + name: 'tongyibingjixu', + desc: '', + args: [], + ); + } + + /// `拒绝` + String get jujue { + return Intl.message( + '拒绝', + name: 'jujue', + desc: '', + args: [], + ); + } + + /// ` 感谢您使用一心回乡APP。我们非常重视您的个人信息和隐私保护。为了更好地保证您的个人权益,在您使用我们的产品前,请务必仔细阅读一心回乡` + String get yinsizhengce1 { + return Intl.message( + ' 感谢您使用一心回乡APP。我们非常重视您的个人信息和隐私保护。为了更好地保证您的个人权益,在您使用我们的产品前,请务必仔细阅读一心回乡', + name: 'yinsizhengce1', + desc: '', + args: [], + ); + } + + /// `     在您同意后,我们才会根据您的使用需求,收集部分可能涉及的数据(地理位置、相机、存储等信息)。` + String get yinsizhengce2 { + return Intl.message( + '     在您同意后,我们才会根据您的使用需求,收集部分可能涉及的数据(地理位置、相机、存储等信息)。', + name: 'yinsizhengce2', + desc: '', + args: [], + ); + } + /// `并使用本机号码登录` String get privacy_policy4 { return Intl.message( diff --git a/lib/home/home_page.dart b/lib/home/home_page.dart index 77763637..394b0e60 100644 --- a/lib/home/home_page.dart +++ b/lib/home/home_page.dart @@ -603,8 +603,6 @@ class _HomePage extends State with AutomaticKeepAliveClientMixin { ); } - // SwiperController swiperController = SwiperController(); - brands() { return Container( height: 90.h, @@ -642,45 +640,6 @@ class _HomePage extends State with AutomaticKeepAliveClientMixin { itemCount: (brandData != null && brandData.length > 0) ? brandData.length : 0, ), - // child: AspectRatio( - // aspectRatio: 4.16, - // child: Swiper( - // scrollDirection: Axis.horizontal, - // controller: swiperController, - // loop: false, - // viewportFraction: 0.32, - // scale: 0.70, - // index: (brandData != null && brandData.length > 0) ? 1 : 0, - // itemBuilder: (context, position) { - // if (brandData == null || brandData.length == 0) { - // return Container(); - // } - // return Container( - // margin: EdgeInsets.symmetric(horizontal: 3.w, vertical: 15.h), - // decoration: BoxDecoration( - // color: Colors.white, - // boxShadow: [ - // BoxShadow( - // color: Colors.black.withAlpha(37), - // offset: Offset(0, 2), - // blurRadius: 5, - // spreadRadius: 0, - // ) - // ], - // borderRadius: BorderRadius.circular(8), - // ), - // child: MImage( - // brandData != null ? brandData[position].image : "", - // radius: BorderRadius.circular(8), - // fit: BoxFit.cover, - // errorSrc: "assets/image/default_2_1.png", - // fadeSrc: "assets/image/default_2_1.png", - // ), - // ); - // }, - // itemCount: (brandData != null && brandData.length > 0) ? brandData.length : 1, - // ), - // ), ); } diff --git a/lib/home/huixiang_brand_page.dart b/lib/home/huixiang_brand_page.dart index c3c55f00..a607bfc0 100644 --- a/lib/home/huixiang_brand_page.dart +++ b/lib/home/huixiang_brand_page.dart @@ -74,20 +74,16 @@ class _BrandPage extends State super.initState(); SharedPreferences.getInstance().then((value) => { - apiService = ApiService(Dio(), - context: context, token: value.getString('token')), - queryHome(), - if(value.getBool("isFristLogin") == null){ - value.setBool("isFristLogin",true), - showAlertDialog(), - } - }); + apiService = ApiService(Dio(), + context: context, token: value.getString('token')), + queryHome(), + }); eventBus.on().listen((event) { - print("object: BrandPage"); - if (event.type < 3) { - setState(() {}); - } + print("object: BrandPage"); + if (event.type < 3) { + setState(() {}); + } }); } @@ -98,10 +94,7 @@ class _BrandPage extends State super.build(context); return Scaffold( appBar: AppBar( - toolbarHeight: 40.h - MediaQuery - .of(context) - .padding - .top, + toolbarHeight: 40.h - MediaQuery.of(context).padding.top, backgroundColor: Colors.white, elevation: 0, ), @@ -238,7 +231,7 @@ class _BrandPage extends State TextSpan(children: [ TextSpan( text: - brandData == null ? "" : brandData.originator, + brandData == null ? "" : brandData.originator, style: TextStyle( fontWeight: FontWeight.bold, fontSize: 14.sp, @@ -246,9 +239,7 @@ class _BrandPage extends State ), ), TextSpan( - text: " ${S - .of(context) - .jituanchuangbanren}", + text: " ${S.of(context).jituanchuangbanren}", style: TextStyle( fontSize: 10.sp, color: Colors.black, @@ -281,9 +272,7 @@ class _BrandPage extends State mainAxisSize: MainAxisSize.max, children: [ Text( - S - .of(context) - .gengduo, + S.of(context).gengduo, style: TextStyle( fontSize: 12.sp, color: Colors.black, @@ -343,9 +332,7 @@ class _BrandPage extends State height: 40.h, ), Text( - S - .of(context) - .linian, + S.of(context).linian, style: TextStyle( fontSize: 16.sp, fontWeight: FontWeight.bold, @@ -491,151 +478,6 @@ class _BrandPage extends State ); } - showAlertDialog() { - //显示对话框 - showDialog( - context: context, - builder: (BuildContext context) { - return SimpleDialog( - titlePadding: EdgeInsets.all(10), - backgroundColor: Colors.transparent, - elevation: 0, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.all(Radius.circular(6))), - children: [ - Stack( - alignment: Alignment.bottomCenter, - children: [ - Container( - alignment: Alignment.center, - width: double.infinity, - height: 305.h, - // margin: EdgeInsets.only(left: 40.w, right: 40.w), - padding: EdgeInsets.only(left: 16.w, right: 16.w), - decoration: new BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all(Radius.circular(8))), - child: Column( - children: [ - Padding( - padding: EdgeInsets.only(top: 24.h, bottom: 10.h), - child: Text( - S - .of(context) - .xieyitanchuang, - style: TextStyle( - color: Color(0xff4D4D4D), - fontSize: 18.sp, - fontWeight: FontWeight.bold), - ), - ), - Text.rich( - TextSpan(children: [ - TextSpan( - text: - "     感谢您使用一心回乡APP。我们非常重视您的个人信息和隐私保护。为了更好地保证您的个人权益,在您使用我们的产品前,请务必仔细阅读一心回乡", - style: TextStyle( - fontWeight: FontWeight.w500, - fontSize: 14.sp, - height: 1.3.h, - color: Color(0xff727272)), - ), - TextSpan( - text: S - .of(context) - .yinsixieyi, - style: TextStyle( - fontWeight: FontWeight.w500, - fontSize: 14.sp, - color: Color(0xff32A060)), - recognizer: TapGestureRecognizer() - ..onTap = () { - debugPrint( - "${Navigator.of(context).popAndPushNamed( - '/router/treaty_page')}"); - }, - ), - ]), - ), - SizedBox( - height: 10.h, - ), - Text( - "     在您同意后,我们才会根据您的使用需求,收集部分可能涉及的数据(地理位置、相机、存储等信息)。", - style: TextStyle( - color: Color(0xff727272), - fontSize: 14.sp, - height: 1.3.h, - fontWeight: FontWeight.w500, - ), - ), - SizedBox( - height: 16.h, - ), - ], - ), - ), - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - GestureDetector( - onTap: () { - Navigator.of(context).pop(); - }, - child: Container( - height: 40.h, - alignment: Alignment.bottomCenter, - margin: EdgeInsets.only(bottom: 20.h), - child: BorderText( - padding: EdgeInsets.only( - top: 10.h, bottom: 10.h, left: 36.w, right: 36.w), - text: "拒绝", - fontSize: 12.sp, - textColor: Color(0xFF32A060), - borderColor: Color(0xFF32A060), - borderWidth: 1.w, - radius: 23, - ), - ), - ), - SizedBox( - width: 21.w, - ), - Container( - height: 40.h, - margin: EdgeInsets.only(bottom: 20.h), - alignment: Alignment.bottomCenter, - child: RoundButton( - text: "同意并继续", - textColor: Colors.white, - fontSize: 12, - callback: () { - SharesdkPlugin.uploadPrivacyPermissionStatus(1, (success) => { - Navigator.of(context).pop(), - }); - }, - padding: EdgeInsets.only( - top: 10.h, - bottom: 10.h, - left: 21.5.w, - right: 21.5.w), - backgroup: Color(0xff32A060), - radius: 23, - ), - ), - SizedBox( - height: 20.h, - ), - ], - ), - ], - ) - ], - ); - }, - ); - } - /// contentType 跳转类型(0:不跳转,1:积分商品,2:活动,3:文章) bannerClick(BannerData bannerData) async { switch (bannerData.contentType) { diff --git a/lib/l10n/intl_en.arb b/lib/l10n/intl_en.arb index 7481f5e2..a1238528 100644 --- a/lib/l10n/intl_en.arb +++ b/lib/l10n/intl_en.arb @@ -413,6 +413,10 @@ "xieyitanchuang": "一心回乡用户隐私政策", "yinsixieyi": "《隐私协议》", "shiyongmendian": "适用门店", + "tongyibingjixu": "同意并继续", + "jujue": "拒绝", + "yinsizhengce1": " 感谢您使用一心回乡APP。我们非常重视您的个人信息和隐私保护。为了更好地保证您的个人权益,在您使用我们的产品前,请务必仔细阅读一心回乡", + "yinsizhengce2": "     在您同意后,我们才会根据您的使用需求,收集部分可能涉及的数据(地理位置、相机、存储等信息)。", diff --git a/lib/l10n/intl_zh_CN.arb b/lib/l10n/intl_zh_CN.arb index 22f3382e..b8016fbd 100644 --- a/lib/l10n/intl_zh_CN.arb +++ b/lib/l10n/intl_zh_CN.arb @@ -414,6 +414,10 @@ "xieyitanchuang": "一心回乡用户隐私政策", "yinsixieyi": "《隐私协议》", "shiyongmendian": "适用门店", + "tongyibingjixu": "同意并继续", + "jujue": "拒绝", + "yinsizhengce1": " 感谢您使用一心回乡APP。我们非常重视您的个人信息和隐私保护。为了更好地保证您的个人权益,在您使用我们的产品前,请务必仔细阅读一心回乡", + "yinsizhengce2": "     在您同意后,我们才会根据您的使用需求,收集部分可能涉及的数据(地理位置、相机、存储等信息)。", diff --git a/lib/l10n/intl_zh_Hans_CN.arb b/lib/l10n/intl_zh_Hans_CN.arb index f8cde686..78e164da 100644 --- a/lib/l10n/intl_zh_Hans_CN.arb +++ b/lib/l10n/intl_zh_Hans_CN.arb @@ -414,6 +414,10 @@ "xieyitanchuang": "一心回乡用户隐私政策", "yinsixieyi": "《隐私协议》", "shiyongmendian": "适用门店", + "tongyibingjixu": "同意并继续", + "jujue": "拒绝", + "yinsizhengce1": " 感谢您使用一心回乡APP。我们非常重视您的个人信息和隐私保护。为了更好地保证您的个人权益,在您使用我们的产品前,请务必仔细阅读一心回乡", + "yinsizhengce2": "     在您同意后,我们才会根据您的使用需求,收集部分可能涉及的数据(地理位置、相机、存储等信息)。", diff --git a/lib/l10n/intl_zh_Hant_CN.arb b/lib/l10n/intl_zh_Hant_CN.arb index 7df5e87b..66bc9ad1 100644 --- a/lib/l10n/intl_zh_Hant_CN.arb +++ b/lib/l10n/intl_zh_Hant_CN.arb @@ -408,6 +408,10 @@ "xieyitanchuang": "一心回鄉用戶隱私協議", "yinsixieyi": "《隱私協議》", "shiyongmendian": "適用門店", + "tongyibingjixu": "同意並繼續", + "jujue": "拒絕", + "yinsizhengce1": " 感謝您使用一心回鄉APP。我們非常的重視您的個人信息和隱私保護。為了更好地保證您的個人權益,在您使用我們的產品前,請務必仔細閱讀一心回鄉", + "yinsizhengce2": "     在您同意後,我們才會根據您的使用需求,收集部分可能涉及(地理位置、相機、存儲等信息)的數據。", diff --git a/lib/l10n/intl_zh_TW.arb b/lib/l10n/intl_zh_TW.arb index cfee8dbd..42e5471a 100644 --- a/lib/l10n/intl_zh_TW.arb +++ b/lib/l10n/intl_zh_TW.arb @@ -406,6 +406,10 @@ "xieyitanchuang": "一心回鄉用戶隱私協議", "yinsixieyi": "《隱私協議》", "shiyongmendian": "適用門店", + "tongyibingjixu": "同意並繼續", + "jujue": "拒絕", + "yinsizhengce1": " 感謝您使用一心回鄉APP。我們非常的重視您的個人信息和隱私保護。為了更好地保證您的個人權益,在您使用我們的產品前,請務必仔細閱讀一心回鄉", + "yinsizhengce2": "     在您同意後,我們才會根據您的使用需求,收集部分可能涉及(地理位置、相機、存儲等信息)的數據。", diff --git a/lib/login/login_page.dart b/lib/login/login_page.dart index f8325ad1..ba47b58d 100644 --- a/lib/login/login_page.dart +++ b/lib/login/login_page.dart @@ -16,8 +16,10 @@ import 'package:flutter/services.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:dio/dio.dart'; +import 'package:huixiang/view_widget/round_button.dart'; import 'package:photo_view/photo_view.dart'; import 'package:shared_preferences/shared_preferences.dart'; +import 'package:sharesdk_plugin/sharesdk_interface.dart'; import 'package:tpns_flutter_plugin/tpns_flutter_plugin.dart'; class LoginPage extends StatefulWidget { @@ -55,9 +57,14 @@ class _MyLoginPageState extends State with TickerProviderStateMixin { isLogin() async { SharedPreferences sharedPreferences = await SharedPreferences.getInstance(); - if (sharedPreferences.containsKey('token') - && sharedPreferences.getString("token") != null - && sharedPreferences.getString("token") != "") { + + if (sharedPreferences.getBool("isShowPrivacyPolicy") == null || !sharedPreferences.getBool("isShowPrivacyPolicy")) { + showAlertDialog(); + } + + if (sharedPreferences.containsKey('token') && + sharedPreferences.getString("token") != null && + sharedPreferences.getString("token") != "") { Navigator.of(context).popAndPushNamed('/router/main_page'); } else { client = ApiService(Dio()); @@ -89,7 +96,6 @@ class _MyLoginPageState extends State with TickerProviderStateMixin { RenderBox renderBox = loginKey.currentContext.findRenderObject(); offsetBtn = scrollController.offset; - print("offsetBtn: $offsetBtn"); var screenHeight = MediaQuery.of(context).size.height; var scrollHeight = screenHeight * 1.47; var height = scrollHeight - renderBox.size.height; @@ -98,7 +104,6 @@ class _MyLoginPageState extends State with TickerProviderStateMixin { (scrollController.offset / (height - chaHeight) * (255)).toInt(); changeAlpha = (changeAlpha > 255 ? 255 : changeAlpha); changeAlpha = (changeAlpha < 0 ? 0 : changeAlpha); - print("changeAlpha: $changeAlpha"); alpha = (initAlpha + scrollController.offset / (height - chaHeight) * @@ -106,7 +111,6 @@ class _MyLoginPageState extends State with TickerProviderStateMixin { .toInt(); alpha = (alpha > 255 ? 255 : alpha); alpha = (alpha < 0 ? 0 : alpha); - print("alpha: $alpha"); }); _controllerPhone.addListener(() { @@ -155,6 +159,11 @@ class _MyLoginPageState extends State with TickerProviderStateMixin { Color statusCodeLineColor = Color(0xFF32A060); _sendCode() async { + SharedPreferences sharedPreferences = await SharedPreferences.getInstance(); + if (!sharedPreferences.containsKey("isShowPrivacyPolicy") || !sharedPreferences.getBool("isShowPrivacyPolicy")) { + showAlertDialog(); + return; + } if (!checkStatus) { SmartDialog.showToast(S.of(context).gouxuanxieyi); return; @@ -216,14 +225,15 @@ class _MyLoginPageState extends State with TickerProviderStateMixin { } _login() async { - // Navigator.of(context).popAndPushNamed('/router/main_page'); - // return; - print("222222"); if (alpha != 255) { scrollToTop(); return; } - + SharedPreferences sharedPreferences = await SharedPreferences.getInstance(); + if (!sharedPreferences.containsKey("isShowPrivacyPolicy") || !sharedPreferences.getBool("isShowPrivacyPolicy")) { + showAlertDialog(); + return; + } if (!checkStatus) { SmartDialog.showToast(S.of(context).gouxuanxieyi); return; @@ -270,7 +280,8 @@ class _MyLoginPageState extends State with TickerProviderStateMixin { eventBus.fire(EventType(3)); xgFlutterPlugin.setAccount(mobile, AccountType.CUSTOM); - xgFlutterPlugin.bindWithIdentifier(identify: mobile, bindType: XGBindType.account); + xgFlutterPlugin.bindWithIdentifier( + identify: mobile, bindType: XGBindType.account); if (widget.arguments != null) { Navigator.of(context).pop(); @@ -890,6 +901,149 @@ class _MyLoginPageState extends State with TickerProviderStateMixin { duration: Duration(milliseconds: 500), curve: Curves.ease); } + showAlertDialog() { + //显示对话框 + showDialog( + context: context, + builder: (BuildContext context) { + return SimpleDialog( + titlePadding: EdgeInsets.all(10), + backgroundColor: Colors.transparent, + elevation: 0, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.all(Radius.circular(6))), + children: [ + Stack( + alignment: Alignment.bottomCenter, + children: [ + Container( + alignment: Alignment.center, + width: double.infinity, + height: 305.h, + // margin: EdgeInsets.only(left: 40.w, right: 40.w), + padding: EdgeInsets.only(left: 16.w, right: 16.w), + decoration: new BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all(Radius.circular(8))), + child: Column( + children: [ + Padding( + padding: EdgeInsets.only(top: 24.h, bottom: 10.h), + child: Text( + S.of(context).xieyitanchuang, + style: TextStyle( + color: Color(0xff4D4D4D), + fontSize: 18.sp, + fontWeight: FontWeight.bold,), + ), + ), + Text.rich( + TextSpan(children: [ + TextSpan( + text: S.of(context).yinsizhengce1, + style: TextStyle( + fontWeight: FontWeight.w500, + fontSize: 14.sp, + height: 1.3.h, + color: Color(0xff727272)), + ), + TextSpan( + text: S.of(context).yinsixieyi, + style: TextStyle( + fontWeight: FontWeight.w500, + fontSize: 14.sp, + color: Color(0xff32A060)), + recognizer: TapGestureRecognizer() + ..onTap = () { + Navigator.of(context).popAndPushNamed('/router/treaty_page'); + }, + ), + ]), + ), + SizedBox( + height: 10.h, + ), + Text( + S.of(context).yinsizhengce2, + style: TextStyle( + color: Color(0xff727272), + fontSize: 14.sp, + height: 1.3.h, + fontWeight: FontWeight.w500, + ), + ), + SizedBox( + height: 16.h, + ), + ], + ), + ), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + GestureDetector( + onTap: () { + Navigator.of(context).pop(); + }, + child: Container( + height: 40.h, + alignment: Alignment.bottomCenter, + margin: EdgeInsets.only(bottom: 20.h), + child: BorderText( + padding: EdgeInsets.only( + top: 10.h, bottom: 10.h, left: 36.w, right: 36.w), + text: S.of(context).jujue, + fontSize: 12.sp, + textColor: Color(0xFF32A060), + borderColor: Color(0xFF32A060), + borderWidth: 1.w, + radius: 23, + ), + ), + ), + SizedBox( + width: 21.w, + ), + Container( + height: 40.h, + margin: EdgeInsets.only(bottom: 20.h), + alignment: Alignment.bottomCenter, + child: RoundButton( + text: S.of(context).tongyibingjixu, + textColor: Colors.white, + fontSize: 12, + callback: () { + SharedPreferences.getInstance().then((value) { + value.setBool("isShowPrivacyPolicy", true); + }); + SharesdkPlugin.uploadPrivacyPermissionStatus( + 1, + (success) => { + Navigator.of(context).pop(), + }); + }, + padding: EdgeInsets.only( + top: 10.h, + bottom: 10.h, + left: 21.5.w, + right: 21.5.w), + backgroup: Color(0xff32A060), + radius: 23, + ), + ), + SizedBox( + height: 20.h, + ), + ], + ), + ], + ) + ], + ); + }, + ); + } + bool isPhone(mobile) { RegExp exp = RegExp( r'^((13[0-9])|(14[0-9])|(15[0-9])|(16[0-9])|(17[0-9])|(18[0-9])|(19[0-9]))\d{8}$'); diff --git a/pubspec.lock b/pubspec.lock index d3bbf51a..e09541ac 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -56,7 +56,7 @@ packages: name: async url: "https://pub.flutter-io.cn" source: hosted - version: "2.6.1" + version: "2.5.0" barcode: dependency: transitive description: @@ -872,7 +872,7 @@ packages: name: test_api url: "https://pub.flutter-io.cn" source: hosted - version: "0.3.0" + version: "0.2.19" timing: dependency: transitive description: