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(