From b61d416d9f87eecd23adcb4540410f6f69740bfa Mon Sep 17 00:00:00 2001 From: wurong <953969641@qq.com> Date: Fri, 28 Apr 2023 18:14:51 +0800 Subject: [PATCH] =?UTF-8?q?=E7=99=BB=E5=BD=95=E9=A1=B5=E9=82=80=E8=AF=B7?= =?UTF-8?q?=E6=9D=A5=E6=BA=90=E6=A0=B9=E6=8D=AE=E6=8E=A5=E5=8F=A3=E5=BC=80?= =?UTF-8?q?=E5=85=B3=E6=98=BE=E7=A4=BA=E9=9A=90=E8=97=8F=EF=BC=9B=20?= =?UTF-8?q?=E5=9B=9E=E4=B9=A1VIP=E5=A5=97=E9=A4=90=E6=9D=BF=E5=9D=97?= =?UTF-8?q?=EF=BC=8C=E5=A6=82=E6=9E=9C=E6=B2=A1=E6=9C=89=E5=A5=97=E9=A4=90?= =?UTF-8?q?=E5=88=97=E8=A1=A8=EF=BC=8C=E5=88=99=E9=9A=90=E8=97=8F=E8=AF=A5?= =?UTF-8?q?=E6=AE=B5=E6=9D=BF=E5=9D=97=EF=BC=9B=20=E5=85=85=E5=80=BC?= =?UTF-8?q?=E9=A1=B5=EF=BC=8C=E9=80=89=E6=8B=A9=E9=97=A8=E5=BA=97=E6=9D=A5?= =?UTF-8?q?=E6=BA=90=E5=BC=B9=E7=AA=97=E9=AB=98=E5=BA=A6=E6=9B=B4=E6=94=B9?= =?UTF-8?q?=EF=BC=9B=EF=BC=88=E5=8E=9F=E5=9F=BA=E7=A1=80=E5=8A=A0=E9=AB=98?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=A4=9A=E7=82=B9=E5=88=97=E8=A1=A8=E9=80=89?= =?UTF-8?q?=E6=8B=A9=EF=BC=89=20=E5=9B=9E=E4=B9=A1=E9=92=B1=E5=8C=85?= =?UTF-8?q?=EF=BC=8C=E6=B4=BB=E5=8A=A8=E4=BD=99=E9=A2=9D=E6=9B=B4=E6=94=B9?= =?UTF-8?q?=E4=B8=BA=E8=B5=A0=E9=80=81=E4=BD=99=E9=A2=9D=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/login/login_store_select.dart | 27 ++++---------------------- lib/login/new_login_page.dart | 32 ++++++++++++++++++++++++++++++- lib/mine/mine_wallet_page.dart | 4 ++-- lib/mine/recharge_page.dart | 2 +- lib/retrofit/min_api.dart | 2 +- lib/vip/vip_view/vip_top.dart | 3 ++- 6 files changed, 41 insertions(+), 29 deletions(-) diff --git a/lib/login/login_store_select.dart b/lib/login/login_store_select.dart index a16a33ca..1844ed9b 100644 --- a/lib/login/login_store_select.dart +++ b/lib/login/login_store_select.dart @@ -1,18 +1,17 @@ -import 'package:dio/dio.dart'; import 'package:flutter/material.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart'; -import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/utils/font_weight.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:huixiang/view_widget/my_appbar.dart'; import '../generated/l10n.dart'; -import '../retrofit/data/base_data.dart'; import '../retrofit/data/channels_list.dart'; import '../retrofit/retrofit_api.dart'; -import '../utils/flutter_utils.dart'; class LoginStoreSelect extends StatefulWidget { + final Map arguments; + + LoginStoreSelect({this.arguments}); @override State createState() { @@ -28,25 +27,7 @@ class _LoginStoreSelect extends State { @override void initState() { super.initState(); - EasyLoading.show(status: S.current.zhengzaijiazai); - queryChannels(); - } - - queryChannels() async{ - apiService = ApiService(Dio(), context: context); - BaseData baseData = await apiService.appChannels().catchError((error) { - print(error.message); - SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type), - alignment: Alignment.center); - }); - if (baseData != null && baseData.isSuccess) { - channelsList = baseData.data; - setState((){}); - EasyLoading.dismiss(); - } else { - if (baseData?.msg != null) - SmartDialog.showToast(baseData.msg, alignment: Alignment.center); - } + channelsList = widget.arguments["channelsList"]; } @override diff --git a/lib/login/new_login_page.dart b/lib/login/new_login_page.dart index 49073834..bd3a24c9 100644 --- a/lib/login/new_login_page.dart +++ b/lib/login/new_login_page.dart @@ -25,6 +25,7 @@ import 'package:shared_preferences/shared_preferences.dart'; import 'package:sharesdk_plugin/sharesdk_interface.dart'; import '../main.dart'; +import '../retrofit/data/channels_list.dart'; class NewLoginPage extends StatefulWidget { final Map arguments; @@ -54,11 +55,36 @@ class _NewLoginPage extends State { bool isShowLogin = false; String area = "+86"; String channelName; + ChannelsList channelsList; @override void initState() { super.initState(); isLogin(); + queryChannels(); + } + + queryChannels() async{ + SharedPreferences sharedPreferences = await SharedPreferences.getInstance(); + if (!sharedPreferences.containsKey("isShowPrivacyPolicy") || + !sharedPreferences.getBool("isShowPrivacyPolicy")) { + showAlertDialog(); + return; + } + apiService = ApiService(Dio(), context: context); + BaseData baseData = await apiService.appChannels().catchError((error) { + print(error.message); + SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type), + alignment: Alignment.center); + }); + if (baseData != null && baseData.isSuccess) { + channelsList = baseData.data; + setState((){}); + EasyLoading.dismiss(); + } else { + if (baseData?.msg != null) + SmartDialog.showToast(baseData.msg, alignment: Alignment.center); + } } initController() { @@ -596,9 +622,12 @@ class _NewLoginPage extends State { SizedBox( height: 30.h, ), + if((channelsList?.isOpen ?? false) == true) GestureDetector( onTap: (){ - Navigator.of(context).pushNamed('/router/login_store_select').then((value) => { + Navigator.of(context).pushNamed('/router/login_store_select',arguments: { + "channelsList":channelsList, + }).then((value) => { setState(() { if (value != null) channelName = value; }) @@ -911,6 +940,7 @@ class _NewLoginPage extends State { SharesdkPlugin.uploadPrivacyPermissionStatus( 1, (success) => { + queryChannels(), Navigator.of(context).pop(), }, ); diff --git a/lib/mine/mine_wallet_page.dart b/lib/mine/mine_wallet_page.dart index 11b8a568..771e404b 100644 --- a/lib/mine/mine_wallet_page.dart +++ b/lib/mine/mine_wallet_page.dart @@ -261,12 +261,12 @@ class _MineWalletPage extends State { color: Color(0x33FFFCFC), ), - ///活动余额 + ///充值活动赠送余额/活动余额 Row( children: [ Expanded( child: Text( - "活动余额", + "赠送余额", style: TextStyle( fontSize: 14.sp, fontWeight: MyFontWeight.semi_bold, diff --git a/lib/mine/recharge_page.dart b/lib/mine/recharge_page.dart index 6ec69bfb..4c51e5ca 100644 --- a/lib/mine/recharge_page.dart +++ b/lib/mine/recharge_page.dart @@ -723,7 +723,7 @@ class _RechargePage extends State { state, ) { return Container( - height: 321.h, + height: 355.h, decoration: BoxDecoration( color: Color(0xFFFAFAFA), borderRadius: BorderRadius.only( diff --git a/lib/retrofit/min_api.dart b/lib/retrofit/min_api.dart index dc0384e3..a1ad9f27 100644 --- a/lib/retrofit/min_api.dart +++ b/lib/retrofit/min_api.dart @@ -26,7 +26,7 @@ import 'data/shopping_home_config.dart'; part 'min_api.g.dart'; -const localBaseUrl = "http://192.168.10.78:8765/app/";///本地 +const localBaseUrl = "http://192.168.10.129:8765/app/";///本地 // const localBaseUrl = "https://2946-27-19-77-115.jp.ngrok.io/app/";///本地 const serviceBaseUrl = "https://pos.api.lotus-wallet.com/app/";///线上 diff --git a/lib/vip/vip_view/vip_top.dart b/lib/vip/vip_view/vip_top.dart index 41982fd1..7ec08ba6 100644 --- a/lib/vip/vip_view/vip_top.dart +++ b/lib/vip/vip_view/vip_top.dart @@ -129,11 +129,12 @@ class _VipTop extends State { child: Column( children: [ vipCard(), + if(widget?.vipCardHome?.cards?.length != 0) SizedBox( height: 15.h, ), (!(widget?.vipCardHome?.member?.isVip ?? false)) - ? vipCardList() + ? (widget?.vipCardHome?.cards?.length == 0 ? Container():vipCardList()) : Padding( padding: EdgeInsets.symmetric(horizontal: 16.w), child: Row(