Showing
12 changed files
with
470 additions
and
265 deletions
| @@ -9,6 +9,7 @@ import android.util.Log | @@ -9,6 +9,7 @@ import android.util.Log | ||
| 9 | import io.flutter.plugin.common.MethodChannel | 9 | import io.flutter.plugin.common.MethodChannel |
| 10 | import io.flutter.plugin.common.MethodCall | 10 | import io.flutter.plugin.common.MethodCall |
| 11 | import android.content.Intent | 11 | import android.content.Intent |
| 12 | +import me.yohom.foundation_fluttify.gMethodChannel | ||
| 12 | 13 | ||
| 13 | class MainActivity: FlutterActivity() { | 14 | class MainActivity: FlutterActivity() { |
| 14 | 15 | ||
| @@ -26,12 +27,15 @@ class MainActivity: FlutterActivity() { | @@ -26,12 +27,15 @@ class MainActivity: FlutterActivity() { | ||
| 26 | 27 | ||
| 27 | override fun onCreate(savedInstanceState: Bundle?) { | 28 | override fun onCreate(savedInstanceState: Bundle?) { |
| 28 | super.onCreate(savedInstanceState) | 29 | super.onCreate(savedInstanceState) |
| 30 | + | ||
| 29 | // flutter版本更新后使用 getFlutterEngine().getDartExecutor().getBinaryMessenger()代替 getFlutterView() | 31 | // flutter版本更新后使用 getFlutterEngine().getDartExecutor().getBinaryMessenger()代替 getFlutterView() |
| 30 | val channel = MethodChannel(getFlutterEngine()?.getDartExecutor()?.getBinaryMessenger(), CHANNEL) | 32 | val channel = MethodChannel(getFlutterEngine()?.getDartExecutor()?.getBinaryMessenger(), CHANNEL) |
| 31 | 33 | ||
| 32 | // 这里要获取启动时的intent | 34 | // 这里要获取启动时的intent |
| 33 | val uri = intent.data | 35 | val uri = intent.data |
| 34 | - | 36 | + if(intent.data != null){ |
| 37 | + Log.i("flutter","onCreate"+intent.data.toString()) | ||
| 38 | + } | ||
| 35 | val paramsMap = mutableMapOf<String, String>() | 39 | val paramsMap = mutableMapOf<String, String>() |
| 36 | if (uri != null) { | 40 | if (uri != null) { |
| 37 | val set = uri.queryParameterNames | 41 | val set = uri.queryParameterNames |
| @@ -52,7 +56,11 @@ class MainActivity: FlutterActivity() { | @@ -52,7 +56,11 @@ class MainActivity: FlutterActivity() { | ||
| 52 | } | 56 | } |
| 53 | override fun onNewIntent(intent: Intent) { | 57 | override fun onNewIntent(intent: Intent) { |
| 54 | super.onNewIntent(intent) | 58 | super.onNewIntent(intent) |
| 55 | - // flutter版本更新后使用 getFlutterEngine().getDartExecutor().getBinaryMessenger()代替 getFlutterView() | 59 | + |
| 60 | + if(intent.data != null){ | ||
| 61 | + Log.i("flutter","onNewIntent"+intent.data.toString()) | ||
| 62 | + } | ||
| 63 | + // flutter版本更新后使用 getFlutterEngine().getDartExecutor().getBinaryMessenger()代替 getFlutterView() | ||
| 56 | val channel = MethodChannel(getFlutterEngine()?.getDartExecutor()?.getBinaryMessenger(), CHANNEL) | 64 | val channel = MethodChannel(getFlutterEngine()?.getDartExecutor()?.getBinaryMessenger(), CHANNEL) |
| 57 | 65 | ||
| 58 | // 这里要获取启动时的intent | 66 | // 这里要获取启动时的intent |
| @@ -68,12 +76,15 @@ class MainActivity: FlutterActivity() { | @@ -68,12 +76,15 @@ class MainActivity: FlutterActivity() { | ||
| 68 | 76 | ||
| 69 | intentMap = paramsMap | 77 | intentMap = paramsMap |
| 70 | 78 | ||
| 71 | - channel.setMethodCallHandler { call, result -> | ||
| 72 | - Log.i(TAG,intentMap.toString()); | ||
| 73 | - when (call.method) { | ||
| 74 | - "getIntent" -> get_intent(call, result) | ||
| 75 | - } | ||
| 76 | - } | 79 | + channel.invokeMethod("getIntent",intentMap) |
| 80 | + | ||
| 81 | +// channel.setMethodCallHandler { call, result -> | ||
| 82 | +// Log.i(TAG,intentMap.toString()); | ||
| 83 | +// when (call.method) { | ||
| 84 | +// "getIntent" -> get_intent(call, result) | ||
| 85 | +// } | ||
| 86 | +// } | ||
| 87 | + | ||
| 77 | } | 88 | } |
| 78 | 89 | ||
| 79 | // 获取intent | 90 | // 获取intent |
| @@ -101,26 +101,29 @@ class NewUnmessage extends Object { | @@ -101,26 +101,29 @@ class NewUnmessage extends Object { | ||
| 101 | @JsonKey(name: 'room_info') | 101 | @JsonKey(name: 'room_info') |
| 102 | dynamic room_info; | 102 | dynamic room_info; |
| 103 | 103 | ||
| 104 | + @JsonKey(name: 'uname') | ||
| 105 | + String uname; | ||
| 106 | + | ||
| 104 | NewUnmessage( | 107 | NewUnmessage( |
| 105 | - this.id, | ||
| 106 | - this.uid, | ||
| 107 | - this.message_type, | ||
| 108 | - this.handle_time, | ||
| 109 | - this.read_time, | ||
| 110 | - this.is_read, | ||
| 111 | - this.is_handle, | ||
| 112 | - this.ddate, | ||
| 113 | - this.rname, | ||
| 114 | - this.sex, | ||
| 115 | - this.cdate, | ||
| 116 | - this.rid, | ||
| 117 | - this.room_demand, | ||
| 118 | - this.ddate_solt, | ||
| 119 | - this.ddate_long, | ||
| 120 | - this.cancelName, | ||
| 121 | - this.status, | ||
| 122 | - this.room_info, | ||
| 123 | - ); | 108 | + this.id, |
| 109 | + this.uid, | ||
| 110 | + this.message_type, | ||
| 111 | + this.handle_time, | ||
| 112 | + this.read_time, | ||
| 113 | + this.is_read, | ||
| 114 | + this.is_handle, | ||
| 115 | + this.ddate, | ||
| 116 | + this.rname, | ||
| 117 | + this.sex, | ||
| 118 | + this.cdate, | ||
| 119 | + this.rid, | ||
| 120 | + this.room_demand, | ||
| 121 | + this.ddate_solt, | ||
| 122 | + this.ddate_long, | ||
| 123 | + this.cancelName, | ||
| 124 | + this.status, | ||
| 125 | + this.room_info, | ||
| 126 | + this.uname); | ||
| 124 | 127 | ||
| 125 | String get rnameStr { | 128 | String get rnameStr { |
| 126 | if (rname == null || rname == '') return ""; | 129 | if (rname == null || rname == '') return ""; |
| @@ -60,6 +60,7 @@ NewUnmessage _$NewUnmessageFromJson(Map<String, dynamic> json) { | @@ -60,6 +60,7 @@ NewUnmessage _$NewUnmessageFromJson(Map<String, dynamic> json) { | ||
| 60 | json['cancel_name'] as dynamic, | 60 | json['cancel_name'] as dynamic, |
| 61 | json['status'] as dynamic, | 61 | json['status'] as dynamic, |
| 62 | json['room_info'] as dynamic, | 62 | json['room_info'] as dynamic, |
| 63 | + json['uname'] as String, | ||
| 63 | ); | 64 | ); |
| 64 | } | 65 | } |
| 65 | 66 | ||
| @@ -83,4 +84,5 @@ Map<String, dynamic> _$NewUnmessageToJson(NewUnmessage instance) => | @@ -83,4 +84,5 @@ Map<String, dynamic> _$NewUnmessageToJson(NewUnmessage instance) => | ||
| 83 | 'cancel_name': instance.cancelName, | 84 | 'cancel_name': instance.cancelName, |
| 84 | 'status': instance.status, | 85 | 'status': instance.status, |
| 85 | 'room_info': instance.room_info, | 86 | 'room_info': instance.room_info, |
| 87 | + 'uname': instance.uname | ||
| 86 | }; | 88 | }; |
| @@ -4,6 +4,7 @@ import 'dart:io'; | @@ -4,6 +4,7 @@ import 'dart:io'; | ||
| 4 | import 'package:common_utils/common_utils.dart'; | 4 | import 'package:common_utils/common_utils.dart'; |
| 5 | import 'package:flutter/cupertino.dart'; | 5 | import 'package:flutter/cupertino.dart'; |
| 6 | import 'package:flutter/material.dart'; | 6 | import 'package:flutter/material.dart'; |
| 7 | +import 'package:flutter/services.dart'; | ||
| 7 | import 'package:flutter_app_update/azhon_app_update.dart'; | 8 | import 'package:flutter_app_update/azhon_app_update.dart'; |
| 8 | import 'package:flutter_screenutil/flutter_screenutil.dart'; | 9 | import 'package:flutter_screenutil/flutter_screenutil.dart'; |
| 9 | import 'package:one_key/models/new_unmessage_model.dart'; | 10 | import 'package:one_key/models/new_unmessage_model.dart'; |
| @@ -40,8 +41,15 @@ class HomePage extends StatefulWidget { | @@ -40,8 +41,15 @@ class HomePage extends StatefulWidget { | ||
| 40 | final bool needReresh; | 41 | final bool needReresh; |
| 41 | 42 | ||
| 42 | final bool mine; | 43 | final bool mine; |
| 44 | + final DateTime date; | ||
| 45 | + final String solt; | ||
| 43 | 46 | ||
| 44 | - HomePage({this.initialIndex = 1, this.needReresh = true, this.mine = false}); | 47 | + HomePage( |
| 48 | + {this.initialIndex = 1, | ||
| 49 | + this.needReresh = true, | ||
| 50 | + this.mine = false, | ||
| 51 | + this.date, | ||
| 52 | + this.solt}); | ||
| 45 | 53 | ||
| 46 | @override | 54 | @override |
| 47 | State<StatefulWidget> createState() { | 55 | State<StatefulWidget> createState() { |
| @@ -66,6 +74,21 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | @@ -66,6 +74,21 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | ||
| 66 | PageController _pageController; | 74 | PageController _pageController; |
| 67 | bool needUpdate = true; | 75 | bool needUpdate = true; |
| 68 | bool needRefreshTemp = true; | 76 | bool needRefreshTemp = true; |
| 77 | + static const MethodChannel _channel = MethodChannel("com.naji/book"); | ||
| 78 | + | ||
| 79 | +//实现监听 | ||
| 80 | + Future<dynamic> platformCallHandler(MethodCall call) async { | ||
| 81 | + switch (call.method) { | ||
| 82 | + case "getIntent": | ||
| 83 | + // dynamic result = await _channel.invokeMethod("getIntent"); | ||
| 84 | + // return result; | ||
| 85 | + dynamic result = call.arguments; | ||
| 86 | + print(result); | ||
| 87 | + _getIntent(result); | ||
| 88 | + | ||
| 89 | + break; | ||
| 90 | + } | ||
| 91 | + } | ||
| 69 | 92 | ||
| 70 | @override | 93 | @override |
| 71 | void initState() { | 94 | void initState() { |
| @@ -73,6 +96,7 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | @@ -73,6 +96,7 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | ||
| 73 | super.initState(); | 96 | super.initState(); |
| 74 | LogUtil.v("home_initState"); | 97 | LogUtil.v("home_initState"); |
| 75 | needRefreshTemp = widget.needReresh; | 98 | needRefreshTemp = widget.needReresh; |
| 99 | + _channel.setMethodCallHandler(platformCallHandler); //设置监听 | ||
| 76 | 100 | ||
| 77 | AzhonAppUpdate.listener( | 101 | AzhonAppUpdate.listener( |
| 78 | // () { | 102 | // () { |
| @@ -103,6 +127,8 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | @@ -103,6 +127,8 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | ||
| 103 | child: SafeArea( | 127 | child: SafeArea( |
| 104 | child: NoteBookPage( | 128 | child: NoteBookPage( |
| 105 | tabIndex: widget.mine ? 1 : 0, | 129 | tabIndex: widget.mine ? 1 : 0, |
| 130 | + date: widget.date, | ||
| 131 | + solt: widget.solt, | ||
| 106 | )), | 132 | )), |
| 107 | )) | 133 | )) |
| 108 | ..add(ChangeNotifierProvider<TableManagerModel>( | 134 | ..add(ChangeNotifierProvider<TableManagerModel>( |
| @@ -145,10 +171,9 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | @@ -145,10 +171,9 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | ||
| 145 | }); | 171 | }); |
| 146 | } | 172 | } |
| 147 | } | 173 | } |
| 148 | - // if (widget.initialIndex == 0 || | ||
| 149 | - // if (widget.initialIndex == 1 && needRefreshTemp == false) return; | ||
| 150 | - if (widget.initialIndex == 0) return; | ||
| 151 | - _getIntent(); | 174 | + if (widget.initialIndex == 0 || |
| 175 | + widget.initialIndex == 1 && needRefreshTemp == false) return; | ||
| 176 | + _initNotification(); | ||
| 152 | Future.delayed(Duration(milliseconds: 30000), () { | 177 | Future.delayed(Duration(milliseconds: 30000), () { |
| 153 | ContactModel.getInstance().uploadLocalContact(context); | 178 | ContactModel.getInstance().uploadLocalContact(context); |
| 154 | if (needUpdate) { | 179 | if (needUpdate) { |
| @@ -165,6 +190,11 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | @@ -165,6 +190,11 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | ||
| 165 | }); | 190 | }); |
| 166 | } | 191 | } |
| 167 | 192 | ||
| 193 | + _initNotification() async { | ||
| 194 | + Map param = await Tools().getIntent(); | ||
| 195 | + _getIntent(param); | ||
| 196 | + } | ||
| 197 | + | ||
| 168 | _endTimerSeller() { | 198 | _endTimerSeller() { |
| 169 | if (timerSeller != null) { | 199 | if (timerSeller != null) { |
| 170 | timerSeller.cancel(); | 200 | timerSeller.cancel(); |
| @@ -202,9 +232,9 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | @@ -202,9 +232,9 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | ||
| 202 | } | 232 | } |
| 203 | 233 | ||
| 204 | //获取点击通知栏的自定义参数 | 234 | //获取点击通知栏的自定义参数 |
| 205 | - _getIntent() async { | 235 | + _getIntent(Map param) async { |
| 206 | _clearBadge(() {}); | 236 | _clearBadge(() {}); |
| 207 | - Map param = await Tools().getIntent(); | 237 | + |
| 208 | Map notifyParam = param; | 238 | Map notifyParam = param; |
| 209 | if (Platform.isIOS && param != null) { | 239 | if (Platform.isIOS && param != null) { |
| 210 | notifyParam = json.decode(param['custom'].toString()); | 240 | notifyParam = json.decode(param['custom'].toString()); |
| @@ -261,7 +291,21 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | @@ -261,7 +291,21 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | ||
| 261 | case "15": | 291 | case "15": |
| 262 | //店内消息 | 292 | //店内消息 |
| 263 | NavigatorUtil.goHomePage(context, | 293 | NavigatorUtil.goHomePage(context, |
| 264 | - initialIndex: 1, needRefresh: false, mine: true); | 294 | + initialIndex: 1, |
| 295 | + needRefresh: false, | ||
| 296 | + mine: true, | ||
| 297 | + dateTime: | ||
| 298 | + DateTime.parse(notifyParam['ddate'].replaceAll('/', '-')) | ||
| 299 | + .millisecondsSinceEpoch, | ||
| 300 | + solt: notifyParam['ddate_solt']); | ||
| 301 | + Map<String, String> params = { | ||
| 302 | + "sid": Provider.of<UserModel>(context, listen: false).user.sellerid, | ||
| 303 | + "id": notifyParam['mid'], | ||
| 304 | + "status": "is_read" | ||
| 305 | + }; | ||
| 306 | + MessageDialogModel messageDialogModel = | ||
| 307 | + Provider.of<MessageDialogModel>(context, listen: false); | ||
| 308 | + await messageDialogModel.setMessageStatus(context, params); | ||
| 265 | break; | 309 | break; |
| 266 | case "16": | 310 | case "16": |
| 267 | //经理取消预订 | 311 | //经理取消预订 |
| @@ -426,7 +470,13 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | @@ -426,7 +470,13 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | ||
| 426 | break; | 470 | break; |
| 427 | case "15": | 471 | case "15": |
| 428 | //店内消息 | 472 | //店内消息 |
| 429 | - NavigatorUtil.goHomePage(context, initialIndex: 1, mine: true); | 473 | + NavigatorUtil.goHomePage(context, |
| 474 | + initialIndex: 1, | ||
| 475 | + needRefresh: false, | ||
| 476 | + mine: true, | ||
| 477 | + dateTime: DateTime.parse(custom['ddate'].replaceAll('/', '-')) | ||
| 478 | + .millisecondsSinceEpoch, | ||
| 479 | + solt: custom['ddate_solt']); | ||
| 430 | Map<String, String> params = { | 480 | Map<String, String> params = { |
| 431 | "sid": Provider.of<UserModel>(context, listen: false) | 481 | "sid": Provider.of<UserModel>(context, listen: false) |
| 432 | .user | 482 | .user |
| @@ -562,12 +612,12 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | @@ -562,12 +612,12 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | ||
| 562 | super.didChangeAppLifecycleState(state); | 612 | super.didChangeAppLifecycleState(state); |
| 563 | switch (state) { | 613 | switch (state) { |
| 564 | case AppLifecycleState.resumed: //应用前台可见 | 614 | case AppLifecycleState.resumed: //应用前台可见 |
| 565 | - // if (widget.initialIndex == 1 && needRefreshTemp == false) { | ||
| 566 | - // } else { | ||
| 567 | - // _clearBadge(() { | ||
| 568 | - // _getAllUnMessages(); | ||
| 569 | - // }); | ||
| 570 | - // } | 615 | + if (widget.initialIndex == 1 && needRefreshTemp == false) { |
| 616 | + } else { | ||
| 617 | + _clearBadge(() { | ||
| 618 | + _getAllUnMessages(); | ||
| 619 | + }); | ||
| 620 | + } | ||
| 571 | 621 | ||
| 572 | break; | 622 | break; |
| 573 | case AppLifecycleState.inactive: | 623 | case AppLifecycleState.inactive: |
| @@ -66,6 +66,10 @@ class MessageDialogItemF extends StatelessWidget { | @@ -66,6 +66,10 @@ class MessageDialogItemF extends StatelessWidget { | ||
| 66 | titleText = "店内\n消息"; | 66 | titleText = "店内\n消息"; |
| 67 | bgcolor = MyColours.color_5F7292; | 67 | bgcolor = MyColours.color_5F7292; |
| 68 | btnname = 'store_info_go'; | 68 | btnname = 'store_info_go'; |
| 69 | + } else if (message.message_type == "16") { | ||
| 70 | + titleText = "取消\n预订"; | ||
| 71 | + bgcolor = MyColours.color_999999; | ||
| 72 | + btnname = 'cancel_go'; | ||
| 69 | } | 73 | } |
| 70 | if (isTreated) { | 74 | if (isTreated) { |
| 71 | bgcolor = MyColours.color_BFC4D4; | 75 | bgcolor = MyColours.color_BFC4D4; |
| @@ -96,6 +100,19 @@ class MessageDialogItemF extends StatelessWidget { | @@ -96,6 +100,19 @@ class MessageDialogItemF extends StatelessWidget { | ||
| 96 | }; | 100 | }; |
| 97 | await messageDialogModel.setMessageStatus(context, params); | 101 | await messageDialogModel.setMessageStatus(context, params); |
| 98 | bus.emit("refresh_untreated_num"); //刷新未读消息数目 | 102 | bus.emit("refresh_untreated_num"); //刷新未读消息数目 |
| 103 | + } else if (message.message_type == "16") { | ||
| 104 | + NavigatorUtil.goNotebookDetailPage( | ||
| 105 | + context, message.rid.toString(), message.uid); | ||
| 106 | + bus.emit("remove_untreated_message", message.id); | ||
| 107 | + | ||
| 108 | + Map<String, String> params = { | ||
| 109 | + "sid": | ||
| 110 | + Provider.of<UserModel>(context, listen: false).user.sellerid, | ||
| 111 | + "id": message.id, | ||
| 112 | + "status": message.message_type == "1" ? "is_read" : "is_handle" | ||
| 113 | + }; | ||
| 114 | + await messageDialogModel.setMessageStatus(context, params); | ||
| 115 | + bus.emit("refresh_untreated_num"); //刷新未读消息数目 | ||
| 99 | } else if (message.message_type == "1") { | 116 | } else if (message.message_type == "1") { |
| 100 | //提前点餐 | 117 | //提前点餐 |
| 101 | NavigatorUtil.goHasOrderFoodPage(context, rid: message.rid); | 118 | NavigatorUtil.goHasOrderFoodPage(context, rid: message.rid); |
| @@ -140,6 +157,25 @@ class MessageDialogItemF extends StatelessWidget { | @@ -140,6 +157,25 @@ class MessageDialogItemF extends StatelessWidget { | ||
| 140 | }; | 157 | }; |
| 141 | await messageDialogModel.setMessageStatus(context, params); | 158 | await messageDialogModel.setMessageStatus(context, params); |
| 142 | bus.emit("refresh_untreated_num"); //刷新未读消息数目 | 159 | bus.emit("refresh_untreated_num"); //刷新未读消息数目 |
| 160 | + } else if (message.message_type == "15") { | ||
| 161 | + //店内消息 | ||
| 162 | + NavigatorUtil.goHomePage(context, | ||
| 163 | + initialIndex: 1, | ||
| 164 | + needRefresh: false, | ||
| 165 | + mine: true, | ||
| 166 | + dateTime: DateTime.parse(message.ddate.replaceAll('/', '-')) | ||
| 167 | + .millisecondsSinceEpoch, | ||
| 168 | + solt: message.ddate_solt); | ||
| 169 | + bus.emit("remove_untreated_message", message.id); | ||
| 170 | + | ||
| 171 | + Map<String, String> params = { | ||
| 172 | + "sid": | ||
| 173 | + Provider.of<UserModel>(context, listen: false).user.sellerid, | ||
| 174 | + "id": message.id, | ||
| 175 | + "status": message.message_type == "1" ? "is_read" : "is_handle" | ||
| 176 | + }; | ||
| 177 | + await messageDialogModel.setMessageStatus(context, params); | ||
| 178 | + bus.emit("refresh_untreated_num"); //刷新未读消息数目 | ||
| 143 | } | 179 | } |
| 144 | }, | 180 | }, |
| 145 | child: Stack( | 181 | child: Stack( |
| @@ -211,81 +247,81 @@ class MessageDialogItemF extends StatelessWidget { | @@ -211,81 +247,81 @@ class MessageDialogItemF extends StatelessWidget { | ||
| 211 | fontSize: | 247 | fontSize: |
| 212 | ScreenUtil().setSp(32)), | 248 | ScreenUtil().setSp(32)), |
| 213 | )), | 249 | )), |
| 214 | - attr == '' || attr == null | ||
| 215 | - ? Container( | ||
| 216 | - margin: EdgeInsets.only( | ||
| 217 | - right: ScreenUtil() | ||
| 218 | - .setWidth(12)), | ||
| 219 | - padding: EdgeInsets.symmetric( | ||
| 220 | - horizontal: ScreenUtil() | ||
| 221 | - .setWidth(16), | ||
| 222 | - vertical: ScreenUtil() | ||
| 223 | - .setWidth(6)), | ||
| 224 | - decoration: BoxDecoration( | ||
| 225 | - color: isTreated | ||
| 226 | - ? MyColours.color_BFC4D4 | ||
| 227 | - : attr == '沉睡' | ||
| 228 | - ? Color.fromRGBO( | ||
| 229 | - 223, 33, 81, 1) | ||
| 230 | - : attr == '活跃' | ||
| 231 | - ? Color | ||
| 232 | - .fromRGBO( | ||
| 233 | - 81, | ||
| 234 | - 170, | ||
| 235 | - 94, | ||
| 236 | - 1) | ||
| 237 | - : attr == '流失' | ||
| 238 | - ? Color | ||
| 239 | - .fromRGBO( | ||
| 240 | - 109, | ||
| 241 | - 101, | ||
| 242 | - 248, | ||
| 243 | - 1) | ||
| 244 | - : Color | ||
| 245 | - .fromRGBO( | ||
| 246 | - 239, | ||
| 247 | - 143, | ||
| 248 | - 49, | ||
| 249 | - 1), | ||
| 250 | - borderRadius: | ||
| 251 | - BorderRadius.circular( | ||
| 252 | - 8)), | ||
| 253 | - child: Text( | ||
| 254 | - '活跃', | ||
| 255 | - style: TextStyle( | ||
| 256 | - color: MyColours | ||
| 257 | - .color_ffffff, | ||
| 258 | - fontSize: ScreenUtil() | ||
| 259 | - .setSp(24)), | ||
| 260 | - ), | ||
| 261 | - ) | ||
| 262 | - : SizedBox(), | ||
| 263 | - Container( | ||
| 264 | - padding: EdgeInsets.symmetric( | ||
| 265 | - horizontal: | ||
| 266 | - ScreenUtil().setWidth(16), | ||
| 267 | - vertical: | ||
| 268 | - ScreenUtil().setWidth(6)), | ||
| 269 | - decoration: BoxDecoration( | ||
| 270 | - border: Border.all( | ||
| 271 | - width: ScreenUtil().setWidth(2), | ||
| 272 | - color: isTreated | ||
| 273 | - ? MyColours.color_BFC4D4 | ||
| 274 | - : MyColours.color_F2995F, | ||
| 275 | - ), | ||
| 276 | - borderRadius: | ||
| 277 | - BorderRadius.circular(8)), | ||
| 278 | - child: Text( | ||
| 279 | - 'biaoqianvipdsds', | ||
| 280 | - // overflow: TextOverflow.ellipsis, | ||
| 281 | - style: TextStyle( | ||
| 282 | - color: isTreated | ||
| 283 | - ? MyColours.color_BFC4D4 | ||
| 284 | - : MyColours.color_F2995F, | ||
| 285 | - fontSize: | ||
| 286 | - ScreenUtil().setSp(24)), | ||
| 287 | - ), | ||
| 288 | - ) | 250 | + // attr == '' || attr == null |
| 251 | + // ? Container( | ||
| 252 | + // margin: EdgeInsets.only( | ||
| 253 | + // right: ScreenUtil() | ||
| 254 | + // .setWidth(12)), | ||
| 255 | + // padding: EdgeInsets.symmetric( | ||
| 256 | + // horizontal: ScreenUtil() | ||
| 257 | + // .setWidth(16), | ||
| 258 | + // vertical: ScreenUtil() | ||
| 259 | + // .setWidth(6)), | ||
| 260 | + // decoration: BoxDecoration( | ||
| 261 | + // color: isTreated | ||
| 262 | + // ? MyColours.color_BFC4D4 | ||
| 263 | + // : attr == '沉睡' | ||
| 264 | + // ? Color.fromRGBO( | ||
| 265 | + // 223, 33, 81, 1) | ||
| 266 | + // : attr == '活跃' | ||
| 267 | + // ? Color | ||
| 268 | + // .fromRGBO( | ||
| 269 | + // 81, | ||
| 270 | + // 170, | ||
| 271 | + // 94, | ||
| 272 | + // 1) | ||
| 273 | + // : attr == '流失' | ||
| 274 | + // ? Color | ||
| 275 | + // .fromRGBO( | ||
| 276 | + // 109, | ||
| 277 | + // 101, | ||
| 278 | + // 248, | ||
| 279 | + // 1) | ||
| 280 | + // : Color | ||
| 281 | + // .fromRGBO( | ||
| 282 | + // 239, | ||
| 283 | + // 143, | ||
| 284 | + // 49, | ||
| 285 | + // 1), | ||
| 286 | + // borderRadius: | ||
| 287 | + // BorderRadius.circular( | ||
| 288 | + // 8)), | ||
| 289 | + // child: Text( | ||
| 290 | + // '活跃', | ||
| 291 | + // style: TextStyle( | ||
| 292 | + // color: MyColours | ||
| 293 | + // .color_ffffff, | ||
| 294 | + // fontSize: ScreenUtil() | ||
| 295 | + // .setSp(24)), | ||
| 296 | + // ), | ||
| 297 | + // ) | ||
| 298 | + // : SizedBox(), | ||
| 299 | + // Container( | ||
| 300 | + // padding: EdgeInsets.symmetric( | ||
| 301 | + // horizontal: | ||
| 302 | + // ScreenUtil().setWidth(16), | ||
| 303 | + // vertical: | ||
| 304 | + // ScreenUtil().setWidth(6)), | ||
| 305 | + // decoration: BoxDecoration( | ||
| 306 | + // border: Border.all( | ||
| 307 | + // width: ScreenUtil().setWidth(2), | ||
| 308 | + // color: isTreated | ||
| 309 | + // ? MyColours.color_BFC4D4 | ||
| 310 | + // : MyColours.color_F2995F, | ||
| 311 | + // ), | ||
| 312 | + // borderRadius: | ||
| 313 | + // BorderRadius.circular(8)), | ||
| 314 | + // child: Text( | ||
| 315 | + // 'biaoqianvipdsds', | ||
| 316 | + // // overflow: TextOverflow.ellipsis, | ||
| 317 | + // style: TextStyle( | ||
| 318 | + // color: isTreated | ||
| 319 | + // ? MyColours.color_BFC4D4 | ||
| 320 | + // : MyColours.color_F2995F, | ||
| 321 | + // fontSize: | ||
| 322 | + // ScreenUtil().setSp(24)), | ||
| 323 | + // ), | ||
| 324 | + // ) | ||
| 289 | ]); | 325 | ]); |
| 290 | })), | 326 | })), |
| 291 | VEmptyView(16), | 327 | VEmptyView(16), |
| @@ -315,7 +351,9 @@ class MessageDialogItemF extends StatelessWidget { | @@ -315,7 +351,9 @@ class MessageDialogItemF extends StatelessWidget { | ||
| 315 | ], | 351 | ], |
| 316 | )) | 352 | )) |
| 317 | : SizedBox(), | 353 | : SizedBox(), |
| 318 | - message.message_type == "11" || message.message_type == "1" | 354 | + message.message_type == "11" || |
| 355 | + message.message_type == "16" || | ||
| 356 | + message.message_type == "1" | ||
| 319 | ? Column( | 357 | ? Column( |
| 320 | crossAxisAlignment: CrossAxisAlignment.start, | 358 | crossAxisAlignment: CrossAxisAlignment.start, |
| 321 | children: [ | 359 | children: [ |
| @@ -345,7 +383,9 @@ class MessageDialogItemF extends StatelessWidget { | @@ -345,7 +383,9 @@ class MessageDialogItemF extends StatelessWidget { | ||
| 345 | message.message_type == "1" | 383 | message.message_type == "1" |
| 346 | ? SizedBox() | 384 | ? SizedBox() |
| 347 | : Text( | 385 | : Text( |
| 348 | - true ? '取消操作人:顾客在线取消' : '取消操作人:方硕', | 386 | + message.message_type == "11" |
| 387 | + ? '取消操作人:顾客在线取消' | ||
| 388 | + : '取消操作人:${message.uname}', | ||
| 349 | style: TextStyle( | 389 | style: TextStyle( |
| 350 | color: isTreated | 390 | color: isTreated |
| 351 | ? MyColours.color_BFC4D4 | 391 | ? MyColours.color_BFC4D4 |
| @@ -355,12 +395,12 @@ class MessageDialogItemF extends StatelessWidget { | @@ -355,12 +395,12 @@ class MessageDialogItemF extends StatelessWidget { | ||
| 355 | ], | 395 | ], |
| 356 | ) | 396 | ) |
| 357 | : SizedBox(), | 397 | : SizedBox(), |
| 358 | - message.message_type == "店内消息" | 398 | + message.message_type == "15" |
| 359 | ? Column( | 399 | ? Column( |
| 360 | crossAxisAlignment: CrossAxisAlignment.start, | 400 | crossAxisAlignment: CrossAxisAlignment.start, |
| 361 | children: [ | 401 | children: [ |
| 362 | Text( | 402 | Text( |
| 363 | - "请确认 2022-04-02 午餐 客人是否会如约到店!", | 403 | + "请确认 ${DateUtil.formatDate(DateTime.parse(message.ddate.replaceAll('/', '-')), format: DateFormats.y_mo_d)} ${message.dsoltStr} \n客人是否会如约到店!", |
| 364 | style: TextStyle( | 404 | style: TextStyle( |
| 365 | color: isTreated | 405 | color: isTreated |
| 366 | ? MyColours.color_BFC4D4 | 406 | ? MyColours.color_BFC4D4 |
| @@ -414,6 +454,23 @@ class MessageDialogItemF extends StatelessWidget { | @@ -414,6 +454,23 @@ class MessageDialogItemF extends StatelessWidget { | ||
| 414 | await messageDialogModel.setMessageStatus( | 454 | await messageDialogModel.setMessageStatus( |
| 415 | context, params); | 455 | context, params); |
| 416 | bus.emit("refresh_untreated_num"); //刷新未读消息数目 | 456 | bus.emit("refresh_untreated_num"); //刷新未读消息数目 |
| 457 | + } else if (message.message_type == "16") { | ||
| 458 | + NavigatorUtil.goNotebookDetailPage( | ||
| 459 | + context, message.rid.toString(), message.uid); | ||
| 460 | + bus.emit("remove_untreated_message", message.id); | ||
| 461 | + | ||
| 462 | + Map<String, String> params = { | ||
| 463 | + "sid": Provider.of<UserModel>(context, listen: false) | ||
| 464 | + .user | ||
| 465 | + .sellerid, | ||
| 466 | + "id": message.id, | ||
| 467 | + "status": message.message_type == "1" | ||
| 468 | + ? "is_read" | ||
| 469 | + : "is_handle" | ||
| 470 | + }; | ||
| 471 | + await messageDialogModel.setMessageStatus( | ||
| 472 | + context, params); | ||
| 473 | + bus.emit("refresh_untreated_num"); //刷新未读消息数目 | ||
| 417 | } else if (message.message_type == "1") { | 474 | } else if (message.message_type == "1") { |
| 418 | //提前点餐 | 475 | //提前点餐 |
| 419 | NavigatorUtil.goHasOrderFoodPage(context, | 476 | NavigatorUtil.goHasOrderFoodPage(context, |
| @@ -472,6 +529,29 @@ class MessageDialogItemF extends StatelessWidget { | @@ -472,6 +529,29 @@ class MessageDialogItemF extends StatelessWidget { | ||
| 472 | await messageDialogModel.setMessageStatus( | 529 | await messageDialogModel.setMessageStatus( |
| 473 | context, params); | 530 | context, params); |
| 474 | bus.emit("refresh_untreated_num"); //刷新未读消息数目 | 531 | bus.emit("refresh_untreated_num"); //刷新未读消息数目 |
| 532 | + } else if (message.message_type == "15") { | ||
| 533 | + //店内消息 | ||
| 534 | + NavigatorUtil.goHomePage(context, | ||
| 535 | + initialIndex: 1, | ||
| 536 | + needRefresh: false, | ||
| 537 | + mine: true, | ||
| 538 | + dateTime: | ||
| 539 | + DateTime.parse(message.ddate.replaceAll('/', '-')) | ||
| 540 | + .millisecondsSinceEpoch, | ||
| 541 | + solt: message.ddate_solt); | ||
| 542 | + bus.emit("remove_untreated_message", message.id); | ||
| 543 | + Map<String, String> params = { | ||
| 544 | + "sid": Provider.of<UserModel>(context, listen: false) | ||
| 545 | + .user | ||
| 546 | + .sellerid, | ||
| 547 | + "id": message.id, | ||
| 548 | + "status": message.message_type == "1" | ||
| 549 | + ? "is_read" | ||
| 550 | + : "is_handle" | ||
| 551 | + }; | ||
| 552 | + await messageDialogModel.setMessageStatus( | ||
| 553 | + context, params); | ||
| 554 | + bus.emit("refresh_untreated_num"); //刷新未读消息数目 | ||
| 475 | } | 555 | } |
| 476 | }, | 556 | }, |
| 477 | child: Image.asset( | 557 | child: Image.asset( |
| @@ -62,6 +62,10 @@ class MessageItemF extends StatelessWidget { | @@ -62,6 +62,10 @@ class MessageItemF extends StatelessWidget { | ||
| 62 | titleText = "店内\n消息"; | 62 | titleText = "店内\n消息"; |
| 63 | bgcolor = MyColours.color_5F7292; | 63 | bgcolor = MyColours.color_5F7292; |
| 64 | btnname = 'store_info_go'; | 64 | btnname = 'store_info_go'; |
| 65 | + } else if (message.message_type == "16") { | ||
| 66 | + titleText = "取消\n预订"; | ||
| 67 | + bgcolor = MyColours.color_999999; | ||
| 68 | + btnname = 'cancel_go'; | ||
| 65 | } | 69 | } |
| 66 | if (isTreated) { | 70 | if (isTreated) { |
| 67 | bgcolor = MyColours.color_BFC4D4; | 71 | bgcolor = MyColours.color_BFC4D4; |
| @@ -101,6 +105,15 @@ class MessageItemF extends StatelessWidget { | @@ -101,6 +105,15 @@ class MessageItemF extends StatelessWidget { | ||
| 101 | } else if (message.message_type == "14") { | 105 | } else if (message.message_type == "14") { |
| 102 | //发票详情页面跳转 | 106 | //发票详情页面跳转 |
| 103 | NavigatorUtil.goInvoiceDetailPage(context, rid: '${message.rid}'); | 107 | NavigatorUtil.goInvoiceDetailPage(context, rid: '${message.rid}'); |
| 108 | + } else if (message.message_type == "15") { | ||
| 109 | + //店内消息 | ||
| 110 | + NavigatorUtil.goHomePage(context, | ||
| 111 | + initialIndex: 1, | ||
| 112 | + needRefresh: false, | ||
| 113 | + mine: true, | ||
| 114 | + dateTime: DateTime.parse(message.ddate.replaceAll('/', '-')) | ||
| 115 | + .millisecondsSinceEpoch, | ||
| 116 | + solt: message.ddate_solt); | ||
| 104 | } | 117 | } |
| 105 | } else { | 118 | } else { |
| 106 | messageDialogModel.removeMessage(message.id); | 119 | messageDialogModel.removeMessage(message.id); |
| @@ -186,7 +199,12 @@ class MessageItemF extends StatelessWidget { | @@ -186,7 +199,12 @@ class MessageItemF extends StatelessWidget { | ||
| 186 | } else if (message.message_type == "15") { | 199 | } else if (message.message_type == "15") { |
| 187 | //店内消息 | 200 | //店内消息 |
| 188 | NavigatorUtil.goHomePage(context, | 201 | NavigatorUtil.goHomePage(context, |
| 189 | - initialIndex: 1, needRefresh: false, mine: true); | 202 | + initialIndex: 1, |
| 203 | + needRefresh: false, | ||
| 204 | + mine: true, | ||
| 205 | + dateTime: DateTime.parse(message.ddate.replaceAll('/', '-')) | ||
| 206 | + .millisecondsSinceEpoch, | ||
| 207 | + solt: message.ddate_solt); | ||
| 190 | bus.emit("remove_untreated_message", message.id); | 208 | bus.emit("remove_untreated_message", message.id); |
| 191 | 209 | ||
| 192 | Map<String, String> params = { | 210 | Map<String, String> params = { |
| @@ -270,81 +288,81 @@ class MessageItemF extends StatelessWidget { | @@ -270,81 +288,81 @@ class MessageItemF extends StatelessWidget { | ||
| 270 | fontSize: | 288 | fontSize: |
| 271 | ScreenUtil().setSp(32)), | 289 | ScreenUtil().setSp(32)), |
| 272 | )), | 290 | )), |
| 273 | - attr == '' || attr == null | ||
| 274 | - ? Container( | ||
| 275 | - margin: EdgeInsets.only( | ||
| 276 | - right: ScreenUtil() | ||
| 277 | - .setWidth(12)), | ||
| 278 | - padding: EdgeInsets.symmetric( | ||
| 279 | - horizontal: ScreenUtil() | ||
| 280 | - .setWidth(16), | ||
| 281 | - vertical: ScreenUtil() | ||
| 282 | - .setWidth(6)), | ||
| 283 | - decoration: BoxDecoration( | ||
| 284 | - color: isTreated | ||
| 285 | - ? MyColours.color_BFC4D4 | ||
| 286 | - : attr == '沉睡' | ||
| 287 | - ? Color.fromRGBO( | ||
| 288 | - 223, 33, 81, 1) | ||
| 289 | - : attr == '活跃' | ||
| 290 | - ? Color | ||
| 291 | - .fromRGBO( | ||
| 292 | - 81, | ||
| 293 | - 170, | ||
| 294 | - 94, | ||
| 295 | - 1) | ||
| 296 | - : attr == '流失' | ||
| 297 | - ? Color | ||
| 298 | - .fromRGBO( | ||
| 299 | - 109, | ||
| 300 | - 101, | ||
| 301 | - 248, | ||
| 302 | - 1) | ||
| 303 | - : Color | ||
| 304 | - .fromRGBO( | ||
| 305 | - 239, | ||
| 306 | - 143, | ||
| 307 | - 49, | ||
| 308 | - 1), | ||
| 309 | - borderRadius: | ||
| 310 | - BorderRadius.circular( | ||
| 311 | - 8)), | ||
| 312 | - child: Text( | ||
| 313 | - '活跃', | ||
| 314 | - style: TextStyle( | ||
| 315 | - color: MyColours | ||
| 316 | - .color_ffffff, | ||
| 317 | - fontSize: ScreenUtil() | ||
| 318 | - .setSp(24)), | ||
| 319 | - ), | ||
| 320 | - ) | ||
| 321 | - : SizedBox(), | ||
| 322 | - Container( | ||
| 323 | - padding: EdgeInsets.symmetric( | ||
| 324 | - horizontal: | ||
| 325 | - ScreenUtil().setWidth(16), | ||
| 326 | - vertical: | ||
| 327 | - ScreenUtil().setWidth(6)), | ||
| 328 | - decoration: BoxDecoration( | ||
| 329 | - border: Border.all( | ||
| 330 | - width: ScreenUtil().setWidth(2), | ||
| 331 | - color: isTreated | ||
| 332 | - ? MyColours.color_BFC4D4 | ||
| 333 | - : MyColours.color_F2995F, | ||
| 334 | - ), | ||
| 335 | - borderRadius: | ||
| 336 | - BorderRadius.circular(8)), | ||
| 337 | - child: Text( | ||
| 338 | - 'biaoqianvipdsds', | ||
| 339 | - // overflow: TextOverflow.ellipsis, | ||
| 340 | - style: TextStyle( | ||
| 341 | - color: isTreated | ||
| 342 | - ? MyColours.color_BFC4D4 | ||
| 343 | - : MyColours.color_F2995F, | ||
| 344 | - fontSize: | ||
| 345 | - ScreenUtil().setSp(24)), | ||
| 346 | - ), | ||
| 347 | - ) | 291 | + // attr == '' || attr == null |
| 292 | + // ? Container( | ||
| 293 | + // margin: EdgeInsets.only( | ||
| 294 | + // right: ScreenUtil() | ||
| 295 | + // .setWidth(12)), | ||
| 296 | + // padding: EdgeInsets.symmetric( | ||
| 297 | + // horizontal: ScreenUtil() | ||
| 298 | + // .setWidth(16), | ||
| 299 | + // vertical: ScreenUtil() | ||
| 300 | + // .setWidth(6)), | ||
| 301 | + // decoration: BoxDecoration( | ||
| 302 | + // color: isTreated | ||
| 303 | + // ? MyColours.color_BFC4D4 | ||
| 304 | + // : attr == '沉睡' | ||
| 305 | + // ? Color.fromRGBO( | ||
| 306 | + // 223, 33, 81, 1) | ||
| 307 | + // : attr == '活跃' | ||
| 308 | + // ? Color | ||
| 309 | + // .fromRGBO( | ||
| 310 | + // 81, | ||
| 311 | + // 170, | ||
| 312 | + // 94, | ||
| 313 | + // 1) | ||
| 314 | + // : attr == '流失' | ||
| 315 | + // ? Color | ||
| 316 | + // .fromRGBO( | ||
| 317 | + // 109, | ||
| 318 | + // 101, | ||
| 319 | + // 248, | ||
| 320 | + // 1) | ||
| 321 | + // : Color | ||
| 322 | + // .fromRGBO( | ||
| 323 | + // 239, | ||
| 324 | + // 143, | ||
| 325 | + // 49, | ||
| 326 | + // 1), | ||
| 327 | + // borderRadius: | ||
| 328 | + // BorderRadius.circular( | ||
| 329 | + // 8)), | ||
| 330 | + // child: Text( | ||
| 331 | + // '活跃', | ||
| 332 | + // style: TextStyle( | ||
| 333 | + // color: MyColours | ||
| 334 | + // .color_ffffff, | ||
| 335 | + // fontSize: ScreenUtil() | ||
| 336 | + // .setSp(24)), | ||
| 337 | + // ), | ||
| 338 | + // ) | ||
| 339 | + // : SizedBox(), | ||
| 340 | + // Container( | ||
| 341 | + // padding: EdgeInsets.symmetric( | ||
| 342 | + // horizontal: | ||
| 343 | + // ScreenUtil().setWidth(16), | ||
| 344 | + // vertical: | ||
| 345 | + // ScreenUtil().setWidth(6)), | ||
| 346 | + // decoration: BoxDecoration( | ||
| 347 | + // border: Border.all( | ||
| 348 | + // width: ScreenUtil().setWidth(2), | ||
| 349 | + // color: isTreated | ||
| 350 | + // ? MyColours.color_BFC4D4 | ||
| 351 | + // : MyColours.color_F2995F, | ||
| 352 | + // ), | ||
| 353 | + // borderRadius: | ||
| 354 | + // BorderRadius.circular(8)), | ||
| 355 | + // child: Text( | ||
| 356 | + // 'biaoqianvipdsds', | ||
| 357 | + // // overflow: TextOverflow.ellipsis, | ||
| 358 | + // style: TextStyle( | ||
| 359 | + // color: isTreated | ||
| 360 | + // ? MyColours.color_BFC4D4 | ||
| 361 | + // : MyColours.color_F2995F, | ||
| 362 | + // fontSize: | ||
| 363 | + // ScreenUtil().setSp(24)), | ||
| 364 | + // ), | ||
| 365 | + // ) | ||
| 348 | ]); | 366 | ]); |
| 349 | })), | 367 | })), |
| 350 | VEmptyView(16), | 368 | VEmptyView(16), |
| @@ -377,7 +395,9 @@ class MessageItemF extends StatelessWidget { | @@ -377,7 +395,9 @@ class MessageItemF extends StatelessWidget { | ||
| 377 | ], | 395 | ], |
| 378 | )) | 396 | )) |
| 379 | : SizedBox(), | 397 | : SizedBox(), |
| 380 | - message.message_type == "11" || message.message_type == "1" | 398 | + message.message_type == "11" || |
| 399 | + message.message_type == "16" || | ||
| 400 | + message.message_type == "1" | ||
| 381 | ? Column( | 401 | ? Column( |
| 382 | crossAxisAlignment: CrossAxisAlignment.start, | 402 | crossAxisAlignment: CrossAxisAlignment.start, |
| 383 | children: [ | 403 | children: [ |
| @@ -430,7 +450,9 @@ class MessageItemF extends StatelessWidget { | @@ -430,7 +450,9 @@ class MessageItemF extends StatelessWidget { | ||
| 430 | message.message_type == "1" | 450 | message.message_type == "1" |
| 431 | ? SizedBox() | 451 | ? SizedBox() |
| 432 | : Text( | 452 | : Text( |
| 433 | - '取消操作人:${message.cancelName}', | 453 | + message.message_type == "11" |
| 454 | + ? '取消操作人:顾客在线取消' | ||
| 455 | + : '取消操作人:${message.uname}', | ||
| 434 | style: TextStyle( | 456 | style: TextStyle( |
| 435 | color: isTreated | 457 | color: isTreated |
| 436 | ? MyColours.color_BFC4D4 | 458 | ? MyColours.color_BFC4D4 |
| @@ -573,8 +595,15 @@ class MessageItemF extends StatelessWidget { | @@ -573,8 +595,15 @@ class MessageItemF extends StatelessWidget { | ||
| 573 | bus.emit("refresh_untreated_num"); //刷新未读消息数目 | 595 | bus.emit("refresh_untreated_num"); //刷新未读消息数目 |
| 574 | } else if (message.message_type == "15") { | 596 | } else if (message.message_type == "15") { |
| 575 | //店内消息 | 597 | //店内消息 |
| 598 | + | ||
| 576 | NavigatorUtil.goHomePage(context, | 599 | NavigatorUtil.goHomePage(context, |
| 577 | - initialIndex: 1, needRefresh: false, mine: true); | 600 | + initialIndex: 1, |
| 601 | + needRefresh: false, | ||
| 602 | + mine: true, | ||
| 603 | + dateTime: | ||
| 604 | + DateTime.parse(message.ddate.replaceAll('/', '-')) | ||
| 605 | + .millisecondsSinceEpoch, | ||
| 606 | + solt: message.ddate_solt); | ||
| 578 | bus.emit("remove_untreated_message", message.id); | 607 | bus.emit("remove_untreated_message", message.id); |
| 579 | Map<String, String> params = { | 608 | Map<String, String> params = { |
| 580 | "sid": Provider.of<UserModel>(context, listen: false) | 609 | "sid": Provider.of<UserModel>(context, listen: false) |
| @@ -23,7 +23,11 @@ import 'package:provider/provider.dart'; | @@ -23,7 +23,11 @@ import 'package:provider/provider.dart'; | ||
| 23 | class NoteBookPage extends StatefulWidget { | 23 | class NoteBookPage extends StatefulWidget { |
| 24 | final int tabIndex; | 24 | final int tabIndex; |
| 25 | 25 | ||
| 26 | - const NoteBookPage({Key key, this.tabIndex = 0}) : super(key: key); | 26 | + final DateTime date; |
| 27 | + final String solt; | ||
| 28 | + | ||
| 29 | + const NoteBookPage({Key key, this.tabIndex = 0, this.date, this.solt}) | ||
| 30 | + : super(key: key); | ||
| 27 | @override | 31 | @override |
| 28 | State<StatefulWidget> createState() { | 32 | State<StatefulWidget> createState() { |
| 29 | // TODO: implement createState | 33 | // TODO: implement createState |
| @@ -75,69 +79,84 @@ class NoteBookPageState extends State<NoteBookPage> { | @@ -75,69 +79,84 @@ class NoteBookPageState extends State<NoteBookPage> { | ||
| 75 | 79 | ||
| 76 | //初始化时间 | 80 | //初始化时间 |
| 77 | _initTime() { | 81 | _initTime() { |
| 78 | - dateTimeNow = DateTime.now(); | 82 | + dateTimeNow = widget.date != null ? widget.date : DateTime.now(); |
| 79 | dateText = "${dateTimeNow.year}年 " + | 83 | dateText = "${dateTimeNow.year}年 " + |
| 80 | Utils.addZeroNumber(dateTimeNow.month) + | 84 | Utils.addZeroNumber(dateTimeNow.month) + |
| 81 | "月" + | 85 | "月" + |
| 82 | Utils.addZeroNumber(dateTimeNow.day) + | 86 | Utils.addZeroNumber(dateTimeNow.day) + |
| 83 | - "日" + | ||
| 84 | - " 今天"; | 87 | + "日"; |
| 88 | + DateTime dateNow = DateTime.now(); | ||
| 89 | + | ||
| 90 | + if (Utils.isOneDay(dateTimeNow, dateNow)) { | ||
| 91 | + dateText += " 今天"; | ||
| 92 | + } else if (Utils.isOneDay(dateTimeNow, dateNow.add(Duration(days: 1)))) { | ||
| 93 | + dateText += " 明天"; | ||
| 94 | + } else if (Utils.isOneDay(dateTimeNow, dateNow.add(Duration(days: 2)))) { | ||
| 95 | + dateText += " 后天"; | ||
| 96 | + } else { | ||
| 97 | + dateText += " 周${Utils.formatWeekDayNum(dateTimeNow.weekday)}"; | ||
| 98 | + } | ||
| 99 | + | ||
| 85 | morning = | 100 | morning = |
| 86 | userModel.user.morning.isEmpty ? "00:00-00:00" : userModel.user.morning; | 101 | userModel.user.morning.isEmpty ? "00:00-00:00" : userModel.user.morning; |
| 87 | noon = userModel.user.noon.isEmpty ? "00:00-00:00" : userModel.user.noon; | 102 | noon = userModel.user.noon.isEmpty ? "00:00-00:00" : userModel.user.noon; |
| 88 | night = userModel.user.night.isEmpty ? "00:00-00:00" : userModel.user.night; | 103 | night = userModel.user.night.isEmpty ? "00:00-00:00" : userModel.user.night; |
| 89 | - if (morning != '' && | ||
| 90 | - dateTimeNow.isBefore(DateTime.parse(dateTimeNow.year.toString() + | ||
| 91 | - "-" + | ||
| 92 | - Utils.addZeroNumber(dateTimeNow.month) + | ||
| 93 | - "-" + | ||
| 94 | - Utils.addZeroNumber(dateTimeNow.day) + | ||
| 95 | - " " + | ||
| 96 | - morning.split("-")[1] + | ||
| 97 | - ":00"))) { | ||
| 98 | - //未过早市 | ||
| 99 | - currTimeIndex = 1; | ||
| 100 | - } else if (noon != '' && | ||
| 101 | - dateTimeNow.isAfter(DateTime.parse(dateTimeNow.year.toString() + | ||
| 102 | - "-" + | ||
| 103 | - Utils.addZeroNumber(dateTimeNow.month) + | ||
| 104 | - "-" + | ||
| 105 | - Utils.addZeroNumber(dateTimeNow.day) + | ||
| 106 | - " " + | ||
| 107 | - morning.split("-")[1] + | ||
| 108 | - ":00")) && | ||
| 109 | - dateTimeNow.isBefore(DateTime.parse(dateTimeNow.year.toString() + | ||
| 110 | - "-" + | ||
| 111 | - Utils.addZeroNumber(dateTimeNow.month) + | ||
| 112 | - "-" + | ||
| 113 | - Utils.addZeroNumber(dateTimeNow.day) + | ||
| 114 | - " " + | ||
| 115 | - noon.split("-")[1] + | ||
| 116 | - ":00"))) { | ||
| 117 | - //过了早市,未过午市 | ||
| 118 | - currTimeIndex = 2; | ||
| 119 | - } else if (night != '' && | ||
| 120 | - dateTimeNow.isAfter(DateTime.parse(dateTimeNow.year.toString() + | ||
| 121 | - "-" + | ||
| 122 | - Utils.addZeroNumber(dateTimeNow.month) + | ||
| 123 | - "-" + | ||
| 124 | - Utils.addZeroNumber(dateTimeNow.day) + | ||
| 125 | - " " + | ||
| 126 | - noon.split("-")[1] + | ||
| 127 | - ":00")) && | ||
| 128 | - dateTimeNow.isBefore(DateTime.parse(dateTimeNow.year.toString() + | ||
| 129 | - "-" + | ||
| 130 | - Utils.addZeroNumber(dateTimeNow.month) + | ||
| 131 | - "-" + | ||
| 132 | - Utils.addZeroNumber(dateTimeNow.day) + | ||
| 133 | - " " + | ||
| 134 | - night.split("-")[1] + | ||
| 135 | - ":00"))) { | ||
| 136 | - //过了午市,未过晚市 | ||
| 137 | - currTimeIndex = 3; | 104 | + if (widget.solt != null) { |
| 105 | + currTimeIndex = int.parse(widget.solt); | ||
| 138 | } else { | 106 | } else { |
| 139 | - //过了晚市 | ||
| 140 | - currTimeIndex = 3; | 107 | + if (morning != '' && |
| 108 | + dateTimeNow.isBefore(DateTime.parse(dateTimeNow.year.toString() + | ||
| 109 | + "-" + | ||
| 110 | + Utils.addZeroNumber(dateTimeNow.month) + | ||
| 111 | + "-" + | ||
| 112 | + Utils.addZeroNumber(dateTimeNow.day) + | ||
| 113 | + " " + | ||
| 114 | + morning.split("-")[1] + | ||
| 115 | + ":00"))) { | ||
| 116 | + //未过早市 | ||
| 117 | + currTimeIndex = 1; | ||
| 118 | + } else if (noon != '' && | ||
| 119 | + dateTimeNow.isAfter(DateTime.parse(dateTimeNow.year.toString() + | ||
| 120 | + "-" + | ||
| 121 | + Utils.addZeroNumber(dateTimeNow.month) + | ||
| 122 | + "-" + | ||
| 123 | + Utils.addZeroNumber(dateTimeNow.day) + | ||
| 124 | + " " + | ||
| 125 | + morning.split("-")[1] + | ||
| 126 | + ":00")) && | ||
| 127 | + dateTimeNow.isBefore(DateTime.parse(dateTimeNow.year.toString() + | ||
| 128 | + "-" + | ||
| 129 | + Utils.addZeroNumber(dateTimeNow.month) + | ||
| 130 | + "-" + | ||
| 131 | + Utils.addZeroNumber(dateTimeNow.day) + | ||
| 132 | + " " + | ||
| 133 | + noon.split("-")[1] + | ||
| 134 | + ":00"))) { | ||
| 135 | + //过了早市,未过午市 | ||
| 136 | + currTimeIndex = 2; | ||
| 137 | + } else if (night != '' && | ||
| 138 | + dateTimeNow.isAfter(DateTime.parse(dateTimeNow.year.toString() + | ||
| 139 | + "-" + | ||
| 140 | + Utils.addZeroNumber(dateTimeNow.month) + | ||
| 141 | + "-" + | ||
| 142 | + Utils.addZeroNumber(dateTimeNow.day) + | ||
| 143 | + " " + | ||
| 144 | + noon.split("-")[1] + | ||
| 145 | + ":00")) && | ||
| 146 | + dateTimeNow.isBefore(DateTime.parse(dateTimeNow.year.toString() + | ||
| 147 | + "-" + | ||
| 148 | + Utils.addZeroNumber(dateTimeNow.month) + | ||
| 149 | + "-" + | ||
| 150 | + Utils.addZeroNumber(dateTimeNow.day) + | ||
| 151 | + " " + | ||
| 152 | + night.split("-")[1] + | ||
| 153 | + ":00"))) { | ||
| 154 | + //过了午市,未过晚市 | ||
| 155 | + currTimeIndex = 3; | ||
| 156 | + } else { | ||
| 157 | + //过了晚市 | ||
| 158 | + currTimeIndex = 3; | ||
| 159 | + } | ||
| 141 | } | 160 | } |
| 142 | } | 161 | } |
| 143 | 162 |
| @@ -234,7 +234,7 @@ class MessageModel extends ChangeNotifier { | @@ -234,7 +234,7 @@ class MessageModel extends ChangeNotifier { | ||
| 234 | removeUntreatedMessageByMid(String mid) { | 234 | removeUntreatedMessageByMid(String mid) { |
| 235 | messages.removeWhere((element) => element.id == mid); | 235 | messages.removeWhere((element) => element.id == mid); |
| 236 | if (messages.length == 0) { | 236 | if (messages.length == 0) { |
| 237 | - pageState = PageState.Empty; | 237 | + pageStateUn = PageState.Empty; |
| 238 | } | 238 | } |
| 239 | notifyListeners(); | 239 | notifyListeners(); |
| 240 | } | 240 | } |
| @@ -55,9 +55,13 @@ class NavigatorUtil { | @@ -55,9 +55,13 @@ class NavigatorUtil { | ||
| 55 | 55 | ||
| 56 | /// 首页 | 56 | /// 首页 |
| 57 | static void goHomePage(BuildContext context, | 57 | static void goHomePage(BuildContext context, |
| 58 | - {int initialIndex = 1, needRefresh = true, mine = false}) { | 58 | + {int initialIndex = 1, |
| 59 | + needRefresh = true, | ||
| 60 | + mine = false, | ||
| 61 | + int dateTime, | ||
| 62 | + String solt}) { | ||
| 59 | _navigateTo(context, | 63 | _navigateTo(context, |
| 60 | - "${Routes.home}?initialIndex=$initialIndex&needRefresh=$needRefresh&mine=$mine", | 64 | + "${Routes.home}?initialIndex=$initialIndex&needRefresh=$needRefresh&mine=$mine&dateTime=$dateTime&solt=$solt", |
| 61 | clearStack: true); | 65 | clearStack: true); |
| 62 | } | 66 | } |
| 63 | 67 |
| @@ -148,11 +148,18 @@ var homeHandler = new Handler( | @@ -148,11 +148,18 @@ var homeHandler = new Handler( | ||
| 148 | String initialIndex = params["initialIndex"].first; | 148 | String initialIndex = params["initialIndex"].first; |
| 149 | bool needRefresh = FluroConvertUtils.string2bool(params["needRefresh"].first); | 149 | bool needRefresh = FluroConvertUtils.string2bool(params["needRefresh"].first); |
| 150 | bool mine = FluroConvertUtils.string2bool(params["mine"].first); | 150 | bool mine = FluroConvertUtils.string2bool(params["mine"].first); |
| 151 | + | ||
| 152 | + String solt = params["solt"].first; | ||
| 153 | + | ||
| 154 | + DateTime dateTime = | ||
| 155 | + DateTime.fromMillisecondsSinceEpoch(int.parse(params["dateTime"].first)); | ||
| 156 | + | ||
| 151 | return HomePage( | 157 | return HomePage( |
| 152 | - initialIndex: int.parse(initialIndex), | ||
| 153 | - needReresh: needRefresh, | ||
| 154 | - mine: mine, | ||
| 155 | - ); | 158 | + initialIndex: int.parse(initialIndex), |
| 159 | + needReresh: needRefresh, | ||
| 160 | + mine: mine, | ||
| 161 | + date: dateTime, | ||
| 162 | + solt: solt); | ||
| 156 | }); | 163 | }); |
| 157 | 164 | ||
| 158 | // 跳转预订详情页 | 165 | // 跳转预订详情页 |
| @@ -2974,7 +2974,7 @@ class DialogUtil { | @@ -2974,7 +2974,7 @@ class DialogUtil { | ||
| 2974 | isScrollControlled: true, | 2974 | isScrollControlled: true, |
| 2975 | builder: (BuildContext dialogContext) { | 2975 | builder: (BuildContext dialogContext) { |
| 2976 | Widget widget = Container( | 2976 | Widget widget = Container( |
| 2977 | - color: MyColours.color_ffffff, | 2977 | + color:messageModel.messages.length > 3 ? MyColours.color_24A4A8: MyColours.color_ffffff, |
| 2978 | child: Column( | 2978 | child: Column( |
| 2979 | mainAxisSize: MainAxisSize.min, | 2979 | mainAxisSize: MainAxisSize.min, |
| 2980 | children: <Widget>[ | 2980 | children: <Widget>[ |
| @@ -3008,7 +3008,7 @@ class DialogUtil { | @@ -3008,7 +3008,7 @@ class DialogUtil { | ||
| 3008 | padding: EdgeInsets.all( | 3008 | padding: EdgeInsets.all( |
| 3009 | ScreenUtil().setWidth(12)), | 3009 | ScreenUtil().setWidth(12)), |
| 3010 | child: Image.asset( | 3010 | child: Image.asset( |
| 3011 | - "assets/close1.png", | 3011 | + "assets/close.png", |
| 3012 | width: ScreenUtil().setWidth(28), | 3012 | width: ScreenUtil().setWidth(28), |
| 3013 | height: ScreenUtil().setWidth(28), | 3013 | height: ScreenUtil().setWidth(28), |
| 3014 | ), | 3014 | ), |
| @@ -1041,7 +1041,7 @@ packages: | @@ -1041,7 +1041,7 @@ packages: | ||
| 1041 | description: | 1041 | description: |
| 1042 | path: "." | 1042 | path: "." |
| 1043 | ref: "V1.1.6" | 1043 | ref: "V1.1.6" |
| 1044 | - resolved-ref: ccc583f7387bbc8a960aaf288bbb6815a0ebe112 | 1044 | + resolved-ref: bc1adc7f1d17d10a8de849fbdcb22b9f3e597d74 |
| 1045 | url: "https://github.com/TencentCloud/TPNS-Flutter-Plugin.git" | 1045 | url: "https://github.com/TencentCloud/TPNS-Flutter-Plugin.git" |
| 1046 | source: git | 1046 | source: git |
| 1047 | version: "1.1.6" | 1047 | version: "1.1.6" |
-
Please register or login to post a comment