# Conflicts:
#	lib/providers/user_provider.dart
#	lib/ui/home/call.dart
#	lib/ui/loading.dart
master
王亚玲 2 years ago
commit 991a01c6f8

@ -10,7 +10,6 @@ class API {
return 'http://api.dxbs.vip';
} else {
// return 'http://10.0.2.2:8088/';
return 'http://api.dxbs.vip/';
}
}
@ -48,6 +47,8 @@ class _App {
String get delete => '/app/user/content/delete';
///
String get checked => '/app/user/content/checked';
///
String get find => '/app/user/content/find';
///VIP
String get updateVip => '/app/user/updateVip';
}

@ -76,7 +76,7 @@ class _MyAppState extends State<MyApp> {
// final service = FlutterBackgroundService();
_Getpermission();
registerWxApi(
appId: "wxd930ea5d5a228f5f",
appId: "wx3a0b41d12afef4e2",
// universalLink:"http://api.dxbs.vip/ "
);
}

@ -16,6 +16,10 @@ class UserProvider extends ChangeNotifier {
late UserInfoModel _userInfo;
UserInfoModel get userInfo => _userInfo;
late String _contentCon;
String get contentCon=>_contentCon;
late String _contentRef;
String get contentRef=>_contentRef;
Future<bool> init() async {
if (HiveStore.appBox?.containsKey('token') ?? false) {
@ -42,6 +46,8 @@ Future setKg(bool lockage) async{
_isLogin = true;
//app
await updateUserInfo();
await updateConSms();
await updateRefSms();
}
Future logout() async {
@ -61,4 +67,23 @@ Future setKg(bool lockage) async{
notifyListeners();
}
Future updateConSms() async {
var base = await apiClient.request(API.app.find,data: {'status': 1});
if (base.code == 0) {
_contentCon = base.data['content'];
} else {
CloudToast.show(base.msg);
}
notifyListeners();
}
Future updateRefSms() async {
var base = await apiClient.request(API.app.find,data: {'status': 2});
if (base.code == 0) {
_contentRef = base.data['content'];
} else {
CloudToast.show(base.msg);
}
notifyListeners();
}
}

@ -62,6 +62,7 @@ void onStart(ServiceInstance service ) async {
Timer.periodic(const Duration(seconds: 1), (timer) async {
CallState state = await Telephony.instance.callState;
callState = state.name;
// bool? kg=prefs.getBool("kg");
// print("这是数据$kg");
// kg= await HiveStore.appBox!.get("kg");

@ -111,6 +111,7 @@ class _ContentConnectPageState extends State<ContentConnectPage> {
if (res.code == 0) {
setState(() {});
UserTool.userProvider.updateUserInfo();
UserTool.userProvider.updateConSms();
_easyRefreshController.callRefresh();
} else {
CloudToast.show(res.msg);

@ -112,6 +112,7 @@ class _ContentRefusePageState extends State<ContentRefusePage> {
if (res.code == 0) {
setState(() {});
userProvider.updateUserInfo();
userProvider.updateRefSms();
_easyRefreshController.callRefresh();
} else {
CloudToast.show(res.msg);

@ -36,17 +36,14 @@ class _LoadingState extends State<Loading> {
Future.delayed(const Duration(milliseconds: 1000), () async {
await initialAll();
if (!await userProvider.init()) {
await Get.offAll(() => const LoginPage());
await Get.offAll(() => const TabNavigator());
// await Get.offAll(() => const LoginPage());
} else {
Navigator.of(context).pushReplacementNamed("/TabNavigator");
// await Get.offAll(() => const TabNavigator());
}
});
// Future.delayed(const Duration(seconds: 3),(){
// //3
// Navigator.of(context).pushReplacementNamed("/TabNavigator");
// });
}
@override

@ -36,11 +36,7 @@ class SortWidget extends StatelessWidget {
required this.childAspectRatio,
this.haveButton = false,
required this.pickItem});
// @override
// void initState() {
// super.initState();
// }
@override
Widget build(BuildContext context) {

Loading…
Cancel
Save