|
|
|
@ -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<String, dynamic> arguments; |
|
|
|
@ -54,11 +55,36 @@ class _NewLoginPage extends State<NewLoginPage> {
|
|
|
|
|
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<ChannelsList> 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<NewLoginPage> {
|
|
|
|
|
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<NewLoginPage> {
|
|
|
|
|
SharesdkPlugin.uploadPrivacyPermissionStatus( |
|
|
|
|
1, |
|
|
|
|
(success) => { |
|
|
|
|
queryChannels(), |
|
|
|
|
Navigator.of(context).pop(), |
|
|
|
|
}, |
|
|
|
|
); |
|
|
|
|