Commit b12d3c51b8dcf8c5cdbd91dfa1da4f7ac9f9bb6c

Authored by wdn
1 parent f2a3d4f7

取消预订

196f9f292c7f47fcf809595ac8fc6ce8
\ No newline at end of file
7babc7873f8d177769b987ba4c6c2911
\ No newline at end of file
... ...
PODS:
- audioplayers (0.0.1):
- Flutter
<<<<<<< HEAD
- Bugly (2.5.71)
=======
- connectivity (0.0.1):
- Flutter
- Reachability
- connectivity_for_web (0.1.0):
- Flutter
- connectivity_macos (0.0.1):
- Flutter
- contacts_service (0.2.2):
- Flutter
- device_info (0.0.1):
- Flutter
>>>>>>> 6d4505c5bf3110e572bc68cbdefa56aee05df137
- Flutter (1.0.0)
- flutter_bugly (0.0.1):
- Bugly
... ... @@ -40,12 +39,17 @@ PODS:
- Flutter
- path_provider (0.0.1):
- Flutter
- path_provider_linux (0.0.1):
- Flutter
- path_provider_macos (0.0.1):
- Flutter
- permission_handler (4.4.0):
- "permission_handler (4.4.0+hotfix.4)":
- Flutter
- Reachability (3.2)
- shared_preferences (0.0.1):
- Flutter
- shared_preferences_linux (0.0.1):
- Flutter
- shared_preferences_macos (0.0.1):
- Flutter
- shared_preferences_web (0.0.1):
... ... @@ -55,31 +59,23 @@ PODS:
- FMDB (~> 2.7.2)
- url_launcher (0.0.1):
- Flutter
- url_launcher_linux (0.0.1):
- Flutter
- url_launcher_macos (0.0.1):
- Flutter
- url_launcher_web (0.0.1):
- Flutter
<<<<<<< HEAD
- WechatOpenSDK (1.8.7.1)
DEPENDENCIES:
- audioplayers (from `.symlinks/plugins/audioplayers/ios`)
=======
<<<<<<< HEAD
- WechatOpenSDK (1.8.6.2)
=======
- webview_flutter (0.0.1):
- Flutter
- WechatOpenSDK (1.8.7.1)
>>>>>>> dev
DEPENDENCIES:
- audioplayers (from `.symlinks/plugins/audioplayers/ios`)
- connectivity (from `.symlinks/plugins/connectivity/ios`)
- connectivity_for_web (from `.symlinks/plugins/connectivity_for_web/ios`)
- connectivity_macos (from `.symlinks/plugins/connectivity_macos/ios`)
- contacts_service (from `.symlinks/plugins/contacts_service/ios`)
- device_info (from `.symlinks/plugins/device_info/ios`)
>>>>>>> 6d4505c5bf3110e572bc68cbdefa56aee05df137
- Flutter (from `Flutter`)
- flutter_bugly (from `.symlinks/plugins/flutter_bugly/ios`)
- flutter_statusbarcolor (from `.symlinks/plugins/flutter_statusbarcolor/ios`)
... ... @@ -89,13 +85,16 @@ DEPENDENCIES:
- jpush_flutter (from `.symlinks/plugins/jpush_flutter/ios`)
- package_info (from `.symlinks/plugins/package_info/ios`)
- path_provider (from `.symlinks/plugins/path_provider/ios`)
- path_provider_linux (from `.symlinks/plugins/path_provider_linux/ios`)
- path_provider_macos (from `.symlinks/plugins/path_provider_macos/ios`)
- permission_handler (from `.symlinks/plugins/permission_handler/ios`)
- shared_preferences (from `.symlinks/plugins/shared_preferences/ios`)
- shared_preferences_linux (from `.symlinks/plugins/shared_preferences_linux/ios`)
- shared_preferences_macos (from `.symlinks/plugins/shared_preferences_macos/ios`)
- shared_preferences_web (from `.symlinks/plugins/shared_preferences_web/ios`)
- sqflite (from `.symlinks/plugins/sqflite/ios`)
- url_launcher (from `.symlinks/plugins/url_launcher/ios`)
- url_launcher_linux (from `.symlinks/plugins/url_launcher_linux/ios`)
- url_launcher_macos (from `.symlinks/plugins/url_launcher_macos/ios`)
- url_launcher_web (from `.symlinks/plugins/url_launcher_web/ios`)
- webview_flutter (from `.symlinks/plugins/webview_flutter/ios`)
... ... @@ -106,22 +105,22 @@ SPEC REPOS:
- FMDB
- JCore
- JPush
- Reachability
- WechatOpenSDK
EXTERNAL SOURCES:
audioplayers:
:path: ".symlinks/plugins/audioplayers/ios"
<<<<<<< HEAD
=======
connectivity:
:path: ".symlinks/plugins/connectivity/ios"
connectivity_for_web:
:path: ".symlinks/plugins/connectivity_for_web/ios"
connectivity_macos:
:path: ".symlinks/plugins/connectivity_macos/ios"
contacts_service:
:path: ".symlinks/plugins/contacts_service/ios"
device_info:
:path: ".symlinks/plugins/device_info/ios"
>>>>>>> 6d4505c5bf3110e572bc68cbdefa56aee05df137
Flutter:
:path: Flutter
flutter_bugly:
... ... @@ -140,12 +139,16 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/package_info/ios"
path_provider:
:path: ".symlinks/plugins/path_provider/ios"
path_provider_linux:
:path: ".symlinks/plugins/path_provider_linux/ios"
path_provider_macos:
:path: ".symlinks/plugins/path_provider_macos/ios"
permission_handler:
:path: ".symlinks/plugins/permission_handler/ios"
shared_preferences:
:path: ".symlinks/plugins/shared_preferences/ios"
shared_preferences_linux:
:path: ".symlinks/plugins/shared_preferences_linux/ios"
shared_preferences_macos:
:path: ".symlinks/plugins/shared_preferences_macos/ios"
shared_preferences_web:
... ... @@ -154,6 +157,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/sqflite/ios"
url_launcher:
:path: ".symlinks/plugins/url_launcher/ios"
url_launcher_linux:
:path: ".symlinks/plugins/url_launcher_linux/ios"
url_launcher_macos:
:path: ".symlinks/plugins/url_launcher_macos/ios"
url_launcher_web:
... ... @@ -163,14 +168,12 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
audioplayers: 84f968cea3f2deab00ec4f8ff53358b3c0b3992c
<<<<<<< HEAD
Bugly: fd066c75c4a0eca1440f9b6a84bd37d51bfc85ac
=======
connectivity: 6e94255659cc86dcbef1d452ad3e0491bb1b3e75
connectivity: c4130b2985d4ef6fd26f9702e886bd5260681467
connectivity_for_web: 2b8584556930d4bd490d82b836bcf45067ce345b
connectivity_macos: e2e9731b6b22dda39eb1b128f6969d574460e191
contacts_service: 849e1f84281804c8bfbec1b4c3eedcb23c5d3eca
device_info: d7d233b645a32c40dfdc212de5cf646ca482f175
>>>>>>> 6d4505c5bf3110e572bc68cbdefa56aee05df137
Flutter: 0e3d915762c693b495b44d77113d4970485de6ec
flutter_bugly: c9800f4d5bc5bdc27ffdde3417a26ba44266e0c3
flutter_statusbarcolor: 8afb1071ed8c58be929f1e32b36c629771fd2259
... ... @@ -182,26 +185,22 @@ SPEC CHECKSUMS:
JPush: a401b946dcc76b37335422487201bc1ecc8dd296
jpush_flutter: 69133df35eaf9135e540549b154d992c44f8ee44
package_info: 873975fc26034f0b863a300ad47e7f1ac6c7ec62
path_provider: fb74bd0465e96b594bb3b5088ee4a4e7bb1f2a9d
path_provider: abfe2b5c733d04e238b0d8691db0cfd63a27a93c
path_provider_linux: 4d630dc393e1f20364f3e3b4a2ff41d9674a84e4
path_provider_macos: f760a3c5b04357c380e2fddb6f9db6f3015897e0
permission_handler: f615215121f43c1640d2b8500d4ad749512828a8
shared_preferences: 430726339841afefe5142b9c1f50cb6bd7793e01
permission_handler: 8278954f2382902f63f00dd8828769c0bd6d511b
Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96
shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d
shared_preferences_linux: afefbfe8d921e207f01ede8b60373d9e3b566b78
shared_preferences_macos: f3f29b71ccbb56bf40c9dd6396c9acf15e214087
shared_preferences_web: 141cce0c3ed1a1c5bf2a0e44f52d31eeb66e5ea9
sqflite: 4001a31ff81d210346b500c55b17f4d6c7589dd0
url_launcher: a1c0cc845906122c4784c542523d8cacbded5626
url_launcher: 6fef411d543ceb26efce54b05a0a40bfd74cbbef
url_launcher_linux: ac237cb7a8058736e4aae38bdbcc748a4b394cc0
url_launcher_macos: fd7894421cd39320dce5f292fc99ea9270b2a313
url_launcher_web: e5527357f037c87560776e36436bf2b0288b965c
<<<<<<< HEAD
WechatOpenSDK: 6a4d1436c15b3b5fe2a0bd383f3046010186da44
=======
<<<<<<< HEAD
WechatOpenSDK: 8b3ba4239193d1112205c139c94e21934e8f369a
=======
webview_flutter: d2b4d6c66968ad042ad94cbb791f5b72b4678a96
WechatOpenSDK: 6a4d1436c15b3b5fe2a0bd383f3046010186da44
>>>>>>> dev
>>>>>>> 6d4505c5bf3110e572bc68cbdefa56aee05df137
PODFILE CHECKSUM: 6d186dc4668603071619657511aa873d9a684d13
... ...
... ... @@ -369,15 +369,10 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/RunnerProfile.entitlements;
<<<<<<< HEAD
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 3;
=======
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 8;
>>>>>>> 6d4505c5bf3110e572bc68cbdefa56aee05df137
DEVELOPMENT_TEAM = 8J59HM8B82;
DEVELOPMENT_TEAM = "";
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
... ...
... ... @@ -13,7 +13,7 @@
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>一键订</string>
<string>Runner</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
... ...
... ... @@ -16,4 +16,4 @@ class HttpUrl{
static const String send_sms="?service=App.SendSMS.NewMessage";//发送短信
static const String check_update="http://xt03.colorcun.com/admin/api/compareversion?flat=3";
static const String upload_contact="?service=App.Seller.SaveCallRecord";//上传通讯录
}
\ No newline at end of file
}
... ...
import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:flutter_picker/flutter_picker.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
... ... @@ -13,7 +15,11 @@ 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/dialog.dart';
import 'package:one_key/widgets/h_empty_view.dart';
import 'package:one_key/widgets/loading.dart';
import 'package:one_key/widgets/need_item.dart';
import 'package:one_key/widgets/round_button.dart';
import 'package:one_key/widgets/row_multi_text.dart';
import 'package:one_key/widgets/table_item.dart';
import 'package:one_key/models/table.dart' as t;
... ... @@ -42,22 +48,59 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
List<Manager> managers = []; //客户经理
Manager manager = Manager();
List cancelReasonList = [];
bool isShowTF = false;
int paddingBottom = 174;
int paddingTop = 138;
FocusNode _cancelNode = FocusNode();
TextEditingController _cancelController = TextEditingController();
StateSetter _cancelState;
@override
void initState() {
// TODO: implement initState
super.initState();
WidgetsBinding.instance.addPostFrameCallback((_) async {
detailEntity = await detailModel.getReserveDetail(context, {
"rid": widget.rid,
});
setState(() {
cusmanText = detailEntity.cusman.isEmpty ? "请选择" : detailEntity.cusman;
});
_getReserveDetail();
managers = await detailModel.getManagers(context);
_initCancel();
//添加listener监听
//对应的TextField失去或者获取焦点都会回调此监听
_cancelNode.addListener(() {
if (_cancelNode.hasFocus) {
print('得到焦点');
paddingTop = 125;
} else {
print('失去焦点');
paddingTop = 138;
}
_cancelState(() {});
});
});
}
_getReserveDetail() async {
detailEntity = await detailModel.getReserveDetail(context, {
"rid": widget.rid,
});
setState(() {
cusmanText = detailEntity.cusman.isEmpty ? "请选择" : detailEntity.cusman;
});
}
/// 初始化取消原因数据
_initCancel() {
isShowTF = false;
paddingBottom = 174;
cancelReasonList = [
{'title': '顾客取消', 'select': false},
{'title': '顾客行程有变', 'select': false},
{'title': '信息填写有误', 'select': false},
{'title': '操作失误', 'select': false},
{'title': '其他原因', 'select': false},
];
}
//设置当前客户经理
_setCurrManager() {
manager = managers.firstWhere((manager) => manager.userName == cusmanText,
... ... @@ -71,6 +114,29 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
detailModel.setReserveCusmnan(context, params);
}
///处理在线预订
setReserveStatus(String status, {String tid = "", String desc}) async {
// bus.emit("remove_untreated_message",widget.mid);
UserModel userModel = Provider.of<UserModel>(context, listen: false);
Map<String, String> causeMap = {
"uid": userModel.user.openid,
"uname": userModel.user.account,
"desc": desc,
};
Map<String, String> params = {
"rid": widget.rid,
"status": status, //5安排包间 6 拒绝订单
"tid": tid,
// "mid": widget.mid,
"cause": json.encode(causeMap)
};
bool success =
await detailModel.setReserveStatus(context, params, ifPush: false);
if (success) {
_getReserveDetail();
}
}
/// 取消预订, 变更预订按钮
Widget _cancelAndChangeBtn(GestureTapCallback onTap, String title) {
return InkWell(
... ... @@ -85,314 +151,487 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
);
}
///取消预订弹框
_showCancelWidget(context) {
showGeneralDialog(
context: context,
barrierDismissible: false,
barrierLabel:
MaterialLocalizations.of(context).modalBarrierDismissLabel,
transitionDuration: const Duration(milliseconds: 150),
pageBuilder: (BuildContext context, Animation animation,
Animation secondaryAnimation) {
return StatefulBuilder(builder: (context, state) {
_cancelState = state;
return GestureDetector(
behavior: HitTestBehavior.opaque,
// onTap: () {
// Navigator.of(context).pop();
// },
child: Container(
decoration: BoxDecoration(
color: Color.fromRGBO(00, 00, 00, 0.5),
),
padding: EdgeInsets.fromLTRB(
ScreenUtil().setWidth(50),
ScreenUtil().setWidth(paddingTop * 2),
ScreenUtil().setWidth(50),
ScreenUtil().setWidth(paddingBottom * 2)),
child: Container(
padding: EdgeInsets.all(ScreenUtil().setWidth(40)),
decoration: BoxDecoration(
color: Colors.white,
borderRadius:
BorderRadius.circular(ScreenUtil().setWidth(10)),
),
child: Column(
children: [
Stack(
children: [
Center(
child: Text(
'请选择取消原因',
style: TextStyle(
fontSize: ScreenUtil().setSp(34),
fontWeight: FontWeight.bold,
decoration: TextDecoration.none,
color: MyColours.color_353535),
),
),
Positioned(
top: ScreenUtil().setWidth(8),
right: ScreenUtil().setWidth(0),
child: GestureDetector(
onTap: () {
_initCancel();
Navigator.of(context).pop();
},
child: Image.asset(
'assets/message_selected.png',
width: ScreenUtil().setWidth(32)),
))
],
),
VEmptyView(60),
Column(
children: cancelReasonList.map((value) {
return GestureDetector(
onTap: () {
for (var item in cancelReasonList) {
item['select'] = false;
isShowTF = false;
paddingBottom = 174;
if (item['title'] == value['title']) {
item['select'] = true;
if (item['title'] == '其他原因') {
isShowTF = true;
paddingBottom = 130;
}
}
}
state(() {});
},
child: Column(children: [
Row(
children: [
Image.asset(
value['select']
? 'assets/message_selected.png'
: 'assets/message_default.png',
width: ScreenUtil().setWidth(44)),
HEmptyView(30),
Text(value['title'],
style: TextStyle(
fontSize: ScreenUtil().setSp(32),
fontWeight: FontWeight.normal,
decoration: TextDecoration.none,
color: MyColours.color_333333))
],
),
value['title'] == '其他原因' && isShowTF
? Material(
child: Container(
color: Colors.white,
padding: EdgeInsets.only(
left: ScreenUtil().setWidth(76)),
child: TextField(
maxLines: 1,
controller: _cancelController,
focusNode: _cancelNode,
textAlignVertical:
TextAlignVertical.bottom,
decoration: InputDecoration(
hintText: "请填写原因",
hintStyle: TextStyle(
color: MyColours.color_999999,
fontSize: ScreenUtil().setSp(30),
),
enabledBorder: UnderlineInputBorder(
borderSide: BorderSide(
color:
MyColours.color_d8d8d8),
),
// border: InputBorder.none,
),
onChanged: (_) {
setState(() {});
},
onEditingComplete: () {
print('fff');
_cancelNode.unfocus();
},
// keyboardType: TextInputType.number,
),
))
: Container(),
VEmptyView(40)
]),
);
}).toList(),
),
VEmptyView(15),
Material(
child: RoundButton(
onPressed: () {
String desc = '';
for (var value in cancelReasonList) {
if (value['select'] == true) {
desc = value['title'];
if (value['title'] == '其他原因') {
desc = _cancelController.text.trim();
if (desc.isEmpty) {
Utils.showToast("请填写原因");
return;
}
}
}
}
if (desc == '') {
Utils.showToast('请选择原因');
return;
}
Navigator.of(context).pop();
setReserveStatus('4', desc: desc);
},
text: '确认',
height: ScreenUtil().setWidth(80),
width: ScreenUtil().setWidth(300),
radius: ScreenUtil().setWidth(10),
),
)
],
),
)),
);
});
});
}
@override
Widget build(BuildContext context) {
// TODO: implement build
return SafeArea(
child: detailEntity == null
? Container(
width: double.infinity,
height: double.infinity,
color: MyColours.color_ffffff,
)
: Container(
color: MyColours.color_ffffff,
child: Column(
children: <Widget>[
MyAppBar(
"订座详情",
showBack: true,
),
Expanded(
child: DefaultTextStyle(
style: TextStyle(decoration: TextDecoration.none),
child: Container(
color: MyColours.color_ffffff,
child: SingleChildScrollView(
child: Container(
color: MyColours.color_ffffff,
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(43)),
child: Column(
children: <Widget>[
RowMultiText("用餐时段", detailEntity.ddateMd),
Stack(
alignment: Alignment.center,
children: <Widget>[
Column(
children: <Widget>[
RowMultiText(
"用餐时间", detailEntity.ddateHm),
Offstage(
offstage: detailEntity.type == "0"
? false
: true,
child: RowMultiText(
"用餐人数", detailEntity.pnum),
)
],
),
Image.asset(
detailEntity.statuImgAssets,
width: ScreenUtil().setWidth(100),
height: ScreenUtil().setWidth(30),
)
],
),
Offstage(
offstage: detailEntity.demands.length <= 0
? true
: false,
child: Column(
return detailEntity == null
? Container(
width: double.infinity,
height: double.infinity,
color: MyColours.color_ffffff,
)
: Container(
color: MyColours.color_ffffff,
child: Column(
children: <Widget>[
SizedBox(height: ScreenUtil.statusBarHeight),
MyAppBar(
"订座详情",
showBack: true,
),
Expanded(
child: DefaultTextStyle(
style: TextStyle(decoration: TextDecoration.none),
child: Container(
color: MyColours.color_ffffff,
child: SingleChildScrollView(
child: Container(
color: MyColours.color_ffffff,
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(43)),
child: Column(
children: <Widget>[
RowMultiText("用餐时段", detailEntity.ddateMd),
Stack(
alignment: Alignment.center,
children: <Widget>[
Column(
children: <Widget>[
RowMultiText(
"包间需求",
(detailEntity.demands.length
.toString() +
"个") ??
""),
Align(
alignment: Alignment.centerRight,
child: Offstage(
offstage: detailEntity
.demands.length >
0
? false
: true,
child: Container(
height: ScreenUtil()
.setHeight(210),
child: ListView.builder(
itemBuilder:
(BuildContext contxt,
int index) {
return NeedItem(
detailEntity
.demands[index]);
},
itemCount: detailEntity
.demands.length,
shrinkWrap: true,
scrollDirection:
Axis.horizontal,
),
),
))
"用餐时间", detailEntity.ddateHm),
Offstage(
offstage: detailEntity.type == "0"
? false
: true,
child: RowMultiText(
"用餐人数", detailEntity.pnum),
)
],
),
Image.asset(
detailEntity.statuImgAssets,
width: ScreenUtil().setWidth(100),
height: ScreenUtil().setWidth(30),
)
],
),
Offstage(
offstage: detailEntity.demands.length <= 0
? true
: false,
child: Column(
children: <Widget>[
RowMultiText(
"包间需求",
(detailEntity.demands.length
.toString() +
"个") ??
""),
Align(
alignment: Alignment.centerRight,
child: Offstage(
offstage:
detailEntity.demands.length >
0
? false
: true,
child: Container(
height:
ScreenUtil().setHeight(210),
child: ListView.builder(
itemBuilder:
(BuildContext contxt,
int index) {
return NeedItem(detailEntity
.demands[index]);
},
itemCount: detailEntity
.demands.length,
shrinkWrap: true,
scrollDirection:
Axis.horizontal,
),
),
))
],
),
RowMultiText(
"预订桌位",
(detailEntity.tables.length.toString() +
"个")),
Align(
alignment: Alignment.centerRight,
child: Offstage(
offstage:
detailEntity.tables.length > 0
? false
: true,
child: Container(
height: ScreenUtil().setHeight(210),
child: ListView.builder(
itemBuilder: (BuildContext contxt,
int index) {
return TableItem(
detailEntity.tables[index]);
},
itemCount:
detailEntity.tables.length,
shrinkWrap: true,
scrollDirection: Axis.horizontal,
),
),
RowMultiText(
"预订桌位",
(detailEntity.tables.length.toString() +
"个")),
Align(
alignment: Alignment.centerRight,
child: Offstage(
offstage: detailEntity.tables.length > 0
? false
: true,
child: Container(
height: ScreenUtil().setHeight(210),
child: ListView.builder(
itemBuilder: (BuildContext contxt,
int index) {
return TableItem(
detailEntity.tables[index]);
},
itemCount:
detailEntity.tables.length,
shrinkWrap: true,
scrollDirection: Axis.horizontal,
),
)),
RowMultiText("客户姓名", detailEntity.rnameStr),
RowMultiText(
"客户电话", detailEntity.phone ?? ""),
RowMultiText(
"备注信息", detailEntity.cusdem ?? ""),
MyDivider(double.infinity,
ScreenUtil().setHeight(1)),
Container(
color: MyColours.color_ffffff,
width: double.infinity,
height: ScreenUtil().setHeight(80),
),
)),
RowMultiText("客户姓名", detailEntity.rnameStr),
RowMultiText(
"客户电话", detailEntity.phone ?? ""),
RowMultiText(
"备注信息", detailEntity.cusdem ?? ""),
MyDivider(double.infinity,
ScreenUtil().setHeight(1)),
Container(
color: MyColours.color_ffffff,
width: double.infinity,
height: ScreenUtil().setHeight(80),
alignment: Alignment.center,
child: Stack(
alignment: Alignment.center,
child: Stack(
alignment: Alignment.center,
children: <Widget>[
Positioned(
left: 0,
child: Text(
"客户经理",
style: TextStyle(
color: MyColours.color_828282,
fontSize:
ScreenUtil().setSp(30)),
),
children: <Widget>[
Positioned(
left: 0,
child: Text(
"客户经理",
style: TextStyle(
color: MyColours.color_828282,
fontSize:
ScreenUtil().setSp(30)),
),
Positioned(
right: 0,
child: GestureDetector(
onTap: () async {
List<String> list = [];
for (Manager manager
in managers) {
list.add(
manager.roleUserName);
),
Positioned(
right: 0,
child: GestureDetector(
onTap: () async {
List<String> list = [];
for (Manager manager
in managers) {
list.add(manager.roleUserName);
}
DialogUtil.showSelectCusmanDialog(
context, list)
.then((value) {
if (value != null) {
setState(() {
cusmanText =
managers[value.first]
.userName;
});
_setCurrManager();
}
DialogUtil
.showSelectCusmanDialog(
context, list)
.then((value) {
if (value != null) {
setState(() {
cusmanText =
managers[value.first]
.userName;
});
_setCurrManager();
}
});
},
child: Text(
cusmanText,
style: TextStyle(
color: MyColours.color_353535,
fontSize:
ScreenUtil().setSp(30),
decoration:
TextDecoration.underline,
),
});
},
child: Text(
cusmanText,
style: TextStyle(
color: MyColours.color_353535,
fontSize:
ScreenUtil().setSp(30),
decoration:
TextDecoration.underline,
),
),
)
],
),
),
)
],
),
RowMultiText(
"记录人", detailEntity.note_name ?? ""),
Offstage(
offstage: (detailEntity.status == "4" &&
detailEntity.cancel != null)
? false
: true,
child: Column(
children: <Widget>[
MyDivider(double.infinity,
ScreenUtil().setHeight(2)),
RowMultiText("取消原因",
detailEntity.cancel?.desc ?? ""),
RowMultiText(
"取消时间",
detailEntity.cancel?.cdateStr ??
""),
RowMultiText("操作人",
detailEntity.cancel?.uname ?? ""),
],
),
),
RowMultiText(
"记录人", detailEntity.note_name ?? ""),
Offstage(
offstage: (detailEntity.status == "4" &&
detailEntity.cancel != null)
? false
: true,
child: Column(
children: <Widget>[
MyDivider(double.infinity,
ScreenUtil().setHeight(2)),
RowMultiText("取消原因",
detailEntity.cancel?.desc ?? "",
textAlign: TextAlign.left),
RowMultiText(
"取消时间",
detailEntity.cancel?.cdateStr ??
""),
RowMultiText("操作人",
detailEntity.cancel?.uname ?? ""),
],
),
],
)),
),
)),
),
Offstage(
offstage: (detailEntity.status == "3" ||
detailEntity.status == "4" ||
detailEntity.status == "6")
? true
: false,
child: Container(
width: double.infinity,
decoration: BoxDecoration(
color: MyColours.color_ffffff,
border: Border(
top: BorderSide(
color: MyColours.color_dbe3e3,
width: ScreenUtil().setWidth(1)))),
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setHeight(40)),
margin: EdgeInsets.symmetric(
vertical: ScreenUtil().setHeight(20)),
child: CommonButton(
content: "通知客户",
width: 669,
height: 80,
fontSize: 34,
onPress: () {
DialogUtil.showShareDialog(context)?.then((value) {
switch (value) {
case 1: //微信
NavigatorUtil.goInvicationPage(
context,
detailEntity.id,
detailEntity.tableinfoStr,
detailEntity.ddate,
detailEntity.ddateStr);
break;
case 2: //短信
NavigatorUtil.goSmsPage(
context, detailEntity.id);
break;
case 3: //电话
if (detailEntity.phone != null &&
detailEntity.phone.isNotEmpty) {
Utils.goPhone(detailEntity.phone);
} else {
Utils.showToast("没有客户电话!");
}
break;
}
});
},
),
),
],
)),
),
)),
),
Offstage(
offstage: (detailEntity.status == "3" ||
detailEntity.status == "4" ||
detailEntity.status == "6")
? true
: false,
child: Container(
width: double.infinity,
decoration: BoxDecoration(
color: MyColours.color_ffffff,
border: Border(
top: BorderSide(
color: MyColours.color_dbe3e3,
width: ScreenUtil().setWidth(1)))),
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setHeight(40)),
margin: EdgeInsets.symmetric(
vertical: ScreenUtil().setHeight(20)),
child: CommonButton(
content: "通知客户",
width: 669,
height: 80,
fontSize: 34,
onPress: () {
DialogUtil.showShareDialog(context)?.then((value) {
switch (value) {
case 1: //微信
NavigatorUtil.goInvicationPage(
context,
detailEntity.id,
detailEntity.tableinfoStr,
detailEntity.ddate,
detailEntity.ddateStr);
break;
case 2: //短信
NavigatorUtil.goSmsPage(context, detailEntity.id);
break;
case 3: //电话
if (detailEntity.phone != null &&
detailEntity.phone.isNotEmpty) {
Utils.goPhone(detailEntity.phone);
} else {
Utils.showToast("没有客户电话!");
}
break;
}
});
},
),
),
Offstage(
offstage: (detailEntity.status == "3" ||
detailEntity.status == "4" ||
detailEntity.status == "6")
? true
: false,
child: Container(
width: double.infinity,
height: ScreenUtil().setWidth(80),
margin: EdgeInsets.symmetric(
horizontal: ScreenUtil().setHeight(40)),
decoration: BoxDecoration(
border: Border.all(
color: MyColours.color_199095,
width: ScreenUtil().setWidth(2)),
borderRadius:
BorderRadius.circular(ScreenUtil().setWidth(5)),
),
// child: Text('fff'),
child: Material(
child: Row(
children: [
Expanded(
child: _cancelAndChangeBtn(() {
print('点击变更预订');
}, '变更预订')),
MyDivider(
ScreenUtil().setWidth(2),
ScreenUtil().setWidth(50),
color: MyColours.color_199095,
),
Expanded(
child: _cancelAndChangeBtn(() {
print('点击取消预订');
}, '取消预订')),
],
)),
),
Offstage(
offstage: (detailEntity.status == "3" ||
detailEntity.status == "4" ||
detailEntity.status == "6")
? true
: false,
child: Container(
width: double.infinity,
height: ScreenUtil().setWidth(80),
margin: EdgeInsets.symmetric(
horizontal: ScreenUtil().setHeight(40)),
decoration: BoxDecoration(
border: Border.all(
color: MyColours.color_199095,
width: ScreenUtil().setWidth(2)),
borderRadius:
BorderRadius.circular(ScreenUtil().setWidth(5)),
),
// child: Text('fff'),
child: Material(
child: Row(
children: [
Expanded(
child: _cancelAndChangeBtn(() {
print('点击变更预订');
}, '变更预订')),
MyDivider(
ScreenUtil().setWidth(2),
ScreenUtil().setWidth(50),
color: MyColours.color_199095,
),
Expanded(
child: _cancelAndChangeBtn(() {
_showCancelWidget(context);
}, '取消预订')),
],
)),
),
VEmptyView(ScreenUtil().setWidth(60))
],
),
),
VEmptyView(ScreenUtil().setWidth(60))
],
),
);
);
}
}
... ...
... ... @@ -350,4 +350,4 @@ class HomePageState extends State<HomePage>{
super.dispose();
LogUtil.v("home_dispose");
}
}
\ No newline at end of file
}
... ...
... ... @@ -9,14 +9,15 @@ import 'package:one_key/provider/user_model.dart';
import 'package:one_key/utils/navigator_util.dart';
import 'package:one_key/utils/utils.dart';
import 'package:provider/provider.dart';
class NotebookDetailModel extends ChangeNotifier{
class NotebookDetailModel extends ChangeNotifier {
///获取已预订订单
Future<NotebookDetail> getReserveDetail(BuildContext context,Map<String,String> params) async {
BaseResp<Map<String,dynamic>> baseResp = await DioUtil()
.request<Map<String,dynamic>>(context, Method.get, HttpUrl.reserve_detail,
data: params)
Future<NotebookDetail> getReserveDetail(
BuildContext context, Map<String, String> params) async {
BaseResp<Map<String, dynamic>> baseResp = await DioUtil()
.request<Map<String, dynamic>>(
context, Method.get, HttpUrl.reserve_detail,
data: params)
.catchError((error) {
print(error.toString());
});
... ... @@ -27,59 +28,71 @@ class NotebookDetailModel extends ChangeNotifier{
///获取商家信息
Future<List<Manager>> getManagers(BuildContext context) async {
UserModel userModel=Provider.of<UserModel>(context,listen: false);
Map<String,String> params={"seller_id": userModel.user.sellerid, "seller_openid": userModel.user.openid};
UserModel userModel = Provider.of<UserModel>(context, listen: false);
Map<String, String> params = {
"seller_id": userModel.user.sellerid,
"seller_openid": userModel.user.openid
};
BaseResp<Map<String, dynamic>> baseResp = await DioUtil()
.request<Map<String, dynamic>>(context, Method.get, HttpUrl.sellerinfo,
data: params)
data: params)
.catchError((error) {
print(error.toString());
});
if (baseResp.code == Constant.status_success) {
return (baseResp.data["manager"] as List).map((value)=>Manager.fromJson(value as Map<String,dynamic>)).toList();
return (baseResp.data["manager"] as List)
.map((value) => Manager.fromJson(value as Map<String, dynamic>))
.toList();
}
}
///设置客户经理
setReserveCusmnan(BuildContext context,Map<String,String> params) async {
setReserveCusmnan(BuildContext context, Map<String, String> params) async {
BaseResp<String> baseResp = await DioUtil()
.request<String>(context, Method.get, HttpUrl.set_reserve_cusman,
data: params)
data: params)
.catchError((error) {
print(error.toString());
});
if (baseResp.code == Constant.status_success) {
}else{
Utils.showToast(baseResp.msg??"");
} else {
Utils.showToast(baseResp.msg ?? "");
}
}
//安排在线预订
setReserveStatus(BuildContext context,Map<String,String> params) async {
BaseResp<Map<String,dynamic>> baseResp = await DioUtil()
.request<Map<String,dynamic>>(context, Method.get, HttpUrl.set_reserve_status,
data: params,showLoading: false)
setReserveStatus(BuildContext context, Map<String, String> params,
{ifPush = true}) async {
BaseResp<Map<String, dynamic>> baseResp = await DioUtil()
.request<Map<String, dynamic>>(
context, Method.get, HttpUrl.set_reserve_status,
data: params, showLoading: false)
.catchError((error) {
print(error.toString());
});
if(baseResp.code==Constant.status_success){
NavigatorUtil.goNotebookDetailPage(context, params["rid"],replace: true);
}else{
if (baseResp.code == Constant.status_success) {
if (ifPush) {
NavigatorUtil.goNotebookDetailPage(context, params["rid"],
replace: true);
} else {
return true;
}
} else {
Utils.showToast(baseResp.msg);
}
}
//设置消息状态
setMessageStatus(BuildContext context,Map<String,String> params) async {
setMessageStatus(BuildContext context, Map<String, String> params) async {
BaseResp<dynamic> baseResp = await DioUtil()
.request<dynamic>(context, Method.get, HttpUrl.set_message_status,
data: params,showLoading: false)
data: params, showLoading: false)
.catchError((error) {
print(error.toString());
});
if(baseResp.code==Constant.status_success){
}else{
if (baseResp.code == Constant.status_success) {
} else {
Utils.showToast(baseResp.msg);
}
}
}
\ No newline at end of file
}
... ...
import 'package:flutter/material.dart';
class MyColours {
static const Color app_main = Color(0xFF24A4A8);
static const Color color_ffffff=Color(0xffffffff);
static const Color color_fefefe=Color(0xfffefefe);
static const Color color_f5f5f5=Color(0xfff5f5f5);
static const Color color_199095=Color(0xff199095);
static const Color color_999999=Color(0xff999999);
static const Color color_353535=Color(0xff353535);
static const Color color_d8d8d8=Color(0xffD8D8D8);
static const Color color_bff6f7=Color(0xffBFF6F7);
static const Color color_c1c1c1=Color(0xffC1C1C1);
static const Color color_2bb5b7=Color(0xff2BB5B7);
static const Color color_26000000=Color(0x26000000);
static const Color color_d93535=Color(0xffD93535);
static const Color color_E14553=Color(0xffE14553);
static const Color color_131313=Color(0xff131313);
static const Color color_2e000000=Color(0x2e000000);
static const Color color_14000000=Color(0x14000000);
static const Color color_bfbfbf=Color(0xffBFBFBF);
static const Color color_828282=Color(0xff828282);
static const Color color_a8e2e4=Color(0xffA8E2E4);
static const Color color_63a6d1=Color(0xff63A6D1);
static const Color color_666666=Color(0xff666666);
static const Color color_777777=Color(0xff777777);
static const Color color_ea5750=Color(0xffEA5750);
static const Color color_89c0b7=Color(0xff89C0B7);
static const Color color_ededed=Color(0xffededed);
static const Color color_f7fdfd=Color(0xffF7FDFD);
static const Color color_dbe3e3=Color(0xffdbe3e3);
static const Color color_f3f3f3=Color(0xfff3f3f3);
static const Color color_f49a5e=Color(0xffF49A5E);
static const Color color_ff0000=Color(0xffff0000);
static const Color color_000000=Color(0xff000000);
static const Color color_97e9ea=Color(0xff97E9EA);
static const Color color_f1f1f1=Color(0xfff1f1f1);
static const Color color_eadab9=Color(0xffeadab9);
static const Color color_e3d2ac=Color(0xffe3d2ac);
static const Color color_83734d=Color(0xff83734d);
static const Color color_dfdfdf=Color(0xffdfdfdf);
static const Color color_ffffff = Color(0xffffffff);
static const Color color_fefefe = Color(0xfffefefe);
static const Color color_f5f5f5 = Color(0xfff5f5f5);
static const Color color_199095 = Color(0xff199095);
static const Color color_999999 = Color(0xff999999);
static const Color color_353535 = Color(0xff353535);
static const Color color_d8d8d8 = Color(0xffD8D8D8);
static const Color color_bff6f7 = Color(0xffBFF6F7);
static const Color color_c1c1c1 = Color(0xffC1C1C1);
static const Color color_2bb5b7 = Color(0xff2BB5B7);
static const Color color_26000000 = Color(0x26000000);
static const Color color_d93535 = Color(0xffD93535);
static const Color color_E14553 = Color(0xffE14553);
static const Color color_131313 = Color(0xff131313);
static const Color color_2e000000 = Color(0x2e000000);
static const Color color_14000000 = Color(0x14000000);
static const Color color_bfbfbf = Color(0xffBFBFBF);
static const Color color_828282 = Color(0xff828282);
static const Color color_a8e2e4 = Color(0xffA8E2E4);
static const Color color_63a6d1 = Color(0xff63A6D1);
static const Color color_666666 = Color(0xff666666);
static const Color color_777777 = Color(0xff777777);
static const Color color_ea5750 = Color(0xffEA5750);
static const Color color_89c0b7 = Color(0xff89C0B7);
static const Color color_ededed = Color(0xffededed);
static const Color color_f7fdfd = Color(0xffF7FDFD);
static const Color color_dbe3e3 = Color(0xffdbe3e3);
static const Color color_f3f3f3 = Color(0xfff3f3f3);
static const Color color_f49a5e = Color(0xffF49A5E);
static const Color color_ff0000 = Color(0xffff0000);
static const Color color_000000 = Color(0xff000000);
static const Color color_97e9ea = Color(0xff97E9EA);
static const Color color_f1f1f1 = Color(0xfff1f1f1);
static const Color color_eadab9 = Color(0xffeadab9);
static const Color color_e3d2ac = Color(0xffe3d2ac);
static const Color color_83734d = Color(0xff83734d);
static const Color color_dfdfdf = Color(0xffdfdfdf);
static const Color color_333333 = Color(0xff333333);
}
... ...
import 'package:flutter/material.dart';
class ShowDialog extends Dialog {
Widget child;
ShowDialog({Key key, this.child}) : super(key: key);
@override
Widget build(BuildContext context) {
return Material(
//透明层
type: MaterialType.transparency,
child: Stack(
children: <Widget>[
InkWell(
onTap: () {
Navigator.pop(context);
},
child: Container(
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height,
),
),
child //内容
],
));
}
}
... ...
import 'package:common_utils/common_utils.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:one_key/res/colors.dart';
class RoundButton extends StatelessWidget {
const RoundButton(
{Key key,
this.width,
this.height = 50,
this.margin,
this.radius,
this.bgColor,
this.highlightColor,
this.splashColor,
this.child,
this.text,
this.style,
this.onPressed,
this.image,
this.imgWidth = 13.0,
this.fontSize = 24,
this.gradientStart = MyColours.color_199095,
this.gradientEnd = MyColours.color_199095,
this.textColor = Colors.white,
this.borderColor = Colors.transparent, this.isBold = true})
: super(key: key);
final String image;
final double width;
final double height;
final double imgWidth;
final double fontSize;
final Color textColor;
final bool isBold;
/// Empty space to surround the [decoration] and [child].
final EdgeInsetsGeometry margin;
final double radius;
final Color bgColor;
final Color highlightColor;
final Color splashColor;
final Color gradientStart;
final Color gradientEnd;
final Widget child;
final Color borderColor;
final String text;
final TextStyle style;
final VoidCallback onPressed;
@override
Widget build(BuildContext context) {
Color _bgColor = bgColor ?? Theme.of(context).primaryColor;
BorderRadius _borderRadius = BorderRadius.circular(radius ?? (height / 2));
return new Container(
width: width,
height: height,
margin: margin,
decoration: BoxDecoration(
borderRadius: _borderRadius,
border: Border.all(color: borderColor, width: ScreenUtil().setWidth(2)),
gradient: LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: [
gradientStart,
gradientEnd,
],
),
),
child: new InkWell(
borderRadius: _borderRadius,
onTap: () => onPressed(),
child: child ??
new Center(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
!ObjectUtil.isEmptyString(image)
? Padding(
padding: EdgeInsets.only(right: 6, bottom: 3),
child: Image.asset(
image,
width: ScreenUtil().setWidth(imgWidth),
),
)
: Text(''),
Text(
text,
style: style ??
new TextStyle(
color: textColor,
fontSize:ScreenUtil().setSp(fontSize),
fontWeight: isBold ? FontWeight.bold : FontWeight.normal),
)
],
),
),
));
}
}
... ...
... ... @@ -2,12 +2,12 @@ import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:one_key/res/colors.dart';
class RowMultiText extends StatelessWidget{
class RowMultiText extends StatelessWidget {
final String title;
final String content;
final TextAlign textAlign;
RowMultiText(this.title, this.content);
RowMultiText(this.title, this.content, {this.textAlign = TextAlign.right});
@override
Widget build(BuildContext context) {
... ... @@ -22,17 +22,27 @@ class RowMultiText extends StatelessWidget{
children: <Widget>[
Align(
alignment: Alignment.centerLeft,
child: Text(title,style: TextStyle(color: MyColours.color_828282,fontSize: ScreenUtil().setSp(30)),),
child: Text(
title,
style: TextStyle(
color: MyColours.color_828282,
fontSize: ScreenUtil().setSp(30)),
),
),
Expanded(
child: Container(
alignment: Alignment.centerRight,
margin: EdgeInsets.only(left: ScreenUtil().setWidth(20)),
child: Text(content,style: TextStyle(color: MyColours.color_353535,fontSize: ScreenUtil().setSp(30)),softWrap: true,textAlign: TextAlign.right,),
child: Text(content,
style: TextStyle(
color: MyColours.color_353535,
fontSize: ScreenUtil().setSp(30)),
softWrap: true,
textAlign: this.textAlign),
),
)
],
),
);
}
}
\ No newline at end of file
}
... ...
... ... @@ -141,6 +141,13 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.14.13"
common_utils:
dependency: "direct main"
description:
name: common_utils
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.2.1"
connectivity:
dependency: "direct main"
description:
... ... @@ -218,6 +225,13 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.2.9"
decimal:
dependency: transitive
description:
name: decimal
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.3.5"
device_info:
dependency: "direct main"
description:
... ... @@ -681,6 +695,13 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.3"
rational:
dependency: transitive
description:
name: rational
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.3.8"
rxdart:
dependency: transitive
description:
... ...
... ... @@ -83,6 +83,7 @@ dependencies:
webview_flutter: ^0.3.22+1
# 获取通讯录
contacts_service: ^0.4.6
common_utils: ^1.1.3
dev_dependencies:
... ...