Showing
13 changed files
with
306 additions
and
173 deletions
| @@ -532,7 +532,7 @@ | @@ -532,7 +532,7 @@ | ||
| 532 | CODE_SIGN_ENTITLEMENTS = Runner/RunnerProfile.entitlements; | 532 | CODE_SIGN_ENTITLEMENTS = Runner/RunnerProfile.entitlements; |
| 533 | CODE_SIGN_IDENTITY = "Apple Development"; | 533 | CODE_SIGN_IDENTITY = "Apple Development"; |
| 534 | CODE_SIGN_STYLE = Automatic; | 534 | CODE_SIGN_STYLE = Automatic; |
| 535 | - CURRENT_PROJECT_VERSION = 5161; | 535 | + CURRENT_PROJECT_VERSION = 5181; |
| 536 | DEVELOPMENT_TEAM = 8J59HM8B82; | 536 | DEVELOPMENT_TEAM = 8J59HM8B82; |
| 537 | ENABLE_BITCODE = NO; | 537 | ENABLE_BITCODE = NO; |
| 538 | FLUTTER_BUILD_MODE = release; | 538 | FLUTTER_BUILD_MODE = release; |
| @@ -547,7 +547,7 @@ | @@ -547,7 +547,7 @@ | ||
| 547 | "$(inherited)", | 547 | "$(inherited)", |
| 548 | "$(PROJECT_DIR)/Flutter", | 548 | "$(PROJECT_DIR)/Flutter", |
| 549 | ); | 549 | ); |
| 550 | - MARKETING_VERSION = 5.1.6; | 550 | + MARKETING_VERSION = 5.1.8; |
| 551 | PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine; | 551 | PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine; |
| 552 | PRODUCT_NAME = Runner; | 552 | PRODUCT_NAME = Runner; |
| 553 | PROVISIONING_PROFILE_SPECIFIER = ""; | 553 | PROVISIONING_PROFILE_SPECIFIER = ""; |
| @@ -678,7 +678,7 @@ | @@ -678,7 +678,7 @@ | ||
| 678 | CODE_SIGN_ENTITLEMENTS = "Runner/一键订Debug.entitlements"; | 678 | CODE_SIGN_ENTITLEMENTS = "Runner/一键订Debug.entitlements"; |
| 679 | CODE_SIGN_IDENTITY = "Apple Development"; | 679 | CODE_SIGN_IDENTITY = "Apple Development"; |
| 680 | CODE_SIGN_STYLE = Automatic; | 680 | CODE_SIGN_STYLE = Automatic; |
| 681 | - CURRENT_PROJECT_VERSION = 5161; | 681 | + CURRENT_PROJECT_VERSION = 5181; |
| 682 | DEVELOPMENT_TEAM = 8J59HM8B82; | 682 | DEVELOPMENT_TEAM = 8J59HM8B82; |
| 683 | ENABLE_BITCODE = NO; | 683 | ENABLE_BITCODE = NO; |
| 684 | FLUTTER_BUILD_MODE = release; | 684 | FLUTTER_BUILD_MODE = release; |
| @@ -693,7 +693,7 @@ | @@ -693,7 +693,7 @@ | ||
| 693 | "$(inherited)", | 693 | "$(inherited)", |
| 694 | "$(PROJECT_DIR)/Flutter", | 694 | "$(PROJECT_DIR)/Flutter", |
| 695 | ); | 695 | ); |
| 696 | - MARKETING_VERSION = 5.1.6; | 696 | + MARKETING_VERSION = 5.1.8; |
| 697 | PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine; | 697 | PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine; |
| 698 | PRODUCT_NAME = Runner; | 698 | PRODUCT_NAME = Runner; |
| 699 | PROVISIONING_PROFILE_SPECIFIER = ""; | 699 | PROVISIONING_PROFILE_SPECIFIER = ""; |
| @@ -714,7 +714,7 @@ | @@ -714,7 +714,7 @@ | ||
| 714 | CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; | 714 | CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; |
| 715 | CODE_SIGN_IDENTITY = "Apple Development"; | 715 | CODE_SIGN_IDENTITY = "Apple Development"; |
| 716 | CODE_SIGN_STYLE = Automatic; | 716 | CODE_SIGN_STYLE = Automatic; |
| 717 | - CURRENT_PROJECT_VERSION = 5161; | 717 | + CURRENT_PROJECT_VERSION = 5181; |
| 718 | DEVELOPMENT_TEAM = 8J59HM8B82; | 718 | DEVELOPMENT_TEAM = 8J59HM8B82; |
| 719 | ENABLE_BITCODE = NO; | 719 | ENABLE_BITCODE = NO; |
| 720 | FLUTTER_BUILD_MODE = release; | 720 | FLUTTER_BUILD_MODE = release; |
| @@ -729,7 +729,7 @@ | @@ -729,7 +729,7 @@ | ||
| 729 | "$(inherited)", | 729 | "$(inherited)", |
| 730 | "$(PROJECT_DIR)/Flutter", | 730 | "$(PROJECT_DIR)/Flutter", |
| 731 | ); | 731 | ); |
| 732 | - MARKETING_VERSION = 5.1.6; | 732 | + MARKETING_VERSION = 5.1.8; |
| 733 | PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine; | 733 | PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine; |
| 734 | PRODUCT_NAME = Runner; | 734 | PRODUCT_NAME = Runner; |
| 735 | PROVISIONING_PROFILE_SPECIFIER = ""; | 735 | PROVISIONING_PROFILE_SPECIFIER = ""; |
| @@ -174,8 +174,17 @@ class Cday extends Object { | @@ -174,8 +174,17 @@ class Cday extends Object { | ||
| 174 | @JsonKey(name: 'dtime') | 174 | @JsonKey(name: 'dtime') |
| 175 | String dtime; | 175 | String dtime; |
| 176 | 176 | ||
| 177 | + @JsonKey(name: 'year') | ||
| 178 | + String year; | ||
| 179 | + | ||
| 180 | + @JsonKey(name: 'month') | ||
| 181 | + String month; | ||
| 182 | + | ||
| 183 | + @JsonKey(name: 'day') | ||
| 184 | + String day; | ||
| 185 | + | ||
| 177 | Cday(this.id, this.gid, this.content, this.cdate, this.desc, this.type, | 186 | Cday(this.id, this.gid, this.content, this.cdate, this.desc, this.type, |
| 178 | - this.dtime); | 187 | + this.dtime, this.year, this.month, this.day); |
| 179 | 188 | ||
| 180 | factory Cday.fromJson(Map<String, dynamic> srcJson) => | 189 | factory Cday.fromJson(Map<String, dynamic> srcJson) => |
| 181 | _$CdayFromJson(srcJson); | 190 | _$CdayFromJson(srcJson); |
| @@ -109,6 +109,9 @@ Cday _$CdayFromJson(Map<String, dynamic> json) { | @@ -109,6 +109,9 @@ Cday _$CdayFromJson(Map<String, dynamic> json) { | ||
| 109 | json['desc'] as String, | 109 | json['desc'] as String, |
| 110 | json['type'] as String, | 110 | json['type'] as String, |
| 111 | json['dtime'] as String, | 111 | json['dtime'] as String, |
| 112 | + json['year'] as String, | ||
| 113 | + json['month'] as String, | ||
| 114 | + json['day'] as String, | ||
| 112 | ); | 115 | ); |
| 113 | } | 116 | } |
| 114 | 117 | ||
| @@ -120,6 +123,9 @@ Map<String, dynamic> _$CdayToJson(Cday instance) => <String, dynamic>{ | @@ -120,6 +123,9 @@ Map<String, dynamic> _$CdayToJson(Cday instance) => <String, dynamic>{ | ||
| 120 | 'desc': instance.cdate, | 123 | 'desc': instance.cdate, |
| 121 | 'type': instance.cdate, | 124 | 'type': instance.cdate, |
| 122 | 'dtime': instance.cdate, | 125 | 'dtime': instance.cdate, |
| 126 | + 'year': instance.year, | ||
| 127 | + 'month': instance.month, | ||
| 128 | + 'day': instance.day, | ||
| 123 | }; | 129 | }; |
| 124 | 130 | ||
| 125 | Last _$LastFromJson(Map<String, dynamic> json) { | 131 | Last _$LastFromJson(Map<String, dynamic> json) { |
| @@ -3043,66 +3043,54 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | @@ -3043,66 +3043,54 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | ||
| 3043 | .rnameStr, | 3043 | .rnameStr, |
| 3044 | textColor: MyColours | 3044 | textColor: MyColours |
| 3045 | .color_515151), | 3045 | .color_515151), |
| 3046 | - (detailEntity.status == "4" && | 3046 | + (detailEntity.status == |
| 3047 | + "4" && | ||
| 3047 | detailEntity | 3048 | detailEntity |
| 3048 | .cancel != | 3049 | .cancel != |
| 3049 | null && | 3050 | null && |
| 3050 | - (detailEntity.phone == | 3051 | + (detailEntity |
| 3052 | + .phone == | ||
| 3051 | null || | 3053 | null || |
| 3052 | - detailEntity.phone == | 3054 | + detailEntity |
| 3055 | + .phone == | ||
| 3053 | '')) | 3056 | '')) |
| 3054 | ? SizedBox() | 3057 | ? SizedBox() |
| 3055 | - : InkWell( | ||
| 3056 | - onTap: () { | ||
| 3057 | - if (formatPhone != | ||
| 3058 | - null && | ||
| 3059 | - formatPhone != | ||
| 3060 | - '') { | ||
| 3061 | - if (Utils.getAuthority( | ||
| 3062 | - context, | ||
| 3063 | - '订座详情-电话') || | ||
| 3064 | - widget.uid == | ||
| 3065 | - userModel | ||
| 3066 | - .user | ||
| 3067 | - .openid || | ||
| 3068 | - (userModel | ||
| 3069 | - .user.role_name == | ||
| 3070 | - '店长' && | ||
| 3071 | - detailEntity.role_name != | ||
| 3072 | - '管理员' && | ||
| 3073 | - detailEntity.role_name != | ||
| 3074 | - '店长')) { | ||
| 3075 | - DialogUtil | ||
| 3076 | - .goPhone( | ||
| 3077 | - formatPhone); | ||
| 3078 | - } | ||
| 3079 | - } | ||
| 3080 | - }, | ||
| 3081 | - child: RowMultiText( | ||
| 3082 | - "电话", | ||
| 3083 | - detailEntity.phone == | ||
| 3084 | - null | ||
| 3085 | - ? '' | ||
| 3086 | - : (Utils.getAuthority(context, '订座详情-电话') || | ||
| 3087 | - widget.uid == | ||
| 3088 | - userModel | ||
| 3089 | - .user.openid || | ||
| 3090 | - (userModel.user.role_name == '店长' && | ||
| 3091 | - detailEntity.role_name != | ||
| 3092 | - '管理员' && | ||
| 3093 | - detailEntity.role_name != | ||
| 3094 | - '店长')) | ||
| 3095 | - ? detailEntity | ||
| 3096 | - .phone | ||
| 3097 | - : Utils.starPhone(detailEntity | ||
| 3098 | - .phone), | ||
| 3099 | - textColor: MyColours | ||
| 3100 | - .color_515151, | ||
| 3101 | - textColorR: | ||
| 3102 | - MyColours | ||
| 3103 | - .color_438E93, | ||
| 3104 | - imageName: | ||
| 3105 | - 'phone_detail')), | 3058 | + : detailEntity.gid == |
| 3059 | + null | ||
| 3060 | + ? SizedBox() | ||
| 3061 | + : InkWell( | ||
| 3062 | + onTap: () { | ||
| 3063 | + if (formatPhone != | ||
| 3064 | + null && | ||
| 3065 | + formatPhone != | ||
| 3066 | + '') { | ||
| 3067 | + if (Utils.getAuthority( | ||
| 3068 | + context, | ||
| 3069 | + '订座详情-电话') || | ||
| 3070 | + widget.uid == | ||
| 3071 | + userModel | ||
| 3072 | + .user.openid || | ||
| 3073 | + (userModel.user.role_name == '店长' && | ||
| 3074 | + detailEntity.role_name != | ||
| 3075 | + '管理员' && | ||
| 3076 | + detailEntity.role_name != | ||
| 3077 | + '店长')) { | ||
| 3078 | + DialogUtil | ||
| 3079 | + .goPhone( | ||
| 3080 | + formatPhone); | ||
| 3081 | + } | ||
| 3082 | + } | ||
| 3083 | + }, | ||
| 3084 | + child: RowMultiText( | ||
| 3085 | + "电话", | ||
| 3086 | + detailEntity.phone == null | ||
| 3087 | + ? '' | ||
| 3088 | + : (Utils.getAuthority(context, '订座详情-电话') || widget.uid == userModel.user.openid || (userModel.user.role_name == '店长' && detailEntity.role_name != '管理员' && detailEntity.role_name != '店长')) | ||
| 3089 | + ? detailEntity.phone | ||
| 3090 | + : Utils.starPhone(detailEntity.phone), | ||
| 3091 | + textColor: MyColours.color_515151, | ||
| 3092 | + textColorR: MyColours.color_438E93, | ||
| 3093 | + imageName: 'phone_detail')), | ||
| 3106 | (detailEntity.status == | 3094 | (detailEntity.status == |
| 3107 | "4" && | 3095 | "4" && |
| 3108 | detailEntity | 3096 | detailEntity |
| @@ -111,6 +111,8 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | @@ -111,6 +111,8 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | ||
| 111 | 111 | ||
| 112 | Map<String, dynamic> dataSp = Map(); | 112 | Map<String, dynamic> dataSp = Map(); |
| 113 | 113 | ||
| 114 | + final XgFlutterPlugin tpush = new XgFlutterPlugin(); | ||
| 115 | + | ||
| 114 | //实现监听 | 116 | //实现监听 |
| 115 | Future<dynamic> platformCallHandler(MethodCall call) async { | 117 | Future<dynamic> platformCallHandler(MethodCall call) async { |
| 116 | switch (call.method) { | 118 | switch (call.method) { |
| @@ -226,9 +228,9 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | @@ -226,9 +228,9 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | ||
| 226 | create: (_) => CollectStoreProvider(), child: MyPage()), | 228 | create: (_) => CollectStoreProvider(), child: MyPage()), |
| 227 | ))); | 229 | ))); |
| 228 | WidgetsBinding.instance.addPostFrameCallback((_) async { | 230 | WidgetsBinding.instance.addPostFrameCallback((_) async { |
| 229 | - bus.on('refresh_token', (arg) { | ||
| 230 | - initPlatformState(); | ||
| 231 | - }); | 231 | + // bus.on('refresh_token', (arg) { |
| 232 | + // initPlatformState(); | ||
| 233 | + // }); | ||
| 232 | getSellerVersion(); | 234 | getSellerVersion(); |
| 233 | 235 | ||
| 234 | initPlatformState(); | 236 | initPlatformState(); |
| @@ -733,7 +735,9 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | @@ -733,7 +735,9 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | ||
| 733 | 735 | ||
| 734 | //获取点击通知栏的自定义参数 | 736 | //获取点击通知栏的自定义参数 |
| 735 | _getIntent(Map param) async { | 737 | _getIntent(Map param) async { |
| 736 | - _clearBadge(() {}); | 738 | + // if (param != null) { |
| 739 | + _clearBadge(() {}); | ||
| 740 | + // } | ||
| 737 | 741 | ||
| 738 | Map notifyParam = param; | 742 | Map notifyParam = param; |
| 739 | if (Platform.isIOS && param != null) { | 743 | if (Platform.isIOS && param != null) { |
| @@ -961,11 +965,23 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | @@ -961,11 +965,23 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | ||
| 961 | // App.sp.setBool("h_notification", true); | 965 | // App.sp.setBool("h_notification", true); |
| 962 | 966 | ||
| 963 | /// 开启DEBUG | 967 | /// 开启DEBUG |
| 964 | - XgFlutterPlugin().setEnableDebug(false); | 968 | + tpush.setEnableDebug(false); |
| 969 | + | ||
| 970 | + String token = await XgFlutterPlugin.xgToken; | ||
| 971 | + print(token); | ||
| 972 | + | ||
| 973 | + if (token != null && token.length > 0) { | ||
| 974 | + | ||
| 975 | + userTokenInit(token); | ||
| 976 | + } | ||
| 965 | 977 | ||
| 966 | /// 添加回调事件 | 978 | /// 添加回调事件 |
| 967 | - XgFlutterPlugin().addEventHandler( | 979 | + tpush.addEventHandler( |
| 968 | onRegisteredDeviceToken: (String msg) async { | 980 | onRegisteredDeviceToken: (String msg) async { |
| 981 | + // String token = await XgFlutterPlugin.xgToken; | ||
| 982 | + // print(token); | ||
| 983 | + // userTokenInit(token); | ||
| 984 | + | ||
| 969 | print("flutter onRegisteredDeviceToken: $msg"); | 985 | print("flutter onRegisteredDeviceToken: $msg"); |
| 970 | }, | 986 | }, |
| 971 | onRegisteredDone: (String msg) async { | 987 | onRegisteredDone: (String msg) async { |
| @@ -984,11 +1000,13 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | @@ -984,11 +1000,13 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | ||
| 984 | LogUtil.v("注册成功:$token"); | 1000 | LogUtil.v("注册成功:$token"); |
| 985 | // Utils.showToast("注册成功:$token"); | 1001 | // Utils.showToast("注册成功:$token"); |
| 986 | userTokenInit(token); | 1002 | userTokenInit(token); |
| 987 | - // XgFlutterPlugin().setAppBadge(0); | 1003 | + // Utils.showToast("注册成功:$token"); |
| 1004 | + // tpush.setAppBadge(0); | ||
| 988 | } | 1005 | } |
| 989 | }, | 1006 | }, |
| 990 | unRegistered: (String msg) async { | 1007 | unRegistered: (String msg) async { |
| 991 | print("flutter unRegistered: $msg"); | 1008 | print("flutter unRegistered: $msg"); |
| 1009 | + // Utils.showToast(msg); | ||
| 992 | }, | 1010 | }, |
| 993 | onReceiveNotificationResponse: (Map<String, dynamic> msg) async { | 1011 | onReceiveNotificationResponse: (Map<String, dynamic> msg) async { |
| 994 | print("flutter onReceiveNotificationResponse $msg"); | 1012 | print("flutter onReceiveNotificationResponse $msg"); |
| @@ -1049,7 +1067,7 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | @@ -1049,7 +1067,7 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | ||
| 1049 | print("flutter xgPushDidSetBadge: $msg"); | 1067 | print("flutter xgPushDidSetBadge: $msg"); |
| 1050 | 1068 | ||
| 1051 | // /// 在此可设置应用角标 | 1069 | // /// 在此可设置应用角标 |
| 1052 | - // XgFlutterPlugin().setAppBadge(0); | 1070 | + // tpush.setAppBadge(0); |
| 1053 | }, | 1071 | }, |
| 1054 | xgPushDidBindWithIdentifier: (String msg) async { | 1072 | xgPushDidBindWithIdentifier: (String msg) async { |
| 1055 | print("flutter xgPushDidBindWithIdentifier: $msg"); | 1073 | print("flutter xgPushDidBindWithIdentifier: $msg"); |
| @@ -1297,53 +1315,47 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | @@ -1297,53 +1315,47 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | ||
| 1297 | if (xgCount > 5) return; | 1315 | if (xgCount > 5) return; |
| 1298 | if (Platform.isAndroid) { | 1316 | if (Platform.isAndroid) { |
| 1299 | /// 设置OPPO AppKey 和 AppSecret | 1317 | /// 设置OPPO AppKey 和 AppSecret |
| 1300 | - if (await XgFlutterPlugin().getXgAndroidApi().isOppoRom()) { | ||
| 1301 | - XgFlutterPlugin().getXgAndroidApi().enableOppoNotification(); | ||
| 1302 | - XgFlutterPlugin().getXgAndroidApi().setOppoPushAppId(appId: "30260281"); | ||
| 1303 | - XgFlutterPlugin() | 1318 | + if (await tpush.getXgAndroidApi().isOppoRom()) { |
| 1319 | + tpush.getXgAndroidApi().enableOppoNotification(); | ||
| 1320 | + tpush.getXgAndroidApi().setOppoPushAppId(appId: "30260281"); | ||
| 1321 | + tpush | ||
| 1304 | .getXgAndroidApi() | 1322 | .getXgAndroidApi() |
| 1305 | .setOppoPushAppKey(appKey: "94d77d10e7bb4c60bcf18a84c8ca8bdd"); | 1323 | .setOppoPushAppKey(appKey: "94d77d10e7bb4c60bcf18a84c8ca8bdd"); |
| 1306 | } | 1324 | } |
| 1307 | // 设置小米 AppID 和 AppKey。 | 1325 | // 设置小米 AppID 和 AppKey。 |
| 1308 | - if (await XgFlutterPlugin().getXgAndroidApi().isMiuiRom()) { | ||
| 1309 | - XgFlutterPlugin() | ||
| 1310 | - .getXgAndroidApi() | ||
| 1311 | - .setMiPushAppId(appId: "2882303761518639456"); | ||
| 1312 | - XgFlutterPlugin() | ||
| 1313 | - .getXgAndroidApi() | ||
| 1314 | - .setMiPushAppKey(appKey: "5231863961456"); | 1326 | + if (await tpush.getXgAndroidApi().isMiuiRom()) { |
| 1327 | + tpush.getXgAndroidApi().setMiPushAppId(appId: "2882303761518639456"); | ||
| 1328 | + tpush.getXgAndroidApi().setMiPushAppKey(appKey: "5231863961456"); | ||
| 1315 | } else { | 1329 | } else { |
| 1316 | - if (!await XgFlutterPlugin().getXgAndroidApi().isVivoRom()) { | ||
| 1317 | - XgFlutterPlugin() | ||
| 1318 | - .getXgAndroidApi() | ||
| 1319 | - .createNotificationChannelWithSound( | ||
| 1320 | - channelId: 'high_custom_8', | ||
| 1321 | - channelName: '新消息通知', | ||
| 1322 | - enableLights: true, | ||
| 1323 | - enableSound: true, | ||
| 1324 | - enableVibration: true, | ||
| 1325 | - soundFileName: 'tts_voice'); | 1330 | + if (!await tpush.getXgAndroidApi().isVivoRom()) { |
| 1331 | + tpush.getXgAndroidApi().createNotificationChannelWithSound( | ||
| 1332 | + channelId: 'high_custom_8', | ||
| 1333 | + channelName: '新消息通知', | ||
| 1334 | + enableLights: true, | ||
| 1335 | + enableSound: true, | ||
| 1336 | + enableVibration: true, | ||
| 1337 | + soundFileName: 'tts_voice'); | ||
| 1326 | } | 1338 | } |
| 1327 | } | 1339 | } |
| 1328 | - XgFlutterPlugin().getXgAndroidApi().enableOtherPush(); | 1340 | + tpush.getXgAndroidApi().enableOtherPush(); |
| 1329 | } | 1341 | } |
| 1330 | 1342 | ||
| 1331 | /// 启动TPNS服务 | 1343 | /// 启动TPNS服务 |
| 1332 | LogUtil.v("register:${xgCount.toString()}"); | 1344 | LogUtil.v("register:${xgCount.toString()}"); |
| 1333 | - XgFlutterPlugin().startXg("1600012876", "INUIMFK21WGH"); | 1345 | + tpush.startXg("1600012876", "INUIMFK21WGH"); |
| 1334 | xgCount++; | 1346 | xgCount++; |
| 1335 | } | 1347 | } |
| 1336 | 1348 | ||
| 1337 | void _addBadge() { | 1349 | void _addBadge() { |
| 1338 | - XgFlutterPlugin().setBadge(numPush); | ||
| 1339 | - XgFlutterPlugin().setAppBadge(numPush); | 1350 | + tpush.setBadge(numPush); |
| 1351 | + tpush.setAppBadge(numPush); | ||
| 1340 | FlutterAppBadger.updateBadgeCount(numPush); | 1352 | FlutterAppBadger.updateBadgeCount(numPush); |
| 1341 | } | 1353 | } |
| 1342 | 1354 | ||
| 1343 | void _clearBadge(VoidCallback callback) async { | 1355 | void _clearBadge(VoidCallback callback) async { |
| 1344 | numPush = 0; | 1356 | numPush = 0; |
| 1345 | - XgFlutterPlugin().setBadge(0); | ||
| 1346 | - XgFlutterPlugin().setAppBadge(0); | 1357 | + tpush.setBadge(0); |
| 1358 | + tpush.setAppBadge(0); | ||
| 1347 | FlutterAppBadger.removeBadge(); | 1359 | FlutterAppBadger.removeBadge(); |
| 1348 | callback(); | 1360 | callback(); |
| 1349 | } | 1361 | } |
| @@ -1871,7 +1883,7 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | @@ -1871,7 +1883,7 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | ||
| 1871 | super.dispose(); | 1883 | super.dispose(); |
| 1872 | LogUtil.v("home_dispose"); | 1884 | LogUtil.v("home_dispose"); |
| 1873 | 1885 | ||
| 1874 | - bus.off('refresh_token'); | 1886 | + // bus.off('refresh_token'); |
| 1875 | if (timer != null) { | 1887 | if (timer != null) { |
| 1876 | timer.cancel(); | 1888 | timer.cancel(); |
| 1877 | } | 1889 | } |
| @@ -71,9 +71,9 @@ class _CompleteCreateStorePageState extends State<CompleteCreateStorePage> { | @@ -71,9 +71,9 @@ class _CompleteCreateStorePageState extends State<CompleteCreateStorePage> { | ||
| 71 | Map<String, dynamic> user; //= baseResp.data[0]["user"] | 71 | Map<String, dynamic> user; //= baseResp.data[0]["user"] |
| 72 | 72 | ||
| 73 | App.sp.setBool("accountLogin", false); | 73 | App.sp.setBool("accountLogin", false); |
| 74 | - if (Platform.isIOS) { | ||
| 75 | - XgFlutterPlugin().stopXg(); | ||
| 76 | - } | 74 | + // if (Platform.isIOS) { |
| 75 | + // // XgFlutterPlugin().stopXg(); | ||
| 76 | + // } | ||
| 77 | if (App.sp.containsKey('table_list')) { | 77 | if (App.sp.containsKey('table_list')) { |
| 78 | //退出清空桌位数据 | 78 | //退出清空桌位数据 |
| 79 | App.sp.remove('table_list'); | 79 | App.sp.remove('table_list'); |
| @@ -99,7 +99,7 @@ class _CompleteCreateStorePageState extends State<CompleteCreateStorePage> { | @@ -99,7 +99,7 @@ class _CompleteCreateStorePageState extends State<CompleteCreateStorePage> { | ||
| 99 | 99 | ||
| 100 | 100 | ||
| 101 | 101 | ||
| 102 | - bus.emit('refresh_token'); | 102 | + // bus.emit('refresh_token'); |
| 103 | Map<String, dynamic> userMap = { | 103 | Map<String, dynamic> userMap = { |
| 104 | "sellerimage": seller['seller_image'], | 104 | "sellerimage": seller['seller_image'], |
| 105 | 105 |
| @@ -140,9 +140,9 @@ class _IfNeedCreateStoreState extends State<IfNeedCreateStore> | @@ -140,9 +140,9 @@ class _IfNeedCreateStoreState extends State<IfNeedCreateStore> | ||
| 140 | _loginStore(context, CheckSellerAccSunModel sunModel) { | 140 | _loginStore(context, CheckSellerAccSunModel sunModel) { |
| 141 | UserModel userModel = Provider.of<UserModel>(context, listen: false); | 141 | UserModel userModel = Provider.of<UserModel>(context, listen: false); |
| 142 | App.sp.setBool("accountLogin", false); | 142 | App.sp.setBool("accountLogin", false); |
| 143 | - if (Platform.isIOS) { | ||
| 144 | - XgFlutterPlugin().stopXg(); | ||
| 145 | - } | 143 | + // if (Platform.isIOS) { |
| 144 | + // // XgFlutterPlugin().stopXg(); | ||
| 145 | + // } | ||
| 146 | if (App.sp.containsKey('table_list')) { | 146 | if (App.sp.containsKey('table_list')) { |
| 147 | //退出清空桌位数据 | 147 | //退出清空桌位数据 |
| 148 | App.sp.remove('table_list'); | 148 | App.sp.remove('table_list'); |
| @@ -164,7 +164,7 @@ class _IfNeedCreateStoreState extends State<IfNeedCreateStore> | @@ -164,7 +164,7 @@ class _IfNeedCreateStoreState extends State<IfNeedCreateStore> | ||
| 164 | //退出清空订单发短信2分钟限制数据缓存 | 164 | //退出清空订单发短信2分钟限制数据缓存 |
| 165 | App.sp.remove('notebook_timer'); | 165 | App.sp.remove('notebook_timer'); |
| 166 | } | 166 | } |
| 167 | - bus.emit('refresh_token'); | 167 | + // bus.emit('refresh_token'); |
| 168 | Map<String, dynamic> seller = sunModel.toJson(); | 168 | Map<String, dynamic> seller = sunModel.toJson(); |
| 169 | Map<String, dynamic> userMap = { | 169 | Map<String, dynamic> userMap = { |
| 170 | "openid": seller['uid'], | 170 | "openid": seller['uid'], |
| @@ -883,13 +883,32 @@ class _MyCustomerDetailPageState extends State<MyCustomerDetailPage> { | @@ -883,13 +883,32 @@ class _MyCustomerDetailPageState extends State<MyCustomerDetailPage> { | ||
| 883 | .guestInfoSunModel.guest.cDay[index]; | 883 | .guestInfoSunModel.guest.cDay[index]; |
| 884 | String show = cday.content; | 884 | String show = cday.content; |
| 885 | if (cday.desc != null && cday.desc != '') { | 885 | if (cday.desc != null && cday.desc != '') { |
| 886 | - //新数据 | ||
| 887 | - // 组展示文本 | 886 | + if (cday.month != null) { |
| 887 | + //最新的数据 | ||
| 888 | 888 | ||
| 889 | - show = cday.desc + | ||
| 890 | - ':' + | ||
| 891 | - cday.dtime + | ||
| 892 | - (cday.type == '1' ? '公历' : '农历'); | 889 | + if (cday.year == null) { |
| 890 | + show = cday.desc + | ||
| 891 | + ':' + | ||
| 892 | + cday.month + | ||
| 893 | + '-' + | ||
| 894 | + cday.day + | ||
| 895 | + (cday.type == '1' ? '(公历)' : '(农历)'); | ||
| 896 | + } else { | ||
| 897 | + show = cday.desc + | ||
| 898 | + ':' + | ||
| 899 | + cday.year + | ||
| 900 | + '-' + | ||
| 901 | + cday.month + | ||
| 902 | + '-' + | ||
| 903 | + cday.day + | ||
| 904 | + (cday.type == '1' ? '(公历)' : '(农历)'); | ||
| 905 | + } | ||
| 906 | + } else { | ||
| 907 | + show = cday.desc + | ||
| 908 | + ':' + | ||
| 909 | + cday.dtime + | ||
| 910 | + (cday.type == '1' ? '(公历)' : '(农历)'); | ||
| 911 | + } | ||
| 893 | } | 912 | } |
| 894 | return Center( | 913 | return Center( |
| 895 | child: Padding( | 914 | child: Padding( |
| @@ -49,7 +49,13 @@ class _MyFestivalEditPageState extends State<MyFestivalEditPage> { | @@ -49,7 +49,13 @@ class _MyFestivalEditPageState extends State<MyFestivalEditPage> { | ||
| 49 | 'desc': content['desc'], | 49 | 'desc': content['desc'], |
| 50 | 'type': content['type'], | 50 | 'type': content['type'], |
| 51 | 'dtime': content['dtime'], | 51 | 'dtime': content['dtime'], |
| 52 | + 'month': content['month'], | ||
| 53 | + 'day': content['day'] | ||
| 52 | }; | 54 | }; |
| 55 | + | ||
| 56 | + if (content['year'] != '') { | ||
| 57 | + params['year'] = content['year']; | ||
| 58 | + } | ||
| 53 | if (id != '') { | 59 | if (id != '') { |
| 54 | params["id"] = id; | 60 | params["id"] = id; |
| 55 | } | 61 | } |
| @@ -124,10 +130,32 @@ class _MyFestivalEditPageState extends State<MyFestivalEditPage> { | @@ -124,10 +130,32 @@ class _MyFestivalEditPageState extends State<MyFestivalEditPage> { | ||
| 124 | //新数据 | 130 | //新数据 |
| 125 | // 组展示文本 | 131 | // 组展示文本 |
| 126 | 132 | ||
| 127 | - show = cday.desc + | ||
| 128 | - ':' + | ||
| 129 | - cday.dtime + | ||
| 130 | - (cday.type == '1' ? '(公历)' : '(农历)'); | 133 | + if (cday.month != null) { |
| 134 | + //最新的数据 | ||
| 135 | + | ||
| 136 | + if (cday.year == null) { | ||
| 137 | + show = cday.desc + | ||
| 138 | + ':' + | ||
| 139 | + cday.month + | ||
| 140 | + '-' + | ||
| 141 | + cday.day + | ||
| 142 | + (cday.type == '1' ? '(公历)' : '(农历)'); | ||
| 143 | + } else { | ||
| 144 | + show = cday.desc + | ||
| 145 | + ':' + | ||
| 146 | + cday.year + | ||
| 147 | + '-' + | ||
| 148 | + cday.month + | ||
| 149 | + '-' + | ||
| 150 | + cday.day + | ||
| 151 | + (cday.type == '1' ? '(公历)' : '(农历)'); | ||
| 152 | + } | ||
| 153 | + } else { | ||
| 154 | + show = cday.desc + | ||
| 155 | + ':' + | ||
| 156 | + cday.dtime + | ||
| 157 | + (cday.type == '1' ? '(公历)' : '(农历)'); | ||
| 158 | + } | ||
| 131 | } | 159 | } |
| 132 | return InkWell( | 160 | return InkWell( |
| 133 | onTap: () { | 161 | onTap: () { |
| @@ -148,30 +176,39 @@ class _MyFestivalEditPageState extends State<MyFestivalEditPage> { | @@ -148,30 +176,39 @@ class _MyFestivalEditPageState extends State<MyFestivalEditPage> { | ||
| 148 | // str += '(${gongli ? '公历' : '农历'})'; | 176 | // str += '(${gongli ? '公历' : '农历'})'; |
| 149 | 177 | ||
| 150 | if (cday.desc != null && cday.desc != '') { | 178 | if (cday.desc != null && cday.desc != '') { |
| 151 | - //新数据 | ||
| 152 | content = cday.desc; | 179 | content = cday.desc; |
| 153 | - List<String> ymd = cday.dtime.split('-'); | ||
| 154 | - if (ymd.length == 3) { | ||
| 155 | - //含有年 | ||
| 156 | - yearStr = ymd[0]; | ||
| 157 | - monthStr = ymd[1]; | ||
| 158 | - dayStr = ymd[2]; | ||
| 159 | - } else if (ymd.length == 2) { | ||
| 160 | - //没有年 | ||
| 161 | - monthStr = ymd[0]; | ||
| 162 | - dayStr = ymd[1]; | ||
| 163 | - } | 180 | + if (cday.month != null) { |
| 181 | + //最新的数据 | ||
| 164 | 182 | ||
| 165 | - if (monthStr.startsWith('0')) { | ||
| 166 | - monthStr = | ||
| 167 | - monthStr.substring(1, monthStr.length); | ||
| 168 | - } | ||
| 169 | - if (dayStr.startsWith('0')) { | ||
| 170 | - dayStr = dayStr.substring(1, dayStr.length); | ||
| 171 | - } | 183 | + yearStr = cday.year ?? '选填'; |
| 184 | + monthStr = cday.month; | ||
| 185 | + dayStr = cday.day; | ||
| 186 | + } else { | ||
| 187 | + //新数据 | ||
| 172 | 188 | ||
| 173 | - print(monthStr); | ||
| 174 | - print(dayStr); | 189 | + List<String> ymd = cday.dtime.split('-'); |
| 190 | + if (ymd.length == 3) { | ||
| 191 | + //含有年 | ||
| 192 | + yearStr = ymd[0]; | ||
| 193 | + monthStr = ymd[1]; | ||
| 194 | + dayStr = ymd[2]; | ||
| 195 | + } else if (ymd.length == 2) { | ||
| 196 | + //没有年 | ||
| 197 | + monthStr = ymd[0]; | ||
| 198 | + dayStr = ymd[1]; | ||
| 199 | + } | ||
| 200 | + | ||
| 201 | + if (monthStr.startsWith('0')) { | ||
| 202 | + monthStr = | ||
| 203 | + monthStr.substring(1, monthStr.length); | ||
| 204 | + } | ||
| 205 | + if (dayStr.startsWith('0')) { | ||
| 206 | + dayStr = dayStr.substring(1, dayStr.length); | ||
| 207 | + } | ||
| 208 | + | ||
| 209 | + print(monthStr); | ||
| 210 | + print(dayStr); | ||
| 211 | + } | ||
| 175 | 212 | ||
| 176 | gongli = cday.type == '1' ? true : false; | 213 | gongli = cday.type == '1' ? true : false; |
| 177 | } else { | 214 | } else { |
| @@ -893,15 +893,33 @@ class _CustomerDetailPageState extends State<CustomerDetailPage> { | @@ -893,15 +893,33 @@ class _CustomerDetailPageState extends State<CustomerDetailPage> { | ||
| 893 | Cday cday = customerProvider | 893 | Cday cday = customerProvider |
| 894 | .guestInfoSunModel.guest.cDay[index]; | 894 | .guestInfoSunModel.guest.cDay[index]; |
| 895 | String show = cday.content; | 895 | String show = cday.content; |
| 896 | - if (cday.content == null) { | ||
| 897 | - //新数据 | ||
| 898 | - // 组展示文本 | 896 | + if (cday.desc != null && cday.desc != '') { |
| 897 | + if (cday.month != null) { | ||
| 898 | + //最新的数据 | ||
| 899 | 899 | ||
| 900 | - show = | ||
| 901 | - cday.desc + ':' + cday.dtime +( cday.type == | ||
| 902 | - '1' | ||
| 903 | - ? '(公历)' | ||
| 904 | - : '(农历)'); | 900 | + if (cday.year == null) { |
| 901 | + show = cday.desc + | ||
| 902 | + ':' + | ||
| 903 | + cday.month + | ||
| 904 | + '-' + | ||
| 905 | + cday.day + | ||
| 906 | + (cday.type == '1' ? '(公历)' : '(农历)'); | ||
| 907 | + } else { | ||
| 908 | + show = cday.desc + | ||
| 909 | + ':' + | ||
| 910 | + cday.year + | ||
| 911 | + '-' + | ||
| 912 | + cday.month + | ||
| 913 | + '-' + | ||
| 914 | + cday.day + | ||
| 915 | + (cday.type == '1' ? '(公历)' : '(农历)'); | ||
| 916 | + } | ||
| 917 | + } else { | ||
| 918 | + show = cday.desc + | ||
| 919 | + ':' + | ||
| 920 | + cday.dtime + | ||
| 921 | + (cday.type == '1' ? '(公历)' : '(农历)'); | ||
| 922 | + } | ||
| 905 | } | 923 | } |
| 906 | return Center( | 924 | return Center( |
| 907 | child: Padding( | 925 | child: Padding( |
| @@ -49,8 +49,14 @@ class _FestivalEditPageState extends State<FestivalEditPage> { | @@ -49,8 +49,14 @@ class _FestivalEditPageState extends State<FestivalEditPage> { | ||
| 49 | 'desc': content['desc'], | 49 | 'desc': content['desc'], |
| 50 | 'type': content['type'], | 50 | 'type': content['type'], |
| 51 | 'dtime': content['dtime'], | 51 | 'dtime': content['dtime'], |
| 52 | + 'month': content['month'], | ||
| 53 | + 'day': content['day'] | ||
| 52 | }; | 54 | }; |
| 53 | 55 | ||
| 56 | + if (content['year'] != '') { | ||
| 57 | + params['year'] = content['year']; | ||
| 58 | + } | ||
| 59 | + | ||
| 54 | if (id != '') { | 60 | if (id != '') { |
| 55 | params["id"] = id; | 61 | params["id"] = id; |
| 56 | } | 62 | } |
| @@ -125,10 +131,32 @@ class _FestivalEditPageState extends State<FestivalEditPage> { | @@ -125,10 +131,32 @@ class _FestivalEditPageState extends State<FestivalEditPage> { | ||
| 125 | //新数据 | 131 | //新数据 |
| 126 | // 组展示文本 | 132 | // 组展示文本 |
| 127 | 133 | ||
| 128 | - show = cday.desc + | ||
| 129 | - ':' + | ||
| 130 | - cday.dtime + | ||
| 131 | - (cday.type == '1' ? '(公历)' : '(农历)'); | 134 | + if (cday.month != null) { |
| 135 | + //最新的数据 | ||
| 136 | + | ||
| 137 | + if (cday.year == null) { | ||
| 138 | + show = cday.desc + | ||
| 139 | + ':' + | ||
| 140 | + cday.month + | ||
| 141 | + '-' + | ||
| 142 | + cday.day + | ||
| 143 | + (cday.type == '1' ? '(公历)' : '(农历)'); | ||
| 144 | + } else { | ||
| 145 | + show = cday.desc + | ||
| 146 | + ':' + | ||
| 147 | + cday.year + | ||
| 148 | + '-' + | ||
| 149 | + cday.month + | ||
| 150 | + '-' + | ||
| 151 | + cday.day + | ||
| 152 | + (cday.type == '1' ? '(公历)' : '(农历)'); | ||
| 153 | + } | ||
| 154 | + } else { | ||
| 155 | + show = cday.desc + | ||
| 156 | + ':' + | ||
| 157 | + cday.dtime + | ||
| 158 | + (cday.type == '1' ? '(公历)' : '(农历)'); | ||
| 159 | + } | ||
| 132 | } | 160 | } |
| 133 | return InkWell( | 161 | return InkWell( |
| 134 | onTap: () { | 162 | onTap: () { |
| @@ -149,30 +177,39 @@ class _FestivalEditPageState extends State<FestivalEditPage> { | @@ -149,30 +177,39 @@ class _FestivalEditPageState extends State<FestivalEditPage> { | ||
| 149 | // str += '(${gongli ? '公历' : '农历'})'; | 177 | // str += '(${gongli ? '公历' : '农历'})'; |
| 150 | 178 | ||
| 151 | if (cday.desc != null && cday.desc != '') { | 179 | if (cday.desc != null && cday.desc != '') { |
| 152 | - //新数据 | ||
| 153 | content = cday.desc; | 180 | content = cday.desc; |
| 154 | - List<String> ymd = cday.dtime.split('-'); | ||
| 155 | - if (ymd.length == 3) { | ||
| 156 | - //含有年 | ||
| 157 | - yearStr = ymd[0]; | ||
| 158 | - monthStr = ymd[1]; | ||
| 159 | - dayStr = ymd[2]; | ||
| 160 | - } else if (ymd.length == 2) { | ||
| 161 | - //没有年 | ||
| 162 | - monthStr = ymd[0]; | ||
| 163 | - dayStr = ymd[1]; | ||
| 164 | - } | 181 | + if (cday.month != null) { |
| 182 | + //最新的数据 | ||
| 165 | 183 | ||
| 166 | - if (monthStr.startsWith('0')) { | ||
| 167 | - monthStr = | ||
| 168 | - monthStr.substring(1, monthStr.length); | ||
| 169 | - } | ||
| 170 | - if (dayStr.startsWith('0')) { | ||
| 171 | - dayStr = dayStr.substring(1, dayStr.length); | ||
| 172 | - } | 184 | + yearStr = cday.year ?? '选填'; |
| 185 | + monthStr = cday.month; | ||
| 186 | + dayStr = cday.day; | ||
| 187 | + } else { | ||
| 188 | + //新数据 | ||
| 173 | 189 | ||
| 174 | - print(monthStr); | ||
| 175 | - print(dayStr); | 190 | + List<String> ymd = cday.dtime.split('-'); |
| 191 | + if (ymd.length == 3) { | ||
| 192 | + //含有年 | ||
| 193 | + yearStr = ymd[0]; | ||
| 194 | + monthStr = ymd[1]; | ||
| 195 | + dayStr = ymd[2]; | ||
| 196 | + } else if (ymd.length == 2) { | ||
| 197 | + //没有年 | ||
| 198 | + monthStr = ymd[0]; | ||
| 199 | + dayStr = ymd[1]; | ||
| 200 | + } | ||
| 201 | + | ||
| 202 | + if (monthStr.startsWith('0')) { | ||
| 203 | + monthStr = | ||
| 204 | + monthStr.substring(1, monthStr.length); | ||
| 205 | + } | ||
| 206 | + if (dayStr.startsWith('0')) { | ||
| 207 | + dayStr = dayStr.substring(1, dayStr.length); | ||
| 208 | + } | ||
| 209 | + | ||
| 210 | + print(monthStr); | ||
| 211 | + print(dayStr); | ||
| 212 | + } | ||
| 176 | 213 | ||
| 177 | gongli = cday.type == '1' ? true : false; | 214 | gongli = cday.type == '1' ? true : false; |
| 178 | } else { | 215 | } else { |
| @@ -354,9 +354,9 @@ class UserModel with ChangeNotifier { | @@ -354,9 +354,9 @@ class UserModel with ChangeNotifier { | ||
| 354 | if (baseResp.code != Constant.status_success) { | 354 | if (baseResp.code != Constant.status_success) { |
| 355 | Utils.showToast(baseResp.msg ?? "退出登录失败,请稍后重试"); | 355 | Utils.showToast(baseResp.msg ?? "退出登录失败,请稍后重试"); |
| 356 | } else { | 356 | } else { |
| 357 | - if (Platform.isIOS) { | ||
| 358 | - XgFlutterPlugin().stopXg(); | ||
| 359 | - } | 357 | + // if (Platform.isIOS) { |
| 358 | + // // XgFlutterPlugin().stopXg(); | ||
| 359 | + // } | ||
| 360 | if (App.sp.containsKey('unionid')) { | 360 | if (App.sp.containsKey('unionid')) { |
| 361 | //微信登陆的时候,退出清空数据 | 361 | //微信登陆的时候,退出清空数据 |
| 362 | App.sp.remove('openid'); | 362 | App.sp.remove('openid'); |
| @@ -8679,7 +8679,14 @@ class DialogUtil { | @@ -8679,7 +8679,14 @@ class DialogUtil { | ||
| 8679 | rCallback({ | 8679 | rCallback({ |
| 8680 | 'desc': name, | 8680 | 'desc': name, |
| 8681 | 'type': gongli ? '1' : '2', | 8681 | 'type': gongli ? '1' : '2', |
| 8682 | - 'dtime': str | 8682 | + 'dtime': str, |
| 8683 | + 'year': (yearStr != '' && | ||
| 8684 | + yearStr != null && | ||
| 8685 | + yearStr != '选填') | ||
| 8686 | + ? yearStr | ||
| 8687 | + : '', | ||
| 8688 | + 'month': monthStr, | ||
| 8689 | + 'day': dayStr | ||
| 8683 | }); | 8690 | }); |
| 8684 | }, | 8691 | }, |
| 8685 | ), | 8692 | ), |
-
Please register or login to post a comment