Commit c6d82706146be36e7b817659e7f22a7445b71d52

Authored by wdn127929
1 parent f6d34073

迎宾权限开放存酒权限

... ... @@ -449,7 +449,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 5550;
CURRENT_PROJECT_VERSION = 5551;
DEVELOPMENT_TEAM = 8J59HM8B82;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
... ... @@ -632,7 +632,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 5550;
CURRENT_PROJECT_VERSION = 5551;
DEVELOPMENT_TEAM = 8J59HM8B82;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
... ... @@ -658,7 +658,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 5550;
CURRENT_PROJECT_VERSION = 5551;
DEVELOPMENT_TEAM = 8J59HM8B82;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
... ...
... ... @@ -211,17 +211,29 @@ class _CouponDetailPageState extends State<CouponDetailPage> {
fontSize: ScreenUtil().setSp(32)),
),
),
Spacer(),
Image.asset(
swich
? Utils.getImgPath(title == '立即启用' || title == '是否核销'
? 'swich_on'
: 'swich_on_lit')
: Utils.getImgPath(title == '立即启用' || title == '是否核销'
? 'swich_off'
: 'swich_off_lit'),
width: ScreenUtil().setWidth(44 * 2),
)
HEmptyView(10),
Expanded(
child: Text(
swich ? '是' : '否',
maxLines: 1,
textAlign: TextAlign.right,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: Color.fromRGBO(0, 0, 0, 0.4),
fontSize: ScreenUtil().setSp(32),
),
))
// Image.asset(
// swich
// ? Utils.getImgPath(title == '立即启用' || title == '是否核销'
// ? 'swich_on'
// : 'swich_on_lit')
// : Utils.getImgPath(title == '立即启用' || title == '是否核销'
// ? 'swich_off'
// : 'swich_off_lit'),
// width: ScreenUtil().setWidth(44 * 2),
// )
],
),
);
... ... @@ -837,7 +849,7 @@ class _CouponDetailPageState extends State<CouponDetailPage> {
// ),
// VEmptyView(24),
_canUse(
'立即启用',
'是否启用',
couponProvider.couponSunModel!.status == '1'
? true
: false),
... ... @@ -875,107 +887,92 @@ class _CouponDetailPageState extends State<CouponDetailPage> {
width: w(100),
gradientStart: MyColours.color_ffffff,
gradientEnd: MyColours.color_ffffff,
borderColor: canOperate
? MyColours.color_438E93
: MyColours.color_999999,
textColor: canOperate
? MyColours.color_438E93
: MyColours.color_999999,
borderColor: MyColours.color_438E93,
textColor: MyColours.color_438E93,
height: ScreenUtil().setWidth(80),
radius: ScreenUtil().setWidth(14),
isBold: true,
fontSize: 28,
onPressed: () async {
if (canOperate) {
if (couponProvider.couponSunModel!.status !=
'1') {
Utils.showToast('请先启用优惠券后再进行操作!');
return;
}
if (couponProvider.couponSunModel!.status != '1') {
Utils.showToast('请先启用优惠券后再进行操作!');
return;
}
if (couponProvider.couponSunModel!.isType ==
'3') {
if (couponProvider.couponSunModel!.isType == '3') {
NavigatorUtil.goCouponPosterPage(
context,
widget.idstr,
couponProvider.couponSunModel!.use,
couponProvider.couponSunModel);
} else {
// 谁可以发放
// 可以发放的才能分享
if (couponProvider.couponSunModel!.uidList!
.split(',')
.contains(Provider.of<UserModel>(context,
listen: false)
.user!
.openid)) {
NavigatorUtil.goCouponPosterPage(
context,
widget.idstr,
couponProvider.couponSunModel!.use,
couponProvider.couponSunModel);
} else {
// 谁可以发放
// 可以发放的才能分享
if (couponProvider.couponSunModel!.uidList!
.split(',')
.contains(Provider.of<UserModel>(context,
listen: false)
.user!
.openid)) {
NavigatorUtil.goCouponPosterPage(
context,
widget.idstr,
couponProvider.couponSunModel!.use,
couponProvider.couponSunModel);
} else {
Utils.showToast('您没有此权限');
}
Utils.showToast('您没有此权限');
}
}
},
),
if (couponProvider.couponSunModel!.liteQrcode != null)
HEmptyView(30),
if (couponProvider.couponSunModel!.isType == '3' ||
couponProvider.couponSunModel!.isType == '1')
if ((couponProvider.couponSunModel!.isType == '3' ||
couponProvider.couponSunModel!.isType == '1') &&
canOperate)
RoundButton(
text: '复用',
width: w(100),
gradientStart: MyColours.color_ffffff,
gradientEnd: MyColours.color_ffffff,
borderColor: canOperate
? MyColours.color_438E93
: MyColours.color_999999,
textColor: canOperate
? MyColours.color_438E93
: MyColours.color_999999,
borderColor: MyColours.color_438E93,
textColor: MyColours.color_438E93,
height: ScreenUtil().setWidth(80),
radius: ScreenUtil().setWidth(14),
isBold: true,
fontSize: 28,
onPressed: () async {
if (canOperate) {
if (couponProvider.couponSunModel!.isType ==
'3') {
//复用,跳转至编辑页面
dynamic needRefresh =
await NavigatorUtil.goCouponEditPage(
context,
isMine: couponProvider
.couponSunModel!.isType ==
'1'
? false
: true,
couponSunModel:
couponProvider.couponSunModel);
if (needRefresh != null && needRefresh) {
if (Navigator.canPop(context)) {
Navigator.pop(context);
}
if (couponProvider.couponSunModel!.isType == '3') {
//复用,跳转至编辑页面
dynamic needRefresh =
await NavigatorUtil.goCouponEditPage(context,
isMine: couponProvider
.couponSunModel!.isType ==
'1'
? false
: true,
couponSunModel:
couponProvider.couponSunModel);
if (needRefresh != null && needRefresh) {
if (Navigator.canPop(context)) {
Navigator.pop(context);
}
} else {
//复用,跳转至编辑页面
dynamic needRefresh =
await NavigatorUtil.goCouponEditPayPage(
context,
isMine: couponProvider
.couponSunModel!.isType ==
'1'
? false
: true,
couponSunModel:
couponProvider.couponSunModel);
if (needRefresh != null && needRefresh) {
if (Navigator.canPop(context)) {
Navigator.pop(context);
}
}
} else {
//复用,跳转至编辑页面
dynamic needRefresh =
await NavigatorUtil.goCouponEditPayPage(
context,
isMine: couponProvider
.couponSunModel!.isType ==
'1'
? false
: true,
couponSunModel:
couponProvider.couponSunModel);
if (needRefresh != null && needRefresh) {
if (Navigator.canPop(context)) {
Navigator.pop(context);
}
}
}
... ... @@ -987,25 +984,34 @@ class _CouponDetailPageState extends State<CouponDetailPage> {
text: '分享给客户',
height: ScreenUtil().setWidth(80),
radius: ScreenUtil().setWidth(14),
gradientStart: canOperate
? MyColours.color_438E93
: MyColours.color_999999,
gradientEnd: canOperate
? MyColours.color_438E93
: MyColours.color_999999,
gradientStart: MyColours.color_438E93,
gradientEnd: MyColours.color_438E93,
isBold: false,
fontSize: 28,
onPressed: () {
if (canOperate) {
if (couponProvider.couponSunModel!.status !=
'1') {
Utils.showToast('请先启用优惠券后再进行操作!');
return;
}
if (couponProvider.couponSunModel!.status ==
'1') {
if (couponProvider.couponSunModel!.isType ==
'3') {
if (couponProvider.couponSunModel!.status != '1') {
Utils.showToast('请先启用优惠券后再进行操作!');
return;
}
if (couponProvider.couponSunModel!.status == '1') {
if (couponProvider.couponSunModel!.isType ==
'3') {
Utils.goShareBuyCouponToWeChat(
context,
widget.idstr,
couponProvider.couponSunModel!.isType,
couponProvider.couponSunModel!.use,
couponProvider.couponSunModel);
} else {
// 谁可以发放
// 可以发放的才能分享
if (couponProvider.couponSunModel!.uidList!
.split(',')
.contains(Provider.of<UserModel>(context,
listen: false)
.user!
.openid)) {
//包含当前登录人
Utils.goShareBuyCouponToWeChat(
context,
widget.idstr,
... ... @@ -1013,37 +1019,20 @@ class _CouponDetailPageState extends State<CouponDetailPage> {
couponProvider.couponSunModel!.use,
couponProvider.couponSunModel);
} else {
// 谁可以发放
// 可以发放的才能分享
if (couponProvider.couponSunModel!.uidList!
.split(',')
.contains(Provider.of<UserModel>(context,
listen: false)
.user!
.openid)) {
//包含当前登录人
Utils.goShareBuyCouponToWeChat(
context,
widget.idstr,
couponProvider.couponSunModel!.isType,
couponProvider.couponSunModel!.use,
couponProvider.couponSunModel);
} else {
Utils.showToast('您没有此权限');
}
Utils.showToast('您没有此权限');
}
}
// else if (couponProvider.couponSunModel.isType ==
// '2' &&
// couponProvider.couponSunModel.status == '1') {
// // 我的优惠券
// Utils.goShareBuyCouponToWeChatMy(
// context,
// widget.idstr,
// managerName,
// couponProvider.couponSunModel);
// }
}
// else if (couponProvider.couponSunModel.isType ==
// '2' &&
// couponProvider.couponSunModel.status == '1') {
// // 我的优惠券
// Utils.goShareBuyCouponToWeChatMy(
// context,
// widget.idstr,
// managerName,
// couponProvider.couponSunModel);
// }
},
),
)
... ...
... ... @@ -242,7 +242,10 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
child: ChangeNotifierProvider<CustomerProvider>(
create: (_) => CustomerProvider(),
child: ChangeNotifierProvider<UserModel>(
create: (_) => UserModel(), child: MyPage()))),
create: (_) => UserModel(),
child: ChangeNotifierProvider<PersonnelProvider>(
create: (_) => PersonnelProvider(),
child: MyPage())))),
)));
WidgetsBinding.instance.addPostFrameCallback((_) async {
// bus.on('refresh_token', (arg) {
... ...
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
... ... @@ -48,8 +47,8 @@ class _RechargeDetailPageState extends State<RechargeDetailPage> {
}
_getNewRechargeDetail() async {
bool success = await marketingCenterProvider!.getNewRechargeDetail(
context, widget.idstr);
bool success = await marketingCenterProvider!
.getNewRechargeDetail(context, widget.idstr);
}
///输入框
... ... @@ -133,18 +132,18 @@ class _RechargeDetailPageState extends State<RechargeDetailPage> {
children: [
Container(
child: Text(
'立即启用',
'是否启用',
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(32)),
),
),
Spacer(),
Image.asset(
marketingCenterProvider!.rechargeDetail!.isOpen == '1'
? Utils.getImgPath('swich_on')
: Utils.getImgPath('swich_off'),
width: ScreenUtil().setWidth(44 * 2),
Text(
marketingCenterProvider!.rechargeDetail!.isOpen == '1' ? '是' : '否',
style: TextStyle(
color: MyColours.color_999999,
fontSize: ScreenUtil().setSp(32)),
),
HEmptyView(16)
],
... ... @@ -171,7 +170,8 @@ class _RechargeDetailPageState extends State<RechargeDetailPage> {
if (widget.idstr != null &&
widget.idstr != 'null' &&
marketingCenterProvider!.rechargeDetail!.isOpen == '1') {
Utils.goShareBuyRechargeToWeChat(context, widget.idstr,marketingCenterProvider!.rechargeDetail!);
Utils.goShareBuyRechargeToWeChat(context, widget.idstr,
marketingCenterProvider!.rechargeDetail!);
}
},
),
... ... @@ -245,8 +245,8 @@ class _RechargeDetailPageState extends State<RechargeDetailPage> {
crossAxisAlignment: CrossAxisAlignment.start,
// mainAxisAlignment: MainAxisAlignment.start,
children: [
if (marketingCenterProvider!
.rechargeDetail!.rechargeList!.isPrice ==
if (marketingCenterProvider!.rechargeDetail!
.rechargeList!.isPrice ==
'1')
Row(
mainAxisAlignment:
... ... @@ -268,12 +268,12 @@ class _RechargeDetailPageState extends State<RechargeDetailPage> {
HEmptyView(32)
],
),
if (marketingCenterProvider!
.rechargeDetail!.rechargeList!.isPrice ==
if (marketingCenterProvider!.rechargeDetail!
.rechargeList!.isPrice ==
'1')
VEmptyView(26),
if (marketingCenterProvider!
.rechargeDetail!.rechargeList!.isScore ==
if (marketingCenterProvider!.rechargeDetail!
.rechargeList!.isScore ==
'1')
Row(
mainAxisAlignment:
... ... @@ -295,8 +295,8 @@ class _RechargeDetailPageState extends State<RechargeDetailPage> {
HEmptyView(32)
],
),
if (marketingCenterProvider!
.rechargeDetail!.rechargeList!.isScore ==
if (marketingCenterProvider!.rechargeDetail!
.rechargeList!.isScore ==
'1')
VEmptyView(26),
if (marketingCenterProvider!.rechargeDetail!
... ... @@ -335,7 +335,9 @@ class _RechargeDetailPageState extends State<RechargeDetailPage> {
alignment: WrapAlignment.start,
runAlignment: WrapAlignment.start,
children: marketingCenterProvider!
.rechargeDetail!.rechargeList!.coupons!
.rechargeDetail!
.rechargeList!
.coupons!
.map((e) {
return InkWell(
onTap: () {
... ... @@ -399,8 +401,8 @@ class _RechargeDetailPageState extends State<RechargeDetailPage> {
child: Padding(
padding: EdgeInsets.only(right: w(16)),
child: Text(
marketingCenterProvider!
.rechargeDetail!.expDate!.weekDateShow!,
marketingCenterProvider!.rechargeDetail!
.expDate!.weekDateShow!,
maxLines: 10,
style: TextStyle(
color: MyColours.color_999999,
... ...
... ... @@ -31,9 +31,11 @@ import '../../app.dart';
import '../../constant/constant.dart';
import '../../models/get_seller_info_model.dart';
import '../../models/personnel_manage_model.dart';
import '../../models/seller_version_model.dart';
import '../../provider/collect_store_provider.dart';
import '../../provider/customer_provider.dart';
import '../../provider/personnel_provider.dart';
import '../../provider/store_base_info_provider.dart';
import '../../utils/dialog_util.dart';
import '../../utils/screen_util.dart';
... ... @@ -59,6 +61,7 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver {
DateTime? edate; //过期时间
late CollectStoreProvider collectStoreProvider;
bool isStoreWine = false;
@override
void initState() {
... ... @@ -97,6 +100,10 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver {
// _getMyIntegral(context);
// _getSellerById();
if (Provider.of<UserModel>(context,listen: false).user!.role_name_addition == '迎宾') {
_getAuthUserLists(showLoading: false);
}
getMyPageCountData();
///apk版本检测
... ... @@ -174,6 +181,33 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver {
// }
// }
//获取员工信息列表
_getAuthUserLists({bool showLoading = true}) async {
Map<String, String?> params = {
"sellerid": Provider.of<UserModel>(context, listen: false).user!.sellerid,
};
PersonnelProvider personnelProvider =
Provider.of<PersonnelProvider>(context, listen: false);
late PersonnelManageSunModel data;
await personnelProvider.getAuthUserLists(context, params,
showLoading: showLoading);
UserModel userModel = Provider.of<UserModel>(context, listen: false);
if (personnelProvider.dataMap != null) {
if (userModel.user!.role_name == '迎宾') {
personnelProvider.dataMap!.welcome!.listdata!.forEach((element) {
if (element!.id == userModel.user!.openid) {
//找到自己
data = element;
}
});
}
isStoreWine = data.isStoreWine == '1' ? true : false;
setState(() {});
}
}
getMyPageCountData() async {
Map<String, String?> params = {
'sellerid': Provider.of<UserModel>(context, listen: false).user!.sellerid,
... ... @@ -1262,7 +1296,8 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver {
return;
}
if (Utils.getAuthority(
context, '客户存酒')) {
context, '客户存酒') ||
isStoreWine) {
NavigatorUtil
.goStoreWineManageHomePage(
context);
... ... @@ -1270,14 +1305,16 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver {
},
child: _item(
outDay == '0' ||
!Utils.getAuthority(
context, '客户存酒')
!(Utils.getAuthority(
context, '客户存酒') ||
isStoreWine)
? Utils.getImgPath('khcj_un')
: Utils.getImgPath('khcj'),
'客户存酒',
isRowLow: outDay == '0' ||
!Utils.getAuthority(
context, '客户存酒'))),
!(Utils.getAuthority(
context, '客户存酒') ||
isStoreWine))),
InkWell(
onTap: () {}, child: _item('', '空空空空')),
InkWell(
... ... @@ -1627,8 +1664,7 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver {
outDay == '0' ||
!Utils.getAuthority(
context, '收银管理')
? Utils.getImgPath(
'finance_un')
? Utils.getImgPath('finance_un')
: Utils.getImgPath('finance'),
'收银管理',
isRowLow: outDay == '0' ||
... ...
import 'dart:convert';
import 'package:dio/dio.dart';
... ... @@ -97,7 +96,7 @@ class _PlanDishEidtPageState extends State<PlanDishEidtPage> {
}
if (widget.sunListPlan != null) {
if (widget.isEdit) {
_dishNameEditControl.text = widget.sunListPlan!.pname??"";
_dishNameEditControl.text = widget.sunListPlan!.pname ?? "";
} else {}
if (widget.sunListPlan!.type == '1') {
... ... @@ -107,11 +106,11 @@ class _PlanDishEidtPageState extends State<PlanDishEidtPage> {
}
labelSelIndex = labelList.indexOf(labelShow);
swichState = widget.sunListPlan!.status == '1' ? true : false;
pNumC.text = widget.sunListPlan!.pnum??"";
pNum = int.parse(widget.sunListPlan!.pnum??"0");
pNumC.text = widget.sunListPlan!.pnum ?? "";
pNum = int.parse(widget.sunListPlan!.pnum ?? "0");
priceSum = widget.sunListPlan!.menuPrice;
memberPriceSum = widget.sunListPlan!.memberPrice;
dishPriceC.text = widget.sunListPlan!.planPrice??"";
dishPriceC.text = widget.sunListPlan!.planPrice ?? "";
menuModel = widget.sunListPlan!.cookList;
String dish = '';
menuModel!.forEach((element) {
... ... @@ -414,12 +413,19 @@ class _PlanDishEidtPageState extends State<PlanDishEidtPage> {
),
),
Spacer(),
Image.asset(
swich
? Utils.getImgPath('swich_on')
: Utils.getImgPath('swich_off'),
width: ScreenUtil().setWidth(44 * 2),
)
widget.onlyShow
? Text(
swich ? '是' : '否',
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(32)),
)
: Image.asset(
swich
? Utils.getImgPath('swich_on')
: Utils.getImgPath('swich_off'),
width: ScreenUtil().setWidth(44 * 2),
)
],
),
),
... ... @@ -819,13 +825,13 @@ class _PlanDishEidtPageState extends State<PlanDishEidtPage> {
temp =
await NavigatorUtil.goPlanNewDishPage(
context,
) ;
);
} else {
temp =
await NavigatorUtil.goPlanNewDishPage(
context,
object: {'object': menuModel},
planDishPrice: dishPriceC.text) ;
planDishPrice: dishPriceC.text);
}
if (temp != null) {
... ...