Commit 1feec80ff0252f99b14a521a2f0e903d82aea87c

Authored by gaiyaguang
1 parent f4b98757

OneKey-debug-v1.0.5

... ... @@ -69,11 +69,11 @@ class MyAppState extends State<MyApp>{
await registerWxApi(
appId: "wx85aa3cdd0f791e65",
doOnAndroid: true,
doOnIOS: true,
universalLink: "https://your.univerallink.com/link/");
var result = await isWeChatInstalled;
LogUtil.v("is installed $result");
}
doOnIOS: true,
universalLink: "https://your.univerallink.com/link/");
var result = await isWeChatInstalled;
LogUtil.v("is installed $result");
}
initDio() {
DioUtil.openDebug();
... ...
... ... @@ -17,6 +17,7 @@ import 'package:one_key/provider/user_model.dart';
import 'package:one_key/res/colors.dart';
import 'package:one_key/route/navigate_service.dart';
import 'package:one_key/utils/log_util.dart';
import 'package:one_key/utils/navigator_util.dart';
import 'package:one_key/utils/utils.dart';
import 'package:provider/provider.dart';
import 'package:flutter/services.dart';
... ... @@ -71,7 +72,6 @@ class HomePageState extends State<HomePage>{
Future<void> initJPush() async {
try {
jpush.resumePush();
jpush.addEventHandler(
onReceiveNotification: (Map<String, dynamic> message) async {
LogUtil.v("flutter onReceiveNotification: $message");
... ... @@ -79,6 +79,7 @@ class HomePageState extends State<HomePage>{
Provider.of<MessageDialogModel>(context,listen: false).addMessage(context,Message.fromJson(messageMap));
}, onOpenNotification: (Map<String, dynamic> message) async {
LogUtil.v("flutter onOpenNotification: $message");
NavigatorUtil.goHomePage(context,initialIndex: 0);
}, onReceiveMessage: (Map<String, dynamic> message) async {
LogUtil.v("flutter onReceiveMessage: $message");
}, onReceiveNotificationAuthorization:
... ... @@ -102,6 +103,7 @@ class HomePageState extends State<HomePage>{
LogUtil.v("flutter get registration id : $rid");
userTokenInit(rid);
});
jpush.openSettingsForNotification();
jpush.isNotificationEnabled().then((bool value) {
if (!value) {
//没有打开通知
... ... @@ -135,7 +137,7 @@ class HomePageState extends State<HomePage>{
MessageDialogModel messageModel=Provider.of<MessageDialogModel>(context,listen: false);
messageModel.getUntreatedMsg(context, params);
}
@override
Widget build(BuildContext context) {
// TODO: implement build
... ... @@ -219,6 +221,5 @@ class HomePageState extends State<HomePage>{
// TODO: implement dispose
super.dispose();
LogUtil.v("home_dispose");
jpush.stopPush();
}
}
\ No newline at end of file
... ...
import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:jpush_flutter/jpush_flutter.dart';
import 'package:one_key/constant/constant.dart';
import 'package:one_key/models/user.dart';
import 'package:one_key/net/base_resp.dart';
... ... @@ -91,6 +92,7 @@ class UserModel with ChangeNotifier {
user['night'] = daily['night'];
_saveUserInfo(User.fromJson(user));
App.sp.setBool("isLogin", true);
new JPush().resumePush();
NavigatorUtil.goHomePage(context);
return null;
}
... ... @@ -119,6 +121,7 @@ class UserModel with ChangeNotifier {
Utils.showToast(baseResp.msg ?? "退出登录失败,请稍后重试");
} else {
App.sp.setBool("isLogin", false);
new JPush().stopPush();
NavigatorUtil.goLoginPage(context);
}
}
... ...
... ... @@ -145,12 +145,13 @@ class DialogUtil {
messageModel.showMessageDialog=false;
}
//显示消息弹框
//显示日历弹框
static Future<DateTime> showCalendarDialog(BuildContext context,DateTime selectDateTime) {
CalendarController _calendarController = CalendarController();
Map<DateTime, List> _events = {};
return showModalBottomSheet<DateTime>(
context: context,
isScrollControlled:true,
builder: (BuildContext context) {
BuildContext dialogContext = context;
Widget widget = StatefulBuilder(builder: (context, _setState) {
... ... @@ -173,6 +174,7 @@ class DialogUtil {
headerStyle: HeaderStyle(
decoration: BoxDecoration(
color: MyColours.color_2bb5b7),
headerPadding: EdgeInsets.zero,
formatButtonVisible: false,
centerHeaderTitle: true,
titleTextBuilder: (dateTime, _) {
... ... @@ -271,34 +273,40 @@ class DialogUtil {
),
),
Positioned(
bottom: ScreenUtil().setHeight(7),
right: ScreenUtil().setWidth(62),
child: GestureDetector(
onTap: () {
_calendarController.setSelectedDay(DateTime.now());
_setState(() {});
},
child: Container(
child: ClipOval(
child: Container(
width: ScreenUtil().setWidth(95),
height: ScreenUtil().setWidth(95),
alignment: Alignment.center,
color: MyColours.color_2bb5b7,
child: Text(
"回到\n今天",
style: TextStyle(
color: MyColours.color_ffffff,
fontSize: ScreenUtil().setSp(26)),
),
)),
bottom: ScreenUtil().setHeight(7),
child: Container(
child: GestureDetector(
onTap: () {
_calendarController.setSelectedDay(DateTime.now());
_setState(() {});
},
child: Container(
child: ClipOval(
child: Container(
width: ScreenUtil().setWidth(95),
height: ScreenUtil().setWidth(95),
alignment: Alignment.center,
color: MyColours.color_2bb5b7,
child: Text(
"回到\n今天",
style: TextStyle(
color: MyColours.color_ffffff,
fontSize: ScreenUtil().setSp(26)),
),
)),
),
),
),
)
],
);
});
return widget;
return SizedBox(
width: double.infinity,
height: ScreenUtil().setWidth(935),
child: widget,
);
});
}
... ...
... ... @@ -51,10 +51,10 @@ class AreaItemState extends State<AreaItem>{
height: ScreenUtil().setHeight(37),
alignment: Alignment.center,
decoration: BoxDecoration(
color: MyColours.color_63a6d1,
color: area.count<=0?MyColours.color_999999:MyColours.color_63a6d1,
borderRadius: BorderRadius.only(topRight: Radius.circular(ScreenUtil().setWidth(8)),bottomRight: Radius.circular(ScreenUtil().setWidth(8)))
),
child: Text("余${area.count}",style: TextStyle(color: MyColours.color_ffffff,fontSize: ScreenUtil().setSp(22),decoration: TextDecoration.none)),
child: Text(area.count<=0?"满座":"余${area.count}",style: TextStyle(color: MyColours.color_ffffff,fontSize: ScreenUtil().setSp(22),decoration: TextDecoration.none)),
),
),
],
... ...