Commit fbe7fa8dcefd7afc9befcc1c4c756d3fcd5e88f5

Authored by wdn127929
1 parent ecb5506c

第几次进店UI调整

... ... @@ -34,7 +34,6 @@ def flutterVersionName = "5.5.0"
if (flutterVersionName == null) {
flutterVersionName = '5.5.0'
}
... ...
... ... @@ -11,6 +11,7 @@
import 'dart:async';
import 'package:flutter/foundation.dart';
import 'package:intl/intl.dart';
import 'package:intl/message_lookup_by_library.dart';
import 'package:intl/src/intl_helpers.dart';
... ... @@ -19,11 +20,9 @@ import 'messages_en.dart' as messages_en;
typedef Future<dynamic> LibraryLoader();
Map<String, LibraryLoader> _deferredLibraries = {
'en': () => new Future.value(null),
'en': () => new SynchronousFuture(null),
};
MessageLookupByLibrary? _findExact(String localeName) {
switch (localeName) {
case 'en':
... ... @@ -34,19 +33,20 @@ MessageLookupByLibrary? _findExact(String localeName) {
}
/// User programs should call this before using [localeName] for messages.
Future<bool> initializeMessages(String localeName) async {
Future<bool> initializeMessages(String localeName) {
var availableLocale = Intl.verifiedLocale(
localeName,
(locale) => _deferredLibraries[locale] != null,
onFailure: (_) => null);
onFailure: (_) => null,
);
if (availableLocale == null) {
return new Future.value(false);
return new SynchronousFuture(false);
}
var lib = _deferredLibraries[availableLocale];
await (lib == null ? new Future.value(false) : lib());
lib == null ? new SynchronousFuture(false) : lib();
initializeInternalMessageLookup(() => new CompositeMessageLookup());
messageLookup.addLocale(availableLocale, _findGeneratedMessagesFor);
return new Future.value(true);
return new SynchronousFuture(true);
}
bool _messagesExistFor(String locale) {
... ... @@ -58,8 +58,11 @@ bool _messagesExistFor(String locale) {
}
MessageLookupByLibrary? _findGeneratedMessagesFor(String locale) {
var actualLocale = Intl.verifiedLocale(locale, _messagesExistFor,
onFailure: (_) => null);
var actualLocale = Intl.verifiedLocale(
locale,
_messagesExistFor,
onFailure: (_) => null,
);
if (actualLocale == null) return null;
return _findExact(actualLocale);
}
... ...
... ... @@ -7,7 +7,8 @@
// ignore_for_file:unnecessary_brace_in_string_interps, unnecessary_new
// ignore_for_file:prefer_single_quotes,comment_references, directives_ordering
// ignore_for_file:annotate_overrides,prefer_generic_function_type_aliases
// ignore_for_file:unused_import, file_names
// ignore_for_file:unused_import, file_names, avoid_escaping_inner_quotes
// ignore_for_file:unnecessary_string_interpolations, unnecessary_string_escapes
import 'package:intl/intl.dart';
import 'package:intl/message_lookup_by_library.dart';
... ... @@ -19,8 +20,6 @@ typedef String MessageIfAbsent(String messageStr, List<dynamic> args);
class MessageLookup extends MessageLookupByLibrary {
String get localeName => 'en';
final Map<String, dynamic> messages = _notInlinedMessages(_notInlinedMessages);
static _notInlinedMessages(_) => <String, Function> {
};
final messages = _notInlinedMessages(_notInlinedMessages);
static Map<String, Function> _notInlinedMessages(_) => <String, Function>{};
}
... ...
// GENERATED CODE - DO NOT MODIFY BY HAND
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import 'intl/messages_all.dart';
... ... @@ -13,41 +10,57 @@ import 'intl/messages_all.dart';
// ignore_for_file: non_constant_identifier_names, lines_longer_than_80_chars
// ignore_for_file: join_return_with_assignment, prefer_final_in_for_each
// ignore_for_file: avoid_redundant_argument_values
// ignore_for_file: avoid_redundant_argument_values, avoid_escaping_inner_quotes
class S {
S();
static late S current;
static const AppLocalizationDelegate delegate =
AppLocalizationDelegate();
static S? _current;
static S get current {
assert(
_current != null,
'No instance of S was loaded. Try to initialize the S delegate before accessing S.current.',
);
return _current!;
}
static const AppLocalizationDelegate delegate = AppLocalizationDelegate();
static Future<S> load(Locale locale) {
final name = (locale.countryCode?.isEmpty ?? false) ? locale.languageCode : locale.toString();
final localeName = Intl.canonicalizedLocale(name);
final name =
(locale.countryCode?.isEmpty ?? false)
? locale.languageCode
: locale.toString();
final localeName = Intl.canonicalizedLocale(name);
return initializeMessages(localeName).then((_) {
Intl.defaultLocale = localeName;
S.current = S();
return S.current;
});
}
final instance = S();
S._current = instance;
static S? of(BuildContext context) {
return Localizations.of<S>(context, S);
return instance;
});
}
static S of(BuildContext context) {
final instance = S.maybeOf(context);
assert(
instance != null,
'No instance of S present in the widget tree. Did you add S.delegate in localizationsDelegates?',
);
return instance!;
}
static S? maybeOf(BuildContext context) {
return Localizations.of<S>(context, S);
}
}
class AppLocalizationDelegate extends LocalizationsDelegate<S> {
const AppLocalizationDelegate();
List<Locale> get supportedLocales {
return const <Locale>[
Locale.fromSubtags(languageCode: 'en'),
];
return const <Locale>[Locale.fromSubtags(languageCode: 'en')];
}
@override
... ... @@ -58,13 +71,11 @@ class AppLocalizationDelegate extends LocalizationsDelegate<S> {
bool shouldReload(AppLocalizationDelegate old) => false;
bool _isSupported(Locale locale) {
if (locale != null) {
for (var supportedLocale in supportedLocales) {
if (supportedLocale.languageCode == locale.languageCode) {
return true;
}
for (var supportedLocale in supportedLocales) {
if (supportedLocale.languageCode == locale.languageCode) {
return true;
}
}
return false;
}
}
\ No newline at end of file
}
... ...
... ... @@ -48,18 +48,18 @@ class Table {
//预订总次数显示
String get reserveCountShow {
if (reserveCount == '1' || phone == null || phone == ''
if (reserveCount == '1'
// ||
// reserver == null ||
// reserver.isEmpty ||
// reserver == ''
) {
// 预订次数== 1 或者 姓名或者客户电话号码为空的时候 ,显示首次预订
return "首次预订";
return "新客";
} else if (reserveCount != null &&
reserveCount != '0' &&
reserveCount != '') {
return '${reserveCount}次预订';
return '第${reserveCount}次进店';
} else {
return '';
}
... ...
... ... @@ -383,18 +383,19 @@ class ReserveListModel {
//预订总次数显示
String get reserveCountShow {
if (reserveCount == '1' || phone == null || phone == ''
if (reserveCount == '1'
// ||
// reserver == null ||
// reserver.isEmpty ||
// reserver == ''
) {
// 预订次数== 1 或者 姓名或者客户电话号码为空的时候 ,显示首次预订
return "首次预订";
return "新客";
} else if (reserveCount != null &&
reserveCount != '0' &&
reserveCount != '') {
return '${reserveCount}次预订';
return '第${reserveCount}次进店';
} else {
return '';
}
... ...
... ... @@ -350,9 +350,10 @@ class TableItemOrReserveState extends State<TableItemOrReserve> {
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
widget.need && table.signStr == '已预订' && !isSelf
? SizedBox()
: VEmptyView(10),
if (!(widget.need &&
table.signStr == '已预订' &&
!isSelf))
VEmptyView(10),
Container(
// color: Colors.red,
alignment: Alignment.center,
... ... @@ -387,89 +388,85 @@ class TableItemOrReserveState extends State<TableItemOrReserve> {
// overflow: TextOverflow.ellipsis,
// ),
),
((table.reserver != null && table.reserver != '') ||
if (((table.reserver != null &&
table.reserver != '') ||
(table.pnum != '' &&
table.pnum != null &&
table.pnum != '0')))
VEmptyView(8),
if (!(table.signStr == '已预订' && !isSelf))
Text(
table.tableNum,
style: TextStyle(
color: table.signStr == '已预订' && !isSelf
? MyColours.color_353535
: (widget.canSelected && table.selected)
? MyColours.color_ffffff
: MyColours.color_353535,
fontSize: ScreenUtil().setSp(22),
decoration: TextDecoration.none,
fontWeight: FontWeight.normal),
overflow: TextOverflow.ellipsis,
),
if (table.signStr == '已预订' &&
!isSelf &&
((table.reserver != null &&
!table.reserver!.isEmpty &&
table.reserver != '') ||
(table.pnum != '' &&
table.pnum != null &&
table.pnum != '0'))
? VEmptyView(8)
: SizedBox(),
table.signStr == '已预订' && !isSelf
? SizedBox()
: Text(
table.tableNum,
style: TextStyle(
color: table.signStr == '已预订' && !isSelf
? MyColours.color_353535
: (widget.canSelected &&
table.selected)
? MyColours.color_ffffff
: MyColours.color_353535,
fontSize: ScreenUtil().setSp(22),
decoration: TextDecoration.none,
fontWeight: FontWeight.normal),
overflow: TextOverflow.ellipsis,
),
table.signStr == '已预订' &&
!isSelf &&
((table.reserver != null &&
!table.reserver!.isEmpty &&
table.reserver != '') ||
(table.pnum != '' &&
table.pnum != '0')))
Text(
(table.reserver == null ||
table.reserver!.isEmpty ||
table.reserver == '')
? (table.pnum != '' &&
table.pnum != null &&
table.pnum != '0'))
? Text(
(table.reserver == null ||
table.reserver!.isEmpty ||
table.reserver == '')
? (table.pnum != '' &&
table.pnum != '0')
? '(${table.pnum}人)'
: ''
: '${table.reserver}' +
(table.pnum != '' &&
table.pnum != null &&
table.pnum != '0')
table.pnum != '0'
? '(${table.pnum}人)'
: ''
: '${table.reserver}' +
(table.pnum != '' &&
table.pnum != null &&
table.pnum != '0'
? '(${table.pnum}人)'
: ''),
style: TextStyle(
color: table.signStr == '已预订' && !isSelf
? MyColours.color_353535
: (widget.canSelected &&
table.selected)
? MyColours.color_ffffff
: MyColours.color_353535,
fontSize: ScreenUtil().setSp(22),
decoration: TextDecoration.none,
fontWeight: FontWeight.normal),
overflow: TextOverflow.ellipsis,
)
: SizedBox(),
: ''),
style: TextStyle(
color: table.signStr == '已预订' && !isSelf
? MyColours.color_353535
: (widget.canSelected && table.selected)
? MyColours.color_ffffff
: MyColours.color_353535,
fontSize: ScreenUtil().setSp(22),
decoration: TextDecoration.none,
fontWeight: FontWeight.normal),
overflow: TextOverflow.ellipsis,
),
widget.need &&
table.signStr == '已预订' &&
!isSelf &&
table.place_order_name != null &&
table.place_order_name != ''
? Padding(
padding: EdgeInsets.only(
top: ScreenUtil().setWidth(6),
bottom: ScreenUtil().setWidth(8),
),
child: Text(
table.place_order_name != null &&
table.place_order_name != ''
? '${table.place_order_name}订'
: '',
style: TextStyle(
color: MyColours.color_353535,
fontSize: ScreenUtil().setSp(22),
decoration: TextDecoration.none,
fontWeight: FontWeight.normal),
overflow: TextOverflow.ellipsis,
),
)
: SizedBox(),
if (widget.need &&
table.signStr == '已预订' &&
!isSelf &&
table.place_order_name != null &&
table.place_order_name != '')
Padding(
padding: EdgeInsets.only(
top: ScreenUtil().setWidth(6),
bottom: ScreenUtil().setWidth(8),
),
child: Text(
table.place_order_name != null &&
table.place_order_name != ''
? '${table.place_order_name}订'
: '',
style: TextStyle(
color: MyColours.color_353535,
fontSize: ScreenUtil().setSp(22),
decoration: TextDecoration.none,
fontWeight: FontWeight.normal),
overflow: TextOverflow.ellipsis,
),
),
// VEmptyView(6),
// Text(
// table.lowStr,
... ... @@ -480,54 +477,54 @@ class TableItemOrReserveState extends State<TableItemOrReserve> {
// fontWeight: FontWeight.normal),
// overflow: TextOverflow.ellipsis,
// )
table.signStr == '已预订' && !isSelf
? Container(
// width: ScreenUtil().setWidth(160),
height: ScreenUtil().setWidth(34),
)
: SizedBox()
if (table.label != '' &&
table.label != null &&
table.signStr == '已预订' &&
!isSelf)
Container(
// width: ScreenUtil().setWidth(160),
height: ScreenUtil().setWidth(34),
)
],
),
),
table.signStr == '已预订' && !isSelf
? SizedBox()
: Positioned(
left: 0,
top: 0,
child: table.tidStr == null
? Container()
: Container(
// width: ScreenUtil().setWidth(60),
// height: ScreenUtil().setWidth(42),
padding: EdgeInsets.all(
ScreenUtil().setWidth(4)),
alignment: Alignment.center,
decoration: BoxDecoration(
if (!(table.signStr == '已预订' && !isSelf))
Positioned(
left: 0,
top: 0,
child: table.tidStr == null
? Container()
: Container(
// width: ScreenUtil().setWidth(60),
// height: ScreenUtil().setWidth(42),
padding:
EdgeInsets.all(ScreenUtil().setWidth(4)),
alignment: Alignment.center,
decoration: BoxDecoration(
color: widget.canSelected &&
table.selected
? MyColours.color_199095
: Color.fromRGBO(239, 239, 239, 1),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(
ScreenUtil().setWidth(20)),
// topRight:
// Radius.circular(ScreenUtil().setWidth(8)),
// bottomRight: Radius.circular(
// ScreenUtil().setWidth(8))
)),
child: Text(table.tidStr,
style: TextStyle(
color: widget.canSelected &&
table.selected
? MyColours.color_199095
: Color.fromRGBO(
239, 239, 239, 1),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(
ScreenUtil().setWidth(20)),
// topRight:
// Radius.circular(ScreenUtil().setWidth(8)),
// bottomRight: Radius.circular(
// ScreenUtil().setWidth(8))
)),
child: Text(table.tidStr,
style: TextStyle(
color: widget.canSelected &&
table.selected
? MyColours.color_ffffff
: MyColours.color_333333,
fontSize: ScreenUtil().setSp(20),
decoration: TextDecoration.none,
fontWeight: FontWeight.normal)),
),
),
? MyColours.color_ffffff
: MyColours.color_333333,
fontSize: ScreenUtil().setSp(20),
decoration: TextDecoration.none,
fontWeight: FontWeight.normal)),
),
),
// widget.need && table.signStr == '已预订'
// ? Positioned(
// bottom: 0,
... ... @@ -574,52 +571,53 @@ class TableItemOrReserveState extends State<TableItemOrReserve> {
// height: ScreenUtil().setWidth(40),
// )
// : Container()),
widget.need && table.signStr == '已预订' && !isSelf
? SizedBox()
: Positioned(
left: ScreenUtil().setWidth(18),
bottom: ScreenUtil().setWidth(12),
child: table.isPhoto != 1
? Image.asset(
widget.canSelected && table.selected
? 'assets/f_camera_white.png'
: "assets/f_camera.png",
width: ScreenUtil().setWidth(22),
height: ScreenUtil().setWidth(22),
)
: Container()),
Positioned(
bottom: 0,
right: 0,
left: 0,
child: table.signStr == '已预订' && !isSelf
? Container(
// width: ScreenUtil().setWidth(160),
height: ScreenUtil().setWidth(34),
alignment: Alignment.center,
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(10)),
decoration: BoxDecoration(
color: table.sign == '10'
? MyColours.color_F7C797
: MyColours.color_d9d9d9,
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(
ScreenUtil().setWidth(20)),
bottomRight: Radius.circular(
ScreenUtil().setWidth(20)))),
child: Text(
table.label!,
textAlign: TextAlign.center,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: MyColours.color_28323B,
fontSize: ScreenUtil().setSp(22),
decoration: TextDecoration.none,
fontWeight: FontWeight.normal),
),
)
: SizedBox())
if (!(widget.need && table.signStr == '已预订' && !isSelf))
Positioned(
left: ScreenUtil().setWidth(18),
bottom: ScreenUtil().setWidth(12),
child: table.isPhoto != 1
? Image.asset(
widget.canSelected && table.selected
? 'assets/f_camera_white.png'
: "assets/f_camera.png",
width: ScreenUtil().setWidth(22),
height: ScreenUtil().setWidth(22),
)
: Container()),
if (table.label != '' &&
table.label != null &&
table.signStr == '已预订' &&
!isSelf)
Positioned(
bottom: 0,
right: 0,
left: 0,
child: Container(
// width: ScreenUtil().setWidth(160),
height: ScreenUtil().setWidth(34),
alignment: Alignment.center,
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(10)),
decoration: BoxDecoration(
color: table.sign == '10'
? MyColours.color_F7C797
: MyColours.color_d9d9d9,
borderRadius: BorderRadius.only(
bottomLeft:
Radius.circular(ScreenUtil().setWidth(20)),
bottomRight: Radius.circular(
ScreenUtil().setWidth(20)))),
child: Text(
table.label!,
textAlign: TextAlign.center,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: MyColours.color_28323B,
fontSize: ScreenUtil().setSp(22),
decoration: TextDecoration.none,
fontWeight: FontWeight.normal),
),
))
],
),
);
... ...
... ... @@ -397,7 +397,7 @@ class FTableItemState extends State<FTableItem> {
// fontWeight: FontWeight.normal),
// overflow: TextOverflow.ellipsis,
// )
signStr == '已预订' && !isSelf
signStr == '已预订' && !isSelf && (table.sign == '10' || table.reserveCountShow != '')
? Container(
// width: ScreenUtil().setWidth(160),
height: ScreenUtil().setWidth(34),
... ... @@ -519,7 +519,7 @@ class FTableItemState extends State<FTableItem> {
decoration: BoxDecoration(
color: table.sign == '10'
? MyColours.color_F7C797
: MyColours.color_d9d9d9,
:table.reserveCountShow == ''? Colors.transparent: MyColours.color_d9d9d9,
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(
ScreenUtil().setWidth(20)),
... ...