|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter_easyrefresh/easy_refresh.dart';
|
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
|
import 'package:one_key/models/out_wine_record_model.dart';
|
|
|
|
import 'package:one_key/models/wine_manage_model.dart';
|
|
|
|
import 'package:one_key/pages/my/store_wine_manage/wine_in_store_item.dart';
|
|
|
|
import 'package:one_key/pages/my/store_wine_manage/wine_out_store_item.dart';
|
|
|
|
import 'package:one_key/widgets/system_app_bar.dart';
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
|
|
|
import '../../../constant/state.dart';
|
|
|
|
import '../../../models/personnel_manage_model.dart';
|
|
|
|
import '../../../provider/personnel_provider.dart';
|
|
|
|
import '../../../provider/store_wine_provider.dart';
|
|
|
|
import '../../../provider/user_model.dart';
|
|
|
|
import '../../../res/colors.dart';
|
|
|
|
import '../../../route/navigator_util.dart';
|
|
|
|
import '../../../utils/event_bus.dart';
|
|
|
|
import '../../../utils/utils.dart';
|
|
|
|
import '../../../widgets/custom_tab_indicator.dart';
|
|
|
|
import '../../../widgets/page_exception.dart';
|
|
|
|
import '../../../widgets/round_button.dart';
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* 存酒首页
|
|
|
|
*/
|
|
|
|
|
|
|
|
class StoreWineManageHomePage extends StatefulWidget {
|
|
|
|
StoreWineManageHomePage({Key key}) : super(key: key);
|
|
|
|
|
|
|
|
@override
|
|
|
|
_StoreWineManageHomePageState createState() =>
|
|
|
|
_StoreWineManageHomePageState();
|
|
|
|
}
|
|
|
|
|
|
|
|
class _StoreWineManageHomePageState extends State<StoreWineManageHomePage>
|
|
|
|
with TickerProviderStateMixin {
|
|
|
|
StoreWineProvider storeWineProvider;
|
|
|
|
|
|
|
|
TextEditingController searchC = TextEditingController(); //搜索框控制器
|
|
|
|
List _tabBarTitle;
|
|
|
|
TabController tabController;
|
|
|
|
int index = 0;
|
|
|
|
ScrollController listInStoreC = ScrollController();
|
|
|
|
|
|
|
|
bool isStoreWine = false;
|
|
|
|
EasyRefreshController _controller;
|
|
|
|
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
_tabBarTitle = ['全部在店', '取酒记录'];
|
|
|
|
_controller = EasyRefreshController();
|
|
|
|
|
|
|
|
super.initState();
|
|
|
|
tabController = TabController(length: 2, vsync: this);
|
|
|
|
tabController.index = 0;
|
|
|
|
|
|
|
|
tabController.addListener(() async {
|
|
|
|
if (tabController.index == tabController.animation.value) {
|
|
|
|
if (index == tabController.index) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
print(tabController.index);
|
|
|
|
index = tabController.index;
|
|
|
|
|
|
|
|
if (index == 0) {
|
|
|
|
await storeWineProvider.getStoreWineBySeller(context,
|
|
|
|
showLoading: false);
|
|
|
|
} else if (index == 1) {
|
|
|
|
await storeWineProvider.getStoreWineCheckList(context,
|
|
|
|
showLoading: false);
|
|
|
|
}
|
|
|
|
|
|
|
|
// _getContantData(first: true);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
|
|
|
index = tabController.index;
|
|
|
|
|
|
|
|
// _getContantData(first: first);
|
|
|
|
await _getAuthUserLists(showLoading: true);
|
|
|
|
|
|
|
|
await storeWineProvider.getStoreWineBySeller(context, showLoading: true);
|
|
|
|
|
|
|
|
await storeWineProvider.getStoreWineCheckList(context, showLoading: true);
|
|
|
|
});
|
|
|
|
bus.on("refresh_wine_home_all_list", (arg) async {
|
|
|
|
await storeWineProvider.getStoreWineBySeller(context, showLoading: true);
|
|
|
|
});
|
|
|
|
bus.on("refresh_wine_home_list", (arg) async {
|
|
|
|
print(arg['index']);
|
|
|
|
tabController.index = arg['index'];
|
|
|
|
index = arg['index'];
|
|
|
|
await storeWineProvider.getStoreWineBySeller(context, showLoading: true);
|
|
|
|
await storeWineProvider.getStoreWineCheckList(context, showLoading: true);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
void dispose() {
|
|
|
|
super.dispose();
|
|
|
|
bus.off('refresh_wine_home_all_list');
|
|
|
|
bus.off('refresh_wine_home_list');
|
|
|
|
}
|
|
|
|
|
|
|
|
//获取员工信息列表
|
|
|
|
_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);
|
|
|
|
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.admin.listdata.forEach((element) {
|
|
|
|
if (element.id == userModel.user.openid) {
|
|
|
|
//找到自己
|
|
|
|
data = element;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
} else if (userModel.user.role_name == '店长') {
|
|
|
|
personnelProvider.dataMap.shopowner.listdata.forEach((element) {
|
|
|
|
if (element.id == userModel.user.openid) {
|
|
|
|
//找到自己
|
|
|
|
data = element;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
} else if (userModel.user.role_name == '客户经理') {
|
|
|
|
personnelProvider.dataMap.manager.listdata.forEach((element) {
|
|
|
|
if (element.id == userModel.user.openid) {
|
|
|
|
//找到自己
|
|
|
|
data = element;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
} else if (userModel.user.role_name == '收银员') {
|
|
|
|
personnelProvider.dataMap.cashier.listdata.forEach((element) {
|
|
|
|
if (element.id == userModel.user.openid) {
|
|
|
|
//找到自己
|
|
|
|
data = element;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
} else if (userModel.user.role_name == '服务员') {
|
|
|
|
personnelProvider.dataMap.waiter.listdata.forEach((element) {
|
|
|
|
if (element.id == userModel.user.openid) {
|
|
|
|
//找到自己
|
|
|
|
data = element;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
isStoreWine = data.isStoreWine == '1' ? true : false;
|
|
|
|
setState(() {});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/// 搜索框
|
|
|
|
Widget _searchWidget() {
|
|
|
|
return Container(
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal: ScreenUtil().setWidth(40),
|
|
|
|
),
|
|
|
|
height: ScreenUtil().setWidth(45 * 2),
|
|
|
|
// alignment: Alignment.center,
|
|
|
|
|
|
|
|
child: Container(
|
|
|
|
alignment: Alignment.center,
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
left: ScreenUtil().setWidth(20 * 2),
|
|
|
|
),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
borderRadius:
|
|
|
|
BorderRadius.circular(ScreenUtil().setWidth(24 * 2)),
|
|
|
|
border: Border.all(color: Color.fromRGBO(228, 228, 228, 1)),
|
|
|
|
boxShadow: [
|
|
|
|
BoxShadow(
|
|
|
|
color: Color.fromRGBO(220, 220, 220, 1), //投影颜色
|
|
|
|
offset: Offset(2, 3), //x,y轴
|
|
|
|
blurRadius: ScreenUtil().setWidth(6) //投影距离
|
|
|
|
)
|
|
|
|
]),
|
|
|
|
child: Row(children: [
|
|
|
|
Expanded(
|
|
|
|
child: TextField(
|
|
|
|
maxLines: 1,
|
|
|
|
controller: searchC,
|
|
|
|
// focusNode: _focusNode,
|
|
|
|
// autofocus: true,
|
|
|
|
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_333333,
|
|
|
|
fontSize: ScreenUtil().setSp(26)),
|
|
|
|
// textAlignVertical: TextAlignVertical.center,
|
|
|
|
decoration: InputDecoration(
|
|
|
|
hintText: "输入手机号或姓名",
|
|
|
|
hintStyle: TextStyle(
|
|
|
|
color: MyColours.color_999999,
|
|
|
|
fontSize: ScreenUtil().setSp(26),
|
|
|
|
),
|
|
|
|
// isCollapsed:
|
|
|
|
// true, //重点,相当于高度包裹的意思,必须设置为true,不然有默认奇妙的最小高度
|
|
|
|
border: OutlineInputBorder(borderSide: BorderSide.none),
|
|
|
|
contentPadding: EdgeInsets.zero,
|
|
|
|
// 左边图标设置
|
|
|
|
icon: Image.asset(
|
|
|
|
Utils.getImgPath('search'),
|
|
|
|
width: ScreenUtil().setWidth(30),
|
|
|
|
),
|
|
|
|
//右边图标设置
|
|
|
|
// suffixIcon:
|
|
|
|
),
|
|
|
|
keyboardType: TextInputType.text,
|
|
|
|
textInputAction: TextInputAction.done,
|
|
|
|
|
|
|
|
onChanged: (value) {
|
|
|
|
// _getContantData(showLoading: false);
|
|
|
|
},
|
|
|
|
onEditingComplete: () {
|
|
|
|
FocusScope.of(context)
|
|
|
|
.requestFocus(FocusNode()); //点击空白处隐藏键盘
|
|
|
|
// _getContantData(showLoading: false);
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Offstage(
|
|
|
|
offstage: searchC.text == '',
|
|
|
|
child: GestureDetector(
|
|
|
|
child: Container(
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal: ScreenUtil().setWidth(40),
|
|
|
|
vertical: ScreenUtil().setWidth(20),
|
|
|
|
),
|
|
|
|
// color: Colors.orange,
|
|
|
|
alignment: Alignment.centerRight,
|
|
|
|
child: Image.asset(
|
|
|
|
Utils.getImgPath('clear'),
|
|
|
|
width: ScreenUtil().setWidth(30),
|
|
|
|
height: ScreenUtil().setWidth(30),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
onTap: () {
|
|
|
|
WidgetsBinding.instance.addPostFrameCallback(((_) {
|
|
|
|
searchC.clear();
|
|
|
|
FocusScope.of(context)
|
|
|
|
.requestFocus(FocusNode()); //点击空白处隐藏键盘
|
|
|
|
// _getContantData(showLoading: false);
|
|
|
|
}));
|
|
|
|
},
|
|
|
|
)),
|
|
|
|
// Offstage(
|
|
|
|
// offstage: false,
|
|
|
|
// child: GestureDetector(
|
|
|
|
// child: Container(
|
|
|
|
// padding: EdgeInsets.only(
|
|
|
|
// right: ScreenUtil().setWidth(30),
|
|
|
|
// bottom: ScreenUtil().setWidth(20),
|
|
|
|
// top: ScreenUtil().setWidth(20),
|
|
|
|
// ),
|
|
|
|
// child: Text(
|
|
|
|
// '搜索',
|
|
|
|
// style: TextStyle(
|
|
|
|
// color: MyColours.color_199095,
|
|
|
|
// fontSize: ScreenUtil().setSp(28)),
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
// onTap: () {
|
|
|
|
// customerProvider.searchData(
|
|
|
|
// customerProvider.controller.text);
|
|
|
|
// },
|
|
|
|
// ))
|
|
|
|
])));
|
|
|
|
}
|
|
|
|
|
|
|
|
Widget _menuWidget() {
|
|
|
|
return Container(
|
|
|
|
margin: EdgeInsets.symmetric(
|
|
|
|
horizontal: ScreenUtil().setWidth(40),
|
|
|
|
vertical: ScreenUtil().setWidth(20)),
|
|
|
|
decoration: BoxDecoration(color: MyColours.color_ffffff, boxShadow: [
|
|
|
|
BoxShadow(
|
|
|
|
// color: Colors.red,
|
|
|
|
color: Color.fromRGBO(220, 220, 220, 1), //投影颜色
|
|
|
|
offset: Offset(2, 2), //x,y轴
|
|
|
|
blurRadius: ScreenUtil().setWidth(6) //投影距离
|
|
|
|
)
|
|
|
|
]),
|
|
|
|
child: Row(
|
|
|
|
children: [
|
|
|
|
Expanded(
|
|
|
|
child: Container(
|
|
|
|
padding: EdgeInsets.only(bottom: ScreenUtil().setWidth(10)),
|
|
|
|
margin:
|
|
|
|
EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(30)),
|
|
|
|
child: TabBar(
|
|
|
|
controller: tabController,
|
|
|
|
// isScrollable: true,
|
|
|
|
indicator: CustomTabIndicator(
|
|
|
|
radius: 0,
|
|
|
|
),
|
|
|
|
indicatorColor: MyColours.color_199095,
|
|
|
|
indicatorSize: TabBarIndicatorSize.tab,
|
|
|
|
// indicatorPadding: EdgeInsets.symmetric(
|
|
|
|
// horizontal: ScreenUtil().setWidth(12)),
|
|
|
|
labelColor: MyColours.color_199095,
|
|
|
|
labelStyle: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(32),
|
|
|
|
fontWeight: FontWeight.bold),
|
|
|
|
labelPadding: EdgeInsets.zero,
|
|
|
|
unselectedLabelStyle: TextStyle(
|
|
|
|
fontWeight: FontWeight.normal,
|
|
|
|
fontSize: ScreenUtil().setSp(28),
|
|
|
|
),
|
|
|
|
unselectedLabelColor: MyColours.color_999999,
|
|
|
|
tabs: _tabBarTitle.map((value) {
|
|
|
|
return Tab(
|
|
|
|
child: Text(value),
|
|
|
|
);
|
|
|
|
}).toList()),
|
|
|
|
)),
|
|
|
|
],
|
|
|
|
));
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
storeWineProvider = Provider.of<StoreWineProvider>(context, listen: true);
|
|
|
|
return Scaffold(
|
|
|
|
appBar: SystemAppBar(
|
|
|
|
'存酒管理',
|
|
|
|
onTap: () {
|
|
|
|
EventBus().emit('changeStatusColor');
|
|
|
|
Navigator.pop(context);
|
|
|
|
},
|
|
|
|
),
|
|
|
|
body: WillPopScope(
|
|
|
|
onWillPop: () async {
|
|
|
|
EventBus().emit('changeStatusColor');
|
|
|
|
return true;
|
|
|
|
},
|
|
|
|
child: SafeArea(
|
|
|
|
child: Column(children: [
|
|
|
|
_searchWidget(), _menuWidget(),
|
|
|
|
Expanded(
|
|
|
|
child: TabBarView(controller: tabController,
|
|
|
|
// physics: NeverScrollableScrollPhysics(),
|
|
|
|
children: [
|
|
|
|
Container(child:
|
|
|
|
Consumer<StoreWineProvider>(builder: (context, model, _) {
|
|
|
|
if (model.pageStateAll != PageState.Success) {
|
|
|
|
return ExceptionPage(
|
|
|
|
pageState: model.pageStateAll,
|
|
|
|
callback: () {
|
|
|
|
// offset = 0;
|
|
|
|
// getMessage(showLoading: true);
|
|
|
|
|
|
|
|
// if (pageState == PageState.Empty) {
|
|
|
|
// NavigatorUtil.goCouponHistoryPage(context);
|
|
|
|
// } else {
|
|
|
|
// _couponNetworkData(widget.index);
|
|
|
|
// }
|
|
|
|
},
|
|
|
|
emptyMsg: "暂时没有存酒信息哦",
|
|
|
|
emptyImg: "empty_search",
|
|
|
|
showMsg: "加载中,请稍后...",
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
return EasyRefresh.custom(
|
|
|
|
controller: _controller,
|
|
|
|
slivers: [
|
|
|
|
SliverList(
|
|
|
|
delegate: SliverChildBuilderDelegate(
|
|
|
|
(BuildContext context, int index) {
|
|
|
|
WineManageModel wineManageModel =
|
|
|
|
storeWineProvider.wineManageList[index];
|
|
|
|
return WineInStoreItem(
|
|
|
|
controller: listInStoreC,
|
|
|
|
wineManageModel: wineManageModel,
|
|
|
|
isStoreWine: isStoreWine);
|
|
|
|
},
|
|
|
|
childCount:
|
|
|
|
storeWineProvider.wineManageList.length),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
onRefresh: () async {
|
|
|
|
await storeWineProvider.getStoreWineBySeller(context,
|
|
|
|
showLoading: false);
|
|
|
|
// offset = 0;
|
|
|
|
// getMessage(typeid, showLoading: false);
|
|
|
|
},
|
|
|
|
onLoad: () async {
|
|
|
|
_controller.finishLoad();
|
|
|
|
_controller.finishLoadCallBack();
|
|
|
|
// offset++;
|
|
|
|
// getMessage(typeid, showLoading: false);
|
|
|
|
},
|
|
|
|
);
|
|
|
|
|
|
|
|
// return ListView.builder(
|
|
|
|
// itemCount: storeWineProvider.wineManageList.length,
|
|
|
|
// controller: listInStoreC,
|
|
|
|
// itemBuilder: (context, index) {
|
|
|
|
// WineManageModel wineManageModel =
|
|
|
|
// storeWineProvider.wineManageList[index];
|
|
|
|
// return WineInStoreItem(
|
|
|
|
// controller: listInStoreC,
|
|
|
|
// wineManageModel: wineManageModel,
|
|
|
|
// isStoreWine: isStoreWine);
|
|
|
|
// });
|
|
|
|
}
|
|
|
|
})),
|
|
|
|
Container(child:
|
|
|
|
Consumer<StoreWineProvider>(builder: (context, model, _) {
|
|
|
|
if (model.pageStateRecordHome != PageState.Success) {
|
|
|
|
return ExceptionPage(
|
|
|
|
pageState: model.pageStateRecordHome,
|
|
|
|
callback: () async {
|
|
|
|
await storeWineProvider.getStoreWineCheckList(context,
|
|
|
|
showLoading: true);
|
|
|
|
// offset = 0;
|
|
|
|
// getMessage(showLoading: true);
|
|
|
|
|
|
|
|
// if (pageState == PageState.Empty) {
|
|
|
|
// NavigatorUtil.goCouponHistoryPage(context);
|
|
|
|
// } else {
|
|
|
|
// _couponNetworkData(widget.index);
|
|
|
|
// }
|
|
|
|
},
|
|
|
|
emptyMsg: "暂时没有取酒记录哦",
|
|
|
|
emptyImg: "empty_search",
|
|
|
|
showMsg: "加载中,请稍后...",
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
return EasyRefresh.custom(
|
|
|
|
controller: _controller,
|
|
|
|
slivers: [
|
|
|
|
SliverList(
|
|
|
|
delegate: SliverChildBuilderDelegate(
|
|
|
|
(BuildContext context, int index) {
|
|
|
|
OutWineRecordSunModel outWineRecordSunModel =
|
|
|
|
model.outWineRecordHomeData[index];
|
|
|
|
return WineOutStoreItem(
|
|
|
|
controller: listInStoreC,
|
|
|
|
outWineRecordSunModel: outWineRecordSunModel,
|
|
|
|
);
|
|
|
|
},
|
|
|
|
childCount: storeWineProvider
|
|
|
|
.outWineRecordHomeData.length),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
onRefresh: () async {
|
|
|
|
await storeWineProvider.getStoreWineCheckList(context,
|
|
|
|
showLoading: false);
|
|
|
|
// offset = 0;
|
|
|
|
// getMessage(typeid, showLoading: false);
|
|
|
|
},
|
|
|
|
onLoad: () async {
|
|
|
|
_controller.finishLoad();
|
|
|
|
_controller.finishLoadCallBack();
|
|
|
|
// offset++;
|
|
|
|
// getMessage(typeid, showLoading: false);
|
|
|
|
},
|
|
|
|
);
|
|
|
|
// return ListView.builder(
|
|
|
|
// itemCount: model.outWineRecordHomeData.length,
|
|
|
|
// controller: listInStoreC,
|
|
|
|
// itemBuilder: (context, index) {
|
|
|
|
// OutWineRecordSunModel outWineRecordSunModel =
|
|
|
|
// model.outWineRecordHomeData[index];
|
|
|
|
// return WineOutStoreItem(
|
|
|
|
// controller: listInStoreC,
|
|
|
|
// outWineRecordSunModel: outWineRecordSunModel,
|
|
|
|
// );
|
|
|
|
// });
|
|
|
|
}
|
|
|
|
}))
|
|
|
|
])),
|
|
|
|
|
|
|
|
Container(
|
|
|
|
height: ScreenUtil().setWidth(91 * 2),
|
|
|
|
width: double.infinity,
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
top: ScreenUtil().setWidth(12 * 2),
|
|
|
|
bottom: ScreenUtil().setWidth(25 * 2),
|
|
|
|
left: ScreenUtil().setWidth(45 * 2),
|
|
|
|
right: ScreenUtil().setWidth(45 * 2),
|
|
|
|
),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
boxShadow: [
|
|
|
|
BoxShadow(
|
|
|
|
spreadRadius: ScreenUtil().setWidth(2),
|
|
|
|
color: Color.fromRGBO(0, 0, 0, 0.1),
|
|
|
|
offset: Offset(0, ScreenUtil().setWidth(-2)),
|
|
|
|
blurRadius: ScreenUtil().setWidth(8))
|
|
|
|
],
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
Radius.circular(ScreenUtil().setWidth(16)),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
child: RoundButton(
|
|
|
|
text: '新建存酒',
|
|
|
|
height: ScreenUtil().setWidth(80),
|
|
|
|
radius: ScreenUtil().setWidth(10),
|
|
|
|
isBold: true,
|
|
|
|
fontSize: 32,
|
|
|
|
textColor: MyColours.color_F8F9FD,
|
|
|
|
gradientStart: !isStoreWine
|
|
|
|
? MyColours.color_BFC4D4
|
|
|
|
: MyColours.color_438E93,
|
|
|
|
gradientEnd: !isStoreWine
|
|
|
|
? MyColours.color_BFC4D4
|
|
|
|
: MyColours.color_438E93,
|
|
|
|
onPressed: () async {
|
|
|
|
if (!isStoreWine) {
|
|
|
|
Utils.showToast('您不是店铺的存酒管理员,无权进行相关操作。');
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
// UserModel userModel =
|
|
|
|
// Provider.of<UserModel>(context, listen: false);
|
|
|
|
// if (userModel.user.role_name == '管理员' ||
|
|
|
|
// userModel.user.role_name == '店长') {
|
|
|
|
NavigatorUtil.goCreateStoreWinePage(context);
|
|
|
|
// } else {
|
|
|
|
// bool needRefresh =
|
|
|
|
// await NavigatorUtil.goCouponEditPage(context);
|
|
|
|
// print(needRefresh);
|
|
|
|
// if (needRefresh != null && needRefresh) {
|
|
|
|
// bus.emit('refresh_coupon_list_f');
|
|
|
|
// //刷新页面数据
|
|
|
|
// // _controller.callRefresh();
|
|
|
|
// // _couponNetworkData(tabController.index);
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
},
|
|
|
|
),
|
|
|
|
)
|
|
|
|
|
|
|
|
// _searchWidget(),
|
|
|
|
// Positioned(
|
|
|
|
// top: 0,
|
|
|
|
// left: ScreenUtil().setWidth(40),
|
|
|
|
// right: ScreenUtil().setWidth(40),
|
|
|
|
// child: _filterWidget())
|
|
|
|
// ],
|
|
|
|
])),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|