|
...
|
...
|
@@ -2,6 +2,7 @@ import 'dart:convert'; |
|
|
|
import 'dart:ui';
|
|
|
|
|
|
|
|
import 'package:common_utils/common_utils.dart';
|
|
|
|
|
|
|
|
// import 'package:contacts_service/contacts_service.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/services.dart';
|
|
...
|
...
|
@@ -18,6 +19,7 @@ import 'package:one_key/utils/dialog_util.dart'; |
|
|
|
import 'package:one_key/utils/event_bus.dart';
|
|
|
|
import 'package:one_key/utils/misc.dart';
|
|
|
|
import 'package:one_key/utils/navigator_util.dart';
|
|
|
|
import 'package:one_key/utils/triangle_custom_painter.dart';
|
|
|
|
import 'package:one_key/utils/utils.dart';
|
|
|
|
import 'package:one_key/widgets/MyDivider.dart';
|
|
|
|
import 'package:one_key/widgets/app_bar.dart';
|
|
...
|
...
|
@@ -40,6 +42,7 @@ class NoteBookChangePage extends StatefulWidget { |
|
|
|
|
|
|
|
const NoteBookChangePage({Key key, this.detailEntity, this.rid})
|
|
|
|
: super(key: key);
|
|
|
|
|
|
|
|
@override
|
|
|
|
_NoteBookChangePageState createState() => _NoteBookChangePageState();
|
|
|
|
}
|
|
...
|
...
|
@@ -55,6 +58,12 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> { |
|
|
|
RemarkManagerModel remarkManagerModel;
|
|
|
|
String currentRemark = '';
|
|
|
|
|
|
|
|
bool showPhoneHistory = false; //显示客户历史记录
|
|
|
|
|
|
|
|
String sid = ""; //商户id
|
|
|
|
|
|
|
|
ScrollController _controller = ScrollController();
|
|
|
|
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
super.initState();
|
|
...
|
...
|
@@ -62,6 +71,7 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> { |
|
|
|
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
|
|
|
|
// _notebookDetailChangeModel =
|
|
|
|
// Provider.of<NotebookDetailChangeModel>(context, listen: false);
|
|
|
|
sid = Provider.of<UserModel>(context, listen: false).user.sellerid;
|
|
|
|
_notebookDetailChangeModel.initDateHourMinuteList(context);
|
|
|
|
String ddate = widget.detailEntity.ddate.toString() + '000';
|
|
|
|
_notebookDetailChangeModel.getNewTableList(
|
|
...
|
...
|
@@ -75,23 +85,6 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> { |
|
|
|
"uid": Provider.of<UserModel>(context, listen: false).user.openid
|
|
|
|
};
|
|
|
|
remarkManagerModel.getRemarks(context, params);
|
|
|
|
// //输入框焦点
|
|
|
|
// _nameNode.addListener(() {
|
|
|
|
// if (!_nameNode.hasFocus) {
|
|
|
|
// print('失去焦点');
|
|
|
|
// } else {
|
|
|
|
// print('得到焦点');
|
|
|
|
// _phoneNode.unfocus();
|
|
|
|
// }
|
|
|
|
// });
|
|
|
|
// //输入框焦点
|
|
|
|
// _phoneNode.addListener(() {
|
|
|
|
// if (!_phoneNode.hasFocus) {
|
|
|
|
// print('失去焦点');
|
|
|
|
// } else {
|
|
|
|
// print('得到焦点');
|
|
|
|
// }
|
|
|
|
// });
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
...
|
...
|
@@ -598,11 +591,34 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> { |
|
|
|
// EdgeInsets.only(bottom: ScreenUtil().setWidth(17)),
|
|
|
|
border: InputBorder.none,
|
|
|
|
),
|
|
|
|
onChanged: (value) {},
|
|
|
|
onChanged: (value) {
|
|
|
|
LogUtil.v("value:$value");
|
|
|
|
if (value.isEmpty || value.length >= 11) {
|
|
|
|
//内容为空,或 超过11位
|
|
|
|
setState(() {
|
|
|
|
showPhoneHistory = false;
|
|
|
|
_notebookDetailChangeModel.userHistorys.clear();
|
|
|
|
});
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
Map<String, String> params = {
|
|
|
|
"keywords": value,
|
|
|
|
"sid": sid
|
|
|
|
};
|
|
|
|
_notebookDetailChangeModel.getUserHistorys(context, params);
|
|
|
|
},
|
|
|
|
onEditingComplete: () {
|
|
|
|
print('fff');
|
|
|
|
_phoneNode.unfocus();
|
|
|
|
},
|
|
|
|
onTap: () {
|
|
|
|
setState(() {
|
|
|
|
showPhoneHistory = true;
|
|
|
|
});
|
|
|
|
Future.delayed(Duration(milliseconds: 300),(){
|
|
|
|
_controller.jumpTo(_controller.position.maxScrollExtent);
|
|
|
|
});
|
|
|
|
},
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
),
|
|
|
|
),
|
|
...
|
...
|
@@ -637,71 +653,166 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> { |
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
VEmptyView(40),
|
|
|
|
MyDivider(ScreenUtil().setWidth(335 * 2), ScreenUtil().setWidth(2),
|
|
|
|
color: MyColours.color_F1F0F4),
|
|
|
|
VEmptyView(52),
|
|
|
|
Row(
|
|
|
|
Stack(
|
|
|
|
children: [
|
|
|
|
Expanded(
|
|
|
|
child: TextField(
|
|
|
|
maxLines: 1,
|
|
|
|
inputFormatters: [LengthLimitingTextInputFormatter(25)],
|
|
|
|
//输入文本的样式
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(34),
|
|
|
|
color: MyColours.color_353535),
|
|
|
|
controller: _notebookDetailChangeModel.customController,
|
|
|
|
focusNode: _needNode,
|
|
|
|
// textAlignVertical: TextAlignVertical.top,
|
|
|
|
decoration: InputDecoration(
|
|
|
|
hintText: "客户要求(25字以内,选填)",
|
|
|
|
hintStyle: TextStyle(
|
|
|
|
color: MyColours.color_999999,
|
|
|
|
fontSize: ScreenUtil().setSp(34),
|
|
|
|
Column(
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
children: [
|
|
|
|
VEmptyView(40),
|
|
|
|
MyDivider(
|
|
|
|
ScreenUtil().setWidth(335 * 2), ScreenUtil().setWidth(2),
|
|
|
|
color: MyColours.color_F1F0F4),
|
|
|
|
VEmptyView(52),
|
|
|
|
Row(
|
|
|
|
children: [
|
|
|
|
Expanded(
|
|
|
|
child: TextField(
|
|
|
|
maxLines: 1,
|
|
|
|
inputFormatters: [LengthLimitingTextInputFormatter(25)],
|
|
|
|
//输入文本的样式
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(34),
|
|
|
|
color: MyColours.color_353535),
|
|
|
|
controller: _notebookDetailChangeModel.customController,
|
|
|
|
focusNode: _needNode,
|
|
|
|
// textAlignVertical: TextAlignVertical.top,
|
|
|
|
decoration: InputDecoration(
|
|
|
|
hintText: "客户要求(25字以内,选填)",
|
|
|
|
hintStyle: TextStyle(
|
|
|
|
color: MyColours.color_999999,
|
|
|
|
fontSize: ScreenUtil().setSp(34),
|
|
|
|
),
|
|
|
|
// contentPadding:
|
|
|
|
// EdgeInsets.only(bottom: ScreenUtil().setWidth(17)),
|
|
|
|
border: InputBorder.none,
|
|
|
|
),
|
|
|
|
onChanged: (value) {
|
|
|
|
print(value);
|
|
|
|
currentRemark = value;
|
|
|
|
// print();
|
|
|
|
},
|
|
|
|
onEditingComplete: () {
|
|
|
|
print('fff');
|
|
|
|
_needNode.unfocus();
|
|
|
|
},
|
|
|
|
// keyboardType: TextInputType.number,
|
|
|
|
)),
|
|
|
|
InkWell(
|
|
|
|
onTap: () {
|
|
|
|
DialogUtil.showRemarkDialog(
|
|
|
|
context, remarkManagerModel.remarks, (item) {
|
|
|
|
int index =
|
|
|
|
remarkManagerModel.remarks.indexOf(item);
|
|
|
|
_refreshRemark(remarkManagerModel.remarks, index);
|
|
|
|
});
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
margin:
|
|
|
|
EdgeInsets.only(left: ScreenUtil().setWidth(40)),
|
|
|
|
width: ScreenUtil().setWidth(122),
|
|
|
|
height: ScreenUtil().setWidth(42),
|
|
|
|
child: Text(
|
|
|
|
'快速备注',
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(30),
|
|
|
|
color: MyColours.color_199095),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
// contentPadding:
|
|
|
|
// EdgeInsets.only(bottom: ScreenUtil().setWidth(17)),
|
|
|
|
border: InputBorder.none,
|
|
|
|
),
|
|
|
|
onChanged: (value) {
|
|
|
|
print(value);
|
|
|
|
currentRemark = value;
|
|
|
|
// print();
|
|
|
|
},
|
|
|
|
onEditingComplete: () {
|
|
|
|
print('fff');
|
|
|
|
_needNode.unfocus();
|
|
|
|
},
|
|
|
|
// keyboardType: TextInputType.number,
|
|
|
|
)),
|
|
|
|
InkWell(
|
|
|
|
onTap: () {
|
|
|
|
DialogUtil.showRemarkDialog(
|
|
|
|
context, remarkManagerModel.remarks, (item) {
|
|
|
|
int index = remarkManagerModel.remarks.indexOf(item);
|
|
|
|
_refreshRemark(remarkManagerModel.remarks, index);
|
|
|
|
});
|
|
|
|
},
|
|
|
|
VEmptyView(40),
|
|
|
|
MyDivider(
|
|
|
|
ScreenUtil().setWidth(335 * 2), ScreenUtil().setWidth(2),
|
|
|
|
color: MyColours.color_F1F0F4),
|
|
|
|
VEmptyView(30),
|
|
|
|
_remarkListWidget()
|
|
|
|
],
|
|
|
|
),
|
|
|
|
Offstage(
|
|
|
|
offstage: !(showPhoneHistory &&
|
|
|
|
_notebookDetailChangeModel.userHistorys.length > 0),
|
|
|
|
child: Container(
|
|
|
|
margin: EdgeInsets.only(left: ScreenUtil().setWidth(40)),
|
|
|
|
width: ScreenUtil().setWidth(122),
|
|
|
|
height: ScreenUtil().setWidth(42),
|
|
|
|
child: Text(
|
|
|
|
'快速备注',
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(30),
|
|
|
|
color: MyColours.color_199095),
|
|
|
|
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(
|
|
|
|
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 =
|
|
|
|
_notebookDetailChangeModel
|
|
|
|
.userHistorys[index].phone;
|
|
|
|
_notebookDetailChangeModel.nameController.text =
|
|
|
|
_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)
|
|
|
|
? 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)),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
},
|
|
|
|
itemExtent: ScreenUtil().setWidth(104),
|
|
|
|
itemCount:
|
|
|
|
_notebookDetailChangeModel.userHistorys.length,
|
|
|
|
))
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
VEmptyView(40),
|
|
|
|
MyDivider(ScreenUtil().setWidth(335 * 2), ScreenUtil().setWidth(2),
|
|
|
|
color: MyColours.color_F1F0F4),
|
|
|
|
VEmptyView(30),
|
|
|
|
_remarkListWidget()
|
|
|
|
)
|
|
|
|
// VEmptyView(62),
|
|
|
|
],
|
|
|
|
),
|
|
...
|
...
|
@@ -966,7 +1077,6 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> { |
|
|
|
} else {
|
|
|
|
fullName = contact.fullName;
|
|
|
|
}
|
|
|
|
|
|
|
|
_notebookDetailChangeModel.phoneController.text = contact.phoneNumber;
|
|
|
|
_notebookDetailChangeModel.nameController.text = fullName;
|
|
|
|
});
|
|
...
|
...
|
@@ -992,9 +1102,14 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> { |
|
|
|
),
|
|
|
|
Expanded(
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
controller: _controller,
|
|
|
|
child: Column(
|
|
|
|
children: [_topWidget(), _middleWidget(), _bottomWidget()],
|
|
|
|
))),
|
|
|
|
children: [
|
|
|
|
_topWidget(),
|
|
|
|
_middleWidget(),
|
|
|
|
_bottomWidget()
|
|
|
|
],
|
|
|
|
))),
|
|
|
|
Container(
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal: ScreenUtil().setWidth(40),
|
|
...
|
...
|
@@ -1102,12 +1217,14 @@ class CustomButton extends StatefulWidget { |
|
|
|
this.model,
|
|
|
|
this.height = 25,
|
|
|
|
}) : super(key: key);
|
|
|
|
|
|
|
|
@override
|
|
|
|
_ButtonState createState() => _ButtonState();
|
|
|
|
}
|
|
|
|
|
|
|
|
class _ButtonState extends State<CustomButton> {
|
|
|
|
FocusNode _cancelNode = FocusNode();
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
String imgStrSelect = widget.isImage && !widget.isTextFiled
|
...
|
...
|
|