Commit 5f8c8d1a075f15d79a0d327939188c4e3eb63bd3

Authored by wdn127929
1 parent dc220a68

去掉willscope change color

Too many changes to show.

To preserve performance only 23 of 23+ files are displayed.

... ... @@ -33,9 +33,9 @@ if (flutterRoot == null) {
def flutterVersionCode = "501"
def flutterVersionCode = "500"
if (flutterVersionCode == null) {
flutterVersionCode = '501'
flutterVersionCode = '500'
}
... ... @@ -44,9 +44,9 @@ if (flutterVersionCode == null) {
def flutterVersionName = "5.0.1"
def flutterVersionName = "5.0.0"
if (flutterVersionName == null) {
flutterVersionName = '5.0.1'
flutterVersionName = '5.0.0'
}
... ...
... ... @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objectVersion = 50;
objects = {
/* Begin PBXBuildFile section */
... ... @@ -659,7 +659,7 @@
CURRENT_PROJECT_VERSION = 500;
DEVELOPMENT_TEAM = 8J59HM8B82;
ENABLE_BITCODE = NO;
FLUTTER_BUILD_MODE = release;
FLUTTER_BUILD_MODE = debug;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
... ...
... ... @@ -110,6 +110,11 @@ class _CouponPageState extends State<CouponPage> with TickerProviderStateMixin {
@override
void dispose() {
if (widget.needRefrsh) {
EventBus().emit('refresh_coupon_invitation');
} else {
EventBus().emit('changeStatusColor');
}
bus.off("refresh_coupon_list_f");
super.dispose();
}
... ... @@ -159,245 +164,227 @@ class _CouponPageState extends State<CouponPage> with TickerProviderStateMixin {
Widget build(BuildContext context) {
couponProvider = Provider.of<CouponProvider>(context, listen: true);
return Scaffold(
backgroundColor: MyColours.color_f3f3f3,
appBar: SystemAppBar(
'线上券',
onTap: () {
if (widget.needRefrsh) {
EventBus().emit('refresh_coupon_invitation');
} else {
EventBus().emit('changeStatusColor');
}
Navigator.of(context).pop();
},
rightImgName: 'scan.png',
onTapRight: () {
_scan();
},
),
body: WillPopScope(
onWillPop: () {
if (widget.needRefrsh) {
EventBus().emit('refresh_coupon_invitation');
} else {
EventBus().emit('changeStatusColor');
}
Navigator.of(context).pop();
},
child: Column(
children: <Widget>[
Container(
width: double.infinity,
height: ScreenUtil().setWidth(80),
color: MyColours.color_ffffff,
padding: EdgeInsets.only(bottom: ScreenUtil().setWidth(6)),
child: TabBar(
controller: tabController,
tabs: [
Tab(
text: "全部",
),
Tab(
text: "店铺优惠券",
),
Tab(
text: "我的优惠券",
),
Tab(
text: "核销记录",
)
],
indicatorColor: MyColours.color_438E93,
indicatorSize: TabBarIndicatorSize.label,
indicatorWeight: ScreenUtil().setWidth(4),
labelColor: MyColours.color_438E93,
unselectedLabelColor: MyColours.color_999999,
labelStyle: TextStyle(
color: MyColours.color_438E93,
fontSize: ScreenUtil().setSp(28),
fontWeight: FontWeight.bold),
unselectedLabelStyle: TextStyle(
color: MyColours.color_999999,
fontSize: ScreenUtil().setSp(24),
),
)),
VEmptyView(32),
Expanded(
child: TabBarView(
controller: tabController,
children: [
ChangeNotifierProvider<PersonnelProvider>(
create: (_) => PersonnelProvider(),
child: CouponSunPage(index: 0)),
ChangeNotifierProvider<PersonnelProvider>(
create: (_) => PersonnelProvider(),
child: CouponSunPage(index: 1)),
ChangeNotifierProvider<PersonnelProvider>(
create: (_) => PersonnelProvider(),
child: CouponSunPage(index: 2)),
ChangeNotifierProvider<PersonnelProvider>(
create: (_) => PersonnelProvider(),
child: CouponHasVerificationPage()),
],
),
),
if (tabController.index != 3)
Container(
height: ScreenUtil().setWidth(91 * 2),
width: double.infinity,
padding: EdgeInsets.only(
top: ScreenUtil().setWidth(16 * 2),
bottom: ScreenUtil().setWidth(35 * 2),
left: ScreenUtil().setWidth(45 * 2),
right: ScreenUtil().setWidth(45 * 2),
backgroundColor: MyColours.color_f3f3f3,
appBar: SystemAppBar(
'线上券',
rightImgName: 'scan.png',
onTapRight: () {
_scan();
},
),
body: Column(
children: <Widget>[
Container(
width: double.infinity,
height: ScreenUtil().setWidth(80),
color: MyColours.color_ffffff,
padding: EdgeInsets.only(bottom: ScreenUtil().setWidth(6)),
child: TabBar(
controller: tabController,
tabs: [
Tab(
text: "全部",
),
decoration: BoxDecoration(
color: MyColours.color_ffffff,
boxShadow: [
BoxShadow(
spreadRadius: ScreenUtil().setWidth(2),
color: Color.fromRGBO(0, 0, 0, 0.1),
offset: Offset(0, ScreenUtil().setWidth(-2)),
blurRadius: ScreenUtil().setWidth(8))
],
borderRadius: BorderRadius.all(
Radius.circular(ScreenUtil().setWidth(16)),
),
Tab(
text: "店铺优惠券",
),
child: RoundButton(
text: '创建新的优惠券',
height: ScreenUtil().setWidth(80),
radius: ScreenUtil().setWidth(14),
isBold: false,
fontSize: 28,
onPressed: () async {
// UserModel userModel =
// Provider.of<UserModel>(context, listen: false);
if (Utils.getAuthority(context, '创建新的优惠券')) {
NavigatorUtil.goCouponCreateSelectTypePage(context);
}
// if (userModel.user.role_name == '管理员' ||
// userModel.user.role_name == '店长') {
// NavigatorUtil.goCouponCreateSelectTypePage(context);
// }
else {
bool needRefresh =
await NavigatorUtil.goCouponEditPage(context);
print(needRefresh);
if (needRefresh != null && needRefresh) {
bus.emit('refresh_coupon_list_f');
//刷新页面数据
// _controller.callRefresh();
// _couponNetworkData(tabController.index);
}
}
},
Tab(
text: "我的优惠券",
),
)
],
Tab(
text: "核销记录",
)
],
indicatorColor: MyColours.color_438E93,
indicatorSize: TabBarIndicatorSize.label,
indicatorWeight: ScreenUtil().setWidth(4),
labelColor: MyColours.color_438E93,
unselectedLabelColor: MyColours.color_999999,
labelStyle: TextStyle(
color: MyColours.color_438E93,
fontSize: ScreenUtil().setSp(28),
fontWeight: FontWeight.bold),
unselectedLabelStyle: TextStyle(
color: MyColours.color_999999,
fontSize: ScreenUtil().setSp(24),
),
)),
VEmptyView(32),
Expanded(
child: TabBarView(
controller: tabController,
children: [
ChangeNotifierProvider<PersonnelProvider>(
create: (_) => PersonnelProvider(),
child: CouponSunPage(index: 0)),
ChangeNotifierProvider<PersonnelProvider>(
create: (_) => PersonnelProvider(),
child: CouponSunPage(index: 1)),
ChangeNotifierProvider<PersonnelProvider>(
create: (_) => PersonnelProvider(),
child: CouponSunPage(index: 2)),
ChangeNotifierProvider<PersonnelProvider>(
create: (_) => PersonnelProvider(),
child: CouponHasVerificationPage()),
],
),
),
// child: Column(
// children: [
// Expanded(child: Consumer<CouponProvider>(
// builder: (context, model, _) {
// if (model.pageState != PageState.Success) {
// return ExceptionPage(
// pageState: model.pageState,
// callback: () {
// // offset = 0;
// // getMessage(showLoading: true);
// _couponNetworkData();
// },
// emptyMsg: "暂时没有列表信息哦",
// emptyImg: "empty_search",
// showMsg: "加载中,请稍后...",
// );
// } else {
// return EasyRefresh.custom(
// controller: _controller,
// shrinkWrap: true,
// slivers: [
// SliverList(
// delegate: SliverChildBuilderDelegate(
// (BuildContext context, int index) {
// return Container(
// margin:
// EdgeInsets.all(ScreenUtil().setWidth(40)),
// padding:
// EdgeInsets.all(ScreenUtil().setWidth(30)),
// color: MyColours.color_F0F0F0,
// child: Text(
// '使用说明:需在结账前出示优惠券二维码,店内工作人员微信扫码核销。超过有效期的券,会自动作废并移出列表。优惠券不可找零、兑现。',
// style: TextStyle(
// color: MyColours.color_666666,
// fontSize: ScreenUtil().setSp(24),
// ),
// strutStyle: StrutStyle(
// forceStrutHeight: true,
// height: 1,
// leading: 0.3),
// ));
// }, childCount: 1),
// ),
// SliverList(
// delegate: SliverChildBuilderDelegate(
// (BuildContext context, int index) {
// return CouponItem(
// from: 'quan',
// couponSonModel:
// couponProvider.couponList[index],
// showBtn: true,
// onPressedSwich: () {
// couponProvider.couponList[index].isOpenBool =
// !couponProvider
// .couponList[index].isOpenBool;
// _setCustomerActivity(index);
// },
// onPressed: () {
// NavigatorUtil.goCouponDetailPage(context,
// couponProvider.couponList[index]);
// },
// );
// }, childCount: couponProvider.couponList.length),
// )
// ],
// // onRefresh: () async {
// // // offset = 0;
// // // getMessage(showLoading: false);
// // },
// // onLoad: () async {
// // // offset++;
// // // getMessage(showLoading: false);
// // },
// );
// }
// },
// )),
// VEmptyView(20),
// Padding(
// padding: EdgeInsets.fromLTRB(ScreenUtil().setWidth(40), 0,
// ScreenUtil().setWidth(40), ScreenUtil().setWidth(40)),
// child: RoundButton(
// onPressed: () async {
// bool needRefresh =
// await NavigatorUtil.goCouponEditPage(context);
// print(needRefresh);
// if (needRefresh != null && needRefresh) {
// //刷新页面数据
// // _controller.callRefresh();
// _couponNetworkData();
// }
// },
// text: '创建新券',
// fontSize: 34,
// isBold: false,
// height: ScreenUtil().setWidth(80),
// width: double.infinity,
// radius: ScreenUtil().setWidth(10),
// ))
// ],
// )
));
if (tabController.index != 3)
Container(
height: ScreenUtil().setWidth(91 * 2),
width: double.infinity,
padding: EdgeInsets.only(
top: ScreenUtil().setWidth(16 * 2),
bottom: ScreenUtil().setWidth(35 * 2),
left: ScreenUtil().setWidth(45 * 2),
right: ScreenUtil().setWidth(45 * 2),
),
decoration: BoxDecoration(
color: MyColours.color_ffffff,
boxShadow: [
BoxShadow(
spreadRadius: ScreenUtil().setWidth(2),
color: Color.fromRGBO(0, 0, 0, 0.1),
offset: Offset(0, ScreenUtil().setWidth(-2)),
blurRadius: ScreenUtil().setWidth(8))
],
borderRadius: BorderRadius.all(
Radius.circular(ScreenUtil().setWidth(16)),
),
),
child: RoundButton(
text: '创建新的优惠券',
height: ScreenUtil().setWidth(80),
radius: ScreenUtil().setWidth(14),
isBold: false,
fontSize: 28,
onPressed: () async {
// UserModel userModel =
// Provider.of<UserModel>(context, listen: false);
if (Utils.getAuthority(context, '创建新的优惠券')) {
NavigatorUtil.goCouponCreateSelectTypePage(context);
}
// if (userModel.user.role_name == '管理员' ||
// userModel.user.role_name == '店长') {
// NavigatorUtil.goCouponCreateSelectTypePage(context);
// }
else {
bool needRefresh =
await NavigatorUtil.goCouponEditPage(context);
print(needRefresh);
if (needRefresh != null && needRefresh) {
bus.emit('refresh_coupon_list_f');
//刷新页面数据
// _controller.callRefresh();
// _couponNetworkData(tabController.index);
}
}
},
),
)
],
),
// child: Column(
// children: [
// Expanded(child: Consumer<CouponProvider>(
// builder: (context, model, _) {
// if (model.pageState != PageState.Success) {
// return ExceptionPage(
// pageState: model.pageState,
// callback: () {
// // offset = 0;
// // getMessage(showLoading: true);
// _couponNetworkData();
// },
// emptyMsg: "暂时没有列表信息哦",
// emptyImg: "empty_search",
// showMsg: "加载中,请稍后...",
// );
// } else {
// return EasyRefresh.custom(
// controller: _controller,
// shrinkWrap: true,
// slivers: [
// SliverList(
// delegate: SliverChildBuilderDelegate(
// (BuildContext context, int index) {
// return Container(
// margin:
// EdgeInsets.all(ScreenUtil().setWidth(40)),
// padding:
// EdgeInsets.all(ScreenUtil().setWidth(30)),
// color: MyColours.color_F0F0F0,
// child: Text(
// '使用说明:需在结账前出示优惠券二维码,店内工作人员微信扫码核销。超过有效期的券,会自动作废并移出列表。优惠券不可找零、兑现。',
// style: TextStyle(
// color: MyColours.color_666666,
// fontSize: ScreenUtil().setSp(24),
// ),
// strutStyle: StrutStyle(
// forceStrutHeight: true,
// height: 1,
// leading: 0.3),
// ));
// }, childCount: 1),
// ),
// SliverList(
// delegate: SliverChildBuilderDelegate(
// (BuildContext context, int index) {
// return CouponItem(
// from: 'quan',
// couponSonModel:
// couponProvider.couponList[index],
// showBtn: true,
// onPressedSwich: () {
// couponProvider.couponList[index].isOpenBool =
// !couponProvider
// .couponList[index].isOpenBool;
// _setCustomerActivity(index);
// },
// onPressed: () {
// NavigatorUtil.goCouponDetailPage(context,
// couponProvider.couponList[index]);
// },
// );
// }, childCount: couponProvider.couponList.length),
// )
// ],
// // onRefresh: () async {
// // // offset = 0;
// // // getMessage(showLoading: false);
// // },
// // onLoad: () async {
// // // offset++;
// // // getMessage(showLoading: false);
// // },
// );
// }
// },
// )),
// VEmptyView(20),
// Padding(
// padding: EdgeInsets.fromLTRB(ScreenUtil().setWidth(40), 0,
// ScreenUtil().setWidth(40), ScreenUtil().setWidth(40)),
// child: RoundButton(
// onPressed: () async {
// bool needRefresh =
// await NavigatorUtil.goCouponEditPage(context);
// print(needRefresh);
// if (needRefresh != null && needRefresh) {
// //刷新页面数据
// // _controller.callRefresh();
// _couponNetworkData();
// }
// },
// text: '创建新券',
// fontSize: 34,
// isBold: false,
// height: ScreenUtil().setWidth(80),
// width: double.infinity,
// radius: ScreenUtil().setWidth(10),
// ))
// ],
// )
);
}
}
... ...
... ... @@ -65,6 +65,7 @@ class _CouponSelectPageState extends State<CouponSelectPage> {
@override
void dispose() {
// Utils.changeStatusColor(color: Colors.transparent);
super.dispose();
}
... ... @@ -79,7 +80,6 @@ class _CouponSelectPageState extends State<CouponSelectPage> {
leading: InkWell(
onTap: () {
Navigator.pop(context);
Utils.changeStatusColor(color: Colors.transparent);
},
child: Padding(
padding: EdgeInsets.symmetric(
... ... @@ -137,113 +137,112 @@ class _CouponSelectPageState extends State<CouponSelectPage> {
],
centerTitle: true, // 标题居中
),
body: WillPopScope(
child: Column(
children: [
Expanded(child: Consumer<CouponProvider>(
builder: (context, model, _) {
if (model.pageStateSelect != PageState.Success) {
return ExceptionPage(
pageState: model.pageStateSelect,
callback: () {
_couponNetworkData();
// offset = 0;
// getMessage(showLoading: true);
},
emptyMsg: "暂时没有列表信息哦",
emptyImg: "empty_search",
showMsg: "加载中,请稍后...",
);
} else {
return EasyRefresh.custom(
controller: _controller,
shrinkWrap: true,
slivers: [
SliverList(
delegate: SliverChildBuilderDelegate(
(BuildContext context, int index) {
return VEmptyView(40);
}, childCount: 1),
),
SliverList(
delegate: SliverChildBuilderDelegate(
(BuildContext context, int index) {
return InkWell(
onTap: () {
couponProvider.couponListSelect[index].isCheck =
!couponProvider
.couponListSelect[index].isCheck;
if (couponProvider
.couponListSelect[index].isCheck) {
couponProvider.addData(index);
} else {
couponProvider.cancelData(index);
}
couponProvider.getCheckValue();
},
// child: Row(
// children: [
// HEmptyView(30),
// !widget.hasModify
// ? Checkbox(
// value: couponProvider
// .couponListSelect[index].isCheck,
// checkColor: MyColours.color_ffffff,
// activeColor: MyColours.app_main,
// onChanged: (bool value) {},
// )
// : Container(),
// Image.asset(
// couponProvider.listData[index]['checked']
// ? 'assets/select.png'
// : 'assets/unselect.png',
// width: ScreenUtil().setWidth(44)),
child: CouponItem(
from: 'select',
showCheck: !widget.hasModify,
couponSonModel:
couponProvider.couponListSelect[index],
onPressed: () {
//改这里 ******8
if (!widget.hasModify) {
couponProvider
.couponListSelect[index].isCheck =
!couponProvider
.couponListSelect[index].isCheck;
if (couponProvider
.couponListSelect[index].isCheck) {
couponProvider.addData(index);
} else {
couponProvider.cancelData(index);
}
couponProvider.getCheckValue();
body: Column(
children: [
Expanded(child: Consumer<CouponProvider>(
builder: (context, model, _) {
if (model.pageStateSelect != PageState.Success) {
return ExceptionPage(
pageState: model.pageStateSelect,
callback: () {
_couponNetworkData();
// offset = 0;
// getMessage(showLoading: true);
},
emptyMsg: "暂时没有列表信息哦",
emptyImg: "empty_search",
showMsg: "加载中,请稍后...",
);
} else {
return EasyRefresh.custom(
controller: _controller,
shrinkWrap: true,
slivers: [
SliverList(
delegate: SliverChildBuilderDelegate(
(BuildContext context, int index) {
return VEmptyView(40);
}, childCount: 1),
),
SliverList(
delegate: SliverChildBuilderDelegate(
(BuildContext context, int index) {
return InkWell(
onTap: () {
couponProvider.couponListSelect[index].isCheck =
!couponProvider
.couponListSelect[index].isCheck;
if (couponProvider
.couponListSelect[index].isCheck) {
couponProvider.addData(index);
} else {
couponProvider.cancelData(index);
}
couponProvider.getCheckValue();
},
// child: Row(
// children: [
// HEmptyView(30),
// !widget.hasModify
// ? Checkbox(
// value: couponProvider
// .couponListSelect[index].isCheck,
// checkColor: MyColours.color_ffffff,
// activeColor: MyColours.app_main,
// onChanged: (bool value) {},
// )
// : Container(),
// Image.asset(
// couponProvider.listData[index]['checked']
// ? 'assets/select.png'
// : 'assets/unselect.png',
// width: ScreenUtil().setWidth(44)),
child: CouponItem(
from: 'select',
showCheck: !widget.hasModify,
couponSonModel:
couponProvider.couponListSelect[index],
onPressed: () {
//改这里 ******8
if (!widget.hasModify) {
couponProvider
.couponListSelect[index].isCheck =
!couponProvider
.couponListSelect[index].isCheck;
if (couponProvider
.couponListSelect[index].isCheck) {
couponProvider.addData(index);
} else {
couponProvider.cancelData(index);
}
}));
}, childCount: couponProvider.couponListSelect.length),
)
],
// onRefresh: () async {
// // offset = 0;
// // getMessage(showLoading: false);
// },
// onLoad: () async {
// // offset++;
// // getMessage(showLoading: false);
// },
);
}
},
)),
VEmptyView(20),
!widget.hasModify &&
couponProvider.pageStateSelect == PageState.Success
? Padding(
padding: EdgeInsets.fromLTRB(ScreenUtil().setWidth(40), 0,
ScreenUtil().setWidth(40), ScreenUtil().setWidth(40)),
child: RoundButton(
onPressed: () async {
if (widget.from == 'statistics') {
/*** 发版注释
couponProvider.getCheckValue();
}
}));
}, childCount: couponProvider.couponListSelect.length),
)
],
// onRefresh: () async {
// // offset = 0;
// // getMessage(showLoading: false);
// },
// onLoad: () async {
// // offset++;
// // getMessage(showLoading: false);
// },
);
}
},
)),
VEmptyView(20),
!widget.hasModify &&
couponProvider.pageStateSelect == PageState.Success
? Padding(
padding: EdgeInsets.fromLTRB(ScreenUtil().setWidth(40), 0,
ScreenUtil().setWidth(40), ScreenUtil().setWidth(40)),
child: RoundButton(
onPressed: () async {
if (widget.from == 'statistics') {
/*** 发版注释
DialogUtil.cupertinoAlertDialog(context,
title: '确认发送',
content: '是否确定为当前所选顾客发送该优惠券', lCallback: () {
... ... @@ -281,25 +280,19 @@ class _CouponSelectPageState extends State<CouponSelectPage> {
// await Sendsms.onSendSMS(phoneNumber, '短信内容');
});
*/
} else {
Navigator.pop(context);
}
},
text: '已选${couponProvider.coupons.length}个 确定',
fontSize: 34,
isBold: false,
height: ScreenUtil().setWidth(80),
width: double.infinity,
radius: ScreenUtil().setWidth(10),
))
: Container()
],
),
onWillPop: () async {
Utils.changeStatusColor(color: Colors.transparent);
Navigator.of(context).pop();
return true;
},
} else {
Navigator.pop(context);
}
},
text: '已选${couponProvider.coupons.length}个 确定',
fontSize: 34,
isBold: false,
height: ScreenUtil().setWidth(80),
width: double.infinity,
radius: ScreenUtil().setWidth(10),
))
: Container()
],
),
);
}
... ...
... ... @@ -26,6 +26,13 @@ class _EnterStoreNamePageState extends State<EnterStoreNamePage> {
}
@override
void dispose() {
// TODO: implement dispose
EventBus().emit('refresh_store_list');
super.dispose();
}
@override
Widget build(BuildContext context) {
CreateStoreModel createStoreModel =
Provider.of<CreateStoreModel>(context, listen: false);
... ... @@ -34,90 +41,85 @@ class _EnterStoreNamePageState extends State<EnterStoreNamePage> {
backgroundColor: Colors.white,
appBar: SystemAppBar(
'',
onTap: () {
EventBus().emit('refresh_store_list');
Navigator.pop(context);
},
// onTap: () {
// EventBus().emit('refresh_store_list');
// Navigator.pop(context);
// },
),
body: WillPopScope(
onWillPop: () {
EventBus().emit('refresh_store_list');
Navigator.of(context).pop();
body: InkWell(
onTap: () {
FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘
},
child: InkWell(
onTap: () {
FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘
},
child: Container(
color: Colors.white,
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(70),
vertical: ScreenUtil().setWidth(60)),
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('您的店铺名称是?',
style: TextStyle(
color: MyColours.color_333333,
fontSize: ScreenUtil().setSp(40),
fontWeight: FontWeight.bold)),
VEmptyView(100),
TextField(
controller: _controller,
// textAlignVertical: TextAlignVertical.bottom,
maxLines: 1,
// //光标颜色
// cursorColor:
// widget.isSelect ? Colors.white : MyColours.color_199095,
//输入文本的样式
style: TextStyle(
child: Container(
color: Colors.white,
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(70),
vertical: ScreenUtil().setWidth(60)),
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('您的店铺名称是?',
style: TextStyle(
color: MyColours.color_333333,
fontSize: ScreenUtil().setSp(28),
),
// focusNode: _codeNode,
decoration: InputDecoration(
contentPadding: EdgeInsets.symmetric(
vertical: ScreenUtil().setWidth(32),
horizontal: ScreenUtil().setWidth(40)),
border: OutlineInputBorder(),
hintText: '请输入店铺名称',
hintStyle: TextStyle(
color: MyColours.color_999999,
fontSize: ScreenUtil().setSp(28),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(
color: MyColours.color_bff6f7,
width: ScreenUtil().setWidth(2))),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(
color: MyColours.color_bff6f7,
width: ScreenUtil().setWidth(2))),
),
onChanged: (value) {
createStoreModel.storeInfo.name = value;
},
onEditingComplete: () {
FocusScope.of(context)
.requestFocus(FocusNode()); //点击空白处隐藏键盘
},
keyboardType: TextInputType.text,
fontSize: ScreenUtil().setSp(40),
fontWeight: FontWeight.bold)),
VEmptyView(100),
TextField(
controller: _controller,
// textAlignVertical: TextAlignVertical.bottom,
maxLines: 1,
// //光标颜色
// cursorColor:
// widget.isSelect ? Colors.white : MyColours.color_199095,
//输入文本的样式
style: TextStyle(
color: MyColours.color_333333,
fontSize: ScreenUtil().setSp(28),
),
// focusNode: _codeNode,
decoration: InputDecoration(
contentPadding: EdgeInsets.symmetric(
vertical: ScreenUtil().setWidth(32),
horizontal: ScreenUtil().setWidth(40)),
border: OutlineInputBorder(),
hintText: '请输入店铺名称',
hintStyle: TextStyle(
color: MyColours.color_999999,
fontSize: ScreenUtil().setSp(28),
),
VEmptyView(160),
RoundButton(
text: '下一步',
gradientStart: MyColours.color_199095,
gradientEnd: MyColours.color_199095,
// borderColor: MyColours.color_999999,
radius: ScreenUtil().setWidth(20),
fontSize: 28,
isBold: false,
onPressed: () {
NavigatorUtil.goEnterStoreAddressPage(context);
},
)
]))))));
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(
color: MyColours.color_bff6f7,
width: ScreenUtil().setWidth(2))),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(
color: MyColours.color_bff6f7,
width: ScreenUtil().setWidth(2))),
),
onChanged: (value) {
createStoreModel.storeInfo.name = value;
},
onEditingComplete: () {
FocusScope.of(context)
.requestFocus(FocusNode()); //点击空白处隐藏键盘
},
keyboardType: TextInputType.text,
),
VEmptyView(160),
RoundButton(
text: '下一步',
gradientStart: MyColours.color_199095,
gradientEnd: MyColours.color_199095,
// borderColor: MyColours.color_999999,
radius: ScreenUtil().setWidth(20),
fontSize: 28,
isBold: false,
onPressed: () {
NavigatorUtil.goEnterStoreAddressPage(context);
},
)
])))));
;
}
}
... ...
... ... @@ -90,7 +90,8 @@ class _FeastBoardItemState extends State<FeastBoardItem> {
onTap: () {
//点击进入宴会详情
NavigatorUtil.goFeastDetailPage(
context, boardSunModel.rid);
context, boardSunModel.rid,
needChange: false);
},
child: Row(
mainAxisSize: MainAxisSize.min,
... ...
... ... @@ -25,7 +25,10 @@ class FeastDetailPage extends StatefulWidget {
final String rid;
final bool canEdit;
FeastDetailPage({Key key, this.rid, this.canEdit = true}) : super(key: key);
final bool needChange;
FeastDetailPage(
{Key key, this.rid, this.canEdit = true, this.needChange = true})
: super(key: key);
@override
_FeastDetailPageState createState() => _FeastDetailPageState();
... ... @@ -56,7 +59,7 @@ class _FeastDetailPageState extends State<FeastDetailPage> {
void dispose() {
super.dispose();
bus.off('feast_detail_page');
if (!widget.canEdit) {
if (widget.needChange) {
Utils.changeStatusColor(color: MyColours.color_ffffff);
}
}
... ...
... ... @@ -858,7 +858,7 @@ class _FeastFollowUpPageState extends State<FeastFollowUpPage> {
return InkWell(
onTap: () {
//点击进入宴会详情
NavigatorUtil.goFeastDetailPage(context, data.id);
NavigatorUtil.goFeastDetailPage(context, data.id,needChange: false);
},
child: buildFeastTypeItem(data));
// '剑南春52度500ml', '1150元/份 不可议价'
... ...
... ... @@ -223,7 +223,7 @@ class _FeastPageState extends State<FeastPage> {
feastModel.banquetHome[index];
return InkWell(
onTap: () {
NavigatorUtil.goFeastDetailPage(context, sunModel.id);
NavigatorUtil.goFeastDetailPage(context, sunModel.id,needChange: true);
},
child: FeastItem(controller, sunModel));
},
... ...
... ... @@ -287,7 +287,7 @@ class InvicationPageState extends State<InvicationPage>
_getTablesPhoto();
});
Utils.changeStatusColor(color: Colors.transparent);
// Utils.changeStatusColor(color: Colors.transparent);
user = Provider.of<UserModel>(context, listen: false).user;
}
... ... @@ -1285,7 +1285,7 @@ class InvicationPageState extends State<InvicationPage>
_goBaseInfoPage() async {
bool needRefresh = await NavigatorUtil.goBaseInfoPage(
context, FromPage.FromPageInvicationPage);
Utils.changeStatusColor(color: Colors.transparent);
// Utils.changeStatusColor(color: Colors.transparent);
if (needRefresh != null && needRefresh) {
//刷新页面数据
_getCustomerActivityBaseinfo();
... ...
... ... @@ -59,6 +59,9 @@ class _IfNeedCreateStoreState extends State<IfNeedCreateStore>
@override
void dispose() {
if (widget.changeStatus) {
EventBus().emit('changeStatusColor');
}
super.dispose();
WidgetsBinding.instance.removeObserver(this); //销毁观察者
EventBus().off('refresh_store_list');
... ... @@ -186,235 +189,218 @@ class _IfNeedCreateStoreState extends State<IfNeedCreateStore>
Widget build(BuildContext context) {
otherLoginProvider = Provider.of<OtherLoginProvider>(context, listen: true);
_baseIndoProvider = Provider.of<BaseIndoProvider>(context, listen: true);
return WillPopScope(
onWillPop: () async {
if (widget.changeStatus) {
EventBus().emit('changeStatusColor');
}
return Scaffold(
backgroundColor: Colors.white,
appBar: SystemAppBar('选择店铺',
// leftTitle: '上一步',
return true;
},
child: Scaffold(
backgroundColor: Colors.white,
appBar: SystemAppBar('选择店铺',
// leftTitle: '上一步',
onTap: () {
if (widget.changeStatus) {
EventBus().emit('changeStatusColor');
}
Navigator.of(context).pop();
},
rightImgName: 'add_check_store.png',
onTapRight: () {
if (otherLoginProvider.pageState != PageState.Success) {
// if (!App.sp.containsKey('openid') ||
// App.sp.get("openid") == null ||
// App.sp.get("openid") == '') {
//跳转小程序
Utils.goMiniProgramCreatePage(context);
// } else {
// //跳转至新建店铺流程
// NavigatorUtil.goEnterStoreNamePage(context);
// }
} else {
// if (!App.sp.containsKey('openid') ||
// App.sp.get("openid") == null ||
// App.sp.get("openid") == '') {
// //跳转小程序
// Utils.goMiniProgramCreatePage(context);
// } else {
//跳转至新建店铺流程
NavigatorUtil.goEnterStoreNamePage(context);
// }
}
}),
body: Container(
// margin: EdgeInsets.only(bottom: ScreenUtil().setWidth(40)),
padding:
EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(48)),
child:
Consumer<OtherLoginProvider>(builder: (context, model, _) {
if (model.pageState != PageState.Success) {
// if (model.pageState == PageState.Empty) {
// return Container(
// width: double.infinity,
// padding: EdgeInsets.all(ScreenUtil().setWidth(40)),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.center,
// // mainAxisAlignment: MainAxisAlignment.center,
// children: [
// VEmptyView(80),
// Image.asset(
// Utils.getImgPath('not_member'),
// width: ScreenUtil().setWidth(120),
// height: ScreenUtil().setWidth(120),
// ),
// VEmptyView(60),
// Text(
// '您还没有绑定任何店铺',
// style: TextStyle(
// fontSize: ScreenUtil().setSp(32),
// color: MyColours.color_333333,
// fontWeight: FontWeight.bold),
// ),
// VEmptyView(172),
// InkWell(
// onTap: () {
// // if (!App.sp.containsKey('openid') ||
// // App.sp.get("openid") == null ||
// // App.sp.get("openid") == '') {
// //跳转小程序
// Utils.goMiniProgramCreatePage(context);
// // } else {
// // //跳转至新建店铺流程
// // NavigatorUtil.goEnterStoreNamePage(context);
// // }
// },
// child: Container(
// width: double.infinity,
// padding: EdgeInsets.symmetric(
// horizontal: ScreenUtil().setWidth(40),
// vertical: ScreenUtil().setWidth(18)),
// decoration: BoxDecoration(
// color: MyColours.color_24A4A8,
// borderRadius: BorderRadius.circular(
// ScreenUtil().setWidth(10))),
// child: Text(
// '创建店铺',
// textAlign: TextAlign.center,
// maxLines: 1,
// overflow: TextOverflow.ellipsis,
// style: TextStyle(
// color: MyColours.color_ffffff,
// fontSize: ScreenUtil().setSp(34)),
// ),
// )),
// ]));
// }
return ExceptionPage(
pageState: model.pageState,
callback: () {
_checkSellerAcc(showLoading: true);
},
emptyMsg: "您还没有绑定任何店铺",
emptyImg: "empty_search",
showMsg: "加载中,请稍后...",
);
} else {
return
// VEmptyView(40),
// Text(
// '请选择您要进入的店铺',
// style: TextStyle(
// fontSize: ScreenUtil().setWidth(32),
// color: MyColours.color_333333,
// fontWeight: FontWeight.bold),
// ),
// VEmptyView(100),
ListView.builder(
padding: EdgeInsets.only(
top: ScreenUtil().setWidth(50),
bottom: ScreenUtil().setWidth(20)),
// controller: widget.scrollController,
// padding: EdgeInsets.only(top: ScreenUtil().getAdapterSize(10)),
shrinkWrap: true,
itemCount: model.sellerList.length,
// cacheExtent: ScreenUtil().setWidth(197 * 2),
//SliverGridDelegateWithFixedCrossAxisCount 构建一个横轴固定数量Widget
// gridDelegate:
// SliverGridDelegateWithFixedCrossAxisCount(
// //横轴元素个数
// crossAxisCount: 2,
// //纵轴间距
// mainAxisSpacing:
// ScreenUtil().setWidth(50),
// //横轴间距
// crossAxisSpacing:
// ScreenUtil().setWidth(50),
// //子组件宽高长度比例
// childAspectRatio: 140 / 197),
itemBuilder: (BuildContext context, int index) {
// if (index == model.sellerList.length) {
// return InkWell(
// onTap: () {
// // if (!App.sp.containsKey('openid') ||
// // App.sp.get("openid") == null ||
// // App.sp.get("openid") == '') {
// // //跳转小程序
// // Utils.goMiniProgramCreatePage(context);
// // } else {
// //跳转至新建店铺流程
// NavigatorUtil.goEnterStoreNamePage(
// context);
// // }
// },
// child: DottedBorder(
// dashPattern: [5, 5, 5, 5],
// borderType: BorderType.RRect,
// radius: Radius.circular(
// ScreenUtil().setWidth(10)),
// // padding: EdgeInsets.all(ScreenUtil().setWidth(70)),
// color: MyColours.color_cccccc,
// strokeWidth: ScreenUtil().setWidth(2),
// child: ClipRRect(
// borderRadius: BorderRadius.all(
// Radius.circular(12)),
// child: Container(
// height: ScreenUtil()
// .setWidth(197 * 2),
// width: ScreenUtil()
// .setWidth(140 * 2),
// child: Column(
// mainAxisAlignment:
// MainAxisAlignment.center,
// children: [
// Image.asset(
// Utils.getImgPath(
// 'add_store'),
// width: ScreenUtil()
// .setWidth(32)),
// VEmptyView(10),
// Text(
// '创建店铺',
// style: TextStyle(
// color: MyColours
// .color_999999,
// fontSize: ScreenUtil()
// .setSp(24)),
// )
// ],
// ),
// ),
// ),
// ));
// }
return InkWell(
onTap: () async {
if (widget.changeStatus) {
UserModel userModel =
Provider.of<UserModel>(context,
listen: false);
bool success = await userModel.loginOutOnly(
context, {
"seller_code": userModel.user.sellercode,
"account": userModel.user.account
});
if (success) {
_clickStore(
context, model.sellerList[index]);
}
} else {
_clickStore(
context, model.sellerList[index]);
}
},
child: IfNeedCreateStoreItem(
model: model.sellerList[index]),
);
});
// VEmptyView(40),
rightImgName: 'add_check_store.png', onTapRight: () {
if (otherLoginProvider.pageState != PageState.Success) {
// if (!App.sp.containsKey('openid') ||
// App.sp.get("openid") == null ||
// App.sp.get("openid") == '') {
//跳转小程序
Utils.goMiniProgramCreatePage(context);
// } else {
// //跳转至新建店铺流程
// NavigatorUtil.goEnterStoreNamePage(context);
// }
} else {
// if (!App.sp.containsKey('openid') ||
// App.sp.get("openid") == null ||
// App.sp.get("openid") == '') {
// //跳转小程序
// Utils.goMiniProgramCreatePage(context);
// } else {
//跳转至新建店铺流程
NavigatorUtil.goEnterStoreNamePage(context);
// }
}
}),
body: Container(
// margin: EdgeInsets.only(bottom: ScreenUtil().setWidth(40)),
padding:
EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(48)),
child: Consumer<OtherLoginProvider>(builder: (context, model, _) {
if (model.pageState != PageState.Success) {
// if (model.pageState == PageState.Empty) {
// return Container(
// width: double.infinity,
// padding: EdgeInsets.all(ScreenUtil().setWidth(40)),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.center,
// // mainAxisAlignment: MainAxisAlignment.center,
// children: [
// VEmptyView(80),
// Image.asset(
// Utils.getImgPath('not_member'),
// width: ScreenUtil().setWidth(120),
// height: ScreenUtil().setWidth(120),
// ),
// VEmptyView(60),
// Text(
// '您还没有绑定任何店铺',
// style: TextStyle(
// fontSize: ScreenUtil().setSp(32),
// color: MyColours.color_333333,
// fontWeight: FontWeight.bold),
// ),
// VEmptyView(172),
// InkWell(
// onTap: () {
// // if (!App.sp.containsKey('openid') ||
// // App.sp.get("openid") == null ||
// // App.sp.get("openid") == '') {
// //跳转小程序
// Utils.goMiniProgramCreatePage(context);
// // } else {
// // //跳转至新建店铺流程
// // NavigatorUtil.goEnterStoreNamePage(context);
// // }
// },
// child: Container(
// width: double.infinity,
// padding: EdgeInsets.symmetric(
// horizontal: ScreenUtil().setWidth(40),
// vertical: ScreenUtil().setWidth(18)),
// decoration: BoxDecoration(
// color: MyColours.color_24A4A8,
// borderRadius: BorderRadius.circular(
// ScreenUtil().setWidth(10))),
// child: Text(
// '创建店铺',
// textAlign: TextAlign.center,
// maxLines: 1,
// overflow: TextOverflow.ellipsis,
// style: TextStyle(
// color: MyColours.color_ffffff,
// fontSize: ScreenUtil().setSp(34)),
// ),
// )),
// ]));
// }
return ExceptionPage(
pageState: model.pageState,
callback: () {
_checkSellerAcc(showLoading: true);
},
emptyMsg: "您还没有绑定任何店铺",
emptyImg: "empty_search",
showMsg: "加载中,请稍后...",
);
} else {
return
// VEmptyView(40),
// Text(
// '请选择您要进入的店铺',
// style: TextStyle(
// fontSize: ScreenUtil().setWidth(32),
// color: MyColours.color_333333,
// fontWeight: FontWeight.bold),
// ),
// VEmptyView(100),
ListView.builder(
padding: EdgeInsets.only(
top: ScreenUtil().setWidth(50),
bottom: ScreenUtil().setWidth(20)),
// controller: widget.scrollController,
// padding: EdgeInsets.only(top: ScreenUtil().getAdapterSize(10)),
shrinkWrap: true,
itemCount: model.sellerList.length,
// cacheExtent: ScreenUtil().setWidth(197 * 2),
//SliverGridDelegateWithFixedCrossAxisCount 构建一个横轴固定数量Widget
// gridDelegate:
// SliverGridDelegateWithFixedCrossAxisCount(
// //横轴元素个数
// crossAxisCount: 2,
// //纵轴间距
// mainAxisSpacing:
// ScreenUtil().setWidth(50),
// //横轴间距
// crossAxisSpacing:
// ScreenUtil().setWidth(50),
// //子组件宽高长度比例
// childAspectRatio: 140 / 197),
itemBuilder: (BuildContext context, int index) {
// if (index == model.sellerList.length) {
// return InkWell(
// onTap: () {
// // if (!App.sp.containsKey('openid') ||
// // App.sp.get("openid") == null ||
// // App.sp.get("openid") == '') {
// // //跳转小程序
// // Utils.goMiniProgramCreatePage(context);
// // } else {
// //跳转至新建店铺流程
// NavigatorUtil.goEnterStoreNamePage(
// context);
// // }
// },
// child: DottedBorder(
// dashPattern: [5, 5, 5, 5],
// borderType: BorderType.RRect,
// radius: Radius.circular(
// ScreenUtil().setWidth(10)),
// // padding: EdgeInsets.all(ScreenUtil().setWidth(70)),
// color: MyColours.color_cccccc,
// strokeWidth: ScreenUtil().setWidth(2),
// child: ClipRRect(
// borderRadius: BorderRadius.all(
// Radius.circular(12)),
// child: Container(
// height: ScreenUtil()
// .setWidth(197 * 2),
// width: ScreenUtil()
// .setWidth(140 * 2),
// child: Column(
// mainAxisAlignment:
// MainAxisAlignment.center,
// children: [
// Image.asset(
// Utils.getImgPath(
// 'add_store'),
// width: ScreenUtil()
// .setWidth(32)),
// VEmptyView(10),
// Text(
// '创建店铺',
// style: TextStyle(
// color: MyColours
// .color_999999,
// fontSize: ScreenUtil()
// .setSp(24)),
// )
// ],
// ),
// ),
// ),
// ));
// }
return InkWell(
onTap: () async {
if (widget.changeStatus) {
UserModel userModel = Provider.of<UserModel>(
context,
listen: false);
bool success = await userModel.loginOutOnly(
context, {
"seller_code": userModel.user.sellercode,
"account": userModel.user.account
});
if (success) {
_clickStore(context, model.sellerList[index]);
}
} else {
_clickStore(context, model.sellerList[index]);
}
},
child: IfNeedCreateStoreItem(
model: model.sellerList[index]),
);
});
// VEmptyView(40),
}
}))));
}
})));
}
}
... ...
... ... @@ -79,6 +79,15 @@ class _WebPageState extends State<WebPage> {
_init();
}
@override
void dispose() {
if (widget.need) {
Utils.changeStatusColor(color: MyColours.color_199095);
}
super.dispose();
}
Future<bool> _checkPermission() async {
DeviceInfoPlugin deviceInfo = DeviceInfoPlugin();
AndroidDeviceInfo androidInfo = await deviceInfo.androidInfo;
... ... @@ -148,203 +157,189 @@ class _WebPageState extends State<WebPage> {
// to allow calling Scaffold.of(context) so we can show a snackbar.
appBar: SystemAppBar(
widget.title,
onTap: () {
if (widget.need) {
Utils.changeStatusColor(color: MyColours.color_199095);
}
Navigator.of(context).pop();
},
),
body: WillPopScope(
onWillPop: () async {
if (widget.need) {
Utils.changeStatusColor(color: MyColours.color_199095);
}
return true;
},
child: Column(
children: [
Expanded(
child: InAppWebView(
key: webViewKey,
// contextMenu: contextMenu,
initialUrlRequest: URLRequest(
// url: Uri.parse("http://colorcun.com/privacy1.html")),
url: Uri.parse("http://colorcun.com/privacy2.html")),
//华为下载功能闪退,去掉下载功能*********http://colorcun.com/privacy2.html
// initialFile: "assets/index.html",
initialUserScripts: UnmodifiableListView<UserScript>([]),
initialOptions: options,
pullToRefreshController: pullToRefreshController,
onWebViewCreated: (controller) {
webViewController = controller;
},
onLoadStart: (controller, url) {
setState(() {
this.url = url.toString();
urlController.text = this.url;
});
},
androidOnPermissionRequest:
(controller, origin, resources) async {
return PermissionRequestResponse(
resources: resources,
action: PermissionRequestResponseAction.GRANT);
},
shouldOverrideUrlLoading:
(controller, navigationAction) async {
var uri = navigationAction.request.url;
body: Column(
children: [
Expanded(
child: InAppWebView(
key: webViewKey,
// contextMenu: contextMenu,
initialUrlRequest: URLRequest(
// url: Uri.parse("http://colorcun.com/privacy1.html")),
url: Uri.parse("http://colorcun.com/privacy2.html")),
//华为下载功能闪退,去掉下载功能*********http://colorcun.com/privacy2.html
// initialFile: "assets/index.html",
initialUserScripts: UnmodifiableListView<UserScript>([]),
initialOptions: options,
pullToRefreshController: pullToRefreshController,
onWebViewCreated: (controller) {
webViewController = controller;
},
onLoadStart: (controller, url) {
setState(() {
this.url = url.toString();
urlController.text = this.url;
});
},
androidOnPermissionRequest:
(controller, origin, resources) async {
return PermissionRequestResponse(
resources: resources,
action: PermissionRequestResponseAction.GRANT);
},
shouldOverrideUrlLoading: (controller, navigationAction) async {
var uri = navigationAction.request.url;
if (![
"http",
"https",
"file",
"chrome",
"data",
"javascript",
"about"
].contains(uri.scheme)) {
if (await canLaunch(url)) {
// Launch the App
await launch(
url,
);
// and cancel the request
return NavigationActionPolicy.CANCEL;
}
}
if (![
"http",
"https",
"file",
"chrome",
"data",
"javascript",
"about"
].contains(uri.scheme)) {
if (await canLaunch(url)) {
// Launch the App
await launch(
url,
);
// and cancel the request
return NavigationActionPolicy.CANCEL;
}
}
return NavigationActionPolicy.ALLOW;
},
onLoadStop: (controller, url) async {
pullToRefreshController.endRefreshing();
setState(() {
this.url = url.toString();
urlController.text = this.url;
});
},
onLoadError: (controller, url, code, message) {
pullToRefreshController.endRefreshing();
},
onProgressChanged: (controller, progress) {
if (progress == 100) {
pullToRefreshController.endRefreshing();
}
setState(() {
this.progress = progress / 100;
urlController.text = this.url;
});
},
onUpdateVisitedHistory: (controller, url, androidIsReload) {
setState(() {
this.url = url.toString();
urlController.text = this.url;
});
},
onConsoleMessage: (controller, consoleMessage) {
print(consoleMessage);
},
onDownloadStart: (controller, url) async {
print("onDownloadStart $url");
Utils.showToast('开始下载...');
// final taskId = await FlutterDownloader.enqueue(
// url: url.toString(),
// savedDir: (await getExternalStorageDirectory()).path,
// showNotification:
// true, // show download progress in status bar (for Android)
// openFileFromNotification:
// true, // click on notification to open downloaded file (for Android)
// );
final dir = await getExternalStorageDirectory();
String savePath = dir.path + "/one_key";
return NavigationActionPolicy.ALLOW;
},
onLoadStop: (controller, url) async {
pullToRefreshController.endRefreshing();
setState(() {
this.url = url.toString();
urlController.text = this.url;
});
},
onLoadError: (controller, url, code, message) {
pullToRefreshController.endRefreshing();
},
onProgressChanged: (controller, progress) {
if (progress == 100) {
pullToRefreshController.endRefreshing();
}
setState(() {
this.progress = progress / 100;
urlController.text = this.url;
});
},
onUpdateVisitedHistory: (controller, url, androidIsReload) {
setState(() {
this.url = url.toString();
urlController.text = this.url;
});
},
onConsoleMessage: (controller, consoleMessage) {
print(consoleMessage);
},
onDownloadStart: (controller, url) async {
print("onDownloadStart $url");
Utils.showToast('开始下载...');
// final taskId = await FlutterDownloader.enqueue(
// url: url.toString(),
// savedDir: (await getExternalStorageDirectory()).path,
// showNotification:
// true, // show download progress in status bar (for Android)
// openFileFromNotification:
// true, // click on notification to open downloaded file (for Android)
// );
final dir = await getExternalStorageDirectory();
String savePath = dir.path + "/one_key";
Directory directory = new Directory(savePath);
if (directory.existsSync()) {
//删除历史apk
final List<FileSystemEntity> files = directory.listSync();
for (FileSystemEntity file in files) {
file.deleteSync();
}
}
DioUtil().download(url.toString(), savePath,
onProgress: (received, total) {
// if (_progress != 100) {
// int progress = ((received / total) * 100).round();
// _progress = progress;
// _setState(() {});
// }
if (received == total) {
print('object');
Utils.showToast('文件已保存在${savePath}');
// openFile(savePath);
//下载完成
// InstallPlugin.installApk(savePath, "com.naji.one_key");
}
});
// },
// DioUtil().download(url.toString(),
// (await getExternalStorageDirectory()).path,
// onProgress: (received, total) {
// // if (_progress != 100) {
// // int progress = ((received / total) * 100).round();
// // _progress = progress;
// // _setState(() {});
// // }
// if (received == total) {
// //下载完成
// // InstallPlugin.installApk(savePath, "com.naji.one_key");
// }
// });
},
))
],
)
// Builder(builder: (BuildContext context) {
// return WebView(
// initialUrl: "http://colorcun.com/privacy1.html",
// javascriptMode: JavascriptMode.unrestricted,
// onWebViewCreated: (WebViewController webViewController) {
// _controller.complete(webViewController);
// },
// // TODO(iskakaushik): Remove this when collection literals makes it to stable.
// // ignore: prefer_collection_literals
// javascriptChannels: <JavascriptChannel>[
// _toasterJavascriptChannel(context),
// ].toSet(),
// navigationDelegate: (NavigationRequest request) {
// if (request.url.startsWith('https://www.youtube.com/')) {
// print('blocking navigation to $request}');
// return NavigationDecision.prevent;
// }
// print('allowing navigation to $request');
// return NavigationDecision.navigate;
// },
// onPageStarted: (String url) {
// print('Page started loading: $url');
// },
// onPageFinished: (String url) async {
// print('Page finished loading: $url');
// // showDownloadProgress(context);
// final dir = await getExternalStorageDirectory();
// String savePath = dir.path + "/one_key";
// DioUtil().download(url, savePath,
// onProgress: (received, total) {
// // if (_progress != 100) {
// // int progress = ((received / total) * 100).round();
// // _progress = progress;
// // _setState(() {});
// // }
// if (received == total) {
// print('object');
// //下载完成
// // InstallPlugin.installApk(savePath, "com.naji.one_key");
// }
// });
// },
// gestureNavigationEnabled: true,
// );
// }),
));
Directory directory = new Directory(savePath);
if (directory.existsSync()) {
//删除历史apk
final List<FileSystemEntity> files = directory.listSync();
for (FileSystemEntity file in files) {
file.deleteSync();
}
}
DioUtil().download(url.toString(), savePath,
onProgress: (received, total) {
// if (_progress != 100) {
// int progress = ((received / total) * 100).round();
// _progress = progress;
// _setState(() {});
// }
if (received == total) {
print('object');
Utils.showToast('文件已保存在${savePath}');
// openFile(savePath);
//下载完成
// InstallPlugin.installApk(savePath, "com.naji.one_key");
}
});
// },
// DioUtil().download(url.toString(),
// (await getExternalStorageDirectory()).path,
// onProgress: (received, total) {
// // if (_progress != 100) {
// // int progress = ((received / total) * 100).round();
// // _progress = progress;
// // _setState(() {});
// // }
// if (received == total) {
// //下载完成
// // InstallPlugin.installApk(savePath, "com.naji.one_key");
// }
// });
},
))
],
)
// Builder(builder: (BuildContext context) {
// return WebView(
// initialUrl: "http://colorcun.com/privacy1.html",
// javascriptMode: JavascriptMode.unrestricted,
// onWebViewCreated: (WebViewController webViewController) {
// _controller.complete(webViewController);
// },
// // TODO(iskakaushik): Remove this when collection literals makes it to stable.
// // ignore: prefer_collection_literals
// javascriptChannels: <JavascriptChannel>[
// _toasterJavascriptChannel(context),
// ].toSet(),
// navigationDelegate: (NavigationRequest request) {
// if (request.url.startsWith('https://www.youtube.com/')) {
// print('blocking navigation to $request}');
// return NavigationDecision.prevent;
// }
// print('allowing navigation to $request');
// return NavigationDecision.navigate;
// },
// onPageStarted: (String url) {
// print('Page started loading: $url');
// },
// onPageFinished: (String url) async {
// print('Page finished loading: $url');
// // showDownloadProgress(context);
// final dir = await getExternalStorageDirectory();
// String savePath = dir.path + "/one_key";
// DioUtil().download(url, savePath,
// onProgress: (received, total) {
// // if (_progress != 100) {
// // int progress = ((received / total) * 100).round();
// // _progress = progress;
// // _setState(() {});
// // }
// if (received == total) {
// print('object');
// //下载完成
// // InstallPlugin.installApk(savePath, "com.naji.one_key");
// }
// });
// },
// gestureNavigationEnabled: true,
// );
// }),
);
}
// JavascriptChannel _toasterJavascriptChannel(BuildContext context) {
... ...
... ... @@ -103,6 +103,12 @@ class _BaseInfoPageState extends State<BaseInfoPage> {
});
}
@override
void dispose() {
EventBus().emit('changeStatusColor');
super.dispose();
}
_getCustomerActivityBaseinfo() async {
Map<String, String> params;
... ... @@ -210,7 +216,7 @@ class _BaseInfoPageState extends State<BaseInfoPage> {
//成功之后跳回前一个页面
// bus.emit('refresh_coupon_list');
Utils.showToast('保存成功');
EventBus().emit('changeStatusColor');
// EventBus().emit('changeStatusColor');
if (widget.fromPage == FromPage.FromPageIfNeedCreateStore) {
_loginStore(context, widget.sunModel);
} else {
... ... @@ -555,180 +561,159 @@ class _BaseInfoPageState extends State<BaseInfoPage> {
appBar: SystemAppBar(
'个人信息',
onTap: () {
EventBus().emit('changeStatusColor');
// EventBus().emit('changeStatusColor');
Navigator.of(context).pop();
},
),
body: WillPopScope(
onWillPop: () {
EventBus().emit('changeStatusColor');
Navigator.of(context).pop();
body: InkWell(
onTap: () {
FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘
},
child: InkWell(
onTap: () {
FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘
},
child: Container(
color: MyColours.color_ffffff,
child: Column(
// crossAxisAlignment: CrossAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expanded(
child: SingleChildScrollView(
controller: _scrollController,
physics: BouncingScrollPhysics(),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
VEmptyView(66),
_imageWidget(
'头像',
_uploadImageProvider.touxiang,
_uploadImageProvider.imgSizeTouxiang,
76),
VEmptyView(26),
Text(nameStr,
style: TextStyle(
fontSize: ScreenUtil().setWidth(50),
color: nameStr == '未填写' ||
nameStr == ''
? MyColours.color_BFC4D4
: MyColours.color_27262B)),
VEmptyView(8),
Text(phoneStr == null ? '' : phoneStr,
style: TextStyle(
fontSize: ScreenUtil().setWidth(30),
color: MyColours.color_BFC4D4)),
VEmptyView(80),
Padding(
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(48),
),
child: _textfield(
'base_name',
'您希望顾客看到的名字',
_nameController,
_nameFocusNode)),
VEmptyView(26),
child: Container(
color: MyColours.color_ffffff,
child: Column(
// crossAxisAlignment: CrossAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expanded(
child: SingleChildScrollView(
controller: _scrollController,
physics: BouncingScrollPhysics(),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
VEmptyView(66),
_imageWidget(
'头像',
_uploadImageProvider.touxiang,
_uploadImageProvider.imgSizeTouxiang,
76),
VEmptyView(26),
Text(nameStr,
style: TextStyle(
fontSize: ScreenUtil().setWidth(50),
color: nameStr == '未填写' || nameStr == ''
? MyColours.color_BFC4D4
: MyColours.color_27262B)),
VEmptyView(8),
Text(phoneStr == null ? '' : phoneStr,
style: TextStyle(
fontSize: ScreenUtil().setWidth(30),
color: MyColours.color_BFC4D4)),
VEmptyView(80),
Padding(
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(40),
),
child: _textfield(
'base_phone',
'顾客联系您的手机号',
_phoneController,
_phoneFocusNode)),
VEmptyView(26),
Padding(
Padding(
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(48),
),
child: _textfield('base_name', '您希望顾客看到的名字',
_nameController, _nameFocusNode)),
VEmptyView(26),
Padding(
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(40),
),
child: _textfield('base_phone', '顾客联系您的手机号',
_phoneController, _phoneFocusNode)),
VEmptyView(26),
Padding(
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(40),
),
child: _textfield(
'base_position',
'告知顾客您的职位',
_positionController,
_positionFocusNode)),
VEmptyView(26),
// _imageWidget('微信二维码', _uploadImageProvider.erweima,
// _uploadImageProvider.imgSizeErweima, 0),
InkWell(
onTap: () {
setState(() {
isSelect = !isSelect;
});
},
child: Container(
padding: EdgeInsets.only(
left: ScreenUtil().setWidth(40),
right: ScreenUtil().setWidth(40),
bottom: ScreenUtil().setWidth(26)),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.center,
children: [
Image.asset(
Utils.getImgPath(isSelect
? 'base_radio_sel'
: 'base_radio_un'),
// width: ScreenUtil().setWidth(16),
height: ScreenUtil().setWidth(34),
),
HEmptyView(24),
Text('微信同电话号',
style: TextStyle(
color: isSelect
? MyColours.color_438E93
: MyColours.color_BFC4D4,
fontSize:
ScreenUtil().setSp(30),
)),
],
),
)),
isSelect
? SizedBox()
: Padding(
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(40),
),
child: _textfield(
'base_position',
'告知顾客您的职位',
_positionController,
_positionFocusNode)),
VEmptyView(26),
// _imageWidget('微信二维码', _uploadImageProvider.erweima,
// _uploadImageProvider.imgSizeErweima, 0),
InkWell(
onTap: () {
setState(() {
isSelect = !isSelect;
});
},
child: Container(
padding: EdgeInsets.only(
left: ScreenUtil().setWidth(40),
right: ScreenUtil().setWidth(40),
bottom:
ScreenUtil().setWidth(26)),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.center,
children: [
Image.asset(
Utils.getImgPath(isSelect
? 'base_radio_sel'
: 'base_radio_un'),
// width: ScreenUtil().setWidth(16),
height:
ScreenUtil().setWidth(34),
),
HEmptyView(24),
Text('微信同电话号',
style: TextStyle(
color: isSelect
? MyColours.color_438E93
: MyColours
.color_BFC4D4,
fontSize:
ScreenUtil().setSp(30),
)),
],
),
)),
isSelect
? SizedBox()
: Padding(
padding: EdgeInsets.symmetric(
horizontal:
ScreenUtil().setWidth(40),
),
child: _textfield(
'base_wechat',
'微信号方便顾客加您微信',
_wechatController,
_wechatFocusNode)),
VEmptyView(30),
],
)),
),
VEmptyView(20),
Padding(
padding: EdgeInsets.fromLTRB(
ScreenUtil().setWidth(40),
0,
ScreenUtil().setWidth(40),
ScreenUtil().setWidth(56)),
child: RoundButton(
onPressed: () {
if (_phoneController.text.trim().length ==
0 ||
_nameController.text.trim().length == 0) {
Utils.showToast('请至少填写您的姓名和电话');
return;
} //接口
_setCustomerActivityBaseinfo();
},
text: '保存',
fontSize: 34,
isBold: false,
height: ScreenUtil().setWidth(100),
width: ScreenUtil().setWidth(154 * 2),
gradientStart: _phoneController.text
.trim()
.length ==
0 ||
'base_wechat',
'微信号方便顾客加您微信',
_wechatController,
_wechatFocusNode)),
VEmptyView(30),
],
)),
),
VEmptyView(20),
Padding(
padding: EdgeInsets.fromLTRB(
ScreenUtil().setWidth(40),
0,
ScreenUtil().setWidth(40),
ScreenUtil().setWidth(56)),
child: RoundButton(
onPressed: () {
if (_phoneController.text.trim().length == 0 ||
_nameController.text.trim().length == 0) {
Utils.showToast('请至少填写您的姓名和电话');
return;
} //接口
_setCustomerActivityBaseinfo();
},
text: '保存',
fontSize: 34,
isBold: false,
height: ScreenUtil().setWidth(100),
width: ScreenUtil().setWidth(154 * 2),
gradientStart:
_phoneController.text.trim().length == 0 ||
_nameController.text.trim().length == 0
? MyColours.color_BFC4D4
: MyColours.color_438E93,
gradientEnd: _phoneController.text
.trim()
.length ==
0 ||
gradientEnd:
_phoneController.text.trim().length == 0 ||
_nameController.text.trim().length == 0
? MyColours.color_BFC4D4
: MyColours.color_438E93,
radius: ScreenUtil().setWidth(24),
))
])))));
radius: ScreenUtil().setWidth(24),
))
]))));
}
}
... ...
... ... @@ -451,92 +451,88 @@ class _BookTimeSetPageState extends State<BookTimeSetPage> {
}
@override
void dispose() {
EventBus().emit('changeStatusColor');
// TODO: implement dispose
super.dispose();
}
@override
Widget build(BuildContext context) {
bookSetTimeModel = Provider.of<BookSetTimeModel>(context, listen: true);
return WillPopScope(
child: Scaffold(
key: _scaffoldKey,
backgroundColor: MyColours.color_f5f5f5,
appBar: SystemAppBar(
'可订时段',
onTap: () {
EventBus().emit('changeStatusColor');
Navigator.of(context).pop();
},
),
body: SafeArea(
child: Column(
children: [
Expanded(
child: SingleChildScrollView(
child: Column(
children: [
_itemWidget('早市', morning.start, morning.end, 0),
VEmptyView(20),
_itemWidget('午市', noon.start, noon.end, 1),
VEmptyView(20),
_itemWidget('晚市', night.start, night.end, 2),
_bottomWidget()
],
),
)),
Padding(
padding: EdgeInsets.fromLTRB(
ScreenUtil().setWidth(40),
ScreenUtil().setWidth(0),
ScreenUtil().setWidth(40),
ScreenUtil().setWidth(60)),
child: CommonButton(
width: double.infinity,
height: 84,
fontSize: 34,
content: '保存',
state: 2,
onPress: () async {
String morningStr = '';
String noonStr = '';
String nightStr = '';
if (swichState[0]) {
morningStr = Utils.getTimelLongString(
morning.start, morning.end);
}
if (swichState[1]) {
noonStr =
Utils.getTimelLongString(noon.start, noon.end);
}
if (swichState[2]) {
nightStr =
Utils.getTimelLongString(night.start, night.end);
}
DialogUtil.confirmTimeAlertDialog(
context, morningStr, noonStr, nightStr, () async {
///接口
///
SetSellerInfoSunModel sunModel = await bookSetTimeModel
.setSellerInfoById(context, {
'morning': morningStr,
'noon': noonStr,
'night': nightStr
});
if (sunModel != null) {
//修改成功
Utils.showToast('保存成功');
EventBus().emit('changeStatusColor');
Navigator.pop(context);
} else {
// Utils.showToast('保存失败');
}
});
},
))
],
return Scaffold(
key: _scaffoldKey,
backgroundColor: MyColours.color_f5f5f5,
appBar: SystemAppBar(
'可订时段',
),
body: SafeArea(
child: Column(
children: [
Expanded(
child: SingleChildScrollView(
child: Column(
children: [
_itemWidget('早市', morning.start, morning.end, 0),
VEmptyView(20),
_itemWidget('午市', noon.start, noon.end, 1),
VEmptyView(20),
_itemWidget('晚市', night.start, night.end, 2),
_bottomWidget()
],
),
)),
),
onWillPop: () async {
EventBus().emit('changeStatusColor');
return true;
});
Padding(
padding: EdgeInsets.fromLTRB(
ScreenUtil().setWidth(40),
ScreenUtil().setWidth(0),
ScreenUtil().setWidth(40),
ScreenUtil().setWidth(60)),
child: CommonButton(
width: double.infinity,
height: 84,
fontSize: 34,
content: '保存',
state: 2,
onPress: () async {
String morningStr = '';
String noonStr = '';
String nightStr = '';
if (swichState[0]) {
morningStr =
Utils.getTimelLongString(morning.start, morning.end);
}
if (swichState[1]) {
noonStr = Utils.getTimelLongString(noon.start, noon.end);
}
if (swichState[2]) {
nightStr = Utils.getTimelLongString(night.start, night.end);
}
DialogUtil.confirmTimeAlertDialog(
context, morningStr, noonStr, nightStr, () async {
///接口
///
SetSellerInfoSunModel sunModel = await bookSetTimeModel
.setSellerInfoById(context, {
'morning': morningStr,
'noon': noonStr,
'night': nightStr
});
if (sunModel != null) {
//修改成功
Utils.showToast('保存成功');
EventBus().emit('changeStatusColor');
Navigator.pop(context);
} else {
// Utils.showToast('保存失败');
}
});
},
))
],
)),
);
}
}
... ...
... ... @@ -35,6 +35,12 @@ class _ContactListPageState extends State<ContactListPage>
}
@override
void dispose() {
EventBus().emit('changeStatusColor');
super.dispose();
}
@override
Widget build(BuildContext context) {
contantShowModel = Provider.of<ContantShowModel>(context, listen: true);
return Material(
... ... @@ -43,162 +49,151 @@ class _ContactListPageState extends State<ContactListPage>
// FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘
},
child: Scaffold(
resizeToAvoidBottomInset: false,
backgroundColor: MyColours.color_ffffff,
appBar: SystemAppBar(
'联系人',
onTap: () {
EventBus().emit('changeStatusColor');
Navigator.of(context).pop();
},
),
body: WillPopScope(
child: SafeArea(
child: Column(
children: <Widget>[
Container(
// color: Colors.red,
resizeToAvoidBottomInset: false,
backgroundColor: MyColours.color_ffffff,
appBar: SystemAppBar(
'联系人',
onTap: () {
Navigator.of(context).pop();
},
),
body: SafeArea(
child: Column(
children: <Widget>[
Container(
// color: Colors.red,
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(40),
vertical: ScreenUtil().setWidth(10)),
height: ScreenUtil().setWidth(45 * 2),
// alignment: Alignment.center,
child: Stack(
children: [
Container(
alignment: Alignment.center,
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(40),
vertical: ScreenUtil().setWidth(10)),
height: ScreenUtil().setWidth(45 * 2),
// alignment: Alignment.center,
child: Stack(
children: [
Container(
alignment: Alignment.center,
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(20 * 2),
vertical: ScreenUtil().setWidth(14)),
decoration: BoxDecoration(
color: MyColours.color_F0F0F0,
borderRadius: BorderRadius.circular(
ScreenUtil().setWidth(24 * 2))),
child: TextField(
maxLines: 1,
controller: contantShowModel.controller,
// focusNode: _focusNode,
// autofocus: true,
style: TextStyle(
color: MyColours.color_333333,
fontSize: ScreenUtil().setSp(30)),
// textAlignVertical: TextAlignVertical.center,
decoration: InputDecoration(
contentPadding: EdgeInsets.only(
right: ScreenUtil().setWidth(40 * 2)),
hintText: "搜索联系人",
hintStyle: TextStyle(
color: MyColours.color_999999,
fontSize: ScreenUtil().setSp(30),
),
isCollapsed:
true, //重点,相当于高度包裹的意思,必须设置为true,不然有默认奇妙的最小高度
border: OutlineInputBorder(
borderSide: BorderSide.none),
// 左边图标设置
icon: Image.asset(
Utils.getImgPath('search'),
horizontal: ScreenUtil().setWidth(20 * 2),
vertical: ScreenUtil().setWidth(14)),
decoration: BoxDecoration(
color: MyColours.color_F0F0F0,
borderRadius: BorderRadius.circular(
ScreenUtil().setWidth(24 * 2))),
child: TextField(
maxLines: 1,
controller: contantShowModel.controller,
// focusNode: _focusNode,
// autofocus: true,
style: TextStyle(
color: MyColours.color_333333,
fontSize: ScreenUtil().setSp(30)),
// textAlignVertical: TextAlignVertical.center,
decoration: InputDecoration(
contentPadding: EdgeInsets.only(
right: ScreenUtil().setWidth(40 * 2)),
hintText: "搜索联系人",
hintStyle: TextStyle(
color: MyColours.color_999999,
fontSize: ScreenUtil().setSp(30),
),
isCollapsed:
true, //重点,相当于高度包裹的意思,必须设置为true,不然有默认奇妙的最小高度
border: OutlineInputBorder(
borderSide: BorderSide.none),
// 左边图标设置
icon: Image.asset(
Utils.getImgPath('search'),
width: ScreenUtil().setWidth(30),
),
//右边图标设置
// suffixIcon:
),
keyboardType: TextInputType.text,
textInputAction: TextInputAction.done,
onChanged: (value) {
// setState(() {});
// _searchSellerLocation();
contantShowModel.searchData(value);
},
onEditingComplete: () {
FocusScope.of(context)
.requestFocus(FocusNode()); //点击空白处隐藏键盘
// contantShowModel.searchData(
// contantShowModel.controller.text);
// _searchSellerLocation();
// _focusNode.unfocus();
},
),
),
Positioned(
right: 0,
top: 0,
bottom: 0,
child: Offstage(
offstage:
contantShowModel.controller.text == '',
child: GestureDetector(
child: Container(
padding: EdgeInsets.only(
right: ScreenUtil().setWidth(20 * 2)),
// color: Colors.orange,
height: ScreenUtil().setWidth(45 * 2),
width: ScreenUtil().setWidth(100 * 2),
alignment: Alignment.centerRight,
child: Image.asset(
Utils.getImgPath('clear'),
width: ScreenUtil().setWidth(30),
height: ScreenUtil().setWidth(30),
),
//右边图标设置
// suffixIcon:
),
keyboardType: TextInputType.text,
textInputAction: TextInputAction.done,
onChanged: (value) {
// setState(() {});
// _searchSellerLocation();
contantShowModel.searchData(value);
onTap: () {
WidgetsBinding.instance
.addPostFrameCallback(((_) {
contantShowModel.controller.clear();
contantShowModel.searchData('');
}));
},
onEditingComplete: () {
FocusScope.of(context).requestFocus(
FocusNode()); //点击空白处隐藏键盘
// contantShowModel.searchData(
// contantShowModel.controller.text);
// _searchSellerLocation();
// _focusNode.unfocus();
},
),
),
Positioned(
right: 0,
top: 0,
bottom: 0,
child: Offstage(
offstage:
contantShowModel.controller.text ==
'',
child: GestureDetector(
child: Container(
padding: EdgeInsets.only(
right: ScreenUtil()
.setWidth(20 * 2)),
// color: Colors.orange,
height:
ScreenUtil().setWidth(45 * 2),
width:
ScreenUtil().setWidth(100 * 2),
alignment: Alignment.centerRight,
child: Image.asset(
Utils.getImgPath('clear'),
width: ScreenUtil().setWidth(30),
height: ScreenUtil().setWidth(30),
),
),
onTap: () {
WidgetsBinding.instance
.addPostFrameCallback(((_) {
contantShowModel.controller
.clear();
contantShowModel.searchData('');
}));
},
)))
],
)),
Container(
padding: EdgeInsets.only(
bottom: ScreenUtil().setWidth(10)),
margin: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(30)),
child: TabBar(
controller: tabController,
indicator: CustomTabIndicator(
radius: 0,
),
indicatorColor: MyColours.color_199095,
indicatorSize: TabBarIndicatorSize.tab,
// indicatorPadding: EdgeInsets.symmetric(
// horizontal: ScreenUtil().setWidth(12)),
labelColor: MyColours.color_199095,
labelStyle: TextStyle(
fontSize: ScreenUtil().setSp(32),
fontWeight: FontWeight.bold),
labelPadding: EdgeInsets.zero,
unselectedLabelStyle:
TextStyle(fontWeight: FontWeight.normal),
unselectedLabelColor: MyColours.color_999999,
tabs: _tabBarTitle.map((value) {
return Tab(
child: Text(value),
);
}).toList()),
)))
],
)),
Container(
padding: EdgeInsets.only(bottom: ScreenUtil().setWidth(10)),
margin: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(30)),
child: TabBar(
controller: tabController,
indicator: CustomTabIndicator(
radius: 0,
),
Expanded(
child: TabBarView(
controller: tabController,
// physics: NeverScrollableScrollPhysics(),
children: <Widget>[
ContantLeftPage(),
ContantRightPage(),
],
)),
],
)),
onWillPop: () async {
EventBus().emit('changeStatusColor');
return true;
}))));
indicatorColor: MyColours.color_199095,
indicatorSize: TabBarIndicatorSize.tab,
// indicatorPadding: EdgeInsets.symmetric(
// horizontal: ScreenUtil().setWidth(12)),
labelColor: MyColours.color_199095,
labelStyle: TextStyle(
fontSize: ScreenUtil().setSp(32),
fontWeight: FontWeight.bold),
labelPadding: EdgeInsets.zero,
unselectedLabelStyle:
TextStyle(fontWeight: FontWeight.normal),
unselectedLabelColor: MyColours.color_999999,
tabs: _tabBarTitle.map((value) {
return Tab(
child: Text(value),
);
}).toList()),
),
Expanded(
child: TabBarView(
controller: tabController,
// physics: NeverScrollableScrollPhysics(),
children: <Widget>[
ContantLeftPage(),
ContantRightPage(),
],
)),
],
)),
)));
}
}
... ...
... ... @@ -61,6 +61,7 @@ class _MyCustomerHomePageState extends State<MyCustomerHomePage> {
@override
void dispose() {
EventBus().emit('changeStatusColor');
bus.off('refresh_my_customer_home');
// bus.off("refresh_coupon_list");
super.dispose();
... ... @@ -314,13 +315,9 @@ class _MyCustomerHomePageState extends State<MyCustomerHomePage> {
return Scaffold(
backgroundColor: MyColours.color_f3f3f3,
appBar: SystemAppBar('我的客情', onTap: () {
EventBus().emit('changeStatusColor');
Navigator.pop(context);
}),
body: WillPopScope(onWillPop: () async {
EventBus().emit('changeStatusColor');
return true;
}, child: Consumer<CustomerProvider>(builder: (context, model, _) {
body: Consumer<CustomerProvider>(builder: (context, model, _) {
if (model.pageStateMyHome != PageState.Success) {
return ExceptionPage(
pageState: model.pageStateMyHome,
... ... @@ -751,6 +748,6 @@ class _MyCustomerHomePageState extends State<MyCustomerHomePage> {
))
]);
}
})));
}));
}
}
... ...
... ... @@ -61,6 +61,7 @@ class _StoreCustomerHomeLeftPageState extends State<StoreCustomerHomeLeftPage> {
@override
void dispose() {
bus.off('refresh_store_customer_home');
// bus.off("refresh_coupon_list");
super.dispose();
... ... @@ -845,361 +846,356 @@ class _StoreCustomerHomeLeftPageState extends State<StoreCustomerHomeLeftPage> {
Widget build(BuildContext context) {
// widget.customerProvider = Provider.of<widget.customerProvider>(context, listen: true);
return Scaffold(
// backgroundColor: Color.fromRGBO(246, 248, 250, 1),
// appBar: SystemAppBar('全店客情', onTap: () {
// EventBus().emit('changeStatusColor');
// Navigator.pop(context);
// }),
body: WillPopScope(onWillPop: () async {
EventBus().emit('changeStatusColor');
return true;
}, child: Consumer<CustomerProvider>(builder: (context, model, _) {
if (model.pageStateStoreHome != PageState.Success) {
if (model.pageStateStoreHome == PageState.Loading) {
return SingleChildScrollView(
controller: _controller,
child: Stack(alignment: Alignment.center, children: [
Column(children: [
VEmptyView(10),
// Stack(
// children: [
Container(
height: w(80),
color: MyColours.color_ffffff,
child: Row(
// backgroundColor: Color.fromRGBO(246, 248, 250, 1),
// appBar: SystemAppBar('全店客情', onTap: () {
// EventBus().emit('changeStatusColor');
// Navigator.pop(context);
// }),
body: Consumer<CustomerProvider>(builder: (context, model, _) {
if (model.pageStateStoreHome != PageState.Success) {
if (model.pageStateStoreHome == PageState.Loading) {
return SingleChildScrollView(
controller: _controller,
child: Stack(alignment: Alignment.center, children: [
Column(children: [
VEmptyView(10),
// Stack(
// children: [
Container(
height: w(80),
color: MyColours.color_ffffff,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'',
style: TextStyle(
color: MyColours.color_438E93,
fontSize: ScreenUtil().setSp(64),
fontWeight: FontWeight.bold),
),
Text(
'位',
style: TextStyle(
color: MyColours.color_515151,
// fontWeight: FontWeight.bold,
fontSize: ScreenUtil().setSp(32)),
)
],
),
),
VEmptyView(10),
Row(
children: [
_percentWidget('', '活跃', '', tap: false),
HEmptyView(10),
_percentWidget('', '60天未到店', '', tap: false),
HEmptyView(10),
_percentWidget('', '120天未到店', '', tap: false),
],
),
VEmptyView(10),
GridView.builder(
controller: _controller,
shrinkWrap: true,
cacheExtent: ScreenUtil().setWidth(0),
itemCount: 6,
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3,
childAspectRatio: 1.05,
mainAxisSpacing: ScreenUtil().setWidth(10),
crossAxisSpacing: ScreenUtil().setWidth(10)),
itemBuilder: (BuildContext context, int index) {
return _managerWidget('', '', null, '',
uid: '', onTap: () {});
})
]),
Align(
alignment: Alignment.center,
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
ClipRRect(
borderRadius: BorderRadius.circular(10),
child: Container(
width: 200,
height: 200,
color: Colors.transparent,
child: CupertinoActivityIndicator(
color: MyColours.color_000000,
radius: 30,
),
))
// VEmptyView(30),
// Text(
// '加载中,请稍后...',
// style: TextStyle(
// color: MyColours.color_666666,
// fontSize: ScreenUtil().setSp(24)),
// )
],
),
))
]));
}
return ExceptionPage(
pageState: model.pageStateStoreHome,
callback: () {
// getTableList();
_getSellerGuestManage();
_getSellerCountsList();
},
emptyMsg: "暂时没有全店客情哦",
emptyImg: "empty_search",
showMsg: "加载中,请稍后...",
);
} else {
return Column(children: [
Expanded(
child: SingleChildScrollView(
controller: _controller,
child: Column(
children: [
if (widget.customerProvider.storeSunmodel != null)
Column(
children: [
VEmptyView(10),
// Stack(
// children: [
InkWell(
onTap: () {
NavigatorUtil.goCustomerListPage(
context,
FromPage.FromPageHome,
'',
{
'object': widget
.customerProvider.storeSunmodel.sellerUser
},
);
},
child: Container(
height: w(80),
color: MyColours.color_ffffff,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'${widget.customerProvider.storeSunmodel.myCustomer}',
style: TextStyle(
color: MyColours.color_438E93,
fontSize: ScreenUtil().setSp(64),
fontWeight: FontWeight.bold),
),
Text(
'位',
style: TextStyle(
color: MyColours.color_515151,
// fontWeight: FontWeight.bold,
fontSize: ScreenUtil().setSp(32)),
)
],
),
)),
// Positioned(
// top: ScreenUtil().setWidth(30),
// right: ScreenUtil().setWidth(40),
// child: InkWell(
// onTap: () {
// NavigatorUtil.goCustomerSetPage(context);
// },
// child: Image.asset(Utils.getImgPath('c_set'),
// width: ScreenUtil().setWidth(40))))
// ],
// ),
VEmptyView(10),
Row(
children: [
Text(
'',
style: TextStyle(
color: MyColours.color_438E93,
fontSize: ScreenUtil().setSp(64),
fontWeight: FontWeight.bold),
),
Text(
'位',
style: TextStyle(
color: MyColours.color_515151,
// fontWeight: FontWeight.bold,
fontSize: ScreenUtil().setSp(32)),
)
_percentWidget(
'${widget.customerProvider.storeSunmodel.active.count}',
'活跃',
'${widget.customerProvider.storeSunmodel.active.scale}'),
HEmptyView(10),
_percentWidget(
'${widget.customerProvider.storeSunmodel.sleep.count}',
'60天未到店',
'${widget.customerProvider.storeSunmodel.sleep.scale}'),
HEmptyView(10),
_percentWidget(
'${widget.customerProvider.storeSunmodel.drain.count}',
'120天未到店',
'${widget.customerProvider.storeSunmodel.drain.scale}'),
],
),
),
VEmptyView(10),
Row(
children: [
_percentWidget('', '活跃', '', tap: false),
HEmptyView(10),
_percentWidget('', '60天未到店', '', tap: false),
HEmptyView(10),
_percentWidget('', '120天未到店', '', tap: false),
],
),
// GridView.builder(
// controller: _controller,
// shrinkWrap: true,
// cacheExtent: ScreenUtil().setWidth(0),
// itemCount: 3,
// gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
// crossAxisCount: 3,
// childAspectRatio: 1,
// mainAxisSpacing: ScreenUtil().setWidth(10),
// crossAxisSpacing: ScreenUtil().setWidth(10)),
// itemBuilder: (BuildContext context, int index) {
// // locationState = state;
// return _percentWidget('1999', '活跃客户', '39.20');
// }),
// Row(
// children: [
// _percentWidget('19992', '活跃客户', '90.90'),
// HEmptyView(10),
// _percentWidget('19992', '沉睡客户', '90.90'),
// HEmptyView(10),
// _percentWidget('19992', '流失客户', '5.90'),
// ],
// ),
// Padding(
// padding: EdgeInsets.symmetric(
// vertical: ScreenUtil().setWidth(30)),
// child: Text(
// '客户经理',
// style: TextStyle(
// fontSize: ScreenUtil().setSp(28),
// color: MyColours.color_333333),
// ),
// ),
VEmptyView(10),
GridView.builder(
controller: _controller,
shrinkWrap: true,
cacheExtent: ScreenUtil().setWidth(0),
itemCount: widget.customerProvider.storeSunmodel
.sellerUser.length +
1,
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3,
childAspectRatio: 1.05,
mainAxisSpacing: ScreenUtil().setWidth(10),
crossAxisSpacing: ScreenUtil().setWidth(10)),
itemBuilder: (BuildContext context, int index) {
// locationState = state;
if (index == 0) {
return _managerWidget(
'${widget.customerProvider.storeSunmodel.distribution}',
'未分配经理',
null,
'${widget.customerProvider.storeSunmodel.distributionStr}',
onTap: () {
NavigatorUtil.goCustomerListPage(
context,
FromPage.FromPageHome,
'',
{
'object': widget.customerProvider
.storeSunmodel.sellerUser
},
index: '0',
distribution: true);
});
}
VEmptyView(10),
GridView.builder(
controller: _controller,
shrinkWrap: true,
cacheExtent: ScreenUtil().setWidth(0),
itemCount: 6,
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3,
childAspectRatio: 1.05,
mainAxisSpacing: ScreenUtil().setWidth(10),
crossAxisSpacing: ScreenUtil().setWidth(10)),
itemBuilder: (BuildContext context, int index) {
return _managerWidget('', '', null, '',
uid: '', onTap: () {});
})
]),
Align(
alignment: Alignment.center,
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
ClipRRect(
borderRadius: BorderRadius.circular(10),
child: Container(
width: 200,
height: 200,
color: Colors.transparent,
child: CupertinoActivityIndicator(
color: MyColours.color_000000,
radius: 30,
),
))
// VEmptyView(30),
// Text(
// '加载中,请稍后...',
// style: TextStyle(
// color: MyColours.color_666666,
// fontSize: ScreenUtil().setSp(24)),
// )
],
),
))
]));
}
return ExceptionPage(
pageState: model.pageStateStoreHome,
callback: () {
// getTableList();
_getSellerGuestManage();
_getSellerCountsList();
},
emptyMsg: "暂时没有全店客情哦",
emptyImg: "empty_search",
showMsg: "加载中,请稍后...",
);
} else {
return Column(children: [
Expanded(
child: SingleChildScrollView(
controller: _controller,
child: Column(
children: [
if (widget.customerProvider.storeSunmodel != null)
Column(
children: [
VEmptyView(10),
// Stack(
// children: [
InkWell(
onTap: () {
return _managerWidget(
'${widget.customerProvider.storeSunmodel.sellerUser[index - 1].count}',
widget.customerProvider.storeSunmodel
.sellerUser[index - 1].account ==
null
? ''
: '${widget.customerProvider.storeSunmodel.sellerUser[index - 1].nickName ?? widget.customerProvider.storeSunmodel.sellerUser[index - 1].account}',
null,
'${widget.customerProvider.storeSunmodel.sellerUser[index - 1].detailStr}',
uid: widget.customerProvider.storeSunmodel
.sellerUser[index - 1].uid, onTap: () {
NavigatorUtil.goCustomerListPage(
context,
FromPage.FromPageHome,
'',
widget.customerProvider.storeSunmodel
.sellerUser[index - 1].uid,
{
'object': widget
.customerProvider.storeSunmodel.sellerUser
},
index: '0',
);
},
child: Container(
height: w(80),
color: MyColours.color_ffffff,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'${widget.customerProvider.storeSunmodel.myCustomer}',
style: TextStyle(
color: MyColours.color_438E93,
fontSize: ScreenUtil().setSp(64),
fontWeight: FontWeight.bold),
),
Text(
'位',
style: TextStyle(
color: MyColours.color_515151,
// fontWeight: FontWeight.bold,
fontSize: ScreenUtil().setSp(32)),
)
],
),
)),
// Positioned(
// top: ScreenUtil().setWidth(30),
// right: ScreenUtil().setWidth(40),
// child: InkWell(
// onTap: () {
// NavigatorUtil.goCustomerSetPage(context);
// },
// child: Image.asset(Utils.getImgPath('c_set'),
// width: ScreenUtil().setWidth(40))))
// ],
// ),
VEmptyView(10),
Row(
children: [
_percentWidget(
'${widget.customerProvider.storeSunmodel.active.count}',
'活跃',
'${widget.customerProvider.storeSunmodel.active.scale}'),
HEmptyView(10),
_percentWidget(
'${widget.customerProvider.storeSunmodel.sleep.count}',
'60天未到店',
'${widget.customerProvider.storeSunmodel.sleep.scale}'),
HEmptyView(10),
_percentWidget(
'${widget.customerProvider.storeSunmodel.drain.count}',
'120天未到店',
'${widget.customerProvider.storeSunmodel.drain.scale}'),
],
),
// GridView.builder(
// controller: _controller,
// shrinkWrap: true,
// cacheExtent: ScreenUtil().setWidth(0),
// itemCount: 3,
// gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
// crossAxisCount: 3,
// childAspectRatio: 1,
// mainAxisSpacing: ScreenUtil().setWidth(10),
// crossAxisSpacing: ScreenUtil().setWidth(10)),
// itemBuilder: (BuildContext context, int index) {
// // locationState = state;
// return _percentWidget('1999', '活跃客户', '39.20');
// }),
// Row(
// children: [
// _percentWidget('19992', '活跃客户', '90.90'),
// HEmptyView(10),
// _percentWidget('19992', '沉睡客户', '90.90'),
// HEmptyView(10),
// _percentWidget('19992', '流失客户', '5.90'),
// ],
// ),
// Padding(
// padding: EdgeInsets.symmetric(
// vertical: ScreenUtil().setWidth(30)),
// child: Text(
// '客户经理',
// style: TextStyle(
// fontSize: ScreenUtil().setSp(28),
// color: MyColours.color_333333),
// ),
// ),
VEmptyView(10),
GridView.builder(
controller: _controller,
shrinkWrap: true,
cacheExtent: ScreenUtil().setWidth(0),
itemCount: widget.customerProvider.storeSunmodel
.sellerUser.length +
1,
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3,
childAspectRatio: 1.05,
mainAxisSpacing: ScreenUtil().setWidth(10),
crossAxisSpacing:
ScreenUtil().setWidth(10)),
itemBuilder: (BuildContext context, int index) {
// locationState = state;
if (index == 0) {
return _managerWidget(
'${widget.customerProvider.storeSunmodel.distribution}',
'未分配经理',
null,
'${widget.customerProvider.storeSunmodel.distributionStr}',
onTap: () {
NavigatorUtil.goCustomerListPage(
context,
FromPage.FromPageHome,
'',
{
'object': widget.customerProvider
.storeSunmodel.sellerUser
},
index: '0',
distribution: true);
});
}
return _managerWidget(
'${widget.customerProvider.storeSunmodel.sellerUser[index - 1].count}',
widget.customerProvider.storeSunmodel
.sellerUser[index - 1].account ==
null
? ''
: '${widget.customerProvider.storeSunmodel.sellerUser[index - 1].nickName ?? widget.customerProvider.storeSunmodel.sellerUser[index - 1].account}',
null,
'${widget.customerProvider.storeSunmodel.sellerUser[index - 1].detailStr}',
uid: widget.customerProvider.storeSunmodel
.sellerUser[index - 1].uid, onTap: () {
NavigatorUtil.goCustomerListPage(
context,
FromPage.FromPageHome,
widget.customerProvider.storeSunmodel
.sellerUser[index - 1].uid,
{
'object': widget.customerProvider
.storeSunmodel.sellerUser
},
index: '0',
);
});
}),
],
),
});
}),
],
),
VEmptyView(10),
// ListView.builder(
// shrinkWrap: true,
// controller: _controller,
// itemCount: 2,
// itemBuilder: (context, index) {
// return Container(
// padding: EdgeInsets.symmetric(
// vertical: w(12), horizontal: w(16)),
// decoration: BoxDecoration(
// color: MyColours.color_ffffff,
// border: Border(
// bottom: BorderSide(
// color: index == 2 - 1
// ? MyColours.color_ffffff
// : MyColours.color_E7E7E7,
// width: w(1)))),
// child: Row(
// children: [
// Expanded(
// child: Text(
// '7天内存酒超期:5位/7天内纪念日提醒:3位',
// style: TextStyle(
// fontSize: font(16),
// color: MyColours.color_515151),
// )),
// Text(
// '创建营销计划',
// style: TextStyle(
// fontSize: font(16),
// color: MyColours.color_999999),
// ),
// HEmptyView(20),
// Image.asset(
// Utils.getImgPath('arrow_right_new'),
// width: w(12),
// )
// ],
// ),
// );
// }),
VEmptyView(10),
// ListView.builder(
// shrinkWrap: true,
// controller: _controller,
// itemCount: 2,
// itemBuilder: (context, index) {
// return Container(
// padding: EdgeInsets.symmetric(
// vertical: w(12), horizontal: w(16)),
// decoration: BoxDecoration(
// color: MyColours.color_ffffff,
// border: Border(
// bottom: BorderSide(
// color: index == 2 - 1
// ? MyColours.color_ffffff
// : MyColours.color_E7E7E7,
// width: w(1)))),
// child: Row(
// children: [
// Expanded(
// child: Text(
// '7天内存酒超期:5位/7天内纪念日提醒:3位',
// style: TextStyle(
// fontSize: font(16),
// color: MyColours.color_515151),
// )),
// Text(
// '创建营销计划',
// style: TextStyle(
// fontSize: font(16),
// color: MyColours.color_999999),
// ),
// HEmptyView(20),
// Image.asset(
// Utils.getImgPath('arrow_right_new'),
// width: w(12),
// )
// ],
// ),
// );
// }),
if (widget.customerProvider.homeStatisticsList != null &&
widget.customerProvider.homeStatisticsList.length > 0)
Column(
children: [
_chart(),
// _monthWidget(),
if (widget.customerProvider.homeStatisticsList != null &&
widget.customerProvider.homeStatisticsList.length > 0)
Column(
children: [
_chart(),
// _monthWidget(),
ListView.builder(
itemCount: widget
.customerProvider.homeStatisticsList.length,
shrinkWrap: true,
controller: _controller,
padding: EdgeInsets.symmetric(horizontal: w(10)),
itemBuilder: (context, index) {
SellerCountsListSunModel countsListSunModel =
widget.customerProvider
.homeStatisticsList[index];
return InkWell(
onTap: () {
NavigatorUtil.goMonthOrderPage(
context,
year.toString(),
countsListSunModel.monthss.toString());
},
child: MonthItem(
countsListSunModel: countsListSunModel));
}),
],
)
ListView.builder(
itemCount:
widget.customerProvider.homeStatisticsList.length,
shrinkWrap: true,
controller: _controller,
padding: EdgeInsets.symmetric(horizontal: w(10)),
itemBuilder: (context, index) {
SellerCountsListSunModel countsListSunModel = widget
.customerProvider.homeStatisticsList[index];
return InkWell(
onTap: () {
NavigatorUtil.goMonthOrderPage(
context,
year.toString(),
countsListSunModel.monthss.toString());
},
child: MonthItem(
countsListSunModel: countsListSunModel));
}),
],
)
/**
ListView.builder(
... ... @@ -1570,54 +1566,53 @@ class _StoreCustomerHomeLeftPageState extends State<StoreCustomerHomeLeftPage> {
);
})
*/
],
),
)),
if (widget.customerProvider.storeSunmodel != null)
Container(
color: MyColours.color_FAFAFA,
padding: EdgeInsets.only(
top: w(13), bottom: w(26), left: w(45), right: (45)),
child: Stack(
children: [
RoundButton(
onPressed: () {
NavigatorUtil.goMarketingRecordsPage(
context, FromPage.FromPageStoreCustomer, {
'object':
widget.customerProvider.storeSunmodel.sellerUser
});
},
text: '历史营销记录',
fontSize: 32,
isBold: true,
// margin: EdgeInsets.only(
// top: w(13),
// bottom: w(26),
// left: w(45),
// right: (45)),
textColor: MyColours.color_F8F9FD,
gradientStart: MyColours.color_199095,
gradientEnd: MyColours.color_199095,
borderColor: MyColours.color_199095,
height: ScreenUtil().setWidth(86),
// width: ScreenUtil().setWidth(260),
radius: ScreenUtil().setWidth(10),
),
showWarning
? Positioned(
right: ScreenUtil().setWidth(30),
top: ScreenUtil().setWidth(45 / 2),
child: Image.asset(
Utils.getImgPath('warning'),
width: ScreenUtil().setWidth(35),
))
: SizedBox()
],
))
]);
}
})),
);
],
),
)),
if (widget.customerProvider.storeSunmodel != null)
Container(
color: MyColours.color_FAFAFA,
padding: EdgeInsets.only(
top: w(13), bottom: w(26), left: w(45), right: (45)),
child: Stack(
children: [
RoundButton(
onPressed: () {
NavigatorUtil.goMarketingRecordsPage(
context, FromPage.FromPageStoreCustomer, {
'object':
widget.customerProvider.storeSunmodel.sellerUser
});
},
text: '历史营销记录',
fontSize: 32,
isBold: true,
// margin: EdgeInsets.only(
// top: w(13),
// bottom: w(26),
// left: w(45),
// right: (45)),
textColor: MyColours.color_F8F9FD,
gradientStart: MyColours.color_199095,
gradientEnd: MyColours.color_199095,
borderColor: MyColours.color_199095,
height: ScreenUtil().setWidth(86),
// width: ScreenUtil().setWidth(260),
radius: ScreenUtil().setWidth(10),
),
showWarning
? Positioned(
right: ScreenUtil().setWidth(30),
top: ScreenUtil().setWidth(45 / 2),
child: Image.asset(
Utils.getImgPath('warning'),
width: ScreenUtil().setWidth(35),
))
: SizedBox()
],
))
]);
}
}));
}
}
... ...
... ... @@ -51,6 +51,12 @@ class _StoreCustomerHomePageState extends State<StoreCustomerHomePage>
});
}
@override
void dispose() {
EventBus().emit('changeStatusColor');
super.dispose();
}
///全店客情首页
_getSellerGuestManage() async {
StoreCustomerHomeSunModel model =
... ... @@ -64,84 +70,73 @@ class _StoreCustomerHomePageState extends State<StoreCustomerHomePage>
return Scaffold(
appBar: SystemAppBar(
'全店客情',
onTap: () {
EventBus().emit('changeStatusColor');
Navigator.pop(context);
},
rightImgName: 'c_set.png',
onTapRight: () {
NavigatorUtil.goCustomerSetPage(context);
},
),
body: WillPopScope(
onWillPop: () async {
EventBus().emit('changeStatusColor');
return true;
},
child: Column(
children: [
Container(
alignment: Alignment.center,
width: double.infinity,
color: MyColours.color_ffffff,
padding: EdgeInsets.only(bottom: w(9), top: w(9)),
child: TabBar(
onTap: (index) {
print(index);
},
controller: tabController,
isScrollable: true,
indicatorColor: MyColours.color_438E93,
indicatorSize: TabBarIndicatorSize.tab,
indicatorWeight: w(2),
unselectedLabelColor: MyColours.color_999999,
labelColor: MyColours.color_438E93,
labelStyle: TextStyle(
fontSize: w(14),
color: MyColours.color_438E93,
fontWeight: FontWeight.bold),
unselectedLabelStyle: TextStyle(
fontSize: w(12), color: MyColours.color_999999),
indicatorPadding:
EdgeInsets.only(left: w(24), right: w(24)),
// labelPadding:
// EdgeInsets.symmetric(horizontal: w(32)), //tabs控件之间的间距
tabs: [
Tab(
height: w(30),
child: Container(
width: w(100),
alignment: Alignment.center,
child: Text(
'全店',
),
)),
Tab(
height: w(30),
child: Container(
width: w(100),
alignment: Alignment.center,
child: Text(
'分经理',
)),
),
],
// indicatorPadding: EdgeInsets.only(
// left: ScreenUtil().setWidth(16),
// right: ScreenUtil().setWidth(32)),
// indicatorWeight: ScreenUtil().setWidth(6.0),
)),
Expanded(
child: TabBarView(controller: tabController, children: [
StoreCustomerHomeLeftPage(
customerProvider: customerProvider,
body: Column(
children: [
Container(
alignment: Alignment.center,
width: double.infinity,
color: MyColours.color_ffffff,
padding: EdgeInsets.only(bottom: w(9), top: w(9)),
child: TabBar(
onTap: (index) {
print(index);
},
controller: tabController,
isScrollable: true,
indicatorColor: MyColours.color_438E93,
indicatorSize: TabBarIndicatorSize.tab,
indicatorWeight: w(2),
unselectedLabelColor: MyColours.color_999999,
labelColor: MyColours.color_438E93,
labelStyle: TextStyle(
fontSize: w(14),
color: MyColours.color_438E93,
fontWeight: FontWeight.bold),
unselectedLabelStyle:
TextStyle(fontSize: w(12), color: MyColours.color_999999),
indicatorPadding: EdgeInsets.only(left: w(24), right: w(24)),
// labelPadding:
// EdgeInsets.symmetric(horizontal: w(32)), //tabs控件之间的间距
tabs: [
Tab(
height: w(30),
child: Container(
width: w(100),
alignment: Alignment.center,
child: Text(
'全店',
),
)),
Tab(
height: w(30),
child: Container(
width: w(100),
alignment: Alignment.center,
child: Text(
'分经理',
)),
),
StoreCustomerHomeRightPage(
customerProvider: customerProvider)
]),
],
// indicatorPadding: EdgeInsets.only(
// left: ScreenUtil().setWidth(16),
// right: ScreenUtil().setWidth(32)),
// indicatorWeight: ScreenUtil().setWidth(6.0),
)),
Expanded(
child: TabBarView(controller: tabController, children: [
StoreCustomerHomeLeftPage(
customerProvider: customerProvider,
),
],
)));
StoreCustomerHomeRightPage(customerProvider: customerProvider)
]),
),
],
));
}
}
... ...
... ... @@ -398,12 +398,7 @@ class _StoreCustomerHomeRightPageState
// EventBus().emit('changeStatusColor');
// Navigator.pop(context);
// }),
body: WillPopScope(
onWillPop: () async {
EventBus().emit('changeStatusColor');
return true;
},
child: Column(children: [
body: Column(children: [
Container(
color: MyColours.color_ffffff,
height: ScreenUtil().setWidth(70),
... ... @@ -1066,6 +1061,6 @@ class _StoreCustomerHomeRightPageState
// : SizedBox()
// ],
// ))
])));
]));
}
}
... ...
... ... @@ -92,6 +92,7 @@ class _MarkingCouponSelectPageState extends State<MarkingCouponSelectPage> {
@override
void dispose() {
super.dispose();
}
... ... @@ -106,147 +107,140 @@ class _MarkingCouponSelectPageState extends State<MarkingCouponSelectPage> {
Navigator.pop(context);
},
),
body: WillPopScope(
child: Column(
children: [
Expanded(child: Consumer<CouponProvider>(
builder: (context, model, _) {
if (model.pageStateSelect != PageState.Success) {
return ExceptionPage(
pageState: model.pageStateSelect,
callback: () {
_couponNetworkData();
// offset = 0;
// getMessage(showLoading: true);
body: Column(
children: [
Expanded(child: Consumer<CouponProvider>(
builder: (context, model, _) {
if (model.pageStateSelect != PageState.Success) {
return ExceptionPage(
pageState: model.pageStateSelect,
callback: () {
_couponNetworkData();
// offset = 0;
// getMessage(showLoading: true);
},
emptyMsg: "暂时没有列表信息哦",
emptyImg: "empty_search",
showMsg: "加载中,请稍后...",
);
} else {
return EasyRefresh.custom(
controller: _controller,
shrinkWrap: true,
slivers: [
SliverList(
delegate: SliverChildBuilderDelegate(
(BuildContext context, int index) {
return VEmptyView(40);
}, childCount: 1),
),
SliverList(
delegate: SliverChildBuilderDelegate(
(BuildContext context, int index) {
return InkWell(
onTap: () {
//改这里 ******8
// couponProvider.couponListSelect
// .forEach((element) {
// element.isCheck = false;
// });
// couponProvider.couponListSelect[index].isCheck =
// true;
couponProvider.couponListSelect[index].isCheck =
!couponProvider
.couponListSelect[index].isCheck;
if (couponProvider
.couponListSelect[index].isCheck) {
selectDataList.add(
couponProvider.couponListSelect[index]);
} else {
selectDataList.remove(
couponProvider.couponListSelect[index]);
}
setState(() {});
},
// child: Row(
// children: [
// HEmptyView(30),
// !widget.hasModify
// ? Checkbox(
// value: couponProvider
// .couponListSelect[index].isCheck,
// checkColor: MyColours.color_ffffff,
// activeColor: MyColours.app_main,
// onChanged: (bool value) {},
// )
// : Container(),
// Image.asset(
// couponProvider.listData[index]['checked']
// ? 'assets/select.png'
// : 'assets/unselect.png',
// width: ScreenUtil().setWidth(44)),
child: CouponItemF(
from: 'select',
showCheck: true,
radio: true,
couponSonModel:
couponProvider.couponListSelect[index],
onPressed: () {
// bool old = couponProvider
// .couponListSelect[index].isCheck;
//改这里 ******8
couponProvider
.couponListSelect[index].isCheck =
!couponProvider
.couponListSelect[index].isCheck;
if (couponProvider
.couponListSelect[index].isCheck) {
selectDataList.add(
couponProvider.couponListSelect[index]);
} else {
selectDataList.remove(
couponProvider.couponListSelect[index]);
}
// couponProvider
// .couponListSelect[index].isCheck = !old;
setState(() {});
}));
}, childCount: couponProvider.couponListSelect.length),
)
],
// onRefresh: () async {
// // offset = 0;
// // getMessage(showLoading: false);
// },
// onLoad: () async {
// // offset++;
// // getMessage(showLoading: false);
// },
);
}
},
)),
VEmptyView(20),
couponProvider.pageStateSelect == PageState.Success
? Padding(
padding: EdgeInsets.fromLTRB(ScreenUtil().setWidth(40), 0,
ScreenUtil().setWidth(40), ScreenUtil().setWidth(40)),
child: RoundButton(
onPressed: () async {
Map temp = {
'coupon': selectDataList,
};
Navigator.pop(context, temp);
},
emptyMsg: "暂时没有列表信息哦",
emptyImg: "empty_search",
showMsg: "加载中,请稍后...",
);
} else {
return EasyRefresh.custom(
controller: _controller,
shrinkWrap: true,
slivers: [
SliverList(
delegate: SliverChildBuilderDelegate(
(BuildContext context, int index) {
return VEmptyView(40);
}, childCount: 1),
),
SliverList(
delegate: SliverChildBuilderDelegate(
(BuildContext context, int index) {
return InkWell(
onTap: () {
//改这里 ******8
// couponProvider.couponListSelect
// .forEach((element) {
// element.isCheck = false;
// });
// couponProvider.couponListSelect[index].isCheck =
// true;
couponProvider.couponListSelect[index].isCheck =
!couponProvider
.couponListSelect[index].isCheck;
if (couponProvider
.couponListSelect[index].isCheck) {
selectDataList.add(
couponProvider.couponListSelect[index]);
} else {
selectDataList.remove(
couponProvider.couponListSelect[index]);
}
setState(() {});
},
// child: Row(
// children: [
// HEmptyView(30),
// !widget.hasModify
// ? Checkbox(
// value: couponProvider
// .couponListSelect[index].isCheck,
// checkColor: MyColours.color_ffffff,
// activeColor: MyColours.app_main,
// onChanged: (bool value) {},
// )
// : Container(),
// Image.asset(
// couponProvider.listData[index]['checked']
// ? 'assets/select.png'
// : 'assets/unselect.png',
// width: ScreenUtil().setWidth(44)),
child: CouponItemF(
from: 'select',
showCheck: true,
radio: true,
couponSonModel:
couponProvider.couponListSelect[index],
onPressed: () {
// bool old = couponProvider
// .couponListSelect[index].isCheck;
//改这里 ******8
couponProvider
.couponListSelect[index].isCheck =
!couponProvider
.couponListSelect[index].isCheck;
if (couponProvider
.couponListSelect[index].isCheck) {
selectDataList.add(couponProvider
.couponListSelect[index]);
} else {
selectDataList.remove(couponProvider
.couponListSelect[index]);
}
// couponProvider
// .couponListSelect[index].isCheck = !old;
setState(() {});
}));
}, childCount: couponProvider.couponListSelect.length),
)
],
// onRefresh: () async {
// // offset = 0;
// // getMessage(showLoading: false);
// },
// onLoad: () async {
// // offset++;
// // getMessage(showLoading: false);
// },
);
}
},
)),
VEmptyView(20),
couponProvider.pageStateSelect == PageState.Success
? Padding(
padding: EdgeInsets.fromLTRB(ScreenUtil().setWidth(40), 0,
ScreenUtil().setWidth(40), ScreenUtil().setWidth(40)),
child: RoundButton(
onPressed: () async {
Map temp = {
'coupon': selectDataList,
};
Navigator.pop(context, temp);
},
text: '确定',
fontSize: 34,
isBold: false,
height: ScreenUtil().setWidth(80),
width: double.infinity,
radius: ScreenUtil().setWidth(10),
))
: Container()
],
),
onWillPop: () async {
Utils.changeStatusColor(color: Colors.transparent);
Navigator.of(context).pop();
return true;
},
text: '确定',
fontSize: 34,
isBold: false,
height: ScreenUtil().setWidth(80),
width: double.infinity,
radius: ScreenUtil().setWidth(10),
))
: Container()
],
),
);
}
... ...
... ... @@ -113,8 +113,7 @@ class _MarkingRechargeSelectPageState extends State<MarkingRechargeSelectPage> {
Navigator.pop(context);
},
),
body: WillPopScope(
child: Column(
body: Column(
children: [
Expanded(child: Consumer<MarketingCenterProvider>(
builder: (context, model, _) {
... ... @@ -228,13 +227,8 @@ class _MarkingRechargeSelectPageState extends State<MarkingRechargeSelectPage> {
))
: Container()
],
),
onWillPop: () async {
Utils.changeStatusColor(color: Colors.transparent);
Navigator.of(context).pop();
return true;
},
),
)
);
}
}
... ...
... ... @@ -142,6 +142,12 @@ class _MarketingCenterHomePageState extends State<MarketingCenterHomePage> {
// }
@override
void dispose() {
EventBus().emit('changeStatusColor');
super.dispose();
}
@override
Widget build(BuildContext context) {
marketingCenterProvider =
Provider.of<MarketingCenterProvider>(context, listen: true);
... ... @@ -149,292 +155,283 @@ class _MarketingCenterHomePageState extends State<MarketingCenterHomePage> {
backgroundColor: Colors.white,
appBar: SystemAppBar(
'营销中心',
onTap: () {
EventBus().emit('changeStatusColor');
Navigator.pop(context);
},
),
body: WillPopScope(
onWillPop: () {
EventBus().emit('changeStatusColor');
Navigator.of(context).pop();
},
child: Column(
children: [
Expanded(
child: SingleChildScrollView(
child: Column(
children: [
InkWell(
onTap: () {
NavigatorUtil.goRechargeHomePage(context);
},
child: Padding(
padding: EdgeInsets.only(
left: w(16),
top: w(12),
bottom: w(12),
right: w(12)),
child: Row(
children: [
Text(
'会员充值优惠活动',
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setWidth(32)),
),
Spacer(),
Container(
padding: EdgeInsets.symmetric(
horizontal: w(7), vertical: w(4)),
child: Image.asset(
"assets/arrow_right_new.png",
width: ScreenUtil().setWidth(18),
height: ScreenUtil().setWidth(32),
),
)
],
))),
Padding(
padding: EdgeInsets.only(left: w(16)),
child: MyDivider(double.infinity, w(0.5),
color: MyColours.color_E7E7E7)),
VEmptyView(24),
InkWell(
onTap: () {
NavigatorUtil.goOrderSettingPage(context);
},
child: Padding(
padding: EdgeInsets.only(
left: w(16),
top: w(12),
bottom: w(12),
right: w(12)),
child: Row(
children: [
Text(
'提前点菜',
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setWidth(32)),
),
Spacer(),
Container(
padding: EdgeInsets.symmetric(
horizontal: w(7), vertical: w(4)),
child: Image.asset(
"assets/arrow_right_new.png",
width: ScreenUtil().setWidth(18),
height: ScreenUtil().setWidth(32),
),
)
],
))),
Padding(
padding: EdgeInsets.only(left: w(16)),
child: MyDivider(double.infinity, w(0.5),
color: MyColours.color_E7E7E7)),
VEmptyView(24),
InkWell(
onTap: () {
NavigatorUtil.goCustomerNoticeSettingPage(context);
},
child: Padding(
padding: EdgeInsets.only(
left: w(16),
top: w(12),
bottom: w(12),
right: w(12)),
child: Row(
children: [
Text(
'客户通知设置',
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setWidth(32)),
),
Spacer(),
Container(
padding: EdgeInsets.symmetric(
horizontal: w(7), vertical: w(4)),
child: Image.asset(
"assets/arrow_right_new.png",
width: ScreenUtil().setWidth(18),
height: ScreenUtil().setWidth(32),
),
)
],
))),
Padding(
padding: EdgeInsets.only(left: w(16)),
child: MyDivider(double.infinity, w(0.5),
color: MyColours.color_E7E7E7)),
VEmptyView(24),
// InkWell(
// onTap: () {
// setState(() {
// selectShowPrice = !selectShowPrice;
// });
// },
// child: Padding(
// padding: EdgeInsets.only(
// left: w(16),
// top: w(12),
// bottom: w(12),
// right: w(12)),
// child: Row(
// mainAxisAlignment:
// MainAxisAlignment.spaceBetween,
// children: [
// Text(
// '分享排菜单给客户时展示菜品价格',
// style: TextStyle(
// color: MyColours.color_515151,
// fontSize: ScreenUtil().setWidth(32)),
// ),
// Spacer(),
// Container(
// padding: EdgeInsets.symmetric(
// horizontal: w(7), vertical: w(4)),
// child: Image.asset(
// Utils.getImgPath(selectShowPrice
// ? 'swich_on'
// : 'swich_off'),
// width: w(44),
// ),
// )
// // RoundButton(
// // text: '预览',
// // gradientStart: MyColours.color_ffffff,
// // gradientEnd: MyColours.color_ffffff,
// // borderColor: MyColours.color_438E93,
// // textColor: MyColours.color_438E93,
// // radius: ScreenUtil().setWidth(22),
// // fontSize: 24,
// // width: w(72),
// // height: ScreenUtil().setWidth(44),
// // isBold: true,
// // onPressed: () {
// // NavigatorUtil.goMarkingPreviewPage(context);
// // },
// // ),
// ]))),
// Padding(
// padding: EdgeInsets.only(left: w(16)),
// child: MyDivider(double.infinity, w(0.5),
// color: MyColours.color_E7E7E7)),
// VEmptyView(20),
// InkWell(
// onTap: () {
// setState(() {
// select = !select;
// });
// },
// child: Padding(
// padding: EdgeInsets.only(
// left: w(16),
// top: w(12),
// bottom: w(12),
// right: w(12)),
// child: Row(
// mainAxisAlignment:
// MainAxisAlignment.spaceBetween,
// children: [
// Text(
// '启用预订安排通知图文模式',
// style: TextStyle(
// color: MyColours.color_515151,
// fontSize: ScreenUtil().setWidth(32)),
// ),
// Spacer(),
// Container(
// padding: EdgeInsets.symmetric(
// horizontal: w(7), vertical: w(4)),
// child: Image.asset(
// Utils.getImgPath(
// select ? 'swich_on' : 'swich_off'),
// width: w(44),
// ),
// )
// // RoundButton(
// // text: '预览',
// // gradientStart: MyColours.color_ffffff,
// // gradientEnd: MyColours.color_ffffff,
// // borderColor: MyColours.color_438E93,
// // textColor: MyColours.color_438E93,
// // radius: ScreenUtil().setWidth(22),
// // fontSize: 24,
// // width: w(72),
// // height: ScreenUtil().setWidth(44),
// // isBold: true,
// // onPressed: () {
// // NavigatorUtil.goMarkingPreviewPage(context);
// // },
// // ),
// ]))),
// Padding(
// padding: EdgeInsets.only(left: w(16)),
// child: MyDivider(double.infinity, w(0.5),
// color: MyColours.color_E7E7E7)),
// _item('首图形象展示', onTap: () {
// NavigatorUtil.goFirstImagePage(context);
// }),
// _item('预订信息模块', onTap: () {
// NavigatorUtil.goBookInfoPage(context);
// }),
// _item('店铺介绍展示', onTap: () {
// NavigatorUtil.goStoreIntroducePage(context);
// }),
// _item('主厨介绍展示', onTap: () {
// NavigatorUtil.goChefIntroducePage(context);
// }),
// _item('招牌菜展示', onTap: () {
// NavigatorUtil.goDishShowPage(context);
// }),
// _item('营销及客户互动功能', onTap: () {
// NavigatorUtil.goMarkingInteractionPage(context);
// }),
],
),
)),
// Container(
// color: MyColours.color_ffffff,
// padding: EdgeInsets.only(
// left: w(23), right: w(23), top: w(12), bottom: w(25)),
// child: Row(
// children: [
// RoundButton(
// text: '图文预览',
// width: w(100),
// gradientStart: MyColours.color_ffffff,
// gradientEnd: MyColours.color_ffffff,
// borderColor: MyColours.color_438E93,
// radius: r(5),
// fontSize: 32,
// height: w(40),
// textColor: MyColours.color_438E93,
// isBold: true,
// onPressed: () async {
// NavigatorUtil.goMarkingPreviewPage(context);
// }),
// HEmptyView(30),
// Expanded(
// child: RoundButton(
// text: '保存',
// gradientStart: MyColours.color_199095,
// gradientEnd: MyColours.color_199095,
// // borderColor: MyColours.color_999999,
// radius: r(5),
// fontSize: 32,
// height: w(40),
// isBold: true,
// onPressed: () async {
// //调用接口
// _setData();
// }))
// ],
// ))
],
)));
body: Column(
children: [
Expanded(
child: SingleChildScrollView(
child: Column(
children: [
InkWell(
onTap: () {
NavigatorUtil.goRechargeHomePage(context);
},
child: Padding(
padding: EdgeInsets.only(
left: w(16),
top: w(12),
bottom: w(12),
right: w(12)),
child: Row(
children: [
Text(
'会员充值优惠活动',
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setWidth(32)),
),
Spacer(),
Container(
padding: EdgeInsets.symmetric(
horizontal: w(7), vertical: w(4)),
child: Image.asset(
"assets/arrow_right_new.png",
width: ScreenUtil().setWidth(18),
height: ScreenUtil().setWidth(32),
),
)
],
))),
Padding(
padding: EdgeInsets.only(left: w(16)),
child: MyDivider(double.infinity, w(0.5),
color: MyColours.color_E7E7E7)),
VEmptyView(24),
InkWell(
onTap: () {
NavigatorUtil.goOrderSettingPage(context);
},
child: Padding(
padding: EdgeInsets.only(
left: w(16),
top: w(12),
bottom: w(12),
right: w(12)),
child: Row(
children: [
Text(
'提前点菜',
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setWidth(32)),
),
Spacer(),
Container(
padding: EdgeInsets.symmetric(
horizontal: w(7), vertical: w(4)),
child: Image.asset(
"assets/arrow_right_new.png",
width: ScreenUtil().setWidth(18),
height: ScreenUtil().setWidth(32),
),
)
],
))),
Padding(
padding: EdgeInsets.only(left: w(16)),
child: MyDivider(double.infinity, w(0.5),
color: MyColours.color_E7E7E7)),
VEmptyView(24),
InkWell(
onTap: () {
NavigatorUtil.goCustomerNoticeSettingPage(context);
},
child: Padding(
padding: EdgeInsets.only(
left: w(16),
top: w(12),
bottom: w(12),
right: w(12)),
child: Row(
children: [
Text(
'客户通知设置',
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setWidth(32)),
),
Spacer(),
Container(
padding: EdgeInsets.symmetric(
horizontal: w(7), vertical: w(4)),
child: Image.asset(
"assets/arrow_right_new.png",
width: ScreenUtil().setWidth(18),
height: ScreenUtil().setWidth(32),
),
)
],
))),
Padding(
padding: EdgeInsets.only(left: w(16)),
child: MyDivider(double.infinity, w(0.5),
color: MyColours.color_E7E7E7)),
VEmptyView(24),
// InkWell(
// onTap: () {
// setState(() {
// selectShowPrice = !selectShowPrice;
// });
// },
// child: Padding(
// padding: EdgeInsets.only(
// left: w(16),
// top: w(12),
// bottom: w(12),
// right: w(12)),
// child: Row(
// mainAxisAlignment:
// MainAxisAlignment.spaceBetween,
// children: [
// Text(
// '分享排菜单给客户时展示菜品价格',
// style: TextStyle(
// color: MyColours.color_515151,
// fontSize: ScreenUtil().setWidth(32)),
// ),
// Spacer(),
// Container(
// padding: EdgeInsets.symmetric(
// horizontal: w(7), vertical: w(4)),
// child: Image.asset(
// Utils.getImgPath(selectShowPrice
// ? 'swich_on'
// : 'swich_off'),
// width: w(44),
// ),
// )
// // RoundButton(
// // text: '预览',
// // gradientStart: MyColours.color_ffffff,
// // gradientEnd: MyColours.color_ffffff,
// // borderColor: MyColours.color_438E93,
// // textColor: MyColours.color_438E93,
// // radius: ScreenUtil().setWidth(22),
// // fontSize: 24,
// // width: w(72),
// // height: ScreenUtil().setWidth(44),
// // isBold: true,
// // onPressed: () {
// // NavigatorUtil.goMarkingPreviewPage(context);
// // },
// // ),
// ]))),
// Padding(
// padding: EdgeInsets.only(left: w(16)),
// child: MyDivider(double.infinity, w(0.5),
// color: MyColours.color_E7E7E7)),
// VEmptyView(20),
// InkWell(
// onTap: () {
// setState(() {
// select = !select;
// });
// },
// child: Padding(
// padding: EdgeInsets.only(
// left: w(16),
// top: w(12),
// bottom: w(12),
// right: w(12)),
// child: Row(
// mainAxisAlignment:
// MainAxisAlignment.spaceBetween,
// children: [
// Text(
// '启用预订安排通知图文模式',
// style: TextStyle(
// color: MyColours.color_515151,
// fontSize: ScreenUtil().setWidth(32)),
// ),
// Spacer(),
// Container(
// padding: EdgeInsets.symmetric(
// horizontal: w(7), vertical: w(4)),
// child: Image.asset(
// Utils.getImgPath(
// select ? 'swich_on' : 'swich_off'),
// width: w(44),
// ),
// )
// // RoundButton(
// // text: '预览',
// // gradientStart: MyColours.color_ffffff,
// // gradientEnd: MyColours.color_ffffff,
// // borderColor: MyColours.color_438E93,
// // textColor: MyColours.color_438E93,
// // radius: ScreenUtil().setWidth(22),
// // fontSize: 24,
// // width: w(72),
// // height: ScreenUtil().setWidth(44),
// // isBold: true,
// // onPressed: () {
// // NavigatorUtil.goMarkingPreviewPage(context);
// // },
// // ),
// ]))),
// Padding(
// padding: EdgeInsets.only(left: w(16)),
// child: MyDivider(double.infinity, w(0.5),
// color: MyColours.color_E7E7E7)),
// _item('首图形象展示', onTap: () {
// NavigatorUtil.goFirstImagePage(context);
// }),
// _item('预订信息模块', onTap: () {
// NavigatorUtil.goBookInfoPage(context);
// }),
// _item('店铺介绍展示', onTap: () {
// NavigatorUtil.goStoreIntroducePage(context);
// }),
// _item('主厨介绍展示', onTap: () {
// NavigatorUtil.goChefIntroducePage(context);
// }),
// _item('招牌菜展示', onTap: () {
// NavigatorUtil.goDishShowPage(context);
// }),
// _item('营销及客户互动功能', onTap: () {
// NavigatorUtil.goMarkingInteractionPage(context);
// }),
],
),
)),
// Container(
// color: MyColours.color_ffffff,
// padding: EdgeInsets.only(
// left: w(23), right: w(23), top: w(12), bottom: w(25)),
// child: Row(
// children: [
// RoundButton(
// text: '图文预览',
// width: w(100),
// gradientStart: MyColours.color_ffffff,
// gradientEnd: MyColours.color_ffffff,
// borderColor: MyColours.color_438E93,
// radius: r(5),
// fontSize: 32,
// height: w(40),
// textColor: MyColours.color_438E93,
// isBold: true,
// onPressed: () async {
// NavigatorUtil.goMarkingPreviewPage(context);
// }),
// HEmptyView(30),
// Expanded(
// child: RoundButton(
// text: '保存',
// gradientStart: MyColours.color_199095,
// gradientEnd: MyColours.color_199095,
// // borderColor: MyColours.color_999999,
// radius: r(5),
// fontSize: 32,
// height: w(40),
// isBold: true,
// onPressed: () async {
// //调用接口
// _setData();
// }))
// ],
// ))
],
));
}
}
... ...
... ... @@ -145,8 +145,7 @@ class _RechargeSelectStoreCouponPageState
// ],
// centerTitle: true, // 标题居中
// ),
body: WillPopScope(
child: Column(
body: Column(
children: [
Expanded(child: Consumer<CouponProvider>(
builder: (context, model, _) {
... ... @@ -350,12 +349,8 @@ class _RechargeSelectStoreCouponPageState
: Container()
],
),
onWillPop: () async {
Utils.changeStatusColor(color: Colors.transparent);
Navigator.of(context).pop();
return true;
},
),
);
}
}
... ...