Commit 2dac9af2b0b2d768ae5e5fd4419d87c81d68917c

Authored by wdn127929
1 parent 1ee103c3

预订安排---会员优惠---分享

... ... @@ -47,7 +47,7 @@ class RechargeListSunModel {
String explain;
String isOpen;
String status;
// Null qrcode;
String qrcode;
String isExamine;
String cdate;
bool isCheck = false;
... ... @@ -72,7 +72,7 @@ class RechargeListSunModel {
this.explain,
this.isOpen,
this.status,
// this.qrcode,
this.qrcode,
this.isExamine,
this.cdate});
... ... @@ -98,7 +98,7 @@ class RechargeListSunModel {
explain = json['explain'];
isOpen = json['is_open'];
status = json['status'];
// qrcode = json['qrcode'];
qrcode = json['qrcode'];
isExamine = json['is_examine'];
cdate = json['cdate'];
}
... ... @@ -115,7 +115,7 @@ class RechargeListSunModel {
data['explain'] = this.explain;
data['is_open'] = this.isOpen;
data['status'] = this.status;
// data['qrcode'] = this.qrcode;
data['qrcode'] = this.qrcode;
data['is_examine'] = this.isExamine;
data['cdate'] = this.cdate;
return data;
... ...
... ... @@ -164,10 +164,10 @@ class _CouponPageState extends State<CouponPage> with TickerProviderStateMixin {
Navigator.of(context).pop();
},
// rightImgName: 'scan.png',
// onTapRight: () {
// _scan();
// },
rightImgName: 'scan.png',
onTapRight: () {
_scan();
},
),
body: WillPopScope(
onWillPop: () {
... ...
import 'package:cached_network_image/cached_network_image.dart';
import 'package:common_utils/common_utils.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
... ... @@ -43,10 +44,40 @@ class _RechargeItemState extends State<RechargeItem> {
Widget build(BuildContext context) {
// CouponSunModel sunModel = widget.couponSonModel;
bool notSelect = true;
BoxDecoration decoration;
if (widget.from == 'history') {
notSelect = false;
} else {
// notSelect = sunModel.isOpenBool;
}
if (widget.from == 'menu' || widget.from == 'menu-show') {
decoration = BoxDecoration(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(ScreenUtil().setWidth(16)),
topRight: Radius.circular(ScreenUtil().setWidth(16))),
gradient: LinearGradient(stops: [
-0.5747,
0.5572,
1.4872
], colors: [
MyColours.color_4C8DAD,
MyColours.color_0143A3,
MyColours.color_42A5FF
], begin: Alignment.topLeft, end: Alignment.bottomRight),
);
} else {
decoration = BoxDecoration(
color: widget.from == 'history'
? MyColours.color_BFC4D4
: notSelect
? widget.rechargeListSunModel.isOpen == '1'
? MyColours.color_438E93
: MyColours.color_999999
: MyColours.color_999999,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(ScreenUtil().setWidth(16)),
topRight: Radius.circular(ScreenUtil().setWidth(16))));
}
// double explainH = 0.0;
... ... @@ -97,20 +128,7 @@ class _RechargeItemState extends State<RechargeItem> {
height: ScreenUtil().setWidth(60),
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(40)),
decoration: BoxDecoration(
color: widget.from == 'history'
? MyColours.color_BFC4D4
: notSelect
? widget.rechargeListSunModel.isOpen ==
'1'
? MyColours.color_438E93
: MyColours.color_999999
: MyColours.color_999999,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(
ScreenUtil().setWidth(16)),
topRight: Radius.circular(
ScreenUtil().setWidth(16)))),
decoration: decoration,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
... ... @@ -137,58 +155,142 @@ class _RechargeItemState extends State<RechargeItem> {
ScreenUtil().setWidth(26),
ScreenUtil().setWidth(40),
ScreenUtil().setWidth(26)),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (widget.rechargeListSunModel.rechargeList
.isPrice ==
'1')
Container(
// height: ScreenUtil().setWidth(14 * 2),
// width: ScreenUtil().setWidth(232 * 2),
margin: EdgeInsets.only(bottom: w(5)),
child: Text(
'会员充值满${widget.rechargeListSunModel.rechargeMoney}元赠余额${widget.rechargeListSunModel.rechargeList.price}元;',
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: MyColours.color_999999,
fontSize: ScreenUtil().setSp(20),
)),
child: widget.from == 'menu-show'
? Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
if (widget.rechargeListSunModel
.rechargeList.isPrice ==
'1')
Container(
// height: ScreenUtil().setWidth(14 * 2),
// width: ScreenUtil().setWidth(232 * 2),
margin:
EdgeInsets.only(bottom: w(5)),
child: Text(
'会员充值满${widget.rechargeListSunModel.rechargeMoney}元赠余额${widget.rechargeListSunModel.rechargeList.price}元;',
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: MyColours.color_999999,
fontSize:
ScreenUtil().setSp(20),
)),
),
if (widget.rechargeListSunModel
.rechargeList.isScore ==
'1')
Container(
// height: ScreenUtil().setWidth(14 * 2),
// width: ScreenUtil().setWidth(232 * 2),
margin:
EdgeInsets.only(bottom: w(5)),
child: Text(
'会员充值满${widget.rechargeListSunModel.rechargeMoney}元赠送${widget.rechargeListSunModel.rechargeList.score}积分;',
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: MyColours.color_999999,
fontSize:
ScreenUtil().setSp(20),
)),
),
if (widget.rechargeListSunModel
.rechargeList.isCoupons ==
'1')
Container(
// height: ScreenUtil().setWidth(14 * 2),
// width: ScreenUtil().setWidth(232 * 2),
child: Text(
'会员充值满${widget.rechargeListSunModel.rechargeMoney}元赠送${Utils.listToStringEnglish3(widget.rechargeListSunModel.rechargeList.couponsNames)}。',
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: MyColours.color_999999,
fontSize:
ScreenUtil().setSp(20),
)),
),
],
),
if (widget.rechargeListSunModel.qrcode !=
null)
Column(
children: [
CachedNetworkImage(
imageUrl: widget
.rechargeListSunModel.qrcode,
width: w(60),
fit: BoxFit.cover,
),
VEmptyView(10),
Text(
'长按识别二维码前往充值',
style: TextStyle(
fontSize: font(10),
color: MyColours.color_999999),
)
],
)
],
)
: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (widget.rechargeListSunModel.rechargeList
.isPrice ==
'1')
Container(
// height: ScreenUtil().setWidth(14 * 2),
// width: ScreenUtil().setWidth(232 * 2),
margin: EdgeInsets.only(bottom: w(5)),
child: Text(
'会员充值满${widget.rechargeListSunModel.rechargeMoney}元赠余额${widget.rechargeListSunModel.rechargeList.price}元;',
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: MyColours.color_999999,
fontSize: ScreenUtil().setSp(20),
)),
),
if (widget.rechargeListSunModel.rechargeList
.isScore ==
'1')
Container(
// height: ScreenUtil().setWidth(14 * 2),
// width: ScreenUtil().setWidth(232 * 2),
margin: EdgeInsets.only(bottom: w(5)),
child: Text(
'会员充值满${widget.rechargeListSunModel.rechargeMoney}元赠送${widget.rechargeListSunModel.rechargeList.score}积分;',
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: MyColours.color_999999,
fontSize: ScreenUtil().setSp(20),
)),
),
if (widget.rechargeListSunModel.rechargeList
.isCoupons ==
'1')
Container(
// height: ScreenUtil().setWidth(14 * 2),
// width: ScreenUtil().setWidth(232 * 2),
child: Text(
'会员充值满${widget.rechargeListSunModel.rechargeMoney}元赠送${Utils.listToStringEnglish3(widget.rechargeListSunModel.rechargeList.couponsNames)}。',
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: MyColours.color_999999,
fontSize: ScreenUtil().setSp(20),
)),
),
],
),
if (widget.rechargeListSunModel.rechargeList
.isScore ==
'1')
Container(
// height: ScreenUtil().setWidth(14 * 2),
// width: ScreenUtil().setWidth(232 * 2),
margin: EdgeInsets.only(bottom: w(5)),
child: Text(
'会员充值满${widget.rechargeListSunModel.rechargeMoney}元赠送${widget.rechargeListSunModel.rechargeList.score}积分;',
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: MyColours.color_999999,
fontSize: ScreenUtil().setSp(20),
)),
),
if (widget.rechargeListSunModel.rechargeList
.isCoupons ==
'1')
Container(
// height: ScreenUtil().setWidth(14 * 2),
// width: ScreenUtil().setWidth(232 * 2),
child: Text(
'会员充值满${widget.rechargeListSunModel.rechargeMoney}元赠送${Utils.listToStringEnglish3(widget.rechargeListSunModel.rechargeList.couponsNames)}。',
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: MyColours.color_999999,
fontSize: ScreenUtil().setSp(20),
)),
),
],
),
// widget.from == 'select'
// ? widget.showCheck
... ...
import 'package:flutter/material.dart';
import 'package:flutter_keyboard_visibility/flutter_keyboard_visibility.dart';
import 'package:one_key/utils/repaint_boundary_utils.dart';
import 'package:one_key/widgets/system_app_bar.dart';
import 'package:provider/provider.dart';
... ... @@ -12,8 +13,12 @@ import '../../../widgets/round_button.dart';
import '../../../widgets/v_empty_view.dart';
import '../../models/cookbook_model.dart';
import '../../models/notebook_detail.dart';
import '../../models/recharge_list_model.dart';
import '../../provider/marketing_center_provider.dart';
import '../../provider/user_model.dart';
import '../../route/navigator_util.dart';
import '../../utils/share_helper.dart';
import '../my/marketing_center/recharge/recharge_item.dart';
/**
* 生成的预览页
... ... @@ -46,10 +51,45 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
//全局key-截图key
final GlobalKey boundaryKey = GlobalKey();
MarketingCenterProvider marketingCenterProvider;
int index;
TextEditingController recommendC = TextEditingController();
bool isRecharge = true;
bool isRecommend = true;
@override
void initState() {
super.initState();
Utils.changeStatusColor(color: Colors.transparent);
recommendC.text =
'${widget.detailEntity.rnameStr ?? ''}:\n 根据您选择的菜品,我们推荐您参加以下活动,本次消费可用,预计可以享受大量优惠!';
WidgetsBinding.instance.addPostFrameCallback((_) {
_getNewRechargeList();
});
}
_getNewRechargeList() async {
await marketingCenterProvider.getNewRechargeList(context);
if (marketingCenterProvider.rechargeList != null &&
marketingCenterProvider.rechargeList.length > 0) {
index = 0; //默认展示第一个
_getRecommendC();
}
}
_getRecommendC() {
String show = marketingCenterProvider
.rechargeList[index].rechargeList.isPrice ==
'1'
? '预计可以节约${marketingCenterProvider.rechargeList[index].rechargeList.price}元!'
: '预计可以享受大量优惠!';
String name = widget.detailEntity.rnameStr == null
? '${widget.detailEntity.rnameStr}:\n'
: '';
recommendC.text = '${name} 根据您选择的菜品,我们推荐您参加以下活动,本次消费可用,${show}';
setState(() {});
}
Widget _laduWidget() {
... ... @@ -76,6 +116,8 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
@override
Widget build(BuildContext context) {
marketingCenterProvider =
Provider.of<MarketingCenterProvider>(context, listen: true);
String sellername =
Provider.of<UserModel>(context, listen: false).user.sellername;
String sellerAdr =
... ... @@ -90,404 +132,633 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
String servicePerson = '${widget.detailEntity.nick_name ?? ''}' +
' ' +
'${widget.detailEntity.seller_user_phone ?? ''}';
return Scaffold(
return KeyboardDismissOnTap(
child: Scaffold(
backgroundColor: MyColours.color_ffffff,
appBar: SystemAppBar('排菜单'),
body: Column(
children: [
Expanded(
child: SingleChildScrollView(
controller: controller,
child: RepaintBoundary(
key: boundaryKey,
child: Container(
color: Colors.white,
child: Column(children: [
Container(
width: double.infinity,
margin: EdgeInsets.zero,
padding: EdgeInsets.only(
left: w(20),
right: w(20),
top: w(30),
bottom: w(15)),
// height: w(200),
// constraints: new BoxConstraints.expand(
// height: w(200),
// ),
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage(
Utils.getImgPath('preview_bg')),
fit: BoxFit.cover
// centerSlice: new Rect.fromLTRB(270.0, 180.0, 1360.0, 730.0),
)),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'${sellername} 贵宾排菜菜单',
style: TextStyle(
fontSize: font(20),
fontWeight: FontWeight.bold,
color: MyColours.color_CFB53B),
),
VEmptyView(26),
Text(
'预订贵宾 | ${widget.detailEntity.rnameStr ?? ''}',
style: TextStyle(
fontSize: font(14),
color: MyColours.color_303030),
),
VEmptyView(10),
Text(
'预订时间 | ${widget.detailEntity.ddateymd}',
style: TextStyle(
fontSize: font(14),
color: MyColours.color_303030),
),
VEmptyView(10),
Text(
'区域桌台 | ${tables}',
style: TextStyle(
fontSize: font(14),
color: MyColours.color_303030),
),
VEmptyView(10),
Text(
'餐厅地址 | ${sellerAdr}',
style: TextStyle(
fontSize: font(14),
color: MyColours.color_303030),
),
VEmptyView(10),
Text(
'专属服务 | ${servicePerson}',
style: TextStyle(
fontSize: font(14),
color: MyColours.color_303030),
),
],
),
),
widget.name != null && widget.name != ''
? Container(
width: double.infinity,
// width: w(32),
// constraints: BoxConstraints(
// minHeight: w(48),
// ),
// height: w(48),
padding: EdgeInsets.only(
left: w(10),
right: w(20),
top: w(10),
bottom: w(10)),
decoration: BoxDecoration(
border: Border(
// top: BorderSide(
// width: w(1), color: MyColours.color_DBDBDB),
bottom: BorderSide(
width: w(1),
color:
MyColours.color_DBDBDB))),
// constraints: BoxConstraints(minWidth: w(20)),
child: Row(
children: [
Expanded(
child: Text(
widget.name,
style: TextStyle(
color: MyColours.color_515151,
fontSize: font(16),
fontWeight: FontWeight.bold),
)
// TextField(
// maxLines: 1,
// // controller:
// // focusNode: _focusNode,
// // autofocus: true,
// style: TextStyle(
// color: MyColours.color_515151,
// fontSize: font(16),
// fontWeight: FontWeight.bold),
// textAlign: TextAlign.left,
// // textAlignVertical: TextAlignVertical.center,
// decoration: InputDecoration(
// // hintText: "请输入排菜名称",
// hintText: '朋友小聚888套餐(若无名称不展示本行)',
// hintStyle: TextStyle(
// color: MyColours.color_999999,
// fontSize: font(16),
// fontWeight: FontWeight.bold),
// // isCollapsed:
// // true, //重点,相当于高度包裹的意思,必须设置为true,不然有默认奇妙的最小高度
// border: OutlineInputBorder(
// borderSide: BorderSide.none),
// contentPadding: EdgeInsets.zero,
// ),
// keyboardType: TextInputType.text,
// textInputAction: TextInputAction.done,
child: Column(
children: [
RepaintBoundary(
key: boundaryKey,
child: Container(
color: Colors.white,
child: Column(children: [
Stack(children: [
Stack(
// alignment: AlignmentDirectional.bottomCenter, // alignment:子组件对齐方式 系统默认
// alignment: const FractionalOffset(0.5, 0.9), //自己指定Stack子组件对齐 ,只对Stack中有两个子View生效。0.5表示x轴,0.9表示y轴(FractionalOffset 0.5,0.5表示中心)
//AlignmentDirectional x、y 偏移量取值范围为 [-1,1],如果 x 的偏移量大于 0,则表示向右偏移,小于 0 则向左偏移;如果 y 轴的偏移量大于 0 则向下偏移,小于 0 则向上偏移。
alignment: AlignmentDirectional(
0, 0), //AlignmentDirectional 0,0表示在正中心。
fit: StackFit.loose,
// onChanged: (value) {
// // setState(() {});
// // _searchSellerLocation();
// // customerProvider.searchData(value);
// },
// onEditingComplete: () {
// FocusScope.of(context)
// .requestFocus(FocusNode()); //点击空白处隐藏键盘
// // contantShowModel.searchData(
// // contantShowModel.controller.text);
// // _searchSellerLocation();
// // _focusNode.unfocus();
// },
// )
),
HEmptyView(20),
Text(
'1份',
style: TextStyle(
fontSize: font(14),
color: MyColours.color_515151),
children: [
Container(
width: double.infinity,
margin: EdgeInsets.zero,
padding: EdgeInsets.only(
left: w(20),
right: w(20),
top: w(30),
bottom: w(15)),
// height: w(200),
// constraints: new BoxConstraints.expand(
// height: w(200),
// ),
decoration: BoxDecoration(
gradient: LinearGradient(
stops: [
-0.5747,
0.5572,
1.4872
],
colors: [
MyColours.color_4C8DAD,
MyColours.color_0143A3,
MyColours.color_42A5FF
],
begin: Alignment.topLeft,
end: Alignment.bottomRight),
),
],
))
: SizedBox(),
ListView.builder(
itemCount: widget.showList.length,
shrinkWrap: true,
controller: controller,
padding: EdgeInsets.zero,
itemBuilder: (context, index) {
MenuModel menuModel = widget.showList[index];
return ListView.builder(
itemCount:
menuModel.cookbooklist.length + 1,
shrinkWrap: true,
controller: controller,
padding: EdgeInsets.zero,
itemBuilder: (context, index) {
if (index == 0) {
return Column(
children: [
//头
Container(
width: double.infinity,
// width: w(32),
height: w(48),
padding: EdgeInsets.only(
left: w(10),
right: w(20)),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
width: w(1),
color: MyColours
.color_DBDBDB))),
// constraints: BoxConstraints(minWidth: w(20)),
child: Row(
mainAxisAlignment:
MainAxisAlignment
.spaceBetween,
children: [
Text(
menuModel.className,
style: TextStyle(
fontSize: font(16),
color: MyColours
.color_515151,
fontWeight:
FontWeight
.bold),
),
Text(
'${menuModel.allSum}道',
style: TextStyle(
fontSize: font(14),
color: MyColours
.color_515151,
),
),
],
))
],
);
}
int indexReal = index - 1;
MenuSunModel menuSunModel =
menuModel.cookbooklist[indexReal];
return Container(
padding: EdgeInsets.symmetric(
horizontal: w(20),
vertical: w(13)),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
width: w(1),
color: MyColours
.color_DBDBDB))),
child: Row(
child: Container(
color: Colors.transparent,
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
'${sellername} 贵宾排菜菜单',
style: TextStyle(
fontSize: font(20),
fontWeight:
FontWeight.bold,
color:
Colors.transparent),
),
VEmptyView(26),
Text(
'预订贵宾 | ${widget.detailEntity.rnameStr ?? ''}',
style: TextStyle(
fontSize: font(14),
color:
Colors.transparent),
),
VEmptyView(10),
Text(
'预订时间 | ${widget.detailEntity.ddateymd}',
style: TextStyle(
fontSize: font(14),
color:
Colors.transparent),
),
VEmptyView(10),
Text(
'区域桌台 | ${tables}',
style: TextStyle(
fontSize: font(14),
color:
Colors.transparent),
),
VEmptyView(10),
Text(
'餐厅地址 | ${sellerAdr}',
style: TextStyle(
fontSize: font(14),
color:
Colors.transparent),
),
VEmptyView(10),
Text(
'专属服务 | ${servicePerson}',
style: TextStyle(
fontSize: font(14),
color:
Colors.transparent),
),
],
)),
),
Positioned(
right: w(22),
bottom: w(30),
child: Image.asset(
Utils.getImgPath('menu_bg')),
width: w(170),
)
],
),
Positioned(
top: w(30),
left: w(20),
child: Container(
color: Colors.transparent,
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
// Container(
// constraints: BoxConstraints(
// maxWidth: w(80)),
Expanded(
child: Text(
menuSunModel.name,
maxLines: 10,
overflow: TextOverflow.ellipsis,
Text(
'${sellername} 贵宾排菜菜单',
style: TextStyle(
fontSize: font(20),
fontWeight: FontWeight.bold,
color:
MyColours.color_CFB53B),
),
VEmptyView(26),
Text(
'预订贵宾 | ${widget.detailEntity.rnameStr ?? ''}',
style: TextStyle(
fontSize: font(14),
color:
MyColours.color_CFB53B),
),
VEmptyView(10),
Text(
'预订时间 | ${widget.detailEntity.ddateymd}',
style: TextStyle(
fontSize: font(14),
color:
MyColours.color_CFB53B),
),
VEmptyView(10),
Text(
'区域桌台 | ${tables}',
style: TextStyle(
fontSize: font(14),
color:
MyColours.color_515151),
)),
// HEmptyView(8),
// _laduWidget(),
Spacer(),
MyColours.color_CFB53B),
),
VEmptyView(10),
Text(
'${menuSunModel.price}元/${menuSunModel.unit}',
maxLines: 2,
overflow: TextOverflow.ellipsis,
'餐厅地址 | ${sellerAdr}',
style: TextStyle(
fontSize: font(12),
fontSize: font(14),
color:
MyColours.color_515151),
MyColours.color_CFB53B),
),
// HEmptyView(108),
// Text(
// '38元/份',
// maxLines: 2,
// overflow: TextOverflow.ellipsis,
// style: TextStyle(
// fontSize: font(10),
// color: MyColours.color_8EBBBE),
// ),
Container(
width: w(79),
alignment:
Alignment.centerRight,
child: Text(
'${menuSunModel.amount}份',
VEmptyView(10),
Text(
'专属服务 | ${servicePerson}',
style: TextStyle(
fontSize: font(14),
color:
MyColours.color_CFB53B),
),
],
))),
]),
widget.name != null && widget.name != ''
? Container(
width: double.infinity,
// width: w(32),
// constraints: BoxConstraints(
// minHeight: w(48),
// ),
// height: w(48),
padding: EdgeInsets.only(
left: w(10),
right: w(20),
top: w(10),
bottom: w(10)),
decoration: BoxDecoration(
border: Border(
// top: BorderSide(
// width: w(1), color: MyColours.color_DBDBDB),
bottom: BorderSide(
width: w(1),
color: MyColours
.color_DBDBDB))),
// constraints: BoxConstraints(minWidth: w(20)),
child: Row(
children: [
Expanded(
child: Text(
widget.name,
style: TextStyle(
color: MyColours.color_515151,
fontSize: font(16),
fontWeight: FontWeight.bold),
)
// TextField(
// maxLines: 1,
// // controller:
// // focusNode: _focusNode,
// // autofocus: true,
// style: TextStyle(
// color: MyColours.color_515151,
// fontSize: font(16),
// fontWeight: FontWeight.bold),
// textAlign: TextAlign.left,
// // textAlignVertical: TextAlignVertical.center,
// decoration: InputDecoration(
// // hintText: "请输入排菜名称",
// hintText: '朋友小聚888套餐(若无名称不展示本行)',
// hintStyle: TextStyle(
// color: MyColours.color_999999,
// fontSize: font(16),
// fontWeight: FontWeight.bold),
// // isCollapsed:
// // true, //重点,相当于高度包裹的意思,必须设置为true,不然有默认奇妙的最小高度
// border: OutlineInputBorder(
// borderSide: BorderSide.none),
// contentPadding: EdgeInsets.zero,
// ),
// keyboardType: TextInputType.text,
// textInputAction: TextInputAction.done,
// onChanged: (value) {
// // setState(() {});
// // _searchSellerLocation();
// // customerProvider.searchData(value);
// },
// onEditingComplete: () {
// FocusScope.of(context)
// .requestFocus(FocusNode()); //点击空白处隐藏键盘
// // contantShowModel.searchData(
// // contantShowModel.controller.text);
// // _searchSellerLocation();
// // _focusNode.unfocus();
// },
// )
),
HEmptyView(20),
Text(
'1份',
style: TextStyle(
fontSize: font(14),
color:
MyColours.color_515151),
),
],
))
: SizedBox(),
ListView.builder(
itemCount: widget.showList.length,
shrinkWrap: true,
controller: controller,
padding: EdgeInsets.zero,
itemBuilder: (context, index) {
MenuModel menuModel =
widget.showList[index];
return ListView.builder(
itemCount:
menuModel.cookbooklist.length + 1,
shrinkWrap: true,
controller: controller,
padding: EdgeInsets.zero,
itemBuilder: (context, index) {
if (index == 0) {
return Column(
children: [
//头
Container(
width: double.infinity,
// width: w(32),
height: w(48),
padding: EdgeInsets.only(
left: w(10),
right: w(20)),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
width: w(1),
color: MyColours
.color_DBDBDB))),
// constraints: BoxConstraints(minWidth: w(20)),
child: Row(
mainAxisAlignment:
MainAxisAlignment
.spaceBetween,
children: [
Text(
menuModel.className,
style: TextStyle(
fontSize:
font(16),
color: MyColours
.color_515151,
fontWeight:
FontWeight
.bold),
),
Text(
'${menuModel.allSum}道',
style: TextStyle(
fontSize:
font(14),
color: MyColours
.color_515151,
),
),
],
))
],
);
}
int indexReal = index - 1;
MenuSunModel menuSunModel =
menuModel
.cookbooklist[indexReal];
return Container(
padding: EdgeInsets.symmetric(
horizontal: w(20),
vertical: w(13)),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
width: w(1),
color: MyColours
.color_DBDBDB))),
child: Row(
children: [
// Container(
// constraints: BoxConstraints(
// maxWidth: w(80)),
Expanded(
child: Text(
menuSunModel.name,
maxLines: 10,
overflow:
TextOverflow.ellipsis,
style: TextStyle(
fontSize: font(12),
fontSize: font(14),
color: MyColours
.color_515151),
)),
],
),
);
});
}),
widget.remark != null && widget.remark != ''
? Container(
width: double.infinity,
padding: EdgeInsets.symmetric(
horizontal: w(15), vertical: w(7)),
margin: EdgeInsets.only(
top: w(7),
bottom: w(13),
left: w(20),
right: w(20)),
// HEmptyView(8),
// _laduWidget(),
Spacer(),
Text(
'${menuSunModel.price}元/${menuSunModel.unit}',
maxLines: 2,
overflow:
TextOverflow.ellipsis,
style: TextStyle(
fontSize: font(12),
color: MyColours
.color_515151),
),
// HEmptyView(108),
// Text(
// '38元/份',
// maxLines: 2,
// overflow: TextOverflow.ellipsis,
// style: TextStyle(
// fontSize: font(10),
// color: MyColours.color_8EBBBE),
// ),
Container(
width: w(79),
alignment:
Alignment.centerRight,
child: Text(
'${menuSunModel.amount}份',
style: TextStyle(
fontSize: font(12),
color: MyColours
.color_515151),
)),
],
),
);
});
}),
widget.remark != null && widget.remark != ''
? Container(
width: double.infinity,
padding: EdgeInsets.symmetric(
horizontal: w(15), vertical: w(7)),
margin: EdgeInsets.only(
top: w(7),
bottom: w(13),
left: w(20),
right: w(20)),
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(r(5)),
border: Border.all(
width: w(1),
color: MyColours.color_DBDBDB)),
child: Text(
"${widget.remark}",
style: TextStyle(
color: MyColours.color_515151,
fontSize: font(12)),
)
// child: TextField(
// maxLines: 4,
// // controller:
// // focusNode: _focusNode,
// // autofocus: true,
// style: TextStyle(
// color: MyColours.color_515151, fontSize: font(12)),
// textAlign: TextAlign.left,
// // textAlignVertical: TextAlignVertical.center,
// decoration: InputDecoration(
// hintText: "请输入整单备注",
// hintStyle: TextStyle(
// color: MyColours.color_999999,
// fontSize: font(12),
// ),
// // isCollapsed:
// // true, //重点,相当于高度包裹的意思,必须设置为true,不然有默认奇妙的最小高度
// border:
// OutlineInputBorder(borderSide: BorderSide.none),
// contentPadding: EdgeInsets.zero,
// ),
// keyboardType: TextInputType.number,
// textInputAction: TextInputAction.done,
// onChanged: (value) {
// // setState(() {});
// // _searchSellerLocation();
// // customerProvider.searchData(value);
// },
// onEditingComplete: () {
// FocusScope.of(context)
// .requestFocus(FocusNode()); //点击空白处隐藏键盘
// // contantShowModel.searchData(
// // contantShowModel.controller.text);
// // _searchSellerLocation();
// // _focusNode.unfocus();
// },
// ),
)
: SizedBox(),
Container(
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(r(5)),
border: Border.all(
width: w(1),
color: MyColours.color_DBDBDB)),
child: Text(
"${widget.remark}",
border: Border(
top: BorderSide(
width: w(1),
color: widget.remark != null &&
widget.remark != ''
? MyColours.color_DBDBDB
: Colors.transparent))),
padding: EdgeInsets.symmetric(
horizontal: w(10), vertical: w(15)),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceAround,
children: [
Text(
'总计',
style: TextStyle(
fontSize: font(12),
color: MyColours.color_515151),
),
Text(
'菜单价:${widget.priceSum}元',
style: TextStyle(
fontSize: font(12),
color: MyColours.color_515151),
),
Text(
'会员价:${widget.memberPriceSum}元',
style: TextStyle(
fontSize: font(12),
color: MyColours.color_515151),
),
Text(
'排菜价:${widget.planDishText}元',
style: TextStyle(
fontSize: font(12),
color: MyColours.color_515151),
)
])),
VEmptyView(10),
]))),
VEmptyView(10),
if (index != null)
InkWell(
onTap: () {
setState(() {
isRecharge = !isRecharge;
});
},
child: Padding(
padding:
EdgeInsets.symmetric(horizontal: w(20)),
child: Row(
children: [
Image.asset(
Utils.getImgPath(isRecharge
? 'f_select'
: 'f_select_not'),
width: w(20),
),
HEmptyView(20),
Text(
'推荐优惠活动(点击优惠活动可以切换其他优惠)',
style: TextStyle(
color: MyColours.color_515151,
fontSize: font(12)),
fontSize: font(12),
color: MyColours.color_515151),
)
// child: TextField(
// maxLines: 4,
// // controller:
// // focusNode: _focusNode,
// // autofocus: true,
],
))),
if (index != null) VEmptyView(15),
if (index != null)
RechargeItem(
from: 'menu',
rechargeListSunModel:
marketingCenterProvider.rechargeList[index],
onPressed: () {
//切换活动
// style: TextStyle(
// color: MyColours.color_515151, fontSize: font(12)),
// textAlign: TextAlign.left,
// // textAlignVertical: TextAlignVertical.center,
// decoration: InputDecoration(
// hintText: "请输入整单备注",
// hintStyle: TextStyle(
// color: MyColours.color_999999,
// fontSize: font(12),
// ),
// // isCollapsed:
// // true, //重点,相当于高度包裹的意思,必须设置为true,不然有默认奇妙的最小高度
// border:
// OutlineInputBorder(borderSide: BorderSide.none),
// contentPadding: EdgeInsets.zero,
// ),
// keyboardType: TextInputType.number,
// textInputAction: TextInputAction.done,
if (index ==
marketingCenterProvider.rechargeList.length -
1) {
index = 0;
} else {
index++;
}
// onChanged: (value) {
// // setState(() {});
// // _searchSellerLocation();
// // customerProvider.searchData(value);
// },
// onEditingComplete: () {
// FocusScope.of(context)
// .requestFocus(FocusNode()); //点击空白处隐藏键盘
// // contantShowModel.searchData(
// // contantShowModel.controller.text);
// // _searchSellerLocation();
// // _focusNode.unfocus();
// },
// ),
)
: SizedBox(),
Container(
decoration: BoxDecoration(
border: Border(
top: BorderSide(
width: w(1),
color: MyColours.color_DBDBDB))),
padding: EdgeInsets.symmetric(
horizontal: w(10), vertical: w(15)),
_getRecommendC();
},
),
VEmptyView(40),
if (index != null)
InkWell(
onTap: () {
setState(() {
isRecommend = !isRecommend;
});
},
child: Padding(
padding:
EdgeInsets.symmetric(horizontal: w(20)),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceAround,
children: [
Text(
'总计',
style: TextStyle(
fontSize: font(12),
color: MyColours.color_515151),
),
Text(
'菜单价:${widget.priceSum}元',
style: TextStyle(
fontSize: font(12),
color: MyColours.color_515151),
),
Text(
'会员价:${widget.memberPriceSum}元',
style: TextStyle(
fontSize: font(12),
color: MyColours.color_515151),
),
Text(
'排菜价:${widget.planDishText}元',
style: TextStyle(
fontSize: font(12),
color: MyColours.color_515151),
)
])),
Text(
'周到安排技术支持 400-000-9690',
style: TextStyle(
children: [
Image.asset(
Utils.getImgPath(isRecommend
? 'f_select'
: 'f_select_not'),
width: w(20),
),
HEmptyView(20),
Text(
'使用自动生成的推荐语(可点击编辑)',
style: TextStyle(
fontSize: font(12),
color: MyColours.color_515151),
)
],
))),
if (index != null) VEmptyView(15),
if (index != null)
Container(
margin: EdgeInsets.symmetric(horizontal: w(20)),
padding: EdgeInsets.symmetric(horizontal: w(10)),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(r(5)),
border: Border.all(
width: w(0.5),
color: MyColours.color_DBDBDB)),
child: TextField(
controller: recommendC,
textAlign: TextAlign.left,
// textAlignVertical:
// TextAlignVertical.bottom,
maxLines: 3,
// //光标颜色
// cursorColor:
// widget.isSelect ? Colors.white : MyColours.color_199095,
//输入文本的样式
style: TextStyle(
color: MyColours.color_999999,
fontSize: font(12),
color: MyColours.color_999999),
),
]))))),
),
// focusNode: focusNode,
decoration: InputDecoration(
border: OutlineInputBorder(
borderSide: BorderSide.none),
hintText: '请输入推荐语',
hintStyle: TextStyle(
color: MyColours.color_999999,
fontSize: font(12),
),
enabledBorder: new UnderlineInputBorder(
borderSide: BorderSide.none,
),
focusedBorder: new UnderlineInputBorder(
borderSide: BorderSide.none,
),
),
onChanged: (value) {},
onEditingComplete: () {
FocusScope.of(context)
.requestFocus(FocusNode()); //点击空白处隐藏键盘
},
keyboardType: TextInputType.text)),
VEmptyView(20),
],
))),
Container(
color: MyColours.color_ffffff,
padding: EdgeInsets.only(
... ... @@ -514,7 +785,7 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
HEmptyView(30),
Expanded(
child: RoundButton(
text: '分享排菜单',
text: '下一步',
gradientStart: MyColours.color_438E93,
gradientEnd: MyColours.color_438E93,
height: w(43),
... ... @@ -522,9 +793,32 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
fontSize: 36,
isBold: false,
onPressed: () {
ShareHelper.onShareWx(context,
boundaryKey: boundaryKey);
// NavigatorUtil.goOrderPreviewPage(context);
if (index != null) {
NavigatorUtil.goOrderSharePage(context,
object: {'object': widget.showList},
name: widget.name,
remark: widget.remark,
priceSum: widget.priceSum,
memberPriceSum: widget.memberPriceSum,
planDishText: widget.planDishText,
detailEntity: widget.detailEntity,
rechargeListSunModel:
marketingCenterProvider.rechargeList[index],
recommend: recommendC.text,
isRecharge: isRecharge,
isRecommend: isRecommend);
} else {
NavigatorUtil.goOrderSharePage(
context,
object: {'object': widget.showList},
name: widget.name,
remark: widget.remark,
priceSum: widget.priceSum,
memberPriceSum: widget.memberPriceSum,
planDishText: widget.planDishText,
detailEntity: widget.detailEntity,
);
}
},
),
)
... ... @@ -532,6 +826,6 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
))
],
),
);
));
}
}
... ...
import 'package:flutter/material.dart';
import 'package:flutter_keyboard_visibility/flutter_keyboard_visibility.dart';
import 'package:one_key/utils/repaint_boundary_utils.dart';
import 'package:one_key/widgets/system_app_bar.dart';
import 'package:provider/provider.dart';
import '../../../res/colors.dart';
import '../../../utils/screen_util.dart';
import '../../../utils/utils.dart';
import '../../../widgets/MyDivider.dart';
import '../../../widgets/h_empty_view.dart';
import '../../../widgets/round_button.dart';
import '../../../widgets/v_empty_view.dart';
import '../../models/cookbook_model.dart';
import '../../models/notebook_detail.dart';
import '../../models/recharge_list_model.dart';
import '../../provider/marketing_center_provider.dart';
import '../../provider/user_model.dart';
import '../../utils/share_helper.dart';
import '../my/marketing_center/recharge/recharge_item.dart';
/**
* 微信分享截图
*/
class OrderSharePage extends StatefulWidget {
final List<MenuModel> showList;
final String priceSum;
final String memberPriceSum;
final String planDishText;
final String name;
final String remark;
final NotebookDetail detailEntity;
final RechargeListSunModel rechargeListSunModel;
final String recommend;
final bool isRecommend;
final bool isRecharge;
OrderSharePage(
{Key key,
this.showList,
this.priceSum,
this.memberPriceSum,
this.planDishText,
this.name,
this.remark,
this.detailEntity,
this.rechargeListSunModel,
this.recommend,
this.isRecommend,
this.isRecharge})
: super(key: key);
@override
_OrderSharePageState createState() => _OrderSharePageState();
}
class _OrderSharePageState extends State<OrderSharePage> {
ScrollController controller = ScrollController();
//全局key-截图key
final GlobalKey boundaryKey = GlobalKey();
@override
void initState() {
super.initState();
Utils.changeStatusColor(color: Colors.transparent);
WidgetsBinding.instance.addPostFrameCallback((_) {});
}
Widget _laduWidget() {
// if (labelIcon[widget
// .cookBookList.labelList[index].icon] is int) {
// int ladu = labelIcon[
// widget.cookBookList.labelList[index].icon];
int ladu = 6;
List<Widget> widgetList = [];
for (var i = 0; i < ladu; i++) {
widgetList.add(Image.asset(
Utils.getImgPath('ladu'),
width: w(10),
));
}
// widgetList.add(HEmptyView(10));
return Row(
children: widgetList,
);
// }else{
// return SizedBox();
// }
}
@override
Widget build(BuildContext context) {
String sellername =
Provider.of<UserModel>(context, listen: false).user.sellername;
String sellerAdr =
Provider.of<UserModel>(context, listen: false).user.sellerAddr;
String tables = '';
widget.detailEntity.tables.forEach((element) {
tables += '${element.name}、';
});
if (tables.endsWith('、')) {
tables = tables.substring(0, tables.length - 1);
}
String servicePerson = '${widget.detailEntity.nick_name ?? ''}' +
' ' +
'${widget.detailEntity.seller_user_phone ?? ''}';
return KeyboardDismissOnTap(
child: Scaffold(
backgroundColor: MyColours.color_ffffff,
appBar: SystemAppBar('排菜单'),
body: Column(
children: [
Expanded(
child: SingleChildScrollView(
controller: controller,
child: RepaintBoundary(
key: boundaryKey,
child: Container(
color: Colors.white,
child: Column(children: [
Stack(children: [
Stack(
// alignment: AlignmentDirectional.bottomCenter, // alignment:子组件对齐方式 系统默认
// alignment: const FractionalOffset(0.5, 0.9), //自己指定Stack子组件对齐 ,只对Stack中有两个子View生效。0.5表示x轴,0.9表示y轴(FractionalOffset 0.5,0.5表示中心)
//AlignmentDirectional x、y 偏移量取值范围为 [-1,1],如果 x 的偏移量大于 0,则表示向右偏移,小于 0 则向左偏移;如果 y 轴的偏移量大于 0 则向下偏移,小于 0 则向上偏移。
alignment: AlignmentDirectional(
0, 0), //AlignmentDirectional 0,0表示在正中心。
fit: StackFit.loose,
children: [
Container(
width: double.infinity,
margin: EdgeInsets.zero,
padding: EdgeInsets.only(
left: w(20),
right: w(20),
top: w(30),
bottom: w(15)),
// height: w(200),
// constraints: new BoxConstraints.expand(
// height: w(200),
// ),
decoration: BoxDecoration(
gradient: LinearGradient(
stops: [
-0.5747,
0.5572,
1.4872
],
colors: [
MyColours.color_4C8DAD,
MyColours.color_0143A3,
MyColours.color_42A5FF
],
begin: Alignment.topLeft,
end: Alignment.bottomRight),
),
child: Container(
color: Colors.transparent,
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
'${sellername} 贵宾排菜菜单',
style: TextStyle(
fontSize: font(20),
fontWeight: FontWeight.bold,
color: Colors.transparent),
),
VEmptyView(26),
Text(
'预订贵宾 | ${widget.detailEntity.rnameStr ?? ''}',
style: TextStyle(
fontSize: font(14),
color: Colors.transparent),
),
VEmptyView(10),
Text(
'预订时间 | ${widget.detailEntity.ddateymd}',
style: TextStyle(
fontSize: font(14),
color: Colors.transparent),
),
VEmptyView(10),
Text(
'区域桌台 | ${tables}',
style: TextStyle(
fontSize: font(14),
color: Colors.transparent),
),
VEmptyView(10),
Text(
'餐厅地址 | ${sellerAdr}',
style: TextStyle(
fontSize: font(14),
color: Colors.transparent),
),
VEmptyView(10),
Text(
'专属服务 | ${servicePerson}',
style: TextStyle(
fontSize: font(14),
color: Colors.transparent),
),
],
)),
),
Positioned(
right: w(22),
bottom: w(30),
child: Image.asset(Utils.getImgPath('menu_bg')),
width: w(170),
)
],
),
Positioned(
top: w(30),
left: w(20),
child: Container(
color: Colors.transparent,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'${sellername} 贵宾排菜菜单',
style: TextStyle(
fontSize: font(20),
fontWeight: FontWeight.bold,
color: MyColours.color_CFB53B),
),
VEmptyView(26),
Text(
'预订贵宾 | ${widget.detailEntity.rnameStr ?? ''}',
style: TextStyle(
fontSize: font(14),
color: MyColours.color_CFB53B),
),
VEmptyView(10),
Text(
'预订时间 | ${widget.detailEntity.ddateymd}',
style: TextStyle(
fontSize: font(14),
color: MyColours.color_CFB53B),
),
VEmptyView(10),
Text(
'区域桌台 | ${tables}',
style: TextStyle(
fontSize: font(14),
color: MyColours.color_CFB53B),
),
VEmptyView(10),
Text(
'餐厅地址 | ${sellerAdr}',
style: TextStyle(
fontSize: font(14),
color: MyColours.color_CFB53B),
),
VEmptyView(10),
Text(
'专属服务 | ${servicePerson}',
style: TextStyle(
fontSize: font(14),
color: MyColours.color_CFB53B),
),
],
))),
]),
widget.name != null && widget.name != ''
? Container(
width: double.infinity,
// width: w(32),
// constraints: BoxConstraints(
// minHeight: w(48),
// ),
// height: w(48),
padding: EdgeInsets.only(
left: w(10),
right: w(20),
top: w(10),
bottom: w(10)),
decoration: BoxDecoration(
border: Border(
// top: BorderSide(
// width: w(1), color: MyColours.color_DBDBDB),
bottom: BorderSide(
width: w(1),
color: MyColours.color_DBDBDB))),
// constraints: BoxConstraints(minWidth: w(20)),
child: Row(
children: [
Expanded(
child: Text(
widget.name,
style: TextStyle(
color: MyColours.color_515151,
fontSize: font(16),
fontWeight: FontWeight.bold),
)
// TextField(
// maxLines: 1,
// // controller:
// // focusNode: _focusNode,
// // autofocus: true,
// style: TextStyle(
// color: MyColours.color_515151,
// fontSize: font(16),
// fontWeight: FontWeight.bold),
// textAlign: TextAlign.left,
// // textAlignVertical: TextAlignVertical.center,
// decoration: InputDecoration(
// // hintText: "请输入排菜名称",
// hintText: '朋友小聚888套餐(若无名称不展示本行)',
// hintStyle: TextStyle(
// color: MyColours.color_999999,
// fontSize: font(16),
// fontWeight: FontWeight.bold),
// // isCollapsed:
// // true, //重点,相当于高度包裹的意思,必须设置为true,不然有默认奇妙的最小高度
// border: OutlineInputBorder(
// borderSide: BorderSide.none),
// contentPadding: EdgeInsets.zero,
// ),
// keyboardType: TextInputType.text,
// textInputAction: TextInputAction.done,
// onChanged: (value) {
// // setState(() {});
// // _searchSellerLocation();
// // customerProvider.searchData(value);
// },
// onEditingComplete: () {
// FocusScope.of(context)
// .requestFocus(FocusNode()); //点击空白处隐藏键盘
// // contantShowModel.searchData(
// // contantShowModel.controller.text);
// // _searchSellerLocation();
// // _focusNode.unfocus();
// },
// )
),
HEmptyView(20),
Text(
'1份',
style: TextStyle(
fontSize: font(14),
color: MyColours.color_515151),
),
],
))
: SizedBox(),
ListView.builder(
itemCount: widget.showList.length,
shrinkWrap: true,
controller: controller,
padding: EdgeInsets.zero,
itemBuilder: (context, index) {
MenuModel menuModel = widget.showList[index];
return ListView.builder(
itemCount: menuModel.cookbooklist.length + 1,
shrinkWrap: true,
controller: controller,
padding: EdgeInsets.zero,
itemBuilder: (context, index) {
if (index == 0) {
return Column(
children: [
//头
Container(
width: double.infinity,
// width: w(32),
height: w(48),
padding: EdgeInsets.only(
left: w(10), right: w(20)),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
width: w(1),
color: MyColours
.color_DBDBDB))),
// constraints: BoxConstraints(minWidth: w(20)),
child: Row(
mainAxisAlignment:
MainAxisAlignment
.spaceBetween,
children: [
Text(
menuModel.className,
style: TextStyle(
fontSize: font(16),
color: MyColours
.color_515151,
fontWeight:
FontWeight.bold),
),
Text(
'${menuModel.allSum}道',
style: TextStyle(
fontSize: font(14),
color:
MyColours.color_515151,
),
),
],
))
],
);
}
int indexReal = index - 1;
MenuSunModel menuSunModel =
menuModel.cookbooklist[indexReal];
return Container(
padding: EdgeInsets.symmetric(
horizontal: w(20), vertical: w(13)),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
width: w(1),
color:
MyColours.color_DBDBDB))),
child: Row(
children: [
// Container(
// constraints: BoxConstraints(
// maxWidth: w(80)),
Expanded(
child: Text(
menuSunModel.name,
maxLines: 10,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: font(14),
color: MyColours.color_515151),
)),
// HEmptyView(8),
// _laduWidget(),
Spacer(),
Text(
'${menuSunModel.price}元/${menuSunModel.unit}',
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: font(12),
color: MyColours.color_515151),
),
// HEmptyView(108),
// Text(
// '38元/份',
// maxLines: 2,
// overflow: TextOverflow.ellipsis,
// style: TextStyle(
// fontSize: font(10),
// color: MyColours.color_8EBBBE),
// ),
Container(
width: w(79),
alignment: Alignment.centerRight,
child: Text(
'${menuSunModel.amount}份',
style: TextStyle(
fontSize: font(12),
color:
MyColours.color_515151),
)),
],
),
);
});
}),
widget.remark != null && widget.remark != ''
? Container(
width: double.infinity,
padding: EdgeInsets.symmetric(
horizontal: w(15), vertical: w(7)),
margin: EdgeInsets.only(
top: w(7),
bottom: w(13),
left: w(20),
right: w(20)),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(r(5)),
border: Border.all(
width: w(1),
color: MyColours.color_DBDBDB)),
child: Text(
"${widget.remark}",
style: TextStyle(
color: MyColours.color_515151,
fontSize: font(12)),
)
// child: TextField(
// maxLines: 4,
// // controller:
// // focusNode: _focusNode,
// // autofocus: true,
// style: TextStyle(
// color: MyColours.color_515151, fontSize: font(12)),
// textAlign: TextAlign.left,
// // textAlignVertical: TextAlignVertical.center,
// decoration: InputDecoration(
// hintText: "请输入整单备注",
// hintStyle: TextStyle(
// color: MyColours.color_999999,
// fontSize: font(12),
// ),
// // isCollapsed:
// // true, //重点,相当于高度包裹的意思,必须设置为true,不然有默认奇妙的最小高度
// border:
// OutlineInputBorder(borderSide: BorderSide.none),
// contentPadding: EdgeInsets.zero,
// ),
// keyboardType: TextInputType.number,
// textInputAction: TextInputAction.done,
// onChanged: (value) {
// // setState(() {});
// // _searchSellerLocation();
// // customerProvider.searchData(value);
// },
// onEditingComplete: () {
// FocusScope.of(context)
// .requestFocus(FocusNode()); //点击空白处隐藏键盘
// // contantShowModel.searchData(
// // contantShowModel.controller.text);
// // _searchSellerLocation();
// // _focusNode.unfocus();
// },
// ),
)
: SizedBox(),
Container(
decoration: BoxDecoration(
border: Border(
top: BorderSide(
width: w(1),
color: widget.remark != null &&
widget.remark != ''
? MyColours.color_DBDBDB
: Colors.transparent))),
padding: EdgeInsets.symmetric(
horizontal: w(10), vertical: w(15)),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Text(
'总计',
style: TextStyle(
fontSize: font(12),
color: MyColours.color_515151),
),
Text(
'菜单价:${widget.priceSum}元',
style: TextStyle(
fontSize: font(12),
color: MyColours.color_515151),
),
Text(
'会员价:${widget.memberPriceSum}元',
style: TextStyle(
fontSize: font(12),
color: MyColours.color_515151),
),
Text(
'排菜价:${widget.planDishText}元',
style: TextStyle(
fontSize: font(12),
color: MyColours.color_515151),
)
])),
// VEmptyView(10),
Column(
children: [
if (widget.isRecommend && widget.recommend != null)
VEmptyView(15),
if (widget.isRecommend && widget.recommend != null)
Container(
margin: EdgeInsets.symmetric(horizontal: w(20)),
padding:
EdgeInsets.symmetric(horizontal: w(10)),
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(r(5)),
// border: Border.all(
// width: w(0.5),
// color: MyColours.color_DBDBDB)),
child: Text(
widget.recommend,
style: TextStyle(
color: MyColours.color_999999,
fontSize: font(12),
),
)
// focusNode: focusNode,
),
if (widget.isRecharge &&
widget.rechargeListSunModel != null)
VEmptyView(15),
if (widget.isRecharge &&
widget.rechargeListSunModel != null)
RechargeItem(
from: 'menu-show',
rechargeListSunModel: widget.rechargeListSunModel,
),
VEmptyView(52),
Text(
'周到安排技术支持 400-000-9690',
style: TextStyle(
fontSize: font(12),
color: MyColours.color_999999),
),
VEmptyView(26),
],
)
]))),
)),
Container(
color: MyColours.color_ffffff,
padding: EdgeInsets.only(
top: w(12), bottom: w(25), left: w(23), right: w(23)),
child: Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
RoundButton(
text: '返回',
gradientStart: MyColours.color_ffffff,
gradientEnd: MyColours.color_ffffff,
borderColor: MyColours.color_438E93,
textColor: MyColours.color_438E93,
width: w(100),
height: w(43),
radius: r(5),
fontSize: 32,
isBold: false,
onPressed: () {
Navigator.pop(context);
// NavigatorUtil.goOrderSharePage(context);
},
),
HEmptyView(30),
Expanded(
child: RoundButton(
text: '分享排菜单',
gradientStart: MyColours.color_438E93,
gradientEnd: MyColours.color_438E93,
height: w(43),
radius: r(5),
fontSize: 36,
isBold: false,
onPressed: () {
ShareHelper.onShareWx(
context,
boundaryKey: boundaryKey,
);
// NavigatorUtil.goOrderSharePage(context);
},
),
)
],
))
],
),
));
}
}
... ...
... ... @@ -32,6 +32,7 @@ import '../models/otherset_model.dart';
import '../models/out_wine_record_model.dart';
import '../models/plan_cook_by_rid_model.dart';
import '../models/plan_cook_list_model.dart';
import '../models/recharge_list_model.dart';
import '../models/set_xuan_tai_model.dart';
import '../models/wine_manage_model.dart';
import '../models/wine_model.dart';
... ... @@ -277,7 +278,7 @@ class NavigatorUtil {
/// 优惠券详情页
static Future<dynamic> goCouponDetailPage(
BuildContext context, CouponSunModel couponSunModel,
{replace = false,String idStr}) {
{replace = false, String idStr}) {
return _navigateTo(context,
"${Routes.coupon_detail}?couponSunModel=${FluroConvertUtils.object2string(couponSunModel)}&idStr=$idStr",
replace: replace);
... ... @@ -1450,10 +1451,12 @@ class NavigatorUtil {
///预订安排通知定制------优惠券选择
static Future<dynamic> goMarkingCouponSelectPage(
BuildContext context,String idstr, {
BuildContext context,
String idstr, {
replace = false,
}) {
return _navigateTo(context, "${Routes.marking_coupon_select_page}?idstr=$idstr",
return _navigateTo(
context, "${Routes.marking_coupon_select_page}?idstr=$idstr",
replace: replace);
}
... ... @@ -1602,4 +1605,40 @@ class NavigatorUtil {
context, "${Routes.marking_recharge_select_page}?idstr=$idstr",
replace: replace);
}
///排菜单--分享微信截屏
static Future<dynamic> goOrderSharePage(
BuildContext context, {
replace = false,
Map object,
String priceSum,
String memberPriceSum,
String planDishText,
String name,
String remark,
NotebookDetail detailEntity,
RechargeListSunModel rechargeListSunModel,
String recommend,
bool isRecharge = false,
bool isRecommend = false,
}) {
// if (invoice != null) {
// return _navigateTo(context,
// "${Routes.order_advance_home_page}?invoice=${FluroConvertUtils.object2string(invoice)}",
// replace: replace);
// }
// if (object != null) {
// return _navigateTo(context,
// "${Routes.order_advance_home_page}?tids=$tids&tableidNow=$tableidNow&fromPage=$fromPage&canChoose=$canChoose&object=${FluroConvertUtils.object2string(object)}");
// }
if (rechargeListSunModel != null) {
return _navigateTo(context,
"${Routes.order_share_page}?object=${FluroConvertUtils.object2string(object)}&priceSum=$priceSum&memberPriceSum=$memberPriceSum&planDishText=${Uri.encodeComponent(planDishText)}&name=${Uri.encodeComponent(name)}&remark=${Uri.encodeComponent(remark)}&detail=${FluroConvertUtils.object2string(detailEntity)}&recharge=${FluroConvertUtils.object2string(rechargeListSunModel)}&isRecharge=${isRecharge}&isRecommend=${isRecommend}&recommend=${Uri.encodeComponent(recommend)}",
replace: replace);
}
return _navigateTo(context,
"${Routes.order_share_page}?object=${FluroConvertUtils.object2string(object)}&priceSum=$priceSum&memberPriceSum=$memberPriceSum&planDishText=${Uri.encodeComponent(planDishText)}&name=${Uri.encodeComponent(name)}&remark=${Uri.encodeComponent(remark)}&detail=${FluroConvertUtils.object2string(detailEntity)}&isRecharge=${isRecharge}&isRecommend=${isRecommend}&recommend=${Uri.encodeComponent(recommend)}",
replace: replace);
}
}
... ...
import 'dart:convert';
import 'package:fluro/fluro.dart';
... ... @@ -17,6 +16,7 @@ import 'package:one_key/models/marketing_by_uid_model.dart';
import 'package:one_key/models/notebook_detail.dart';
import 'package:one_key/models/otherset_model.dart';
import 'package:one_key/models/personnel_manage_model.dart';
import 'package:one_key/models/recharge_list_model.dart';
import 'package:one_key/models/sms_info.dart';
import 'package:one_key/models/statics_model.dart';
import 'package:one_key/models/table_list.dart';
... ... @@ -214,6 +214,7 @@ import '../pages/order_advance/order_advance_home_page.dart';
import '../pages/order_advance/order_create_temporary_page.dart';
import '../pages/order_advance/order_edit_list_show_page.dart';
import '../pages/order_advance/order_preview_page.dart';
import '../pages/order_advance/order_share_page.dart';
import '../provider/feast_model.dart';
import '../provider/marketing_center_provider.dart';
import '../provider/plan_dish_provider.dart';
... ... @@ -2077,14 +2078,16 @@ var orderPreviewPageHandle = new Handler(
return ChangeNotifierProvider<PlanDishProvider>(
create: (_) => PlanDishProvider(),
child: OrderPreviewPage(
showList: res,
priceSum: priceSum,
memberPriceSum: memberPriceSum,
planDishText: planDishText,
name: name,
remark: remark,
detailEntity: detailEntity));
child: ChangeNotifierProvider<MarketingCenterProvider>(
create: (_) => MarketingCenterProvider(),
child: OrderPreviewPage(
showList: res,
priceSum: priceSum,
memberPriceSum: memberPriceSum,
planDishText: planDishText,
name: name,
remark: remark,
detailEntity: detailEntity)));
});
///经理排菜---排菜编辑列表展示
... ... @@ -2596,3 +2599,75 @@ var markingRechargeSelectPageHandle = new Handler(
create: (_) => MarketingCenterProvider(),
child: MarkingRechargeSelectPage(selectid: idstr));
});
///排菜单微信分享截屏页
var orderSharePageHandle = new Handler(
handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) {
// String fromPage = params["fromPage"].first;
// String tids = params["tids"].first;
// String tableidNow = params["tableidNow"].first;
// bool canChoose = params["canChoose"].first == "true" ? true : false;
// List<TableList> res = [];
// if (params.keys.contains('object')) {
// Map object = FluroConvertUtils.string2map(params["object"].first);
// List temp = object['object'];
// for (var item in temp) {
// res.add(TableList.fromJson(item));
// }
// }
NotebookDetail detailEntity = NotebookDetail.fromJson(json
.decode(FluroConvertUtils.fluroCnParamsDecode(params["detail"].first)));
List<MenuModel> res = [];
// String planDishPrice = '';
if (params.keys.contains('object')) {
Map object = FluroConvertUtils.string2map(params["object"].first);
List temp = object['object'];
// planDishPrice = params["planDishPrice"].first;
for (var item in temp) {
// MenuModel menuModel = MenuModel.fromJson2(item);
// res.add(menuModel);
// print(res);
res.add(MenuModel.fromJson2(item));
}
}
String priceSum = params["priceSum"].first;
String memberPriceSum = params["memberPriceSum"].first;
String planDishText = params["planDishText"].first;
String name = params["name"].first;
String remark = params["remark"].first;
RechargeListSunModel rechargeListSunModel;
if (params.keys.contains('recharge')) {
rechargeListSunModel = RechargeListSunModel.fromJson(json.decode(
FluroConvertUtils.fluroCnParamsDecode(params["recharge"].first)));
}
String recommend = params["recommend"].first;
bool isRecommend = FluroConvertUtils.string2bool(params["isRecommend"].first);
bool isRecharge =
FluroConvertUtils.string2bool(params["isRecharge"].first);
return ChangeNotifierProvider<PlanDishProvider>(
create: (_) => PlanDishProvider(),
child: ChangeNotifierProvider<MarketingCenterProvider>(
create: (_) => MarketingCenterProvider(),
child: OrderSharePage(
showList: res,
priceSum: priceSum,
memberPriceSum: memberPriceSum,
planDishText: planDishText,
name: name,
remark: remark,
detailEntity: detailEntity,
rechargeListSunModel: rechargeListSunModel,
recommend: recommend,
isRecommend: isRecommend,
isRecharge: isRecharge)));
});
... ...
... ... @@ -229,19 +229,13 @@ class Routes {
static String recharge_edit_page = "/recharge_edit_page"; //充值优惠详情编辑页
static String recharge_select_store_coupon_page =
"/recharge_select_store_coupon_page"; //充值优惠选择店铺可核销优惠券
static String recharge_detail_page =
"/recharge_detail_page"; //充值优惠详情页
static String recharge_detail_page = "/recharge_detail_page"; //充值优惠详情页
static String verification_coupon_page =
"/verification_coupon_page"; //核销使用
static String verification_coupon_page = "/verification_coupon_page"; //核销使用
static String marking_recharge_select_page =
static String marking_recharge_select_page =
"/marking_recharge_select_page"; //充值优惠单选择页面
static String order_share_page = "/order_share_page"; //排菜单微信分享截屏
static void configureRoutes(FluroRouter router) {
router.notFoundHandler = new Handler(
... ... @@ -456,16 +450,14 @@ static String recharge_detail_page =
router.define(recharge_select_store_coupon_page,
handler: rechargeSelectStoreCouponPageHandle);
router.define(recharge_detail_page,
handler: rechargeDetailPageHandle);
router.define(verification_coupon_page,
router.define(recharge_detail_page, handler: rechargeDetailPageHandle);
router.define(verification_coupon_page,
handler: verificationCouponPageHandle);
router.define(marking_recharge_select_page,
router.define(marking_recharge_select_page,
handler: markingRechargeSelectPageHandle);
router.define(order_share_page,
handler: orderSharePageHandle);
}
}
... ...
... ... @@ -16,11 +16,9 @@ import 'package:one_key/utils/wx_sdk.dart';
// import 'package:share_plus/share_plus.dart';
class ShareHelper {
static bool wxIsInstalled = false;
//微信分享截图
static void onShareWx(BuildContext context,{boundaryKey}) async {
static Future<bool> onShareWx(BuildContext context, {boundaryKey}) async {
wxIsInstalled = await WxSdk.wxIsInstalled();
//收回键盘,如果有输入的情况下,先收回键盘,再截图
FocusScope.of(context).requestFocus(FocusNode());
... ... @@ -43,6 +41,4 @@ class ShareHelper {
// wxIsInstalled = await WxSdk.wxIsInstalled();
// }
}
... ...
... ... @@ -188,6 +188,7 @@ dependencies:
pin_code_fields: ^7.4.0
# 二维码扫描
barcode_scan2: ^4.2.4
# ai_barcode 3.2.4
# qr_code_scanner: ^1.0.1
... ...