|
...
|
...
|
@@ -53,6 +53,7 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> { |
|
|
|
NotebookDetailModel detailModel = NotebookDetailModel();
|
|
|
|
EasyContactPicker _contactPicker = EasyContactPicker();
|
|
|
|
RemarkManagerModel remarkManagerModel;
|
|
|
|
String currentRemark = '';
|
|
|
|
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
...
|
...
|
@@ -663,7 +664,11 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> { |
|
|
|
// EdgeInsets.only(bottom: ScreenUtil().setWidth(17)),
|
|
|
|
border: InputBorder.none,
|
|
|
|
),
|
|
|
|
onChanged: (value) {},
|
|
|
|
onChanged: (value) {
|
|
|
|
print(value);
|
|
|
|
currentRemark = value;
|
|
|
|
// print();
|
|
|
|
},
|
|
|
|
onEditingComplete: () {
|
|
|
|
print('fff');
|
|
|
|
_needNode.unfocus();
|
|
...
|
...
|
@@ -731,24 +736,43 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> { |
|
|
|
}
|
|
|
|
|
|
|
|
_refreshRemark(List<Remark> remark, int index) {
|
|
|
|
String currentRemark = '';
|
|
|
|
for (int i = 0; i < remark.length; i++) {
|
|
|
|
if (remark[i].selected) {
|
|
|
|
if (currentRemark.length == 0) {
|
|
|
|
currentRemark += '${remark[i].custom}';
|
|
|
|
} else {
|
|
|
|
currentRemark += '、${remark[i].custom}';
|
|
|
|
if (remark[index].selected) {
|
|
|
|
if (currentRemark.length == 0) {
|
|
|
|
currentRemark += '${remark[index].custom}';
|
|
|
|
} else {
|
|
|
|
if (!currentRemark.contains(remark[index].custom)) {
|
|
|
|
if (currentRemark.endsWith('、')) {
|
|
|
|
currentRemark += '${remark[index].custom}';
|
|
|
|
} else {
|
|
|
|
currentRemark += '、${remark[index].custom}';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (currentRemark.contains(remark[index].custom)) {
|
|
|
|
int start = currentRemark.indexOf(remark[index].custom);
|
|
|
|
int end = start + remark[index].custom.length;
|
|
|
|
currentRemark = currentRemark.replaceRange(start, end, '');
|
|
|
|
if (currentRemark.endsWith('、')) {
|
|
|
|
currentRemark = currentRemark.substring(0, currentRemark.length - 1);
|
|
|
|
}
|
|
|
|
if (currentRemark.startsWith('、')) {
|
|
|
|
currentRemark = currentRemark.substring(1, currentRemark.length);
|
|
|
|
}
|
|
|
|
if (currentRemark.contains('、、')) {
|
|
|
|
currentRemark = currentRemark.replaceRange(
|
|
|
|
currentRemark.indexOf('、、'),
|
|
|
|
currentRemark.indexOf('、、') + 2,
|
|
|
|
'、');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (currentRemark.length > 25) {
|
|
|
|
Utils.showToast('备注字数超过25个字!');
|
|
|
|
remark[index].selected = !remark[index].selected;
|
|
|
|
} else {
|
|
|
|
setState(() {
|
|
|
|
_notebookDetailChangeModel.customController.text = currentRemark;
|
|
|
|
});
|
|
|
|
currentRemark = currentRemark.substring(0, 25);
|
|
|
|
}
|
|
|
|
setState(() {
|
|
|
|
_notebookDetailChangeModel.customController.text = currentRemark;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
///底部弹框,设置时间30分钟间隔布局
|
...
|
...
|
|