diff --git a/assets/image/2x/lose.webp b/assets/image/2x/lose.webp new file mode 100644 index 00000000..9e8a699a Binary files /dev/null and b/assets/image/2x/lose.webp differ diff --git a/assets/image/2x/pop_background.webp b/assets/image/2x/pop_background.webp new file mode 100644 index 00000000..d6ebcc2d Binary files /dev/null and b/assets/image/2x/pop_background.webp differ diff --git a/assets/image/3x/lose.webp b/assets/image/3x/lose.webp new file mode 100644 index 00000000..5ae9ce96 Binary files /dev/null and b/assets/image/3x/lose.webp differ diff --git a/assets/image/3x/pop_background.webp b/assets/image/3x/pop_background.webp new file mode 100644 index 00000000..d0b735bd Binary files /dev/null and b/assets/image/3x/pop_background.webp differ diff --git a/assets/image/pop_background.webp b/assets/image/pop_background.webp new file mode 100644 index 00000000..7b403922 Binary files /dev/null and b/assets/image/pop_background.webp differ diff --git a/assets/map_style/area_code_full.json b/assets/map_style/area_code_full.json new file mode 100644 index 00000000..3cbd69f3 --- /dev/null +++ b/assets/map_style/area_code_full.json @@ -0,0 +1,794 @@ +{ + "热门":[ + { + "area": "中国", + "area_code": "+86" + }, + { + "area": "中国(香港)", + "area_code": "+852" + }, + { + "area": "中国(澳门)", + "area_code": "+853" + }, + { + "area": "中国(台湾)", + "area_code": "+886" + } + ], + "A": [ + { + "area": "阿尔巴尼亚", + "area_code": "+355" + }, + { + "area": "阿尔及利亚", + "area_code": "+213" + }, + { + "area": "阿富汗", + "area_code": "+93" + }, + { + "area": "阿根廷", + "area_code": "+54" + }, + { + "area": "阿拉斯加", + "area_code": "+1907" + }, + { + "area": "阿鲁巴岛", + "area_code": "+297" + }, + { + "area": "阿曼", + "area_code": "+968" + }, + { + "area": "阿森松", + "area_code": "+247" + }, + { + "area": "埃及", + "area_code": "+20" + }, + { + "area": "埃塞俄比亚", + "area_code": "+251" + }, + { + "area": "爱尔兰", + "area_code": "+353" + }, + { + "area": "安哥拉", + "area_code": "+244" + }, + { + "area": "安圭拉岛", + "area_code": "+1809" + }, + { + "area": "奥地利", + "area_code": "+43" + }, + { + "area": "澳大利亚", + "area_code": "+61" + }, + { + "area": "澳门", + "area_code": "+853" + } + ], + "B": [ + { + "area": "巴巴多斯", + "area_code": "+1809" + }, + { + "area": "巴哈马", + "area_code": "+1809" + }, + { + "area": "巴基斯坦", + "area_code": "+92" + }, + { + "area": "巴拉圭", + "area_code": "+595" + }, + { + "area": "巴林", + "area_code": "+973" + }, + { + "area": "巴拿马", + "area_code": "+507" + }, + { + "area": "巴西", + "area_code": "+55" + }, + { + "area": "保加利亚", + "area_code": "+359" + }, + { + "area": "贝宁", + "area_code": "+229" + }, + { + "area": "比利时", + "area_code": "+32" + }, + { + "area": "冰岛", + "area_code": "+354" + }, + { + "area": "波多黎各", + "area_code": "+1809" + }, + { + "area": "波兰", + "area_code": "+48" + }, + { + "area": "玻利维亚", + "area_code": "+591" + }, + { + "area": "伯利兹", + "area_code": "+501" + }, + { + "area": "博茨瓦纳", + "area_code": "+267" + }, + { + "area": "不丹", + "area_code": "+975" + }, + { + "area": "布基拉法索", + "area_code": "+226" + }, + { + "area": "布隆迪", + "area_code": "+257" + } + ], + "C": [ + { + "area": "朝鲜", + "area_code": "+850" + }, + { + "area": "赤道几内亚", + "area_code": "+240" + } + ], + "D": [ + { + "area": "丹麦", + "area_code": "+45" + }, + { + "area": "德国", + "area_code": "+349" + }, + { + "area": "东萨摩亚", + "area_code": "+684" + }, + { + "area": "多哥", + "area_code": "+228" + } + ], + "E": [ + { + "area": "俄罗斯", + "area_code": "+7" + }, + { + "area": "厄瓜多尔", + "area_code": "+593" + } + ], + "F": [ + { + "area": "法国", + "area_code": "+33" + }, + { + "area": "法罗群岛", + "area_code": "+298" + }, + { + "area": "法属圭亚那", + "area_code": "+594" + }, + { + "area": "梵蒂冈", + "area_code": "+396" + }, + { + "area": "菲律宾", + "area_code": "+63" + }, + { + "area": "斐济", + "area_code": "+679" + }, + { + "area": "芬兰", + "area_code": "+358" + }, + { + "area": "佛得角", + "area_code": "+238" + }, + { + "area": "福克兰群岛", + "area_code": "+500" + } + ], + "G": [ + { + "area": "冈比亚", + "area_code": "+220" + }, + { + "area": "刚果", + "area_code": "+242" + }, + { + "area": "哥伦比亚", + "area_code": "+57" + }, + { + "area": "哥斯达黎加", + "area_code": "+506" + }, + { + "area": "格陵兰岛", + "area_code": "+299" + }, + { + "area": "古巴", + "area_code": "+53" + }, + { + "area": "关岛", + "area_code": "+671" + }, + { + "area": "圭亚那", + "area_code": "+592" + } + ], + "H": [ + { + "area": "海地", + "area_code": "+509" + }, + { + "area": "韩国", + "area_code": "+82" + }, + { + "area": "荷兰", + "area_code": "+31" + }, + { + "area": "洪都拉斯", + "area_code": "+504" + } + ], + "J": [ + { + "area": "基里巴斯", + "area_code": "+686" + }, + { + "area": "吉布提", + "area_code": "+253" + }, + { + "area": "几内亚", + "area_code": "+224" + }, + { + "area": "几内亚比绍", + "area_code": "+245" + }, + { + "area": "加拿大", + "area_code": "+1" + }, + { + "area": "加纳", + "area_code": "+233" + }, + { + "area": "加蓬", + "area_code": "+241" + }, + { + "area": "柬埔寨", + "area_code": "+855" + }, + { + "area": "津巴布韦", + "area_code": "+263" + } + ], + "K": [ + { + "area": "喀麦隆", + "area_code": "+237" + }, + { + "area": "卡塔尔", + "area_code": "+974" + }, + { + "area": "科科斯岛", + "area_code": "+6722" + }, + { + "area": "科克群岛", + "area_code": "+682" + }, + { + "area": "科摩罗", + "area_code": "+269" + }, + { + "area": "科特迪瓦", + "area_code": "+225" + }, + { + "area": "科威特", + "area_code": "+965" + }, + { + "area": "肯尼亚", + "area_code": "+254" + } + ], + "L": [ + { + "area": "莱索托", + "area_code": "+266" + }, + { + "area": "老挝", + "area_code": "+856" + }, + { + "area": "黎巴嫩", + "area_code": "+961" + }, + { + "area": "利比里亚", + "area_code": "+231" + }, + { + "area": "利比亚", + "area_code": "+218" + }, + { + "area": "列支敦士登", + "area_code": "+4175" + }, + { + "area": "留尼旺岛", + "area_code": "+262" + }, + { + "area": "卢森堡", + "area_code": "+352" + }, + { + "area": "卢旺达", + "area_code": "+250" + }, + { + "area": "罗马尼亚", + "area_code": "+40" + } + ], + "M": [ + { + "area": "马达加斯加", + "area_code": "+261" + }, + { + "area": "马尔代夫", + "area_code": "+960" + }, + { + "area": "马耳他", + "area_code": "+356" + }, + { + "area": "马拉维", + "area_code": "+265" + }, + { + "area": "马来西亚", + "area_code": "+60" + }, + { + "area": "马里", + "area_code": "+223" + }, + { + "area": "马提尼克", + "area_code": "+596" + }, + { + "area": "毛里求斯", + "area_code": "+230" + }, + { + "area": "毛里塔尼亚", + "area_code": "+222" + }, + { + "area": "美国", + "area_code": "+1" + }, + { + "area": "蒙古", + "area_code": "+976" + }, + { + "area": "孟加拉国", + "area_code": "+880" + }, + { + "area": "秘鲁", + "area_code": "+51" + }, + { + "area": "缅甸", + "area_code": "+95" + }, + { + "area": "摩洛哥", + "area_code": "+210" + }, + { + "area": "莫桑比克", + "area_code": "+258" + }, + { + "area": "墨西哥", + "area_code": "+52" + } + ], + "N": [ + { + "area": "纳米比亚", + "area_code": "+264" + }, + { + "area": "南非", + "area_code": "+27" + }, + { + "area": "南斯拉夫", + "area_code": "+338" + }, + { + "area": "瑙鲁", + "area_code": "+674" + }, + { + "area": "尼加拉瓜", + "area_code": "+505" + }, + { + "area": "尼泊尔", + "area_code": "+977" + }, + { + "area": "尼日尔", + "area_code": "+227" + }, + { + "area": "尼日利亚", + "area_code": "+234" + }, + { + "area": "纽埃岛", + "area_code": "+683" + }, + { + "area": "挪威", + "area_code": "+47" + }, + { + "area": "诺福克岛", + "area_code": "+6723" + } + ], + "P": [ + { + "area": "葡萄牙", + "area_code": "+351" + }, + { + "area": "普林西比", + "area_code": "+239" + } + ], + "R": [ + { + "area": "日本", + "area_code": "+81" + }, + { + "area": "瑞典", + "area_code": "+46" + }, + { + "area": "瑞士", + "area_code": "+41" + } + ], + "S": [ + { + "area": "萨尔瓦多", + "area_code": "+503" + }, + { + "area": "塞拉利昂", + "area_code": "+232" + }, + { + "area": "塞内加尔", + "area_code": "+221" + }, + { + "area": "塞浦路斯", + "area_code": "+357" + }, + { + "area": "塞舌尔", + "area_code": "+248" + }, + { + "area": "沙特阿拉伯", + "area_code": "+966" + }, + { + "area": "圣诞岛", + "area_code": "+6724" + }, + { + "area": "圣多美", + "area_code": "+239" + }, + { + "area": "圣赫勒拿", + "area_code": "+290" + }, + { + "area": "圣卢西亚", + "area_code": "+1809" + }, + { + "area": "圣马力诺", + "area_code": "+223" + }, + { + "area": "斯里兰卡", + "area_code": "+94" + }, + { + "area": "斯威士兰", + "area_code": "+268" + }, + { + "area": "苏丹", + "area_code": "+249" + }, + { + "area": "苏里南", + "area_code": "+597" + }, + { + "area": "所罗门群岛", + "area_code": "+677" + }, + { + "area": "索马里", + "area_code": "+252" + } + ], + "T": [ + { + "area": "台湾", + "area_code": "+886" + }, + { + "area": "泰国", + "area_code": "+66" + }, + { + "area": "坦桑尼亚", + "area_code": "+255" + }, + { + "area": "汤加", + "area_code": "+676" + }, + { + "area": "突尼斯", + "area_code": "+216" + }, + { + "area": "图瓦卢", + "area_code": "+688" + }, + { + "area": "土耳其", + "area_code": "+90" + } + ], + "W": [ + { + "area": "瓦努阿图", + "area_code": "+678" + }, + { + "area": "危地马拉", + "area_code": "+502" + }, + { + "area": "威克岛", + "area_code": "+1808" + }, + { + "area": "维尔京群岛", + "area_code": "+1809" + }, + { + "area": "委内瑞拉", + "area_code": "+58" + }, + { + "area": "文莱", + "area_code": "+673" + }, + { + "area": "乌干达", + "area_code": "+256" + }, + { + "area": "乌拉圭", + "area_code": "+598" + } + ], + "X": [ + { + "area": "希腊", + "area_code": "+30" + }, + { + "area": "西班牙", + "area_code": "+34" + }, + { + "area": "西萨摩亚", + "area_code": "+685" + }, + { + "area": "夏威夷", + "area_code": "+1808" + }, + { + "area": "香港", + "area_code": "+852" + }, + { + "area": "新加坡", + "area_code": "+65" + }, + { + "area": "新西兰", + "area_code": "+64" + }, + { + "area": "匈牙利", + "area_code": "+336" + }, + { + "area": "叙利亚", + "area_code": "+963" + } + ], + "Y": [ + { + "area": "牙买加", + "area_code": "+1809" + }, + { + "area": "伊拉克", + "area_code": "+964" + }, + { + "area": "伊朗", + "area_code": "+98" + }, + { + "area": "以色列", + "area_code": "+972" + }, + { + "area": "意大利", + "area_code": "+39" + }, + { + "area": "印度", + "area_code": "+91" + }, + { + "area": "印度尼西亚", + "area_code": "+62" + }, + { + "area": "英国", + "area_code": "+44" + }, + { + "area": "约旦", + "area_code": "+962" + }, + { + "area": "越南", + "area_code": "+84" + } + ], + "Z": [ + { + "area": "赞比亚", + "area_code": "+260" + }, + { + "area": "扎伊尔", + "area_code": "+243" + }, + { + "area": "乍得", + "area_code": "+235" + }, + { + "area": "直布罗陀", + "area_code": "+350" + }, + { + "area": "智利", + "area_code": "+56" + }, + { + "area": "中非", + "area_code": "+236" + }, + { + "area": "中国", + "area_code": "+86" + }, + { + "area": "中途岛", + "area_code": "+1808" + } + ] +} \ No newline at end of file diff --git a/lib/community/community_view/class_details_video.dart b/lib/community/community_view/class_details_video.dart index 11fdf1a6..62611fde 100644 --- a/lib/community/community_view/class_details_video.dart +++ b/lib/community/community_view/class_details_video.dart @@ -78,14 +78,15 @@ class ClassDetailsVideoState extends State { //自动播放 looping: false, //循环播放 - allowFullScreen: true, - // 拖动条样式颜色 + allowFullScreen: false, + // 允许的屏幕睡眠 materialProgressColors: chewie.ChewieProgressColors( playedColor: Colors.white, handleColor: Colors.white, backgroundColor: Colors.grey, bufferedColor: Colors.transparent, ), + // 拖动条样式颜色 autoInitialize: true, ); chewieAudioController.addListener(_fullScreenListener); diff --git a/lib/community/community_view/community_dynamic.dart b/lib/community/community_view/community_dynamic.dart index 07a19639..d169762f 100644 --- a/lib/community/community_view/community_dynamic.dart +++ b/lib/community/community_view/community_dynamic.dart @@ -89,7 +89,7 @@ class _CommunityDynamic extends State { //宽高比 autoPlay: false, //自动播放 - looping: false, + looping: true, //循环播放 allowFullScreen: true, // 拖动条样式颜色 diff --git a/lib/integral_store/integral_store_details_page.dart b/lib/integral_store/integral_store_details_page.dart index 3112c1ae..0b16ff30 100644 --- a/lib/integral_store/integral_store_details_page.dart +++ b/lib/integral_store/integral_store_details_page.dart @@ -167,12 +167,13 @@ class _IntegralStoreDetailsPage extends State { }, child: Container( padding: EdgeInsets.only(top: 16.h, bottom: 16.h), + margin: EdgeInsets.only(bottom:25.h,left:20,right: 20), decoration: BoxDecoration( color: (payType > 0) ? Color(0xFF32A060) : Color(0xFFD8D8D8), - borderRadius: BorderRadius.vertical( - top: Radius.circular(4), + borderRadius: BorderRadius.circular( + 45 ), ), alignment: Alignment.center, diff --git a/lib/login/login_page.dart b/lib/login/login_page.dart index dd55456d..f1112d07 100644 --- a/lib/login/login_page.dart +++ b/lib/login/login_page.dart @@ -61,6 +61,7 @@ class _MyLoginPageState extends State with TickerProviderStateMixin { Animation animation; Animation doubleAnimation; bool invitationCode = true; + String areaCode; isLogin() async { SharedPreferences sharedPreferences = await SharedPreferences.getInstance(); @@ -227,7 +228,7 @@ class _MyLoginPageState extends State with TickerProviderStateMixin { } if (_sendCodeStatus == 0) { client - .sendVerify(mobile) + .sendVerify(areaCode,mobile) .then((value) => { if (value.isSuccess) {_sendCodeStatus = 1, countdown()} diff --git a/lib/login/new_login_page.dart b/lib/login/new_login_page.dart index 5669523d..0ecf5d67 100644 --- a/lib/login/new_login_page.dart +++ b/lib/login/new_login_page.dart @@ -59,6 +59,7 @@ class _NewLoginPage extends State { var checkStatus = false; Timer _timer; bool isShowLogin = false; + String area = "+86"; @override void initState() { @@ -129,19 +130,19 @@ class _NewLoginPage extends State { } if (_sendCodeStatus == 0) { apiService - .sendVerify(mobile) + .sendVerify(area,mobile) .then((value) => { - if (value.isSuccess) - {_sendCodeStatus = 1, countdown()} - else - { - btnText = S.of(context).send_code, - _sendCodeStatus = 0, - SmartDialog.showToast("${value.msg}", - alignment: Alignment.center), - refresh() - } - }) + if (value.isSuccess) + {_sendCodeStatus = 1, countdown()} + else + { + btnText = S.of(context).send_code, + _sendCodeStatus = 0, + SmartDialog.showToast("${value.msg}", + alignment: Alignment.center), + refresh() + } + }) .catchError((error) { SmartDialog.showToast("$error", alignment: Alignment.center); }); @@ -212,43 +213,42 @@ class _NewLoginPage extends State { return; } var invite = _controllerInviteCode.text; - var param = { - "capcha": code, - "mobile": mobile, - "invite":invite - }; + var param = {"capcha": code, "mobile": mobile, "invite": invite}; EasyLoading.show(status: S.of(context).zhengzaijiazai); BaseData value = await apiService.memberLogin(param).catchError((error) { print(error.message); - SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type), alignment: Alignment.center); + SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type), + alignment: Alignment.center); }); // EasyLoading.show(status: S.of(context).zhengzaijiazai); - if (value !=null && value.isSuccess) { + if (value != null && value.isSuccess) { var userInfo = LoginInfo.fromJson(value.data); saveUserJson(userInfo.authInfo.toJson()); eventBus.fire(EventType(3)); Navigator.of(context).pushNamedAndRemoveUntil( - '/router/main_page', - (route) => false,arguments:{"invite":invite,"interviewCouponList":userInfo.interviewCouponList, - "firstLoginCouponList":userInfo.firstLoginCouponList}); + '/router/main_page', (route) => false, + arguments: { + "invite": invite, + "interviewCouponList": userInfo.interviewCouponList, + "firstLoginCouponList": userInfo.firstLoginCouponList + }); EasyLoading.dismiss(); - } else { - if(value.msg != null) - SmartDialog.showToast(value?.msg, alignment: Alignment.center); + if (value.msg != null) + SmartDialog.showToast(value?.msg, alignment: Alignment.center); } } saveUserJson(userJson) { var userEntity = UserEntity.fromJson(userJson); SharedPreferences.getInstance().then((value) => { - value.setString('userJson', jsonEncode(userJson)), - value.setString('token', userEntity.token), - value.setString('userId', userEntity.userId), - value.setString('nick', userEntity.name), - value.setString('mobile', userEntity.mobile), - }); + value.setString('userJson', jsonEncode(userJson)), + value.setString('token', userEntity.token), + value.setString('userId', userEntity.userId), + value.setString('nick', userEntity.name), + value.setString('mobile', userEntity.mobile), + }); } isLogin() async { @@ -263,11 +263,12 @@ class _NewLoginPage extends State { sharedPreferences.getString("token") != null && sharedPreferences.getString("token") != "") { Navigator.of(context).popAndPushNamed('/router/main_page'); - } else {initController(); + } else { + initController(); - apiService = ApiService(Dio(), context: context); - isShowLogin = true; - setState(() {}); + apiService = ApiService(Dio(), context: context); + isShowLogin = true; + setState(() {}); } } @@ -279,64 +280,63 @@ class _NewLoginPage extends State { @override Widget build(BuildContext context) { - return Scaffold( - body:GestureDetector( - behavior: HitTestBehavior.translucent, - onTap: (){ - FocusScope.of(context).requestFocus(FocusNode()); - }, - child: AnimatedCrossFade( - firstChild: Container( - color: Colors.white, - child: Image.asset( - "assets/image/ic_splash_bg.webp", - fit: BoxFit.fill, - ), + return Scaffold( + body: GestureDetector( + behavior: HitTestBehavior.translucent, + onTap: () { + FocusScope.of(context).requestFocus(FocusNode()); + }, + child: AnimatedCrossFade( + firstChild: Container( + color: Colors.white, + child: Image.asset( + "assets/image/ic_splash_bg.webp", + fit: BoxFit.fill, ), - layoutBuilder: (widgetFirst, keyFirst, widgetSecond, keySecond) { - return Stack( - clipBehavior: Clip.none, - children: [ - Positioned( - key: keySecond, - left: 0.0, - top: 0.0, - right: 0.0, - bottom: 0.0, - child: widgetSecond, - ), - Positioned( - key: keyFirst, - left: 0.0, - top: 0.0, - right: 0.0, - bottom: 0.0, - child: widgetFirst, - ), - ], - ); - }, - secondChild: substance(), - firstCurve: Curves.easeInQuart, - secondCurve: Curves.easeInQuart, - crossFadeState: - isShowLogin ? CrossFadeState.showSecond : CrossFadeState.showFirst, - duration: Duration(milliseconds: Platform.isIOS ? 1000 : 1000), ), - ) - ); + layoutBuilder: (widgetFirst, keyFirst, widgetSecond, keySecond) { + return Stack( + clipBehavior: Clip.none, + children: [ + Positioned( + key: keySecond, + left: 0.0, + top: 0.0, + right: 0.0, + bottom: 0.0, + child: widgetSecond, + ), + Positioned( + key: keyFirst, + left: 0.0, + top: 0.0, + right: 0.0, + bottom: 0.0, + child: widgetFirst, + ), + ], + ); + }, + secondChild: substance(), + firstCurve: Curves.easeInQuart, + secondCurve: Curves.easeInQuart, + crossFadeState: + isShowLogin ? CrossFadeState.showSecond : CrossFadeState.showFirst, + duration: Duration(milliseconds: Platform.isIOS ? 1000 : 1000), + ), + )); } void refresh() { setState(() {}); } - Widget substance(){ + Widget substance() { return Container( child: Column( children: [ Expanded( - child:SingleChildScrollView( + child: SingleChildScrollView( physics: BouncingScrollPhysics(), child: Column( mainAxisAlignment: MainAxisAlignment.spaceBetween, @@ -344,8 +344,11 @@ class _NewLoginPage extends State { children: [ Container( width: double.infinity, - padding: EdgeInsets.only(left: 16.w,top:60.h+ MediaQuery.of(context).padding.top,right: 12.w), - child:Column( + padding: EdgeInsets.only( + left: 16.w, + top: 60.h + MediaQuery.of(context).padding.top, + right: 12.w), + child: Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -357,7 +360,9 @@ class _NewLoginPage extends State { color: Color(0xFF000000), ), ), - SizedBox(height:20.h,), + SizedBox( + height: 20.h, + ), Text( "欢迎来到一心回乡", style: TextStyle( @@ -366,7 +371,9 @@ class _NewLoginPage extends State { color: Color(0xFF000000), ), ), - SizedBox(height:50.h,), + SizedBox( + height: 50.h, + ), Text( S.of(context).shoujihao, style: TextStyle( @@ -375,46 +382,76 @@ class _NewLoginPage extends State { color: Color(0xFF181818), ), ), - Container( - height:30.h, - width: MediaQuery.of(context).size.width - 80.h, - // margin: EdgeInsets.only(top: 12.h), - child: TextField( - style: TextStyle( - height: 1.h, - fontSize: 16.sp, - color: statusPhoneTextColor, + Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + GestureDetector( + onTap: (){ + Navigator.of(context).pushNamed('/router/phone_address_page').then((value) { + if(value != null) + setState(() { + area = value; + }); + }); + }, + child: Text( + area, + style: TextStyle( + fontWeight: MyFontWeight.regular, + fontSize: 16.sp, + color: Color(0xFF1A1A1A), + ), + )), + Icon( + Icons.keyboard_arrow_right, + size: 18, + color: Color(0xFF1A1A1A), ), - onChanged: (value) { - if (value != null && value.isNotEmpty) { - if (isPhone(value)) { - mobileStatus = 1; - } else { - mobileStatus = 2; - } - } else { - mobileStatus = 0; - } - setState(() {}); - }, - controller: _controllerPhone, - keyboardType: TextInputType.phone, - decoration: InputDecoration( - errorBorder: InputBorder.none, - focusedBorder: InputBorder.none, - enabledBorder: InputBorder.none, - hintText: "", - // contentPadding: EdgeInsets.only(top: 12, bottom: 12, left: 12), - hintStyle: TextStyle( - fontSize: 10.sp, - color: Color(0xFFA29E9E), + Container( + height: 30.h, + width: MediaQuery.of(context).size.width - 100.w, + margin: EdgeInsets.only(bottom: 10.h), + child: TextField( + style: TextStyle( + height: 1.h, + fontSize: 16.sp, + color: statusPhoneTextColor, + ), + onChanged: (value) { + if (value != null && value.isNotEmpty) { + if (isPhone(value)) { + mobileStatus = 1; + } else { + mobileStatus = 2; + } + } else { + mobileStatus = 0; + } + setState(() {}); + }, + controller: _controllerPhone, + keyboardType: TextInputType.phone, + decoration: InputDecoration( + errorBorder: InputBorder.none, + focusedBorder: InputBorder.none, + enabledBorder: InputBorder.none, + hintText: "", + // contentPadding: EdgeInsets.only(top: 12, bottom: 12, left: 12), + hintStyle: TextStyle( + fontSize: 10.sp, + color: Color(0xFFA29E9E), + ), + ), + textInputAction: TextInputAction.next, + inputFormatters: [ + LengthLimitingTextInputFormatter(11) + ], + cursorColor: Colors.grey, + maxLines: 1, ), ), - textInputAction: TextInputAction.next, - inputFormatters: [LengthLimitingTextInputFormatter(11)], - cursorColor: Colors.grey, - maxLines: 1, - ), + ], ), Container( height: 1.h, @@ -422,7 +459,7 @@ class _NewLoginPage extends State { color: statusPhoneLineColor, ), SizedBox( - height:30.h, + height: 30.h, child: Visibility( visible: statusPhoneVisible, child: Text( @@ -443,7 +480,7 @@ class _NewLoginPage extends State { ), ), Container( - height:30.h, + height: 30.h, width: MediaQuery.of(context).size.width - 30.h, child: Row( mainAxisAlignment: MainAxisAlignment.end, @@ -463,7 +500,8 @@ class _NewLoginPage extends State { color: statusCodeTextColor, ), onChanged: (value) { - if (value != null && value.isNotEmpty) { + if (value != null && + value.isNotEmpty) { if (value.length == 6) { verifyStatus = 1; } else { @@ -543,7 +581,9 @@ class _NewLoginPage extends State { ), ), ), - SizedBox(height: 51.h,), + SizedBox( + height: 51.h, + ), Row( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.center, @@ -556,10 +596,11 @@ class _NewLoginPage extends State { }); }, checkColor: Color(0xFFFFFFFF), - fillColor: MaterialStateProperty.all(Color(0xFF32A060)), + fillColor: + MaterialStateProperty.all(Color(0xFF32A060)), ), - Expanded(child: - Text.rich( + Expanded( + child: Text.rich( TextSpan(children: [ TextSpan( text: S.of(context).privacy_policy1, @@ -573,8 +614,8 @@ class _NewLoginPage extends State { text: "《一心回乡用户协议》", recognizer: TapGestureRecognizer() ..onTap = () { - Navigator.of(context) - .pushNamed('/router/user_service_page'); + Navigator.of(context).pushNamed( + '/router/user_service_page'); }, style: TextStyle( fontSize: 11.sp, @@ -606,18 +647,20 @@ class _NewLoginPage extends State { ), ]), )), - SizedBox(width: 30,) + SizedBox( + width: 30, + ) ], ), GestureDetector( - onTap: (){ + onTap: () { _login(); }, child: Container( - width:double.infinity, + width: double.infinity, height: 57.h, alignment: Alignment.center, - margin: EdgeInsets.only(top: 14.h,bottom:12.h), + margin: EdgeInsets.only(top: 14.h, bottom: 12.h), decoration: BoxDecoration( borderRadius: BorderRadius.circular(6), color: Color(0xFF32A060), @@ -633,16 +676,17 @@ class _NewLoginPage extends State { ), ), GestureDetector( - onTap: (){ + onTap: () { print("11111"); if (widget.arguments != null) { Navigator.of(context).pop(); } else { - Navigator.of(context).popAndPushNamed('/router/main_page'); + Navigator.of(context) + .popAndPushNamed('/router/main_page'); } }, child: Container( - width:double.infinity, + width: double.infinity, height: 57.h, alignment: Alignment.center, decoration: BoxDecoration( @@ -810,7 +854,7 @@ class _NewLoginPage extends State { }); SharesdkPlugin.uploadPrivacyPermissionStatus( 1, - (success) => { + (success) => { Navigator.of(context).pop(), }, ); @@ -843,5 +887,4 @@ class _NewLoginPage extends State { r'^((13[0-9])|(14[0-9])|(15[0-9])|(16[0-9])|(17[0-9])|(18[0-9])|(19[0-9]))\d{8}$'); return exp.hasMatch(mobile); } - } diff --git a/lib/login/phone_address_page.dart b/lib/login/phone_address_page.dart new file mode 100644 index 00000000..29bf8c7e --- /dev/null +++ b/lib/login/phone_address_page.dart @@ -0,0 +1,158 @@ +import 'dart:convert'; + +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:huixiang/generated/l10n.dart'; +import 'package:huixiang/utils/font_weight.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:huixiang/view_widget/classic_header.dart'; +import 'package:huixiang/view_widget/my_footer.dart'; +import 'package:pull_to_refresh/pull_to_refresh.dart'; + +class PhoneAddressPage extends StatefulWidget { + @override + State createState() { + return _PhoneAddressPage(); + } +} + +class _PhoneAddressPage extends State { + RefreshController refreshController = RefreshController(); + Map areaMap; + List areaList = []; + + @override + void initState() { + super.initState(); + areaCode(); + } + + void areaCode() async { + var value = + await rootBundle.loadString('assets/map_style/area_code_full.json'); + areaMap = jsonDecode(value); + areaMap.forEach((key, value) { + areaList.add(key); + }); + setState(() {}); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + backgroundColor: Color(0xFFF0F0F0), + leading: GestureDetector( + child: Icon( + Icons.arrow_back_ios, + color: Colors.black, + ), + onTap: () { + Navigator.of(context).pop(); + }), + title: Text( + "选择手机号归属地", + style: TextStyle( + fontWeight: MyFontWeight.regular, + fontSize: 17.sp, + color: Color(0xFF0D0D0D), + ), + ), + centerTitle: true, + elevation: 0.0, + ), + body: Container( + color: Color(0xFFF0F0F0), + child: sortList(), + ), + ); + } + + Widget sortList() { + return ListView.builder( + padding: EdgeInsets.zero, + itemCount: areaList.length, + scrollDirection: Axis.vertical, + shrinkWrap: true, + physics: BouncingScrollPhysics(), + itemBuilder: (context, position) { + return GestureDetector( + onTap: () {}, + child: sortItem(position), + ); + }, + ); + } + + Widget sortItem(int position) { + return Column( + children: [ + Container( + width: double.infinity, + color: Colors.white, + padding: EdgeInsets.only(top: 2.h, bottom: 2.h, left: 16.w), + margin: EdgeInsets.only(bottom: 12.h), + child: Text( + areaList[position], + style: TextStyle( + color: Color(0xFF000000), + fontWeight: MyFontWeight.medium, + fontSize: 16.sp, + ), + ), + ), + Column( + children: (areaMap[areaList[position]] as List).map((e) { + return globalRoamingItem(e); + }).toList(), + ) + ], + ); + } + + Widget globalRoamingItem(data) { + return GestureDetector( + child: Container( + margin: EdgeInsets.only(left: 16.w, right: 22.w), + child: Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Expanded( + child: Text( + data["area"], + style: TextStyle( + color: Color(0xFF000000), + fontWeight: MyFontWeight.regular, + fontSize: 14.sp, + ), + ), + ), + Text( + data["area_code"], + style: TextStyle( + color: Color(0xFFA29E9E), + fontWeight: MyFontWeight.regular, + fontSize: 12.sp, + ), + ), + ], + ), + Container( + margin: EdgeInsets.symmetric(vertical: 12.h), + width: double.infinity, + height: 1.h, + color: Color(0xFFDCDCDC), + ) + ], + ), + ), + onTap: () { + Navigator.of(context).pop(data["area_code"]); + }, + ); + } +} diff --git a/lib/main.dart b/lib/main.dart index 028734a4..ff373191 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -5,7 +5,6 @@ import 'package:event_bus/event_bus.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; -import 'package:flutter_bmflocation/bdmap_location_flutter_plugin.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; @@ -54,6 +53,8 @@ import 'package:huixiang/setting/logout_ing.dart'; import 'package:huixiang/setting/logout_page.dart'; import 'package:huixiang/setting/permission_setting_page.dart'; import 'package:huixiang/setting/platform_code_page.dart'; +import 'package:huixiang/setting/platform_pay_code.dart'; +import 'package:huixiang/setting/platform_pay_code_success.dart'; import 'package:huixiang/setting/setting_page.dart'; import 'package:huixiang/setting/treaty_page.dart'; import 'package:huixiang/store/report_assess%20.dart'; @@ -71,7 +72,6 @@ import 'package:huixiang/settlement/settlement.dart'; import 'package:huixiang/test_page.dart'; import 'package:huixiang/union/location_map_page.dart'; import 'package:huixiang/utils/ImgCachePath.dart'; -import 'package:huixiang/view_widget/activity_poster.dart'; import 'package:huixiang/web/web_page.dart'; import 'package:huixiang/union/union_details_page.dart'; @@ -80,11 +80,6 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:huixiang/utils/flutter_utils.dart'; import 'package:huixiang/web/web_turntable_activity.dart'; import 'package:shared_preferences/shared_preferences.dart'; -import 'package:sharesdk_plugin/sharesdk_interface.dart'; -import 'package:sharesdk_plugin/sharesdk_register.dart'; -import 'package:tpns_flutter_plugin/android/xg_android_api.dart'; -import 'package:tpns_flutter_plugin/tpns_flutter_plugin.dart'; -import 'package:flutter_baidu_mapapi_base/flutter_baidu_mapapi_base.dart'; import 'community/community_view/class_details.dart'; import 'community/headlines/headlines_column_details.dart'; @@ -95,10 +90,10 @@ import 'community/report/report_page.dart'; import 'community/report/report_success.dart'; import 'home/guide_page.dart'; import 'home/home_view/activity_list.dart'; -import 'home/start_page.dart'; import 'home/welfare_exchange.dart'; import 'home/welfare_page.dart'; import 'login/new_login_page.dart'; +import 'login/phone_address_page.dart'; import 'main_page.dart'; import 'message/system_details.dart'; import 'mine/coupon_page.dart'; @@ -108,7 +103,6 @@ import 'mine/manage_address_page.dart'; import 'mine/mine_greenery.dart'; import 'mine/mine_shop_details.dart'; import 'mine/mine_shop_page.dart'; -import 'mine/mine_view/calendar_page.dart'; import 'mine/mine_view/community_follow.dart'; import 'mine/mine_vip/binding_assistant_card.dart'; import 'mine/mine_vip/legal_right_details.dart'; @@ -401,4 +395,10 @@ Map routers = { AccountSecurityPage(), '/router/platform_code_page': (context, {arguments}) => PlatformCodePage(arguments:arguments), + '/router/platform_pay_code': (context, {arguments}) => + PlatformPayCode(arguments:arguments), + '/router/platform_pay_code_success': (context, {arguments}) => + PlatformPayCodeSuccess(arguments:arguments), + '/router/phone_address_page': (context, {arguments}) => + PhoneAddressPage(), }; diff --git a/lib/mine/manage_address_page.dart b/lib/mine/manage_address_page.dart index 18a55a44..f918399e 100644 --- a/lib/mine/manage_address_page.dart +++ b/lib/mine/manage_address_page.dart @@ -97,10 +97,14 @@ class _ManageAddressPage extends State { addAddress(); }, child: Container( - color: Color(0xFF32A060), width: MediaQuery.of(context).size.width, padding: EdgeInsets.all(16), + margin:EdgeInsets.symmetric(horizontal: 16.w,vertical:25.h), alignment: Alignment.center, + decoration: BoxDecoration( + color: Color(0xFF32A060), + borderRadius: BorderRadius.circular(45), + ), child: Text( "新增地址", style: TextStyle( diff --git a/lib/mine/recharge_page.dart b/lib/mine/recharge_page.dart index d5e442c1..5de0b37d 100644 --- a/lib/mine/recharge_page.dart +++ b/lib/mine/recharge_page.dart @@ -43,6 +43,7 @@ class _RechargePage extends State { int selectIndex = 0; UserInfo userInfo; String mBalance = "0"; + dynamic payListen; @override void initState() { @@ -56,19 +57,26 @@ class _RechargePage extends State { queryRechargeList(); queryUserBalance(); }); - weChatResponseEventHandler.listen((event) async { + payListen = weChatResponseEventHandler.listen((event) async { print("payCallback: ${event.errCode}"); if (event.errCode == 0) { queryUserBalance(); SmartDialog.showToast("充值成功", alignment: Alignment.center); } - // else{ - // SmartDialog.showToast("充值失败", alignment: Alignment.center); - // return; - // } + else{ + SmartDialog.showToast("充值失败", alignment: Alignment.center); + return; + } }); } + @override + void dispose() { + super.dispose(); + if(payListen!=null) + payListen.cancel(); + } + ///会员权益列表 queryBenefitList() async { BaseData> baseData = diff --git a/lib/order/exchange_order_page.dart b/lib/order/exchange_order_page.dart index 75f4e5bc..5f17894a 100644 --- a/lib/order/exchange_order_page.dart +++ b/lib/order/exchange_order_page.dart @@ -1,4 +1,6 @@ +import 'dart:async'; import 'dart:convert'; +import 'dart:io'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -12,6 +14,7 @@ import 'package:huixiang/retrofit/data/wx_pay.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/utils/flutter_utils.dart'; import 'package:huixiang/utils/font_weight.dart'; +import 'package:huixiang/utils/min.dart'; import 'package:huixiang/view_widget/custom_image.dart'; import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:huixiang/view_widget/receiving_method_dialog.dart'; @@ -34,8 +37,9 @@ class ExchangeOrderPage extends StatefulWidget { class _ExchangeOrderPage extends State { ApiService apiService; int buyNum = 1; - var checkIndex = 1; + var checkIndex = 3; UserInfo userInfo; + dynamic payListen; dynamic mBalance = 0; @override @@ -49,6 +53,34 @@ class _ExchangeOrderPage extends State { UserInfo.fromJson(jsonDecode(value.getString('user'))).points, queryUserBalance(), }); + + payListen = weChatResponseEventHandler.listen((event) async { + print("payCallback: ${event.errCode}"); + if (event.errCode == 0) { + String realPay = handleNeedPay(); + Navigator.of(context).popAndPushNamed( + '/router/exchange_order_success_page', + arguments: { + "id": widget.arguments["goodsId"], + "price": realPay.contains("积分") ? realPay.substring(0,realPay.indexOf("积分")) : "0", + "points": points, + "realPay": realPay, + "payChannel": widget.arguments["payChannel"], + }, + ); + } else { + SmartDialog.showToast("支付失败", alignment: Alignment.center); + return; + } + }); + + } + + @override + void dispose() { + super.dispose(); + if(payListen!=null) + payListen.cancel(); } queryUserBalance() async { @@ -926,14 +958,20 @@ class _ExchangeOrderPage extends State { ], ), ), - SizedBox(height: 40) + SizedBox(height:100.h) ], )), Align( alignment: Alignment.bottomCenter, child: Container( height: 54.h, - color: Colors.white, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular( + 45 + ), + ), + margin: EdgeInsets.only(bottom:20.h,left: 16.w,right: 16.w), child: Row( children: [ Spacer(), @@ -965,21 +1003,29 @@ class _ExchangeOrderPage extends State { if (!storeIsSelected) return; creditOrder(); }, - child: RoundButton( + child: Container( width: 103.w, height: 54.h, - text: widget.arguments["payType"] == 3 || - (widget.arguments["payType"] == 2 && - widget.arguments["money"] != "0.00") + alignment: Alignment.center, + decoration: BoxDecoration( + color: Color(0xFF32A060), + borderRadius: BorderRadius.only( + bottomRight: Radius.circular(45), + topRight: Radius.circular(45), + ), + ), + child: Text( + widget.arguments["payType"] == 3 || + (widget.arguments["payType"] == 2 && + widget.arguments["money"] != "0.00") ? S.current.jiesuan : S.current.duihuan, - textColor: Colors.white, - fontWeight: MyFontWeight.regular, - backgroup: Color(0xFF32A060), - radius: 0, - fontSize: 16.sp, - padding: EdgeInsets.symmetric(vertical: 5.h), - ), + style: TextStyle( + fontSize: 16.sp, + fontWeight: MyFontWeight.regular, + color: Colors.white, + ), + ),), ), ], ), @@ -1111,24 +1157,6 @@ class _ExchangeOrderPage extends State { timeStamp: int.tryParse(wxPay.timeStamp), sign: wxPay.sign, ); - weChatResponseEventHandler.listen((event) async { - print("payCallback: ${event.errCode}"); - if (event.errCode == 0) { - Navigator.of(context).popAndPushNamed( - '/router/exchange_order_success_page', - arguments: { - "id": widget.arguments["goodsId"], - "price": realPay.contains("积分") ? realPay.substring(0,realPay.indexOf("积分")) : "0", - "points": points, - "realPay": realPay, - "payChannel": widget.arguments["payChannel"], - }, - ); - } else { - SmartDialog.showToast("支付失败", alignment: Alignment.center); - return; - } - }); return; } await Navigator.of(context) diff --git a/lib/retrofit/retrofit_api.dart b/lib/retrofit/retrofit_api.dart index 84bef5f0..fabaf924 100644 --- a/lib/retrofit/retrofit_api.dart +++ b/lib/retrofit/retrofit_api.dart @@ -181,8 +181,8 @@ abstract class ApiService { Future memberLogin(@Body() Map param); ///发送验证码 - @GET("/auth/sendVerify/{mobile}") - Future sendVerify(@Path("mobile") String mobile); + @GET("/auth/sendVerify/{areaCode}/{mobile}") + Future sendVerify(@Path("areaCode") String areaCode, @Path("mobile") String mobile); ///积分商城商品列表 @POST("/creditGoods/list") @@ -536,4 +536,7 @@ abstract class ApiService { @POST("/member/updatePayPwd") Future updatePayPwd(@Body() Map param); + ///验证验证码 + @POST("/member/verifyByUpdatePayPwd") + Future verifyByUpdatePayPwd(@Body() Map param); } diff --git a/lib/retrofit/retrofit_api.g.dart b/lib/retrofit/retrofit_api.g.dart index c5912d65..284605e2 100644 --- a/lib/retrofit/retrofit_api.g.dart +++ b/lib/retrofit/retrofit_api.g.dart @@ -99,13 +99,14 @@ class _ApiService implements ApiService { } @override - Future> sendVerify(mobile) async { + Future> sendVerify(areaCode,mobile) async { ArgumentError.checkNotNull(mobile, 'mobile'); + ArgumentError.checkNotNull(areaCode, 'areaCode'); const _extra = {}; final queryParameters = {}; final _data = {}; final _result = await _dio.request>( - '/auth/sendVerify/$mobile', + '/auth/sendVerify/$areaCode/$mobile', queryParameters: queryParameters, options: RequestOptions( method: 'GET', @@ -2045,4 +2046,26 @@ class _ApiService implements ApiService { ); return value; } + + @override + Future> verifyByUpdatePayPwd(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>('/member/verifyByUpdatePayPwd', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => json as dynamic, + ); + return value; + } } diff --git a/lib/setting/help_feedback_page.dart b/lib/setting/help_feedback_page.dart index 62128a1e..07f7b88b 100644 --- a/lib/setting/help_feedback_page.dart +++ b/lib/setting/help_feedback_page.dart @@ -149,12 +149,16 @@ class _HelpFeedbackPage extends State { child: Container( height: 54.h, alignment: Alignment.center, - color: Color(0xFF32A060), + margin:EdgeInsets.symmetric(horizontal: 16.w,vertical:25.h), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(45), + ), child: RoundButton( text: S.of(context).tijiao, backgroup: Color(0xFF32A060), textColor: Colors.white, fontSize: 16.sp, + radius: 45, fontWeight: MyFontWeight.semi_bold, ), ), diff --git a/lib/setting/logout_ing.dart b/lib/setting/logout_ing.dart index 1dc39add..243f784d 100644 --- a/lib/setting/logout_ing.dart +++ b/lib/setting/logout_ing.dart @@ -38,6 +38,7 @@ class _LogoutIng extends State { var _sendCodeStatus = 0; Timer _timer; UserInfo userInfo; + String area = "+86"; @override void initState() { @@ -81,7 +82,7 @@ class _LogoutIng extends State { showLoading: true ); } - BaseData baseData = await apiService.sendVerify(mobile).catchError((onError) {}); + BaseData baseData = await apiService.sendVerify("+86",mobile).catchError((onError) {}); if (baseData != null && baseData.isSuccess) { countdown(); SmartDialog.showToast(baseData.data, @@ -150,7 +151,12 @@ class _LogoutIng extends State { background: Colors.transparent, leadingColor: Colors.black, ), - body: Stack( + body: GestureDetector( + behavior: HitTestBehavior.translucent, + onTap: () { + FocusScope.of(context).requestFocus(FocusNode()); + }, + child: Stack( children: [ Container( width: double.infinity, @@ -199,22 +205,52 @@ class _LogoutIng extends State { ), ), ), - Container( - margin: EdgeInsets.fromLTRB(0.w, 0, 20.w, 0), - alignment: Alignment.topLeft, - child: TextField( - controller: phoneController, - inputFormatters: [LengthLimitingTextInputFormatter(11)], - decoration: InputDecoration( - border: InputBorder.none, - hintText: S.of(context).qingshurushoujihao, - hintStyle: TextStyle( - fontSize: 14.sp, - fontWeight: MyFontWeight.regular, - color: Color(0xffA29E9E), - ), + Row( + children: [ + GestureDetector( + onTap: (){ + Navigator.of(context).pushNamed('/router/phone_address_page').then((value) { + if(value != null) + setState(() { + area = value; + }); + }); + }, + child: Text( + area, + style: TextStyle( + fontWeight: MyFontWeight.regular, + fontSize: 16.sp, + color: Color(0xFF1A1A1A), + ), + )), + Icon( + Icons.keyboard_arrow_right, + size: 18, + color: Color(0xFF1A1A1A), ), - ), + Expanded(child: + Container( + margin: EdgeInsets.fromLTRB(0.w, 0, 20.w, 0), + // alignment: Alignment.topLeft, + height: 30.h, + // width: MediaQuery.of(context).size.width - 100.w, + child: TextField( + controller: phoneController, + keyboardType: TextInputType.phone, + inputFormatters: [LengthLimitingTextInputFormatter(11)], + decoration: InputDecoration( + border: InputBorder.none, + hintText: S.of(context).qingshurushoujihao, + hintStyle: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xffA29E9E), + ), + ), + ), + )), + ], ), Container( height: 1.h, @@ -243,6 +279,7 @@ class _LogoutIng extends State { alignment: Alignment.topLeft, child: TextField( controller: provingController, + keyboardType: TextInputType.phone, inputFormatters: [ LengthLimitingTextInputFormatter(6) ], @@ -310,10 +347,14 @@ class _LogoutIng extends State { width: double.infinity, height: 54.h, alignment: Alignment.center, - color: (phoneController.text == "" && - provingController.text == "") - ? Color(0xFFD8D8D8) - : Color(0xFF32A060), + margin:EdgeInsets.symmetric(horizontal: 16.w,vertical:25.h), + decoration: BoxDecoration( + color: (phoneController.text == "" && + provingController.text == "") + ? Color(0xFFD8D8D8) + : Color(0xFF32A060), + borderRadius: BorderRadius.circular(45), + ), child: Text( S.of(context).querenzhuxiao, style: TextStyle( @@ -324,7 +365,7 @@ class _LogoutIng extends State { )), )) ], - ), + )), ); } diff --git a/lib/setting/logout_page.dart b/lib/setting/logout_page.dart index 00eafdec..e7e3dc94 100644 --- a/lib/setting/logout_page.dart +++ b/lib/setting/logout_page.dart @@ -183,7 +183,11 @@ class _LogoutPage extends State { width: double.infinity, height: 54.h, alignment: Alignment.center, - color: checkStatus ? Color(0xFF32A060) : Color(0xFFD8D8D8), + margin:EdgeInsets.only(left:20.w,right:20.w,bottom: 25.h), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(45), + color: checkStatus ? Color(0xFF32A060) : Color(0xFFD8D8D8), + ), child: Text( "注销", style: TextStyle( diff --git a/lib/setting/platform_code_page.dart b/lib/setting/platform_code_page.dart index a2f92eda..101e9887 100644 --- a/lib/setting/platform_code_page.dart +++ b/lib/setting/platform_code_page.dart @@ -1,3 +1,5 @@ +import 'dart:async'; + import 'package:dio/dio.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -15,6 +17,7 @@ import 'package:shared_preferences/shared_preferences.dart'; class PlatformCodePage extends StatefulWidget { final Map arguments; + PlatformCodePage({this.arguments}); @override @@ -27,22 +30,35 @@ class _PlatformCodePage extends State { ApiService apiService; int codeType = 0; UserInfo userInfo; + String inputText = ""; + Timer _timer; + int sendCodeStatus = 0; + var codeText = "重新发送"; @override void initState() { super.initState(); } + @override + void dispose() { + if (_timer != null && _timer.isActive) _timer.cancel(); + super.dispose(); + } + ///发送修改支付密码的短信验证 sendCode() async { if (apiService == null) { SharedPreferences value = await SharedPreferences.getInstance(); apiService = ApiService(Dio(), - context: context, token: value.getString("token"), showLoading: true); + context: context, + token: value.getString("token"), + showLoading: false); } BaseData baseData = await apiService.sendVerifyByUpdatePayPwd().catchError((onError) {}); if (baseData != null && baseData.isSuccess) { + countdown(); codeType = 1; SmartDialog.showToast(baseData.data, alignment: Alignment.center); } else { @@ -50,27 +66,48 @@ class _PlatformCodePage extends State { } } - ///修改支付密码 - modifyPayCode(String payCode,String code) async { + ///验证验证码 + verificationCode(String smsCode) async { if (apiService == null) { - SharedPreferences value = await SharedPreferences.getInstance(); - apiService = ApiService(Dio(), - context: context, token: value.getString("token"), showLoading: true); - } - BaseData baseData = await apiService.updatePayPwd({ - "newPayPwd": payCode, - "smsCode": code, + SharedPreferences value = await SharedPreferences.getInstance(); + apiService = ApiService(Dio(), + context: context, token: value.getString("token"), showLoading: false); + } + BaseData baseData = await apiService.verifyByUpdatePayPwd({ + "smsCode": smsCode, }).catchError((error) {}); if (baseData != null && baseData.isSuccess) { - setState(() { - codeType=4; - }); - SmartDialog.showToast(baseData.data, alignment: Alignment.center); + Navigator.of(context).popAndPushNamed( + '/router/platform_pay_code', + arguments: { + "inputText": inputText, + }); + SmartDialog.showToast(baseData.data ?? false, alignment: Alignment.center); } else { SmartDialog.showToast(baseData.msg, alignment: Alignment.center); } } + countdown() { + if (_timer != null && _timer.isActive) return; + int countdown = 60; + _timer = Timer.periodic(Duration(seconds: 1), (timer) { + countdown--; + if (countdown == 0) { + codeText = "重新发送"; + sendCodeStatus = 0; + _timer.cancel(); + } else { + codeText = S.of(context).resend_in_seconds(countdown); + } + refresh(); + }); + } + + void refresh() { + setState(() {}); + } + @override Widget build(BuildContext context) { return GestureDetector( @@ -79,6 +116,7 @@ class _PlatformCodePage extends State { FocusScope.of(context).requestFocus(FocusNode()); }, child: Scaffold( + resizeToAvoidBottomInset: false, appBar: AppBar( backgroundColor: Colors.white, leading: GestureDetector( @@ -102,168 +140,13 @@ class _PlatformCodePage extends State { ), body: Column( children: [ - if(codeType == 0) - verification(), - if(codeType ==1) - verificationIssued(), - if(codeType == 2 || codeType ==3) - settingCode(), - // if(codeType == 3) - // againSettingCode(), - if(codeType == 4) - codeSuccess(), + if (codeType == 0) verification(), + if (codeType == 1) verificationIssued(), ], ), )); } - ///设置密码 - Widget settingCode() { - return Container( - alignment: Alignment.center, - margin: EdgeInsets.only(top: 28.h), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Text( - codeType== 3?"请再次输入6位数字密码":"请输入6位数字密码", - style: TextStyle( - fontWeight: MyFontWeight.semi_bold, - fontSize: 18.sp, - color: Color(0xFF353535), - ), - ), - SizedBox( - height: 12.h, - ), - Text( - "将用于一心回乡APP下单时平台余额消费", - style: TextStyle( - fontWeight: MyFontWeight.medium, - fontSize: 14.sp, - color: Color(0xFFA29E9E), - ), - ), - Container( - margin: EdgeInsets.only(top: 24.h, bottom: 31.h), - padding: EdgeInsets.only(left: 48.w, right: 48.w), - height: 45.h, - child: PinInputTextField( - decoration: BoxLooseDecoration( - strokeColorBuilder: FixedColorBuilder(Color(0xFFEBEAEA)), - textStyle: TextStyle( - fontWeight: MyFontWeight.medium, - fontSize: 18.sp, - color: Color(0xFF353535), - ), - radius: Radius.circular(4.r)), - ), - ), - GestureDetector( - onTap: (){ - setState(() { - codeType = 3; - if(codeType == 3) - modifyPayCode("123656", "5394"); - }); - }, - child: Container( - width: 163.w, - height: 46.h, - alignment: Alignment.center, - decoration: BoxDecoration( - color: Color(0xFFBBE7CC), - borderRadius: BorderRadius.circular(23.r), - ), - child: Text( - codeType== 3?"确认":"下一步", - style: TextStyle( - fontWeight: MyFontWeight.semi_bold, - fontSize: 18.sp, - color: Color(0xFFFFFFFF), - ), - ), - ), - ) - ], - ), - ); - } - - ///再次输入密码 - Widget againSettingCode() { - return Container( - alignment: Alignment.center, - margin: EdgeInsets.only(top: 28.h), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Text( - "请再次输入6位数字密码", - style: TextStyle( - fontWeight: MyFontWeight.semi_bold, - fontSize: 18.sp, - color: Color(0xFF353535), - ), - ), - SizedBox( - height: 12.h, - ), - Text( - "将用于一心回乡APP下单时平台余额消费", - style: TextStyle( - fontWeight: MyFontWeight.medium, - fontSize: 14.sp, - color: Color(0xFFA29E9E), - ), - ), - Container( - margin: EdgeInsets.only(top: 24.h, bottom: 31.h), - padding: EdgeInsets.only(left: 48.w, right: 48.w), - height: 45.h, - child: PinInputTextField( - decoration: BoxLooseDecoration( - strokeColorBuilder: FixedColorBuilder(Color(0xFFEBEAEA)), - textStyle: TextStyle( - fontWeight: MyFontWeight.medium, - fontSize: 18.sp, - color: Color(0xFF353535), - ), - radius: Radius.circular(4.r)), - keyboardType: TextInputType.text, - ), - ), - GestureDetector( - onTap: (){ - setState(() { - codeType = 4; - }); - }, - child: Container( - width: 163.w, - height: 46.h, - alignment: Alignment.center, - decoration: BoxDecoration( - color: Color(0xFFBBE7CC), - borderRadius: BorderRadius.circular(23.r), - ), - child: Text( - "确认", - style: TextStyle( - fontWeight: MyFontWeight.semi_bold, - fontSize: 18.sp, - color: Color(0xFFFFFFFF), - ), - ), - ), - ) - ], - ), - ); - } - ///忘记密码-验证 Widget verification() { return Container( @@ -296,7 +179,7 @@ class _PlatformCodePage extends State { height: 14.h, ), Text( - AppUtils.phoneEncode(widget.arguments["userInfo"]?.phone ?? ""), + AppUtils.phoneEncode(widget.arguments["userInfo"]?.phone ?? ""), style: TextStyle( fontWeight: MyFontWeight.medium, fontSize: 14.sp, @@ -305,9 +188,8 @@ class _PlatformCodePage extends State { ), GestureDetector( onTap: () { - // sendCode(); setState(() { - codeType = 1; + sendCode(); }); }, child: Container( @@ -344,7 +226,7 @@ class _PlatformCodePage extends State { crossAxisAlignment: CrossAxisAlignment.center, children: [ Text( - "验证码已发至 176****998", + "验证码已发至 ${AppUtils.phoneEncode(widget.arguments["userInfo"]?.phone ?? "")}", style: TextStyle( fontWeight: MyFontWeight.semi_bold, fontSize: 18.sp, @@ -354,23 +236,34 @@ class _PlatformCodePage extends State { SizedBox( height: 14.h, ), - Text( - "55S后可重发", - style: TextStyle( - fontWeight: MyFontWeight.semi_bold, - fontSize: 14.sp, - color: Color(0xFFA29E9E), + GestureDetector( + onTap: () { + sendCode(); + }, + child: Text( + codeText, + style: TextStyle( + fontWeight: MyFontWeight.semi_bold, + fontSize: 14.sp, + color: Color(0xFF32A060), + ), ), ), SizedBox( height: 14.h, ), Container( - margin: EdgeInsets.only(top: 24.h, bottom: 31.h), - padding: EdgeInsets.only(left: 48.w, right: 48.w), + margin: EdgeInsets.only(top: 24.h, bottom: 31.h,right: 48.w,left: 48.w), + // padding: EdgeInsets.only(left: 48.w, right: 48.w), height: 55.h, child: PinInputTextField( pinLength: 4, + onChanged: (txt) { + print(txt); + setState(() { + inputText = txt; + }); + }, decoration: BoxLooseDecoration( strokeColorBuilder: FixedColorBuilder(Color(0xFFEBEAEA)), textStyle: TextStyle( @@ -385,7 +278,12 @@ class _PlatformCodePage extends State { GestureDetector( onTap: () { setState(() { - codeType = 2; + if (inputText.length == 4) { + verificationCode(inputText); + } else { + SmartDialog.showToast("请输入验证码", + alignment: Alignment.center); + } }); }, child: Container( @@ -393,7 +291,9 @@ class _PlatformCodePage extends State { height: 46.h, alignment: Alignment.center, decoration: BoxDecoration( - color: Color(0xFFBBE7CC), + color: inputText.length == 4 + ? Color(0xFF32A060) + : Color(0xFFBBE7CC), borderRadius: BorderRadius.circular(23.r), ), child: Text( @@ -409,73 +309,4 @@ class _PlatformCodePage extends State { ), ); } - - ///设置密码成功状态 - Widget codeSuccess() { - return Container( - alignment: Alignment.center, - margin: EdgeInsets.only(top: 31.h), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Image.asset( - "assets/image/icon_order_success.webp", - fit: BoxFit.cover, - width: 76, - height: 76, - ), - SizedBox( - height: 16.h, - ), - Text( - "设置密码成功", - style: TextStyle( - fontWeight: MyFontWeight.semi_bold, - fontSize: 21.sp, - color: Color(0xFF353535), - ), - ), - SizedBox( - height: 69.h, - ), - GestureDetector( - onTap: () { - Navigator.of(context).pop(); - }, - child: Container( - width: double.infinity, - height: 46.h, - alignment: Alignment.center, - decoration: BoxDecoration( - color: Color(0xFF32A060), - borderRadius: BorderRadius.circular(4.r), - ), - margin: EdgeInsets.symmetric(horizontal: 16.w), - child: Text( - S.of(context).queren, - style: TextStyle( - fontWeight: MyFontWeight.semi_bold, - fontSize: 18.sp, - color: Color(0xFFFFFFFF), - ), - ), - ), - ) - ], - ), - ); - } - - ///平台支付密码弹窗 - assessShowBottomSheet() { - showModalBottomSheet( - context: context, - backgroundColor: Colors.transparent, - isScrollControlled: true, - builder: (context) { - return PaySelectedDialog(); - }, - ); - } } diff --git a/lib/setting/platform_pay_code.dart b/lib/setting/platform_pay_code.dart new file mode 100644 index 00000000..ab3ce56b --- /dev/null +++ b/lib/setting/platform_pay_code.dart @@ -0,0 +1,156 @@ +import 'package:dio/dio.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; +import 'package:huixiang/generated/l10n.dart'; +import 'package:huixiang/retrofit/data/base_data.dart'; +import 'package:huixiang/retrofit/data/user_info.dart'; +import 'package:huixiang/retrofit/retrofit_api.dart'; +import 'package:huixiang/utils/flutter_utils.dart'; +import 'package:huixiang/utils/font_weight.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:huixiang/view_widget/pay_selected_dialog.dart'; +import 'package:pin_input_text_field/pin_input_text_field.dart'; +import 'package:shared_preferences/shared_preferences.dart'; + +class PlatformPayCode extends StatefulWidget { + final Map arguments; + PlatformPayCode({this.arguments}); + + @override + State createState() { + return _PlatformPayCode(); + } +} + +class _PlatformPayCode extends State { + String inputCode = ""; + + @override + void initState() { + super.initState(); + } + + @override + Widget build(BuildContext context) { + return GestureDetector( + behavior: HitTestBehavior.translucent, + onTap: () { + FocusScope.of(context).requestFocus(FocusNode()); + }, + child: Scaffold( + appBar: AppBar( + backgroundColor: Colors.white, + leading: GestureDetector( + child: Icon( + Icons.arrow_back_ios, + color: Colors.black, + ), + onTap: () { + Navigator.of(context).pop(); + }), + title: Text( + S.of(context).pingtaizhifumima, + style: TextStyle( + fontWeight: MyFontWeight.regular, + fontSize: 17.sp, + color: Color(0xFF0D0D0D), + ), + ), + centerTitle: true, + elevation: 0.0, + ), + body: Column( + children: [ + settingCode(), + ], + ), + )); + } + + ///设置密码 + Widget settingCode(){ + return Container( + alignment: Alignment.center, + margin: EdgeInsets.only(top: 28.h), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + "请输入6位数字密码", + style: TextStyle( + fontWeight: MyFontWeight.semi_bold, + fontSize: 18.sp, + color: Color(0xFF353535), + ), + ), + SizedBox( + height: 12.h, + ), + Text( + "将用于一心回乡APP下单时平台余额消费", + style: TextStyle( + fontWeight: MyFontWeight.medium, + fontSize: 14.sp, + color: Color(0xFFA29E9E), + ), + ), + Container( + margin: EdgeInsets.only(top: 24.h, bottom: 31.h), + padding: EdgeInsets.only(left: 48.w, right: 48.w), + height: 45.h, + child: PinInputTextField( + onChanged: (txtCode){ + print(txtCode); + setState(() { + inputCode = txtCode; + }); + }, + decoration: BoxLooseDecoration( + strokeColorBuilder: FixedColorBuilder(Color(0xFFEBEAEA)), + textStyle: TextStyle( + fontWeight: MyFontWeight.medium, + fontSize: 18.sp, + color: Color(0xFF353535), + ), + radius: Radius.circular(4.r)), + ), + ), + GestureDetector( + onTap: (){ + setState(() { + if(inputCode.length == 6){ + Navigator.of(context).popAndPushNamed('/router/platform_pay_code_success',arguments:{ + "inputCode":inputCode, + "inputText":widget.arguments["inputText"] + }); + }else{ + SmartDialog.showToast("请输入6位数字密码", alignment: Alignment.center); + } + }); + }, + child: Container( + width: 163.w, + height: 46.h, + alignment: Alignment.center, + decoration: BoxDecoration( + color: inputCode.length == 6 ? Color(0xFF32A060):Color(0xFFBBE7CC), + borderRadius: BorderRadius.circular(23.r), + ), + child: Text( + "下一步", + style: TextStyle( + fontWeight: MyFontWeight.semi_bold, + fontSize: 18.sp, + color: Color(0xFFFFFFFF), + ), + ), + ), + ) + ], + ), + ); + } + +} diff --git a/lib/setting/platform_pay_code_success.dart b/lib/setting/platform_pay_code_success.dart new file mode 100644 index 00000000..df75d7f4 --- /dev/null +++ b/lib/setting/platform_pay_code_success.dart @@ -0,0 +1,255 @@ +import 'package:dio/dio.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; +import 'package:huixiang/generated/l10n.dart'; +import 'package:huixiang/retrofit/data/base_data.dart'; +import 'package:huixiang/retrofit/data/user_info.dart'; +import 'package:huixiang/retrofit/retrofit_api.dart'; +import 'package:huixiang/utils/flutter_utils.dart'; +import 'package:huixiang/utils/font_weight.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:huixiang/view_widget/pay_selected_dialog.dart'; +import 'package:pin_input_text_field/pin_input_text_field.dart'; +import 'package:shared_preferences/shared_preferences.dart'; + +class PlatformPayCodeSuccess extends StatefulWidget { + final Map arguments; + PlatformPayCodeSuccess({this.arguments}); + + @override + State createState() { + return _PlatformPayCodeSuccess(); + } +} + +class _PlatformPayCodeSuccess extends State { + ApiService apiService; + int codeType = 0; + UserInfo userInfo; + String againInputCode = ""; + + @override + void initState() { + super.initState(); + } + + ///修改支付密码 + modifyPayCode(String payCode,String code) async { + if (apiService == null) { + SharedPreferences value = await SharedPreferences.getInstance(); + apiService = ApiService(Dio(), + context: context, token: value.getString("token"), showLoading: false); + } + BaseData baseData = await apiService.updatePayPwd({ + "newPayPwd": payCode, + "smsCode": code, + }).catchError((error) {}); + if (baseData != null && baseData.isSuccess) { + setState(() { + codeType=4; + }); + SmartDialog.showToast(baseData.data ?? false, alignment: Alignment.center); + } else { + setState(() { + codeType = 5; + }); + SmartDialog.showToast(baseData.msg, alignment: Alignment.center); + } + } + + @override + Widget build(BuildContext context) { + return GestureDetector( + behavior: HitTestBehavior.translucent, + onTap: () { + FocusScope.of(context).requestFocus(FocusNode()); + }, + child: Scaffold( + appBar: AppBar( + backgroundColor: Colors.white, + leading: GestureDetector( + child: Icon( + Icons.arrow_back_ios, + color: Colors.black, + ), + onTap: () { + Navigator.of(context).pop(); + }), + title: Text( + S.of(context).pingtaizhifumima, + style: TextStyle( + fontWeight: MyFontWeight.regular, + fontSize: 17.sp, + color: Color(0xFF0D0D0D), + ), + ), + centerTitle: true, + elevation: 0.0, + ), + body: Column( + children: [ + if(codeType!=4 && codeType != 5) + againSettingCode(), + if(codeType == 4 || codeType == 5) + codeSuccess(), + ], + ), + )); + } + + ///再次输入密码 + Widget againSettingCode() { + return Container( + alignment: Alignment.center, + margin: EdgeInsets.only(top: 28.h), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + "请再次输入6位数字密码", + style: TextStyle( + fontWeight: MyFontWeight.semi_bold, + fontSize: 18.sp, + color: Color(0xFF353535), + ), + ), + SizedBox( + height: 12.h, + ), + Text( + "将用于一心回乡APP下单时平台余额消费", + style: TextStyle( + fontWeight: MyFontWeight.medium, + fontSize: 14.sp, + color: Color(0xFFA29E9E), + ), + ), + Container( + margin: EdgeInsets.only(top: 24.h, bottom: 31.h), + padding: EdgeInsets.only(left: 48.w, right: 48.w), + height: 45.h, + child: PinInputTextField( + onChanged: (txtCode){ + print(txtCode); + setState(() { + againInputCode = txtCode; + }); + }, + decoration: BoxLooseDecoration( + strokeColorBuilder: FixedColorBuilder(Color(0xFFEBEAEA)), + textStyle: TextStyle( + fontWeight: MyFontWeight.medium, + fontSize: 18.sp, + color: Color(0xFF353535), + ), + radius: Radius.circular(4.r)), + ), + ), + GestureDetector( + onTap: (){ + setState(() { + if(againInputCode.length == 6 && (widget.arguments["inputCode"] == againInputCode)){ + modifyPayCode(againInputCode,widget.arguments["inputText"]); + }else{ + if(widget.arguments["inputCode"] != againInputCode){ + SmartDialog.showToast("请输入与上次一致的6位数字密码", alignment: Alignment.center); + }else{ + SmartDialog.showToast("请再次输入6位数字密码", alignment: Alignment.center); + } + } + }); + }, + child: Container( + width: 163.w, + height: 46.h, + alignment: Alignment.center, + decoration: BoxDecoration( + color: againInputCode.length == 6 ? Color(0xFF32A060):Color(0xFFBBE7CC), + borderRadius: BorderRadius.circular(23.r), + ), + child: Text( + "确认", + style: TextStyle( + fontWeight: MyFontWeight.semi_bold, + fontSize: 18.sp, + color: Color(0xFFFFFFFF), + ), + ), + ), + ) + ], + ), + ); + } + + ///设置密码成功状态 + Widget codeSuccess() { + return Container( + alignment: Alignment.center, + margin: EdgeInsets.only(top: 31.h), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Image.asset( + codeType == 5 ? "assets/image/lose.webp":"assets/image/icon_order_success.webp", + fit: BoxFit.cover, + width: 76, + height: 76, + ), + SizedBox( + height: 16.h, + ), + Text( + codeType == 5 ? "设置密码失败":"设置密码成功", + style: TextStyle( + fontWeight: MyFontWeight.semi_bold, + fontSize: 21.sp, + color: Color(0xFF353535), + ), + ), + SizedBox( + height: 69.h, + ), + GestureDetector( + onTap: () { + Navigator.of(context).pop(); + }, + child: Container( + width: double.infinity, + height: 46.h, + alignment: Alignment.center, + decoration: BoxDecoration( + color: Color(0xFF32A060), + borderRadius: BorderRadius.circular(4.r), + ), + margin: EdgeInsets.symmetric(horizontal: 16.w), + child: Text( + S.of(context).queren, + style: TextStyle( + fontWeight: MyFontWeight.semi_bold, + fontSize: 18.sp, + color: Color(0xFFFFFFFF), + ), + ), + ), + ) + ], + ), + ); + } + + ///平台支付密码弹窗 + assessShowBottomSheet() { + showModalBottomSheet( + context: context, + backgroundColor: Colors.transparent, + isScrollControlled: true, + builder: (context) { + return PaySelectedDialog(); + }, + ); + } +} diff --git a/lib/setting/setting_page.dart b/lib/setting/setting_page.dart index 68a308bf..9c411e4d 100644 --- a/lib/setting/setting_page.dart +++ b/lib/setting/setting_page.dart @@ -47,6 +47,7 @@ class _SettingPage extends State { @override Widget build(BuildContext context) { return Scaffold( + resizeToAvoidBottomInset: false, appBar: AppBar( backgroundColor: Colors.white, leading: GestureDetector( @@ -97,12 +98,12 @@ class _SettingPage extends State { SizedBox( height: 16.h, ), - // GestureDetector( - // child: settingSingleItem(S.of(context).zhanghaoyuanquan), - // onTap: () { - // Navigator.of(context).pushNamed('/router/account_security_page'); - // }, - // ), + GestureDetector( + child: settingSingleItem(S.of(context).zhanghaoyuanquan), + onTap: () { + Navigator.of(context).pushNamed('/router/account_security_page'); + }, + ), SizedBox( height: 16.h, ), @@ -199,12 +200,16 @@ class _SettingPage extends State { child: Container( height: 54.h, alignment: Alignment.center, - color: Color(0xFF32A060), + margin:EdgeInsets.symmetric(horizontal: 16.w,vertical:25.h), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(45), + ), child: RoundButton( text: S.of(context).tuichudenglu, backgroup: Color(0xFF32A060), textColor: Colors.white, fontSize: 16.sp, + radius:45, fontWeight: MyFontWeight.semi_bold, ), ), diff --git a/lib/store/shop__details_page.dart b/lib/store/shop__details_page.dart index 6c86b6c4..9120e6c5 100644 --- a/lib/store/shop__details_page.dart +++ b/lib/store/shop__details_page.dart @@ -702,6 +702,7 @@ class _ShopDetailsPage extends State { ), ], ), + SizedBox(height: 30.h,) ], ), ), diff --git a/lib/store/store_order.dart b/lib/store/store_order.dart index 5da2e79d..0f7a4f8c 100644 --- a/lib/store/store_order.dart +++ b/lib/store/store_order.dart @@ -207,7 +207,17 @@ class _StoreOrderPage extends State @override Widget build(BuildContext context) { - return Container( + return WillPopScope( + onWillPop: () async { + if (dialogShowing) { + debugPrint("ssssasdadsasdadasd"); + SmartDialog.dismiss(); + return false; + } else { + return true; + } + }, + child:Container( color: Colors.white, child: Stack( children: [ @@ -540,7 +550,7 @@ class _StoreOrderPage extends State ), ), ], - )); + ))); } ///领取优惠券 diff --git a/lib/view_widget/receive_success.dart b/lib/view_widget/receive_success.dart index e35269f2..58667012 100644 --- a/lib/view_widget/receive_success.dart +++ b/lib/view_widget/receive_success.dart @@ -1,9 +1,9 @@ import 'package:flutter/material.dart'; import 'package:huixiang/generated/l10n.dart'; +import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/view_widget/round_button.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; - class ReceiveSuccess extends StatelessWidget { @override Widget build(BuildContext context) { @@ -22,17 +22,28 @@ class ReceiveSuccess extends StatelessWidget { margin: EdgeInsets.only(top: 40.h), decoration: BoxDecoration( color: Colors.white, - borderRadius: BorderRadius.circular(8),), - width: 218.w, - height: 250.h, + borderRadius: BorderRadius.circular(8), + image: DecorationImage( + fit: BoxFit.fill, + image: AssetImage("assets/image/pop_background.webp"), + ), + ), + width: 269.w, + height: 300.h, + padding: EdgeInsets.only(bottom: 13.h), child: Column( children: [ + SizedBox(height: 8.h,), + Image.asset( + "assets/image/icon_order_success.webp", + fit: BoxFit.cover, + width: 56, + height: 56, + ), Padding( - padding: EdgeInsets.only(top: 50.h, bottom: 19.h), + padding: EdgeInsets.only(top:7.h, bottom: 19.h), child: Text( - S - .of(context) - .lingquchenggong, + S.of(context).lingquchenggong, style: TextStyle( color: Color(0xff353535), fontSize: 16.sp, @@ -47,6 +58,7 @@ class ReceiveSuccess extends StatelessWidget { fontSize: 14.sp, ), ), + SizedBox(height:8.h,), Row( mainAxisAlignment: MainAxisAlignment.center, children: [ @@ -59,9 +71,7 @@ class ReceiveSuccess extends StatelessWidget { ), GestureDetector( child: Text( - "${S - .of(context) - .youhuiquan}", + "${S.of(context).youhuiquan}", style: TextStyle( color: Color(0xFFFF7A1A), fontSize: 14.sp, @@ -69,13 +79,12 @@ class ReceiveSuccess extends StatelessWidget { ), ), onTap: () { - Navigator.of(context).pushNamed('/router/coupon_page'); + Navigator.of(context) + .pushNamed('/router/coupon_page'); }, ), Text( - S - .of(context) - .zhongchakan, + S.of(context).zhongchakan, style: TextStyle( color: Color(0xff353535), fontSize: 14.sp, @@ -83,42 +92,32 @@ class ReceiveSuccess extends StatelessWidget { ), ], ), - Padding( - padding: EdgeInsets.only(top: 30.h), - child: RoundButton( - width: 130.w, - height: 34.h, - text: S - .of(context) - .queren, - textColor: Colors.white, - fontSize: 12.sp, - callback: () { - Navigator.of(context).pop(); - }, - padding: EdgeInsets.only( - top: 2.h, - bottom: 2.h, - left: 8.w, - right: 8.w, - ), - backgroup: Color(0xff32A060), - ), - ) + Spacer(), + RoundButton( + width: 229.w, + height: 34.h, + text: S.of(context).queren, + textColor: Color(0xFF188451), + fontWeight: MyFontWeight.medium, + fontSize: 16.sp, + radius: 17.w, + callback: () { + Navigator.of(context).pop(); + }, + backgroup: Color(0xFFFFFFFF), + ), ], ), ), - Image.asset( - "assets/image/icon_order_success.webp", - fit: BoxFit.cover, - width: 80, - height: 80, - ), + // Image.asset( + // "assets/image/icon_order_success.webp", + // fit: BoxFit.cover, + // width: 80, + // height: 80, + // ), ], ) ], ); } - - -} \ No newline at end of file +} diff --git a/lib/view_widget/sign_in_widget.dart b/lib/view_widget/sign_in_widget.dart index a8747388..62bf4eb0 100644 --- a/lib/view_widget/sign_in_widget.dart +++ b/lib/view_widget/sign_in_widget.dart @@ -24,8 +24,8 @@ class _SignInWidget extends State { @override Widget build(BuildContext context) { return Container( - width: 222.w, - height:320.h * AppUtils.textScale(context), + width: 269.w, + height:370.h * AppUtils.textScale(context), child: Stack( children: [ Positioned( @@ -39,12 +39,16 @@ class _SignInWidget extends State { decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(8.w), + image: DecorationImage( + fit: BoxFit.fill, + image: AssetImage("assets/image/pop_background.webp"), + ), ), - padding: EdgeInsets.only(top:20.h), + // padding: EdgeInsets.only(top:8.h), child: Container( - padding: EdgeInsets.symmetric(vertical: 10.h), + padding: EdgeInsets.symmetric(vertical: 13.h), child: Column( - mainAxisAlignment: MainAxisAlignment.spaceAround, + mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.center, children: [ Image.asset( @@ -52,61 +56,41 @@ class _SignInWidget extends State { width: 80, height: 80, ), - Text( + Padding(padding:EdgeInsets.only(top:8.h,bottom:12.h), + child: Text( S.of(context).qiandaowancheng, style: TextStyle( color: Color(0xFF353535), fontSize: 16.sp, fontWeight: MyFontWeight.medium, ), - ), - Text( - S.of(context).ninyilianxuqiandaotian(widget.day), + ),), + Padding(padding:EdgeInsets.only(bottom:12.h), + child: Text( + S.of(context).ninyilianxuqiandaotian(widget.day), + style: TextStyle( + color: Color(0xFF353535), + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + ), + ),), + Expanded(child: Text( + S.of(context).jiajifen(widget.integral), style: TextStyle( - color: Color(0xFF353535), - fontSize: 14.sp, - fontWeight: MyFontWeight.regular, + color: Color(0xFFFF7A1A), + fontSize: 15.sp, + fontWeight: MyFontWeight.semi_bold, ), - ), - Row( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Image.asset( - "assets/image/icon_gold_coin.webp", - width: 16, - height: 16, - ), - SizedBox( - width: 4.h, - ), - Text( - S.of(context).jiajifen(widget.integral), - style: TextStyle( - color: Color(0xFFEE9905), - fontSize: 14.sp, - fontWeight: MyFontWeight.semi_bold, - ), - ), - ], - ), - // Text( - // S.of(context).jiajifen(widget.integral), - // style: TextStyle( - // color: Color(0xFFFF7A1A), - // fontSize: 14.sp, - // fontWeight: MyFontWeight.semi_bold, - // ), - // ), + )), RoundButton( text: S.of(context).queren, - textColor: Colors.white, - width: 130.w, - padding: EdgeInsets.symmetric(vertical: 6.h), + textColor: Color(0xFF188451), + width:220.w, + padding: EdgeInsets.symmetric(vertical:8.h), fontSize: 16.sp, fontWeight: MyFontWeight.semi_bold, - backgroup: Color(0xFF32A060), - radius: 4.w, + backgroup: Color(0xFFFFFFFF), + radius: 17.w, callback: () { SmartDialog.dismiss(); }, diff --git a/pubspec.yaml b/pubspec.yaml index 5f383d3b..e29f45e9 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -3,7 +3,7 @@ description: 一心回乡. publish_to: 'none' # Remove this line if you wish to publish to pub.dev -version: 2.0.25+13 +version: 2.0.26+14 environment: sdk: ">=2.7.0 <3.0.0"