Commit 55eda9480326e547b27286c0a1c4cf7b607804fa

Authored by gaiyaguang
1 parent 591b9691

拒绝订单置满

... ... @@ -11,14 +11,14 @@ if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
def flutterVersionCode = "135"
def flutterVersionCode = "141"
if (flutterVersionCode == null) {
flutterVersionCode = '135'
flutterVersionCode = '141'
}
def flutterVersionName = "1.3.5"
def flutterVersionName = "1.4.1"
if (flutterVersionName == null) {
flutterVersionName = '1.3.5'
flutterVersionName = '1.4.1'
}
apply plugin: 'com.android.application'
... ...
... ... @@ -406,7 +406,7 @@
CODE_SIGN_ENTITLEMENTS = Runner/RunnerProfile.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 134;
CURRENT_PROJECT_VERSION = 136;
DEVELOPMENT_TEAM = 8J59HM8B82;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
... ... @@ -419,7 +419,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
MARKETING_VERSION = 1.3.4;
MARKETING_VERSION = 1.3.6;
PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine;
PRODUCT_NAME = "一键订";
PROVISIONING_PROFILE_SPECIFIER = "";
... ... @@ -548,7 +548,7 @@
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 134;
CURRENT_PROJECT_VERSION = 136;
DEVELOPMENT_TEAM = 8J59HM8B82;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
... ... @@ -561,7 +561,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
MARKETING_VERSION = 1.3.4;
MARKETING_VERSION = 1.3.6;
PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine;
PRODUCT_NAME = "一键订";
PROVISIONING_PROFILE_SPECIFIER = "";
... ... @@ -581,7 +581,7 @@
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 134;
CURRENT_PROJECT_VERSION = 136;
DEVELOPMENT_TEAM = 8J59HM8B82;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
... ... @@ -594,7 +594,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
MARKETING_VERSION = 1.3.4;
MARKETING_VERSION = 1.3.6;
PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine;
PRODUCT_NAME = "一键订";
PROVISIONING_PROFILE_SPECIFIER = "";
... ...
... ... @@ -104,6 +104,14 @@ class NotebookDetail {
}
}
String get demandStr{
String demand="";
for(t.Table table in demands){
demand+=table.name+",";
}
return demand.substring(0,demand.length-1);
}
String get ddateMd {
DateTime dateTime =
DateTime.fromMillisecondsSinceEpoch(int.parse(ddate) * 1000);
... ...
... ... @@ -14,6 +14,7 @@ import 'package:one_key/utils/utils.dart';
import 'package:one_key/widgets/MyDivider.dart';
import 'package:one_key/widgets/app_bar.dart';
import 'package:one_key/widgets/common_button.dart';
import 'package:one_key/widgets/h_empty_view.dart';
import 'package:one_key/widgets/need_item.dart';
import 'package:one_key/widgets/page_exception.dart';
import 'package:one_key/widgets/row_multi_text.dart';
... ... @@ -54,6 +55,10 @@ class HandleOnlinePageState extends State<HandleOnlinePage> {
String formatPhone = ""; //格式客户号码
bool isRefused=false;//是否已拒绝
bool isPause=false;//是否暂停预订
StateSetter refuseDialogState;//决绝弹框setState
@override
void initState() {
// TODO: implement initState
... ... @@ -86,7 +91,7 @@ class HandleOnlinePageState extends State<HandleOnlinePage> {
}
}
});
if (detailEntity.status != "0") {
if (detailEntity.status != "0"&&!isPause) {
//已处理
Future.delayed(Duration(milliseconds: 200), () {
NavigatorUtil.goNotebookDetailPage(context, detailEntity.id,
... ... @@ -112,54 +117,162 @@ class HandleOnlinePageState extends State<HandleOnlinePage> {
}
//拒绝订单弹框
_showRefuseDialog() {
showDialog(
_showRefuseDialog2() {
Widget dialogContent=StatefulBuilder(
builder: (context,setState){
refuseDialogState=setState;
Container container=Container(
child: Stack(
alignment: AlignmentDirectional.topCenter,
children: [
Positioned(
right: 0,
top: ScreenUtil().setWidth(6),
child: GestureDetector(
child: Container(
padding: EdgeInsets.all(ScreenUtil().setWidth(21)),
child: Image.asset("assets/close.png",width: ScreenUtil().setWidth(28),height: ScreenUtil().setWidth(28),),
),
onTap: (){
Navigator.of(context).pop();
},
),
),
Offstage(
offstage: isRefused,
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
VEmptyView(40),
Text("拒绝订单",style: TextStyle(fontSize: ScreenUtil().setSp(32),color: MyColours.color_353535,fontWeight: FontWeight.bold),),
VEmptyView(60),
Text("确定要拒绝订单吗?一旦拒绝无法恢复。",style: TextStyle(fontSize: ScreenUtil().setSp(32),color: MyColours.color_353535),),
VEmptyView(80),
GestureDetector(
onTap: (){
setReserveStatus("6",ac: "1");
},
child: Container(
width: ScreenUtil().setWidth(336),
height: ScreenUtil().setWidth(80),
alignment: Alignment.center,
color: MyColours.color_199095,
child: Text("拒绝并暂停预订",style: TextStyle(fontSize: ScreenUtil().setSp(34),color: MyColours.color_ffffff),),
),
),
VEmptyView(20),
GestureDetector(
onTap: (){
Navigator.of(context).pop();
setReserveStatus("6");
},
child: Container(
width: ScreenUtil().setWidth(336),
height: ScreenUtil().setWidth(80),
alignment: Alignment.center,
decoration: BoxDecoration(
color: MyColours.color_ffffff,
border: Border.all(color: MyColours.color_199095,width: ScreenUtil().setWidth(2))
),
child: Text("直接拒绝",style: TextStyle(fontSize: ScreenUtil().setSp(34),color: MyColours.color_199095),),
),
),
VEmptyView(20),
GestureDetector(
onTap: () async {
Navigator.of(context).pop();
Map temp = await NavigatorUtil.goSelectTablePage(
context,
widget.rid,
int.parse(detailEntity.ddate) * 1000,
detailEntity.ddate_solt);
if (temp != null && temp['tid'] != null) {
setReserveStatus("5", tid: temp['tid']);
}
},
child: Container(
width: ScreenUtil().setWidth(336),
height: ScreenUtil().setWidth(80),
alignment: Alignment.center,
color: MyColours.color_ffffff,
child: Text("去安排包间",style: TextStyle(fontSize: ScreenUtil().setSp(34),color: MyColours.color_199095),),
),
),
VEmptyView(44),
],
),
),
Offstage(
offstage: !isRefused,
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
VEmptyView(98),
Row(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Image.asset("assets/icon_refuse_book.png",width: ScreenUtil().setWidth(56),height: ScreenUtil().setWidth(56),),
HEmptyView(10),
Text("订单已拒绝",style: TextStyle(fontSize: ScreenUtil().setSp(34),color: MyColours.color_353535),)
],
),
Offstage(
offstage: !isPause,
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
VEmptyView(20),
Text("并已将${detailEntity.ddateMd}的${detailEntity.demandStr}置满",style: TextStyle(fontSize: ScreenUtil().setSp(34),color: MyColours.color_353535),),
],
),
),
VEmptyView(120),
Text("如果有包间空出来或其他包间也满了,你可以:",style: TextStyle(fontSize: ScreenUtil().setSp(26),color: MyColours.color_353535),),
VEmptyView(20),
GestureDetector(
onTap: (){
Utils.goMiniProgramZm(context);
},
child: Container(
width: ScreenUtil().setWidth(336),
height: ScreenUtil().setWidth(80),
alignment: Alignment.center,
color: MyColours.color_199095,
child: Text("去管理包间",style: TextStyle(fontSize: ScreenUtil().setSp(34),color: MyColours.color_ffffff),),
),
),
VEmptyView(60)
],
),
)
],
),
);
return container;
},
);
Widget dialog = Container(
width: double.infinity,
decoration: BoxDecoration(
color: MyColours.color_ffffff,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(ScreenUtil().setWidth(40)),
topRight: Radius.circular(ScreenUtil().setWidth(40)))),
child:dialogContent
);
showModalBottomSheet(
context: context,
backgroundColor: Colors.transparent,
builder: (context) {
return AlertDialog(
title: Text("确定拒绝订单吗?\n拒绝后无法联系客户"),
titleTextStyle: TextStyle(
color: MyColours.color_353535,
fontSize: ScreenUtil().setSp(32)),
content: Text("如果包间类型订满,请及时停用"),
contentTextStyle: TextStyle(
color: MyColours.color_828282,
fontSize: ScreenUtil().setSp(28)),
actions: <Widget>[
FlatButton(
child: Text(
"拒绝订单",
style: TextStyle(fontSize: ScreenUtil().setSp(32)),
),
onPressed: () {
Navigator.of(context).pop();
setReserveStatus("6");
},
),
FlatButton(
child: Text(
"去安排",
style: TextStyle(fontSize: ScreenUtil().setSp(32)),
),
onPressed: () async {
Navigator.of(context).pop();
Map temp = await NavigatorUtil.goSelectTablePage(
context,
widget.rid,
int.parse(detailEntity.ddate) * 1000,
detailEntity.ddate_solt);
if (temp != null && temp['tid'] != null) {
setReserveStatus("5", tid: temp['tid']);
}
},
)
],
);
});
return Stack(
children: <Widget>[dialog],
);
});
}
//处理在线预订
setReserveStatus(String status, {String tid = ""}) async {
setReserveStatus(String status, {String tid = "",String ac=""}) async {
bus.emit("remove_untreated_message", widget.mid);
UserModel userModel = Provider.of<UserModel>(context, listen: false);
Map<String, String> causeMap = {
... ... @@ -174,10 +287,21 @@ class HandleOnlinePageState extends State<HandleOnlinePage> {
"mid": widget.mid,
"cause": json.encode(causeMap)
};
if(status=="6"){
isPause=true;
params['ac']=ac;//0=直接拒绝 1=拒绝并暂停预订
}
bool success =
await detailModel.setReserveStatus(context, params, showLoading: true);
await detailModel.setReserveStatus(context, params, ifPush:(isPause?false:true),showLoading: true);
if (success != null && success) {
bus.emit("refresh_book_list");
if(status=="6"){
isRefused=true;
}
if(isPause){
_getOrderListData();
refuseDialogState((){});
}
}
}
... ... @@ -373,108 +497,111 @@ class HandleOnlinePageState extends State<HandleOnlinePage> {
)),
),
),
Container(
margin: EdgeInsets.only(
top: ScreenUtil().setHeight(30),
bottom: ScreenUtil().setHeight(30)),
child: Column(
children: <Widget>[
CommonButton(
content: "安排包间",
width: 669,
height: 84,
fontSize: 34,
onPress: () async {
Map map = await NavigatorUtil
.goSelectTablePage(
context,
widget.rid,
int.parse(detailEntity.ddate) *
1000,
detailEntity.ddate_solt);
if (map != null && map['tid'] != null) {
setReserveStatus("5",
tid: map['tid']);
}
},
),
VEmptyView(20),
Container(
width: ScreenUtil().setWidth(669),
height: ScreenUtil().setWidth(84),
decoration: BoxDecoration(
border: Border.all(
color: MyColours.color_199095),
borderRadius: BorderRadius.circular(
ScreenUtil().setWidth(10)),
Offstage(
offstage: detailEntity.status!="0",
child: Container(
margin: EdgeInsets.only(
top: ScreenUtil().setHeight(30),
bottom: ScreenUtil().setHeight(30)),
child: Column(
children: <Widget>[
CommonButton(
content: "安排包间",
width: 669,
height: 84,
fontSize: 34,
onPress: () async {
Map map = await NavigatorUtil
.goSelectTablePage(
context,
widget.rid,
int.parse(detailEntity.ddate) *
1000,
detailEntity.ddate_solt);
if (map != null && map['tid'] != null) {
setReserveStatus("5",
tid: map['tid']);
}
},
),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.center,
children: <Widget>[
Expanded(
child: GestureDetector(
child: Center(
child: Text(
"拒绝订单",
style: TextStyle(
color:
MyColours.color_199095,
fontSize:
ScreenUtil().setSp(34)),
),
),
onTap: () {
_showRefuseDialog();
},
)),
Offstage(
offstage: !isCallTel,
child: SizedBox(
width: ScreenUtil().setWidth(335),
height: ScreenUtil().setWidth(84),
child: Row(
children: [
MyDivider(
ScreenUtil().setWidth(2),
ScreenUtil().setHeight(52),
color:
MyColours.color_199095,
VEmptyView(20),
Container(
width: ScreenUtil().setWidth(669),
height: ScreenUtil().setWidth(84),
decoration: BoxDecoration(
border: Border.all(
color: MyColours.color_199095),
borderRadius: BorderRadius.circular(
ScreenUtil().setWidth(10)),
),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.center,
children: <Widget>[
Expanded(
child: GestureDetector(
child: Center(
child: Text(
"拒绝订单",
style: TextStyle(
color:
MyColours.color_199095,
fontSize:
ScreenUtil().setSp(34)),
),
),
Expanded(
child: GestureDetector(
child: Center(
child: Text(
"联系顾客",
style: TextStyle(
color: MyColours
.color_199095,
fontSize:
ScreenUtil()
.setSp(34)),
),
onTap: () {
_showRefuseDialog2();
},
)),
Offstage(
offstage: !isCallTel,
child: SizedBox(
width: ScreenUtil().setWidth(335),
height: ScreenUtil().setWidth(84),
child: Row(
children: [
MyDivider(
ScreenUtil().setWidth(2),
ScreenUtil().setHeight(52),
color:
MyColours.color_199095,
),
onTap: () {
if (detailEntity.phone !=
null &&
detailEntity.phone
.isNotEmpty) {
Utils.goPhone(
detailEntity.phone);
} else {
Utils.showToast(
"没有客户电话!");
}
},
)),
],
Expanded(
child: GestureDetector(
child: Center(
child: Text(
"联系顾客",
style: TextStyle(
color: MyColours
.color_199095,
fontSize:
ScreenUtil()
.setSp(34)),
),
),
onTap: () {
if (detailEntity.phone !=
null &&
detailEntity.phone
.isNotEmpty) {
Utils.goPhone(
detailEntity.phone);
} else {
Utils.showToast(
"没有客户电话!");
}
},
)),
],
),
),
),
)
],
),
)
],
)
],
),
)
],
),
),
)
],
... ...
... ... @@ -80,11 +80,11 @@ class Utils {
}
//跳转小程序包间类型置满管理
static goMiniProgramZm(BuildContext context) {
static goMiniProgramZm(BuildContext context){
UserModel model=Provider.of<UserModel>(context);
launchWeChatMiniProgram(
username: "gh_487873d353b3",
path: "pack-book/pages/book/b_index?seller_id=${model.user.sellerid}&seller_openid=oGefL4qKBWIh5xwyg3LVfkMbDumA&manager_id=''&goPath=roomtype/roomtype",
path: "pack-book/pages/book/b_index?seller_id=${model.user.sellerid}&seller_openid=seller_openid&manager_id=&goPath=roomtype/roomtype",
miniProgramType: WXMiniProgramType.RELEASE);
}
//跳转拨打电话页面
... ...