Commit 3cf97eb07b0e6fd075a8dc2ce50eee297e15ab4a

Authored by “gaiyaguang”
1 parent 4d61b2c8

快速备注

... ... @@ -104,233 +104,283 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver {
Widget build(BuildContext context) {
myModel = Provider.of<MyModel>(context, listen: true);
return Scaffold(
appBar: AppBar(
backgroundColor: MyColours.color_199095, //把appbar的背景色改成透明
elevation: 0, //appbar的阴影
centerTitle: true, // 标题居中
title: Text(
'我的',
style: TextStyle(
color: MyColours.color_fefefe,
fontSize: ScreenUtil().setSp(34),
fontWeight: FontWeight.normal,
decoration: TextDecoration.none),
)),
body: Consumer<UserModel>(
builder: (BuildContext context, UserModel model, Widget child) {
return MediaQuery.removePadding(
context: context,
child: SingleChildScrollView(
child: Column(
children: <Widget>[
Stack(
children: [
Container(
width: double.infinity,
height: ScreenUtil().setHeight(200),
alignment: Alignment.centerLeft,
color: MyColours.color_199095,
),
Padding(
padding:
EdgeInsets.only(left: ScreenUtil().setWidth(40)),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
VEmptyView(38),
Text(
model.user.sellername,
style: TextStyle(
color: MyColours.color_ffffff,
fontSize: ScreenUtil().setSp(36)),
),
VEmptyView(38),
Text(
model.user.account +
" | " +
model.user.role_name,
style: TextStyle(
color: MyColours.color_ffffff,
fontSize: ScreenUtil().setSp(30)),
),
],
))
],
),
VEmptyView(40),
MyItem(
title: "短信管理",
content: myModel.smsInfo.isNotEmpty
? '剩余${myModel.smsInfo}条'
: '',
callback: () {
Utils.goMiniProgramZm(context, "setting/sms");
},
),
MyDivider(
double.infinity,
ScreenUtil().setHeight(1),
color: MyColours.color_f3f3f3,
),
MyItem(
title: "包间类型置满管理",
content: "",
callback: () {
Utils.goMiniProgramZm(context, "roomtype/roomtype");
},
),
MyDivider(
double.infinity,
ScreenUtil().setHeight(1),
color: MyColours.color_f3f3f3,
),
MyItem(
title: "可订时段管理",
content: "",
callback: () {
NavigatorUtil.goBookTimeSetPage(context);
},
),
MyDivider(
double.infinity,
ScreenUtil().setHeight(1),
color: MyColours.color_f3f3f3,
),
MyItem(
title: "接单时间管理",
content: "",
callback: () {
NavigatorUtil.goReceiveOrdersTimeSetPage(context);
},
),
MyDivider(
double.infinity,
ScreenUtil().setHeight(1),
color: MyColours.color_f3f3f3,
),
MyItem(
title: "常用备注管理",
content: "",
callback: () {
NavigatorUtil.goRemarkManagerPage(context);
},
),
VEmptyView(40),
MyItem(
title: "联系客服",
content: "09:00~21:00",
callback: () {
Utils.goPhone("400-000-9690");
},
),
MyDivider(
double.infinity,
ScreenUtil().setHeight(1),
color: MyColours.color_f3f3f3,
),
MyItem(
title: "帮助与反馈",
content: "",
callback: () {
Utils.goHelp(context);
},
),
MyDivider(double.infinity, ScreenUtil().setHeight(1),
color: MyColours.color_f3f3f3),
GestureDetector(
onTap: checkUpdate,
child: Container(
appBar: AppBar(
backgroundColor: MyColours.color_199095, //把appbar的背景色改成透明
elevation: 0, //appbar的阴影
centerTitle: true, // 标题居中
title: Text(
'我的',
style: TextStyle(
color: MyColours.color_fefefe,
fontSize: ScreenUtil().setSp(34),
fontWeight: FontWeight.normal,
decoration: TextDecoration.none),
)),
body: NestedScrollView(
// controller: _scrollViewController,
headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) {
return <Widget>[
SliverAppBar(
pinned: false,
floating: false,
expandedHeight: ScreenUtil().setWidth(200),
flexibleSpace: FlexibleSpaceBar(
collapseMode: CollapseMode.pin,
background: Consumer<UserModel>(builder:
(BuildContext context, UserModel model, Widget child) {
return Stack(
children: [
Container(
width: double.infinity,
height: ScreenUtil().setHeight(122),
color: MyColours.color_ffffff,
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(40)),
alignment: Alignment.center,
child: Row(
children: <Widget>[
Text(
"版本更新",
style: TextStyle(
fontSize: ScreenUtil().setSp(30),
color: MyColours.color_353535),
),
Spacer(),
newVersion
? Container(
width: ScreenUtil().setWidth(120),
height: ScreenUtil().setWidth(34),
decoration: BoxDecoration(
color: MyColours.color_E14553,
borderRadius: BorderRadius.all(
Radius.circular(
ScreenUtil().setWidth(6))),
),
child: Center(
child: Text(
"发现新版本",
style: TextStyle(
fontSize: ScreenUtil().setSp(24),
color: MyColours.color_ffffff),
),
height: ScreenUtil().setHeight(200),
alignment: Alignment.centerLeft,
color: MyColours.color_199095,
),
Padding(
padding:
EdgeInsets.only(left: ScreenUtil().setWidth(40)),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
VEmptyView(38),
Text(
model.user.sellername,
style: TextStyle(
color: MyColours.color_ffffff,
fontSize: ScreenUtil().setSp(36)),
),
VEmptyView(38),
Text(
model.user.account +
" | " +
model.user.role_name,
style: TextStyle(
color: MyColours.color_ffffff,
fontSize: ScreenUtil().setSp(30)),
),
],
))
],
);
}),
),
)
];
}, body: Consumer<UserModel>(
builder: (BuildContext context, UserModel model, Widget child) {
return MediaQuery.removePadding(
context: context,
child: SingleChildScrollView(
child: Column(
children: <Widget>[
// Stack(
// children: [
// Container(
// width: double.infinity,
// height: ScreenUtil().setHeight(200),
// alignment: Alignment.centerLeft,
// color: MyColours.color_199095,
// ),
// Padding(
// padding:
// EdgeInsets.only(left: ScreenUtil().setWidth(40)),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// VEmptyView(38),
// Text(
// model.user.sellername,
// style: TextStyle(
// color: MyColours.color_ffffff,
// fontSize: ScreenUtil().setSp(36)),
// ),
// VEmptyView(38),
// Text(
// model.user.account +
// " | " +
// model.user.role_name,
// style: TextStyle(
// color: MyColours.color_ffffff,
// fontSize: ScreenUtil().setSp(30)),
// ),
// ],
// ))
// ],
// ),
VEmptyView(40),
MyItem(
title: "短信管理",
content:
myModel.smsInfo.isNotEmpty ? '剩余${myModel.smsInfo}条' : '',
callback: () {
Utils.goMiniProgramZm(context, "setting/sms");
},
),
MyDivider(
double.infinity,
ScreenUtil().setHeight(1),
color: MyColours.color_f3f3f3,
),
MyItem(
title: "包间类型置满管理",
content: "",
callback: () {
Utils.goMiniProgramZm(context, "roomtype/roomtype");
},
),
MyDivider(
double.infinity,
ScreenUtil().setHeight(1),
color: MyColours.color_f3f3f3,
),
MyItem(
title: "可订时段管理",
content: "",
callback: () {
NavigatorUtil.goBookTimeSetPage(context);
},
),
MyDivider(
double.infinity,
ScreenUtil().setHeight(1),
color: MyColours.color_f3f3f3,
),
MyItem(
title: "接单时间管理",
content: "",
callback: () {
NavigatorUtil.goReceiveOrdersTimeSetPage(context);
},
),
MyDivider(
double.infinity,
ScreenUtil().setHeight(1),
color: MyColours.color_f3f3f3,
),
MyItem(
title: "常用备注管理",
content: "",
callback: () {
NavigatorUtil.goRemarkManagerPage(context);
},
),
VEmptyView(40),
MyItem(
title: "联系客服",
content: "09:00~21:00",
callback: () {
Utils.goPhone("400-000-9690");
},
),
MyDivider(
double.infinity,
ScreenUtil().setHeight(1),
color: MyColours.color_f3f3f3,
),
MyItem(
title: "帮助与反馈",
content: "",
callback: () {
Utils.goHelp(context);
},
),
MyDivider(double.infinity, ScreenUtil().setHeight(1),
color: MyColours.color_f3f3f3),
GestureDetector(
onTap: checkUpdate,
child: Container(
width: double.infinity,
height: ScreenUtil().setHeight(122),
color: MyColours.color_ffffff,
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(40)),
alignment: Alignment.center,
child: Row(
children: <Widget>[
Text(
"版本更新",
style: TextStyle(
fontSize: ScreenUtil().setSp(30),
color: MyColours.color_353535),
),
Spacer(),
newVersion
? Container(
width: ScreenUtil().setWidth(120),
height: ScreenUtil().setWidth(34),
decoration: BoxDecoration(
color: MyColours.color_E14553,
borderRadius: BorderRadius.all(
Radius.circular(
ScreenUtil().setWidth(6))),
),
child: Center(
child: Text(
"发现新版本",
style: TextStyle(
fontSize: ScreenUtil().setSp(24),
color: MyColours.color_ffffff),
),
)
: Text(
cur_version,
style: TextStyle(
fontSize: ScreenUtil().setSp(28),
color: MyColours.color_666666),
),
HEmptyView(20),
Image.asset(
"assets/arr_right_gray.png",
width: ScreenUtil().setWidth(14),
height: ScreenUtil().setWidth(22),
)
],
),
)
: Text(
cur_version,
style: TextStyle(
fontSize: ScreenUtil().setSp(28),
color: MyColours.color_666666),
),
HEmptyView(20),
Image.asset(
"assets/arr_right_gray.png",
width: ScreenUtil().setWidth(14),
height: ScreenUtil().setWidth(22),
)
],
),
),
MyDivider(
double.infinity,
ScreenUtil().setHeight(1),
color: MyColours.color_f3f3f3,
),
VEmptyView(40),
Consumer<UserModel>(
builder:
(BuildContext context, UserModel model, Widget child) {
return GestureDetector(
onTap: () {
model.showLoginOutDialog(context);
},
child: Container(
height: ScreenUtil().setHeight(122),
color: MyColours.color_ffffff,
child: Center(
child: Row(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Image.asset(
"assets/icon_exist.png",
width: ScreenUtil().setWidth(30),
height: ScreenUtil().setWidth(30),
),
HEmptyView(18),
Text("退出登录",
style: TextStyle(
color: MyColours.color_199095,
fontSize: ScreenUtil().setSp(34),
))
],
),
),
MyDivider(
double.infinity,
ScreenUtil().setHeight(1),
color: MyColours.color_f3f3f3,
),
VEmptyView(40),
Consumer<UserModel>(
builder:
(BuildContext context, UserModel model, Widget child) {
return GestureDetector(
onTap: () {
model.showLoginOutDialog(context);
},
child: Container(
height: ScreenUtil().setHeight(122),
color: MyColours.color_ffffff,
child: Center(
child: Row(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Image.asset(
"assets/icon_exist.png",
width: ScreenUtil().setWidth(30),
height: ScreenUtil().setWidth(30),
),
HEmptyView(18),
Text("退出登录",
style: TextStyle(
color: MyColours.color_199095,
fontSize: ScreenUtil().setSp(34),
))
],
),
),
);
},
)
],
)));
}));
),
);
},
)
],
)));
})),
);
}
}
... ...
... ... @@ -6,6 +6,7 @@ import 'package:one_key/models/remark.dart';
import 'package:one_key/provider/remark_manager_model.dart';
import 'package:one_key/provider/user_model.dart';
import 'package:one_key/res/colors.dart';
import 'package:one_key/utils/event_bus.dart';
import 'package:one_key/utils/utils.dart';
import 'package:one_key/widgets/MyDivider.dart';
import 'package:one_key/widgets/h_empty_view.dart';
... ... @@ -281,99 +282,105 @@ 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,
children: [
VEmptyView(60),
Row(
crossAxisAlignment: CrossAxisAlignment.end,
return WillPopScope(
child: Scaffold(
backgroundColor: MyColours.color_ffffff,
appBar: SystemAppBar(
'常用备注管理',
onTap: () {
EventBus().emit('changeStatusColor');
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: [
Text(
"我的常用备注",
style: TextStyle(
color: MyColours.color_353535,
fontSize: ScreenUtil().setSp(30),
fontWeight: FontWeight.bold),
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(
"(最多添加10个)",
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: _buildAlwayItems()),
),
],
),
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),
MyDivider(
double.infinity,
ScreenUtil().setWidth(2),
color: MyColours.color_f3f3f3,
),
Text(
"(最多添加20个)",
style: TextStyle(
color: MyColours.color_666666,
fontSize: ScreenUtil().setSp(26)),
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)),
),
],
),
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()),
)
],
),
);
}
},
),
));
);
}
},
),
)),
onWillPop: () async {
EventBus().emit('changeStatusColor');
return true;
});
}
}
... ...
... ... @@ -21,6 +21,7 @@ import 'package:table_calendar/table_calendar.dart';
import 'package:one_key/models/table.dart' as t;
typedef CustomCallBack = void Function(Object object);
class DialogUtil {
//备注弹框
static showRemarkDialog(
... ... @@ -29,7 +30,7 @@ class DialogUtil {
return showModalBottomSheet(
context: context,
isScrollControlled: true,
isDismissible: false,
// isDismissible: false,
backgroundColor: Colors.transparent,
builder: (context) {
return StatefulBuilder(builder: (context, state) {
... ... @@ -45,15 +46,33 @@ class DialogUtil {
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
VEmptyView(40),
Center(
child: Text(
'更多标签',
style: TextStyle(
fontSize: ScreenUtil().setSp(32),
color: MyColours.color_353535,
),
softWrap: true,
textAlign: TextAlign.center,
InkWell(
onTap: () {
Navigator.pop(context);
},
child: Stack(
children: [
Center(
child: Text(
'更多标签',
style: TextStyle(
fontSize: ScreenUtil().setSp(32),
color: MyColours.color_353535,
),
softWrap: true,
textAlign: TextAlign.center,
),
),
Positioned(
top: ScreenUtil().setWidth(10),
right: ScreenUtil().setWidth(40),
child: Image.asset(
Utils.getImgPath('close1'),
width: ScreenUtil().setWidth(28),
height: ScreenUtil().setWidth(28),
),
)
],
),
),
VEmptyView(60),
... ... @@ -95,10 +114,10 @@ class DialogUtil {
return InkWell(
onTap: onPress,
child: Container(
height: ScreenUtil().setHeight(50),
height: ScreenUtil().setHeight(54),
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(20),
vertical: ScreenUtil().setWidth(12)),
vertical: ScreenUtil().setWidth(10)),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(ScreenUtil().setWidth(10)),
color: isSelect ? MyColours.color_199095 : MyColours.color_f5f5f5,
... ...