Commit 8c221f318ffa705026a85588dd9d218595f10565

Authored by wdn127929
1 parent b3ddaaa1

预订安排页

... ... @@ -41,8 +41,9 @@ typedef clickCallback = void Function(String value);
class NoteBookChangeFPage extends StatefulWidget {
final NotebookDetail detailEntity;
final String rid;
final bool back;
const NoteBookChangeFPage({Key key, this.detailEntity, this.rid})
const NoteBookChangeFPage({Key key, this.detailEntity, this.rid, this.back})
: super(key: key);
@override
... ... @@ -1963,58 +1964,70 @@ class _NoteBookChangeFPageState extends State<NoteBookChangeFPage> {
// _notebookDetailChangeModel.clearData();
bus.emit("refresh_detail");
bus.emit("refresh_book_list"); //刷新已预订列表
String ddate_solt = '';
if (_model.row.isSetDdate == '1') {
String createtime =
_model.row.ddate.toString() + '000';
DateTime createTime =
DateTime.fromMillisecondsSinceEpoch(
int.parse(createtime));
ddate_solt = DateUtil.formatDate(createTime,
format: DateFormats.h_m);
if (widget.back) {
EventBus()
.emit("refresh_invitaion_info"); //刷新预订安排页面
Navigator.pop(context);
} else {
if (_model.row.ddateSolt == '1') {
ddate_solt = '早餐';
} else if (_model.row.ddateSolt == '2') {
ddate_solt = '午餐';
} else if (_model.row.ddateSolt == '3') {
ddate_solt = '晚餐';
String ddate_solt = '';
if (_model.row.isSetDdate == '1') {
String createtime =
_model.row.ddate.toString() + '000';
DateTime createTime =
DateTime.fromMillisecondsSinceEpoch(
int.parse(createtime));
ddate_solt = DateUtil.formatDate(createTime,
format: DateFormats.h_m);
} else {
if (_model.row.ddateSolt == '1') {
ddate_solt = '早餐';
} else if (_model.row.ddateSolt == '2') {
ddate_solt = '午餐';
} else if (_model.row.ddateSolt == '3') {
ddate_solt = '晚餐';
}
}
List<dynamic> tableinfo =
convert.jsonDecode(_model.row.tableinfo);
print(tableinfo);
// if (tableinfo.length > 1) {
// _nameStr =
// t.TableList.fromJson(tableinfo[0]).name +
// '等${tableinfo.length}桌';
// }
String _nameStr = '';
String _tid = '';
for (int i = 0; i < tableinfo.length; i++) {
_nameStr +=
'${t.TableList.fromJson(tableinfo[i]).name},';
_tid +=
'${t.TableList.fromJson(tableinfo[i]).id},';
}
if (_tid.endsWith(',')) {
_tid = _tid.substring(0, _tid.length - 1);
}
if (_nameStr.endsWith(',')) {
_nameStr =
_nameStr.substring(0, _nameStr.length - 1);
}
LogUtil.v(_nameStr);
NavigatorUtil.goInvicationPage(
context,
_model.row.id,
_nameStr,
_model.row.ddate,
ddate_solt,
_model.row.phone,
_model.row.ddateSolt,
_model.row.rname == null
? ''
: _model.row.rname,
_model.row.sex == null ? '' : _model.row.sex,
tid: _tid,
replace: true);
}
List<dynamic> tableinfo =
convert.jsonDecode(_model.row.tableinfo);
print(tableinfo);
String _nameStr =
t.TableList.fromJson(tableinfo[0]).name;
if (tableinfo.length > 1) {
_nameStr =
t.TableList.fromJson(tableinfo[0]).name +
'等${tableinfo.length}桌';
}
String _tid = '';
for (int i = 0; i < tableinfo.length; i++) {
_tid +=
'${t.TableList.fromJson(tableinfo[i]).id},';
}
if (_tid.endsWith(',')) {
_tid = _tid.substring(0, _tid.length - 1);
}
LogUtil.v(_nameStr);
NavigatorUtil.goInvicationPage(
context,
_model.row.id,
_nameStr,
_model.row.ddate,
ddate_solt,
_model.row.phone,
_model.row.ddateSolt,
_model.row.rname == null
? ''
: _model.row.rname,
_model.row.sex == null ? '' : _model.row.sex,
tid: _tid,
replace: true);
EventBus().emit("refresh_tablemanager"); //刷新桌位
} else {
Utils.showToast(widget.detailEntity.id == "-1"
... ...
... ... @@ -2505,12 +2505,16 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
flex: 2,
child: InkWell(
onTap: () {
String _nameStr = '';
String _tid = '';
for (int i = 0;
i <
detailEntity
.tables.length;
i++) {
_nameStr +=
'${detailEntity.tables[i].name},';
_tid +=
'${detailEntity.tables[i].id},';
}
... ... @@ -2518,12 +2522,20 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
_tid = _tid.substring(
0, _tid.length - 1);
}
if (_nameStr
.endsWith(',')) {
_nameStr =
_nameStr.substring(
0,
_nameStr.length -
1);
}
NavigatorUtil
.goInvicationPage(
context,
detailEntity.id,
detailEntity
.tableinfoStr,
_nameStr,
detailEntity.ddate,
detailEntity
.ddateStr,
... ...
This diff could not be displayed because it is too large.
// import 'dart:typed_data';
// import 'dart:ui';
// import 'package:cached_network_image/cached_network_image.dart';
// import 'package:common_utils/common_utils.dart';
// import 'package:flutter/material.dart';
// import 'package:flutter/rendering.dart';
// import 'package:flutter/services.dart';
// import 'package:flutter_screenutil/flutter_screenutil.dart';
// import 'package:one_key/models/seller_phone_model.dart';
// import 'package:one_key/models/user.dart';
// import 'package:one_key/pages/online_check/photo_view_wiget.dart';
// import 'package:one_key/provider/base_info_provider.dart';
// import 'package:one_key/provider/coupon_provider.dart';
// import 'package:one_key/provider/user_model.dart';
// import 'package:one_key/res/colors.dart';
// import 'package:one_key/utils/event_bus.dart';
// import 'package:one_key/utils/misc.dart';
// import 'package:one_key/route/navigator_util.dart';
// import 'package:one_key/utils/utils.dart';
// import 'package:one_key/widgets/h_empty_view.dart';
// import 'package:one_key/widgets/round_button.dart';
// import 'package:one_key/widgets/system_app_bar.dart';
// import 'package:one_key/widgets/v_empty_view.dart';
// import 'package:permission_handler/permission_handler.dart';
// import 'package:provider/provider.dart';
// import 'dart:ui' as ui;
// class InvicationPage extends StatefulWidget {
// final String rid; //预订订单id
// final String tableInfo; //桌位信息
// final String ddate;
// final String ddateStr;
// final String phone;
// final String dateSolt;
// final String tid;
// final String name;
// final String sex;
// InvicationPage(this.rid, this.tableInfo, this.ddate, this.ddateStr,
// this.phone, this.dateSolt, this.tid, this.name, this.sex);
// @override
// State<StatefulWidget> createState() {
// // TODO: implement createState
// return new InvicationPageState();
// }
// }
// class InvicationPageState extends State<InvicationPage> {
// User user;
// DateTime dateTime;
// String dateTimeStr = "";
// ScrollController controller = ScrollController();
// double couponHeight = 140.0;
// CouponProvider couponProvider;
// BaseIndoProvider _baseIndoProvider;
// String name = '';
// String position = '经理';
// String phone = '';
// String qiniuUrl = '';
// final GlobalKey key = new GlobalKey();
// final GlobalKey globalKey = GlobalKey();
// String reserverPhone;
// @override
// void initState() {
// super.initState();
// reserverPhone = widget.phone;
// WidgetsBinding.instance.addPostFrameCallback((_) {
// couponProvider.sendSMS = false;
// _getActivityByRid();
// _getCustomerActivityBaseinfo();
// _getTablesPhoto();
// });
// bus.on("refresh_coupon_invitation", (args) {
// _couponNetworkData(isShowLoading: false);
// });
// Utils.changeStatusColor(color: Colors.transparent);
// dateTime =
// DateTime.fromMillisecondsSinceEpoch(int.parse(widget.ddate) * 1000);
// user = Provider.of<UserModel>(context, listen: false).user;
// dateTimeStr =
// "${dateTime.year}/${Utils.addZeroNumber(dateTime.month)}/${Utils.addZeroNumber(dateTime.day)} 星期${Utils.formatWeekDayNum(dateTime.weekday)} ${widget.ddateStr}";
// }
// @override
// void dispose() {
// Utils.changeStatusColor();
// couponProvider.clearSelect();
// bus.off("refresh_coupon_invitation");
// super.dispose();
// }
// _getTablesPhoto() async {
// Map<String, String> params = {
// "sellerid": Provider.of<UserModel>(context, listen: false).user.sellerid,
// "tableids": widget.tid,
// };
// bool success = await _baseIndoProvider.getTablesPhoto(context, params);
// }
// //客户经理添加/修改基本信息
// _setCustomerActivityBaseinfo() async {
// Map<String, String> params = {
// 'sellerid': Provider.of<UserModel>(context, listen: false).user.sellerid,
// "uid": Provider.of<UserModel>(context, listen: false).user.openid,
// "name": user.sellername,
// "photo": 'http://nosqn.colorcun.com/yd_person.png',
// "position": '经理',
// };
// if (user.userphone != null) {
// params['phone'] = user.userphone;
// }
// bool isSuccess =
// await _baseIndoProvider.setCustomerActivityBaseinfo(context, params);
// // _baseIndoProvider.baseInfoSunModel = null;
// if (isSuccess) {
// name = user.sellername;
// qiniuUrl = 'http://nosqn.colorcun.com/yd_person.png';
// // _uploadImageProvider.erweima.qiniuUrl =
// // _baseIndoProvider.baseInfoSunModel.qrcode;
// phone = user.userphone != null ? user.userphone : '填写电话';
// position = '经理';
// qiniuUrl = 'http://nosqn.colorcun.com/yd_person.png';
// setState(() {});
// }
// }
// _getCustomerActivityBaseinfo() async {
// Map<String, String> params = {
// 'sellerid': Provider.of<UserModel>(context, listen: false).user.sellerid,
// "uid": Provider.of<UserModel>(context, listen: false).user.openid,
// };
// bool success =
// await _baseIndoProvider.getCustomerActivityBaseinfo(context, params);
// if (success) {
// name = _baseIndoProvider.baseInfoSunModel.name;
// qiniuUrl = _baseIndoProvider.baseInfoSunModel.photo;
// // _uploadImageProvider.erweima.qiniuUrl =
// // _baseIndoProvider.baseInfoSunModel.qrcode;
// phone = _baseIndoProvider.baseInfoSunModel.phone != null
// ? _baseIndoProvider.baseInfoSunModel.phone
// : '填写电话';
// position = _baseIndoProvider.baseInfoSunModel.position;
// setState(() {});
// } else {
// // name = '请填写姓名';
// // position = '请填写职位';
// // phone = '请填写电话';
// // qiniuUrl = '';
// _setCustomerActivityBaseinfo();
// }
// }
// _getActivityByRid() async {
// Map<String, String> params = {
// "rid": widget.rid,
// };
// await couponProvider.getActivityByRid(context, params, isShowLoading: true);
// //flase默认5个 true 不默认5个
// if (!couponProvider.hasModify) {
// //没有绑定的券,默认给5个,获取优惠券列表
// _couponNetworkData(isShowLoading: true);
// }
// }
// ///消费券默认5张
// _couponNetworkData({bool isShowLoading = true}) async {
// Map<String, String> params = {
// "uid": Provider.of<UserModel>(context, listen: false).user.openid,
// 'status': '1'
// };
// await couponProvider.getCustomerSelectActivity(context, params,
// isShowLoading: isShowLoading);
// //此人已经新建好券
// if (couponProvider.couponListSelect.length > 0) {
// couponProvider.initCouponSelect(context);
// if (couponProvider.coupons.length == 0) {
// setState(() {
// couponHeight = 0.0;
// });
// } else {
// setState(() {
// couponHeight = 140.0;
// });
// }
// } else {
// //没有新建的优惠券
// setState(() {
// couponHeight = 0.0;
// });
// }
// }
// //中间内容显示组件
// Widget _middleWidget(String title, String content) {
// return Column(
// children: <Widget>[
// VEmptyView(80),
// Row(
// mainAxisSize: MainAxisSize.min,
// children: <Widget>[
// Image.asset(
// "assets/invication_line_left.png",
// width: ScreenUtil().setWidth(44),
// height: ScreenUtil().setWidth(4),
// ),
// Container(
// margin:
// EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(13)),
// child: Text(title,
// style: TextStyle(
// color: MyColours.color_CEB689,
// fontSize: ScreenUtil().setSp(28))),
// ),
// Image.asset(
// "assets/invication_line_right.png",
// width: ScreenUtil().setWidth(44),
// height: ScreenUtil().setWidth(4),
// )
// ],
// ),
// Container(
// margin: EdgeInsets.only(top: ScreenUtil().setHeight(20)),
// child: Text(
// content,
// style: TextStyle(
// color: MyColours.color_F2F2F2,
// fontSize: ScreenUtil().setSp(36)),
// ),
// )
// ],
// );
// }
// _goBaseInfoPage() async {
// bool needRefresh = await NavigatorUtil.goBaseInfoPage(context);
// Utils.changeStatusColor(color: Colors.transparent);
// if (needRefresh != null && needRefresh) {
// //刷新页面数据
// _getCustomerActivityBaseinfo();
// }
// }
// //查看大图
// _showPhotoView(BuildContext context, int index, List imgs,
// {isShow = false, List dashName}) async {
// // if (imgs.length == 1 &&
// // imgs[0] ==
// // 'http://nosqn.colorcun.com/custom/lite-online/image/def-banner.png') {
// // imgs[0] = 'http://nosqn.colorcun.com/app/seller-hj-empty.png';
// // }
// Utils.setBarStatus(false, color: Colors.black);
// dynamic result = await showGeneralDialog(
// context: context,
// barrierDismissible: false,
// // barrierColor: Colors.red,
// barrierLabel:
// MaterialLocalizations.of(context).modalBarrierDismissLabel,
// transitionDuration: const Duration(milliseconds: 150),
// pageBuilder: (BuildContext context, Animation animation,
// Animation secondaryAnimation) {
// Widget child = Stack(
// children: <Widget>[
// PhotoPreview(
// initialIndex: index,
// photoList: imgs,
// isShow: isShow,
// dashName: dashName)
// ],
// );
// return child;
// });
// // Utils.setBarStatus(true, color: Colors.white);
// }
// ///浏览照片
// ///
// void onTapDown(BuildContext context, TapDownDetails details) {
// final RenderBox box = context.findRenderObject();
// final Offset localOffset = box.globalToLocal(details.globalPosition);
// final RenderBox containerBox = key.currentContext.findRenderObject();
// final Offset containerOffset = containerBox.localToGlobal(localOffset);
// final onTap = containerBox.paintBounds.contains(containerOffset);
// if (onTap) {
// _seePhoto();
// }
// }
// _seePhoto() {
// // List<String> temp = [];
// if (_baseIndoProvider.photoList.length > 0) {
// // for (int i = 0; i < _baseIndoProvider.photoList.length; i++) {
// // temp.add(_baseIndoProvider.photoList[i].image);
// // }
// ///没有上传完成的不可以点击
// _showPhotoView(context, 0, _baseIndoProvider.photoList);
// }
// }
// ///获取截图
// Future<Uint8List> _getImage() async {
// BuildContext buildContext = globalKey.currentContext;
// if (null != buildContext) {
// RenderRepaintBoundary boundary = buildContext.findRenderObject();
// ui.Image image = await boundary.toImage(pixelRatio: 6);
// ByteData byteData = await image.toByteData(format: ImageByteFormat.png);
// Uint8List pngBytes = byteData.buffer.asUint8List();
// return pngBytes;
// }
// }
// //发送短信
// _sendSms() async {
// UserModel userModel = Provider.of<UserModel>(context, listen: false);
// Map<String, String> params = {
// "rid": widget.rid,
// "sid": userModel.user.sellerid
// };
// await couponProvider.sendSms(context, params);
// }
// // 客户经理转发记录
// _addForward() async {
// UserModel userModel = Provider.of<UserModel>(context, listen: false);
// Map<String, String> params = {
// "rid": widget.rid,
// "sid": userModel.user.sellerid,
// "uid": userModel.user.openid
// };
// bool success = await couponProvider.addForwardAsReserve(context, params);
// if (success) {
// print('yes');
// }
// }
// @override
// Widget build(BuildContext context) {
// // Utils.changeStatusColor(color: Colors.transparent);
// // TODO: implement build
// _baseIndoProvider = Provider.of<BaseIndoProvider>(context, listen: true);
// couponProvider = Provider.of<CouponProvider>(context, listen: true);
// return SafeArea(
// child: Scaffold(
// backgroundColor: Colors.white,
// appBar: SystemAppBar('', onTap: () {
// Navigator.pop(context);
// }),
// body: Stack(
// children: [
// Column(children: [
// Expanded(
// child: ListView(
// controller: controller,
// physics: BouncingScrollPhysics(),
// children: <Widget>[
// Center(
// child: Column(
// children: <Widget>[
// VEmptyView(20),
// Image.asset(
// "assets/yd_logo.png",
// width: ScreenUtil().setWidth(233 * 2),
// height: ScreenUtil().setHeight(51 * 2),
// ),
// VEmptyView(26),
// Container(
// margin: EdgeInsets.symmetric(
// horizontal: ScreenUtil().setWidth(40)),
// // padding: EdgeInsets.all(
// // ScreenUtil().setWidth(60)),
// // decoration: BoxDecoration(
// // gradient: LinearGradient(
// // begin: Alignment.topCenter,
// // end: Alignment.bottomCenter,
// // colors: [
// // MyColours.color_F7F1E8,
// // MyColours.color_E3D6C7,
// // ],
// // ),
// // borderRadius: BorderRadius.circular(
// // ScreenUtil().setWidth(10))),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// Container(
// // color: Colors.red,
// width: ScreenUtil().setWidth(335 * 2),
// height: ScreenUtil().setWidth(200 * 2),
// // decoration: BoxDecoration(
// // image: DecorationImage(
// // alignment:
// // Alignment.topCenter,
// // image: AssetImage(
// // "assets/yd_baiinfo_bg.png"),
// // fit: BoxFit.cover),
// // ),
// child: Row(
// crossAxisAlignment:
// CrossAxisAlignment.start,
// children: [
// Padding(
// padding: EdgeInsets.only(
// left: ScreenUtil()
// .setWidth(70)),
// child: Stack(
// alignment:
// Alignment.bottomCenter,
// children: [
// Image.network(
// qiniuUrl == ''
// ? 'http://nosqn.colorcun.com/yd_person.png'
// : qiniuUrl,
// // 'http://nosqn.colorcun.com/yd_person.png',
// width: ScreenUtil()
// .setWidth(143 * 2),
// height: ScreenUtil()
// .setWidth(190 * 2)),
// couponProvider.coupons
// .length ==
// 0
// ? Align(
// alignment: Alignment
// .bottomCenter,
// child: RoundButton(
// width: ScreenUtil()
// .setWidth(
// 86 * 2),
// height:
// ScreenUtil()
// .setWidth(
// 30 *
// 2),
// radius:
// ScreenUtil()
// .setWidth(
// 30),
// space:
// ScreenUtil()
// .setWidth(
// 20),
// text: '添加优惠',
// textColor: MyColours
// .color_ffffff,
// isBold: false,
// fontSize: 28,
// gradientStart:
// MyColours
// .color_199095,
// gradientEnd: MyColours
// .color_199095,
// onPressed: () {
// NavigatorUtil
// .goCouponPage(
// context,
// needRefrsh:
// true);
// },
// ),
// )
// : Container()
// ],
// )),
// HEmptyView(10),
// Spacer(),
// Container(
// padding: EdgeInsets.only(
// top: ScreenUtil()
// .setWidth(37 * 2)),
// // height: ScreenUtil()
// // .setWidth(200 * 2),
// child: Column(
// mainAxisAlignment:
// MainAxisAlignment.start,
// crossAxisAlignment:
// CrossAxisAlignment.end,
// children: [
// // VEmptyView(60),
// GestureDetector(
// behavior: HitTestBehavior
// .opaque,
// onTap: () {
// _goBaseInfoPage();
// },
// child: Container(
// width: ScreenUtil()
// .setWidth(120 * 2),
// height: ScreenUtil()
// .setWidth(42 * 2),
// child: Text(
// name,
// overflow: TextOverflow
// .ellipsis,
// textAlign:
// TextAlign.right,
// style: TextStyle(
// color: MyColours
// .color_333333,
// fontSize:
// ScreenUtil()
// .setSp(
// 60)),
// ),
// ),
// ),
// // VEmptyView(6),
// InkWell(
// onTap: () {
// _goBaseInfoPage();
// },
// child: Container(
// width: ScreenUtil()
// .setWidth(
// 120 * 2),
// height: ScreenUtil()
// .setWidth(22 * 2),
// child: Text(
// phone,
// overflow:
// TextOverflow
// .ellipsis,
// textAlign:
// TextAlign.right,
// style: TextStyle(
// color: phone ==
// '填写电话'
// ? MyColours
// .color_999999
// : MyColours
// .color_333333,
// fontSize:
// ScreenUtil()
// .setSp(
// 32)),
// ),
// )),
// // VEmptyView(6),
// InkWell(
// onTap: () {
// _goBaseInfoPage();
// },
// child: Container(
// width: ScreenUtil()
// .setWidth(
// 120 * 2),
// height: ScreenUtil()
// .setWidth(24 * 2),
// child: Text(
// position,
// overflow:
// TextOverflow
// .ellipsis,
// textAlign:
// TextAlign.right,
// style: TextStyle(
// color: MyColours
// .color_333333,
// fontSize:
// ScreenUtil()
// .setSp(
// 34)),
// ),
// )),
// RoundButton(
// // width: ScreenUtil().setWidth(95),
// height: ScreenUtil()
// .setWidth(60 * 2),
// image: Utils.getImgPath(
// 'yd_bianji'),
// imgWidth: 24,
// radius: 0,
// space: ScreenUtil()
// .setWidth(20),
// text: '编辑',
// textColor: MyColours
// .color_199095,
// isBold: false,
// fontSize: 28,
// gradientStart:
// Colors.transparent,
// gradientEnd:
// Colors.transparent,
// onPressed: () {
// _goBaseInfoPage();
// },
// )
// ],
// )),
// HEmptyView(60),
// ],
// )),
// // Positioned(
// // bottom: 0,
// // child: Container(
// // color: MyColours.color_EEDBC4,
// // width: double.infinity,
// // height:
// // ScreenUtil().setWidth(40),
// // ))
// // ],
// // ),
// // Container(
// // color: MyColours.color_EEDBC4,
// // width: double.infinity,
// // height: ScreenUtil().setWidth(40),
// // ),
// VEmptyView(76),
// // Image.asset(
// // "assets/yd_up.png",
// // width: ScreenUtil().setWidth(195 * 2),
// // height:
// // ScreenUtil().setHeight(33 * 2),
// // ),
// // VEmptyView(50),
// RepaintBoundary(
// key: globalKey,
// child: Container(
// padding: EdgeInsets.fromLTRB(
// ScreenUtil().setWidth(10),
// ScreenUtil().setWidth(10),
// ScreenUtil().setWidth(10),
// ScreenUtil().setWidth(40)),
// // color: Colors.red,
// child: Column(
// children: [
// Container(
// height: ScreenUtil().setWidth(58),
// child: Text(
// user.sellername,
// style: TextStyle(
// // letterSpacing: ScreenUtil()
// // .setWidth(2.13 * 2),
// color:
// MyColours.color_333333,
// // fontWeight: FontWeight.bold,
// fontSize:
// ScreenUtil().setSp(42)),
// ),
// ),
// VEmptyView(14),
// Container(
// height: ScreenUtil().setWidth(58),
// child: Text(
// '${dateTimeStr}',
// style: TextStyle(
// letterSpacing: ScreenUtil()
// .setWidth(1.8 * 2),
// color:
// MyColours.color_333333,
// fontSize:
// ScreenUtil().setSp(42)),
// ),
// ),
// VEmptyView(26),
// Container(
// height: ScreenUtil().setWidth(44),
// child: Text(
// '已为您安排在包间',
// style: TextStyle(
// color:
// MyColours.color_666666,
// fontSize:
// ScreenUtil().setSp(32)),
// ),
// ),
// VEmptyView(28),
// GestureDetector(
// onTapDown: (TapDownDetails
// details) =>
// onTapDown(context, details),
// child: Container(
// child: Stack(
// alignment:
// Alignment.bottomCenter,
// overflow: Overflow.visible,
// children: [
// Container(
// margin: EdgeInsets.only(
// bottom: ScreenUtil()
// .setWidth(24)),
// constraints: BoxConstraints(
// maxWidth: ScreenUtil()
// .setWidth(
// 195 * 2)),
// padding:
// EdgeInsets.fromLTRB(
// ScreenUtil()
// .setWidth(60),
// ScreenUtil()
// .setWidth(30),
// ScreenUtil()
// .setWidth(60),
// ScreenUtil()
// .setWidth(
// 24 * 2)),
// decoration: BoxDecoration(
// borderRadius: BorderRadius.all(
// Radius.circular(
// ScreenUtil()
// .setWidth(
// 13 *
// 2))),
// border: Border.all(
// color: MyColours
// .color_199095,
// width:
// ScreenUtil()
// .setWidth(
// 4))),
// child: Text(
// widget.tableInfo
// .replaceAll(
// "\n", ""),
// style: TextStyle(
// // letterSpacing: ScreenUtil()
// // .setWidth(2.13 * 2),
// color: MyColours
// .color_333333,
// fontWeight:
// FontWeight.bold,
// fontSize:
// ScreenUtil()
// .setSp(52)),
// ),
// ),
// Positioned(
// key: key,
// bottom: 0,
// child: RoundButton(
// onPressed: () {
// _seePhoto();
// },
// text: '浏览照片',
// width: ScreenUtil()
// .setWidth(68 * 2),
// height: ScreenUtil()
// .setWidth(24 * 2),
// fontSize: 26,
// textColor: _baseIndoProvider
// .photoList
// .length >
// 0
// ? MyColours
// .color_ffffff
// : MyColours
// .color_999999,
// isBold: false,
// gradientStart: _baseIndoProvider
// .photoList
// .length >
// 0
// ? MyColours
// .color_199095
// : MyColours
// .color_E0E0E0,
// gradientEnd: _baseIndoProvider
// .photoList
// .length >
// 0
// ? MyColours
// .color_199095
// : MyColours
// .color_E0E0E0,
// ))
// ],
// ))),
// ],
// ),
// ),
// ),
// VEmptyView(30),
// Container(
// // height: ScreenUtil().setWidth(40),
// child: Text(
// '${user.sellerAddr}',
// maxLines: 3,
// overflow: TextOverflow.ellipsis,
// textAlign: TextAlign.center,
// style: TextStyle(
// color: MyColours.color_333333,
// fontSize: ScreenUtil().setSp(28)),
// ),
// ),
// // VEmptyView(20),
// // RoundButton(
// // text: '一键导航',
// // width: ScreenUtil().setWidth(68 * 2),
// // height: ScreenUtil().setWidth(24 * 2),
// // fontSize: 24,
// // textColor: MyColours.color_794F28,
// // isBold: false,
// // gradientStart:
// // Color.fromRGBO(121, 79, 40, 0.1),
// // gradientEnd:
// // Color.fromRGBO(121, 79, 40, 0.1),
// // ),
// // VEmptyView(50),
// // Image.asset(
// // "assets/yd_down.png",
// // width: ScreenUtil().setWidth(195 * 2),
// // height:
// // ScreenUtil().setHeight(33 * 2),
// // ),
// // VEmptyView(60),
// ],
// ),
// )
// ],
// ),
// ),
// VEmptyView(couponHeight),
// ])),
// Padding(
// padding: EdgeInsets.fromLTRB(
// ScreenUtil().setWidth(70),
// ScreenUtil().setWidth(20),
// ScreenUtil().setWidth(70),
// ScreenUtil().setWidth(40)),
// child: Column(children: [
// RoundButton(
// text: '微信通知',
// width: double.infinity,
// height: ScreenUtil().setWidth(84),
// gradientStart: MyColours.color_199095,
// gradientEnd: MyColours.color_199095,
// textColor: MyColours.color_ffffff,
// fontSize: 34,
// radius: ScreenUtil().setWidth(10),
// isBold: false,
// onPressed: () async {
// // Uint8List image = await _getImage();
// print(widget.rid);
// print(Provider.of<UserModel>(context, listen: false)
// .user
// .openid);
// // if (ObjectUtil.isEmpty(
// // _baseIndoProvider.baseInfoSunModel)) {
// // Utils.showToast('请输入个人资料');
// // return;
// // }
// // if (ObjectUtil.isEmpty(
// // _baseIndoProvider.baseInfoSunModel.name)) {
// // Utils.showToast('请填写您的姓名');
// // return;
// // }
// if (ObjectUtil.isEmpty(
// _baseIndoProvider.baseInfoSunModel) ||
// ObjectUtil.isEmpty(
// _baseIndoProvider.baseInfoSunModel.phone)) {
// Utils.showToast('请填写您的联系电话');
// return;
// }
// // if (ObjectUtil.isEmpty(
// // _baseIndoProvider.baseInfoSunModel.position)) {
// // Utils.showToast('请填写您在餐厅中的职位');
// // return;
// // }
// // if (ObjectUtil.isEmpty(
// // _baseIndoProvider.baseInfoSunModel.phone)) {
// // Utils.showToast('请上传您的头像');
// // return;
// // }
// // if (ObjectUtil.isEmpty(
// // _baseIndoProvider.baseInfoSunModel.qrcode)) {
// // Utils.showToast('请上传您的微信二维码');
// // return;
// // }
// if (!couponProvider.hasModify &&
// couponProvider.coupons.length > 0) {
// Map<String, String> params = {
// "rid": widget.rid,
// "aid": Utils.listToStringEnglish(
// couponProvider.coupons)
// };
// bool isSuc = await couponProvider
// .setActivityAsReserve(context, params);
// if (isSuc) {
// couponProvider.hasModify = true;
// bool isSuccess =
// await Utils.goShareInvicationToWeChat(
// widget.rid,
// Provider.of<UserModel>(context,
// listen: false)
// .user
// .openid);
// print(isSuccess);
// if (isSuccess) {
// _addForward();
// }
// // couponProvider.couponsShow = [];
// // couponProvider.couponsShow
// // .addAll(couponProvider.coupons);
// // couponProvider.coupons = [];
// // couponProvider.notifyListeners();
// }
// } else {
// bool isSuccess =
// await Utils.goShareInvicationToWeChat(
// widget.rid,
// Provider.of<UserModel>(context,
// listen: false)
// .user
// .openid);
// if (isSuccess) {
// _addForward();
// }
// }
// },
// ),
// VEmptyView(20),
// Stack(children: [
// Container(
// margin: EdgeInsets.only(
// top: ScreenUtil().setWidth(10),
// right: ScreenUtil().setWidth(6)),
// child: RoundButton(
// text: '发短信',
// width: double.infinity,
// height: ScreenUtil().setWidth(84),
// gradientStart: MyColours.color_ffffff,
// gradientEnd: MyColours.color_ffffff,
// textColor: MyColours.color_199095,
// borderColor: MyColours.color_199095,
// fontSize: 34,
// radius: ScreenUtil().setWidth(10),
// isBold: false,
// onPressed: () async {
// if (reserverPhone == null ||
// reserverPhone.isEmpty) {
// //跳转到录入联系人页面
// String temp =
// await NavigatorUtil.goEditReserverPage(
// context,
// widget.rid,
// widget.name,
// widget.sex,
// needBtn: true);
// if (temp != null) {
// reserverPhone = temp;
// }
// } else if (!Utils.phoneRegExp(
// reserverPhone)) {
// Utils.showToast('手机号错误,请修改正确');
// //跳转到录入联系人页面
// String temp =
// await NavigatorUtil.goEditReserverPage(
// context,
// widget.rid,
// widget.name,
// widget.sex,
// needBtn: true);
// if (temp != null) {
// reserverPhone = temp;
// }
// } else {
// if (!couponProvider.sendSMS) {
// /*
// String dateSoltStr = '';
// if (widget.dateSolt == '1') {
// dateSoltStr = '早餐';
// } else if (widget.dateSolt == '2') {
// dateSoltStr = '午餐';
// } else if (widget.dateSolt == '3') {
// dateSoltStr = '晚餐';
// }
// DateTime dateTimeTemp =
// DateTime.fromMillisecondsSinceEpoch(
// int.parse(widget.ddate) * 1000);
// String dateTimeStrTemp =
// "${Utils.addZeroNumber(dateTimeTemp.month)}月${Utils.addZeroNumber(dateTimeTemp.day)}日";
// Map<String, String> params = {
// "id": widget.rid,
// "uid": Provider.of<UserModel>(context,
// listen: false)
// .user
// .openid,
// "phone": widget.phone,
// // "Strtext": user.sellername +
// // dateTimeStrTemp +
// // dateSoltStr +
// // ',' +
// // '餐厅经理' +
// // _baseIndoProvider.baseInfoSunModel.name +
// // '已为您安排在' +
// // widget.tableInfo.replaceAll("\n", "")
// };
// if (ObjectUtil.isNotEmpty(_baseIndoProvider
// .baseInfoSunModel) &&
// ObjectUtil.isNotEmpty(_baseIndoProvider
// .baseInfoSunModel.name)) {
// params['Strtext'] = user.sellername +
// _baseIndoProvider
// .baseInfoSunModel.name;
// } else {
// params['Strtext'] = user.sellername;
// }
// */
// UserModel userModel =
// Provider.of<UserModel>(context,
// listen: false);
// Map<String, String> params = {
// "rid": widget.rid,
// "sid": userModel.user.sellerid
// };
// bool success = await couponProvider
// .sendSMSWxSendSms(context, params);
// print(success);
// // if (success) {
// // Utils.showToast('短信已经发送成功!');
// // } else {
// // Utils.showToast('发送次数太频繁!');
// // }
// } else {
// Utils.showToast('短信已经发送成功!');
// }
// }
// // _sendSms();
// // NavigatorUtil.goSmsPage(context, widget.rid);
// },
// )),
// Positioned(
// top: 0,
// right: 0,
// child: Container(
// // padding: EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(16),vertical: ScreenUtil().setWidth(4)),
// padding: EdgeInsets.only(
// bottom: ScreenUtil().setWidth(6)),
// alignment: Alignment.center,
// width: ScreenUtil().setWidth(62 * 2),
// height: ScreenUtil().setWidth(42),
// decoration: BoxDecoration(
// // color: Colors.red,
// image: DecorationImage(
// image: ExactAssetImage(
// Utils.getImgPath('sms_bg'),
// ),
// fit: BoxFit.cover,
// ),
// ),
// child: Text(
// '免费短信',
// style: TextStyle(
// color: MyColours.color_fefefe,
// fontSize: ScreenUtil().setSp(24)),
// )),
// )
// ])
// ])),
// ]),
// Positioned(
// // left: ScreenUtil().setWidth(180),
// bottom: ScreenUtil().setWidth(124 * 2),
// right: ScreenUtil().setWidth(52 * 2),
// child: couponProvider.hasModify ||
// couponProvider.coupons.length > 0 ||
// couponProvider.couponListSelect.length > 0
// ? GestureDetector(
// onTap: () async {
// NavigatorUtil.goCouponSelectPage(context,
// from: 'other',
// hasModify: couponProvider.hasModify);
// },
// behavior: HitTestBehavior.opaque,
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// Container(
// padding: EdgeInsets.symmetric(
// horizontal: ScreenUtil().setWidth(40),
// vertical: ScreenUtil().setWidth(16)),
// height: ScreenUtil().setWidth(35 * 2),
// decoration: BoxDecoration(
// color: Color.fromRGBO(0, 0, 0, 0.5),
// borderRadius: BorderRadius.circular(
// ScreenUtil().setWidth(20))),
// child: Row(
// children: [
// Text(
// '并赠送给顾客${couponProvider.coupons.length}张优惠券',
// textAlign: TextAlign.center,
// style: TextStyle(
// color: MyColours.color_f5f5f5,
// fontWeight: FontWeight.bold,
// fontSize: ScreenUtil().setSp(28),
// ),
// ),
// HEmptyView(40),
// RoundButton(
// width: ScreenUtil().setWidth(124),
// height: ScreenUtil().setWidth(46),
// text: '点击查看',
// textColor: MyColours.color_FDA31D,
// fontSize: 24,
// isBold: true,
// radius: ScreenUtil().setWidth(10),
// gradientStart: MyColours.color_f5f5f5,
// gradientEnd: MyColours.color_f5f5f5,
// onPressed: () async {
// NavigatorUtil.goCouponSelectPage(
// context,
// from: 'other',
// hasModify:
// couponProvider.hasModify);
// },
// )
// ],
// )),
// Image.asset(Utils.getImgPath('jian'),
// width: ScreenUtil().setWidth(28),
// height: ScreenUtil().setWidth(20))
// ],
// ))
// : Container(),
// )
// ],
// )));
// }
// }
... ...
... ... @@ -23,6 +23,31 @@ class NoteBookItem extends StatefulWidget {
class NotebookItemState extends State<NoteBookItem> {
_onOperateClick() {
if (widget.notebook.operationText == "通知客户") {
// String _nameStr = '';
// String _tid = '';
// for (int i = 0;
// i <
// detailEntity
// .tables.length;
// i++) {
// _nameStr +=
// '${detailEntity.tables[i].name},';
// _tid +=
// '${detailEntity.tables[i].id},';
// }
// if (_tid.endsWith(',')) {
// _tid = _tid.substring(
// 0, _tid.length - 1);
// }
// if (_nameStr
// .endsWith(',')) {
// _nameStr =
// _nameStr.substring(
// 0,
// _nameStr.length -
// 1);
// }
NavigatorUtil.goInvicationPage(
context,
widget.notebook.id,
... ...
... ... @@ -250,7 +250,7 @@ class TableManagerPageState extends State<TableManagerPage> {
shouldRebuild: (pre, next) => true,
selector: (context, model) => data[index],
builder: (context, table, _) {
return FTableItem(table,canSelected: true, onSelected: (table) {
return FTableItem(table, canSelected: true, onSelected: (table) {
if (table.signStr == '已预订') {
//进入订座详情页面
NavigatorUtil.goNotebookDetailPage(
... ... @@ -645,20 +645,34 @@ class TableManagerPageState extends State<TableManagerPage> {
convert.jsonDecode(_model.row.tableinfo);
print(tableinfo);
String _nameStr =
table.TableList.fromJson(tableinfo[0]).name;
if (tableinfo.length > 1) {
_nameStr = table.TableList.fromJson(tableinfo[0]).name +
'等${tableinfo.length}桌';
}
LogUtil.v(_nameStr);
// String _nameStr =
// table.TableList.fromJson(tableinfo[0]).name;
// if (tableinfo.length > 1) {
// _nameStr = table.TableList.fromJson(tableinfo[0]).name +
// '等${tableinfo.length}桌';
// }
// LogUtil.v(_nameStr);
// String _tid = '';
// for (int i = 0; i < tableinfo.length; i++) {
// _tid += '${table.TableList.fromJson(tableinfo[i]).id},';
// }
// if (_tid.endsWith(',')) {
// _tid = _tid.substring(0, _tid.length - 1);
// }
String _nameStr = '';
String _tid = '';
for (int i = 0; i < tableinfo.length; i++) {
_nameStr +=
'${table.TableList.fromJson(tableinfo[i]).name},';
_tid += '${table.TableList.fromJson(tableinfo[i]).id},';
}
if (_tid.endsWith(',')) {
_tid = _tid.substring(0, _tid.length - 1);
}
if (_nameStr.endsWith(',')) {
_nameStr = _nameStr.substring(0, _nameStr.length - 1);
}
NavigatorUtil.goInvicationPage(
context,
_model.row.id,
... ...
... ... @@ -4,6 +4,7 @@ import 'package:one_key/constant/error.dart';
import 'package:one_key/models/base_info_model.dart';
import 'package:one_key/models/seller_phone_model.dart';
import 'package:one_key/models/table_photo_model.dart';
import 'package:one_key/models/user_history_entity.dart';
import 'package:one_key/net/base_resp.dart';
import 'package:one_key/net/dio_util.dart';
import 'package:one_key/net/http_url.dart';
... ... @@ -15,6 +16,55 @@ class BaseIndoProvider with ChangeNotifier {
BaseInfoSunModel baseInfoSunModel; //客户经理基础信息
List<String> photoList = []; //商家图片信息
TextEditingController phoneController = TextEditingController();
TextEditingController nameController = TextEditingController();
List sexList;
List<UserHistoryEntity> userHistorys = []; //历史录入
BaseIndoProvider() {
initSexList();
}
///称谓
initSexList() {
String sexStr = '1';
sexList = [
{
'title': '先生',
'select': sexStr == '1' ? true : false,
'code': '1',
'hasLeftBorder': true
},
{
'title': '女士',
'select': sexStr == '2' ? true : false,
'code': '2',
'hasLeftBorder': false
},
{
'title': '公司',
'select': sexStr == '3' ? true : false,
'code': '3',
'hasLeftBorder': false
}
];
}
//获取历史录入
getUserHistorys(BuildContext context, Map<String, String> params) async {
BaseResp<List> baseResp = await DioUtil()
.request<List>(context, Method.get, HttpUrl.get_reserve_user,
data: params, showLoading: false)
.catchError((error) {
print(error.toString());
});
if (baseResp != null && baseResp.code == Constant.status_success) {
userHistorys = baseResp.data.map<UserHistoryEntity>((value) {
return UserHistoryEntity.fromJson(value);
}).toList();
notifyListeners();
}
}
///客户经理添加/修改基本信息
Future<dynamic> setCustomerActivityBaseinfo(
BuildContext context, Map<String, String> params,
... ... @@ -116,7 +166,7 @@ class BaseIndoProvider with ChangeNotifier {
// }
// }
///App获取多个桌位关联图片
///App获取多个桌位关联图片
Future<dynamic> getTablesPhoto(
BuildContext context, Map<String, String> params,
{isShowLoading = true}) async {
... ...
... ... @@ -250,6 +250,73 @@ class CouponProvider with ChangeNotifier {
return couponListHistory;
}
///客户经理获取所创建活动列表(选择优惠券)
Future<List<CouponSunModel>> getCustomerSelectActivityNew(
BuildContext context, Map<String, String> params,
{isShowLoading = true}) async {
if (isShowLoading) {
pageStateSelect = PageState.Loading;
notifyListeners();
}
BaseResp<dynamic> baseResp = await DioUtil()
.request<dynamic>(context, Method.get, HttpUrl.get_customer_activity,
data: params, showLoading: false)
.catchError((error) {
print(error.toString());
if (error is MyError) {
switch (error.type) {
case 1:
pageStateSelect = PageState.ConnectivityError;
break;
case 2:
pageStateSelect = PageState.ConnectivityTimeOut;
break;
default:
pageStateSelect = PageState.ConnectivityError;
break;
}
}
notifyListeners();
});
if (baseResp.code == Constant.status_success) {
if (baseResp.data.isEmpty) {
pageStateSelect = PageState.Empty;
} else {
pageStateSelect = PageState.Success;
}
couponListSelect = CouponModel.fromJson(baseResp.responseData).data;
if (hasModify) {
//已经绑定
List<CouponSunModel> temp = [];
for (int i = 0; i < couponListSelect.length; i++) {
for (int j = 0; j < coupons.length; j++) {
if (couponListSelect[i].id == coupons[j]) {
temp.add(couponListSelect[i]);
}
}
}
couponListSelect = temp;
} else {
for (int i = 0; i < couponListSelect.length; i++) {
for (int j = 0; j < coupons.length; j++) {
if (couponListSelect[i].id == coupons[j]) {
couponListSelect[i].isCheck = true;
}
}
}
}
getCheckValue();
notifyListeners();
} else {
pageStateSelect = PageState.ConnectivityError;
if (baseResp != null) {
Utils.showToast(baseResp.msg ?? "");
}
}
return couponListSelect;
}
///客户经理获取所创建活动列表(选择优惠券)
Future<List<CouponSunModel>> getCustomerSelectActivity(
BuildContext context, Map<String, String> params,
... ...
... ... @@ -162,14 +162,18 @@ class NavigatorUtil {
/// 变更预订——方硕新修改页面
static void goNoteBookChangeFPage(
BuildContext context, NotebookDetail detailEntity, String rid,
{replace = false}) {
BuildContext context,
NotebookDetail detailEntity,
String rid, {
replace = false,
bool back = false,
}) {
if (detailEntity.type == "0") {
//内部预订
detailEntity.is_set_ddate = "1";
}
_navigateTo(context,
"${Routes.change_detail_f}?detail=${FluroConvertUtils.object2string(detailEntity)}&rid=$rid",
"${Routes.change_detail_f}?detail=${FluroConvertUtils.object2string(detailEntity)}&rid=$rid&back=${back}",
replace: replace);
}
... ...
... ... @@ -322,11 +322,16 @@ var noteBookChangeFPageHandle = new Handler(
NotebookDetail detailEntity = NotebookDetail.fromJson(json
.decode(FluroConvertUtils.fluroCnParamsDecode(params["detail"].first)));
String rid = params['rid'].first;
bool back = FluroConvertUtils.string2bool(params["back"].first);
return ChangeNotifierProvider<NotebookDetailChangeModel>(
create: (_) => NotebookDetailChangeModel(detailEntity),
child: ChangeNotifierProvider<RemarkManagerModel>(
create: (_) => RemarkManagerModel(),
child: NoteBookChangeFPage(detailEntity: detailEntity, rid: rid)));
child: NoteBookChangeFPage(
detailEntity: detailEntity,
rid: rid,
back: back,
)));
});
// 跳转可订时段管理页面
... ...