|
...
|
...
|
@@ -11,6 +11,7 @@ import 'package:one_key/provider/notebook_detail_change_model.dart'; |
|
|
|
import 'package:one_key/provider/notebook_detail_model.dart';
|
|
|
|
import 'package:one_key/provider/user_model.dart';
|
|
|
|
import 'package:one_key/res/colors.dart';
|
|
|
|
import 'package:one_key/res/styles.dart';
|
|
|
|
import 'package:one_key/utils/dialog_util.dart';
|
|
|
|
import 'package:one_key/utils/event_bus.dart';
|
|
|
|
import 'package:one_key/utils/misc.dart';
|
|
...
|
...
|
@@ -21,6 +22,7 @@ import 'package:one_key/widgets/app_bar.dart'; |
|
|
|
import 'package:one_key/widgets/common_button.dart';
|
|
|
|
import 'package:one_key/widgets/h_empty_view.dart';
|
|
|
|
import 'package:one_key/widgets/new_table_item.dart';
|
|
|
|
import 'package:one_key/widgets/round_button.dart';
|
|
|
|
import 'package:one_key/widgets/table_item.dart';
|
|
|
|
import 'package:one_key/widgets/v_empty_view.dart';
|
|
|
|
import 'package:permission_handler/permission_handler.dart';
|
|
...
|
...
|
@@ -102,7 +104,9 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> { |
|
|
|
|
|
|
|
_topWidget() {
|
|
|
|
return Container(
|
|
|
|
padding: EdgeInsets.all(ScreenUtil().setWidth(40)),
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal: ScreenUtil().setWidth(40),
|
|
|
|
vertical: ScreenUtil().setWidth(20)),
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
//第一行 日期选择
|
|
...
|
...
|
@@ -173,7 +177,7 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> { |
|
|
|
);
|
|
|
|
}).toList()),
|
|
|
|
|
|
|
|
VEmptyView(60),
|
|
|
|
VEmptyView(40),
|
|
|
|
//早市、午市、晚市
|
|
|
|
Row(
|
|
|
|
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
...
|
...
|
@@ -233,7 +237,7 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> { |
|
|
|
),
|
|
|
|
);
|
|
|
|
}).toList()),
|
|
|
|
VEmptyView(60),
|
|
|
|
VEmptyView(40),
|
|
|
|
|
|
|
|
///人数选择
|
|
|
|
Row(
|
|
...
|
...
|
@@ -293,7 +297,8 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> { |
|
|
|
model: _notebookDetailChangeModel,
|
|
|
|
);
|
|
|
|
}).toList(),
|
|
|
|
)
|
|
|
|
),
|
|
|
|
VEmptyView(20),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|
|
...
|
...
|
@@ -469,9 +474,46 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> { |
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal: ScreenUtil().setWidth(40),
|
|
|
|
),
|
|
|
|
margin: EdgeInsets.only(top: ScreenUtil().setWidth(72)),
|
|
|
|
// margin: EdgeInsets.only(top: ScreenUtil().setWidth(72)),
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
InkWell(
|
|
|
|
onTap: () {
|
|
|
|
_openAddressBook();
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
height: ScreenUtil().setWidth(120),
|
|
|
|
child: Row(
|
|
|
|
children: [
|
|
|
|
Image.asset(
|
|
|
|
Utils.getImgPath('phone_list'),
|
|
|
|
width: ScreenUtil().setWidth(26 * 2),
|
|
|
|
height: ScreenUtil().setWidth(26 * 2),
|
|
|
|
),
|
|
|
|
HEmptyView(20),
|
|
|
|
Container(
|
|
|
|
height: ScreenUtil().setWidth(48),
|
|
|
|
alignment: Alignment.center,
|
|
|
|
child: Text(
|
|
|
|
'一键录入',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_353535,
|
|
|
|
fontSize: ScreenUtil().setSp(34)),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Spacer(),
|
|
|
|
Image.asset(
|
|
|
|
'assets/arr_right_gray.png',
|
|
|
|
width: ScreenUtil().setWidth(12),
|
|
|
|
height: ScreenUtil().setWidth(22),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
MyDivider(ScreenUtil().setWidth(335 * 2), ScreenUtil().setWidth(2),
|
|
|
|
color: MyColours.color_F1F0F4),
|
|
|
|
VEmptyView(52),
|
|
|
|
Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
...
|
...
|
@@ -479,15 +521,16 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> { |
|
|
|
Expanded(
|
|
|
|
child: TextField(
|
|
|
|
maxLines: 1,
|
|
|
|
|
|
|
|
//输入文本的样式
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(34),
|
|
|
|
color: MyColours.color_353535),
|
|
|
|
controller: _notebookDetailChangeModel.phoneController,
|
|
|
|
focusNode: _phoneNode,
|
|
|
|
controller: _notebookDetailChangeModel.nameController,
|
|
|
|
focusNode: _nameNode,
|
|
|
|
// textAlignVertical: TextAlignVertical.top,
|
|
|
|
decoration: InputDecoration(
|
|
|
|
hintText: "客户电话",
|
|
|
|
hintText: "客户姓名(必填)",
|
|
|
|
hintStyle: TextStyle(
|
|
|
|
color: MyColours.color_999999,
|
|
|
|
fontSize: ScreenUtil().setSp(34),
|
|
...
|
...
|
@@ -496,50 +539,39 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> { |
|
|
|
// EdgeInsets.only(bottom: ScreenUtil().setWidth(17)),
|
|
|
|
border: InputBorder.none,
|
|
|
|
),
|
|
|
|
onChanged: (value) {},
|
|
|
|
onChanged: (value) {
|
|
|
|
print('ggg');
|
|
|
|
},
|
|
|
|
onEditingComplete: () {
|
|
|
|
print('fff');
|
|
|
|
_phoneNode.unfocus();
|
|
|
|
_nameNode.unfocus();
|
|
|
|
},
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
HEmptyView(40),
|
|
|
|
InkWell(
|
|
|
|
onTap: () {
|
|
|
|
_openAddressBook();
|
|
|
|
},
|
|
|
|
child: Text(
|
|
|
|
'打开通讯录',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_199095,
|
|
|
|
fontSize: ScreenUtil().setSp(34),
|
|
|
|
),
|
|
|
|
keyboardType: TextInputType.text,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
HEmptyView(40),
|
|
|
|
InkWell(
|
|
|
|
onTap: () {
|
|
|
|
_showDateChooseWidget(context);
|
|
|
|
},
|
|
|
|
child: Text(
|
|
|
|
int.parse(widget.detailEntity.is_set_ddate) == 0
|
|
|
|
? '未设置到店时间'
|
|
|
|
: _notebookDetailChangeModel.ddateStr,
|
|
|
|
style: TextStyle(
|
|
|
|
color: int.parse(widget.detailEntity.is_set_ddate) == 0
|
|
|
|
? MyColours.color_999999
|
|
|
|
: MyColours.color_199095,
|
|
|
|
fontSize: ScreenUtil().setSp(34),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Row(
|
|
|
|
children: _notebookDetailChangeModel.sexList.map((value) {
|
|
|
|
return _callButton(
|
|
|
|
onPress: () {
|
|
|
|
for (var item in _notebookDetailChangeModel.sexList) {
|
|
|
|
item['select'] = false;
|
|
|
|
if (item['title'] == value['title']) {
|
|
|
|
item['select'] = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
_notebookDetailChangeModel.notifyListeners();
|
|
|
|
},
|
|
|
|
content: value['title'],
|
|
|
|
hasLeftBorder: value['hasLeftBorder'],
|
|
|
|
isSelect: value['select']);
|
|
|
|
}).toList()),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
VEmptyView(40),
|
|
|
|
MyDivider(ScreenUtil().setWidth(335 * 2), ScreenUtil().setWidth(2),
|
|
|
|
color: MyColours.color_F1F0F4),
|
|
|
|
VEmptyView(72),
|
|
|
|
VEmptyView(52),
|
|
|
|
Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
...
|
...
|
@@ -547,16 +579,15 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> { |
|
|
|
Expanded(
|
|
|
|
child: TextField(
|
|
|
|
maxLines: 1,
|
|
|
|
|
|
|
|
//输入文本的样式
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(34),
|
|
|
|
color: MyColours.color_353535),
|
|
|
|
controller: _notebookDetailChangeModel.nameController,
|
|
|
|
focusNode: _nameNode,
|
|
|
|
controller: _notebookDetailChangeModel.phoneController,
|
|
|
|
focusNode: _phoneNode,
|
|
|
|
// textAlignVertical: TextAlignVertical.top,
|
|
|
|
decoration: InputDecoration(
|
|
|
|
hintText: "客户姓名(必填)",
|
|
|
|
hintText: "客户电话",
|
|
|
|
hintStyle: TextStyle(
|
|
|
|
color: MyColours.color_999999,
|
|
|
|
fontSize: ScreenUtil().setSp(34),
|
|
...
|
...
|
@@ -565,39 +596,49 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> { |
|
|
|
// EdgeInsets.only(bottom: ScreenUtil().setWidth(17)),
|
|
|
|
border: InputBorder.none,
|
|
|
|
),
|
|
|
|
onChanged: (value) {
|
|
|
|
print('ggg');
|
|
|
|
},
|
|
|
|
onChanged: (value) {},
|
|
|
|
onEditingComplete: () {
|
|
|
|
print('fff');
|
|
|
|
_nameNode.unfocus();
|
|
|
|
_phoneNode.unfocus();
|
|
|
|
},
|
|
|
|
keyboardType: TextInputType.text,
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
HEmptyView(40),
|
|
|
|
Row(
|
|
|
|
children: _notebookDetailChangeModel.sexList.map((value) {
|
|
|
|
return _callButton(
|
|
|
|
onPress: () {
|
|
|
|
for (var item in _notebookDetailChangeModel.sexList) {
|
|
|
|
item['select'] = false;
|
|
|
|
if (item['title'] == value['title']) {
|
|
|
|
item['select'] = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
_notebookDetailChangeModel.notifyListeners();
|
|
|
|
},
|
|
|
|
content: value['title'],
|
|
|
|
hasLeftBorder: value['hasLeftBorder'],
|
|
|
|
isSelect: value['select']);
|
|
|
|
}).toList()),
|
|
|
|
Container(
|
|
|
|
height: ScreenUtil().setWidth(48),
|
|
|
|
width: ScreenUtil().setWidth(84 * 2),
|
|
|
|
child: RoundButton(
|
|
|
|
height: ScreenUtil().setWidth(80),
|
|
|
|
width: ScreenUtil().setWidth(300),
|
|
|
|
radius: ScreenUtil().setWidth(0),
|
|
|
|
fontSize: 28,
|
|
|
|
isBold: false,
|
|
|
|
text: int.parse(widget.detailEntity.is_set_ddate) == 0
|
|
|
|
? '设置时间'
|
|
|
|
: _notebookDetailChangeModel.ddateStr,
|
|
|
|
onPressed: () {
|
|
|
|
_showDateChooseWidget(context);
|
|
|
|
}
|
|
|
|
// Text(
|
|
|
|
// int.parse(widget.detailEntity.is_set_ddate) == 0
|
|
|
|
// ? '未设置到店时间'
|
|
|
|
// : _notebookDetailChangeModel.ddateStr,
|
|
|
|
// style: TextStyle(
|
|
|
|
// color: int.parse(widget.detailEntity.is_set_ddate) == 0
|
|
|
|
// ? MyColours.color_999999
|
|
|
|
// : MyColours.color_199095,
|
|
|
|
// fontSize: ScreenUtil().setSp(34),
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
VEmptyView(40),
|
|
|
|
MyDivider(ScreenUtil().setWidth(335 * 2), ScreenUtil().setWidth(2),
|
|
|
|
color: MyColours.color_F1F0F4),
|
|
|
|
VEmptyView(72),
|
|
|
|
VEmptyView(52),
|
|
|
|
TextField(
|
|
|
|
maxLines: 1,
|
|
|
|
inputFormatters: [LengthLimitingTextInputFormatter(25)],
|
|
...
|
...
|
@@ -797,6 +838,7 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> { |
|
|
|
if (permissionStatus == PermissionStatus.neverAskAgain) {
|
|
|
|
//用户选择不在弹出权限提示框
|
|
|
|
print('never');
|
|
|
|
DialogUtil.openAlertDialog(context);
|
|
|
|
} else {
|
|
|
|
// 申请权限
|
|
|
|
bool canContacts = await requestContactPermission();
|
|
...
|
...
|
@@ -804,7 +846,7 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> { |
|
|
|
_getContactData();
|
|
|
|
} else {
|
|
|
|
//拒绝通讯录权限 , 苹果拒绝权限后,不再提示权限框,进入此处
|
|
|
|
print(canContacts);
|
|
|
|
DialogUtil.openAlertDialog(context);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
...
|
...
|
|