Commit a2d191a0ef701aa9d3b064beb260f69adf1968b5

Authored by weixin_45529955
1 parent 22d258a2

客户管理 客情 non

Showing 25 changed files with 3184 additions and 1098 deletions

Too many changes to show.

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

... ... @@ -20,19 +20,19 @@ if (flutterRoot == null) {
def flutterVersionCode = "580"
def flutterVersionCode = "700"
if (flutterVersionCode == null) {
flutterVersionCode = '580'
flutterVersionCode = '700'
}
def flutterVersionName = "5.8.0"
def flutterVersionName = "7.0.0"
if (flutterVersionName == null) {
flutterVersionName = '5.8.0'
flutterVersionName = '7.0.0'
}
... ...
... ... @@ -87,6 +87,14 @@ class Constant {
'管理员',
'店长',
],
'消费金': [
'管理员',
'店长',
],
'会员充值': [
'管理员',
'店长',
],
'评价管理': [
'管理员',
'店长',
... ... @@ -233,6 +241,16 @@ class Constant {
'管理员',
'店长',
],
'预订管理': [
'管理员',
'店长',
],
'客户管理': [
'管理员',
'店长',
],
'优惠券详情-编辑发放人': [
'管理员',
'店长',
... ...
... ... @@ -196,10 +196,10 @@ class _CouponPageState extends State<CouponPage> with TickerProviderStateMixin {
appBar: Utils.getAuthority(context, '线上券-设置')
? SystemAppBar(
'优惠券',
rightImgName: 'set_g.png',
onTapRight: () {
NavigatorUtil.goCouponSettingPage(context);
},
// rightImgName: 'set_g.png',
// onTapRight: () {
// NavigatorUtil.goCouponSettingPage(context);
// },
)
: SystemAppBar(
'优惠券',
... ...
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:one_key/provider/user_model.dart';
import 'package:one_key/res/colors.dart';
import 'package:one_key/route/navigator_util.dart';
import 'package:one_key/utils/event_bus.dart';
import 'package:one_key/widgets/MyDivider.dart';
import 'package:one_key/widgets/v_empty_view.dart';
import 'package:provider/provider.dart';
import '../../../utils/screen_util.dart';
import '../../../widgets/system_app_bar.dart';
/***
* 预订管理首页
*/
class BookManageHomePage extends StatefulWidget {
BookManageHomePage({
Key? key,
}) : super(key: key);
@override
_BookManageHomePageState createState() => _BookManageHomePageState();
}
class _BookManageHomePageState extends State<BookManageHomePage> {
@override
void initState() {
super.initState();
WidgetsBinding.instance.addPostFrameCallback((_) {});
}
@override
void dispose() {
EventBus().emit('changeStatusColor');
super.dispose();
}
@override
Widget build(BuildContext context) {
UserModel userModel = Provider.of<UserModel>(context, listen: false);
return Scaffold(
backgroundColor: Colors.white,
appBar: SystemAppBar(
'预订管理',
),
body: Column(
children: [
Expanded(
child: SingleChildScrollView(
child: Column(
children: [
InkWell(
onTap: () async {
//
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: () {
//
NavigatorUtil.goPaymentSettingPage(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.goCustomLabelPage(context);
NavigatorUtil.goCommentsSettingPage(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.goOrderManageHomePage(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)),
],
),
)),
],
));
}
}
... ...
import 'dart:async';
import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_keyboard_visibility/flutter_keyboard_visibility.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:one_key/models/customer_label_model.dart';
import 'package:one_key/provider/customer_provider.dart';
import 'package:one_key/provider/user_model.dart';
import 'package:one_key/res/colors.dart';
import 'package:one_key/utils/dialog_util.dart';
import 'package:one_key/utils/utils.dart';
import 'package:one_key/widgets/MyDivider.dart';
import 'package:one_key/widgets/system_app_bar.dart';
import 'package:one_key/widgets/v_empty_view.dart';
import 'package:provider/provider.dart';
import '../../../../provider/marketing_center_provider.dart';
import '../../../../utils/screen_util.dart';
import '../../../../widgets/h_empty_view.dart';
import '../../../../widgets/round_button.dart';
class OrderCancelSetPage extends StatefulWidget {
OrderCancelSetPage({Key? key}) : super(key: key);
@override
_OrderCancelSetPageState createState() => _OrderCancelSetPageState();
}
class _OrderCancelSetPageState extends State<OrderCancelSetPage> {
late CustomerProvider customerProvider;
bool swichSync = false; //会员系统同步
String memberShow = '';
bool showLabel = false;
late MarketingCenterProvider marketingCenterProvider;
TextEditingController controllerDay = TextEditingController();
TextEditingController controllerDeadline = TextEditingController();
TextEditingController controllerConsumptionTimes = TextEditingController();
TextEditingController controllerHighValue = TextEditingController();
@override
void initState() {
WidgetsBinding.instance.addPostFrameCallback((_) async {
// _getContantData();
_sellerGuestGet();
_getLabelBySellerid();
getDzSellerConf();
});
}
getDzSellerConf() async {
bool success = await marketingCenterProvider.getDzSellerConf(context);
if (success && marketingCenterProvider.dzSellerConfModel != null) {
customerProvider.isReservePhoneApp =
marketingCenterProvider.dzSellerConfModel!.appPhoneSwitch == '1'
? true
: false;
customerProvider.ispcphone =
marketingCenterProvider.dzSellerConfModel!.pcNotPhone == '1'
? true
: false;
customerProvider.isAddOver =
marketingCenterProvider.dzSellerConfModel!.isAddOver == '1'
? true
: false;
customerProvider.isSetOver =
marketingCenterProvider.dzSellerConfModel!.isSetOver == '1'
? true
: false;
customerProvider.isReserveOver =
marketingCenterProvider.dzSellerConfModel!.isReserveOver == '1'
? true
: false;
customerProvider.isReserveCancel =
marketingCenterProvider.dzSellerConfModel!.isReserveCancel == '1'
? true
: false;
customerProvider.ispcname =
marketingCenterProvider.dzSellerConfModel!.pcNotName == '1'
? true
: false;
controllerDay.text =
marketingCenterProvider.dzSellerConfModel!.cancelDay!;
customerProvider.cancelOrderdayShopowner =
marketingCenterProvider.dzSellerConfModel!.cancelShopowner == '1'
? true
: false;
customerProvider.cancelOrderdayManager =
marketingCenterProvider.dzSellerConfModel!.cancelManager == '1'
? true
: false;
customerProvider.cancelOrderdayOther =
marketingCenterProvider.dzSellerConfModel!.cancelOther == '1'
? true
: false;
}
setState(() {});
}
///修改客情配置
Future<bool> _sellerGuestSet() async {
Map<String, String?> params = {
"sellerid": Provider.of<UserModel>(context, listen: false).user!.sellerid,
'is_additional': customerProvider.isrepair ? "1" : "0",
'is_enter_self': customerProvider.isselfphone ? '1' : '0',
'is_high_frequency': customerProvider.isHighFrequency ? '1' : '0',
'high_frequency_day': controllerDeadline.text,
'high_frequency_reserve': controllerConsumptionTimes.text,
'is_high_consumption': customerProvider.isHighConsumption ? '1' : '0',
'is_high_money': controllerHighValue.text
};
bool success = await customerProvider.setSellerGuest(context, params,
showLoading: true);
if (success) {
return true;
} else {
return false;
}
}
_saveData() async {
(bool, bool) result = await (_setConfings(), _sellerGuestSet()).wait;
if (result.$1 && result.$2) {
// 全部保存成功
Utils.showToast('保存成功!');
} else {
Utils.showToast('保存失败,请重试');
}
}
Future<bool> _setConfings() async {
Map<String, dynamic> data = {
'app_phone_switch': customerProvider.isReservePhoneApp ? '1' : '0',
'pc_not_rname': customerProvider.ispcname ? '1' : '0',
"pc_not_phone": customerProvider.ispcphone ? '1' : '0',
"is_add_over": customerProvider.isAddOver ? '1' : '0',
"is_set_over": customerProvider.isSetOver ? '1' : '0',
"is_reserve_over": customerProvider.isReserveOver ? '1' : '0',
"is_reserve_cancel": customerProvider.isReserveCancel ? '1' : '0',
'temp_cancel_day': controllerDay.text,
'temp_for_shopowner':
customerProvider.cancelOrderdayShopowner ? '1' : '0',
'temp_for_manager': customerProvider.cancelOrderdayManager ? '1' : '0',
'temp_for_other': customerProvider.cancelOrderdayOther ? '1' : '0',
};
Map<String, String?> params = {
'sid': Provider.of<UserModel>(context, listen: false).user!.sellerid,
'data': jsonEncode(data),
};
bool success = await marketingCenterProvider.setConfings(context, params,
needToast: false);
if (success) {
return true;
} else {
return false;
}
}
///获取客情配置
_sellerGuestGet() async {
bool success = await customerProvider.getSellerGuest(context);
if (success) {
controllerDeadline.text =
customerProvider.sellerGuestData?.highFrequencyDay ?? '';
controllerConsumptionTimes.text =
customerProvider.sellerGuestData?.highFrequencyReserve ?? '';
controllerHighValue.text =
customerProvider.sellerGuestData?.isHighMoney ?? '';
}
// if (success) {
// customerProvider.isrepair = true;
// } else {
// customerProvider.isrepair = false;
// }
setState(() {});
}
///获取商家标签
_getLabelBySellerid() async {
await customerProvider.getLabelBySellerid(context);
}
///商家创建商家标签
_createLabelBySellerid(String? name) async {
Map<String, String?> params = {
"sellerid": Provider.of<UserModel>(context, listen: false).user!.sellerid,
'label': name
};
bool success =
await customerProvider.createLabelBySellerid(context, params);
if (success) {
//刷新当前标签列表
Utils.showToast('标签添加成功');
//调用获取标签接口
// 。。。。。。
_getLabelBySellerid();
}
}
///商家修改标签
_setLabelBySellerid(String? id, String? name) async {
Map<String, String?> params = {"id": id, 'label': name};
bool success = await customerProvider.setLabelBySellerid(context, params);
if (success) {
//刷新当前标签列表
Utils.showToast('标签修改成功');
//调用获取标签接口
// 。。。。。。
_getLabelBySellerid();
}
}
//构建标签
List<Widget> _buildLabelItem(List<CustomerLabelSunModel> data) {
List<Widget> items = [];
for (CustomerLabelSunModel item in data) {
items.add(InkWell(
onTap: () {
DialogUtil.textfeildAlertDialog(context,
title: '自定义标签名称',
hintText: '例:高频客户',
text: item.label!,
lenghtLimit: false,
toast: '请输入标签名称', rCallback: (name) {
print(name);
_setLabelBySellerid(item.id, name as String?);
// _addCookbookClass(name, showLoading: true);
});
},
child: Container(
// height: ScreenUtil().setWidth(40),
padding: EdgeInsets.symmetric(horizontal: w(6), vertical: w(3)),
decoration: BoxDecoration(
border: Border.all(width: w(1), color: MyColours.color_A78E44),
borderRadius: BorderRadius.circular(r(5))),
child: Text(
item.label!,
style: TextStyle(
color: MyColours.color_A78E44,
fontSize: ScreenUtil().setSp(22),
),
),
)));
}
items.add(InkWell(
onTap: () {
DialogUtil.textfeildAlertDialog(context,
title: '自定义标签名称',
hintText: '例:高频客户',
text: '',
lenghtLimit: false,
toast: '请输入标签名称',
lCallback: () {}, rCallback: (name) {
print(name);
// _addCookbookClass(name, showLoading: true);
_createLabelBySellerid(name as String?);
});
},
child: Container(
width: ScreenUtil().setWidth(90),
height: ScreenUtil().setWidth(40),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(ScreenUtil().setWidth(10)),
border: Border.all(
color: MyColours.color_199095,
width: ScreenUtil().setWidth(2))),
child: Image.asset(Utils.getImgPath('add_area'),
width: ScreenUtil().setWidth(14)),
),
));
return items;
}
Widget _itemWidget(String title, String hintText,
TextEditingController controller, FocusNode node) {
return Row(
children: [
Container(
width: w(112),
child: Text(
title,
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(32)),
)),
HEmptyView(24),
Expanded(
child: Container(
height: w(30),
padding: EdgeInsets.symmetric(horizontal: w(10)),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(r(5)),
border:
Border.all(color: MyColours.color_E7E7E7, width: w(1)),
),
child: TextField(
controller: controller,
focusNode: node,
// autofocus: _sellerCodeController.text.isEmpty,
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(24),
),
textAlignVertical: TextAlignVertical.top,
decoration: InputDecoration(
hintText: hintText,
hintStyle: TextStyle(
color: MyColours.color_999999,
fontSize: ScreenUtil().setSp(24),
),
contentPadding: EdgeInsets.zero,
border: OutlineInputBorder(borderSide: BorderSide.none),
),
onChanged: (_) {
// setActivate();
},
keyboardType: TextInputType.numberWithOptions(decimal: true),
))),
],
);
}
@override
Widget build(BuildContext context) {
customerProvider = Provider.of<CustomerProvider>(context, listen: true);
marketingCenterProvider =
Provider.of<MarketingCenterProvider>(context, listen: true);
return KeyboardDismissOnTap(
child: Scaffold(
backgroundColor: MyColours.color_ffffff,
appBar: SystemAppBar(
'临餐取消预订限制设置',
onTap: () {
if (Navigator.canPop(context)) {
Navigator.pop(context);
}
},
),
body: Padding(
padding: EdgeInsets.only(
left: ScreenUtil().setWidth(0), top: ScreenUtil().setWidth(40)),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Expanded(
child: Container(
padding: EdgeInsets.symmetric(
vertical: w(8), horizontal: w(14)),
child: Text('临餐取消预订限制(前台及管理员除外)',
overflow: TextOverflow.ellipsis,
maxLines: 10,
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(28))))),
HEmptyView(2),
Container(
width: w(40),
child: TextField(
controller: controllerDay,
textAlign: TextAlign.right,
textAlignVertical: TextAlignVertical.bottom,
maxLines: 1,
// //光标颜色
// cursorColor:
// widget.isSelect ? Colors.white : MyColours.color_199095,
//输入文本的样式
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(32),
),
inputFormatters: <TextInputFormatter>[
FilteringTextInputFormatter.allow(
RegExp(r'[0-9]')), //设置只允许输入数字
],
decoration: InputDecoration(
isCollapsed: true,
border:
OutlineInputBorder(borderSide: BorderSide.none),
hintText: '输入',
hintStyle: TextStyle(
color: MyColours.color_999999,
fontSize: ScreenUtil().setSp(28),
),
enabledBorder: new UnderlineInputBorder(
borderSide: BorderSide.none,
),
focusedBorder: new UnderlineInputBorder(
borderSide: BorderSide.none,
),
),
onChanged: (value) {},
onEditingComplete: () {
FocusScope.of(context)
.requestFocus(FocusNode()); //点击空白处隐藏键盘
},
keyboardType: TextInputType.number),
),
Text('天',
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(28))),
HEmptyView(28),
],
),
VEmptyView(22),
Padding(
padding: EdgeInsets.symmetric(horizontal: w(14)),
child: MyDivider(
double.infinity,
w(1),
color: MyColours.color_E7E7E7,
)),
VEmptyView(24),
InkWell(
onTap: () {
setState(() {
customerProvider.cancelOrderdayShopowner =
!customerProvider.cancelOrderdayShopowner;
});
// _sellerGuestSet();
},
child: Container(
padding: EdgeInsets.symmetric(
vertical: w(8), horizontal: w(14)),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text('允许店长临餐取消预订',
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(28))),
Image.asset(
customerProvider.cancelOrderdayShopowner
? Utils.getImgPath('swich_on')
: Utils.getImgPath('swich_off'),
width: ScreenUtil().setWidth(88),
// height: ScreenUtil().setWidth(82),
),
],
)),
),
Padding(
padding: EdgeInsets.only(left: w(14), right: w(10)),
child: MyDivider(
double.infinity,
w(1),
color: MyColours.color_E7E7E7,
)),
VEmptyView(24),
InkWell(
onTap: () {
setState(() {
customerProvider.cancelOrderdayManager =
!customerProvider.cancelOrderdayManager;
});
},
child: Container(
padding: EdgeInsets.symmetric(
vertical: w(8), horizontal: w(14)),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text('允许经理临餐取消预订',
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(28))),
Image.asset(
customerProvider.cancelOrderdayManager
? Utils.getImgPath('swich_on')
: Utils.getImgPath('swich_off'),
width: ScreenUtil().setWidth(88),
// height: ScreenUtil().setWidth(82),
),
],
),
)),
Padding(
padding: EdgeInsets.only(left: w(14), right: w(10)),
child: MyDivider(
double.infinity,
w(1),
color: MyColours.color_E7E7E7,
)),
VEmptyView(24),
InkWell(
onTap: () {
setState(() {
customerProvider.cancelOrderdayOther =
!customerProvider.cancelOrderdayOther;
});
},
child: Container(
padding: EdgeInsets.symmetric(
vertical: w(8), horizontal: w(14)),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text('允许服务员及其他人员临餐取消预订',
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(28))),
Image.asset(
customerProvider.cancelOrderdayOther
? Utils.getImgPath('swich_on')
: Utils.getImgPath('swich_off'),
width: ScreenUtil().setWidth(88),
// height: ScreenUtil().setWidth(82),
),
],
),
)),
Padding(
padding: EdgeInsets.only(left: w(14), right: w(10)),
child: MyDivider(
double.infinity,
w(1),
color: MyColours.color_E7E7E7,
)),
VEmptyView(48),
// Container(
// padding: EdgeInsets.symmetric(vertical: w(8)),
// child: Text('优质客户标记',
// style: TextStyle(
// color: MyColours.color_515151,
// fontSize: ScreenUtil().setSp(32)))),
// VEmptyView(22),
// MyDivider(
// double.infinity,
// w(1),
// color: MyColours.color_E7E7E7,
// ),
// VEmptyView(24),
// InkWell(
// onTap: () {
// setState(() {
// customerProvider.isHighFrequency =
// !customerProvider.isHighFrequency;
// });
// },
// child: Container(
// padding: EdgeInsets.symmetric(
// vertical: w(8), horizontal: w(14)),
// child: Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// Text('高频客户标记',
// style: TextStyle(
// color: MyColours.color_515151,
// fontSize: ScreenUtil().setSp(28))),
// Image.asset(
// customerProvider.isHighFrequency
// ? Utils.getImgPath('swich_on')
// : Utils.getImgPath('swich_off'),
// width: ScreenUtil().setWidth(88),
// // height: ScreenUtil().setWidth(82),
// ),
// ],
// ),
// )),
// Padding(
// padding: EdgeInsets.only(left: w(14), right: w(10)),
// child: MyDivider(
// double.infinity,
// w(1),
// color: MyColours.color_E7E7E7,
// )),
// VEmptyView(24),
// Container(
// padding:
// EdgeInsets.symmetric(vertical: w(8), horizontal: w(14)),
// child: Row(
// children: [
// Expanded(
// child: Container(
// padding: EdgeInsets.symmetric(vertical: w(8)),
// child: Text('指定期限',
// overflow: TextOverflow.ellipsis,
// maxLines: 10,
// style: TextStyle(
// color: MyColours.color_515151,
// fontSize: ScreenUtil().setSp(28))))),
// HEmptyView(2),
// Container(
// width: w(40),
// child: TextField(
// controller: controllerDeadline,
// textAlign: TextAlign.right,
// textAlignVertical: TextAlignVertical.bottom,
// maxLines: 1,
// // //光标颜色
// // cursorColor:
// // widget.isSelect ? Colors.white : MyColours.color_199095,
// //输入文本的样式
// style: TextStyle(
// color: MyColours.color_515151,
// fontSize: ScreenUtil().setSp(28),
// ),
// inputFormatters: <TextInputFormatter>[
// FilteringTextInputFormatter.allow(
// RegExp(r'[0-9]')), //设置只允许输入数字
// ],
// decoration: InputDecoration(
// isCollapsed: true,
// border: OutlineInputBorder(
// borderSide: BorderSide.none),
// hintText: '输入',
// hintStyle: TextStyle(
// color: MyColours.color_999999,
// fontSize: ScreenUtil().setSp(28),
// ),
// enabledBorder: new UnderlineInputBorder(
// borderSide: BorderSide.none,
// ),
// focusedBorder: new UnderlineInputBorder(
// borderSide: BorderSide.none,
// ),
// ),
// onChanged: (value) {},
// onEditingComplete: () {
// FocusScope.of(context)
// .requestFocus(FocusNode()); //点击空白处隐藏键盘
// },
// keyboardType: TextInputType.number),
// ),
// HEmptyView(5),
// Text('天',
// style: TextStyle(
// color: MyColours.color_999999,
// fontSize: ScreenUtil().setSp(28))),
// // HEmptyView(24),
// ],
// )),
// Padding(
// padding: EdgeInsets.only(left: w(14), right: w(10)),
// child: MyDivider(
// double.infinity,
// w(1),
// color: MyColours.color_E7E7E7,
// )),
// VEmptyView(24),
// Container(
// padding:
// EdgeInsets.symmetric(vertical: w(8), horizontal: w(14)),
// child: Row(
// children: [
// Expanded(
// child: Container(
// padding: EdgeInsets.symmetric(vertical: w(8)),
// child: Text('消费次数',
// overflow: TextOverflow.ellipsis,
// maxLines: 10,
// style: TextStyle(
// color: MyColours.color_515151,
// fontSize: ScreenUtil().setSp(28))))),
// HEmptyView(2),
// Container(
// width: w(40),
// child: TextField(
// controller: controllerConsumptionTimes,
// textAlign: TextAlign.right,
// textAlignVertical: TextAlignVertical.bottom,
// maxLines: 1,
// // //光标颜色
// // cursorColor:
// // widget.isSelect ? Colors.white : MyColours.color_199095,
// //输入文本的样式
// style: TextStyle(
// color: MyColours.color_515151,
// fontSize: ScreenUtil().setSp(28),
// ),
// inputFormatters: <TextInputFormatter>[
// FilteringTextInputFormatter.allow(
// RegExp(r'[0-9]')), //设置只允许输入数字
// ],
// decoration: InputDecoration(
// isCollapsed: true,
// border: OutlineInputBorder(
// borderSide: BorderSide.none),
// hintText: '输入',
// hintStyle: TextStyle(
// color: MyColours.color_999999,
// fontSize: ScreenUtil().setSp(28),
// ),
// enabledBorder: new UnderlineInputBorder(
// borderSide: BorderSide.none,
// ),
// focusedBorder: new UnderlineInputBorder(
// borderSide: BorderSide.none,
// ),
// ),
// onChanged: (value) {},
// onEditingComplete: () {
// FocusScope.of(context)
// .requestFocus(FocusNode()); //点击空白处隐藏键盘
// },
// keyboardType: TextInputType.number),
// ),
// HEmptyView(5),
// Text('次',
// style: TextStyle(
// color: MyColours.color_999999,
// fontSize: ScreenUtil().setSp(28))),
// // HEmptyView(24),
// ],
// )),
// Padding(
// padding: EdgeInsets.only(left: w(14), right: w(10)),
// child: MyDivider(
// double.infinity,
// w(1),
// color: MyColours.color_E7E7E7,
// )),
// VEmptyView(24),
// InkWell(
// onTap: () {
// setState(() {
// customerProvider.isHighConsumption =
// !customerProvider.isHighConsumption;
// });
// },
// child: Container(
// padding: EdgeInsets.symmetric(
// vertical: w(8), horizontal: w(14)),
// child: Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// Text('高消费客户标记',
// style: TextStyle(
// color: MyColours.color_515151,
// fontSize: ScreenUtil().setSp(28))),
// Image.asset(
// customerProvider.isHighConsumption
// ? Utils.getImgPath('swich_on')
// : Utils.getImgPath('swich_off'),
// width: ScreenUtil().setWidth(88),
// // height: ScreenUtil().setWidth(82),
// ),
// ],
// ),
// )),
// Padding(
// padding: EdgeInsets.only(left: w(14), right: w(10)),
// child: MyDivider(
// double.infinity,
// w(1),
// color: MyColours.color_E7E7E7,
// )),
// VEmptyView(24),
// Container(
// padding:
// EdgeInsets.symmetric(vertical: w(8), horizontal: w(14)),
// child: Row(
// children: [
// Expanded(
// child: Container(
// padding: EdgeInsets.symmetric(vertical: w(8)),
// child: Text('客户人均消费到达设置金额标记为高单值',
// overflow: TextOverflow.ellipsis,
// maxLines: 10,
// style: TextStyle(
// color: MyColours.color_515151,
// fontSize: ScreenUtil().setSp(28))))),
// HEmptyView(2),
// Container(
// width: w(40),
// child: TextField(
// controller: controllerHighValue,
// textAlign: TextAlign.right,
// textAlignVertical: TextAlignVertical.bottom,
// maxLines: 1,
// // //光标颜色
// // cursorColor:
// // widget.isSelect ? Colors.white : MyColours.color_199095,
// //输入文本的样式
// style: TextStyle(
// color: MyColours.color_515151,
// fontSize: ScreenUtil().setSp(28),
// ),
// inputFormatters: <TextInputFormatter>[
// FilteringTextInputFormatter.allow(
// RegExp("[0-9.]")),
// ],
// decoration: InputDecoration(
// isCollapsed: true,
// border: OutlineInputBorder(
// borderSide: BorderSide.none),
// hintText: '输入',
// hintStyle: TextStyle(
// color: MyColours.color_999999,
// fontSize: ScreenUtil().setSp(28),
// ),
// enabledBorder: new UnderlineInputBorder(
// borderSide: BorderSide.none,
// ),
// focusedBorder: new UnderlineInputBorder(
// borderSide: BorderSide.none,
// ),
// ),
// onChanged: (value) {},
// onEditingComplete: () {
// FocusScope.of(context)
// .requestFocus(FocusNode()); //点击空白处隐藏键盘
// },
// keyboardType: TextInputType.number),
// ),
// HEmptyView(5),
// Text('元',
// style: TextStyle(
// color: MyColours.color_999999,
// fontSize: ScreenUtil().setSp(28))),
// // HEmptyView(24),
// ],
// )),
// Padding(
// padding: EdgeInsets.only(left: w(14), right: w(10)),
// child: MyDivider(
// double.infinity,
// w(1),
// color: MyColours.color_E7E7E7,
// )),
// VEmptyView(24),
// VEmptyView(48),
],
))),
Container(
color: MyColours.color_ffffff,
padding: EdgeInsets.symmetric(horizontal: w(48)),
margin: EdgeInsets.only(bottom: w(35), top: w(25)),
child: RoundButton(
// content: widget.fromPage == 'tablePhoto'
// ? '确定'
// : "已选${selectNum}个 确定",
text: '保存',
// width: w(128),
height: w(40),
radius: r(4),
isBold: false,
gradientStart: MyColours.color_438E93,
gradientEnd: MyColours.color_438E93,
fontSize: 28,
textColor: MyColours.color_ffffff,
onPressed: () {
FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘
//前置条件判断
// if (customerProvider.isHighFrequency) {
// if (controllerDeadline.text.trim().length == 0) {
// Utils.showToast('请输入指定期限');
// return;
// }
// if (controllerConsumptionTimes.text.trim().length == 0) {
// Utils.showToast('请输入消费次数');
// return;
// }
// }
// if (customerProvider.isHighConsumption) {
// if (controllerHighValue.text.trim().length == 0) {
// Utils.showToast('请设置客户人均消费到达金额');
// return;
// }
// }
_saveData();
},
),
)
// VEmptyView(34),
// MyDivider(
// double.infinity,
// w(1),
// color: MyColours.color_E7E7E7,
// ),
// VEmptyView(52),
// InkWell(
// onTap: () {
// setState(() {
// swichSync = !swichSync;
// });
// // _sellerGuestSet();
// },
// child: Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// Text('是否与会员系统同步',
// style: TextStyle(
// color: MyColours.color_515151,
// fontSize: ScreenUtil().setSp(32))),
// Image.asset(
// swichSync
// ? Utils.getImgPath('f_swich_on')
// : Utils.getImgPath('f_swich_off'),
// width: ScreenUtil().setWidth(70),
// // height: ScreenUtil().setWidth(82),
// ),
// ],
// ),
// ),
// VEmptyView(48),
// InkWell(
// onTap: () {
// FocusScope.of(context).requestFocus(FocusNode()); //隐藏键盘
// // DialogUtil.showSelectCusmanDialog(context, memberList,
// // (value) {
// // if (value != null) {
// // setState(() {
// // memberIndex = value.first;
// // memberShow = memberList[memberIndex];
// // });
// // }
// // }, selecteds: memberIndex == null ? [] : [memberIndex])
// // .then((value) {});
// },
// child: Container(
// // height: ScreenUtil().setWidth(60),
// padding: EdgeInsets.only(bottom: ScreenUtil().setWidth(50)),
// child: Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// Container(
// // color: Colors.red,
// width: ScreenUtil().setWidth(150),
// height: ScreenUtil().setWidth(35),
// child: Text(
// '会员系统选择',
// style: TextStyle(
// fontSize: ScreenUtil().setSp(32),
// color: MyColours.color_515151),
// ),
// ),
// Expanded(
// child: Text(
// memberShow,
// overflow: TextOverflow.ellipsis,
// style: TextStyle(
// color: MyColours.color_353535,
// fontSize: ScreenUtil().setSp(28),
// ),
// )),
// HEmptyView(10),
// Image.asset(
// Utils.getImgPath(
// showLabel ? 'c_arrow_up' : 'c_arrow_down'),
// width: ScreenUtil().setWidth(24),
// // height: ScreenUtil().setWidth(10),
// )
// ],
// ),
// )),
// _itemWidget('企业代码或账号', "点击这里输入企业代码或账号", null, null),
// VEmptyView(50),
// _itemWidget('管理员账号', "点击这里输入管理员账号", null, null),
// VEmptyView(50),
// _itemWidget('密码', "点击这里输入管理员密码", null, null),
// VEmptyView(40),
// Center(
// child: Text(
// '请与纳极客服400-000-9690 联系对接事宜',
// style: TextStyle(
// color: MyColours.color_999999, fontSize: font(12)),
// ))
],
),
),
));
}
}
... ...
import 'dart:async';
import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_keyboard_visibility/flutter_keyboard_visibility.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:one_key/models/customer_label_model.dart';
import 'package:one_key/provider/customer_provider.dart';
import 'package:one_key/provider/user_model.dart';
import 'package:one_key/res/colors.dart';
import 'package:one_key/utils/dialog_util.dart';
import 'package:one_key/utils/utils.dart';
import 'package:one_key/widgets/MyDivider.dart';
import 'package:one_key/widgets/system_app_bar.dart';
import 'package:one_key/widgets/v_empty_view.dart';
import 'package:provider/provider.dart';
import '../../../../provider/marketing_center_provider.dart';
import '../../../../utils/screen_util.dart';
import '../../../../widgets/h_empty_view.dart';
import '../../../../widgets/round_button.dart';
/**
* 历史订单设置页面
*/
class OrderHistorySetPage extends StatefulWidget {
OrderHistorySetPage({Key? key}) : super(key: key);
@override
_OrderHistorySetPageState createState() => _OrderHistorySetPageState();
}
class _OrderHistorySetPageState extends State<OrderHistorySetPage> {
late CustomerProvider customerProvider;
bool swichSync = false; //会员系统同步
String memberShow = '';
bool showLabel = false;
late MarketingCenterProvider marketingCenterProvider;
TextEditingController controllerDay = TextEditingController();
TextEditingController controllerDeadline = TextEditingController();
TextEditingController controllerConsumptionTimes = TextEditingController();
TextEditingController controllerHighValue = TextEditingController();
@override
void initState() {
WidgetsBinding.instance.addPostFrameCallback((_) async {
// _getContantData();
_sellerGuestGet();
_getLabelBySellerid();
getDzSellerConf();
});
}
getDzSellerConf() async {
bool success = await marketingCenterProvider.getDzSellerConf(context);
if (success && marketingCenterProvider.dzSellerConfModel != null) {
customerProvider.isReservePhoneApp =
marketingCenterProvider.dzSellerConfModel!.appPhoneSwitch == '1'
? true
: false;
customerProvider.ispcphone =
marketingCenterProvider.dzSellerConfModel!.pcNotPhone == '1'
? true
: false;
customerProvider.isAddOver =
marketingCenterProvider.dzSellerConfModel!.isAddOver == '1'
? true
: false;
customerProvider.isSetOver =
marketingCenterProvider.dzSellerConfModel!.isSetOver == '1'
? true
: false;
customerProvider.isReserveOver =
marketingCenterProvider.dzSellerConfModel!.isReserveOver == '1'
? true
: false;
customerProvider.isReserveCancel =
marketingCenterProvider.dzSellerConfModel!.isReserveCancel == '1'
? true
: false;
customerProvider.ispcname =
marketingCenterProvider.dzSellerConfModel!.pcNotName == '1'
? true
: false;
controllerDay.text =
marketingCenterProvider.dzSellerConfModel!.cancelDay!;
customerProvider.cancelOrderdayShopowner =
marketingCenterProvider.dzSellerConfModel!.cancelShopowner == '1'
? true
: false;
customerProvider.cancelOrderdayManager =
marketingCenterProvider.dzSellerConfModel!.cancelManager == '1'
? true
: false;
customerProvider.cancelOrderdayOther =
marketingCenterProvider.dzSellerConfModel!.cancelOther == '1'
? true
: false;
}
setState(() {});
}
///修改客情配置
Future<bool> _sellerGuestSet() async {
Map<String, String?> params = {
"sellerid": Provider.of<UserModel>(context, listen: false).user!.sellerid,
'is_additional': customerProvider.isrepair ? "1" : "0",
'is_enter_self': customerProvider.isselfphone ? '1' : '0',
'is_high_frequency': customerProvider.isHighFrequency ? '1' : '0',
'high_frequency_day': controllerDeadline.text,
'high_frequency_reserve': controllerConsumptionTimes.text,
'is_high_consumption': customerProvider.isHighConsumption ? '1' : '0',
'is_high_money': controllerHighValue.text
};
bool success = await customerProvider.setSellerGuest(context, params,
showLoading: true);
if (success) {
return true;
} else {
return false;
}
}
_saveData() async {
(bool, bool) result = await (_setConfings(), _sellerGuestSet()).wait;
if (result.$1 && result.$2) {
// 全部保存成功
Utils.showToast('保存成功!');
} else {
Utils.showToast('保存失败,请重试');
}
}
Future<bool> _setConfings() async {
Map<String, dynamic> data = {
'app_phone_switch': customerProvider.isReservePhoneApp ? '1' : '0',
'pc_not_rname': customerProvider.ispcname ? '1' : '0',
"pc_not_phone": customerProvider.ispcphone ? '1' : '0',
"is_add_over": customerProvider.isAddOver ? '1' : '0',
"is_set_over": customerProvider.isSetOver ? '1' : '0',
"is_reserve_over": customerProvider.isReserveOver ? '1' : '0',
"is_reserve_cancel": customerProvider.isReserveCancel ? '1' : '0',
'temp_cancel_day': controllerDay.text,
'temp_for_shopowner':
customerProvider.cancelOrderdayShopowner ? '1' : '0',
'temp_for_manager': customerProvider.cancelOrderdayManager ? '1' : '0',
'temp_for_other': customerProvider.cancelOrderdayOther ? '1' : '0',
};
Map<String, String?> params = {
'sid': Provider.of<UserModel>(context, listen: false).user!.sellerid,
'data': jsonEncode(data),
};
bool success = await marketingCenterProvider.setConfings(context, params,
needToast: false);
if (success) {
return true;
} else {
return false;
}
}
///获取客情配置
_sellerGuestGet() async {
bool success = await customerProvider.getSellerGuest(context);
if (success) {
controllerDeadline.text =
customerProvider.sellerGuestData?.highFrequencyDay ?? '';
controllerConsumptionTimes.text =
customerProvider.sellerGuestData?.highFrequencyReserve ?? '';
controllerHighValue.text =
customerProvider.sellerGuestData?.isHighMoney ?? '';
}
// if (success) {
// customerProvider.isrepair = true;
// } else {
// customerProvider.isrepair = false;
// }
setState(() {});
}
///获取商家标签
_getLabelBySellerid() async {
await customerProvider.getLabelBySellerid(context);
}
///商家创建商家标签
_createLabelBySellerid(String? name) async {
Map<String, String?> params = {
"sellerid": Provider.of<UserModel>(context, listen: false).user!.sellerid,
'label': name
};
bool success =
await customerProvider.createLabelBySellerid(context, params);
if (success) {
//刷新当前标签列表
Utils.showToast('标签添加成功');
//调用获取标签接口
// 。。。。。。
_getLabelBySellerid();
}
}
///商家修改标签
_setLabelBySellerid(String? id, String? name) async {
Map<String, String?> params = {"id": id, 'label': name};
bool success = await customerProvider.setLabelBySellerid(context, params);
if (success) {
//刷新当前标签列表
Utils.showToast('标签修改成功');
//调用获取标签接口
// 。。。。。。
_getLabelBySellerid();
}
}
@override
Widget build(BuildContext context) {
customerProvider = Provider.of<CustomerProvider>(context, listen: true);
marketingCenterProvider =
Provider.of<MarketingCenterProvider>(context, listen: true);
return KeyboardDismissOnTap(
child: Scaffold(
backgroundColor: MyColours.color_ffffff,
appBar: SystemAppBar(
'历史订单修改限制设置',
onTap: () {
if (Navigator.canPop(context)) {
Navigator.pop(context);
}
},
),
body: Padding(
padding: EdgeInsets.only(
left: ScreenUtil().setWidth(4), top: ScreenUtil().setWidth(40)),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
InkWell(
onTap: () {
setState(() {
customerProvider.isAddOver = !customerProvider.isAddOver;
});
// _sellerGuestSet();
},
child: Container(
padding: EdgeInsets.symmetric(
vertical: w(8), horizontal: w(14)),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text('允许新建过去餐段的订单',
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(28))),
Image.asset(
customerProvider.isAddOver
? Utils.getImgPath('swich_on')
: Utils.getImgPath('swich_off'),
width: ScreenUtil().setWidth(88),
// height: ScreenUtil().setWidth(82),
),
],
)),
),
Padding(
padding: EdgeInsets.only(left: w(14), right: w(10)),
child: MyDivider(
double.infinity,
w(1),
color: MyColours.color_E7E7E7,
)),
VEmptyView(24),
InkWell(
onTap: () {
setState(() {
customerProvider.isSetOver =
!customerProvider.isSetOver;
});
},
child: Container(
padding: EdgeInsets.symmetric(
vertical: w(8), horizontal: w(14)),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text('允许变更过去餐段订单',
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(28))),
Image.asset(
customerProvider.isSetOver
? Utils.getImgPath('swich_on')
: Utils.getImgPath('swich_off'),
width: ScreenUtil().setWidth(88),
// height: ScreenUtil().setWidth(82),
),
],
),
)),
Padding(
padding: EdgeInsets.only(left: w(14), right: w(10)),
child: MyDivider(
double.infinity,
w(1),
color: MyColours.color_E7E7E7,
)),
VEmptyView(24),
InkWell(
onTap: () {
setState(() {
customerProvider.isReserveOver =
!customerProvider.isReserveOver;
});
},
child: Container(
padding: EdgeInsets.symmetric(
vertical: w(8), horizontal: w(14)),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text('允许变更订单到过去餐段',
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(28))),
Image.asset(
customerProvider.isReserveOver
? Utils.getImgPath('swich_on')
: Utils.getImgPath('swich_off'),
width: ScreenUtil().setWidth(88),
// height: ScreenUtil().setWidth(82),
),
],
),
)),
Padding(
padding: EdgeInsets.only(left: w(14), right: w(10)),
child: MyDivider(
double.infinity,
w(1),
color: MyColours.color_E7E7E7,
)),
VEmptyView(24),
InkWell(
onTap: () {
setState(() {
customerProvider.isReserveCancel =
!customerProvider.isReserveCancel;
});
},
child: Container(
padding: EdgeInsets.symmetric(
vertical: w(8), horizontal: w(14)),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text('允许取消过去餐段的订单',
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(28))),
Image.asset(
customerProvider.isReserveCancel
? Utils.getImgPath('swich_on')
: Utils.getImgPath('swich_off'),
width: ScreenUtil().setWidth(88),
// height: ScreenUtil().setWidth(82),
),
],
),
)),
Padding(
padding: EdgeInsets.only(left: w(14), right: w(10)),
child: MyDivider(
double.infinity,
w(1),
color: MyColours.color_E7E7E7,
)),
],
))),
Container(
color: MyColours.color_ffffff,
padding: EdgeInsets.symmetric(horizontal: w(48)),
margin: EdgeInsets.only(bottom: w(35), top: w(25)),
child: RoundButton(
// content: widget.fromPage == 'tablePhoto'
// ? '确定'
// : "已选${selectNum}个 确定",
text: '保存',
// width: w(128),
height: w(40),
radius: r(4),
isBold: false,
gradientStart: MyColours.color_438E93,
gradientEnd: MyColours.color_438E93,
fontSize: 28,
textColor: MyColours.color_ffffff,
onPressed: () {
FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘
//前置条件判断
if (customerProvider.isHighFrequency) {
if (controllerDeadline.text.trim().length == 0) {
Utils.showToast('请输入指定期限');
return;
}
if (controllerConsumptionTimes.text.trim().length == 0) {
Utils.showToast('请输入消费次数');
return;
}
}
if (customerProvider.isHighConsumption) {
if (controllerHighValue.text.trim().length == 0) {
Utils.showToast('请设置客户人均消费到达金额');
return;
}
}
_saveData();
},
),
)
// VEmptyView(34),
// MyDivider(
// double.infinity,
// w(1),
// color: MyColours.color_E7E7E7,
// ),
// VEmptyView(52),
// InkWell(
// onTap: () {
// setState(() {
// swichSync = !swichSync;
// });
// // _sellerGuestSet();
// },
// child: Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// Text('是否与会员系统同步',
// style: TextStyle(
// color: MyColours.color_515151,
// fontSize: ScreenUtil().setSp(32))),
// Image.asset(
// swichSync
// ? Utils.getImgPath('f_swich_on')
// : Utils.getImgPath('f_swich_off'),
// width: ScreenUtil().setWidth(70),
// // height: ScreenUtil().setWidth(82),
// ),
// ],
// ),
// ),
// VEmptyView(48),
// InkWell(
// onTap: () {
// FocusScope.of(context).requestFocus(FocusNode()); //隐藏键盘
// // DialogUtil.showSelectCusmanDialog(context, memberList,
// // (value) {
// // if (value != null) {
// // setState(() {
// // memberIndex = value.first;
// // memberShow = memberList[memberIndex];
// // });
// // }
// // }, selecteds: memberIndex == null ? [] : [memberIndex])
// // .then((value) {});
// },
// child: Container(
// // height: ScreenUtil().setWidth(60),
// padding: EdgeInsets.only(bottom: ScreenUtil().setWidth(50)),
// child: Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// Container(
// // color: Colors.red,
// width: ScreenUtil().setWidth(150),
// height: ScreenUtil().setWidth(35),
// child: Text(
// '会员系统选择',
// style: TextStyle(
// fontSize: ScreenUtil().setSp(32),
// color: MyColours.color_515151),
// ),
// ),
// Expanded(
// child: Text(
// memberShow,
// overflow: TextOverflow.ellipsis,
// style: TextStyle(
// color: MyColours.color_353535,
// fontSize: ScreenUtil().setSp(28),
// ),
// )),
// HEmptyView(10),
// Image.asset(
// Utils.getImgPath(
// showLabel ? 'c_arrow_up' : 'c_arrow_down'),
// width: ScreenUtil().setWidth(24),
// // height: ScreenUtil().setWidth(10),
// )
// ],
// ),
// )),
// _itemWidget('企业代码或账号', "点击这里输入企业代码或账号", null, null),
// VEmptyView(50),
// _itemWidget('管理员账号', "点击这里输入管理员账号", null, null),
// VEmptyView(50),
// _itemWidget('密码', "点击这里输入管理员密码", null, null),
// VEmptyView(40),
// Center(
// child: Text(
// '请与纳极客服400-000-9690 联系对接事宜',
// style: TextStyle(
// color: MyColours.color_999999, fontSize: font(12)),
// ))
],
),
),
));
}
}
... ...
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:one_key/provider/user_model.dart';
import 'package:one_key/res/colors.dart';
import 'package:one_key/route/navigator_util.dart';
import 'package:one_key/utils/screen_util.dart';
import 'package:one_key/widgets/MyDivider.dart';
import 'package:one_key/widgets/system_app_bar.dart';
import 'package:one_key/widgets/v_empty_view.dart';
import 'package:provider/provider.dart';
/**
* 预订订单首页home
*/
class OrderManageHomePage extends StatefulWidget {
const OrderManageHomePage({super.key});
@override
State<OrderManageHomePage> createState() => _OrderManageHomePageState();
}
class _OrderManageHomePageState extends State<OrderManageHomePage> {
@override
Widget build(BuildContext context) {
UserModel userModel = Provider.of<UserModel>(context, listen: false);
return Scaffold(
backgroundColor: Colors.white,
appBar: SystemAppBar(
'预订订单管理',
),
body: Column(
children: [
Expanded(
child: SingleChildScrollView(
child: Column(
children: [
InkWell(
onTap: () async {
NavigatorUtil.goCustomerSetPage(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.goOrderHistorySetPage(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.goCustomLabelPage(context);
NavigatorUtil.goOrderCancelSetPage(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),
],
),
)),
],
));
}
}
... ...
import 'dart:async';
import 'dart:io';
import 'dart:ui';
... ... @@ -111,7 +110,7 @@ class _CommentManageHomePageState extends State<CommentManageHomePage> {
};
bool success = await commentManageProvider.setComment(context, pramas,
isShowLoading: isShowLoading) ;
isShowLoading: isShowLoading);
if (success) {
//成功 刷新列表
_getSellerComments(isShowLoading: false);
... ... @@ -180,7 +179,7 @@ class _CommentManageHomePageState extends State<CommentManageHomePage> {
// return data;
// }
Future<String?>? getThumbnailFile(
Future<String?>? getThumbnailFile(
List<CommentsImageModel> imags, int index) async {
final fileName = await VideoThumbnail.thumbnailFile(
video: imags[index].url!,
... ... @@ -197,7 +196,6 @@ class _CommentManageHomePageState extends State<CommentManageHomePage> {
Widget _getGridImg(List<CommentsImageModel> imags) {
imags.removeWhere((element) => element.url == null || element.url == '');
return GridView.builder(
controller: controller,
padding: EdgeInsets.symmetric(vertical: w(7)),
... ... @@ -214,7 +212,7 @@ class _CommentManageHomePageState extends State<CommentManageHomePage> {
crossAxisSpacing: w(7),
//子组件宽高长度比例
childAspectRatio: 1.0),
itemBuilder: (BuildContext context, int index){
itemBuilder: (BuildContext context, int index) {
if (imags[index].avinfo != null &&
imags[index].avinfo != 'false' &&
imags[index].avinfo != '0') {
... ... @@ -409,7 +407,7 @@ class _CommentManageHomePageState extends State<CommentManageHomePage> {
Provider.of<CommentManageProvider>(context, listen: true);
return Scaffold(
backgroundColor: MyColours.color_ffffff,
appBar: SystemAppBar('评价管理'),
appBar: SystemAppBar('意见本'),
body: Consumer<CommentManageProvider>(builder: (context1, model, _) {
if (model.pageState != PageState.Success) {
return ExceptionPage(
... ...
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:one_key/res/colors.dart';
import 'package:one_key/route/navigator_util.dart';
import 'package:one_key/utils/event_bus.dart';
import 'package:one_key/utils/screen_util.dart';
import 'package:one_key/widgets/MyDivider.dart';
import 'package:one_key/widgets/h_empty_view.dart';
import 'package:one_key/widgets/system_app_bar.dart';
import 'package:one_key/widgets/v_empty_view.dart';
import 'package:provider/provider.dart';
/**
* 消费金home
*/
class ConsumeHomePage extends StatefulWidget {
ConsumeHomePage({
Key? key,
}) : super(key: key);
@override
_ConsumeHomePageState createState() => _ConsumeHomePageState();
}
class _ConsumeHomePageState extends State<ConsumeHomePage> {
@override
void initState() {
super.initState();
WidgetsBinding.instance.addPostFrameCallback((_) {});
}
@override
void dispose() {
EventBus().emit('changeStatusColor');
super.dispose();
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.white,
appBar: SystemAppBar(
'消费金',
),
body: Column(
children: [
Expanded(
child: SingleChildScrollView(
child: Column(
children: [
InkWell(
onTap: () async {
NavigatorUtil.goGrantPage(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.goReturnMoneyPage(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.goGiveMoneyBeforePayPage(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: () {
//
},
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)),
],
),
)),
],
));
}
}
... ...
... ... @@ -19,7 +19,7 @@ import 'package:one_key/widgets/v_empty_view.dart';
import 'package:provider/provider.dart';
/**
* 买单前送消费金 配置页
* 支付前送消费金 配置页
*/
class GiveMoneyBeforePayPage extends StatefulWidget {
const GiveMoneyBeforePayPage({super.key});
... ... @@ -629,14 +629,14 @@ class _GiveMoneyBeforePayPageState extends State<GiveMoneyBeforePayPage> {
return KeyboardDismissOnTap(
child: Scaffold(
backgroundColor: MyColours.color_ffffff,
appBar: SystemAppBar('买单前送消费金'),
appBar: SystemAppBar('支付前送消费金'),
key: scaffoldKey,
body: Column(children: [
Expanded(
child: SingleChildScrollView(
controller: controller,
child: Column(children: [
_canUse('新用户买单前送消费金', isNew, () {
_canUse('新用户支付前送消费金', isNew, () {
setState(() {
isNew = !isNew;
});
... ... @@ -742,7 +742,7 @@ class _GiveMoneyBeforePayPageState extends State<GiveMoneyBeforePayPage> {
_randomWidget(
minCNew, minNodeNew, maxCNew, maxNodeNew),
VEmptyView(24),
_canUse('老用户买单前送消费金', isOld, () {
_canUse('老用户支付前送消费金', isOld, () {
setState(() {
isOld = !isOld;
});
... ...
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:one_key/models/customer_label_model.dart';
import 'package:one_key/provider/customer_provider.dart';
import 'package:one_key/provider/user_model.dart';
import 'package:one_key/res/colors.dart';
import 'package:one_key/utils/dialog_util.dart';
import 'package:one_key/utils/screen_util.dart';
import 'package:one_key/utils/utils.dart';
import 'package:one_key/widgets/system_app_bar.dart';
import 'package:provider/provider.dart';
class CustomLabelPage extends StatefulWidget {
const CustomLabelPage({super.key});
@override
State<CustomLabelPage> createState() => _CustomLabelPageState();
}
class _CustomLabelPageState extends State<CustomLabelPage> {
late CustomerProvider customerProvider;
@override
void initState() {
WidgetsBinding.instance.addPostFrameCallback((_) async {
_getLabelBySellerid();
});
}
///获取商家标签
_getLabelBySellerid() async {
await customerProvider.getLabelBySellerid(context);
}
///商家创建商家标签
_createLabelBySellerid(String? name) async {
Map<String, String?> params = {
"sellerid": Provider.of<UserModel>(context, listen: false).user!.sellerid,
'label': name
};
bool success =
await customerProvider.createLabelBySellerid(context, params);
if (success) {
//刷新当前标签列表
Utils.showToast('标签添加成功');
//调用获取标签接口
// 。。。。。。
_getLabelBySellerid();
}
}
///商家修改标签
_setLabelBySellerid(String? id, String? name) async {
Map<String, String?> params = {"id": id, 'label': name};
bool success = await customerProvider.setLabelBySellerid(context, params);
if (success) {
//刷新当前标签列表
Utils.showToast('标签修改成功');
//调用获取标签接口
// 。。。。。。
_getLabelBySellerid();
}
}
//构建标签
List<Widget> _buildLabelItem(List<CustomerLabelSunModel> data) {
List<Widget> items = [];
for (CustomerLabelSunModel item in data) {
items.add(InkWell(
onTap: () {
DialogUtil.textfeildAlertDialog(context,
title: '自定义标签名称',
hintText: '例:高频客户',
text: item.label!,
lenghtLimit: false,
toast: '请输入标签名称', rCallback: (name) {
print(name);
_setLabelBySellerid(item.id, name as String?);
// _addCookbookClass(name, showLoading: true);
});
},
child: Container(
// height: ScreenUtil().setWidth(40),
padding: EdgeInsets.symmetric(horizontal: w(6), vertical: w(3)),
decoration: BoxDecoration(
border: Border.all(width: w(1), color: MyColours.color_A78E44),
borderRadius: BorderRadius.circular(r(5))),
child: Text(
item.label!,
style: TextStyle(
color: MyColours.color_A78E44,
fontSize: ScreenUtil().setSp(22),
),
),
)));
}
items.add(InkWell(
onTap: () {
DialogUtil.textfeildAlertDialog(context,
title: '自定义标签名称',
hintText: '例:高频客户',
text: '',
lenghtLimit: false,
toast: '请输入标签名称',
lCallback: () {}, rCallback: (name) {
print(name);
// _addCookbookClass(name, showLoading: true);
_createLabelBySellerid(name as String?);
});
},
child: Container(
width: ScreenUtil().setWidth(90),
height: ScreenUtil().setWidth(40),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(ScreenUtil().setWidth(10)),
border: Border.all(
color: MyColours.color_199095,
width: ScreenUtil().setWidth(2))),
child: Image.asset(Utils.getImgPath('add_area'),
width: ScreenUtil().setWidth(14)),
),
));
return items;
}
@override
Widget build(BuildContext context) {
customerProvider = Provider.of<CustomerProvider>(context, listen: true);
return Scaffold(
appBar: SystemAppBar('客户自定义标签'),
backgroundColor: MyColours.color_ffffff,
body: SingleChildScrollView(
child: Container(
padding: EdgeInsets.symmetric(vertical: w(20), horizontal: w(14)),
child: Wrap(
spacing: ScreenUtil().setWidth(20),
runSpacing: ScreenUtil().setWidth(10),
crossAxisAlignment: WrapCrossAlignment.center,
children: _buildLabelItem(customerProvider.labelList!))),
),
);
}
}
... ...
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:one_key/route/navigator_util.dart';
import 'package:one_key/widgets/MyDivider.dart';
import 'package:one_key/widgets/h_empty_view.dart';
import 'package:one_key/widgets/v_empty_view.dart';
import 'package:provider/provider.dart';
import '../../../provider/collect_store_provider.dart';
import '../../../provider/marketing_center_provider.dart';
import '../../../provider/user_model.dart';
import '../../../res/colors.dart';
import '../../../utils/dialog_util.dart';
import '../../../utils/event_bus.dart';
import '../../../utils/screen_util.dart';
import '../../../utils/utils.dart';
import '../../../widgets/round_button.dart';
import '../../../widgets/system_app_bar.dart';
/**
* 客户管理home
*/
class CustomerHomePage extends StatefulWidget {
final bool sellerNormalSpecial;
final bool sellerPreserve;
final bool sellerMarketing;
CustomerHomePage({
Key? key,
required this.sellerNormalSpecial,
required this.sellerPreserve,
required this.sellerMarketing,
}) : super(key: key);
@override
_CustomerHomePageState createState() => _CustomerHomePageState();
}
class _CustomerHomePageState extends State<CustomerHomePage> {
@override
void initState() {
super.initState();
WidgetsBinding.instance.addPostFrameCallback((_) {});
}
@override
void dispose() {
EventBus().emit('changeStatusColor');
super.dispose();
}
@override
Widget build(BuildContext context) {
UserModel userModel = Provider.of<UserModel>(context, listen: false);
return Scaffold(
backgroundColor: Colors.white,
appBar: SystemAppBar(
'菜单管理',
),
body: Column(
children: [
Expanded(
child: SingleChildScrollView(
child: Column(
children: [
InkWell(
onTap: () async {
if (userModel.user?.role_name == '管理员' ||
userModel.user?.role_name == '店长') {
if (Utils.getAuthority(context, '全店客情')) {
if (widget.sellerNormalSpecial) {
//标准版
if (widget.sellerPreserve ||
widget.sellerMarketing) {
NavigatorUtil.goStoreCustomerPage(context);
} else {
NavigatorUtil.goCustomerListPageSim(context);
}
} else {
NavigatorUtil.goStoreCustomerPage(context);
}
}
} else {
if (Utils.getAuthority(context, '我的客情')) {
if (widget.sellerNormalSpecial) {
//标准版
if (widget.sellerPreserve ||
widget.sellerMarketing) {
NavigatorUtil.goMyCustomerPage(context);
} else {
NavigatorUtil.goMyCustomerListPageSim(context);
}
} else {
NavigatorUtil.goMyCustomerPage(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: () {
if (userModel.user?.role_name == '管理员' ||
userModel.user?.role_name == '店长') {
if (Utils.getAuthority(context, '全店客情')) {
if (widget.sellerNormalSpecial) {
//标准版
if (widget.sellerPreserve ||
widget.sellerMarketing) {
NavigatorUtil.goStoreCustomerPage(context);
} else {
NavigatorUtil.goCustomerListPageSim(context);
}
} else {
NavigatorUtil.goStoreCustomerPage(context);
}
}
} else {
if (Utils.getAuthority(context, '我的客情')) {
if (widget.sellerNormalSpecial) {
//标准版
if (widget.sellerPreserve ||
widget.sellerMarketing) {
NavigatorUtil.goMyCustomerPage(context);
} else {
NavigatorUtil.goMyCustomerListPageSim(context);
}
} else {
NavigatorUtil.goMyCustomerPage(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.goCustomLabelPage(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)),
],
),
)),
],
));
}
}
... ...
import 'dart:convert';
import 'dart:ui';
... ... @@ -316,9 +315,9 @@ class _MyCustomerHomePageState extends State<MyCustomerHomePage> {
customerProvider = Provider.of<CustomerProvider>(context, listen: false);
return Scaffold(
backgroundColor: MyColours.color_f3f3f3,
appBar: SystemAppBar('我的客情', onTap: () {
appBar: SystemAppBar('客户汇总', onTap: () {
if (Navigator.canPop(context)) {
Navigator.pop(context);
Navigator.pop(context);
}
}),
body: Consumer<CustomerProvider>(builder: (context, model, _) {
... ... @@ -426,11 +425,12 @@ class _MyCustomerHomePageState extends State<MyCustomerHomePage> {
.guestSunmodel!.tips!.task!.length ==
0
? 0
: customerProvider.guestSunmodel!.tips!.task!.length,
: customerProvider
.guestSunmodel!.tips!.task!.length,
itemBuilder: (BuildContext context, int index) {
// locationState = state;
Task data =
(customerProvider.guestSunmodel!.tips!.task![index])!;
Task data = (customerProvider
.guestSunmodel!.tips!.task![index])!;
return Column(
children: [
VEmptyView(10),
... ... @@ -543,8 +543,8 @@ class _MyCustomerHomePageState extends State<MyCustomerHomePage> {
itemCount:
customerProvider.guestSunmodel!.tips!.recover ==
null ||
customerProvider.guestSunmodel!.tips!.recover!
.length ==
customerProvider.guestSunmodel!.tips!
.recover!.length ==
0
? 0
: 1,
... ... @@ -614,13 +614,14 @@ class _MyCustomerHomePageState extends State<MyCustomerHomePage> {
controller: _controller,
shrinkWrap: true,
cacheExtent: ScreenUtil().setWidth(0),
itemCount: customerProvider.guestSunmodel!.tips!.awaken ==
null ||
customerProvider
.guestSunmodel!.tips!.awaken!.length ==
0
? 0
: 1,
itemCount:
customerProvider.guestSunmodel!.tips!.awaken ==
null ||
customerProvider.guestSunmodel!.tips!
.awaken!.length ==
0
? 0
: 1,
itemBuilder: (BuildContext context, int index) {
// locationState = state;
... ...
... ... @@ -341,7 +341,7 @@ class _CustomerSettingPageState extends State<CustomerSettingPage> {
child: Scaffold(
backgroundColor: MyColours.color_ffffff,
appBar: SystemAppBar(
'客情设置',
'预订客人信息录入限制设置',
onTap: () {
if (Navigator.canPop(context)) {
Navigator.pop(context);
... ... @@ -359,18 +359,6 @@ class _CustomerSettingPageState extends State<CustomerSettingPage> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
padding: EdgeInsets.symmetric(vertical: w(8)),
child: Text('客人信息录入',
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(32)))),
MyDivider(
double.infinity,
w(1),
color: MyColours.color_E7E7E7,
),
VEmptyView(24),
InkWell(
onTap: () {
setState(() {
... ... @@ -553,667 +541,7 @@ class _CustomerSettingPageState extends State<CustomerSettingPage> {
w(1),
color: MyColours.color_E7E7E7,
)),
VEmptyView(48),
Container(
padding: EdgeInsets.symmetric(vertical: w(8)),
child: Text('历史订单',
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(32)))),
VEmptyView(22),
MyDivider(
double.infinity,
w(1),
color: MyColours.color_E7E7E7,
),
VEmptyView(24),
InkWell(
onTap: () {
setState(() {
customerProvider.isAddOver = !customerProvider.isAddOver;
});
// _sellerGuestSet();
},
child: Container(
padding: EdgeInsets.symmetric(
vertical: w(8), horizontal: w(14)),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text('允许新建过去餐段的订单',
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(28))),
Image.asset(
customerProvider.isAddOver
? Utils.getImgPath('swich_on')
: Utils.getImgPath('swich_off'),
width: ScreenUtil().setWidth(88),
// height: ScreenUtil().setWidth(82),
),
],
)),
),
Padding(
padding: EdgeInsets.only(left: w(14), right: w(10)),
child: MyDivider(
double.infinity,
w(1),
color: MyColours.color_E7E7E7,
)),
VEmptyView(24),
InkWell(
onTap: () {
setState(() {
customerProvider.isSetOver =
!customerProvider.isSetOver;
});
},
child: Container(
padding: EdgeInsets.symmetric(
vertical: w(8), horizontal: w(14)),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text('允许变更过去餐段订单',
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(28))),
Image.asset(
customerProvider.isSetOver
? Utils.getImgPath('swich_on')
: Utils.getImgPath('swich_off'),
width: ScreenUtil().setWidth(88),
// height: ScreenUtil().setWidth(82),
),
],
),
)),
Padding(
padding: EdgeInsets.only(left: w(14), right: w(10)),
child: MyDivider(
double.infinity,
w(1),
color: MyColours.color_E7E7E7,
)),
VEmptyView(24),
InkWell(
onTap: () {
setState(() {
customerProvider.isReserveOver =
!customerProvider.isReserveOver;
});
},
child: Container(
padding: EdgeInsets.symmetric(
vertical: w(8), horizontal: w(14)),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text('允许变更订单到过去餐段',
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(28))),
Image.asset(
customerProvider.isReserveOver
? Utils.getImgPath('swich_on')
: Utils.getImgPath('swich_off'),
width: ScreenUtil().setWidth(88),
// height: ScreenUtil().setWidth(82),
),
],
),
)),
Padding(
padding: EdgeInsets.only(left: w(14), right: w(10)),
child: MyDivider(
double.infinity,
w(1),
color: MyColours.color_E7E7E7,
)),
VEmptyView(24),
InkWell(
onTap: () {
setState(() {
customerProvider.isReserveCancel =
!customerProvider.isReserveCancel;
});
},
child: Container(
padding: EdgeInsets.symmetric(
vertical: w(8), horizontal: w(14)),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text('允许取消过去餐段的订单',
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(28))),
Image.asset(
customerProvider.isReserveCancel
? Utils.getImgPath('swich_on')
: Utils.getImgPath('swich_off'),
width: ScreenUtil().setWidth(88),
// height: ScreenUtil().setWidth(82),
),
],
),
)),
Padding(
padding: EdgeInsets.only(left: w(14), right: w(10)),
child: MyDivider(
double.infinity,
w(1),
color: MyColours.color_E7E7E7,
)),
VEmptyView(48),
Row(
children: [
Expanded(
child: Container(
padding: EdgeInsets.symmetric(vertical: w(8)),
child: Text('临餐取消预订限制(前台及管理员除外)',
overflow: TextOverflow.ellipsis,
maxLines: 10,
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(32))))),
HEmptyView(2),
Container(
width: w(40),
child: TextField(
controller: controllerDay,
textAlign: TextAlign.right,
textAlignVertical: TextAlignVertical.bottom,
maxLines: 1,
// //光标颜色
// cursorColor:
// widget.isSelect ? Colors.white : MyColours.color_199095,
//输入文本的样式
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(32),
),
inputFormatters: <TextInputFormatter>[
FilteringTextInputFormatter.allow(
RegExp(r'[0-9]')), //设置只允许输入数字
],
decoration: InputDecoration(
isCollapsed: true,
border:
OutlineInputBorder(borderSide: BorderSide.none),
hintText: '输入',
hintStyle: TextStyle(
color: MyColours.color_999999,
fontSize: ScreenUtil().setSp(32),
),
enabledBorder: new UnderlineInputBorder(
borderSide: BorderSide.none,
),
focusedBorder: new UnderlineInputBorder(
borderSide: BorderSide.none,
),
),
onChanged: (value) {},
onEditingComplete: () {
FocusScope.of(context)
.requestFocus(FocusNode()); //点击空白处隐藏键盘
},
keyboardType: TextInputType.number),
),
Text('天',
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(32))),
HEmptyView(24),
],
),
VEmptyView(22),
MyDivider(
double.infinity,
w(1),
color: MyColours.color_E7E7E7,
),
VEmptyView(24),
InkWell(
onTap: () {
setState(() {
customerProvider.cancelOrderdayShopowner =
!customerProvider.cancelOrderdayShopowner;
});
// _sellerGuestSet();
},
child: Container(
padding: EdgeInsets.symmetric(
vertical: w(8), horizontal: w(14)),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text('允许店长临餐取消预订',
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(28))),
Image.asset(
customerProvider.cancelOrderdayShopowner
? Utils.getImgPath('swich_on')
: Utils.getImgPath('swich_off'),
width: ScreenUtil().setWidth(88),
// height: ScreenUtil().setWidth(82),
),
],
)),
),
Padding(
padding: EdgeInsets.only(left: w(14), right: w(10)),
child: MyDivider(
double.infinity,
w(1),
color: MyColours.color_E7E7E7,
)),
VEmptyView(24),
InkWell(
onTap: () {
setState(() {
customerProvider.cancelOrderdayManager =
!customerProvider.cancelOrderdayManager;
});
},
child: Container(
padding: EdgeInsets.symmetric(
vertical: w(8), horizontal: w(14)),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text('允许经理临餐取消预订',
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(28))),
Image.asset(
customerProvider.cancelOrderdayManager
? Utils.getImgPath('swich_on')
: Utils.getImgPath('swich_off'),
width: ScreenUtil().setWidth(88),
// height: ScreenUtil().setWidth(82),
),
],
),
)),
Padding(
padding: EdgeInsets.only(left: w(14), right: w(10)),
child: MyDivider(
double.infinity,
w(1),
color: MyColours.color_E7E7E7,
)),
VEmptyView(24),
InkWell(
onTap: () {
setState(() {
customerProvider.cancelOrderdayOther =
!customerProvider.cancelOrderdayOther;
});
},
child: Container(
padding: EdgeInsets.symmetric(
vertical: w(8), horizontal: w(14)),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text('允许服务员及其他人员临餐取消预订',
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(28))),
Image.asset(
customerProvider.cancelOrderdayOther
? Utils.getImgPath('swich_on')
: Utils.getImgPath('swich_off'),
width: ScreenUtil().setWidth(88),
// height: ScreenUtil().setWidth(82),
),
],
),
)),
Padding(
padding: EdgeInsets.only(left: w(14), right: w(10)),
child: MyDivider(
double.infinity,
w(1),
color: MyColours.color_E7E7E7,
)),
VEmptyView(48),
// Container(
// padding: EdgeInsets.symmetric(vertical: w(8)),
// child: Text('优质客户标记',
// style: TextStyle(
// color: MyColours.color_515151,
// fontSize: ScreenUtil().setSp(32)))),
// VEmptyView(22),
// MyDivider(
// double.infinity,
// w(1),
// color: MyColours.color_E7E7E7,
// ),
// VEmptyView(24),
// InkWell(
// onTap: () {
// setState(() {
// customerProvider.isHighFrequency =
// !customerProvider.isHighFrequency;
// });
// },
// child: Container(
// padding: EdgeInsets.symmetric(
// vertical: w(8), horizontal: w(14)),
// child: Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// Text('高频客户标记',
// style: TextStyle(
// color: MyColours.color_515151,
// fontSize: ScreenUtil().setSp(28))),
// Image.asset(
// customerProvider.isHighFrequency
// ? Utils.getImgPath('swich_on')
// : Utils.getImgPath('swich_off'),
// width: ScreenUtil().setWidth(88),
// // height: ScreenUtil().setWidth(82),
// ),
// ],
// ),
// )),
// Padding(
// padding: EdgeInsets.only(left: w(14), right: w(10)),
// child: MyDivider(
// double.infinity,
// w(1),
// color: MyColours.color_E7E7E7,
// )),
// VEmptyView(24),
// Container(
// padding:
// EdgeInsets.symmetric(vertical: w(8), horizontal: w(14)),
// child: Row(
// children: [
// Expanded(
// child: Container(
// padding: EdgeInsets.symmetric(vertical: w(8)),
// child: Text('指定期限',
// overflow: TextOverflow.ellipsis,
// maxLines: 10,
// style: TextStyle(
// color: MyColours.color_515151,
// fontSize: ScreenUtil().setSp(28))))),
// HEmptyView(2),
// Container(
// width: w(40),
// child: TextField(
// controller: controllerDeadline,
// textAlign: TextAlign.right,
// textAlignVertical: TextAlignVertical.bottom,
// maxLines: 1,
// // //光标颜色
// // cursorColor:
// // widget.isSelect ? Colors.white : MyColours.color_199095,
// //输入文本的样式
// style: TextStyle(
// color: MyColours.color_515151,
// fontSize: ScreenUtil().setSp(28),
// ),
// inputFormatters: <TextInputFormatter>[
// FilteringTextInputFormatter.allow(
// RegExp(r'[0-9]')), //设置只允许输入数字
// ],
// decoration: InputDecoration(
// isCollapsed: true,
// border: OutlineInputBorder(
// borderSide: BorderSide.none),
// hintText: '输入',
// hintStyle: TextStyle(
// color: MyColours.color_999999,
// fontSize: ScreenUtil().setSp(28),
// ),
// enabledBorder: new UnderlineInputBorder(
// borderSide: BorderSide.none,
// ),
// focusedBorder: new UnderlineInputBorder(
// borderSide: BorderSide.none,
// ),
// ),
// onChanged: (value) {},
// onEditingComplete: () {
// FocusScope.of(context)
// .requestFocus(FocusNode()); //点击空白处隐藏键盘
// },
// keyboardType: TextInputType.number),
// ),
// HEmptyView(5),
// Text('天',
// style: TextStyle(
// color: MyColours.color_999999,
// fontSize: ScreenUtil().setSp(28))),
// // HEmptyView(24),
// ],
// )),
// Padding(
// padding: EdgeInsets.only(left: w(14), right: w(10)),
// child: MyDivider(
// double.infinity,
// w(1),
// color: MyColours.color_E7E7E7,
// )),
// VEmptyView(24),
// Container(
// padding:
// EdgeInsets.symmetric(vertical: w(8), horizontal: w(14)),
// child: Row(
// children: [
// Expanded(
// child: Container(
// padding: EdgeInsets.symmetric(vertical: w(8)),
// child: Text('消费次数',
// overflow: TextOverflow.ellipsis,
// maxLines: 10,
// style: TextStyle(
// color: MyColours.color_515151,
// fontSize: ScreenUtil().setSp(28))))),
// HEmptyView(2),
// Container(
// width: w(40),
// child: TextField(
// controller: controllerConsumptionTimes,
// textAlign: TextAlign.right,
// textAlignVertical: TextAlignVertical.bottom,
// maxLines: 1,
// // //光标颜色
// // cursorColor:
// // widget.isSelect ? Colors.white : MyColours.color_199095,
// //输入文本的样式
// style: TextStyle(
// color: MyColours.color_515151,
// fontSize: ScreenUtil().setSp(28),
// ),
// inputFormatters: <TextInputFormatter>[
// FilteringTextInputFormatter.allow(
// RegExp(r'[0-9]')), //设置只允许输入数字
// ],
// decoration: InputDecoration(
// isCollapsed: true,
// border: OutlineInputBorder(
// borderSide: BorderSide.none),
// hintText: '输入',
// hintStyle: TextStyle(
// color: MyColours.color_999999,
// fontSize: ScreenUtil().setSp(28),
// ),
// enabledBorder: new UnderlineInputBorder(
// borderSide: BorderSide.none,
// ),
// focusedBorder: new UnderlineInputBorder(
// borderSide: BorderSide.none,
// ),
// ),
// onChanged: (value) {},
// onEditingComplete: () {
// FocusScope.of(context)
// .requestFocus(FocusNode()); //点击空白处隐藏键盘
// },
// keyboardType: TextInputType.number),
// ),
// HEmptyView(5),
// Text('次',
// style: TextStyle(
// color: MyColours.color_999999,
// fontSize: ScreenUtil().setSp(28))),
// // HEmptyView(24),
// ],
// )),
// Padding(
// padding: EdgeInsets.only(left: w(14), right: w(10)),
// child: MyDivider(
// double.infinity,
// w(1),
// color: MyColours.color_E7E7E7,
// )),
// VEmptyView(24),
// InkWell(
// onTap: () {
// setState(() {
// customerProvider.isHighConsumption =
// !customerProvider.isHighConsumption;
// });
// },
// child: Container(
// padding: EdgeInsets.symmetric(
// vertical: w(8), horizontal: w(14)),
// child: Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// Text('高消费客户标记',
// style: TextStyle(
// color: MyColours.color_515151,
// fontSize: ScreenUtil().setSp(28))),
// Image.asset(
// customerProvider.isHighConsumption
// ? Utils.getImgPath('swich_on')
// : Utils.getImgPath('swich_off'),
// width: ScreenUtil().setWidth(88),
// // height: ScreenUtil().setWidth(82),
// ),
// ],
// ),
// )),
// Padding(
// padding: EdgeInsets.only(left: w(14), right: w(10)),
// child: MyDivider(
// double.infinity,
// w(1),
// color: MyColours.color_E7E7E7,
// )),
// VEmptyView(24),
// Container(
// padding:
// EdgeInsets.symmetric(vertical: w(8), horizontal: w(14)),
// child: Row(
// children: [
// Expanded(
// child: Container(
// padding: EdgeInsets.symmetric(vertical: w(8)),
// child: Text('客户人均消费到达设置金额标记为高单值',
// overflow: TextOverflow.ellipsis,
// maxLines: 10,
// style: TextStyle(
// color: MyColours.color_515151,
// fontSize: ScreenUtil().setSp(28))))),
// HEmptyView(2),
// Container(
// width: w(40),
// child: TextField(
// controller: controllerHighValue,
// textAlign: TextAlign.right,
// textAlignVertical: TextAlignVertical.bottom,
// maxLines: 1,
// // //光标颜色
// // cursorColor:
// // widget.isSelect ? Colors.white : MyColours.color_199095,
// //输入文本的样式
// style: TextStyle(
// color: MyColours.color_515151,
// fontSize: ScreenUtil().setSp(28),
// ),
// inputFormatters: <TextInputFormatter>[
// FilteringTextInputFormatter.allow(
// RegExp("[0-9.]")),
// ],
// decoration: InputDecoration(
// isCollapsed: true,
// border: OutlineInputBorder(
// borderSide: BorderSide.none),
// hintText: '输入',
// hintStyle: TextStyle(
// color: MyColours.color_999999,
// fontSize: ScreenUtil().setSp(28),
// ),
// enabledBorder: new UnderlineInputBorder(
// borderSide: BorderSide.none,
// ),
// focusedBorder: new UnderlineInputBorder(
// borderSide: BorderSide.none,
// ),
// ),
// onChanged: (value) {},
// onEditingComplete: () {
// FocusScope.of(context)
// .requestFocus(FocusNode()); //点击空白处隐藏键盘
// },
// keyboardType: TextInputType.number),
// ),
// HEmptyView(5),
// Text('元',
// style: TextStyle(
// color: MyColours.color_999999,
// fontSize: ScreenUtil().setSp(28))),
// // HEmptyView(24),
// ],
// )),
// Padding(
// padding: EdgeInsets.only(left: w(14), right: w(10)),
// child: MyDivider(
// double.infinity,
// w(1),
// color: MyColours.color_E7E7E7,
// )),
// VEmptyView(24),
// VEmptyView(48),
Text('店内自定义标签',
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(32))),
VEmptyView(48),
Container(
padding: EdgeInsets.symmetric(
vertical: w(18), horizontal: w(14)),
child: Wrap(
spacing: ScreenUtil().setWidth(20),
runSpacing: ScreenUtil().setWidth(10),
crossAxisAlignment: WrapCrossAlignment.center,
children:
_buildLabelItem(customerProvider.labelList!))),
Padding(
padding: EdgeInsets.only(left: w(14), right: w(10)),
child: MyDivider(
double.infinity,
w(1),
color: MyColours.color_E7E7E7,
)),
],
))),
... ... @@ -1238,22 +566,22 @@ class _CustomerSettingPageState extends State<CustomerSettingPage> {
FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘
//前置条件判断
if (customerProvider.isHighFrequency) {
if (controllerDeadline.text.trim().length == 0) {
Utils.showToast('请输入指定期限');
return;
}
if (controllerConsumptionTimes.text.trim().length == 0) {
Utils.showToast('请输入消费次数');
return;
}
}
if (customerProvider.isHighConsumption) {
if (controllerHighValue.text.trim().length == 0) {
Utils.showToast('请设置客户人均消费到达金额');
return;
}
}
// if (customerProvider.isHighFrequency) {
// if (controllerDeadline.text.trim().length == 0) {
// Utils.showToast('请输入指定期限');
// return;
// }
// if (controllerConsumptionTimes.text.trim().length == 0) {
// Utils.showToast('请输入消费次数');
// return;
// }
// }
// if (customerProvider.isHighConsumption) {
// if (controllerHighValue.text.trim().length == 0) {
// Utils.showToast('请设置客户人均消费到达金额');
// return;
// }
// }
_saveData();
},
),
... ...
... ... @@ -72,11 +72,11 @@ class _StoreCustomerHomePageState extends State<StoreCustomerHomePage>
customerProvider = Provider.of<CustomerProvider>(context, listen: false);
return Scaffold(
appBar: SystemAppBar(
'全店客情',
rightImgName: 'c_set.png',
onTapRight: () {
NavigatorUtil.goCustomerSetPage(context);
},
'客户汇总',
// rightImgName: 'c_set.png',
// onTapRight: () {
// NavigatorUtil.goCustomerSetPage(context);
// },
),
body: Column(
children: [
... ...
... ... @@ -71,19 +71,20 @@ class _FinanceManageHomePageState extends State<FinanceManageHomePage> {
// NavigatorUtil.goEnterpriseInformationUploadPage(context);
// }),
// _item('微信商户账户开通结果查询', () {}),
_item('门店收款码', () {
NavigatorUtil.goPaymentCodePage(context);
}),
_item('支付返券', () {
NavigatorUtil.goPaymentGiftPage(context);
}),
_item('支付返消费金', () {
NavigatorUtil.goReturnMoneyPage(context);
_item('门店收款码', () {
NavigatorUtil.goPaymentCodePage(context);
}),
// _item('支付返消费金', () {
// NavigatorUtil.goReturnMoneyPage(context);
// }),
_item('买单前送消费金', () {
NavigatorUtil.goGiveMoneyBeforePayPage(context);
}),
// _item('买单前送消费金', () {
// NavigatorUtil.goGiveMoneyBeforePayPage(context);
// }),
_item('交易记录', () {
NavigatorUtil.goTransactionRecordHomePage(context);
... ...
... ... @@ -437,7 +437,7 @@ class _CommentsSettingPageState extends State<CommentsSettingPage> {
Provider.of<MarketingCenterProvider>(context, listen: false);
return Scaffold(
backgroundColor: MyColours.color_ffffff,
appBar: SystemAppBar('用户评价设置'),
appBar: SystemAppBar('意见反馈设置'),
body: Column(
children: [
Expanded(
... ...
... ... @@ -35,7 +35,7 @@ class _CustomerNoticeSettingPageState extends State<CustomerNoticeSettingPage> {
bool cancelSms = false; //取消预订发送短信默认关闭
bool noticeSms = false; //使用店铺手机发送通知短信
bool marketingSms = false; //使用店铺手机发送营销短信
bool select = false; //启用预订安排通知图文模式
// bool select = false; //启用预订安排通知图文模式
late MarketingCenterProvider marketingCenterProvider;
// String themeName = '';
// String previewUrl = ''; //效果预览的图片链接
... ... @@ -70,11 +70,12 @@ class _CustomerNoticeSettingPageState extends State<CustomerNoticeSettingPage> {
}
getDzSellerConf() async {
bool success = await marketingCenterProvider.getDzSellerConf(context,showLoading: false);
bool success = await marketingCenterProvider.getDzSellerConf(context,
showLoading: false);
if (success && marketingCenterProvider.dzSellerConfModel != null) {
select = marketingCenterProvider.dzSellerConfModel!.isNewTemplate == '1'
? true
: false;
// select = marketingCenterProvider.dzSellerConfModel!.isNewTemplate == '1'
// ? true
// : false;
cancelSms = marketingCenterProvider.dzSellerConfModel!.isOpenCancel == '1'
? true
: false;
... ... @@ -162,14 +163,14 @@ class _CustomerNoticeSettingPageState extends State<CustomerNoticeSettingPage> {
///保存接口
_setData() async {
(bool, bool,bool, bool) result = await (
(bool, bool) result = await (
_setCancelSMS(),
_setNotice(),
_setMarketing(),
_setNewType(),
// _setMarketing(),
// _setNewType(),
).wait;
if (result.$1 && result.$2 && result.$3 && result.$4) {
if (result.$1 && result.$2) {
Utils.showToast('设置成功');
} else {
Utils.showToast('设置失败,请重试');
... ... @@ -177,7 +178,7 @@ class _CustomerNoticeSettingPageState extends State<CustomerNoticeSettingPage> {
}
///客户取消预订时自动发送通知短信
Future<bool> _setCancelSMS({bool isShowLoading = true}) async {
Future<bool> _setCancelSMS({bool isShowLoading = true}) async {
Map<String, String?> params = {
'sid': Provider.of<UserModel>(context, listen: false).user!.sellerid,
'key': 'is_open_cancel_temp',
... ... @@ -206,7 +207,7 @@ class _CustomerNoticeSettingPageState extends State<CustomerNoticeSettingPage> {
}
///使用店铺手机发送通知短信
Future<bool> _setNotice({bool isShowLoading = true}) async {
Future<bool> _setNotice({bool isShowLoading = true}) async {
Map<String, String?> params = {
'sid': Provider.of<UserModel>(context, listen: false).user!.sellerid,
'key': 'is_seller_notice',
... ... @@ -224,7 +225,7 @@ class _CustomerNoticeSettingPageState extends State<CustomerNoticeSettingPage> {
}
///使用店铺手机发送营销短信
Future<bool> _setMarketing({bool isShowLoading = true}) async {
Future<bool> _setMarketing({bool isShowLoading = true}) async {
Map<String, String?> params = {
'sid': Provider.of<UserModel>(context, listen: false).user!.sellerid,
'key': 'is_seller_marketing',
... ... @@ -242,22 +243,22 @@ class _CustomerNoticeSettingPageState extends State<CustomerNoticeSettingPage> {
}
///启用预订安排通知图文模式
Future<bool> _setNewType({bool isShowLoading = true}) async {
Map<String, String?> params = {
'sid': Provider.of<UserModel>(context, listen: false).user!.sellerid,
'key': 'is_new_template',
'value': select ? '1' : '0'
};
bool success = await marketingCenterProvider.setConfing(context, params,
needToast: false);
if (success) {
return true;
} else {
return false;
}
}
// Future<bool> _setNewType({bool isShowLoading = true}) async {
// Map<String, String?> params = {
// 'sid': Provider.of<UserModel>(context, listen: false).user!.sellerid,
// 'key': 'is_new_template',
// 'value': select ? '1' : '0'
// };
// bool success = await marketingCenterProvider.setConfing(context, params,
// needToast: false);
// if (success) {
// return true;
// } else {
// return false;
// }
// }
_showPhotoView(BuildContext context, int index, List<String> imgs,
{isShow = false, List? dashName}) async {
... ... @@ -447,17 +448,29 @@ class _CustomerNoticeSettingPageState extends State<CustomerNoticeSettingPage> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
_title('充值优惠活动设置'),
_item('预订安排中附带的营销推广', onTap: () {
NavigatorUtil.goRechargeSettingPage(context);
}),
VEmptyView(40),
_title('优惠券设置'),
_item('预订安排中附带的营销推广', onTap: () {
NavigatorUtil.goCouponSettingPage(context);
}),
VEmptyView(40),
_title('短信通知'),
_itemSmsWidget(cancelSms, '客户取消预订时自动发送通知短信',
onTap: () {
setState(() {
cancelSms = !cancelSms;
});
_setCancelSMS();
}),
_itemSmsWidget(noticeSms, '使用店铺手机发送通知短信', onTap: () {
setState(() {
noticeSms = !noticeSms;
});
_setNotice();
}),
VEmptyView(28),
InkWell(
... ... @@ -608,49 +621,49 @@ class _CustomerNoticeSettingPageState extends State<CustomerNoticeSettingPage> {
],
)),
)),
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);
// if (previewUrl == '') {
// Utils.showToast('暂时没有可预览的图文信息');
// return;
// }
// //
// _showPhotoView(context, 0, [previewUrl]);
// }),
// 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();
}))
],
))
// 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);
// // if (previewUrl == '') {
// // Utils.showToast('暂时没有可预览的图文信息');
// // return;
// // }
// // //
// // _showPhotoView(context, 0, [previewUrl]);
// // }),
// // 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();
// }))
// ],
// ))
],
);
}
... ...
... ... @@ -175,170 +175,170 @@ class _MarketingCenterHomePageState extends State<MarketingCenterHomePage> {
child: SingleChildScrollView(
child: Column(
children: [
InkWell(
onTap: () {
if (!collectStoreProvider.sellerCoupon) {
//没有购买优惠券模块
//提示购买
// InkWell(
// onTap: () {
// if (!collectStoreProvider.sellerCoupon) {
// //没有购买优惠券模块
// //提示购买
DialogUtil.showSellerVersionBuyDialog(
context, '储值营销', (v) {});
return;
}
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: () {
if (!collectStoreProvider.sellerOrderCustomer) {
//没有购买提前点餐模块
//提示购买
// DialogUtil.showSellerVersionBuyDialog(
// context, '储值营销', (v) {});
// return;
// }
// 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: () {
// if (!collectStoreProvider.sellerOrderCustomer) {
// //没有购买提前点餐模块
// //提示购买
DialogUtil.showSellerVersionBuyDialog(
context, '提前点餐', (v) {});
return;
}
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: () {
if (!collectStoreProvider.sellerOrderManager) {
//没有购买经理排菜模块
//提示购买
// DialogUtil.showSellerVersionBuyDialog(
// context, '提前点餐', (v) {});
// return;
// }
// 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: () {
// if (!collectStoreProvider.sellerOrderManager) {
// //没有购买经理排菜模块
// //提示购买
DialogUtil.showSellerVersionBuyDialog(
context, '经理排菜', (v) {});
return;
}
NavigatorUtil.goOrderSettingManagerPage(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.goCommentsSettingPage(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),
// DialogUtil.showSellerVersionBuyDialog(
// context, '经理排菜', (v) {});
// return;
// }
// NavigatorUtil.goOrderSettingManagerPage(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.goCommentsSettingPage(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);
... ... @@ -409,75 +409,75 @@ class _MarketingCenterHomePageState extends State<MarketingCenterHomePage> {
child: MyDivider(double.infinity, w(0.5),
color: MyColours.color_E7E7E7)),
VEmptyView(24),
InkWell(
onTap: () {
NavigatorUtil.goPaymentSettingPage(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.goGrantPage(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)),
// InkWell(
// onTap: () {
// NavigatorUtil.goPaymentSettingPage(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.goGrantPage(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)),
// InkWell(
// onTap: () {
// setState(() {
... ...
... ... @@ -131,17 +131,20 @@ class _RechargeHomePageState extends State<RechargeHomePage> {
bool showBtn = Utils.getAuthority(context, '编辑优惠');
return Scaffold(
backgroundColor: MyColours.color_f3f3f3,
appBar: Utils.getAuthority(context, '充值优惠-设置')
? SystemAppBar(
'充值优惠',
rightImgName: 'set_g.png',
onTapRight: () {
NavigatorUtil.goRechargeSettingPage(context);
},
)
: SystemAppBar(
'充值优惠',
),
appBar: SystemAppBar(
'充值优惠',
),
// Utils.getAuthority(context, '充值优惠-设置')
// ? SystemAppBar(
// '充值优惠',
// rightImgName: 'set_g.png',
// onTapRight: () {
// NavigatorUtil.goRechargeSettingPage(context);
// },
// )
// : SystemAppBar(
// '充值优惠',
// ),
body: Container(
child: Column(
children: [
... ...
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:one_key/route/navigator_util.dart';
import 'package:one_key/widgets/MyDivider.dart';
import 'package:one_key/widgets/h_empty_view.dart';
import 'package:one_key/widgets/v_empty_view.dart';
import 'package:provider/provider.dart';
import '../../../provider/collect_store_provider.dart';
import '../../../provider/marketing_center_provider.dart';
import '../../../provider/user_model.dart';
import '../../../res/colors.dart';
import '../../../utils/dialog_util.dart';
import '../../../utils/event_bus.dart';
import '../../../utils/screen_util.dart';
import '../../../utils/utils.dart';
import '../../../widgets/round_button.dart';
import '../../../widgets/system_app_bar.dart';
/**
* 菜单管理home
*/
class MenuHomePage extends StatefulWidget {
final bool sellerOrderManager;
final bool sellerOrderCustomer;
MenuHomePage(
{Key? key,
required this.sellerOrderManager,
required this.sellerOrderCustomer})
: super(key: key);
@override
_MenuHomePageState createState() => _MenuHomePageState();
}
class _MenuHomePageState extends State<MenuHomePage> {
@override
void initState() {
super.initState();
WidgetsBinding.instance.addPostFrameCallback((_) {});
}
@override
void dispose() {
EventBus().emit('changeStatusColor');
super.dispose();
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.white,
appBar: SystemAppBar(
'菜单管理',
),
body: Column(
children: [
Expanded(
child: SingleChildScrollView(
child: Column(
children: [
InkWell(
onTap: () async {
//
bool? needRefresh =
await NavigatorUtil.goMenuCategoryPage(context);
print(needRefresh);
if (needRefresh != null && needRefresh) {
//刷新页面数据
// _controller.callRefresh();
// _couponNetworkData();
}
},
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.goMenuManagePage(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: () {
//
if (!widget.sellerOrderManager) {
//没有购买经理排菜模块
//提示购买
DialogUtil.showSellerVersionBuyDialog(
context, '经理排菜', (v) {});
return;
}
if (Utils.getAuthority(context, '套餐排菜')) {
NavigatorUtil.goMyPlanDishHomePage(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: () {
//
if (!widget.sellerOrderCustomer) {
//没有购买提前点餐模块
//提示购买
DialogUtil.showSellerVersionBuyDialog(
context, '提前点餐', (v) {});
return;
}
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)),
],
),
)),
],
));
}
}
... ...
import 'dart:convert';
// import 'package:amap_map_fluttify/amap_map_fluttify.dart';
... ... @@ -237,8 +236,8 @@ class _MenuManagePageState extends State<MenuManagePage> {
//小图
//判断下一个是大图还是小图
if (menuManageProvider.menuModel![i].cookbooklist!.length - 1 > j) {
if (menuManageProvider
.menuModel![i].cookbooklist![j + 1].cookStyle!.imageType ==
if (menuManageProvider.menuModel![i].cookbooklist![j + 1]
.cookStyle!.imageType ==
'1') {
//下一个是大图
menuSunModel.indexNew = j;
... ... @@ -740,7 +739,7 @@ class _MenuManagePageState extends State<MenuManagePage> {
context,
model.nameTypeList,
model.imageTypeList,
model.moveList(cookbooklist.length)) ;
model.moveList(cookbooklist.length));
if (object != null) {
print(object);
if (object['name_type'] != null) {
... ... @@ -823,7 +822,7 @@ class _MenuManagePageState extends State<MenuManagePage> {
return Scaffold(
backgroundColor: MyColours.color_DBDBDB,
appBar: SystemAppBar(
'菜单管理',
'菜品管理',
rightImgName: 'set_g.png',
onTapRight: () {
NavigatorUtil.goMenuThemeColorSetPage(
... ... @@ -890,7 +889,7 @@ class _MenuManagePageState extends State<MenuManagePage> {
onPressed: () async {
bool? needRefresh =
await NavigatorUtil.goMenuCategoryPage(
context) ;
context);
print(needRefresh);
if (needRefresh != null && needRefresh) {
//刷新页面数据
... ... @@ -1068,7 +1067,8 @@ class _MenuManagePageState extends State<MenuManagePage> {
.nameType ==
'1'
? CrossAxisAlignment.start
: model.cookStyle!.imageType !=
: model.cookStyle!
.imageType !=
'2' &&
model.cookStyle!
.nameType ==
... ... @@ -1289,54 +1289,55 @@ class _MenuManagePageState extends State<MenuManagePage> {
if (model.pageState == PageState.Success ||
model.pageState == PageState.Empty)
Container(
padding: EdgeInsets.symmetric(horizontal: w(23)),
padding: EdgeInsets.symmetric(horizontal: w(45)),
// height: w(80),
color: MyColours.color_FAFAFA,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Padding(
padding: EdgeInsets.only(top: w(12), bottom: w(25)),
child: RoundButton(
onPressed: () async {
bool? needRefresh =
await NavigatorUtil.goMenuCategoryPage(
context) ;
print(needRefresh);
if (needRefresh != null && needRefresh) {
//刷新页面数据
// _controller.callRefresh();
// _couponNetworkData();
}
},
text: '分类管理',
fontSize: 32,
gradientStart: MyColours.color_ffffff,
gradientEnd: MyColours.color_ffffff,
borderColor: MyColours.color_438E93,
textColor: MyColours.color_438E93,
isBold: true,
height: w(43),
width: w(100),
radius: r(5),
)),
// Padding(
// padding: EdgeInsets.only(top: w(12), bottom: w(25)),
// child: RoundButton(
// onPressed: () async {
// bool? needRefresh =
// await NavigatorUtil.goMenuCategoryPage(
// context);
// print(needRefresh);
// if (needRefresh != null && needRefresh) {
// //刷新页面数据
// // _controller.callRefresh();
// // _couponNetworkData();
// }
// },
// text: '分类管理',
// fontSize: 32,
// gradientStart: MyColours.color_ffffff,
// gradientEnd: MyColours.color_ffffff,
// borderColor: MyColours.color_438E93,
// textColor: MyColours.color_438E93,
// isBold: true,
// height: w(43),
// width: w(100),
// radius: r(5),
// )),
!isShow
? SizedBox()
: Padding(
padding:
EdgeInsets.only(top: w(12), bottom: w(25)),
child: RoundButton(
onPressed: () async {
await NavigatorUtil.goMenuAddDishesPage(
context);
},
text: '添加菜品',
fontSize: 32,
isBold: true,
width: w(218),
height: w(43),
radius: r(5),
))
: Expanded(
child: Padding(
padding: EdgeInsets.only(
top: w(12), bottom: w(25)),
child: RoundButton(
onPressed: () async {
await NavigatorUtil.goMenuAddDishesPage(
context);
},
text: '添加菜品',
fontSize: 32,
isBold: true,
width: w(218),
height: w(43),
radius: r(5),
)))
],
))
]);
... ...