Commit 9555c583d48f477ea64dafa6c24b9b352daffe68

Authored by wdn127929
1 parent 0d098603

历史手机号高度变大,增加滚动条

... ... @@ -15,6 +15,7 @@ import 'package:one_key/widgets/v_empty_view.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:provider/provider.dart';
import '../../utils/screen_util.dart';
import '../../widgets/special_text/my_extended_text_selection_controls.dart';
/**
... ... @@ -43,6 +44,8 @@ class _EditReserverPageState extends State<EditReserverPage> {
MyTextSelectionControls _myExtendedMaterialTextSelectionControls =
MyTextSelectionControls();
ScrollController _scrollCrl = ScrollController();
@override
void initState() {
super.initState();
... ... @@ -195,9 +198,16 @@ class _EditReserverPageState extends State<EditReserverPage> {
),
body: Container(
color: MyColours.color_ffffff,
// color: Colors.red,
child: InkWell(
onTap: () {
FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘
if (showPhoneHistory) {
setState(() {
showPhoneHistory = false;
detailModel.userHistorys.clear();
});
}
},
child: Padding(
padding: EdgeInsets.symmetric(
... ... @@ -344,6 +354,9 @@ class _EditReserverPageState extends State<EditReserverPage> {
});
return;
}
setState(() {
showPhoneHistory = true;
});
Map<String, String> params = {
"keywords": value,
"sid": Provider.of<UserModel>(context,
... ... @@ -575,10 +588,13 @@ class _EditReserverPageState extends State<EditReserverPage> {
color: MyColours.color_e5e5e5,
blurRadius: ScreenUtil().setWidth(20))
]),
width: ScreenUtil().setWidth(440),
height: detailModel.userHistorys.length > 1
? ScreenUtil().setWidth(260)
: ScreenUtil().setWidth(104),
width: ScreenUtil().screenWidth - w(60),
// width: ScreenUtil().setWidth(350),
constraints: BoxConstraints(maxHeight: w(270)),
// width: ScreenUtil().setWidth(440),
// height: detailModel.userHistorys.length > 1
// ? ScreenUtil().setWidth(260)
// : ScreenUtil().setWidth(104),
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(30)),
child: Align(
... ... @@ -586,108 +602,122 @@ class _EditReserverPageState extends State<EditReserverPage> {
child: MediaQuery.removePadding(
context: context,
removeTop: true,
child: ListView.builder(
shrinkWrap: true,
itemBuilder: (context, index) {
return GestureDetector(
onTap: () {
setState(() {
showPhoneHistory = false;
detailModel.phoneController
.text = detailModel
child: Scrollbar(
isAlwaysShown: true, //设置滚动条常亮
controller:
_scrollCrl, //必须设置一个controller
///添加进度条
child: ListView.builder(
shrinkWrap: true,
controller: _scrollCrl,
itemBuilder: (context, index) {
return GestureDetector(
onTap: () {
setState(() {
showPhoneHistory = false;
detailModel.phoneController
.text = detailModel
.userHistorys[
index]
.phone !=
null
? detailModel
.userHistorys[index]
.phone !=
null
? detailModel
.userHistorys[index]
.phone
: '';
// _homeEnterModel.nameController.text =
// _homeEnterModel
// .userHistorys[index].rname +
// _nameSuffix();
_addNameSuffix(
detailModel
.phone
: '';
// _homeEnterModel.nameController.text =
// _homeEnterModel
// .userHistorys[index].rname +
// _nameSuffix();
_addNameSuffix(
detailModel
.userHistorys[index]
.rname,
_nameSuffix());
nameStr = detailModel
.userHistorys[index]
.rname,
_nameSuffix());
nameStr = detailModel
.userHistorys[index].rname;
_phoneNode.unfocus();
detailModel.userHistorys
.clear();
});
},
child: Container(
width: double.infinity,
height:
ScreenUtil().setWidth(102),
decoration: BoxDecoration(
border: Border(
bottom: (index !=
(detailModel
.rname;
_phoneNode.unfocus();
detailModel.userHistorys
.clear();
});
},
child: Container(
width: double.infinity,
height: ScreenUtil()
.setWidth(102),
decoration: BoxDecoration(
border: Border(
bottom: (index !=
(detailModel
.userHistorys
.length -
1) &&
detailModel
.userHistorys
.length -
1) &&
detailModel
.userHistorys
.length >
1)
? BorderSide(
color: MyColours
.color_e5e5e5,
width:
ScreenUtil()
.length >
1)
? BorderSide(
color: MyColours
.color_e5e5e5,
width: ScreenUtil()
.setWidth(
2))
: BorderSide.none)),
child: Row(
mainAxisAlignment:
MainAxisAlignment
.spaceBetween,
children: [
Text(
detailModel
: BorderSide
.none)),
child: Row(
mainAxisAlignment:
MainAxisAlignment
.spaceBetween,
children: [
Text(
detailModel
.userHistorys[
index]
.phone ==
null
? ''
: detailModel
.userHistorys[
index]
.phone ==
null
? ''
: detailModel
.userHistorys[index]
.phone,
style: TextStyle(
color: MyColours
.color_333333,
fontSize: ScreenUtil()
.setSp(32)),
),
Expanded(
child: Text(
detailModel
.phone,
style: TextStyle(
color: MyColours
.color_333333,
fontSize:
ScreenUtil()
.setSp(32)),
),
Expanded(
child: Text(
detailModel
.userHistorys[
index]
.rname ==
null
? ''
: detailModel
.userHistorys[
index]
.rname ==
null
? ''
: detailModel
.userHistorys[index]
.rname,
style: TextStyle(
color: MyColours
.color_333333,
fontSize: ScreenUtil()
.setSp(32)),
))
],
),
),
);
},
itemExtent: ScreenUtil().setWidth(104),
itemCount:
detailModel.userHistorys.length,
))),
.rname,
style: TextStyle(
color: MyColours
.color_333333,
fontSize:
ScreenUtil()
.setSp(32)),
))
],
),
),
);
},
itemExtent:
ScreenUtil().setWidth(104),
itemCount:
detailModel.userHistorys.length,
)))),
),
),
],
... ...
... ... @@ -35,6 +35,7 @@ import 'package:provider/provider.dart';
import 'package:one_key/models/table_list.dart' as t;
import 'dart:convert' as convert;
import 'package:easy_contact_picker/easy_contact_picker.dart';
import '../../utils/screen_util.dart';
import '../../widgets/special_text/my_extended_text_selection_controls.dart';
typedef clickCallback = void Function(String value);
... ... @@ -72,6 +73,7 @@ class _NoteBookChangeFPageState extends State<NoteBookChangeFPage> {
FocusNode _cusdemNode = FocusNode();
MyTextSelectionControls _myExtendedMaterialTextSelectionControls =
MyTextSelectionControls();
ScrollController _scrollCrl = ScrollController();
@override
void initState() {
... ... @@ -528,7 +530,7 @@ class _NoteBookChangeFPageState extends State<NoteBookChangeFPage> {
}
_notebookDetailChangeModel.nameController.text = name + suffix;
}
/**
_bottomWidget() {
return Container(
padding: EdgeInsets.symmetric(
... ... @@ -777,101 +779,114 @@ class _NoteBookChangeFPageState extends State<NoteBookChangeFPage> {
],
),
Offstage(
offstage: !(showPhoneHistory &&
_notebookDetailChangeModel.userHistorys.length > 0),
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
border: Border.all(color: Colors.white),
color: MyColours.color_ffffff,
boxShadow: [
BoxShadow(
color: MyColours.color_e5e5e5,
blurRadius: ScreenUtil().setWidth(20))
]),
// width: ScreenUtil().setWidth(440),
height: _notebookDetailChangeModel.userHistorys.length > 1
? ScreenUtil().setWidth(208)
: ScreenUtil().setWidth(104),
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(30)),
child: Align(
offstage: !(showPhoneHistory &&
_notebookDetailChangeModel.userHistorys.length > 0),
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
border: Border.all(color: Colors.white),
color: MyColours.color_ffffff,
boxShadow: [
BoxShadow(
color: MyColours.color_e5e5e5,
blurRadius: ScreenUtil().setWidth(20))
]),
// width: ScreenUtil().setWidth(440),
// height: _notebookDetailChangeModel.userHistorys.length > 1
// ? ScreenUtil().setWidth(208)
// : ScreenUtil().setWidth(104),
width: ScreenUtil().screenWidth - w(60),
// width: ScreenUtil().setWidth(350),
constraints: BoxConstraints(maxHeight: w(270)),
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(30)),
child: Align(
alignment: Alignment.topCenter,
child: MediaQuery.removePadding(
context: context,
removeTop: true,
child: ListView.builder(
itemBuilder: (context, index) {
return GestureDetector(
onTap: () {
setState(() {
showPhoneHistory = false;
_notebookDetailChangeModel
.phoneController.text =
child: Scrollbar(
isAlwaysShown: true, //设置滚动条常亮
controller: _scrollCrl, //必须设置一个controller
///添加进度条
child: ListView.builder(
controller: _scrollCrl,
itemBuilder: (context, index) {
return GestureDetector(
onTap: () {
setState(() {
showPhoneHistory = false;
_notebookDetailChangeModel
.userHistorys[index].phone;
// _notebookDetailChangeModel
// .nameController.text =
// _notebookDetailChangeModel
// .userHistorys[index].rname;
_addNameSuffix(
_notebookDetailChangeModel
.userHistorys[index].rname,
_nameSuffix());
nameStr = _notebookDetailChangeModel
.userHistorys[index].rname;
_phoneNode.unfocus();
_notebookDetailChangeModel.userHistorys
.clear();
});
},
child: Container(
width: double.infinity,
height: ScreenUtil().setWidth(102),
decoration: BoxDecoration(
border: Border(
bottom: (index !=
(_notebookDetailChangeModel
.phoneController.text =
_notebookDetailChangeModel
.userHistorys[index].phone;
// _notebookDetailChangeModel
// .nameController.text =
// _notebookDetailChangeModel
// .userHistorys[index].rname;
_addNameSuffix(
_notebookDetailChangeModel
.userHistorys[index].rname,
_nameSuffix());
nameStr = _notebookDetailChangeModel
.userHistorys[index].rname;
_phoneNode.unfocus();
_notebookDetailChangeModel.userHistorys
.clear();
});
},
child: Container(
width: double.infinity,
height: ScreenUtil().setWidth(102),
decoration: BoxDecoration(
border: Border(
bottom: (index !=
(_notebookDetailChangeModel
.userHistorys
.length -
1) &&
_notebookDetailChangeModel
.userHistorys
.length -
1) &&
_notebookDetailChangeModel
.userHistorys.length >
1)
? BorderSide(
color: MyColours.color_e5e5e5,
width:
ScreenUtil().setWidth(2))
: BorderSide.none)),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Text(
_notebookDetailChangeModel
.userHistorys[index].phone,
style: TextStyle(
color: MyColours.color_333333,
fontSize: ScreenUtil().setSp(32)),
.length >
1)
? BorderSide(
color: MyColours
.color_e5e5e5,
width: ScreenUtil()
.setWidth(2))
: BorderSide.none)),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Text(
_notebookDetailChangeModel
.userHistorys[index].phone,
style: TextStyle(
color: MyColours.color_333333,
fontSize:
ScreenUtil().setSp(32)),
),
Text(
_notebookDetailChangeModel
.userHistorys[index].rname,
style: TextStyle(
color: MyColours.color_333333,
fontSize:
ScreenUtil().setSp(32)),
)
],
),
Text(
_notebookDetailChangeModel
.userHistorys[index].rname,
style: TextStyle(
color: MyColours.color_333333,
fontSize: ScreenUtil().setSp(32)),
)
],
),
),
);
},
itemExtent: ScreenUtil().setWidth(104),
itemCount:
_notebookDetailChangeModel.userHistorys.length,
))),
),
)
),
);
},
itemExtent: ScreenUtil().setWidth(104),
itemCount: _notebookDetailChangeModel
.userHistorys.length,
))),
),
))
],
)
// VEmptyView(62),
... ... @@ -880,6 +895,8 @@ class _NoteBookChangeFPageState extends State<NoteBookChangeFPage> {
);
}
*/
_remarkListWidget() {
List<Remark> remark = [];
if (remarkManagerModel.ofenRemarks.length > 4) {
... ... @@ -1156,6 +1173,12 @@ class _NoteBookChangeFPageState extends State<NoteBookChangeFPage> {
behavior: HitTestBehavior.translucent,
onTap: () {
FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘
if (showPhoneHistory) {
setState(() {
showPhoneHistory = false;
// _notebookDetailChangeModel.userHistorys.clear();
});
}
},
child: Scaffold(
backgroundColor: Colors.white,
... ... @@ -1838,11 +1861,14 @@ class _NoteBookChangeFPageState extends State<NoteBookChangeFPage> {
color: MyColours.color_e5e5e5,
blurRadius: ScreenUtil().setWidth(20))
]),
width: ScreenUtil().setWidth(440),
height:
_notebookDetailChangeModel.userHistorys.length > 1
? ScreenUtil().setWidth(208)
: ScreenUtil().setWidth(104),
// width: ScreenUtil().setWidth(440),
// height:
// _notebookDetailChangeModel.userHistorys.length > 1
// ? ScreenUtil().setWidth(208)
// : ScreenUtil().setWidth(104),
width: ScreenUtil().screenWidth - w(60),
// width: ScreenUtil().setWidth(350),
constraints: BoxConstraints(maxHeight: w(260)),
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(30)),
child: Align(
... ... @@ -1850,84 +1876,99 @@ class _NoteBookChangeFPageState extends State<NoteBookChangeFPage> {
child: MediaQuery.removePadding(
context: context,
removeTop: true,
child: ListView.builder(
itemBuilder: (context, index) {
return GestureDetector(
onTap: () {
setState(() {
showPhoneHistory = false;
_notebookDetailChangeModel
.phoneController.text =
child: Scrollbar(
isAlwaysShown: true, //设置滚动条常亮
controller: _scrollCrl, //必须设置一个controller
///添加进度条
child: ListView.builder(
itemBuilder: (context, index) {
return GestureDetector(
onTap: () {
setState(() {
showPhoneHistory = false;
_notebookDetailChangeModel
.userHistorys[index].phone;
// _homeEnterModel.nameController.text =
// _homeEnterModel
// .userHistorys[index].rname +
// _nameSuffix();
_addNameSuffix(
.phoneController.text =
_notebookDetailChangeModel
.userHistorys[index]
.phone;
// _homeEnterModel.nameController.text =
// _homeEnterModel
// .userHistorys[index].rname +
// _nameSuffix();
_addNameSuffix(
_notebookDetailChangeModel
.userHistorys[index]
.rname,
_nameSuffix());
nameStr =
_notebookDetailChangeModel
.userHistorys[index]
.rname;
_phoneNode.unfocus();
_notebookDetailChangeModel
.userHistorys[index].rname,
_nameSuffix());
nameStr = _notebookDetailChangeModel
.userHistorys[index].rname;
_phoneNode.unfocus();
_notebookDetailChangeModel
.userHistorys
.clear();
});
},
child: Container(
width: double.infinity,
height: ScreenUtil().setWidth(102),
decoration: BoxDecoration(
border: Border(
bottom: (index !=
(_notebookDetailChangeModel
.userHistorys
.clear();
});
},
child: Container(
width: double.infinity,
height:
ScreenUtil().setWidth(102),
decoration: BoxDecoration(
border: Border(
bottom: (index !=
(_notebookDetailChangeModel
.userHistorys
.length -
1) &&
_notebookDetailChangeModel
.userHistorys
.length -
1) &&
_notebookDetailChangeModel
.userHistorys
.length >
1)
? BorderSide(
color: MyColours
.color_e5e5e5,
width: ScreenUtil()
.setWidth(2))
: BorderSide.none)),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Text(
_notebookDetailChangeModel
.userHistorys[index].phone,
style: TextStyle(
color:
MyColours.color_333333,
fontSize:
ScreenUtil().setSp(32)),
.length >
1)
? BorderSide(
color: MyColours
.color_e5e5e5,
width:
ScreenUtil()
.setWidth(
2))
: BorderSide.none)),
child: Row(
mainAxisAlignment:
MainAxisAlignment
.spaceBetween,
children: [
Text(
_notebookDetailChangeModel
.userHistorys[index]
.phone,
style: TextStyle(
color: MyColours
.color_333333,
fontSize: ScreenUtil()
.setSp(32)),
),
Expanded(
child: Text(
_notebookDetailChangeModel
.userHistorys[index]
.rname,
style: TextStyle(
color: MyColours
.color_333333,
fontSize: ScreenUtil()
.setSp(32)),
))
],
),
Expanded(
child: Text(
_notebookDetailChangeModel
.userHistorys[index].rname,
style: TextStyle(
color:
MyColours.color_333333,
fontSize:
ScreenUtil().setSp(32)),
))
],
),
),
);
},
itemExtent: ScreenUtil().setWidth(104),
itemCount: _notebookDetailChangeModel
.userHistorys.length,
))),
),
);
},
itemExtent: ScreenUtil().setWidth(104),
itemCount: _notebookDetailChangeModel
.userHistorys.length,
)))),
),
)
],
... ...
... ... @@ -46,6 +46,7 @@ import '../../app.dart';
import '../../models/sms_info.dart';
import '../../provider/customer_provider.dart';
import '../../provider/my_model.dart';
import '../../utils/screen_util.dart';
import '../../widgets/special_text/my_extended_text_selection_controls.dart';
class InvicationPage extends StatefulWidget {
... ... @@ -163,6 +164,8 @@ class InvicationPageState extends State<InvicationPage>
MyModel myModel;
SmsInfoData smsInfoData;
ScrollController _scrollCrl = ScrollController();
@override
void initState() {
super.initState();
... ... @@ -2354,105 +2357,121 @@ class InvicationPageState extends State<InvicationPage>
top: 0,
left: 0,
child: Offstage(
offstage: !(showPhoneHistory &&
_baseIndoProvider.userHistorys.length > 0),
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
border: Border.all(color: Colors.white),
color: MyColours.color_ffffff,
// color: Colors.red,
boxShadow: [
BoxShadow(
color: MyColours.color_e5e5e5,
blurRadius: ScreenUtil().setWidth(20))
]),
width: ScreenUtil().setWidth(440),
height: _baseIndoProvider.userHistorys.length > 1
? ScreenUtil().setWidth(140)
: ScreenUtil().setWidth(104),
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(30)),
child: Align(
offstage: !(showPhoneHistory &&
_baseIndoProvider.userHistorys.length > 0),
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
border: Border.all(color: Colors.white),
color: MyColours.color_ffffff,
// color: Colors.red,
boxShadow: [
BoxShadow(
color: MyColours.color_e5e5e5,
blurRadius: ScreenUtil().setWidth(20))
]),
// width: ScreenUtil().setWidth(440),
// height: _baseIndoProvider.userHistorys.length > 1
// ? ScreenUtil().setWidth(140)
// : ScreenUtil().setWidth(104),
width: ScreenUtil().screenWidth - w(60),
// width: ScreenUtil().setWidth(350),
constraints: BoxConstraints(maxHeight: w(270)),
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(30)),
child: Align(
alignment: Alignment.topCenter,
child: MediaQuery.removePadding(
context: context,
removeTop: true,
child: ListView.builder(
shrinkWrap: true,
itemBuilder: (context, index) {
return GestureDetector(
onTap: () {
_getIsMemberByPhone(_baseIndoProvider
.userHistorys[index].phone);
needHistory = true;
_showConfirmWidget(
needHistory: true, index: index);
},
child: Container(
width: double.infinity,
height: ScreenUtil().setWidth(102),
decoration: BoxDecoration(
border: Border(
bottom: (index !=
(_baseIndoProvider
child: Scrollbar(
isAlwaysShown: true, //设置滚动条常亮
controller: _scrollCrl, //必须设置一个controller
///添加进度条
child: ListView.builder(
shrinkWrap: true,
controller: _scrollCrl,
itemBuilder: (context, index) {
return GestureDetector(
onTap: () {
_getIsMemberByPhone(
_baseIndoProvider
.userHistorys[index].phone);
needHistory = true;
_showConfirmWidget(
needHistory: true,
index: index);
},
child: Container(
width: double.infinity,
height: ScreenUtil().setWidth(102),
decoration: BoxDecoration(
border: Border(
bottom: (index !=
(_baseIndoProvider
.userHistorys
.length -
1) &&
_baseIndoProvider
.userHistorys
.length -
1) &&
_baseIndoProvider
.userHistorys
.length >
1)
? BorderSide(
color: MyColours
.color_e5e5e5,
width: ScreenUtil()
.setWidth(2))
: BorderSide.none)),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Text(
_baseIndoProvider
.length >
1)
? BorderSide(
color: MyColours
.color_e5e5e5,
width: ScreenUtil()
.setWidth(2))
: BorderSide.none)),
child: Row(
mainAxisAlignment:
MainAxisAlignment
.spaceBetween,
children: [
Text(
_baseIndoProvider
.userHistorys[
index]
.phone ==
null
? ''
: _baseIndoProvider
.userHistorys[index]
.phone ==
null
? ''
: _baseIndoProvider
.userHistorys[index]
.phone,
style: TextStyle(
color: MyColours.color_333333,
fontSize:
ScreenUtil().setSp(32)),
),
Expanded(
child: Text(
_baseIndoProvider
.phone,
style: TextStyle(
color: MyColours
.color_333333,
fontSize: ScreenUtil()
.setSp(32)),
),
Expanded(
child: Text(
_baseIndoProvider
.userHistorys[
index]
.rname ==
null
? ''
: _baseIndoProvider
.userHistorys[index]
.rname ==
null
? ''
: _baseIndoProvider
.userHistorys[index]
.rname,
style: TextStyle(
color: MyColours.color_333333,
fontSize:
ScreenUtil().setSp(32)),
))
],
),
),
);
},
itemExtent: ScreenUtil().setWidth(104),
itemCount:
_baseIndoProvider.userHistorys.length,
))),
),
))
.rname,
style: TextStyle(
color: MyColours
.color_333333,
fontSize: ScreenUtil()
.setSp(32)),
))
],
),
),
);
},
itemExtent: ScreenUtil().setWidth(104),
itemCount:
_baseIndoProvider.userHistorys.length,
))),
),
)))
: SizedBox()
],
),
... ...
... ... @@ -115,7 +115,7 @@ class _MonthItemState extends State<MonthItem> {
),
HEmptyView(10),
Text(
'${widget.countsListSunModel.totalPnum}人',
'${widget.countsListSunModel.totalPnum??0}人',
style: TextStyle(
color: MyColours.color_515151,
fontSize: font(12)),
... ...
... ... @@ -45,7 +45,7 @@ class _CustomerSettingPageState extends State<CustomerSettingPage> {
"sellerid": Provider.of<UserModel>(context, listen: false).user.sellerid,
'is_additional': swichState ? "1" : "0"
};
bool success = await customerProvider.setSellerGuest(context, params);
bool success = await customerProvider.setSellerGuest(context, params,showLoading: true);
if (success) {}
}
... ...
... ... @@ -71,8 +71,6 @@ class _DayOrderLeftPageState extends State<DayOrderLeftPage> {
isShowLoading: isShowLoading);
}
@override
Widget build(BuildContext context) {
customerProvider = Provider.of<CustomerProvider>(context, listen: true);
... ...
... ... @@ -84,6 +84,8 @@ class _DayOrderPageState extends State<DayOrderPage>
}
Widget _headWidget() {
// String day =
// widget.day.startsWith('0') ? widget.day.substring(1) : widget.day;
return Column(
children: [
Container(
... ... @@ -96,7 +98,11 @@ class _DayOrderPageState extends State<DayOrderPage>
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
widget.year + '-' + widget.month + '-' + widget.day,
widget.year +
'-' +
Utils.addZeroNumber(int.parse(widget.month)) +
'-' +
widget.day,
style: TextStyle(
color: MyColours.color_515151,
fontSize: font(16),
... ...
... ... @@ -540,7 +540,7 @@ class _MonthOrderPageState extends State<MonthOrderPage> {
NavigatorUtil.goDayOrderPage(
context,
widget.year.toString(),
widget.month.toString(),
month.toString(),
daylist.days.toString(),
daylist,
uid: widget.uid.toString(),
... ...
... ... @@ -840,47 +840,47 @@ class _StoreCustomerHomeLeftPageState extends State<StoreCustomerHomeLeftPage> {
child: Column(
children: [
VEmptyView(10),
Stack(
children: [
InkWell(
onTap: () {
NavigatorUtil.goCustomerListPage(
context, FromPage.FromPageHome, '');
},
child: Container(
height: w(80),
color: MyColours.color_ffffff,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'${widget.customerProvider.storeSunmodel.myCustomer}',
style: TextStyle(
color: MyColours.color_438E93,
fontSize: ScreenUtil().setSp(64),
fontWeight: FontWeight.bold),
),
Text(
'位',
style: TextStyle(
color: MyColours.color_515151,
// fontWeight: FontWeight.bold,
fontSize: ScreenUtil().setSp(32)),
)
],
// Stack(
// children: [
InkWell(
onTap: () {
NavigatorUtil.goCustomerListPage(
context, FromPage.FromPageHome, '');
},
child: Container(
height: w(80),
color: MyColours.color_ffffff,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'${widget.customerProvider.storeSunmodel.myCustomer}',
style: TextStyle(
color: MyColours.color_438E93,
fontSize: ScreenUtil().setSp(64),
fontWeight: FontWeight.bold),
),
)),
Positioned(
top: ScreenUtil().setWidth(30),
right: ScreenUtil().setWidth(40),
child: InkWell(
onTap: () {
NavigatorUtil.goCustomerSetPage(context);
},
child: Image.asset(Utils.getImgPath('c_set'),
width: ScreenUtil().setWidth(40))))
],
),
Text(
'位',
style: TextStyle(
color: MyColours.color_515151,
// fontWeight: FontWeight.bold,
fontSize: ScreenUtil().setSp(32)),
)
],
),
)),
// Positioned(
// top: ScreenUtil().setWidth(30),
// right: ScreenUtil().setWidth(40),
// child: InkWell(
// onTap: () {
// NavigatorUtil.goCustomerSetPage(context);
// },
// child: Image.asset(Utils.getImgPath('c_set'),
// width: ScreenUtil().setWidth(40))))
// ],
// ),
VEmptyView(10),
Row(
children: [
... ...
... ... @@ -9,6 +9,7 @@ import 'package:provider/provider.dart';
import '../../../../models/store_customer_home_model.dart';
import '../../../../provider/customer_provider.dart';
import '../../../../res/colors.dart';
import '../../../../route/navigator_util.dart';
import '../../../../utils/event_bus.dart';
import '../../../../utils/screen_util.dart';
import '../../../../widgets/v_empty_view.dart';
... ... @@ -61,10 +62,17 @@ class _StoreCustomerHomePageState extends State<StoreCustomerHomePage>
Widget build(BuildContext context) {
customerProvider = Provider.of<CustomerProvider>(context, listen: false);
return Scaffold(
appBar: SystemAppBar('全店客情', onTap: () {
EventBus().emit('changeStatusColor');
Navigator.pop(context);
}),
appBar: SystemAppBar(
'全店客情',
onTap: () {
EventBus().emit('changeStatusColor');
Navigator.pop(context);
},
rightImgName: 'c_set.png',
onTapRight: () {
NavigatorUtil.goCustomerSetPage(context);
},
),
body: WillPopScope(
onWillPop: () async {
EventBus().emit('changeStatusColor');
... ...
... ... @@ -21,6 +21,7 @@ import 'package:provider/provider.dart';
import '../../../../models/message_menu_model.dart';
import '../../../../models/seller_counts_list.dart';
import '../../../../models/store_customer_home_model.dart';
import '../../../../utils/screen_util.dart';
import '../../../../widgets/MyDivider.dart';
import '../month_item.dart';
... ... @@ -52,16 +53,7 @@ class _StoreCustomerHomeRightPageState
void initState() {
super.initState();
year = DateTime.now().year;
widget.customerProvider.storeSunmodel.sellerUser.forEach((element) {
MessageMenuModel messageMenuModel = MessageMenuModel();
messageMenuModel.uid = element.uid;
messageMenuModel.title = element.nickName ?? element.account;
messageMenuModel.select = false;
menuTitle.add(messageMenuModel);
});
if (menuTitle.length > 0) {
menuTitle[0].select = true;
}
// for (int i = 0; i < 15; i++) {
// MessageMenuModel messageMenuModel = MessageMenuModel();
// messageMenuModel.title = '${i}经理';
... ... @@ -69,10 +61,24 @@ class _StoreCustomerHomeRightPageState
// menuTitle.add(messageMenuModel);
// }
WidgetsBinding.instance.addPostFrameCallback((_) {
_couponNetworkData();
if (widget.customerProvider.storeSunmodel == null) {
_getSellerGuestManage();
} else {
widget.customerProvider.storeSunmodel.sellerUser.forEach((element) {
MessageMenuModel messageMenuModel = MessageMenuModel();
messageMenuModel.uid = element.uid;
messageMenuModel.title = element.nickName ?? element.account;
messageMenuModel.select = false;
menuTitle.add(messageMenuModel);
});
if (menuTitle.length > 0) {
menuTitle[0].select = true;
}
_couponNetworkData();
_getMarketingByUid();
_getSellerCountsList();
_getMarketingByUid();
_getSellerCountsList();
}
});
bus.on("refresh_my_customer_home", (arg) {
// _getGuestManageData(isShowLoading: false);
... ... @@ -88,6 +94,27 @@ class _StoreCustomerHomeRightPageState
super.dispose();
}
///全店客情首页
_getSellerGuestManage() async {
StoreCustomerHomeSunModel model =
await widget.customerProvider.getSellerGuestManage(context);
// setState(() {});
widget.customerProvider.storeSunmodel.sellerUser.forEach((element) {
MessageMenuModel messageMenuModel = MessageMenuModel();
messageMenuModel.uid = element.uid;
messageMenuModel.title = element.nickName ?? element.account;
messageMenuModel.select = false;
menuTitle.add(messageMenuModel);
});
if (menuTitle.length > 0) {
menuTitle[0].select = true;
}
_couponNetworkData();
_getMarketingByUid();
_getSellerCountsList();
}
_getSellerCountsList({isShowLoading = false, VoidCallback callback}) async {
String uid = '';
menuTitle.forEach((element) {
... ... @@ -336,579 +363,509 @@ class _StoreCustomerHomeRightPageState
// EventBus().emit('changeStatusColor');
// Navigator.pop(context);
// }),
body: WillPopScope(
onWillPop: () async {
EventBus().emit('changeStatusColor');
return true;
},
child: Column(
body: WillPopScope(onWillPop: () async {
EventBus().emit('changeStatusColor');
return true;
}, child: Consumer<CustomerProvider>(builder: (context, model, _) {
if (model.pageStateMyHome != PageState.Success) {
return ExceptionPage(
pageState: model.pageStateMyHome,
callback: () {
_getSellerCountsList();
},
emptyMsg: "暂时没有我的客情哦",
emptyImg: "empty_search",
showMsg: "加载中,请稍后...",
);
} else {
return Column(children: [
Container(
color: MyColours.color_ffffff,
height: ScreenUtil().setWidth(70),
padding: EdgeInsets.only(bottom: w(12)),
margin: EdgeInsets.only(bottom: ScreenUtil().setWidth(10)),
child: Row(
children: [
Container(
color: MyColours.color_ffffff,
height: ScreenUtil().setWidth(70),
padding: EdgeInsets.only(bottom: w(12)),
margin: EdgeInsets.only(bottom: ScreenUtil().setWidth(10)),
child: Row(
children: [
HEmptyView(48),
Expanded(
child: SizedBox(
// height: ScreenUtil().setWidth(30),
child: ListView.builder(
itemCount: menuTitle.length,
shrinkWrap: true,
controller: _controller,
scrollDirection: Axis.horizontal,
itemBuilder:
(BuildContext contxt, int index) {
return InkWell(
onTap: () {
for (MessageMenuModel item
in menuTitle) {
item.select = false;
}
menuTitle[index].select = true;
setState(() {});
_getSellerCountsList(
isShowLoading: true,
callback: () {});
// offset = 0;
// 1提前点餐/2内部预订/10在线预订/15店内消息传/12在线买单
// if (index == 0) {
// typeid = '';
// } else if (index == 1) {
// //店内消息
// typeid = '15';
// } else if (index == 2) {
// //在线预订
// typeid = '10';
// } else if (index == 3) {
// //提前点餐
// typeid = '1';
// } else if (index == 4) {
// //在线买单
// typeid = '12';
// } else if (index == 5) {
// //会员充值
// typeid = '17';
// } else if (index == 6) {
// //存酒超期
// typeid = '18';
// }
// getMessage(typeid, showLoading: true);
},
child: Container(
// width: ScreenUtil().setWidth(104 * 2),
margin: EdgeInsets.only(
right: ScreenUtil().setWidth(30),
),
padding: EdgeInsets.symmetric(
horizontal:
ScreenUtil().setWidth(10),
vertical: ScreenUtil().setWidth(4)),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(
ScreenUtil().setWidth(10)),
// color: menuTitle[index].select
// ? MyColours.color_438E93
// : MyColours.color_999999,
border: Border.all(
color: menuTitle[index].select
? MyColours.color_438E93
: MyColours.color_999999,
width:
ScreenUtil().setWidth(2))),
child: Text(
menuTitle[index].title,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: menuTitle[index].select
? MyColours.color_438E93
: MyColours.color_999999,
fontSize: ScreenUtil().setSp(24),
decoration: TextDecoration.none,
fontWeight: FontWeight.normal),
),
),
);
})))
],
),
),
Expanded(child:
Consumer<CustomerProvider>(builder: (context, model, _) {
if (model.pageStateMyHome != PageState.Success) {
return ExceptionPage(
pageState: model.pageStateMyHome,
callback: () {
_getGuestManageData();
},
emptyMsg: "暂时没有我的客情哦",
emptyImg: "empty_search",
showMsg: "加载中,请稍后...",
);
} else {
return Column(children: [
Expanded(
child: SingleChildScrollView(
controller: _controller,
child: Column(
children: [
// VEmptyView(10),
InkWell(
HEmptyView(48),
Expanded(
child: SizedBox(
// height: ScreenUtil().setWidth(30),
child: ListView.builder(
itemCount: menuTitle.length,
shrinkWrap: true,
controller: _controller,
scrollDirection: Axis.horizontal,
itemBuilder: (BuildContext contxt, int index) {
return InkWell(
onTap: () {
NavigatorUtil.goMyCustomerListPage(
context, FromPage.FromPageMyCustomer);
for (MessageMenuModel item in menuTitle) {
item.select = false;
}
menuTitle[index].select = true;
setState(() {});
_getSellerCountsList(
isShowLoading: true, callback: () {});
// offset = 0;
// 1提前点餐/2内部预订/10在线预订/15店内消息传/12在线买单
// if (index == 0) {
// typeid = '';
// } else if (index == 1) {
// //店内消息
// typeid = '15';
// } else if (index == 2) {
// //在线预订
// typeid = '10';
// } else if (index == 3) {
// //提前点餐
// typeid = '1';
// } else if (index == 4) {
// //在线买单
// typeid = '12';
// } else if (index == 5) {
// //会员充值
// typeid = '17';
// } else if (index == 6) {
// //存酒超期
// typeid = '18';
// }
// getMessage(typeid, showLoading: true);
},
child: Container(
height: w(80),
color: MyColours.color_ffffff,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
// Text(
// '累计',
// style: TextStyle(
// color: MyColours.color_515151,
// fontWeight: FontWeight.bold,
// fontSize: ScreenUtil().setSp(32)),
// ),
Text(
'${widget.customerProvider.guestSunmodel.myCustomer}',
style: TextStyle(
color: MyColours.color_199095,
fontSize: ScreenUtil().setSp(64),
fontWeight: FontWeight.bold),
),
Text(
'位',
style: TextStyle(
color: MyColours.color_515151,
fontWeight: FontWeight.bold,
fontSize: ScreenUtil().setSp(32)),
)
],
// width: ScreenUtil().setWidth(104 * 2),
margin: EdgeInsets.only(
right: ScreenUtil().setWidth(30),
),
)),
VEmptyView(10),
// GridView.builder(
// controller: _controller,
// shrinkWrap: true,
// cacheExtent: ScreenUtil().setWidth(0),
// itemCount: 3,
// gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
// crossAxisCount: 3,
// childAspectRatio: 1,
// mainAxisSpacing: ScreenUtil().setWidth(10),
// crossAxisSpacing: ScreenUtil().setWidth(10)),
// itemBuilder: (BuildContext context, int index) {
// // locationState = state;
// return _percentWidget(
// '${widget.customerProvider.guestSunmodel.active.count}',
// '活跃客户',
// '${widget.customerProvider.guestSunmodel.active.scale}');
// }),
Row(
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(10),
vertical: ScreenUtil().setWidth(4)),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(
ScreenUtil().setWidth(10)),
// color: menuTitle[index].select
// ? MyColours.color_438E93
// : MyColours.color_999999,
border: Border.all(
color: menuTitle[index].select
? MyColours.color_438E93
: MyColours.color_999999,
width: ScreenUtil().setWidth(2))),
child: Text(
menuTitle[index].title,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: menuTitle[index].select
? MyColours.color_438E93
: MyColours.color_999999,
fontSize: ScreenUtil().setSp(24),
decoration: TextDecoration.none,
fontWeight: FontWeight.normal),
),
),
);
})))
],
),
),
Expanded(
child: SingleChildScrollView(
controller: _controller,
child: Column(
children: [
// VEmptyView(10),
InkWell(
onTap: () {
NavigatorUtil.goMyCustomerListPage(
context, FromPage.FromPageMyCustomer);
},
child: Container(
height: w(80),
color: MyColours.color_ffffff,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
// Text(
// '累计',
// style: TextStyle(
// color: MyColours.color_515151,
// fontWeight: FontWeight.bold,
// fontSize: ScreenUtil().setSp(32)),
// ),
Text(
'${widget.customerProvider.guestSunmodel.myCustomer}',
style: TextStyle(
color: MyColours.color_199095,
fontSize: ScreenUtil().setSp(64),
fontWeight: FontWeight.bold),
),
Text(
'位',
style: TextStyle(
color: MyColours.color_515151,
fontWeight: FontWeight.bold,
fontSize: ScreenUtil().setSp(32)),
)
],
),
)),
VEmptyView(10),
// GridView.builder(
// controller: _controller,
// shrinkWrap: true,
// cacheExtent: ScreenUtil().setWidth(0),
// itemCount: 3,
// gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
// crossAxisCount: 3,
// childAspectRatio: 1,
// mainAxisSpacing: ScreenUtil().setWidth(10),
// crossAxisSpacing: ScreenUtil().setWidth(10)),
// itemBuilder: (BuildContext context, int index) {
// // locationState = state;
// return _percentWidget(
// '${widget.customerProvider.guestSunmodel.active.count}',
// '活跃客户',
// '${widget.customerProvider.guestSunmodel.active.scale}');
// }),
Row(
children: [
_percentWidget(
'${widget.customerProvider.guestSunmodel.active.count}',
'活跃',
'${widget.customerProvider.guestSunmodel.active.scale}'),
HEmptyView(10),
_percentWidget(
'${widget.customerProvider.guestSunmodel.sleep.count}',
'60天未到店',
'${widget.customerProvider.guestSunmodel.sleep.scale}'),
HEmptyView(10),
_percentWidget(
'${widget.customerProvider.guestSunmodel.drain.count}',
'120天未到店',
'${widget.customerProvider.guestSunmodel.drain.scale}'),
],
),
ListView.builder(
controller: _controller,
shrinkWrap: true,
cacheExtent: ScreenUtil().setWidth(0),
itemCount:
widget.customerProvider.guestSunmodel.tips.task ==
null ||
widget.customerProvider.guestSunmodel.tips.task
.length ==
0
? 0
: widget.customerProvider.guestSunmodel.tips.task
.length,
itemBuilder: (BuildContext context, int index) {
// locationState = state;
Task data = widget
.customerProvider.guestSunmodel.tips.task[index];
return Column(
children: [
VEmptyView(10),
Container(
color: MyColours.color_ffffff,
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(20),
vertical: ScreenUtil().setWidth(30)),
child: Row(
children: [
_percentWidget(
'${widget.customerProvider.guestSunmodel.active.count}',
'活跃',
'${widget.customerProvider.guestSunmodel.active.scale}'),
HEmptyView(10),
_percentWidget(
'${widget.customerProvider.guestSunmodel.sleep.count}',
'60天未到店',
'${widget.customerProvider.guestSunmodel.sleep.scale}'),
HEmptyView(10),
_percentWidget(
'${widget.customerProvider.guestSunmodel.drain.count}',
'120天未到店',
'${widget.customerProvider.guestSunmodel.drain.scale}'),
],
),
ListView.builder(
controller: _controller,
shrinkWrap: true,
cacheExtent: ScreenUtil().setWidth(0),
itemCount: widget.customerProvider.guestSunmodel
.tips.task ==
null ||
widget.customerProvider.guestSunmodel
.tips.task.length ==
0
? 0
: widget.customerProvider.guestSunmodel.tips
.task.length,
itemBuilder: (BuildContext context, int index) {
// locationState = state;
Task data = widget.customerProvider
.guestSunmodel.tips.task[index];
return Column(
children: [
VEmptyView(10),
Container(
color: MyColours.color_ffffff,
padding: EdgeInsets.symmetric(
horizontal:
ScreenUtil().setWidth(20),
vertical:
ScreenUtil().setWidth(30)),
child: Row(
children: [
Image.asset(
Utils.getImgPath('warning'),
width: ScreenUtil().setWidth(42),
),
HEmptyView(15),
Expanded(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
'店内任务:${data.content}',
maxLines: 1,
overflow:
TextOverflow.ellipsis,
style: TextStyle(
color: MyColours
.color_333333,
fontSize: ScreenUtil()
.setSp(32)),
),
data.aid != null &&
data.aidStr != null
? Padding(
padding: EdgeInsets.only(
top: ScreenUtil()
.setWidth(8)),
child: Text(
'优惠内容:${data.aidStr}',
maxLines: 1,
overflow: TextOverflow
.ellipsis,
style: TextStyle(
color: MyColours
.color_333333,
fontSize:
ScreenUtil()
.setSp(
24)),
),
)
: SizedBox(),
VEmptyView(8),
Text(
'创建人:${data.createUser}',
maxLines: 1,
overflow:
TextOverflow.ellipsis,
style: TextStyle(
color: MyColours
.color_333333,
fontSize: ScreenUtil()
.setSp(26)),
)
],
)),
HEmptyView(20),
Column(children: [
RoundButton(
text: '立即完成',
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil()
.setWidth(26)),
gradientStart:
MyColours.color_199095,
gradientEnd:
MyColours.color_199095,
// borderColor: MyColours.color_999999,
radius:
ScreenUtil().setWidth(40),
height:
ScreenUtil().setWidth(64),
width:
ScreenUtil().setWidth(180),
fontSize: 26,
isBold: false,
onPressed: () {
SellerList sellerList =
SellerList.fromJson(
json.decode(json
.encode(data)));
NavigatorUtil
.goMyMakeMarkingPageOnlyShow(
context, sellerList);
},
),
data.remainingTime != null
? Padding(
padding: EdgeInsets.only(
top: ScreenUtil()
.setWidth(6)),
child: Text(
'${data.remainingTime}天内',
maxLines: 1,
overflow: TextOverflow
.ellipsis,
style: TextStyle(
color:
Color.fromRGBO(
215,
30,
40,
1),
fontSize:
ScreenUtil()
.setSp(26)),
))
: SizedBox()
])
],
),
),
],
);
}),
ListView.builder(
controller: _controller,
shrinkWrap: true,
cacheExtent: ScreenUtil().setWidth(0),
itemCount: widget.customerProvider.guestSunmodel
.tips.recover ==
null ||
widget.customerProvider.guestSunmodel
.tips.recover.length ==
0
? 0
: 1,
itemBuilder: (BuildContext context, int index) {
// locationState = state;
return Column(
children: [
VEmptyView(10),
Container(
color: MyColours.color_ffffff,
padding: EdgeInsets.symmetric(
horizontal:
ScreenUtil().setWidth(20),
vertical:
ScreenUtil().setWidth(30)),
child: Row(
children: [
Image.asset(
Utils.getImgPath('warning'),
width: ScreenUtil().setWidth(42),
),
HEmptyView(15),
Expanded(
child: Text(
'${widget.customerProvider.guestSunmodel.tips.recover[0]}',
maxLines: 10,
Image.asset(
Utils.getImgPath('warning'),
width: ScreenUtil().setWidth(42),
),
HEmptyView(15),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'店内任务:${data.content}',
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: MyColours.color_333333,
fontSize: ScreenUtil().setSp(32)),
),
data.aid != null && data.aidStr != null
? Padding(
padding: EdgeInsets.only(
top: ScreenUtil().setWidth(8)),
child: Text(
'优惠内容:${data.aidStr}',
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: MyColours.color_333333,
fontSize:
ScreenUtil().setSp(32)),
)),
HEmptyView(20),
RoundButton(
text: '一键追回',
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil()
.setWidth(26)),
gradientStart:
MyColours.color_199095,
gradientEnd:
MyColours.color_199095,
// borderColor: MyColours.color_999999,
radius: ScreenUtil().setWidth(40),
height: ScreenUtil().setWidth(64),
width: ScreenUtil().setWidth(180),
fontSize: 26,
isBold: false,
onPressed: () {
NavigatorUtil.goMyMakeMarkingPage(
context,
fromPage: FromPage
.FromPageMyCustomer,
homeGid: Utils
.listToStringEnglish1(
widget
.customerProvider
.guestSunmodel
.tips
.recover[1]));
},
ScreenUtil().setSp(24)),
),
],
),
),
],
);
}),
ListView.builder(
controller: _controller,
shrinkWrap: true,
cacheExtent: ScreenUtil().setWidth(0),
itemCount: widget.customerProvider.guestSunmodel
.tips.awaken ==
null ||
widget.customerProvider.guestSunmodel
.tips.awaken.length ==
0
? 0
: 1,
itemBuilder: (BuildContext context, int index) {
// locationState = state;
)
: SizedBox(),
VEmptyView(8),
Text(
'创建人:${data.createUser}',
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: MyColours.color_333333,
fontSize: ScreenUtil().setSp(26)),
)
],
)),
HEmptyView(20),
Column(children: [
RoundButton(
text: '立即完成',
return Column(
children: [
VEmptyView(10),
Container(
color: MyColours.color_ffffff,
padding: EdgeInsets.symmetric(
horizontal:
ScreenUtil().setWidth(20),
vertical:
ScreenUtil().setWidth(30)),
child: Row(
children: [
Image.asset(
Utils.getImgPath('warning'),
width: ScreenUtil().setWidth(42),
),
HEmptyView(15),
Expanded(
child: Text(
'${widget.customerProvider.guestSunmodel.tips.awaken[0]}',
maxLines: 10,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: MyColours.color_333333,
fontSize:
ScreenUtil().setSp(32)),
)),
HEmptyView(20),
RoundButton(
text: '一键唤醒',
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil()
.setWidth(26)),
gradientStart:
MyColours.color_199095,
gradientEnd:
MyColours.color_199095,
// borderColor: MyColours.color_999999,
radius: ScreenUtil().setWidth(40),
height: ScreenUtil().setWidth(64),
width: ScreenUtil().setWidth(180),
fontSize: 26,
isBold: false,
onPressed: () {
NavigatorUtil.goMyMakeMarkingPage(
context,
fromPage: FromPage
.FromPageMyCustomer,
homeGid: Utils
.listToStringEnglish1(
widget
.customerProvider
.guestSunmodel
.tips
.awaken[1]));
},
),
],
),
),
],
);
}),
_chart(),
ListView.builder(
itemCount: widget.customerProvider
.managerStatisticsList.length,
shrinkWrap: true,
controller: _controller,
padding:
EdgeInsets.symmetric(horizontal: w(10)),
itemBuilder: (context, index) {
SellerCountsListSunModel countsListSunModel =
widget.customerProvider
.managerStatisticsList[index];
return InkWell(
onTap: () {
String uid = '';
menuTitle.forEach((element) {
if (element.select) {
uid = element.uid;
}
});
NavigatorUtil.goMonthOrderPage(
context,
year.toString(),
countsListSunModel.monthss
.toString(),
uid: uid);
},
child: MonthItem(
countsListSunModel:
countsListSunModel));
})
],
),
)),
Container(
color: MyColours.color_FAFAFA,
padding: EdgeInsets.only(
top: w(13),
bottom: w(26),
left: w(45),
right: (45)),
child: Stack(
children: [
RoundButton(
onPressed: () {
NavigatorUtil.goMyMarketingRecordsPage(
context, FromPage.FromPageMyCustomer);
},
text: '历史营销记录',
fontSize: 32,
isBold: true,
// margin: EdgeInsets.only(
// top: w(13),
// bottom: w(26),
// left: w(45),
// right: (45)),
textColor: MyColours.color_F8F9FD,
gradientStart: MyColours.color_199095,
gradientEnd: MyColours.color_199095,
borderColor: MyColours.color_199095,
height: ScreenUtil().setWidth(86),
// width: ScreenUtil().setWidth(260),
radius: ScreenUtil().setWidth(10),
),
showWarning
? Positioned(
right: ScreenUtil().setWidth(30),
top: ScreenUtil().setWidth(45 / 2),
child: Image.asset(
Utils.getImgPath('warning'),
width: ScreenUtil().setWidth(35),
))
: SizedBox()
],
))
]);
}
}))
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(26)),
gradientStart: MyColours.color_199095,
gradientEnd: MyColours.color_199095,
// borderColor: MyColours.color_999999,
radius: ScreenUtil().setWidth(40),
height: ScreenUtil().setWidth(64),
width: ScreenUtil().setWidth(180),
fontSize: 26,
isBold: false,
onPressed: () {
SellerList sellerList =
SellerList.fromJson(
json.decode(json.encode(data)));
NavigatorUtil.goMyMakeMarkingPageOnlyShow(
context, sellerList);
},
),
data.remainingTime != null
? Padding(
padding: EdgeInsets.only(
top: ScreenUtil().setWidth(6)),
child: Text(
'${data.remainingTime}天内',
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: Color.fromRGBO(
215, 30, 40, 1),
fontSize:
ScreenUtil().setSp(26)),
))
: SizedBox()
])
],
),
),
],
);
}),
ListView.builder(
controller: _controller,
shrinkWrap: true,
cacheExtent: ScreenUtil().setWidth(0),
itemCount:
widget.customerProvider.guestSunmodel.tips.recover ==
null ||
widget.customerProvider.guestSunmodel.tips
.recover.length ==
0
? 0
: 1,
itemBuilder: (BuildContext context, int index) {
// locationState = state;
return Column(
children: [
VEmptyView(10),
Container(
color: MyColours.color_ffffff,
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(20),
vertical: ScreenUtil().setWidth(30)),
child: Row(
children: [
Image.asset(
Utils.getImgPath('warning'),
width: ScreenUtil().setWidth(42),
),
HEmptyView(15),
Expanded(
child: Text(
'${widget.customerProvider.guestSunmodel.tips.recover[0]}',
maxLines: 10,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: MyColours.color_333333,
fontSize: ScreenUtil().setSp(32)),
)),
HEmptyView(20),
RoundButton(
text: '一键追回',
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(26)),
gradientStart: MyColours.color_199095,
gradientEnd: MyColours.color_199095,
// borderColor: MyColours.color_999999,
radius: ScreenUtil().setWidth(40),
height: ScreenUtil().setWidth(64),
width: ScreenUtil().setWidth(180),
fontSize: 26,
isBold: false,
onPressed: () {
NavigatorUtil.goMyMakeMarkingPage(context,
fromPage: FromPage.FromPageMyCustomer,
homeGid: Utils.listToStringEnglish1(
widget
.customerProvider
.guestSunmodel
.tips
.recover[1]));
},
),
],
),
),
],
);
}),
ListView.builder(
controller: _controller,
shrinkWrap: true,
cacheExtent: ScreenUtil().setWidth(0),
itemCount:
widget.customerProvider.guestSunmodel.tips.awaken ==
null ||
widget.customerProvider.guestSunmodel.tips
.awaken.length ==
0
? 0
: 1,
itemBuilder: (BuildContext context, int index) {
// locationState = state;
return Column(
children: [
VEmptyView(10),
Container(
color: MyColours.color_ffffff,
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(20),
vertical: ScreenUtil().setWidth(30)),
child: Row(
children: [
Image.asset(
Utils.getImgPath('warning'),
width: ScreenUtil().setWidth(42),
),
HEmptyView(15),
Expanded(
child: Text(
'${widget.customerProvider.guestSunmodel.tips.awaken[0]}',
maxLines: 10,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: MyColours.color_333333,
fontSize: ScreenUtil().setSp(32)),
)),
HEmptyView(20),
RoundButton(
text: '一键唤醒',
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(26)),
gradientStart: MyColours.color_199095,
gradientEnd: MyColours.color_199095,
// borderColor: MyColours.color_999999,
radius: ScreenUtil().setWidth(40),
height: ScreenUtil().setWidth(64),
width: ScreenUtil().setWidth(180),
fontSize: 26,
isBold: false,
onPressed: () {
NavigatorUtil.goMyMakeMarkingPage(context,
fromPage: FromPage.FromPageMyCustomer,
homeGid: Utils.listToStringEnglish1(
widget.customerProvider
.guestSunmodel.tips.awaken[1]));
},
),
],
),
),
],
);
}),
_chart(),
ListView.builder(
itemCount:
widget.customerProvider.managerStatisticsList.length,
shrinkWrap: true,
controller: _controller,
padding: EdgeInsets.symmetric(horizontal: w(10)),
itemBuilder: (context, index) {
SellerCountsListSunModel countsListSunModel =
widget.customerProvider.managerStatisticsList[index];
return InkWell(
onTap: () {
String uid = '';
menuTitle.forEach((element) {
if (element.select) {
uid = element.uid;
}
});
NavigatorUtil.goMonthOrderPage(
context,
year.toString(),
countsListSunModel.monthss.toString(),
uid: uid);
},
child: MonthItem(
countsListSunModel: countsListSunModel));
})
],
)));
),
)),
// Container(
// color: MyColours.color_FAFAFA,
// padding: EdgeInsets.only(
// top: w(13), bottom: w(26), left: w(45), right: (45)),
// child: Stack(
// children: [
// RoundButton(
// onPressed: () {
// NavigatorUtil.goMyMarketingRecordsPage(
// context, FromPage.FromPageMyCustomer);
// },
// text: '历史营销记录',
// fontSize: 32,
// isBold: true,
// // margin: EdgeInsets.only(
// // top: w(13),
// // bottom: w(26),
// // left: w(45),
// // right: (45)),
// textColor: MyColours.color_F8F9FD,
// gradientStart: MyColours.color_199095,
// gradientEnd: MyColours.color_199095,
// borderColor: MyColours.color_199095,
// height: ScreenUtil().setWidth(86),
// // width: ScreenUtil().setWidth(260),
// radius: ScreenUtil().setWidth(10),
// ),
// showWarning
// ? Positioned(
// right: ScreenUtil().setWidth(30),
// top: ScreenUtil().setWidth(45 / 2),
// child: Image.asset(
// Utils.getImgPath('warning'),
// width: ScreenUtil().setWidth(35),
// ))
// : SizedBox()
// ],
// ))
]);
}
})));
}
}
... ...
... ... @@ -101,7 +101,7 @@ class TableManagerPageState extends State<TableManagerPage> {
String smsErro = '';
String showErro = '';
// ScrollController _scrollCrl = ScrollController();
ScrollController _scrollCrl = ScrollController();
final ItemPositionsListener itemPositionsListener =
ItemPositionsListener.create();
... ... @@ -813,6 +813,9 @@ class TableManagerPageState extends State<TableManagerPage> {
});
return;
}
setState(() {
showPhoneHistory = true;
});
Map<String, String> params = {
"keywords": value,
"sid": Provider.of<UserModel>(context, listen: false)
... ... @@ -1190,7 +1193,7 @@ class TableManagerPageState extends State<TableManagerPage> {
blurRadius: ScreenUtil().setWidth(20))
]),
// width: double.infinity,
width: ScreenUtil().screenWidth-w(60),
width: ScreenUtil().screenWidth - w(60),
// width: ScreenUtil().setWidth(350),
constraints: BoxConstraints(maxHeight: w(170)),
// height: _baseIndoProvider.userHistorys.length > 1
... ... @@ -1203,98 +1206,110 @@ class TableManagerPageState extends State<TableManagerPage> {
child: MediaQuery.removePadding(
context: context,
removeTop: true,
child: ListView.builder(
shrinkWrap: true,
itemBuilder: (context, index) {
return GestureDetector(
onTap: () {
setState(() {
showPhoneHistory = false;
_baseIndoProvider.phoneController
.text = _baseIndoProvider
.userHistorys[index]
.phone !=
null
? _baseIndoProvider
.userHistorys[index].phone
: '';
// _homeEnterModel.nameController.text =
// _homeEnterModel
// .userHistorys[index].rname +
// _nameSuffix();
_addNameSuffix(
_baseIndoProvider
.userHistorys[index].rname,
sexStr);
nameStr = _baseIndoProvider
.userHistorys[index].rname;
_phoneNode.unfocus();
_baseIndoProvider.userHistorys
.clear();
});
},
child: Container(
width: double.infinity,
height: ScreenUtil().setWidth(102),
decoration: BoxDecoration(
border: Border(
bottom: (index !=
(_baseIndoProvider
.userHistorys
.length -
1) &&
_baseIndoProvider
.userHistorys
.length >
1)
? BorderSide(
color: MyColours
.color_e5e5e5,
width: ScreenUtil()
.setWidth(2))
: BorderSide.none)),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Text(
_baseIndoProvider
.userHistorys[index]
.phone ==
null
? ''
: _baseIndoProvider
.userHistorys[index]
.phone,
style: TextStyle(
color: MyColours.color_333333,
fontSize:
ScreenUtil().setSp(32)),
),
Expanded(
child: Text(
_baseIndoProvider
child: Scrollbar(
isAlwaysShown: true, //设置滚动条常亮
controller: _scrollCrl, //必须设置一个controller
///添加进度条
child: ListView.builder(
shrinkWrap: true,
controller: _scrollCrl,
itemBuilder: (context, index) {
return GestureDetector(
onTap: () {
setState(() {
showPhoneHistory = false;
_baseIndoProvider.phoneController
.text = _baseIndoProvider
.userHistorys[index]
.rname ==
.phone !=
null
? ''
: _baseIndoProvider
? _baseIndoProvider
.userHistorys[index].phone
: '';
// _homeEnterModel.nameController.text =
// _homeEnterModel
// .userHistorys[index].rname +
// _nameSuffix();
_addNameSuffix(
_baseIndoProvider
.userHistorys[index]
.rname,
style: TextStyle(
color: MyColours.color_333333,
fontSize:
ScreenUtil().setSp(32)),
))
],
),
),
);
},
itemExtent: ScreenUtil().setWidth(104),
itemCount:
_baseIndoProvider.userHistorys.length,
))),
sexStr);
nameStr = _baseIndoProvider
.userHistorys[index].rname;
_phoneNode.unfocus();
_baseIndoProvider.userHistorys
.clear();
});
},
child: Container(
width: double.infinity,
height: ScreenUtil().setWidth(102),
decoration: BoxDecoration(
border: Border(
bottom: (index !=
(_baseIndoProvider
.userHistorys
.length -
1) &&
_baseIndoProvider
.userHistorys
.length >
1)
? BorderSide(
color: MyColours
.color_e5e5e5,
width: ScreenUtil()
.setWidth(2))
: BorderSide.none)),
child: Row(
mainAxisAlignment:
MainAxisAlignment
.spaceBetween,
children: [
Text(
_baseIndoProvider
.userHistorys[
index]
.phone ==
null
? ''
: _baseIndoProvider
.userHistorys[index]
.phone,
style: TextStyle(
color: MyColours
.color_333333,
fontSize: ScreenUtil()
.setSp(32)),
),
Expanded(
child: Text(
_baseIndoProvider
.userHistorys[
index]
.rname ==
null
? ''
: _baseIndoProvider
.userHistorys[index]
.rname,
style: TextStyle(
color: MyColours
.color_333333,
fontSize: ScreenUtil()
.setSp(32)),
))
],
),
),
);
},
itemExtent: ScreenUtil().setWidth(104),
itemCount:
_baseIndoProvider.userHistorys.length,
)))),
),
)),
],
... ... @@ -2010,6 +2025,7 @@ class TableManagerPageState extends State<TableManagerPage> {
tableManagerModel.selectTables = [];
wechatNotification = true;
showPhoneHistory = false; //显示客户历史记录
_baseIndoProvider.userHistorys.clear();
currentRemark = '';
... ... @@ -2037,199 +2053,211 @@ class TableManagerPageState extends State<TableManagerPage> {
///选中的桌子widget
Widget _selectTableWidgetSms() {
return Container(
// constraints: BoxConstraints(maxHeight: ScreenUtil().setWidth(760)),
// height: ScreenUtil().setWidth(400),
width: double.infinity,
decoration: BoxDecoration(
color: MyColours.color_ffffff,
boxShadow: [
BoxShadow(
color: MyColours.color_333333,
blurRadius: ScreenUtil().setWidth(14))
],
borderRadius: BorderRadius.only(
topLeft: Radius.circular(ScreenUtil().setWidth(24)),
topRight: Radius.circular(ScreenUtil().setWidth(24)),
)),
child: SingleChildScrollView(
child: Column(
// mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Stack(alignment: Alignment.centerRight, children: [
Container(
width: double.infinity,
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(40),
vertical: ScreenUtil().setSp(16),
),
decoration: BoxDecoration(
color: MyColours.color_f3f3f3,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(ScreenUtil().setWidth(24)),
topRight: Radius.circular(ScreenUtil().setWidth(24)),
)),
child: Column(
children: [
Text(
tableManagerModel.selectDateStr +
' ' +
tableManagerModel.doltStr,
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(28),
fontWeight: FontWeight.bold),
return InkWell(
onTap: () {
if (showPhoneHistory) {
setState(() {
showPhoneHistory = false;
});
}
},
child: Container(
// constraints: BoxConstraints(maxHeight: ScreenUtil().setWidth(760)),
// height: ScreenUtil().setWidth(400),
width: double.infinity,
decoration: BoxDecoration(
color: MyColours.color_ffffff,
boxShadow: [
BoxShadow(
color: MyColours.color_333333,
blurRadius: ScreenUtil().setWidth(14))
],
borderRadius: BorderRadius.only(
topLeft: Radius.circular(ScreenUtil().setWidth(24)),
topRight: Radius.circular(ScreenUtil().setWidth(24)),
)),
child: SingleChildScrollView(
child: Column(
// mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Stack(alignment: Alignment.centerRight, children: [
Container(
width: double.infinity,
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(40),
vertical: ScreenUtil().setSp(16),
),
VEmptyView(8),
Text(
tableManagerModel.selectWeekAndLunarCalendar,
style: TextStyle(
color: MyColours.color_999999,
fontSize: ScreenUtil().setSp(20)),
)
],
),
),
Positioned(
right: ScreenUtil().setWidth(40),
child: InkWell(
onTap: () {
_clearData();
},
child: Text(
'清空',
style: TextStyle(
decoration: TextDecoration.underline,
color: MyColours.color_438E93,
fontSize: ScreenUtil().setSp(20)),
)))
]),
Container(
margin: EdgeInsets.only(top: ScreenUtil().setWidth(44)),
height: ScreenUtil().setWidth(60),
child: ListView.builder(
padding: EdgeInsets.only(left: ScreenUtil().setWidth(48)),
itemCount: tableManagerModel.selectTables.length,
shrinkWrap: true,
scrollDirection: Axis.horizontal,
itemBuilder: (BuildContext contxt, int index) {
t.Table table = tableManagerModel.selectTables[index];
return Container(
margin:
EdgeInsets.only(right: ScreenUtil().setWidth(20)),
padding: EdgeInsets.only(
left: ScreenUtil().setWidth(16),
// right: ScreenUtil().setWidth(4),
// top: ScreenUtil().setWidth(14),
// bottom: ScreenUtil().setWidth(14)
),
decoration: BoxDecoration(
border: Border.all(
width: ScreenUtil().setWidth(2),
color: MyColours.color_438E93),
borderRadius: BorderRadius.circular(
ScreenUtil().setWidth(8))),
child: Row(
children: [
Text(
table.name,
decoration: BoxDecoration(
color: MyColours.color_f3f3f3,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(ScreenUtil().setWidth(24)),
topRight:
Radius.circular(ScreenUtil().setWidth(24)),
)),
child: Column(
children: [
Text(
tableManagerModel.selectDateStr +
' ' +
tableManagerModel.doltStr,
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(28),
fontWeight: FontWeight.bold),
),
VEmptyView(8),
Text(
tableManagerModel.selectWeekAndLunarCalendar,
style: TextStyle(
color: MyColours.color_999999,
fontSize: ScreenUtil().setSp(20)),
)
],
),
),
Positioned(
right: ScreenUtil().setWidth(40),
child: InkWell(
onTap: () {
_clearData();
},
child: Text(
'清空',
style: TextStyle(
decoration: TextDecoration.underline,
color: MyColours.color_438E93,
fontSize: ScreenUtil().setSp(28)),
fontSize: ScreenUtil().setSp(20)),
)))
]),
Container(
margin: EdgeInsets.only(top: ScreenUtil().setWidth(44)),
height: ScreenUtil().setWidth(60),
child: ListView.builder(
padding:
EdgeInsets.only(left: ScreenUtil().setWidth(48)),
itemCount: tableManagerModel.selectTables.length,
shrinkWrap: true,
scrollDirection: Axis.horizontal,
itemBuilder: (BuildContext contxt, int index) {
t.Table table = tableManagerModel.selectTables[index];
return Container(
margin: EdgeInsets.only(
right: ScreenUtil().setWidth(20)),
padding: EdgeInsets.only(
left: ScreenUtil().setWidth(16),
// right: ScreenUtil().setWidth(4),
// top: ScreenUtil().setWidth(14),
// bottom: ScreenUtil().setWidth(14)
),
HEmptyView(14),
InkWell(
onTap: () {
//删除已经选择的桌位
tableManagerModel.selectTables
.removeWhere((t) => t.id == table.id);
if (tableManagerModel.selectTables.length ==
0) {
// wechatNotification = true;
_clearData();
}
decoration: BoxDecoration(
border: Border.all(
width: ScreenUtil().setWidth(2),
color: MyColours.color_438E93),
borderRadius: BorderRadius.circular(
ScreenUtil().setWidth(8))),
child: Row(
children: [
Text(
table.name,
style: TextStyle(
color: MyColours.color_438E93,
fontSize: ScreenUtil().setSp(28)),
),
HEmptyView(14),
InkWell(
onTap: () {
//删除已经选择的桌位
tableManagerModel.selectTables
.removeWhere((t) => t.id == table.id);
if (tableManagerModel
.selectTables.length ==
0) {
// wechatNotification = true;
_clearData();
}
for (t.Table item
in tableManagerModel.tablesShow) {
if (item.id == table.id) {
item.selected = false;
setState(() {});
}
}
for (t.Table item in tableManagerModel
.areaTableMapShow[
tableManagerModel
.areas[tableManagerModel.selectNumber]
.name]) {
if (item.id == table.id) {
item.selected = false;
setState(() {});
}
}
},
child: Container(
// color: Colors.red,
padding: EdgeInsets.only(
top: ScreenUtil().setWidth(14),
bottom: ScreenUtil().setWidth(14),
left: ScreenUtil().setWidth(14),
right: ScreenUtil().setWidth(4)),
child: Image.asset(
Utils.getImgPath('table_m_close'),
width: ScreenUtil().setWidth(32)))),
],
),
);
}),
),
// Column(children: [
_customerInfoWidget(),
for (t.Table item
in tableManagerModel.tablesShow) {
if (item.id == table.id) {
item.selected = false;
setState(() {});
}
}
for (t.Table item
in tableManagerModel.areaTableMapShow[
tableManagerModel
.areas[tableManagerModel
.selectNumber]
.name]) {
if (item.id == table.id) {
item.selected = false;
setState(() {});
}
}
},
child: Container(
// color: Colors.red,
padding: EdgeInsets.only(
top: ScreenUtil().setWidth(14),
bottom: ScreenUtil().setWidth(14),
left: ScreenUtil().setWidth(14),
right: ScreenUtil().setWidth(4)),
child: Image.asset(
Utils.getImgPath('table_m_close'),
width: ScreenUtil().setWidth(32)))),
],
),
);
}),
),
// Column(children: [
_customerInfoWidget(),
// _couponWidget(),
// ]),
// _couponWidget(),
// ]),
VEmptyView(20),
Padding(
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(36)),
child: Row(
children: [
Expanded(
child: RoundButton(
text: '短信通知',
height: ScreenUtil().setWidth(96),
fontSize: 32,
gradientStart: MyColours.color_438E93,
gradientEnd: MyColours.color_438E93,
radius: ScreenUtil().setWidth(8),
isBold: false,
onPressed: () async {
if (myModel.smsInfo == '0') {
setState(() {
showErro = smsErro;
});
return;
}
if ((_baseIndoProvider.phoneController.text
.replaceAll(' ', '')
.isEmpty ||
!Utils.phoneRegExp(_baseIndoProvider
.phoneController.text
.replaceAll(' ', '')))) {
setState(() {
showErro = '请输入正确的11位手机号码';
});
return;
} else {
setState(() {
showErro = '';
});
}
VEmptyView(20),
Padding(
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(36)),
child: Row(
children: [
Expanded(
child: RoundButton(
text: '短信通知',
height: ScreenUtil().setWidth(96),
fontSize: 32,
gradientStart: MyColours.color_438E93,
gradientEnd: MyColours.color_438E93,
radius: ScreenUtil().setWidth(8),
isBold: false,
onPressed: () async {
if (myModel.smsInfo == '0') {
setState(() {
showErro = smsErro;
});
return;
}
if ((_baseIndoProvider.phoneController.text
.replaceAll(' ', '')
.isEmpty ||
!Utils.phoneRegExp(_baseIndoProvider
.phoneController.text
.replaceAll(' ', '')))) {
setState(() {
showErro = '请输入正确的11位手机号码';
});
return;
} else {
setState(() {
showErro = '';
});
}
// if (!couponProvider.sendSMS) {
/*
// if (!couponProvider.sendSMS) {
/*
String dateSoltStr = '';
if (widget.dateSolt == '1') {
dateSoltStr = '早餐';
... ... @@ -2271,572 +2299,576 @@ class TableManagerPageState extends State<TableManagerPage> {
params['Strtext'] = user.sellername;
}
*/
Guest guest = Guest(
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null);
if (widget.guest == null) {
guest.phone = _baseIndoProvider.phoneController.text
.replaceAll(' ', ''); //预订人电话
if (nameStr != null && nameStr.trim().length > 0) {
String sex = '1';
if (sexStr == '女士') {
sex = '2';
} else if (sexStr == '公司') {
sex = '3';
}
guest.rname = nameStr; //预订人姓名
guest.sex = sex; //预订人性别:1:男 2:女
}
}
String pnum;
if (pnumController.text != '') {
pnum = pnumController.text;
}
String cusdem;
if (customController.text.trim().length > 0) {
cusdem = customController.text;
}
SunReserveInfoModel _model =
await tableManagerModel.setReserveInfo(context,
needKeep: true,
pnum: pnum,
cusdem: cusdem,
tempTime: ddateHm == '选填' ? null : ddateHm,
guest: widget.guest == null
? guest
: widget.guest);
if (_model != null &&
ObjectUtil.isNotEmpty(_model.row) &&
ObjectUtil.isNotEmpty(_model.row.id)) {
print('成功');
// tableManagerModel.selectTables = [];
// wechatNotification = true;
_clearData();
Guest guest = Guest(
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null);
if (widget.guest == null) {
guest.phone = _baseIndoProvider
.phoneController.text
.replaceAll(' ', ''); //预订人电话
if (nameStr != null &&
nameStr.trim().length > 0) {
String sex = '1';
if (sexStr == '女士') {
sex = '2';
} else if (sexStr == '公司') {
sex = '3';
}
guest.rname = nameStr; //预订人姓名
guest.sex = sex; //预订人性别:1:男 2:女
// _homeEnterModel.clearData();
bus.emit("refresh_tablemanager"); //刷新当前页面
bus.emit("refresh_book_list"); //刷新已预订列表
if (youhui != '选择优惠') {
Map<String, String> params = {
"rid": _model.row.id,
"aid":
'${couponProvider.couponListSelect[couponSelectIndex].id}'
};
bool isSuc = await couponProvider
.setActivityAsReserve(context, params);
if (isSuc) {
couponProvider.hasModify = true;
UserModel userModel = Provider.of<UserModel>(
context,
listen: false);
Map<String, String> params = {
"rid": _model.row.id,
"sid": userModel.user.sellerid
};
bool success = await couponProvider
.sendSMSWxSendSms(context, params);
print(success);
}
}
} else {
UserModel userModel = Provider.of<UserModel>(
context,
listen: false);
Map<String, String> params = {
"rid": _model.row.id,
"sid": userModel.user.sellerid
};
bool success = await couponProvider
.sendSMSWxSendSms(context, params);
print(success);
}
// if (success) {
// Utils.showToast('短信已经发送成功!');
// } else {
// Utils.showToast('发送次数太频繁!');
// }
// } else {
// Utils.showToast('短信已经发送成功!');
// }
// //进入订座详情页面
// NavigatorUtil.goNotebookDetailPage(
// context,
// _model.row.id,
// Provider.of<UserModel>(context, listen: false)
// .user
// .openid,
// );
// String ddate_solt = '';
// if (_model.row.isSetDdate == '1') {
// String createtime = _model.row.ddate.toString() + '000';
// DateTime createTime =
// DateTime.fromMillisecondsSinceEpoch(
// int.parse(createtime));
// ddate_solt = DateUtil.formatDate(createTime,
// format: DateFormats.h_m);
// } else {
// if (_model.row.ddateSolt == '1') {
// ddate_solt = '早餐';
// } else if (_model.row.ddateSolt == '2') {
// ddate_solt = '午餐';
// } else if (_model.row.ddateSolt == '3') {
// ddate_solt = '晚餐';
// }
// }
// List<dynamic> tableinfo =
// convert.jsonDecode(_model.row.tableinfo);
// print(tableinfo);
// // String _nameStr =
// // table.TableList.fromJson(tableinfo[0]).name;
// // if (tableinfo.length > 1) {
// // _nameStr = table.TableList.fromJson(tableinfo[0]).name +
// // '等${tableinfo.length}桌';
// // }
// // LogUtil.v(_nameStr);
// // String _tid = '';
// // for (int i = 0; i < tableinfo.length; i++) {
// // _tid += '${table.TableList.fromJson(tableinfo[i]).id},';
// // }
// // if (_tid.endsWith(',')) {
// // _tid = _tid.substring(0, _tid.length - 1);
// // }
// String _nameStr = '';
// String _tid = '';
// for (int i = 0; i < tableinfo.length; i++) {
// _nameStr +=
// '${table.TableList.fromJson(tableinfo[i]).name},';
// _tid += '${table.TableList.fromJson(tableinfo[i]).id},';
// }
// if (_tid.endsWith(',')) {
// _tid = _tid.substring(0, _tid.length - 1);
// }
// if (_nameStr.endsWith(',')) {
// _nameStr = _nameStr.substring(0, _nameStr.length - 1);
// }
// NavigatorUtil.goInvicationPage(
// context,
// _model.row.id,
// _nameStr,
// _model.row.ddate,
// ddate_solt,
// _model.row.phone,
// _model.row.ddateSolt,
// _model.row.rname == null ? '' : _model.row.rname,
// _model.row.sex == null ? '' : _model.row.sex,
// tid: _tid,
// replace: false);
// // //今天 明天 其他天
// // String tempTime = _homeEnterModel.ddateStr;
// // if (_homeEnterModel.ddateStr == '') {
// // if (currTimeIndex == 1) {
// // tempTime = '08:00';
// // } else if (currTimeIndex == 2) {
// // tempTime = '12:00';
// // } else if (currTimeIndex == 3) {
// // tempTime = '18:00';
// // }
// // }
// // print(_model.row.tableinfo);
// // _clearData();
// // String timeStr = dateText + ' ' + tempTime + ':00';
// // LogUtil.v(timeStr);
// // int ddate = DateUtil.getDateMsByTimeStr(timeStr);
// // _homeEnterModel.getNewTableList(context, '${ddate}',
// // currTimeIndex.toString(), pnum);
// // EventBus().emit("refresh_tablemanager"); //刷新桌位
} else {
Utils.showToast("预订失败!");
}
},
)),
HEmptyView(36),
RoundButton(
text: '返回微信通知',
width: ScreenUtil().setWidth(182),
height: ScreenUtil().setWidth(96),
fontSize: 24,
textColor: MyColours.color_515151,
gradientStart: MyColours.color_f3f3f3,
gradientEnd: MyColours.color_f3f3f3,
radius: ScreenUtil().setWidth(8),
isBold: false,
onPressed: () {
setState(() {
wechatNotification = true;
});
},
)
],
)),
String pnum;
if (pnumController.text != '') {
pnum = pnumController.text;
}
String cusdem;
if (customController.text.trim().length > 0) {
cusdem = customController.text;
}
SunReserveInfoModel _model =
await tableManagerModel.setReserveInfo(
context,
needKeep: true,
pnum: pnum,
cusdem: cusdem,
tempTime:
ddateHm == '选填' ? null : ddateHm,
guest: widget.guest == null
? guest
: widget.guest);
if (_model != null &&
ObjectUtil.isNotEmpty(_model.row) &&
ObjectUtil.isNotEmpty(_model.row.id)) {
print('成功');
// tableManagerModel.selectTables = [];
// wechatNotification = true;
_clearData();
// _homeEnterModel.clearData();
bus.emit("refresh_tablemanager"); //刷新当前页面
bus.emit("refresh_book_list"); //刷新已预订列表
if (youhui != '选择优惠') {
Map<String, String> params = {
"rid": _model.row.id,
"aid":
'${couponProvider.couponListSelect[couponSelectIndex].id}'
};
bool isSuc = await couponProvider
.setActivityAsReserve(context, params);
if (isSuc) {
couponProvider.hasModify = true;
UserModel userModel =
Provider.of<UserModel>(context,
listen: false);
Map<String, String> params = {
"rid": _model.row.id,
"sid": userModel.user.sellerid
};
bool success = await couponProvider
.sendSMSWxSendSms(context, params);
print(success);
}
} else {
UserModel userModel = Provider.of<UserModel>(
context,
listen: false);
Map<String, String> params = {
"rid": _model.row.id,
"sid": userModel.user.sellerid
};
bool success = await couponProvider
.sendSMSWxSendSms(context, params);
print(success);
}
// Row(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// // HEmptyView(15),
// Padding(
// // width: ScreenUtil().setWidth(120),
// padding: EdgeInsets.only(top: ScreenUtil().setWidth(10)),
// child: Text(
// '已选桌位:',
// style: TextStyle(
// color: MyColours.color_333333,
// fontSize: ScreenUtil().setSp(26)),
// )),
// HEmptyView(15),
// // Expanded(
// // child:
// // width: ScreenUtil().screenWidth -
// // ScreenUtil().setWidth(160),
// // constraints:
// // BoxConstraints(maxHeight: ScreenUtil().setWidth(140)),
// // color: Colors.blueAccent,
// // ListView.builder(
// // shrinkWrap: true,
// // itemBuilder: (BuildContext context, int index) {
// // return
// // Scrollbar(
// // isAlwaysShown: true, //设置滚动条常亮
// // controller: _scrollCrl, //必须设置一个controller
// // ///添加进度条
// // child:
// // SingleChildScrollView(
// // controller: _scrollCrl,
// // child:
// Container(
// // color: Colors.red,
// width: ScreenUtil().screenWidth -
// ScreenUtil().setWidth(100 + 130),
// child: Wrap(
// spacing: ScreenUtil().setWidth(20),
// runSpacing: ScreenUtil().setWidth(20),
// children: _buildAlwayItems())),
// // )
// // )
// // },
// // itemCount: 1,
// // ),
// // )
// ],
// ),
// VEmptyView(40),
// Container(
// // width: ScreenUtil().setWidth(100),
// // color: Colors.red,
// // constraints: BoxConstraints(
// // minHeight: ScreenUtil().setWidth(500),
// // ),
// child: Row(
// mainAxisAlignment: MainAxisAlignment.spaceEvenly,
// children: [
// InkWell(
// onTap: () {
// tableManagerModel.selectTables = [];
// for (t.Table item in tableManagerModel.tablesShow) {
// item.selected = false;
// }
// tableManagerModel.areaTableMapShow.forEach((key, value) {
// value.forEach((element) {
// element.selected = false;
// });
// });
// tableManagerModel.notifyListeners();
// },
// child: Container(
// padding: EdgeInsets.all(
// ScreenUtil().setWidth(30),
// ),
// child: Text(
// '取消重置',
// style: TextStyle(
// color: MyColours.color_199095,
// fontSize: ScreenUtil().setSp(26)),
// ),
// ),
// ),
// RoundButton(
// onPressed: () async {
// SunReserveInfoModel _model =
// await tableManagerModel.setReserveInfo(context,
// needKeep: true, guest: widget.guest);
// if (_model != null &&
// ObjectUtil.isNotEmpty(_model.row) &&
// ObjectUtil.isNotEmpty(_model.row.id)) {
// print('成功');
// tableManagerModel.selectTables = [];
// // _homeEnterModel.clearData();
// bus.emit("refresh_tablemanager"); //刷新当前页面
// bus.emit("refresh_book_list"); //刷新已预订列表
// //进入订座详情页面
// // NavigatorUtil.goNotebookDetailPage(
// // context,
// // _model.row.id,
// // Provider.of<UserModel>(context, listen: false)
// // .user
// // .openid,
// // );
// // String ddate_solt = '';
// // if (_model.row.isSetDdate == '1') {
// // String createtime =
// // _model.row.ddate.toString() + '000';
// // DateTime createTime =
// // DateTime.fromMillisecondsSinceEpoch(
// // int.parse(createtime));
// // ddate_solt = DateUtil.formatDate(createTime,
// // format: DateFormats.h_m);
// // } else {
// // if (_model.row.ddateSolt == '1') {
// // ddate_solt = '早餐';
// // } else if (_model.row.ddateSolt == '2') {
// // ddate_solt = '午餐';
// // } else if (_model.row.ddateSolt == '3') {
// // ddate_solt = '晚餐';
// // }
// // }
// // List<dynamic> tableinfo =
// // convert.jsonDecode(_model.row.tableinfo);
// // print(tableinfo);
// // String _nameStr =
// // t.TableList.fromJson(tableinfo[0]).name;
// // if (tableinfo.length > 1) {
// // _nameStr = t.TableList.fromJson(tableinfo[0]).name +
// // '等${tableinfo.length}桌';
// // }
// // LogUtil.v(_nameStr);
// // String _tid = '';
// // for (int i = 0; i < tableinfo.length; i++) {
// // _tid += '${t.TableList.fromJson(tableinfo[i]).id},';
// // }
// // if (_tid.endsWith(',')) {
// // _tid = _tid.substring(0, _tid.length - 1);
// // }
// // NavigatorUtil.goInvicationPage(
// // context,
// // _model.row.id,
// // _nameStr,
// // _model.row.ddate,
// // ddate_solt,
// // _model.row.phone,
// // _model.row.ddateSolt,
// // tid: _tid,
// // replace: false);
// // //今天 明天 其他天
// // String tempTime = _homeEnterModel.ddateStr;
// // if (_homeEnterModel.ddateStr == '') {
// // if (currTimeIndex == 1) {
// // tempTime = '08:00';
// // } else if (currTimeIndex == 2) {
// // tempTime = '12:00';
// // } else if (currTimeIndex == 3) {
// // tempTime = '18:00';
// // }
// // }
// // print(_model.row.tableinfo);
// // _clearData();
// // String timeStr = dateText + ' ' + tempTime + ':00';
// // LogUtil.v(timeStr);
// // int ddate = DateUtil.getDateMsByTimeStr(timeStr);
// // _homeEnterModel.getNewTableList(context, '${ddate}',
// // currTimeIndex.toString(), pnum);
// // EventBus().emit("refresh_tablemanager"); //刷新桌位
// } else {
// Utils.showToast("预订失败!");
// }
// },
// text: '仅预订',
// fontSize: 32,
// isBold: false,
// width: ScreenUtil().setWidth(180),
// height: ScreenUtil().setWidth(90),
// padding: EdgeInsets.symmetric(
// horizontal: ScreenUtil().setWidth(20),
// vertical: ScreenUtil().setWidth(4)),
// textColor: MyColours.color_199095,
// gradientStart: MyColours.color_ffffff,
// gradientEnd: MyColours.color_ffffff,
// radius: ScreenUtil().setWidth(10),
// borderColor: MyColours.color_199095,
// ),
// RoundButton(
// onPressed: () async {
// SunReserveInfoModel _model =
// await tableManagerModel.setReserveInfo(context,
// needKeep: true, guest: widget.guest);
// if (_model != null &&
// ObjectUtil.isNotEmpty(_model.row) &&
// ObjectUtil.isNotEmpty(_model.row.id)) {
// print('成功');
// tableManagerModel.selectTables = [];
// // _homeEnterModel.clearData();
// bus.emit("refresh_tablemanager"); //刷新当前页面
// bus.emit("refresh_book_list"); //刷新已预订列表
// // //进入订座详情页面
// // NavigatorUtil.goNotebookDetailPage(
// // context,
// // _model.row.id,
// // Provider.of<UserModel>(context, listen: false)
// // .user
// // .openid,
// // );
// String ddate_solt = '';
// if (_model.row.isSetDdate == '1') {
// String createtime = _model.row.ddate.toString() + '000';
// DateTime createTime =
// DateTime.fromMillisecondsSinceEpoch(
// int.parse(createtime));
// ddate_solt = DateUtil.formatDate(createTime,
// format: DateFormats.h_m);
// } else {
// if (_model.row.ddateSolt == '1') {
// ddate_solt = '早餐';
// } else if (_model.row.ddateSolt == '2') {
// ddate_solt = '午餐';
// } else if (_model.row.ddateSolt == '3') {
// ddate_solt = '晚餐';
// }
// }
// List<dynamic> tableinfo =
// convert.jsonDecode(_model.row.tableinfo);
// print(tableinfo);
// // String _nameStr =
// // table.TableList.fromJson(tableinfo[0]).name;
// // if (tableinfo.length > 1) {
// // _nameStr = table.TableList.fromJson(tableinfo[0]).name +
// // '等${tableinfo.length}桌';
// // }
// // LogUtil.v(_nameStr);
// // String _tid = '';
// // for (int i = 0; i < tableinfo.length; i++) {
// // _tid += '${table.TableList.fromJson(tableinfo[i]).id},';
// // }
// // if (_tid.endsWith(',')) {
// // _tid = _tid.substring(0, _tid.length - 1);
// // }
// String _nameStr = '';
// String _tid = '';
// for (int i = 0; i < tableinfo.length; i++) {
// _nameStr +=
// '${table.TableList.fromJson(tableinfo[i]).name},';
// _tid += '${table.TableList.fromJson(tableinfo[i]).id},';
// }
// if (_tid.endsWith(',')) {
// _tid = _tid.substring(0, _tid.length - 1);
// }
// if (_nameStr.endsWith(',')) {
// _nameStr = _nameStr.substring(0, _nameStr.length - 1);
// }
// NavigatorUtil.goInvicationPage(
// context,
// _model.row.id,
// _nameStr,
// _model.row.ddate,
// ddate_solt,
// _model.row.phone,
// _model.row.ddateSolt,
// _model.row.rname == null ? '' : _model.row.rname,
// _model.row.sex == null ? '' : _model.row.sex,
// tid: _tid,
// replace: false);
// // //今天 明天 其他天
// // String tempTime = _homeEnterModel.ddateStr;
// // if (_homeEnterModel.ddateStr == '') {
// // if (currTimeIndex == 1) {
// // tempTime = '08:00';
// // } else if (currTimeIndex == 2) {
// // tempTime = '12:00';
// // } else if (currTimeIndex == 3) {
// // tempTime = '18:00';
// // }
// // }
// // print(_model.row.tableinfo);
// // _clearData();
// // String timeStr = dateText + ' ' + tempTime + ':00';
// // LogUtil.v(timeStr);
// // int ddate = DateUtil.getDateMsByTimeStr(timeStr);
// // _homeEnterModel.getNewTableList(context, '${ddate}',
// // currTimeIndex.toString(), pnum);
// // EventBus().emit("refresh_tablemanager"); //刷新桌位
// } else {
// Utils.showToast("预订失败!");
// }
// },
// text: '预订并通知',
// fontSize: 32,
// isBold: false,
// width: ScreenUtil().setWidth(220),
// height: ScreenUtil().setWidth(90),
// padding: EdgeInsets.symmetric(
// horizontal: ScreenUtil().setWidth(20),
// vertical: ScreenUtil().setWidth(4)),
// textColor: MyColours.color_ffffff,
// gradientStart: MyColours.color_199095,
// gradientEnd: MyColours.color_199095,
// radius: ScreenUtil().setWidth(10),
// borderColor: MyColours.color_199095,
// ),
// ],
// ),
// ),
showErro == ''
? VEmptyView(62)
: Container(
padding: EdgeInsets.only(
left: ScreenUtil().setWidth(36),
top: ScreenUtil().setWidth(12),
right: ScreenUtil().setWidth(36),
bottom: ScreenUtil().setWidth(18),
),
child: Row(
children: [
Image.asset(Utils.getImgPath('error_circle_red'),
width: ScreenUtil().setWidth(44)),
HEmptyView(16),
Text(
showErro,
style: TextStyle(
color: MyColours.color_E34D59,
fontSize: ScreenUtil().setSp(28)),
// if (success) {
// Utils.showToast('短信已经发送成功!');
// } else {
// Utils.showToast('发送次数太频繁!');
// }
// } else {
// Utils.showToast('短信已经发送成功!');
// }
// //进入订座详情页面
// NavigatorUtil.goNotebookDetailPage(
// context,
// _model.row.id,
// Provider.of<UserModel>(context, listen: false)
// .user
// .openid,
// );
// String ddate_solt = '';
// if (_model.row.isSetDdate == '1') {
// String createtime = _model.row.ddate.toString() + '000';
// DateTime createTime =
// DateTime.fromMillisecondsSinceEpoch(
// int.parse(createtime));
// ddate_solt = DateUtil.formatDate(createTime,
// format: DateFormats.h_m);
// } else {
// if (_model.row.ddateSolt == '1') {
// ddate_solt = '早餐';
// } else if (_model.row.ddateSolt == '2') {
// ddate_solt = '午餐';
// } else if (_model.row.ddateSolt == '3') {
// ddate_solt = '晚餐';
// }
// }
// List<dynamic> tableinfo =
// convert.jsonDecode(_model.row.tableinfo);
// print(tableinfo);
// // String _nameStr =
// // table.TableList.fromJson(tableinfo[0]).name;
// // if (tableinfo.length > 1) {
// // _nameStr = table.TableList.fromJson(tableinfo[0]).name +
// // '等${tableinfo.length}桌';
// // }
// // LogUtil.v(_nameStr);
// // String _tid = '';
// // for (int i = 0; i < tableinfo.length; i++) {
// // _tid += '${table.TableList.fromJson(tableinfo[i]).id},';
// // }
// // if (_tid.endsWith(',')) {
// // _tid = _tid.substring(0, _tid.length - 1);
// // }
// String _nameStr = '';
// String _tid = '';
// for (int i = 0; i < tableinfo.length; i++) {
// _nameStr +=
// '${table.TableList.fromJson(tableinfo[i]).name},';
// _tid += '${table.TableList.fromJson(tableinfo[i]).id},';
// }
// if (_tid.endsWith(',')) {
// _tid = _tid.substring(0, _tid.length - 1);
// }
// if (_nameStr.endsWith(',')) {
// _nameStr = _nameStr.substring(0, _nameStr.length - 1);
// }
// NavigatorUtil.goInvicationPage(
// context,
// _model.row.id,
// _nameStr,
// _model.row.ddate,
// ddate_solt,
// _model.row.phone,
// _model.row.ddateSolt,
// _model.row.rname == null ? '' : _model.row.rname,
// _model.row.sex == null ? '' : _model.row.sex,
// tid: _tid,
// replace: false);
// // //今天 明天 其他天
// // String tempTime = _homeEnterModel.ddateStr;
// // if (_homeEnterModel.ddateStr == '') {
// // if (currTimeIndex == 1) {
// // tempTime = '08:00';
// // } else if (currTimeIndex == 2) {
// // tempTime = '12:00';
// // } else if (currTimeIndex == 3) {
// // tempTime = '18:00';
// // }
// // }
// // print(_model.row.tableinfo);
// // _clearData();
// // String timeStr = dateText + ' ' + tempTime + ':00';
// // LogUtil.v(timeStr);
// // int ddate = DateUtil.getDateMsByTimeStr(timeStr);
// // _homeEnterModel.getNewTableList(context, '${ddate}',
// // currTimeIndex.toString(), pnum);
// // EventBus().emit("refresh_tablemanager"); //刷新桌位
} else {
Utils.showToast("预订失败!");
}
},
)),
HEmptyView(36),
RoundButton(
text: '返回微信通知',
width: ScreenUtil().setWidth(182),
height: ScreenUtil().setWidth(96),
fontSize: 24,
textColor: MyColours.color_515151,
gradientStart: MyColours.color_f3f3f3,
gradientEnd: MyColours.color_f3f3f3,
radius: ScreenUtil().setWidth(8),
isBold: false,
onPressed: () {
setState(() {
wechatNotification = true;
});
},
)
],
),
)
],
),
));
)),
// Row(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// // HEmptyView(15),
// Padding(
// // width: ScreenUtil().setWidth(120),
// padding: EdgeInsets.only(top: ScreenUtil().setWidth(10)),
// child: Text(
// '已选桌位:',
// style: TextStyle(
// color: MyColours.color_333333,
// fontSize: ScreenUtil().setSp(26)),
// )),
// HEmptyView(15),
// // Expanded(
// // child:
// // width: ScreenUtil().screenWidth -
// // ScreenUtil().setWidth(160),
// // constraints:
// // BoxConstraints(maxHeight: ScreenUtil().setWidth(140)),
// // color: Colors.blueAccent,
// // ListView.builder(
// // shrinkWrap: true,
// // itemBuilder: (BuildContext context, int index) {
// // return
// // Scrollbar(
// // isAlwaysShown: true, //设置滚动条常亮
// // controller: _scrollCrl, //必须设置一个controller
// // ///添加进度条
// // child:
// // SingleChildScrollView(
// // controller: _scrollCrl,
// // child:
// Container(
// // color: Colors.red,
// width: ScreenUtil().screenWidth -
// ScreenUtil().setWidth(100 + 130),
// child: Wrap(
// spacing: ScreenUtil().setWidth(20),
// runSpacing: ScreenUtil().setWidth(20),
// children: _buildAlwayItems())),
// // )
// // )
// // },
// // itemCount: 1,
// // ),
// // )
// ],
// ),
// VEmptyView(40),
// Container(
// // width: ScreenUtil().setWidth(100),
// // color: Colors.red,
// // constraints: BoxConstraints(
// // minHeight: ScreenUtil().setWidth(500),
// // ),
// child: Row(
// mainAxisAlignment: MainAxisAlignment.spaceEvenly,
// children: [
// InkWell(
// onTap: () {
// tableManagerModel.selectTables = [];
// for (t.Table item in tableManagerModel.tablesShow) {
// item.selected = false;
// }
// tableManagerModel.areaTableMapShow.forEach((key, value) {
// value.forEach((element) {
// element.selected = false;
// });
// });
// tableManagerModel.notifyListeners();
// },
// child: Container(
// padding: EdgeInsets.all(
// ScreenUtil().setWidth(30),
// ),
// child: Text(
// '取消重置',
// style: TextStyle(
// color: MyColours.color_199095,
// fontSize: ScreenUtil().setSp(26)),
// ),
// ),
// ),
// RoundButton(
// onPressed: () async {
// SunReserveInfoModel _model =
// await tableManagerModel.setReserveInfo(context,
// needKeep: true, guest: widget.guest);
// if (_model != null &&
// ObjectUtil.isNotEmpty(_model.row) &&
// ObjectUtil.isNotEmpty(_model.row.id)) {
// print('成功');
// tableManagerModel.selectTables = [];
// // _homeEnterModel.clearData();
// bus.emit("refresh_tablemanager"); //刷新当前页面
// bus.emit("refresh_book_list"); //刷新已预订列表
// //进入订座详情页面
// // NavigatorUtil.goNotebookDetailPage(
// // context,
// // _model.row.id,
// // Provider.of<UserModel>(context, listen: false)
// // .user
// // .openid,
// // );
// // String ddate_solt = '';
// // if (_model.row.isSetDdate == '1') {
// // String createtime =
// // _model.row.ddate.toString() + '000';
// // DateTime createTime =
// // DateTime.fromMillisecondsSinceEpoch(
// // int.parse(createtime));
// // ddate_solt = DateUtil.formatDate(createTime,
// // format: DateFormats.h_m);
// // } else {
// // if (_model.row.ddateSolt == '1') {
// // ddate_solt = '早餐';
// // } else if (_model.row.ddateSolt == '2') {
// // ddate_solt = '午餐';
// // } else if (_model.row.ddateSolt == '3') {
// // ddate_solt = '晚餐';
// // }
// // }
// // List<dynamic> tableinfo =
// // convert.jsonDecode(_model.row.tableinfo);
// // print(tableinfo);
// // String _nameStr =
// // t.TableList.fromJson(tableinfo[0]).name;
// // if (tableinfo.length > 1) {
// // _nameStr = t.TableList.fromJson(tableinfo[0]).name +
// // '等${tableinfo.length}桌';
// // }
// // LogUtil.v(_nameStr);
// // String _tid = '';
// // for (int i = 0; i < tableinfo.length; i++) {
// // _tid += '${t.TableList.fromJson(tableinfo[i]).id},';
// // }
// // if (_tid.endsWith(',')) {
// // _tid = _tid.substring(0, _tid.length - 1);
// // }
// // NavigatorUtil.goInvicationPage(
// // context,
// // _model.row.id,
// // _nameStr,
// // _model.row.ddate,
// // ddate_solt,
// // _model.row.phone,
// // _model.row.ddateSolt,
// // tid: _tid,
// // replace: false);
// // //今天 明天 其他天
// // String tempTime = _homeEnterModel.ddateStr;
// // if (_homeEnterModel.ddateStr == '') {
// // if (currTimeIndex == 1) {
// // tempTime = '08:00';
// // } else if (currTimeIndex == 2) {
// // tempTime = '12:00';
// // } else if (currTimeIndex == 3) {
// // tempTime = '18:00';
// // }
// // }
// // print(_model.row.tableinfo);
// // _clearData();
// // String timeStr = dateText + ' ' + tempTime + ':00';
// // LogUtil.v(timeStr);
// // int ddate = DateUtil.getDateMsByTimeStr(timeStr);
// // _homeEnterModel.getNewTableList(context, '${ddate}',
// // currTimeIndex.toString(), pnum);
// // EventBus().emit("refresh_tablemanager"); //刷新桌位
// } else {
// Utils.showToast("预订失败!");
// }
// },
// text: '仅预订',
// fontSize: 32,
// isBold: false,
// width: ScreenUtil().setWidth(180),
// height: ScreenUtil().setWidth(90),
// padding: EdgeInsets.symmetric(
// horizontal: ScreenUtil().setWidth(20),
// vertical: ScreenUtil().setWidth(4)),
// textColor: MyColours.color_199095,
// gradientStart: MyColours.color_ffffff,
// gradientEnd: MyColours.color_ffffff,
// radius: ScreenUtil().setWidth(10),
// borderColor: MyColours.color_199095,
// ),
// RoundButton(
// onPressed: () async {
// SunReserveInfoModel _model =
// await tableManagerModel.setReserveInfo(context,
// needKeep: true, guest: widget.guest);
// if (_model != null &&
// ObjectUtil.isNotEmpty(_model.row) &&
// ObjectUtil.isNotEmpty(_model.row.id)) {
// print('成功');
// tableManagerModel.selectTables = [];
// // _homeEnterModel.clearData();
// bus.emit("refresh_tablemanager"); //刷新当前页面
// bus.emit("refresh_book_list"); //刷新已预订列表
// // //进入订座详情页面
// // NavigatorUtil.goNotebookDetailPage(
// // context,
// // _model.row.id,
// // Provider.of<UserModel>(context, listen: false)
// // .user
// // .openid,
// // );
// String ddate_solt = '';
// if (_model.row.isSetDdate == '1') {
// String createtime = _model.row.ddate.toString() + '000';
// DateTime createTime =
// DateTime.fromMillisecondsSinceEpoch(
// int.parse(createtime));
// ddate_solt = DateUtil.formatDate(createTime,
// format: DateFormats.h_m);
// } else {
// if (_model.row.ddateSolt == '1') {
// ddate_solt = '早餐';
// } else if (_model.row.ddateSolt == '2') {
// ddate_solt = '午餐';
// } else if (_model.row.ddateSolt == '3') {
// ddate_solt = '晚餐';
// }
// }
// List<dynamic> tableinfo =
// convert.jsonDecode(_model.row.tableinfo);
// print(tableinfo);
// // String _nameStr =
// // table.TableList.fromJson(tableinfo[0]).name;
// // if (tableinfo.length > 1) {
// // _nameStr = table.TableList.fromJson(tableinfo[0]).name +
// // '等${tableinfo.length}桌';
// // }
// // LogUtil.v(_nameStr);
// // String _tid = '';
// // for (int i = 0; i < tableinfo.length; i++) {
// // _tid += '${table.TableList.fromJson(tableinfo[i]).id},';
// // }
// // if (_tid.endsWith(',')) {
// // _tid = _tid.substring(0, _tid.length - 1);
// // }
// String _nameStr = '';
// String _tid = '';
// for (int i = 0; i < tableinfo.length; i++) {
// _nameStr +=
// '${table.TableList.fromJson(tableinfo[i]).name},';
// _tid += '${table.TableList.fromJson(tableinfo[i]).id},';
// }
// if (_tid.endsWith(',')) {
// _tid = _tid.substring(0, _tid.length - 1);
// }
// if (_nameStr.endsWith(',')) {
// _nameStr = _nameStr.substring(0, _nameStr.length - 1);
// }
// NavigatorUtil.goInvicationPage(
// context,
// _model.row.id,
// _nameStr,
// _model.row.ddate,
// ddate_solt,
// _model.row.phone,
// _model.row.ddateSolt,
// _model.row.rname == null ? '' : _model.row.rname,
// _model.row.sex == null ? '' : _model.row.sex,
// tid: _tid,
// replace: false);
// // //今天 明天 其他天
// // String tempTime = _homeEnterModel.ddateStr;
// // if (_homeEnterModel.ddateStr == '') {
// // if (currTimeIndex == 1) {
// // tempTime = '08:00';
// // } else if (currTimeIndex == 2) {
// // tempTime = '12:00';
// // } else if (currTimeIndex == 3) {
// // tempTime = '18:00';
// // }
// // }
// // print(_model.row.tableinfo);
// // _clearData();
// // String timeStr = dateText + ' ' + tempTime + ':00';
// // LogUtil.v(timeStr);
// // int ddate = DateUtil.getDateMsByTimeStr(timeStr);
// // _homeEnterModel.getNewTableList(context, '${ddate}',
// // currTimeIndex.toString(), pnum);
// // EventBus().emit("refresh_tablemanager"); //刷新桌位
// } else {
// Utils.showToast("预订失败!");
// }
// },
// text: '预订并通知',
// fontSize: 32,
// isBold: false,
// width: ScreenUtil().setWidth(220),
// height: ScreenUtil().setWidth(90),
// padding: EdgeInsets.symmetric(
// horizontal: ScreenUtil().setWidth(20),
// vertical: ScreenUtil().setWidth(4)),
// textColor: MyColours.color_ffffff,
// gradientStart: MyColours.color_199095,
// gradientEnd: MyColours.color_199095,
// radius: ScreenUtil().setWidth(10),
// borderColor: MyColours.color_199095,
// ),
// ],
// ),
// ),
showErro == ''
? VEmptyView(62)
: Container(
padding: EdgeInsets.only(
left: ScreenUtil().setWidth(36),
top: ScreenUtil().setWidth(12),
right: ScreenUtil().setWidth(36),
bottom: ScreenUtil().setWidth(18),
),
child: Row(
children: [
Image.asset(Utils.getImgPath('error_circle_red'),
width: ScreenUtil().setWidth(44)),
HEmptyView(16),
Text(
showErro,
style: TextStyle(
color: MyColours.color_E34D59,
fontSize: ScreenUtil().setSp(28)),
)
],
),
)
],
),
)));
}
//构建常用备注
... ...
... ... @@ -1389,6 +1389,7 @@ class CustomerProvider extends ChangeNotifier {
{isShowLoading = true}) async {
if (isShowLoading) {
pageStateStoreHome = PageState.Loading;
pageStateMyHome = PageState.Loading;
notifyListeners();
}
Map<String, String> params = {
... ... @@ -1404,12 +1405,15 @@ class CustomerProvider extends ChangeNotifier {
switch (error.type) {
case 1:
pageStateStoreHome = PageState.ConnectivityError;
pageStateMyHome = PageState.ConnectivityError;
break;
case 2:
pageStateStoreHome = PageState.ConnectivityTimeOut;
pageStateMyHome = PageState.ConnectivityTimeOut;
break;
default:
pageStateStoreHome = PageState.ConnectivityError;
pageStateMyHome = PageState.ConnectivityError;
break;
}
}
... ... @@ -1420,6 +1424,7 @@ class CustomerProvider extends ChangeNotifier {
if (baseResp.data.isEmpty) {
if (isShowLoading) {
pageStateStoreHome = PageState.Empty;
pageStateMyHome = PageState.Empty;
}
} else {
if (isShowLoading) {
... ... @@ -1432,6 +1437,7 @@ class CustomerProvider extends ChangeNotifier {
} else {
if (isShowLoading) {
pageStateStoreHome = PageState.ConnectivityError;
pageStateMyHome = PageState.ConnectivityError;
}
if (baseResp != null) {
Utils.showToast(baseResp.msg ?? "");
... ... @@ -1811,8 +1817,9 @@ class CustomerProvider extends ChangeNotifier {
if (baseResp != null && baseResp.code == Constant.status_success) {
// guestReserveSunModel =
// GuestReserveModel.fromJson(baseResp.responseData).data;
if (baseResp.responseData['data'] == 1 ||
baseResp.responseData['data'] == 0) {
if (baseResp.responseData['data'] is Map ||
baseResp.responseData['data'] == 1) {
Utils.showToast("设置成功!");
return true;
}
return false;
... ...