|
...
|
...
|
@@ -66,6 +66,10 @@ class RemarkManagerPageState extends State<RemarkManagerPage> { |
|
|
|
|
|
|
|
//添加常用备注
|
|
|
|
_addCustomRemark(Remark remark) {
|
|
|
|
if (alwaysCount >= 10) {
|
|
|
|
Utils.showToast("最多添加10个常用备注");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
Map<String, String> params = {
|
|
|
|
"uid": Provider.of<UserModel>(context, listen: false).user.openid,
|
|
|
|
"kid": remark.id,
|
|
...
|
...
|
@@ -115,14 +119,15 @@ class RemarkManagerPageState extends State<RemarkManagerPage> { |
|
|
|
ScreenUtil().setWidth(30),
|
|
|
|
color: MyColours.color_6AB6B9,
|
|
|
|
),
|
|
|
|
GestureDetector(
|
|
|
|
InkWell(
|
|
|
|
onTap: () {
|
|
|
|
setState(() {
|
|
|
|
remark.oftenUse = "";
|
|
|
|
});
|
|
|
|
_delCustomRemark(remark);
|
|
|
|
},
|
|
|
|
child: Padding(
|
|
|
|
child: Container(
|
|
|
|
// color: Colors.transparent,
|
|
|
|
padding: EdgeInsets.all(ScreenUtil().setWidth(10)),
|
|
|
|
child: Image.asset(
|
|
|
|
"assets/icon_remark_del.png",
|
|
...
|
...
|
@@ -231,14 +236,11 @@ class RemarkManagerPageState extends State<RemarkManagerPage> { |
|
|
|
))
|
|
|
|
: GestureDetector(
|
|
|
|
onTap: () {
|
|
|
|
if (remarkManagerModel.remarks.length >= 20) {
|
|
|
|
Utils.showToast("最多添加20个备注");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (alwaysCount >= 10) {
|
|
|
|
Utils.showToast("最多添加10个常用备注");
|
|
|
|
if (remarkManagerModel.remarks.length >= 30) {
|
|
|
|
Utils.showToast("最多添加30个备注");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
setState(() {
|
|
|
|
isAdding = true;
|
|
|
|
});
|
|
...
|
...
|
@@ -276,9 +278,10 @@ class RemarkManagerPageState extends State<RemarkManagerPage> { |
|
|
|
));
|
|
|
|
return alls;
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
void dispose() {
|
|
|
|
EventBus().emit('changeStatusColor');
|
|
|
|
EventBus().emit('changeStatusColor');
|
|
|
|
// TODO: implement dispose
|
|
|
|
super.dispose();
|
|
|
|
}
|
|
...
|
...
|
@@ -288,101 +291,99 @@ class RemarkManagerPageState extends State<RemarkManagerPage> { |
|
|
|
// TODO: implement build
|
|
|
|
remarkManagerModel =
|
|
|
|
Provider.of<RemarkManagerModel>(context, listen: false);
|
|
|
|
return Scaffold(
|
|
|
|
backgroundColor: MyColours.color_ffffff,
|
|
|
|
appBar: SystemAppBar(
|
|
|
|
'常用备注管理',
|
|
|
|
onTap: () {
|
|
|
|
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
},
|
|
|
|
),
|
|
|
|
body: SafeArea(
|
|
|
|
child: Consumer<RemarkManagerModel>(
|
|
|
|
builder: (context, model, _) {
|
|
|
|
if (model.pageState != PageState.Success) {
|
|
|
|
return ExceptionPage(
|
|
|
|
pageState: model.pageState,
|
|
|
|
callback: () {
|
|
|
|
_getRemarks(showPageLoading: true);
|
|
|
|
},
|
|
|
|
emptyMsg: "暂时没有备注哦",
|
|
|
|
emptyImg: "empty_search",
|
|
|
|
showMsg: "加载中,请稍后...",
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
return Container(
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal: ScreenUtil().setWidth(40)),
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
return Scaffold(
|
|
|
|
backgroundColor: MyColours.color_ffffff,
|
|
|
|
appBar: SystemAppBar(
|
|
|
|
'常用备注管理',
|
|
|
|
onTap: () {
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
},
|
|
|
|
),
|
|
|
|
body: SafeArea(
|
|
|
|
child: Consumer<RemarkManagerModel>(
|
|
|
|
builder: (context, model, _) {
|
|
|
|
if (model.pageState != PageState.Success) {
|
|
|
|
return ExceptionPage(
|
|
|
|
pageState: model.pageState,
|
|
|
|
callback: () {
|
|
|
|
_getRemarks(showPageLoading: true);
|
|
|
|
},
|
|
|
|
emptyMsg: "暂时没有备注哦",
|
|
|
|
emptyImg: "empty_search",
|
|
|
|
showMsg: "加载中,请稍后...",
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
return Container(
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal: ScreenUtil().setWidth(40)),
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
VEmptyView(60),
|
|
|
|
Row(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
children: [
|
|
|
|
VEmptyView(60),
|
|
|
|
Row(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
"我的常用备注",
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_353535,
|
|
|
|
fontSize: ScreenUtil().setSp(30),
|
|
|
|
fontWeight: FontWeight.bold),
|
|
|
|
),
|
|
|
|
Text(
|
|
|
|
"(最多添加10个)",
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_666666,
|
|
|
|
fontSize: ScreenUtil().setSp(26)),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
Text(
|
|
|
|
"我的常用备注",
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_353535,
|
|
|
|
fontSize: ScreenUtil().setSp(30),
|
|
|
|
fontWeight: FontWeight.bold),
|
|
|
|
),
|
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
vertical: ScreenUtil().setWidth(40)),
|
|
|
|
child: Wrap(
|
|
|
|
spacing: ScreenUtil().setWidth(20),
|
|
|
|
runSpacing: ScreenUtil().setWidth(20),
|
|
|
|
children: _buildAlwayItems()),
|
|
|
|
Text(
|
|
|
|
"(最多添加10个)",
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_666666,
|
|
|
|
fontSize: ScreenUtil().setSp(26)),
|
|
|
|
),
|
|
|
|
MyDivider(
|
|
|
|
double.infinity,
|
|
|
|
ScreenUtil().setWidth(2),
|
|
|
|
color: MyColours.color_f3f3f3,
|
|
|
|
],
|
|
|
|
),
|
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
vertical: ScreenUtil().setWidth(40)),
|
|
|
|
child: Wrap(
|
|
|
|
spacing: ScreenUtil().setWidth(20),
|
|
|
|
runSpacing: ScreenUtil().setWidth(20),
|
|
|
|
children: _buildAlwayItems()),
|
|
|
|
),
|
|
|
|
MyDivider(
|
|
|
|
double.infinity,
|
|
|
|
ScreenUtil().setWidth(2),
|
|
|
|
color: MyColours.color_f3f3f3,
|
|
|
|
),
|
|
|
|
VEmptyView(40),
|
|
|
|
Row(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
"所有备注",
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_353535,
|
|
|
|
fontSize: ScreenUtil().setSp(30),
|
|
|
|
fontWeight: FontWeight.bold),
|
|
|
|
),
|
|
|
|
VEmptyView(40),
|
|
|
|
Row(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
"所有备注",
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_353535,
|
|
|
|
fontSize: ScreenUtil().setSp(30),
|
|
|
|
fontWeight: FontWeight.bold),
|
|
|
|
),
|
|
|
|
Text(
|
|
|
|
"(最多添加20个)",
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_666666,
|
|
|
|
fontSize: ScreenUtil().setSp(26)),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
Text(
|
|
|
|
"(最多添加30个)",
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_666666,
|
|
|
|
fontSize: ScreenUtil().setSp(26)),
|
|
|
|
),
|
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
vertical: ScreenUtil().setWidth(40)),
|
|
|
|
child: Wrap(
|
|
|
|
spacing: ScreenUtil().setWidth(20),
|
|
|
|
runSpacing: ScreenUtil().setWidth(20),
|
|
|
|
children: _buildAllItems()),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
),
|
|
|
|
))
|
|
|
|
;
|
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
vertical: ScreenUtil().setWidth(40)),
|
|
|
|
child: Wrap(
|
|
|
|
spacing: ScreenUtil().setWidth(20),
|
|
|
|
runSpacing: ScreenUtil().setWidth(20),
|
|
|
|
children: _buildAllItems()),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
),
|
|
|
|
));
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|