Showing
13 changed files
with
628 additions
and
508 deletions
| @@ -13,12 +13,12 @@ if (flutterRoot == null) { | @@ -13,12 +13,12 @@ if (flutterRoot == null) { | ||
| 13 | 13 | ||
| 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') |
| 15 | if (flutterVersionCode == null) { | 15 | if (flutterVersionCode == null) { |
| 16 | - flutterVersionCode = '112' | 16 | + flutterVersionCode = '121' |
| 17 | } | 17 | } |
| 18 | 18 | ||
| 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') |
| 20 | if (flutterVersionName == null) { | 20 | if (flutterVersionName == null) { |
| 21 | - flutterVersionName = '1.1.2' | 21 | + flutterVersionName = '1.2.1' |
| 22 | } | 22 | } |
| 23 | 23 | ||
| 24 | apply plugin: 'com.android.application' | 24 | apply plugin: 'com.android.application' |
| @@ -31,12 +31,23 @@ | @@ -31,12 +31,23 @@ | ||
| 31 | <meta-data | 31 | <meta-data |
| 32 | android:name="io.flutter.embedding.android.SplashScreenDrawable" | 32 | android:name="io.flutter.embedding.android.SplashScreenDrawable" |
| 33 | android:resource="@drawable/launch_background" /> | 33 | android:resource="@drawable/launch_background" /> |
| 34 | + | ||
| 34 | <intent-filter> | 35 | <intent-filter> |
| 35 | <action android:name="android.intent.action.MAIN"/> | 36 | <action android:name="android.intent.action.MAIN"/> |
| 36 | <category android:name="android.intent.category.LAUNCHER"/> | 37 | <category android:name="android.intent.category.LAUNCHER"/> |
| 37 | <action android:name="android.intent.action.VIEW"/> | 38 | <action android:name="android.intent.action.VIEW"/> |
| 38 | <category android:name="android.intent.category.DEFAULT"/> | 39 | <category android:name="android.intent.category.DEFAULT"/> |
| 39 | </intent-filter> | 40 | </intent-filter> |
| 41 | + | ||
| 42 | + <!-- 通知栏跳转intent --> | ||
| 43 | + <intent-filter> | ||
| 44 | + <action android:name="android.intent.action.VIEW"/> | ||
| 45 | + <category android:name="android.intent.category.DEFAULT"/> | ||
| 46 | + <data | ||
| 47 | + android:scheme="xgscheme" | ||
| 48 | + android:host="com.naji.book" | ||
| 49 | + android:path="/book_detail" /> | ||
| 50 | + </intent-filter> | ||
| 40 | </activity> | 51 | </activity> |
| 41 | 52 | ||
| 42 | <!-- Don't delete the meta-data below. | 53 | <!-- Don't delete the meta-data below. |
| @@ -4,10 +4,54 @@ import androidx.annotation.NonNull; | @@ -4,10 +4,54 @@ import androidx.annotation.NonNull; | ||
| 4 | import io.flutter.embedding.android.FlutterActivity | 4 | import io.flutter.embedding.android.FlutterActivity |
| 5 | import io.flutter.embedding.engine.FlutterEngine | 5 | import io.flutter.embedding.engine.FlutterEngine |
| 6 | import io.flutter.plugins.GeneratedPluginRegistrant | 6 | import io.flutter.plugins.GeneratedPluginRegistrant |
| 7 | +import android.os.Bundle | ||
| 8 | +import android.util.Log | ||
| 9 | +import io.flutter.plugin.common.MethodChannel | ||
| 10 | +import io.flutter.plugin.common.MethodCall | ||
| 7 | 11 | ||
| 8 | class MainActivity: FlutterActivity() { | 12 | class MainActivity: FlutterActivity() { |
| 9 | 13 | ||
| 14 | + private var TAG = "| com.naji.book |" | ||
| 15 | + | ||
| 16 | + // 通道名称 | ||
| 17 | + private var CHANNEL = "com.naji/book" | ||
| 18 | + | ||
| 19 | + // native端的Intent数据 | ||
| 20 | + private var intentMap = mutableMapOf<String, String>() | ||
| 21 | + | ||
| 10 | override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) { | 22 | override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) { |
| 11 | GeneratedPluginRegistrant.registerWith(flutterEngine); | 23 | GeneratedPluginRegistrant.registerWith(flutterEngine); |
| 12 | } | 24 | } |
| 25 | + | ||
| 26 | + override fun onCreate(savedInstanceState: Bundle?) { | ||
| 27 | + super.onCreate(savedInstanceState) | ||
| 28 | + // flutter版本更新后使用 getFlutterEngine().getDartExecutor().getBinaryMessenger()代替 getFlutterView() | ||
| 29 | + val channel = MethodChannel(getFlutterEngine()?.getDartExecutor()?.getBinaryMessenger(), CHANNEL) | ||
| 30 | + | ||
| 31 | + // 这里要获取启动时的intent | ||
| 32 | + val uri = intent.data | ||
| 33 | + val paramsMap = mutableMapOf<String, String>() | ||
| 34 | + if (uri != null) { | ||
| 35 | + val set = uri.queryParameterNames | ||
| 36 | + for (name in set) { | ||
| 37 | + val value = uri.getQueryParameter(name) | ||
| 38 | + paramsMap[name.toString()] = value.toString() | ||
| 39 | + } | ||
| 40 | + } | ||
| 41 | + | ||
| 42 | + intentMap = paramsMap | ||
| 43 | + | ||
| 44 | + channel.setMethodCallHandler { call, result -> | ||
| 45 | + Log.i(TAG,intentMap.toString()); | ||
| 46 | + when (call.method) { | ||
| 47 | + "getIntent" -> get_intent(call, result) | ||
| 48 | + } | ||
| 49 | + } | ||
| 50 | + } | ||
| 51 | + | ||
| 52 | + // 获取intent | ||
| 53 | + private fun get_intent(call: MethodCall, result: MethodChannel.Result) { | ||
| 54 | + Log.i(TAG, "调用${call.method}方法") | ||
| 55 | + result.success(intentMap) | ||
| 56 | + } | ||
| 13 | } | 57 | } |
| @@ -6,8 +6,10 @@ import 'package:flutter_easyrefresh/ball_pulse_footer.dart'; | @@ -6,8 +6,10 @@ import 'package:flutter_easyrefresh/ball_pulse_footer.dart'; | ||
| 6 | import 'package:flutter_easyrefresh/easy_refresh.dart'; | 6 | import 'package:flutter_easyrefresh/easy_refresh.dart'; |
| 7 | import 'package:flutter_easyrefresh/material_header.dart'; | 7 | import 'package:flutter_easyrefresh/material_header.dart'; |
| 8 | import 'package:fluwx/fluwx.dart'; | 8 | import 'package:fluwx/fluwx.dart'; |
| 9 | +import 'package:one_key/pages/detail/handle_online_page.dart'; | ||
| 9 | import 'package:one_key/provider/message_dialog_model.dart'; | 10 | import 'package:one_key/provider/message_dialog_model.dart'; |
| 10 | import 'package:intl/date_symbol_data_local.dart'; | 11 | import 'package:intl/date_symbol_data_local.dart'; |
| 12 | +import 'package:one_key/provider/tools.dart'; | ||
| 11 | import 'package:one_key/utils/utils.dart'; | 13 | import 'package:one_key/utils/utils.dart'; |
| 12 | import 'package:provider/provider.dart'; | 14 | import 'package:provider/provider.dart'; |
| 13 | import 'package:tpns_flutter_plugin/tpns_flutter_plugin.dart'; | 15 | import 'package:tpns_flutter_plugin/tpns_flutter_plugin.dart'; |
| @@ -29,7 +31,7 @@ Future<void> main() async { | @@ -29,7 +31,7 @@ Future<void> main() async { | ||
| 29 | Routes.configureRoutes(router); | 31 | Routes.configureRoutes(router); |
| 30 | App.router = router; | 32 | App.router = router; |
| 31 | App.setupLocator(); | 33 | App.setupLocator(); |
| 32 | - LogUtil.init(isDebug: false, tag: 'ONE_KEY'); | 34 | + LogUtil.init(isDebug: true, tag: 'ONE_KEY'); |
| 33 | Provider.debugCheckInvalidValueType = null; | 35 | Provider.debugCheckInvalidValueType = null; |
| 34 | await initializeDateFormatting(); | 36 | await initializeDateFormatting(); |
| 35 | SystemChrome.setPreferredOrientations( | 37 | SystemChrome.setPreferredOrientations( |
| @@ -61,6 +63,7 @@ class MyApp extends StatefulWidget { | @@ -61,6 +63,7 @@ class MyApp extends StatefulWidget { | ||
| 61 | } | 63 | } |
| 62 | 64 | ||
| 63 | class MyAppState extends State<MyApp> { | 65 | class MyAppState extends State<MyApp> { |
| 66 | + | ||
| 64 | @override | 67 | @override |
| 65 | void initState() { | 68 | void initState() { |
| 66 | // TODO: implement initState | 69 | // TODO: implement initState |
| @@ -22,9 +22,11 @@ import 'package:provider/provider.dart'; | @@ -22,9 +22,11 @@ import 'package:provider/provider.dart'; | ||
| 22 | import 'package:one_key/utils/event_bus.dart'; | 22 | import 'package:one_key/utils/event_bus.dart'; |
| 23 | 23 | ||
| 24 | class HandleOnlinePage extends StatefulWidget { | 24 | class HandleOnlinePage extends StatefulWidget { |
| 25 | + | ||
| 25 | final String rid; | 26 | final String rid; |
| 26 | final String mid; | 27 | final String mid; |
| 27 | - HandleOnlinePage(this.rid, this.mid); | 28 | + final bool fromNotify; |
| 29 | + HandleOnlinePage(this.rid, this.mid, {this.fromNotify=false}); | ||
| 28 | 30 | ||
| 29 | @override | 31 | @override |
| 30 | State<StatefulWidget> createState() { | 32 | State<StatefulWidget> createState() { |
| @@ -59,7 +61,7 @@ class HandleOnlinePageState extends State<HandleOnlinePage> { | @@ -59,7 +61,7 @@ class HandleOnlinePageState extends State<HandleOnlinePage> { | ||
| 59 | if (detailEntity.status != "0") { | 61 | if (detailEntity.status != "0") { |
| 60 | //已处理 | 62 | //已处理 |
| 61 | Future.delayed(Duration(milliseconds: 200), () { | 63 | Future.delayed(Duration(milliseconds: 200), () { |
| 62 | - NavigatorUtil.goNotebookDetailPage(context, detailEntity.id, | 64 | + NavigatorUtil.goNotebookDetailPage(context, detailEntity.id,fromNotify: widget.fromNotify, |
| 63 | replace: true); | 65 | replace: true); |
| 64 | }); | 66 | }); |
| 65 | setMessageStatus(); | 67 | setMessageStatus(); |
| @@ -163,233 +165,234 @@ class HandleOnlinePageState extends State<HandleOnlinePage> { | @@ -163,233 +165,234 @@ class HandleOnlinePageState extends State<HandleOnlinePage> { | ||
| 163 | Widget build(BuildContext context) { | 165 | Widget build(BuildContext context) { |
| 164 | // TODO: implement build | 166 | // TODO: implement build |
| 165 | return SafeArea( | 167 | return SafeArea( |
| 166 | - child: detailEntity == null | ||
| 167 | - ? Container( | ||
| 168 | - width: double.infinity, | ||
| 169 | - height: double.infinity, | ||
| 170 | - color: MyColours.color_ffffff, | ||
| 171 | - ) | ||
| 172 | - : Column( | ||
| 173 | - children: <Widget>[ | ||
| 174 | - MyAppBar( | ||
| 175 | - "在线预订详情", | ||
| 176 | - showBack: true, | ||
| 177 | - ), | ||
| 178 | - Expanded( | ||
| 179 | - child: DefaultTextStyle( | ||
| 180 | - style: TextStyle(decoration: TextDecoration.none), | ||
| 181 | - child: Container( | ||
| 182 | - color: MyColours.color_ffffff, | ||
| 183 | - child: Column( | ||
| 184 | - children: <Widget>[ | ||
| 185 | - Expanded( | ||
| 186 | - child: SingleChildScrollView( | ||
| 187 | - child: Container( | ||
| 188 | - color: MyColours.color_ffffff, | ||
| 189 | - padding: EdgeInsets.symmetric( | ||
| 190 | - horizontal: ScreenUtil().setWidth(43)), | ||
| 191 | - child: Column( | 168 | + child: WillPopScope( |
| 169 | + child: detailEntity == null | ||
| 170 | + ? Container( | ||
| 171 | + width: double.infinity, | ||
| 172 | + height: double.infinity, | ||
| 173 | + color: MyColours.color_ffffff, | ||
| 174 | + ) | ||
| 175 | + : Column( | ||
| 176 | + children: <Widget>[ | ||
| 177 | + MyAppBar( | ||
| 178 | + "在线预订详情", | ||
| 179 | + showBack: true, | ||
| 180 | + ), | ||
| 181 | + Expanded( | ||
| 182 | + child: DefaultTextStyle( | ||
| 183 | + style: TextStyle(decoration: TextDecoration.none), | ||
| 184 | + child: Container( | ||
| 185 | + color: MyColours.color_ffffff, | ||
| 186 | + child: Column( | ||
| 187 | + children: <Widget>[ | ||
| 188 | + Expanded( | ||
| 189 | + child: SingleChildScrollView( | ||
| 190 | + child: Container( | ||
| 191 | + color: MyColours.color_ffffff, | ||
| 192 | + padding: EdgeInsets.symmetric( | ||
| 193 | + horizontal: ScreenUtil().setWidth(43)), | ||
| 194 | + child: Column( | ||
| 195 | + children: <Widget>[ | ||
| 196 | + RowMultiText( | ||
| 197 | + "用餐时段", detailEntity.ddateMd), | ||
| 198 | + Stack( | ||
| 199 | + alignment: Alignment.center, | ||
| 192 | children: <Widget>[ | 200 | children: <Widget>[ |
| 193 | - RowMultiText( | ||
| 194 | - "用餐时段", detailEntity.ddateMd), | ||
| 195 | - Stack( | ||
| 196 | - alignment: Alignment.center, | 201 | + Column( |
| 197 | children: <Widget>[ | 202 | children: <Widget>[ |
| 198 | - Column( | ||
| 199 | - children: <Widget>[ | ||
| 200 | - RowMultiText("用餐时间", | ||
| 201 | - detailEntity.ddateHm), | ||
| 202 | - Offstage( | ||
| 203 | - offstage: | ||
| 204 | - detailEntity.type == "0" | ||
| 205 | - ? false | ||
| 206 | - : true, | ||
| 207 | - child: RowMultiText("用餐人数", | ||
| 208 | - detailEntity.pnum), | ||
| 209 | - ) | ||
| 210 | - ], | ||
| 211 | - ), | ||
| 212 | - Image.asset( | ||
| 213 | - detailEntity.statuImgAssets, | ||
| 214 | - width: ScreenUtil().setWidth(100), | ||
| 215 | - height: ScreenUtil().setWidth(30), | ||
| 216 | - ) | ||
| 217 | - ], | ||
| 218 | - ), | ||
| 219 | - RowMultiText( | ||
| 220 | - "包间需求", | ||
| 221 | - (detailEntity.demands.length | ||
| 222 | - .toString() + | ||
| 223 | - "个") ?? | ||
| 224 | - ""), | ||
| 225 | - Align( | ||
| 226 | - alignment: Alignment.centerRight, | ||
| 227 | - child: Offstage( | 203 | + RowMultiText("用餐时间", |
| 204 | + detailEntity.ddateHm), | ||
| 205 | + Offstage( | ||
| 228 | offstage: | 206 | offstage: |
| 229 | - detailEntity.demands.length > | ||
| 230 | - 0 | 207 | + detailEntity.type == "0" |
| 231 | ? false | 208 | ? false |
| 232 | : true, | 209 | : true, |
| 233 | - child: Container( | ||
| 234 | - height: | ||
| 235 | - ScreenUtil().setHeight(210), | ||
| 236 | - child: ListView.builder( | ||
| 237 | - itemBuilder: | ||
| 238 | - (BuildContext contxt, | ||
| 239 | - int index) { | ||
| 240 | - return NeedItem(detailEntity | ||
| 241 | - .demands[index]); | ||
| 242 | - }, | ||
| 243 | - itemCount: detailEntity | ||
| 244 | - .demands.length, | ||
| 245 | - shrinkWrap: true, | ||
| 246 | - scrollDirection: | ||
| 247 | - Axis.horizontal, | ||
| 248 | - ), | ||
| 249 | - ), | ||
| 250 | - )), | ||
| 251 | - RowMultiText( | ||
| 252 | - "客户姓名", detailEntity.rnameStr), | ||
| 253 | - RowMultiText( | ||
| 254 | - "客户电话", detailEntity.phone), | ||
| 255 | - RowMultiText( | ||
| 256 | - "备注信息", detailEntity.cusdem ?? ""), | ||
| 257 | - MyDivider(double.infinity, | ||
| 258 | - ScreenUtil().setHeight(1)), | ||
| 259 | - Container( | ||
| 260 | - color: MyColours.color_ffffff, | ||
| 261 | - width: double.infinity, | ||
| 262 | - height: ScreenUtil().setHeight(80), | ||
| 263 | - alignment: Alignment.center, | ||
| 264 | - child: Stack( | ||
| 265 | - alignment: Alignment.center, | ||
| 266 | - children: <Widget>[ | ||
| 267 | - Positioned( | ||
| 268 | - left: 0, | ||
| 269 | - child: Text( | ||
| 270 | - "客户经理", | ||
| 271 | - style: TextStyle( | ||
| 272 | - color: MyColours | ||
| 273 | - .color_828282, | ||
| 274 | - fontSize: ScreenUtil() | ||
| 275 | - .setSp(30)), | ||
| 276 | - ), | ||
| 277 | - ), | ||
| 278 | - Positioned( | ||
| 279 | - right: 0, | ||
| 280 | - child: GestureDetector( | ||
| 281 | - onTap: () async { | ||
| 282 | - List<String> list = []; | ||
| 283 | - for (Manager manager | ||
| 284 | - in managers) { | ||
| 285 | - list.add( | ||
| 286 | - manager.roleUserName); | ||
| 287 | - } | ||
| 288 | - DialogUtil | ||
| 289 | - .showSelectCusmanDialog( | ||
| 290 | - context, list,(value){ | ||
| 291 | - if(value!=null){ | ||
| 292 | - setState(() { | ||
| 293 | - cusmanText = managers[ | ||
| 294 | - value.first] | ||
| 295 | - .userName; | ||
| 296 | - }); | ||
| 297 | - _setCurrManager(); | ||
| 298 | - } | ||
| 299 | - }) | ||
| 300 | - .then((value) { | ||
| 301 | - | ||
| 302 | - }); | ||
| 303 | - }, | ||
| 304 | - child: Text( | ||
| 305 | - cusmanText, | ||
| 306 | - style: TextStyle( | ||
| 307 | - color: MyColours | ||
| 308 | - .color_353535, | ||
| 309 | - fontSize: ScreenUtil() | ||
| 310 | - .setSp(30), | ||
| 311 | - decoration: TextDecoration | ||
| 312 | - .underline, | ||
| 313 | - ), | ||
| 314 | - ), | ||
| 315 | - ), | ||
| 316 | - ) | ||
| 317 | - ], | ||
| 318 | - ), | 210 | + child: RowMultiText("用餐人数", |
| 211 | + detailEntity.pnum), | ||
| 212 | + ) | ||
| 213 | + ], | ||
| 319 | ), | 214 | ), |
| 215 | + Image.asset( | ||
| 216 | + detailEntity.statuImgAssets, | ||
| 217 | + width: ScreenUtil().setWidth(100), | ||
| 218 | + height: ScreenUtil().setWidth(30), | ||
| 219 | + ) | ||
| 320 | ], | 220 | ], |
| 321 | - )), | ||
| 322 | - ), | ||
| 323 | - ), | ||
| 324 | - Container( | ||
| 325 | - margin: EdgeInsets.only( | ||
| 326 | - top: ScreenUtil().setHeight(30), | ||
| 327 | - bottom: ScreenUtil().setHeight(30)), | ||
| 328 | - child: Column( | ||
| 329 | - children: <Widget>[ | ||
| 330 | - CommonButton( | ||
| 331 | - content: "安排包间", | ||
| 332 | - width: 669, | ||
| 333 | - height: 76, | ||
| 334 | - fontSize: 34, | ||
| 335 | - onPress: () async { | ||
| 336 | - Map map = await NavigatorUtil | ||
| 337 | - .goSelectTablePage( | ||
| 338 | - context, | ||
| 339 | - widget.rid, | ||
| 340 | - int.parse(detailEntity.ddate) * | ||
| 341 | - 1000, | ||
| 342 | - detailEntity.ddate_solt); | ||
| 343 | - if (map['tid'] != null) { | ||
| 344 | - setReserveStatus("5", tid: map['tid']); | ||
| 345 | - } | ||
| 346 | - }, | ||
| 347 | - ), | ||
| 348 | - VEmptyView(20), | ||
| 349 | - Container( | ||
| 350 | - width: ScreenUtil().setWidth(669), | ||
| 351 | - height: ScreenUtil().setHeight(76), | ||
| 352 | - decoration: BoxDecoration( | ||
| 353 | - border: Border.all( | ||
| 354 | - color: MyColours.color_199095), | ||
| 355 | - borderRadius: BorderRadius.circular( | ||
| 356 | - ScreenUtil().setWidth(5)), | ||
| 357 | ), | 221 | ), |
| 358 | - child: Row( | ||
| 359 | - crossAxisAlignment: | ||
| 360 | - CrossAxisAlignment.center, | ||
| 361 | - children: <Widget>[ | ||
| 362 | - Expanded( | 222 | + RowMultiText( |
| 223 | + "包间需求", | ||
| 224 | + (detailEntity.demands.length | ||
| 225 | + .toString() + | ||
| 226 | + "个") ?? | ||
| 227 | + ""), | ||
| 228 | + Align( | ||
| 229 | + alignment: Alignment.centerRight, | ||
| 230 | + child: Offstage( | ||
| 231 | + offstage: | ||
| 232 | + detailEntity.demands.length > | ||
| 233 | + 0 | ||
| 234 | + ? false | ||
| 235 | + : true, | ||
| 236 | + child: Container( | ||
| 237 | + height: | ||
| 238 | + ScreenUtil().setHeight(210), | ||
| 239 | + child: ListView.builder( | ||
| 240 | + itemBuilder: | ||
| 241 | + (BuildContext contxt, | ||
| 242 | + int index) { | ||
| 243 | + return NeedItem(detailEntity | ||
| 244 | + .demands[index]); | ||
| 245 | + }, | ||
| 246 | + itemCount: detailEntity | ||
| 247 | + .demands.length, | ||
| 248 | + shrinkWrap: true, | ||
| 249 | + scrollDirection: | ||
| 250 | + Axis.horizontal, | ||
| 251 | + ), | ||
| 252 | + ), | ||
| 253 | + )), | ||
| 254 | + RowMultiText( | ||
| 255 | + "客户姓名", detailEntity.rnameStr), | ||
| 256 | + RowMultiText( | ||
| 257 | + "客户电话", detailEntity.phone), | ||
| 258 | + RowMultiText( | ||
| 259 | + "备注信息", detailEntity.cusdem ?? ""), | ||
| 260 | + MyDivider(double.infinity, | ||
| 261 | + ScreenUtil().setHeight(1)), | ||
| 262 | + Container( | ||
| 263 | + color: MyColours.color_ffffff, | ||
| 264 | + width: double.infinity, | ||
| 265 | + height: ScreenUtil().setHeight(80), | ||
| 266 | + alignment: Alignment.center, | ||
| 267 | + child: Stack( | ||
| 268 | + alignment: Alignment.center, | ||
| 269 | + children: <Widget>[ | ||
| 270 | + Positioned( | ||
| 271 | + left: 0, | ||
| 272 | + child: Text( | ||
| 273 | + "客户经理", | ||
| 274 | + style: TextStyle( | ||
| 275 | + color: MyColours | ||
| 276 | + .color_828282, | ||
| 277 | + fontSize: ScreenUtil() | ||
| 278 | + .setSp(30)), | ||
| 279 | + ), | ||
| 280 | + ), | ||
| 281 | + Positioned( | ||
| 282 | + right: 0, | ||
| 363 | child: GestureDetector( | 283 | child: GestureDetector( |
| 284 | + onTap: () async { | ||
| 285 | + List<String> list = []; | ||
| 286 | + for (Manager manager | ||
| 287 | + in managers) { | ||
| 288 | + list.add( | ||
| 289 | + manager.roleUserName); | ||
| 290 | + } | ||
| 291 | + DialogUtil | ||
| 292 | + .showSelectCusmanDialog( | ||
| 293 | + context, list,(value){ | ||
| 294 | + if(value!=null){ | ||
| 295 | + setState(() { | ||
| 296 | + cusmanText = managers[ | ||
| 297 | + value.first] | ||
| 298 | + .userName; | ||
| 299 | + }); | ||
| 300 | + _setCurrManager(); | ||
| 301 | + } | ||
| 302 | + }) | ||
| 303 | + .then((value) { | ||
| 304 | + | ||
| 305 | + }); | ||
| 306 | + }, | ||
| 307 | + child: Text( | ||
| 308 | + cusmanText, | ||
| 309 | + style: TextStyle( | ||
| 310 | + color: MyColours | ||
| 311 | + .color_353535, | ||
| 312 | + fontSize: ScreenUtil() | ||
| 313 | + .setSp(30), | ||
| 314 | + decoration: TextDecoration | ||
| 315 | + .underline, | ||
| 316 | + ), | ||
| 317 | + ), | ||
| 318 | + ), | ||
| 319 | + ) | ||
| 320 | + ], | ||
| 321 | + ), | ||
| 322 | + ), | ||
| 323 | + ], | ||
| 324 | + )), | ||
| 325 | + ), | ||
| 326 | + ), | ||
| 327 | + Container( | ||
| 328 | + margin: EdgeInsets.only( | ||
| 329 | + top: ScreenUtil().setHeight(30), | ||
| 330 | + bottom: ScreenUtil().setHeight(30)), | ||
| 331 | + child: Column( | ||
| 332 | + children: <Widget>[ | ||
| 333 | + CommonButton( | ||
| 334 | + content: "安排包间", | ||
| 335 | + width: 669, | ||
| 336 | + height: 76, | ||
| 337 | + fontSize: 34, | ||
| 338 | + onPress: () async { | ||
| 339 | + Map map = await NavigatorUtil | ||
| 340 | + .goSelectTablePage( | ||
| 341 | + context, | ||
| 342 | + widget.rid, | ||
| 343 | + int.parse(detailEntity.ddate) * | ||
| 344 | + 1000, | ||
| 345 | + detailEntity.ddate_solt); | ||
| 346 | + if (map['tid'] != null) { | ||
| 347 | + setReserveStatus("5", tid: map['tid']); | ||
| 348 | + } | ||
| 349 | + }, | ||
| 350 | + ), | ||
| 351 | + VEmptyView(20), | ||
| 352 | + Container( | ||
| 353 | + width: ScreenUtil().setWidth(669), | ||
| 354 | + height: ScreenUtil().setHeight(76), | ||
| 355 | + decoration: BoxDecoration( | ||
| 356 | + border: Border.all( | ||
| 357 | + color: MyColours.color_199095), | ||
| 358 | + borderRadius: BorderRadius.circular( | ||
| 359 | + ScreenUtil().setWidth(5)), | ||
| 360 | + ), | ||
| 361 | + child: Row( | ||
| 362 | + crossAxisAlignment: | ||
| 363 | + CrossAxisAlignment.center, | ||
| 364 | + children: <Widget>[ | ||
| 365 | + Expanded( | ||
| 366 | + child: GestureDetector( | ||
| 364 | child: Center( | 367 | child: Center( |
| 365 | child: Text( | 368 | child: Text( |
| 366 | "拒绝订单", | 369 | "拒绝订单", |
| 367 | style: TextStyle( | 370 | style: TextStyle( |
| 368 | color: | 371 | color: |
| 369 | - MyColours.color_199095, | 372 | + MyColours.color_199095, |
| 370 | fontSize: | 373 | fontSize: |
| 371 | - ScreenUtil().setSp(34)), | 374 | + ScreenUtil().setSp(34)), |
| 372 | ), | 375 | ), |
| 373 | ), | 376 | ), |
| 374 | onTap: () { | 377 | onTap: () { |
| 375 | _showRefuseDialog(); | 378 | _showRefuseDialog(); |
| 376 | }, | 379 | }, |
| 377 | )), | 380 | )), |
| 378 | - MyDivider( | ||
| 379 | - ScreenUtil().setWidth(2), | ||
| 380 | - ScreenUtil().setHeight(52), | ||
| 381 | - color: MyColours.color_199095, | ||
| 382 | - ), | ||
| 383 | - Expanded( | ||
| 384 | - child: GestureDetector( | 381 | + MyDivider( |
| 382 | + ScreenUtil().setWidth(2), | ||
| 383 | + ScreenUtil().setHeight(52), | ||
| 384 | + color: MyColours.color_199095, | ||
| 385 | + ), | ||
| 386 | + Expanded( | ||
| 387 | + child: GestureDetector( | ||
| 385 | child: Center( | 388 | child: Center( |
| 386 | child: Text( | 389 | child: Text( |
| 387 | "联系顾客", | 390 | "联系顾客", |
| 388 | style: TextStyle( | 391 | style: TextStyle( |
| 389 | color: | 392 | color: |
| 390 | - MyColours.color_199095, | 393 | + MyColours.color_199095, |
| 391 | fontSize: | 394 | fontSize: |
| 392 | - ScreenUtil().setSp(34)), | 395 | + ScreenUtil().setSp(34)), |
| 393 | ), | 396 | ), |
| 394 | ), | 397 | ), |
| 395 | onTap: () { | 398 | onTap: () { |
| @@ -403,17 +406,26 @@ class HandleOnlinePageState extends State<HandleOnlinePage> { | @@ -403,17 +406,26 @@ class HandleOnlinePageState extends State<HandleOnlinePage> { | ||
| 403 | } | 406 | } |
| 404 | }, | 407 | }, |
| 405 | )), | 408 | )), |
| 406 | - ], | ||
| 407 | - ), | ||
| 408 | - ) | ||
| 409 | - ], | ||
| 410 | - ), | ||
| 411 | - ) | ||
| 412 | - ], | ||
| 413 | - ))), | ||
| 414 | - ) | ||
| 415 | - ], | ||
| 416 | - ), | 409 | + ], |
| 410 | + ), | ||
| 411 | + ) | ||
| 412 | + ], | ||
| 413 | + ), | ||
| 414 | + ) | ||
| 415 | + ], | ||
| 416 | + ))), | ||
| 417 | + ) | ||
| 418 | + ], | ||
| 419 | + ), | ||
| 420 | + onWillPop: ()async{ | ||
| 421 | + if(widget.fromNotify){ | ||
| 422 | + NavigatorUtil.goHomePage(context,initialIndex: 0); | ||
| 423 | + return true; | ||
| 424 | + } | ||
| 425 | + Navigator.of(context).pop(); | ||
| 426 | + return true; | ||
| 427 | + }, | ||
| 428 | + ) | ||
| 417 | ); | 429 | ); |
| 418 | } | 430 | } |
| 419 | } | 431 | } |
| @@ -29,8 +29,9 @@ import 'package:provider/provider.dart'; | @@ -29,8 +29,9 @@ import 'package:provider/provider.dart'; | ||
| 29 | 29 | ||
| 30 | class NotebookDetailPage extends StatefulWidget { | 30 | class NotebookDetailPage extends StatefulWidget { |
| 31 | final String rid; | 31 | final String rid; |
| 32 | + final bool fromNotify; | ||
| 32 | 33 | ||
| 33 | - NotebookDetailPage(this.rid); | 34 | + NotebookDetailPage(this.rid,{this.fromNotify=false}); |
| 34 | 35 | ||
| 35 | @override | 36 | @override |
| 36 | State<StatefulWidget> createState() { | 37 | State<StatefulWidget> createState() { |
| @@ -340,12 +341,10 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | @@ -340,12 +341,10 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | ||
| 340 | } | 341 | } |
| 341 | } | 342 | } |
| 342 | } | 343 | } |
| 343 | - | ||
| 344 | if (desc == '') { | 344 | if (desc == '') { |
| 345 | Utils.showToast('请选择原因'); | 345 | Utils.showToast('请选择原因'); |
| 346 | return; | 346 | return; |
| 347 | } | 347 | } |
| 348 | - | ||
| 349 | Navigator.of(context).pop(); | 348 | Navigator.of(context).pop(); |
| 350 | Loading.showLoading(context); | 349 | Loading.showLoading(context); |
| 351 | setReserveStatus('4', desc: desc); | 350 | setReserveStatus('4', desc: desc); |
| @@ -370,293 +369,294 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | @@ -370,293 +369,294 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | ||
| 370 | if (MediaQuery.of(context).viewInsets.bottom == 0) { | 369 | if (MediaQuery.of(context).viewInsets.bottom == 0) { |
| 371 | _cancelNode.unfocus(); | 370 | _cancelNode.unfocus(); |
| 372 | } | 371 | } |
| 373 | - return detailEntity == null | ||
| 374 | - ? Container( | ||
| 375 | - width: double.infinity, | ||
| 376 | - height: double.infinity, | ||
| 377 | - color: MyColours.color_ffffff, | ||
| 378 | - ) | ||
| 379 | - : Container( | ||
| 380 | - color: MyColours.color_ffffff, | ||
| 381 | - child: Column( | ||
| 382 | - children: <Widget>[ | ||
| 383 | - SizedBox(height: ScreenUtil.statusBarHeight), | ||
| 384 | - MyAppBar( | ||
| 385 | - "订座详情", | ||
| 386 | - showBack: true, | ||
| 387 | - ), | ||
| 388 | - Expanded( | ||
| 389 | - child: DefaultTextStyle( | ||
| 390 | - style: TextStyle(decoration: TextDecoration.none), | 372 | + return WillPopScope( |
| 373 | + child: detailEntity == null | ||
| 374 | + ? Container( | ||
| 375 | + width: double.infinity, | ||
| 376 | + height: double.infinity, | ||
| 377 | + color: MyColours.color_ffffff, | ||
| 378 | + ) | ||
| 379 | + : Container( | ||
| 380 | + color: MyColours.color_ffffff, | ||
| 381 | + child: Column( | ||
| 382 | + children: <Widget>[ | ||
| 383 | + SizedBox(height: ScreenUtil.statusBarHeight), | ||
| 384 | + MyAppBar( | ||
| 385 | + "订座详情", | ||
| 386 | + showBack: true, | ||
| 387 | + ), | ||
| 388 | + Expanded( | ||
| 389 | + child: DefaultTextStyle( | ||
| 390 | + style: TextStyle(decoration: TextDecoration.none), | ||
| 391 | + child: Container( | ||
| 392 | + color: MyColours.color_ffffff, | ||
| 393 | + child: SingleChildScrollView( | ||
| 391 | child: Container( | 394 | child: Container( |
| 392 | - color: MyColours.color_ffffff, | ||
| 393 | - child: SingleChildScrollView( | ||
| 394 | - child: Container( | ||
| 395 | - color: MyColours.color_ffffff, | ||
| 396 | - padding: EdgeInsets.symmetric( | ||
| 397 | - horizontal: ScreenUtil().setWidth(43)), | ||
| 398 | - child: Column( | 395 | + color: MyColours.color_ffffff, |
| 396 | + padding: EdgeInsets.symmetric( | ||
| 397 | + horizontal: ScreenUtil().setWidth(43)), | ||
| 398 | + child: Column( | ||
| 399 | + children: <Widget>[ | ||
| 400 | + RowMultiText("用餐时段", detailEntity.ddateMd), | ||
| 401 | + Stack( | ||
| 402 | + alignment: Alignment.center, | ||
| 399 | children: <Widget>[ | 403 | children: <Widget>[ |
| 400 | - RowMultiText("用餐时段", detailEntity.ddateMd), | ||
| 401 | - Stack( | ||
| 402 | - alignment: Alignment.center, | 404 | + Column( |
| 403 | children: <Widget>[ | 405 | children: <Widget>[ |
| 404 | - Column( | ||
| 405 | - children: <Widget>[ | ||
| 406 | - RowMultiText( | ||
| 407 | - "用餐时间", detailEntity.ddateHm), | ||
| 408 | - Offstage( | ||
| 409 | - offstage: detailEntity.type == "0" | ||
| 410 | - ? false | ||
| 411 | - : true, | ||
| 412 | - child: RowMultiText( | ||
| 413 | - "用餐人数", detailEntity.pnum), | ||
| 414 | - ) | ||
| 415 | - ], | ||
| 416 | - ), | ||
| 417 | - Image.asset( | ||
| 418 | - detailEntity.statuImgAssets, | ||
| 419 | - width: ScreenUtil().setWidth(100), | ||
| 420 | - height: ScreenUtil().setWidth(30), | 406 | + RowMultiText( |
| 407 | + "用餐时间", detailEntity.ddateHm), | ||
| 408 | + Offstage( | ||
| 409 | + offstage: detailEntity.type == "0" | ||
| 410 | + ? false | ||
| 411 | + : true, | ||
| 412 | + child: RowMultiText( | ||
| 413 | + "用餐人数", detailEntity.pnum), | ||
| 421 | ) | 414 | ) |
| 422 | ], | 415 | ], |
| 423 | ), | 416 | ), |
| 424 | - Offstage( | ||
| 425 | - offstage: detailEntity.demands.length <= 0 | ||
| 426 | - ? true | ||
| 427 | - : false, | ||
| 428 | - child: Column( | ||
| 429 | - children: <Widget>[ | ||
| 430 | - RowMultiText( | ||
| 431 | - "包间需求", | ||
| 432 | - (detailEntity.demands.length | ||
| 433 | - .toString() + | ||
| 434 | - "个") ?? | ||
| 435 | - ""), | ||
| 436 | - Align( | ||
| 437 | - alignment: Alignment.centerRight, | ||
| 438 | - child: Offstage( | ||
| 439 | - offstage: | ||
| 440 | - detailEntity.demands.length > | ||
| 441 | - 0 | ||
| 442 | - ? false | ||
| 443 | - : true, | ||
| 444 | - child: Container( | ||
| 445 | - height: | ||
| 446 | - ScreenUtil().setHeight(210), | ||
| 447 | - child: ListView.builder( | ||
| 448 | - itemBuilder: | ||
| 449 | - (BuildContext contxt, | ||
| 450 | - int index) { | ||
| 451 | - return NeedItem(detailEntity | ||
| 452 | - .demands[index]); | ||
| 453 | - }, | ||
| 454 | - itemCount: detailEntity | ||
| 455 | - .demands.length, | ||
| 456 | - shrinkWrap: true, | ||
| 457 | - scrollDirection: | ||
| 458 | - Axis.horizontal, | ||
| 459 | - ), | ||
| 460 | - ), | ||
| 461 | - )) | ||
| 462 | - ], | ||
| 463 | - ), | ||
| 464 | - ), | ||
| 465 | - RowMultiText( | ||
| 466 | - "预订桌位", | ||
| 467 | - (detailEntity.tables.length.toString() + | ||
| 468 | - "个")), | ||
| 469 | - Align( | ||
| 470 | - alignment: Alignment.centerRight, | ||
| 471 | - child: Offstage( | ||
| 472 | - offstage: detailEntity.tables.length > 0 | ||
| 473 | - ? false | ||
| 474 | - : true, | ||
| 475 | - child: Container( | ||
| 476 | - height: ScreenUtil().setHeight(210), | ||
| 477 | - child: ListView.builder( | ||
| 478 | - itemBuilder: (BuildContext contxt, | ||
| 479 | - int index) { | ||
| 480 | - return TableItem( | ||
| 481 | - detailEntity.tables[index]); | ||
| 482 | - }, | ||
| 483 | - itemCount: | ||
| 484 | - detailEntity.tables.length, | ||
| 485 | - shrinkWrap: true, | ||
| 486 | - scrollDirection: Axis.horizontal, | ||
| 487 | - ), | ||
| 488 | - ), | ||
| 489 | - )), | ||
| 490 | - RowMultiText("客户姓名", detailEntity.rnameStr), | ||
| 491 | - RowMultiText( | ||
| 492 | - "客户电话", detailEntity.phone ?? ""), | ||
| 493 | - RowMultiText( | ||
| 494 | - "备注信息", detailEntity.cusdem ?? ""), | ||
| 495 | - MyDivider(double.infinity, | ||
| 496 | - ScreenUtil().setHeight(1)), | ||
| 497 | - Container( | ||
| 498 | - color: MyColours.color_ffffff, | ||
| 499 | - width: double.infinity, | ||
| 500 | - height: ScreenUtil().setHeight(80), | ||
| 501 | - alignment: Alignment.center, | ||
| 502 | - child: Stack( | ||
| 503 | - alignment: Alignment.center, | ||
| 504 | - children: <Widget>[ | ||
| 505 | - Positioned( | ||
| 506 | - left: 0, | ||
| 507 | - child: Text( | ||
| 508 | - "客户经理", | ||
| 509 | - style: TextStyle( | ||
| 510 | - color: MyColours.color_828282, | ||
| 511 | - fontSize: | ||
| 512 | - ScreenUtil().setSp(30)), | ||
| 513 | - ), | ||
| 514 | - ), | ||
| 515 | - Positioned( | ||
| 516 | - right: 0, | ||
| 517 | - child: GestureDetector( | ||
| 518 | - onTap: () async { | ||
| 519 | - List<String> list = []; | ||
| 520 | - for (Manager manager | ||
| 521 | - in managers) { | ||
| 522 | - list.add(manager.roleUserName); | ||
| 523 | - } | ||
| 524 | - DialogUtil.showSelectCusmanDialog( | ||
| 525 | - context, list,(value){ | ||
| 526 | - if (value != null) { | ||
| 527 | - setState(() { | ||
| 528 | - cusmanText = | ||
| 529 | - managers[value.first] | ||
| 530 | - .userName; | ||
| 531 | - }); | ||
| 532 | - _setCurrManager(); | ||
| 533 | - } | ||
| 534 | - }) | ||
| 535 | - .then((value) { | ||
| 536 | - }); | ||
| 537 | - }, | ||
| 538 | - child: Text( | ||
| 539 | - cusmanText, | ||
| 540 | - style: TextStyle( | ||
| 541 | - color: MyColours.color_353535, | ||
| 542 | - fontSize: | ||
| 543 | - ScreenUtil().setSp(30), | ||
| 544 | - decoration: | ||
| 545 | - TextDecoration.underline, | ||
| 546 | - ), | 417 | + Image.asset( |
| 418 | + detailEntity.statuImgAssets, | ||
| 419 | + width: ScreenUtil().setWidth(100), | ||
| 420 | + height: ScreenUtil().setWidth(30), | ||
| 421 | + ) | ||
| 422 | + ], | ||
| 423 | + ), | ||
| 424 | + Offstage( | ||
| 425 | + offstage: detailEntity.demands.length <= 0 | ||
| 426 | + ? true | ||
| 427 | + : false, | ||
| 428 | + child: Column( | ||
| 429 | + children: <Widget>[ | ||
| 430 | + RowMultiText( | ||
| 431 | + "包间需求", | ||
| 432 | + (detailEntity.demands.length | ||
| 433 | + .toString() + | ||
| 434 | + "个") ?? | ||
| 435 | + ""), | ||
| 436 | + Align( | ||
| 437 | + alignment: Alignment.centerRight, | ||
| 438 | + child: Offstage( | ||
| 439 | + offstage: | ||
| 440 | + detailEntity.demands.length > | ||
| 441 | + 0 | ||
| 442 | + ? false | ||
| 443 | + : true, | ||
| 444 | + child: Container( | ||
| 445 | + height: | ||
| 446 | + ScreenUtil().setHeight(210), | ||
| 447 | + child: ListView.builder( | ||
| 448 | + itemBuilder: | ||
| 449 | + (BuildContext contxt, | ||
| 450 | + int index) { | ||
| 451 | + return NeedItem(detailEntity | ||
| 452 | + .demands[index]); | ||
| 453 | + }, | ||
| 454 | + itemCount: detailEntity | ||
| 455 | + .demands.length, | ||
| 456 | + shrinkWrap: true, | ||
| 457 | + scrollDirection: | ||
| 458 | + Axis.horizontal, | ||
| 547 | ), | 459 | ), |
| 548 | ), | 460 | ), |
| 549 | - ) | ||
| 550 | - ], | ||
| 551 | - ), | ||
| 552 | - ), | ||
| 553 | - RowMultiText( | ||
| 554 | - "记录人", detailEntity.note_name ?? ""), | ||
| 555 | - Offstage( | ||
| 556 | - offstage: (detailEntity.status == "4" && | ||
| 557 | - detailEntity.cancel != null) | 461 | + )) |
| 462 | + ], | ||
| 463 | + ), | ||
| 464 | + ), | ||
| 465 | + RowMultiText( | ||
| 466 | + "预订桌位", | ||
| 467 | + (detailEntity.tables.length.toString() + | ||
| 468 | + "个")), | ||
| 469 | + Align( | ||
| 470 | + alignment: Alignment.centerRight, | ||
| 471 | + child: Offstage( | ||
| 472 | + offstage: detailEntity.tables.length > 0 | ||
| 558 | ? false | 473 | ? false |
| 559 | : true, | 474 | : true, |
| 560 | - child: Column( | ||
| 561 | - children: <Widget>[ | ||
| 562 | - MyDivider(double.infinity, | ||
| 563 | - ScreenUtil().setHeight(2)), | ||
| 564 | - RowMultiText("取消原因", | ||
| 565 | - detailEntity.cancel?.desc ?? "", | ||
| 566 | - textAlign: TextAlign.left), | ||
| 567 | - RowMultiText( | ||
| 568 | - "取消时间", | ||
| 569 | - detailEntity.cancel?.cdateStr ?? | ||
| 570 | - ""), | ||
| 571 | - RowMultiText("操作人", | ||
| 572 | - detailEntity.cancel?.uname ?? ""), | ||
| 573 | - ], | 475 | + child: Container( |
| 476 | + height: ScreenUtil().setHeight(210), | ||
| 477 | + child: ListView.builder( | ||
| 478 | + itemBuilder: (BuildContext contxt, | ||
| 479 | + int index) { | ||
| 480 | + return TableItem( | ||
| 481 | + detailEntity.tables[index]); | ||
| 482 | + }, | ||
| 483 | + itemCount: | ||
| 484 | + detailEntity.tables.length, | ||
| 485 | + shrinkWrap: true, | ||
| 486 | + scrollDirection: Axis.horizontal, | ||
| 487 | + ), | ||
| 574 | ), | 488 | ), |
| 575 | - ), | ||
| 576 | - ], | ||
| 577 | - )), | ||
| 578 | - ), | ||
| 579 | - )), | ||
| 580 | - ), | ||
| 581 | - Offstage( | ||
| 582 | - offstage: (detailEntity.status == "3" || | ||
| 583 | - detailEntity.status == "4" || | ||
| 584 | - detailEntity.status == "6") | ||
| 585 | - ? true | ||
| 586 | - : false, | ||
| 587 | - child: Container( | ||
| 588 | - width: double.infinity, | ||
| 589 | - decoration: BoxDecoration( | ||
| 590 | - color: MyColours.color_ffffff, | ||
| 591 | - border: Border( | ||
| 592 | - top: BorderSide( | ||
| 593 | - color: MyColours.color_dbe3e3, | ||
| 594 | - width: ScreenUtil().setWidth(1)))), | ||
| 595 | - padding: EdgeInsets.symmetric( | ||
| 596 | - horizontal: ScreenUtil().setHeight(40)), | ||
| 597 | - margin: EdgeInsets.symmetric( | ||
| 598 | - vertical: ScreenUtil().setHeight(20)), | ||
| 599 | - child: CommonButton( | ||
| 600 | - content: "通知客户", | ||
| 601 | - width: 669, | ||
| 602 | - height: 80, | ||
| 603 | - fontSize: 34, | ||
| 604 | - onPress: () { | ||
| 605 | - DialogUtil.showShareDialog(context)?.then((value) { | ||
| 606 | - switch (value) { | ||
| 607 | - case 1: //微信 | ||
| 608 | - NavigatorUtil.goInvicationPage( | ||
| 609 | - context, | ||
| 610 | - detailEntity.id, | ||
| 611 | - detailEntity.tableinfoStr, | ||
| 612 | - detailEntity.ddate, | ||
| 613 | - detailEntity.ddateStr); | ||
| 614 | - break; | ||
| 615 | - case 2: //短信 | ||
| 616 | - NavigatorUtil.goSmsPage(context, detailEntity.id); | ||
| 617 | - break; | ||
| 618 | - case 3: //电话 | ||
| 619 | - if (detailEntity.phone != null && | ||
| 620 | - detailEntity.phone.isNotEmpty) { | ||
| 621 | - Utils.goPhone(detailEntity.phone); | ||
| 622 | - } else { | ||
| 623 | - Utils.showToast("没有客户电话!"); | ||
| 624 | - } | ||
| 625 | - break; | ||
| 626 | - } | ||
| 627 | - }); | ||
| 628 | - }, | 489 | + )), |
| 490 | + RowMultiText("客户姓名", detailEntity.rnameStr), | ||
| 491 | + RowMultiText( | ||
| 492 | + "客户电话", detailEntity.phone ?? ""), | ||
| 493 | + RowMultiText( | ||
| 494 | + "备注信息", detailEntity.cusdem ?? ""), | ||
| 495 | + MyDivider(double.infinity, | ||
| 496 | + ScreenUtil().setHeight(1)), | ||
| 497 | + Container( | ||
| 498 | + color: MyColours.color_ffffff, | ||
| 499 | + width: double.infinity, | ||
| 500 | + height: ScreenUtil().setHeight(80), | ||
| 501 | + alignment: Alignment.center, | ||
| 502 | + child: Stack( | ||
| 503 | + alignment: Alignment.center, | ||
| 504 | + children: <Widget>[ | ||
| 505 | + Positioned( | ||
| 506 | + left: 0, | ||
| 507 | + child: Text( | ||
| 508 | + "客户经理", | ||
| 509 | + style: TextStyle( | ||
| 510 | + color: MyColours.color_828282, | ||
| 511 | + fontSize: | ||
| 512 | + ScreenUtil().setSp(30)), | ||
| 513 | + ), | ||
| 514 | + ), | ||
| 515 | + Positioned( | ||
| 516 | + right: 0, | ||
| 517 | + child: GestureDetector( | ||
| 518 | + onTap: () async { | ||
| 519 | + List<String> list = []; | ||
| 520 | + for (Manager manager | ||
| 521 | + in managers) { | ||
| 522 | + list.add(manager.roleUserName); | ||
| 523 | + } | ||
| 524 | + DialogUtil.showSelectCusmanDialog( | ||
| 525 | + context, list,(value){ | ||
| 526 | + if (value != null) { | ||
| 527 | + setState(() { | ||
| 528 | + cusmanText = | ||
| 529 | + managers[value.first] | ||
| 530 | + .userName; | ||
| 531 | + }); | ||
| 532 | + _setCurrManager(); | ||
| 533 | + } | ||
| 534 | + }) | ||
| 535 | + .then((value) { | ||
| 536 | + }); | ||
| 537 | + }, | ||
| 538 | + child: Text( | ||
| 539 | + cusmanText, | ||
| 540 | + style: TextStyle( | ||
| 541 | + color: MyColours.color_353535, | ||
| 542 | + fontSize: | ||
| 543 | + ScreenUtil().setSp(30), | ||
| 544 | + decoration: | ||
| 545 | + TextDecoration.underline, | ||
| 546 | + ), | ||
| 547 | + ), | ||
| 548 | + ), | ||
| 549 | + ) | ||
| 550 | + ], | ||
| 551 | + ), | ||
| 552 | + ), | ||
| 553 | + RowMultiText( | ||
| 554 | + "记录人", detailEntity.note_name ?? ""), | ||
| 555 | + Offstage( | ||
| 556 | + offstage: (detailEntity.status == "4" && | ||
| 557 | + detailEntity.cancel != null) | ||
| 558 | + ? false | ||
| 559 | + : true, | ||
| 560 | + child: Column( | ||
| 561 | + children: <Widget>[ | ||
| 562 | + MyDivider(double.infinity, | ||
| 563 | + ScreenUtil().setHeight(2)), | ||
| 564 | + RowMultiText("取消原因", | ||
| 565 | + detailEntity.cancel?.desc ?? "", | ||
| 566 | + textAlign: TextAlign.left), | ||
| 567 | + RowMultiText( | ||
| 568 | + "取消时间", | ||
| 569 | + detailEntity.cancel?.cdateStr ?? | ||
| 570 | + ""), | ||
| 571 | + RowMultiText("操作人", | ||
| 572 | + detailEntity.cancel?.uname ?? ""), | ||
| 573 | + ], | ||
| 574 | + ), | ||
| 575 | + ), | ||
| 576 | + ], | ||
| 577 | + )), | ||
| 629 | ), | 578 | ), |
| 630 | - ), | 579 | + )), |
| 580 | + ), | ||
| 581 | + Offstage( | ||
| 582 | + offstage: (detailEntity.status == "3" || | ||
| 583 | + detailEntity.status == "4" || | ||
| 584 | + detailEntity.status == "6") | ||
| 585 | + ? true | ||
| 586 | + : false, | ||
| 587 | + child: Container( | ||
| 588 | + width: double.infinity, | ||
| 589 | + decoration: BoxDecoration( | ||
| 590 | + color: MyColours.color_ffffff, | ||
| 591 | + border: Border( | ||
| 592 | + top: BorderSide( | ||
| 593 | + color: MyColours.color_dbe3e3, | ||
| 594 | + width: ScreenUtil().setWidth(1)))), | ||
| 595 | + padding: EdgeInsets.symmetric( | ||
| 596 | + horizontal: ScreenUtil().setHeight(40)), | ||
| 597 | + margin: EdgeInsets.symmetric( | ||
| 598 | + vertical: ScreenUtil().setHeight(20)), | ||
| 599 | + child: CommonButton( | ||
| 600 | + content: "通知客户", | ||
| 601 | + width: 669, | ||
| 602 | + height: 80, | ||
| 603 | + fontSize: 34, | ||
| 604 | + onPress: () { | ||
| 605 | + DialogUtil.showShareDialog(context)?.then((value) { | ||
| 606 | + switch (value) { | ||
| 607 | + case 1: //微信 | ||
| 608 | + NavigatorUtil.goInvicationPage( | ||
| 609 | + context, | ||
| 610 | + detailEntity.id, | ||
| 611 | + detailEntity.tableinfoStr, | ||
| 612 | + detailEntity.ddate, | ||
| 613 | + detailEntity.ddateStr); | ||
| 614 | + break; | ||
| 615 | + case 2: //短信 | ||
| 616 | + NavigatorUtil.goSmsPage(context, detailEntity.id); | ||
| 617 | + break; | ||
| 618 | + case 3: //电话 | ||
| 619 | + if (detailEntity.phone != null && | ||
| 620 | + detailEntity.phone.isNotEmpty) { | ||
| 621 | + Utils.goPhone(detailEntity.phone); | ||
| 622 | + } else { | ||
| 623 | + Utils.showToast("没有客户电话!"); | ||
| 624 | + } | ||
| 625 | + break; | ||
| 626 | + } | ||
| 627 | + }); | ||
| 628 | + }, | ||
| 631 | ), | 629 | ), |
| 632 | - Offstage( | ||
| 633 | - offstage: (detailEntity.status == "3" || | ||
| 634 | - detailEntity.status == "4" || | ||
| 635 | - detailEntity.status == "6") | ||
| 636 | - ? true | ||
| 637 | - : false, | ||
| 638 | - child: Container( | ||
| 639 | - width: double.infinity, | ||
| 640 | - height: ScreenUtil().setWidth(80), | ||
| 641 | - margin: EdgeInsets.symmetric( | ||
| 642 | - horizontal: ScreenUtil().setHeight(40)), | ||
| 643 | - decoration: BoxDecoration( | ||
| 644 | - border: Border.all( | ||
| 645 | - color: MyColours.color_199095, | ||
| 646 | - width: ScreenUtil().setWidth(2)), | ||
| 647 | - borderRadius: | ||
| 648 | - BorderRadius.circular(ScreenUtil().setWidth(5)), | ||
| 649 | - ), | ||
| 650 | - // child: Text('fff'), | ||
| 651 | - child: Material( | ||
| 652 | - child: Row( | 630 | + ), |
| 631 | + ), | ||
| 632 | + Offstage( | ||
| 633 | + offstage: (detailEntity.status == "3" || | ||
| 634 | + detailEntity.status == "4" || | ||
| 635 | + detailEntity.status == "6") | ||
| 636 | + ? true | ||
| 637 | + : false, | ||
| 638 | + child: Container( | ||
| 639 | + width: double.infinity, | ||
| 640 | + height: ScreenUtil().setWidth(80), | ||
| 641 | + margin: EdgeInsets.symmetric( | ||
| 642 | + horizontal: ScreenUtil().setHeight(40)), | ||
| 643 | + decoration: BoxDecoration( | ||
| 644 | + border: Border.all( | ||
| 645 | + color: MyColours.color_199095, | ||
| 646 | + width: ScreenUtil().setWidth(2)), | ||
| 647 | + borderRadius: | ||
| 648 | + BorderRadius.circular(ScreenUtil().setWidth(5)), | ||
| 649 | + ), | ||
| 650 | + // child: Text('fff'), | ||
| 651 | + child: Material( | ||
| 652 | + child: Row( | ||
| 653 | children: [ | 653 | children: [ |
| 654 | Expanded( | 654 | Expanded( |
| 655 | child: _cancelAndChangeBtn(() { | 655 | child: _cancelAndChangeBtn(() { |
| 656 | - print('点击变更预订'); | ||
| 657 | - NavigatorUtil.goNoteBookChangePage( | ||
| 658 | - context, detailEntity, widget.rid); | ||
| 659 | - }, '变更预订')), | 656 | + print('点击变更预订'); |
| 657 | + NavigatorUtil.goNoteBookChangePage( | ||
| 658 | + context, detailEntity, widget.rid); | ||
| 659 | + }, '变更预订')), | ||
| 660 | MyDivider( | 660 | MyDivider( |
| 661 | ScreenUtil().setWidth(2), | 661 | ScreenUtil().setWidth(2), |
| 662 | ScreenUtil().setWidth(50), | 662 | ScreenUtil().setWidth(50), |
| @@ -664,15 +664,24 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | @@ -664,15 +664,24 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | ||
| 664 | ), | 664 | ), |
| 665 | Expanded( | 665 | Expanded( |
| 666 | child: _cancelAndChangeBtn(() { | 666 | child: _cancelAndChangeBtn(() { |
| 667 | - _showCancelWidget(context); | ||
| 668 | - }, '取消预订')), | 667 | + _showCancelWidget(context); |
| 668 | + }, '取消预订')), | ||
| 669 | ], | 669 | ], |
| 670 | )), | 670 | )), |
| 671 | - ), | ||
| 672 | - ), | ||
| 673 | - VEmptyView(ScreenUtil().setWidth(60)) | ||
| 674 | - ], | 671 | + ), |
| 675 | ), | 672 | ), |
| 676 | - ); | 673 | + VEmptyView(ScreenUtil().setWidth(60)) |
| 674 | + ], | ||
| 675 | + ), | ||
| 676 | + ), | ||
| 677 | + onWillPop: ()async{ | ||
| 678 | + if(widget.fromNotify){ | ||
| 679 | + NavigatorUtil.goHomePage(context,initialIndex: 0); | ||
| 680 | + return true; | ||
| 681 | + } | ||
| 682 | + Navigator.of(context).pop(); | ||
| 683 | + return true; | ||
| 684 | + }, | ||
| 685 | + ); | ||
| 677 | } | 686 | } |
| 678 | } | 687 | } |
| @@ -12,10 +12,12 @@ import 'package:one_key/provider/message_dialog_model.dart'; | @@ -12,10 +12,12 @@ import 'package:one_key/provider/message_dialog_model.dart'; | ||
| 12 | import 'package:one_key/provider/message_model.dart'; | 12 | import 'package:one_key/provider/message_model.dart'; |
| 13 | import 'package:one_key/provider/my_model.dart'; | 13 | import 'package:one_key/provider/my_model.dart'; |
| 14 | import 'package:one_key/provider/notebook_model.dart'; | 14 | import 'package:one_key/provider/notebook_model.dart'; |
| 15 | +import 'package:one_key/provider/tools.dart'; | ||
| 15 | import 'package:one_key/provider/update_model.dart'; | 16 | import 'package:one_key/provider/update_model.dart'; |
| 16 | import 'package:one_key/provider/user_model.dart'; | 17 | import 'package:one_key/provider/user_model.dart'; |
| 17 | import 'package:one_key/res/colors.dart'; | 18 | import 'package:one_key/res/colors.dart'; |
| 18 | import 'package:one_key/utils/log_util.dart'; | 19 | import 'package:one_key/utils/log_util.dart'; |
| 20 | +import 'package:one_key/utils/navigator_util.dart'; | ||
| 19 | import 'package:one_key/utils/utils.dart'; | 21 | import 'package:one_key/utils/utils.dart'; |
| 20 | import 'package:provider/provider.dart'; | 22 | import 'package:provider/provider.dart'; |
| 21 | import 'package:shared_preferences/shared_preferences.dart'; | 23 | import 'package:shared_preferences/shared_preferences.dart'; |
| @@ -68,6 +70,7 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver{ | @@ -68,6 +70,7 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver{ | ||
| 68 | )); | 70 | )); |
| 69 | WidgetsBinding.instance.addPostFrameCallback((_){ | 71 | WidgetsBinding.instance.addPostFrameCallback((_){ |
| 70 | if(widget.initialIndex==0)return; | 72 | if(widget.initialIndex==0)return; |
| 73 | + _getIntent(); | ||
| 71 | Future.delayed(Duration(milliseconds: 300),(){ | 74 | Future.delayed(Duration(milliseconds: 300),(){ |
| 72 | initPlatformState(); | 75 | initPlatformState(); |
| 73 | }); | 76 | }); |
| @@ -83,6 +86,21 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver{ | @@ -83,6 +86,21 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver{ | ||
| 83 | }); | 86 | }); |
| 84 | } | 87 | } |
| 85 | 88 | ||
| 89 | + _getIntent() async { | ||
| 90 | + Map notifyParam=await Tools().getIntent(); | ||
| 91 | + LogUtil.v(notifyParam.toString()); | ||
| 92 | + if(notifyParam!=null&¬ifyParam.isNotEmpty){ | ||
| 93 | + switch(notifyParam["messageType"]){ | ||
| 94 | + case "10": | ||
| 95 | + NavigatorUtil.goNotebookDetailPage(context, notifyParam['rid'],fromNotify: true); | ||
| 96 | + break; | ||
| 97 | + case "11": | ||
| 98 | + NavigatorUtil.goHandleOnlinePage(context, notifyParam["rid"], notifyParam['mid'],fromNotify: true); | ||
| 99 | + break; | ||
| 100 | + } | ||
| 101 | + } | ||
| 102 | + } | ||
| 103 | + | ||
| 86 | //初始化信鸽推送 | 104 | //初始化信鸽推送 |
| 87 | initPlatformState(){ | 105 | initPlatformState(){ |
| 88 | 106 | ||
| @@ -140,7 +158,18 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver{ | @@ -140,7 +158,18 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver{ | ||
| 140 | print("flutter xgPushDidClearAllIdentifiers: $msg"); | 158 | print("flutter xgPushDidClearAllIdentifiers: $msg"); |
| 141 | }, | 159 | }, |
| 142 | xgPushClickAction: (Map<String, dynamic> msg) async { | 160 | xgPushClickAction: (Map<String, dynamic> msg) async { |
| 143 | - print("flutter xgPushClickAction $msg"); | 161 | + print("flutter xgPushClickAction ${msg['custom']}"); |
| 162 | + if(Platform.isIOS&&msg!=null&&msg['custom']!=null){ | ||
| 163 | + Map<String,dynamic> custom=msg['custom']; | ||
| 164 | + switch(custom["messageType"].toString()){ | ||
| 165 | + case "10": | ||
| 166 | + NavigatorUtil.goNotebookDetailPage(context, custom['rid'].toString(),fromNotify: true); | ||
| 167 | + break; | ||
| 168 | + case "11": | ||
| 169 | + NavigatorUtil.goHandleOnlinePage(context, custom["rid"].toString(), custom['mid'],fromNotify: true); | ||
| 170 | + break; | ||
| 171 | + } | ||
| 172 | + } | ||
| 144 | }, | 173 | }, |
| 145 | ); | 174 | ); |
| 146 | registerPush(); | 175 | registerPush(); |
| @@ -50,7 +50,7 @@ class MessageDialogItem extends StatelessWidget { | @@ -50,7 +50,7 @@ class MessageDialogItem extends StatelessWidget { | ||
| 50 | crossAxisAlignment: CrossAxisAlignment.center, | 50 | crossAxisAlignment: CrossAxisAlignment.center, |
| 51 | children: <Widget>[ | 51 | children: <Widget>[ |
| 52 | Text( | 52 | Text( |
| 53 | - "在线预订", | 53 | + message.message_type=="10"?"在线预订":"取消预订", |
| 54 | style: TextStyle( | 54 | style: TextStyle( |
| 55 | color: textColor, | 55 | color: textColor, |
| 56 | fontSize: ScreenUtil().setSp(28)), | 56 | fontSize: ScreenUtil().setSp(28)), |
| @@ -51,7 +51,7 @@ class MessageItem extends StatelessWidget { | @@ -51,7 +51,7 @@ class MessageItem extends StatelessWidget { | ||
| 51 | crossAxisAlignment: CrossAxisAlignment.center, | 51 | crossAxisAlignment: CrossAxisAlignment.center, |
| 52 | children: <Widget>[ | 52 | children: <Widget>[ |
| 53 | Text( | 53 | Text( |
| 54 | - "在线预订", | 54 | + message.message_type=="10"?"在线预订":"取消预订", |
| 55 | style: TextStyle( | 55 | style: TextStyle( |
| 56 | color: textColor, | 56 | color: textColor, |
| 57 | fontSize: ScreenUtil().setSp(28)), | 57 | fontSize: ScreenUtil().setSp(28)), |
lib/provider/tools.dart
0 → 100644
| @@ -36,11 +36,12 @@ var homeHandler = new Handler( | @@ -36,11 +36,12 @@ var homeHandler = new Handler( | ||
| 36 | ); | 36 | ); |
| 37 | }); | 37 | }); |
| 38 | 38 | ||
| 39 | -// 跳转到处理在线预订 | 39 | +// 跳转预订详情页 |
| 40 | var reserveDetailHandler = new Handler( | 40 | var reserveDetailHandler = new Handler( |
| 41 | handlerFunc: (BuildContext context, Map<String, List<Object>> params) { | 41 | handlerFunc: (BuildContext context, Map<String, List<Object>> params) { |
| 42 | String rid = params['rid'].first; | 42 | String rid = params['rid'].first; |
| 43 | - return NotebookDetailPage(rid); | 43 | + bool fromNotify=FluroConvertUtils.string2bool(params["fromNotify"].first); |
| 44 | + return NotebookDetailPage(rid,fromNotify: fromNotify,); | ||
| 44 | }); | 45 | }); |
| 45 | 46 | ||
| 46 | // 跳转到处理在线预订 | 47 | // 跳转到处理在线预订 |
| @@ -48,7 +49,8 @@ var handleOnlineHandler = new Handler( | @@ -48,7 +49,8 @@ var handleOnlineHandler = new Handler( | ||
| 48 | handlerFunc: (BuildContext context, Map<String, List<Object>> params) { | 49 | handlerFunc: (BuildContext context, Map<String, List<Object>> params) { |
| 49 | String rid = params['rid'].first; | 50 | String rid = params['rid'].first; |
| 50 | String mid = params["mid"].first; | 51 | String mid = params["mid"].first; |
| 51 | - return HandleOnlinePage(rid, mid); | 52 | + bool fromNotify=FluroConvertUtils.string2bool(params["fromNotify"].first); |
| 53 | + return HandleOnlinePage(rid, mid,fromNotify: fromNotify,); | ||
| 52 | }); | 54 | }); |
| 53 | 55 | ||
| 54 | // 跳转到选择桌位 | 56 | // 跳转到选择桌位 |
| @@ -39,14 +39,14 @@ class NavigatorUtil { | @@ -39,14 +39,14 @@ class NavigatorUtil { | ||
| 39 | 39 | ||
| 40 | /// 订单详情 | 40 | /// 订单详情 |
| 41 | static void goNotebookDetailPage(BuildContext context, String rid, | 41 | static void goNotebookDetailPage(BuildContext context, String rid, |
| 42 | - {replace = false}) { | ||
| 43 | - _navigateTo(context, "${Routes.reserve_detail}?rid=$rid", replace: replace); | 42 | + {bool fromNotify=false,replace = false}) { |
| 43 | + _navigateTo(context, "${Routes.reserve_detail}?rid=$rid&fromNotify=$fromNotify", replace: replace); | ||
| 44 | } | 44 | } |
| 45 | 45 | ||
| 46 | /// 处理在线预订 | 46 | /// 处理在线预订 |
| 47 | static void goHandleOnlinePage(BuildContext context, String rid, String mid, | 47 | static void goHandleOnlinePage(BuildContext context, String rid, String mid, |
| 48 | - {replace = false}) { | ||
| 49 | - _navigateTo(context, "${Routes.handle_online_page}?rid=$rid&mid=$mid", | 48 | + {fromNotify=false,replace = false}) { |
| 49 | + _navigateTo(context, "${Routes.handle_online_page}?rid=$rid&mid=$mid&fromNotify=$fromNotify", | ||
| 50 | replace: replace); | 50 | replace: replace); |
| 51 | } | 51 | } |
| 52 | 52 |
-
Please register or login to post a comment