|
@@ -66,6 +66,10 @@ class RemarkManagerPageState extends State<RemarkManagerPage> { |
|
@@ -66,6 +66,10 @@ class RemarkManagerPageState extends State<RemarkManagerPage> { |
|
66
|
|
66
|
|
|
67
|
//添加常用备注
|
67
|
//添加常用备注
|
|
68
|
_addCustomRemark(Remark remark) {
|
68
|
_addCustomRemark(Remark remark) {
|
|
|
|
69
|
+ if (alwaysCount >= 10) {
|
|
|
|
70
|
+ Utils.showToast("最多添加10个常用备注");
|
|
|
|
71
|
+ return;
|
|
|
|
72
|
+ }
|
|
69
|
Map<String, String> params = {
|
73
|
Map<String, String> params = {
|
|
70
|
"uid": Provider.of<UserModel>(context, listen: false).user.openid,
|
74
|
"uid": Provider.of<UserModel>(context, listen: false).user.openid,
|
|
71
|
"kid": remark.id,
|
75
|
"kid": remark.id,
|
|
@@ -115,14 +119,15 @@ class RemarkManagerPageState extends State<RemarkManagerPage> { |
|
@@ -115,14 +119,15 @@ class RemarkManagerPageState extends State<RemarkManagerPage> { |
|
115
|
ScreenUtil().setWidth(30),
|
119
|
ScreenUtil().setWidth(30),
|
|
116
|
color: MyColours.color_6AB6B9,
|
120
|
color: MyColours.color_6AB6B9,
|
|
117
|
),
|
121
|
),
|
|
118
|
- GestureDetector(
|
122
|
+ InkWell(
|
|
119
|
onTap: () {
|
123
|
onTap: () {
|
|
120
|
setState(() {
|
124
|
setState(() {
|
|
121
|
remark.oftenUse = "";
|
125
|
remark.oftenUse = "";
|
|
122
|
});
|
126
|
});
|
|
123
|
_delCustomRemark(remark);
|
127
|
_delCustomRemark(remark);
|
|
124
|
},
|
128
|
},
|
|
125
|
- child: Padding(
|
129
|
+ child: Container(
|
|
|
|
130
|
+ // color: Colors.transparent,
|
|
126
|
padding: EdgeInsets.all(ScreenUtil().setWidth(10)),
|
131
|
padding: EdgeInsets.all(ScreenUtil().setWidth(10)),
|
|
127
|
child: Image.asset(
|
132
|
child: Image.asset(
|
|
128
|
"assets/icon_remark_del.png",
|
133
|
"assets/icon_remark_del.png",
|
|
@@ -231,14 +236,11 @@ class RemarkManagerPageState extends State<RemarkManagerPage> { |
|
@@ -231,14 +236,11 @@ class RemarkManagerPageState extends State<RemarkManagerPage> { |
|
231
|
))
|
236
|
))
|
|
232
|
: GestureDetector(
|
237
|
: GestureDetector(
|
|
233
|
onTap: () {
|
238
|
onTap: () {
|
|
234
|
- if (remarkManagerModel.remarks.length >= 20) {
|
|
|
|
235
|
- Utils.showToast("最多添加20个备注");
|
|
|
|
236
|
- return;
|
|
|
|
237
|
- }
|
|
|
|
238
|
- if (alwaysCount >= 10) {
|
|
|
|
239
|
- Utils.showToast("最多添加10个常用备注");
|
239
|
+ if (remarkManagerModel.remarks.length >= 30) {
|
|
|
|
240
|
+ Utils.showToast("最多添加30个备注");
|
|
240
|
return;
|
241
|
return;
|
|
241
|
}
|
242
|
}
|
|
|
|
243
|
+
|
|
242
|
setState(() {
|
244
|
setState(() {
|
|
243
|
isAdding = true;
|
245
|
isAdding = true;
|
|
244
|
});
|
246
|
});
|
|
@@ -276,9 +278,10 @@ class RemarkManagerPageState extends State<RemarkManagerPage> { |
|
@@ -276,9 +278,10 @@ class RemarkManagerPageState extends State<RemarkManagerPage> { |
|
276
|
));
|
278
|
));
|
|
277
|
return alls;
|
279
|
return alls;
|
|
278
|
}
|
280
|
}
|
|
|
|
281
|
+
|
|
279
|
@override
|
282
|
@override
|
|
280
|
void dispose() {
|
283
|
void dispose() {
|
|
281
|
- EventBus().emit('changeStatusColor');
|
284
|
+ EventBus().emit('changeStatusColor');
|
|
282
|
// TODO: implement dispose
|
285
|
// TODO: implement dispose
|
|
283
|
super.dispose();
|
286
|
super.dispose();
|
|
284
|
}
|
287
|
}
|
|
@@ -288,101 +291,99 @@ class RemarkManagerPageState extends State<RemarkManagerPage> { |
|
@@ -288,101 +291,99 @@ class RemarkManagerPageState extends State<RemarkManagerPage> { |
|
288
|
// TODO: implement build
|
291
|
// TODO: implement build
|
|
289
|
remarkManagerModel =
|
292
|
remarkManagerModel =
|
|
290
|
Provider.of<RemarkManagerModel>(context, listen: false);
|
293
|
Provider.of<RemarkManagerModel>(context, listen: false);
|
|
291
|
- return Scaffold(
|
|
|
|
292
|
- backgroundColor: MyColours.color_ffffff,
|
|
|
|
293
|
- appBar: SystemAppBar(
|
|
|
|
294
|
- '常用备注管理',
|
|
|
|
295
|
- onTap: () {
|
|
|
|
296
|
-
|
|
|
|
297
|
- Navigator.of(context).pop();
|
|
|
|
298
|
- },
|
|
|
|
299
|
- ),
|
|
|
|
300
|
- body: SafeArea(
|
|
|
|
301
|
- child: Consumer<RemarkManagerModel>(
|
|
|
|
302
|
- builder: (context, model, _) {
|
|
|
|
303
|
- if (model.pageState != PageState.Success) {
|
|
|
|
304
|
- return ExceptionPage(
|
|
|
|
305
|
- pageState: model.pageState,
|
|
|
|
306
|
- callback: () {
|
|
|
|
307
|
- _getRemarks(showPageLoading: true);
|
|
|
|
308
|
- },
|
|
|
|
309
|
- emptyMsg: "暂时没有备注哦",
|
|
|
|
310
|
- emptyImg: "empty_search",
|
|
|
|
311
|
- showMsg: "加载中,请稍后...",
|
|
|
|
312
|
- );
|
|
|
|
313
|
- } else {
|
|
|
|
314
|
- return Container(
|
|
|
|
315
|
- padding: EdgeInsets.symmetric(
|
|
|
|
316
|
- horizontal: ScreenUtil().setWidth(40)),
|
|
|
|
317
|
- child: Column(
|
|
|
|
318
|
- crossAxisAlignment: CrossAxisAlignment.start,
|
294
|
+ return Scaffold(
|
|
|
|
295
|
+ backgroundColor: MyColours.color_ffffff,
|
|
|
|
296
|
+ appBar: SystemAppBar(
|
|
|
|
297
|
+ '常用备注管理',
|
|
|
|
298
|
+ onTap: () {
|
|
|
|
299
|
+ Navigator.of(context).pop();
|
|
|
|
300
|
+ },
|
|
|
|
301
|
+ ),
|
|
|
|
302
|
+ body: SafeArea(
|
|
|
|
303
|
+ child: Consumer<RemarkManagerModel>(
|
|
|
|
304
|
+ builder: (context, model, _) {
|
|
|
|
305
|
+ if (model.pageState != PageState.Success) {
|
|
|
|
306
|
+ return ExceptionPage(
|
|
|
|
307
|
+ pageState: model.pageState,
|
|
|
|
308
|
+ callback: () {
|
|
|
|
309
|
+ _getRemarks(showPageLoading: true);
|
|
|
|
310
|
+ },
|
|
|
|
311
|
+ emptyMsg: "暂时没有备注哦",
|
|
|
|
312
|
+ emptyImg: "empty_search",
|
|
|
|
313
|
+ showMsg: "加载中,请稍后...",
|
|
|
|
314
|
+ );
|
|
|
|
315
|
+ } else {
|
|
|
|
316
|
+ return Container(
|
|
|
|
317
|
+ padding: EdgeInsets.symmetric(
|
|
|
|
318
|
+ horizontal: ScreenUtil().setWidth(40)),
|
|
|
|
319
|
+ child: Column(
|
|
|
|
320
|
+ crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
321
|
+ children: [
|
|
|
|
322
|
+ VEmptyView(60),
|
|
|
|
323
|
+ Row(
|
|
|
|
324
|
+ crossAxisAlignment: CrossAxisAlignment.end,
|
|
319
|
children: [
|
325
|
children: [
|
|
320
|
- VEmptyView(60),
|
|
|
|
321
|
- Row(
|
|
|
|
322
|
- crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
323
|
- children: [
|
|
|
|
324
|
- Text(
|
|
|
|
325
|
- "我的常用备注",
|
|
|
|
326
|
- style: TextStyle(
|
|
|
|
327
|
- color: MyColours.color_353535,
|
|
|
|
328
|
- fontSize: ScreenUtil().setSp(30),
|
|
|
|
329
|
- fontWeight: FontWeight.bold),
|
|
|
|
330
|
- ),
|
|
|
|
331
|
- Text(
|
|
|
|
332
|
- "(最多添加10个)",
|
|
|
|
333
|
- style: TextStyle(
|
|
|
|
334
|
- color: MyColours.color_666666,
|
|
|
|
335
|
- fontSize: ScreenUtil().setSp(26)),
|
|
|
|
336
|
- ),
|
|
|
|
337
|
- ],
|
326
|
+ Text(
|
|
|
|
327
|
+ "我的常用备注",
|
|
|
|
328
|
+ style: TextStyle(
|
|
|
|
329
|
+ color: MyColours.color_353535,
|
|
|
|
330
|
+ fontSize: ScreenUtil().setSp(30),
|
|
|
|
331
|
+ fontWeight: FontWeight.bold),
|
|
338
|
),
|
332
|
),
|
|
339
|
- Padding(
|
|
|
|
340
|
- padding: EdgeInsets.symmetric(
|
|
|
|
341
|
- vertical: ScreenUtil().setWidth(40)),
|
|
|
|
342
|
- child: Wrap(
|
|
|
|
343
|
- spacing: ScreenUtil().setWidth(20),
|
|
|
|
344
|
- runSpacing: ScreenUtil().setWidth(20),
|
|
|
|
345
|
- children: _buildAlwayItems()),
|
333
|
+ Text(
|
|
|
|
334
|
+ "(最多添加10个)",
|
|
|
|
335
|
+ style: TextStyle(
|
|
|
|
336
|
+ color: MyColours.color_666666,
|
|
|
|
337
|
+ fontSize: ScreenUtil().setSp(26)),
|
|
346
|
),
|
338
|
),
|
|
347
|
- MyDivider(
|
|
|
|
348
|
- double.infinity,
|
|
|
|
349
|
- ScreenUtil().setWidth(2),
|
|
|
|
350
|
- color: MyColours.color_f3f3f3,
|
339
|
+ ],
|
|
|
|
340
|
+ ),
|
|
|
|
341
|
+ Padding(
|
|
|
|
342
|
+ padding: EdgeInsets.symmetric(
|
|
|
|
343
|
+ vertical: ScreenUtil().setWidth(40)),
|
|
|
|
344
|
+ child: Wrap(
|
|
|
|
345
|
+ spacing: ScreenUtil().setWidth(20),
|
|
|
|
346
|
+ runSpacing: ScreenUtil().setWidth(20),
|
|
|
|
347
|
+ children: _buildAlwayItems()),
|
|
|
|
348
|
+ ),
|
|
|
|
349
|
+ MyDivider(
|
|
|
|
350
|
+ double.infinity,
|
|
|
|
351
|
+ ScreenUtil().setWidth(2),
|
|
|
|
352
|
+ color: MyColours.color_f3f3f3,
|
|
|
|
353
|
+ ),
|
|
|
|
354
|
+ VEmptyView(40),
|
|
|
|
355
|
+ Row(
|
|
|
|
356
|
+ crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
357
|
+ children: [
|
|
|
|
358
|
+ Text(
|
|
|
|
359
|
+ "所有备注",
|
|
|
|
360
|
+ style: TextStyle(
|
|
|
|
361
|
+ color: MyColours.color_353535,
|
|
|
|
362
|
+ fontSize: ScreenUtil().setSp(30),
|
|
|
|
363
|
+ fontWeight: FontWeight.bold),
|
|
351
|
),
|
364
|
),
|
|
352
|
- VEmptyView(40),
|
|
|
|
353
|
- Row(
|
|
|
|
354
|
- crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
355
|
- children: [
|
|
|
|
356
|
- Text(
|
|
|
|
357
|
- "所有备注",
|
|
|
|
358
|
- style: TextStyle(
|
|
|
|
359
|
- color: MyColours.color_353535,
|
|
|
|
360
|
- fontSize: ScreenUtil().setSp(30),
|
|
|
|
361
|
- fontWeight: FontWeight.bold),
|
|
|
|
362
|
- ),
|
|
|
|
363
|
- Text(
|
|
|
|
364
|
- "(最多添加20个)",
|
|
|
|
365
|
- style: TextStyle(
|
|
|
|
366
|
- color: MyColours.color_666666,
|
|
|
|
367
|
- fontSize: ScreenUtil().setSp(26)),
|
|
|
|
368
|
- ),
|
|
|
|
369
|
- ],
|
365
|
+ Text(
|
|
|
|
366
|
+ "(最多添加30个)",
|
|
|
|
367
|
+ style: TextStyle(
|
|
|
|
368
|
+ color: MyColours.color_666666,
|
|
|
|
369
|
+ fontSize: ScreenUtil().setSp(26)),
|
|
370
|
),
|
370
|
),
|
|
371
|
- Padding(
|
|
|
|
372
|
- padding: EdgeInsets.symmetric(
|
|
|
|
373
|
- vertical: ScreenUtil().setWidth(40)),
|
|
|
|
374
|
- child: Wrap(
|
|
|
|
375
|
- spacing: ScreenUtil().setWidth(20),
|
|
|
|
376
|
- runSpacing: ScreenUtil().setWidth(20),
|
|
|
|
377
|
- children: _buildAllItems()),
|
|
|
|
378
|
- )
|
|
|
|
379
|
],
|
371
|
],
|
|
380
|
),
|
372
|
),
|
|
381
|
- );
|
|
|
|
382
|
- }
|
|
|
|
383
|
- },
|
|
|
|
384
|
- ),
|
|
|
|
385
|
- ))
|
|
|
|
386
|
- ;
|
373
|
+ Padding(
|
|
|
|
374
|
+ padding: EdgeInsets.symmetric(
|
|
|
|
375
|
+ vertical: ScreenUtil().setWidth(40)),
|
|
|
|
376
|
+ child: Wrap(
|
|
|
|
377
|
+ spacing: ScreenUtil().setWidth(20),
|
|
|
|
378
|
+ runSpacing: ScreenUtil().setWidth(20),
|
|
|
|
379
|
+ children: _buildAllItems()),
|
|
|
|
380
|
+ )
|
|
|
|
381
|
+ ],
|
|
|
|
382
|
+ ),
|
|
|
|
383
|
+ );
|
|
|
|
384
|
+ }
|
|
|
|
385
|
+ },
|
|
|
|
386
|
+ ),
|
|
|
|
387
|
+ ));
|
|
387
|
}
|
388
|
}
|
|
388
|
} |
389
|
} |