Commit a0fd226526c70a6497e657582eaca27a7da1d531

Authored by wdn127929
1 parent 204caef7

4.8.3打包

... ... @@ -270,7 +270,7 @@ class MenuSunModel {
taste = json['taste'];
cooks = json['cooks'];
json['cook_style'] != null && json['cook_style'] != ''
json['cook_style'] != null && json['cook_style'] != ''
? cookStyle = DishCookStyle.fromJson(json['cook_style'] is Map
? json['cook_style']
: convert.json.decode(json['cook_style']))
... ... @@ -403,9 +403,11 @@ class MenuSunModel {
taste = json['taste'];
cooks = json['cooks'];
json['cook_style'] != null && json['cook_style'] != ''
? cookStyle = DishCookStyle.fromJson(json['cook_style'] is Map
? json['cook_style'] is DishCookStyle
? json['cook_style']
: convert.json.decode(json['cook_style']))
: cookStyle = DishCookStyle.fromJson(json['cook_style'] is Map
? json['cook_style']
: convert.json.decode(json['cook_style']))
: cookStyle = DishCookStyle.fromJson({
// 'image_type': image != null && image != '' ? '1' : '2',
'image_type': '1',
... ...
... ... @@ -82,7 +82,7 @@ class SetMealSunModel {
data['bargaining'] = this.bargaining;
data['status'] = this.status;
data['cdate'] = this.cdate;
if (this.classify = null) {
if (this.classify != null) {
data['class'] = this.classify.map((v) => v.toJson()).toList();
}
if (this.cook != null) {
... ...
... ... @@ -204,9 +204,9 @@ class _CouponPageState extends State<CouponPage> with TickerProviderStateMixin {
Tab(
text: "我的优惠券",
),
Tab(
text: "核销记录",
)
// Tab(
// text: "核销记录",
// )
],
indicatorColor: MyColours.color_438E93,
indicatorSize: TabBarIndicatorSize.label,
... ... @@ -236,9 +236,9 @@ class _CouponPageState extends State<CouponPage> with TickerProviderStateMixin {
ChangeNotifierProvider<PersonnelProvider>(
create: (_) => PersonnelProvider(),
child: CouponSunPage(index: 2)),
ChangeNotifierProvider<PersonnelProvider>(
create: (_) => PersonnelProvider(),
child: CouponHasVerificationPage()),
// ChangeNotifierProvider<PersonnelProvider>(
// create: (_) => PersonnelProvider(),
// child: CouponHasVerificationPage()),
],
),
),
... ...
... ... @@ -79,11 +79,12 @@ class MessageTreatedPageState extends State<MessageTreatedPage> {
MessageMenuModel model5 = MessageMenuModel();
model5.title = '在线买单';
model5.select = false;
MessageMenuModel model6 = MessageMenuModel();
model6.title = '会员充值';
model6.select = false;
// MessageMenuModel model6 = MessageMenuModel();
// model6.title = '会员充值';
// model6.select = false;
menuTitle = [model1, model2, model3, model4, model5, model6];
// menuTitle = [model1, model2, model3, model4, model5, model6];
menuTitle = [model1, model2, model3, model4, model5];
}
@override
... ... @@ -166,10 +167,11 @@ class MessageTreatedPageState extends State<MessageTreatedPage> {
} else if (index == 4) {
//在线买单
typeid = '12';
} else if (index == 5) {
//会员充值
typeid = '12';
}
// else if (index == 5) {
// //会员充值
// typeid = '12';
// }
getMessage(typeid, showLoading: true);
},
child: Container(
... ...
import 'package:flutter/material.dart';
import 'package:flutter_keyboard_visibility/flutter_keyboard_visibility.dart';
import 'package:flutter_screenutil/flutter_screenutil.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 '../../../provider/feast_model.dart';
import '../../../models/cookbook_model.dart';
import '../../../models/notebook_detail.dart';
import '../../../models/recharge_list_model.dart';
import '../../../models/setmeal_by_id_model.dart';
import '../../../models/setmeal_model.dart';
import '../../../models/user.dart';
import '../../../provider/marketing_center_provider.dart';
import '../../../provider/user_model.dart';
import '../../../res/colors.dart';
import '../../../utils/screen_util.dart';
import '../../../utils/share_helper.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';
/**
* 宴会套餐菜单分享
*/
class FeastDishSharePage extends StatefulWidget {
final String setmealId;
FeastDishSharePage({Key key, this.setmealId}) : super(key: key);
final SetMealSunModel setmealDetail; //套餐详情
FeastDishSharePage({
Key key,
this.setmealDetail,
}) : super(key: key);
@override
_FeastDishSharePageState createState() => _FeastDishSharePageState();
}
class _FeastDishSharePageState extends State<FeastDishSharePage> {
FeastModel feastModel;
ScrollController controller = ScrollController();
//全局key-截图key
final GlobalKey boundaryKey = GlobalKey();
Map<String, List<Cook>> data = {};
// Map<String, List<Cook>> dataNew = {};
List<String> classNames = [];
@override
void initState() {
super.initState();
WidgetsBinding.instance.addPostFrameCallback((_) {
_getSetmealById();
_getSetmealClass();
});
Utils.changeStatusColor(color: Colors.transparent);
_getSetmealById();
}
/// 根据ID获取宴会套餐
_getSetmealById({bool isShowLoading = true}) async {
Map<String, String> params = {"id": widget.setmealId};
bool success = await feastModel.getSetmealById(context, params,
isShowLoading: isShowLoading);
if (success) {
// mealNameC.text = feastModel.setmealDetail.mealName;
// mealPriceC.text = feastModel.setmealDetail.price;
// canBargaining = feastModel.setmealDetail.bargaining == '1' ? true : false;
setState(() {});
_getSetmealById() async {
// Map<String, String> params = {"id": widget.setmealId};
// bool success = await feastModel.getSetmealById(context, params,
// isShowLoading: isShowLoading);
// if (success) {
// if (widget.justSelData.length > 0) {
// data = widget.justSelData;
// data.forEach((key, value) {
// classNames.add(key);
// });
// } else {
for (Classify item in widget.setmealDetail.classify) {
// Map<String, List<Cook>> map = {};
String cid = item.id;
String className = item.className;
List<Cook> temp = [];
int numStr = 0;
for (Cook itemCook in widget.setmealDetail.cook) {
if (cid == itemCook.cid) {
temp.add(itemCook);
if (itemCook.numStr != null) {
numStr += int.parse(itemCook.numStr);
}
}
}
String key = className + '(${numStr}道)';
classNames.add(key);
data[key] = temp;
}
// }
setState(() {});
}
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();
// }
}
/// 获取宴会套餐菜品分类列表
_getSetmealClass({bool isShowLoading = true}) async {
Map<String, String> params = {"mid": widget.setmealId};
await feastModel.getSetmealClass(context, params,
isShowLoading: isShowLoading);
Widget _itemBuildWidget(BuildContext context, int index1) {
List<Cook> cookList = data[classNames[index1]];
return ListView.builder(
shrinkWrap: true,
controller: controller,
padding: EdgeInsets.only(bottom: w(20)),
itemCount: cookList.length + 1,
itemBuilder: (BuildContext context, int index) {
if (index < 1) {
return _buildHeaderWidget(context, classNames[index1]);
} else {
int itemIndex = index - 1;
Cook setmeal = cookList[itemIndex];
return Container(
margin: new EdgeInsets.only(top: h(14), left: w(25), right: w(25)),
color: MyColours.color_ffffff,
child: new GestureDetector(
onTap: () {
// _gotoProjectDetail(projectModelList[index]);
},
child: new Container(
color: MyColours.color_ffffff,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: Container(
child: Text(
setmeal.cname,
overflow: TextOverflow.ellipsis,
maxLines: 10,
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(32)),
))),
HEmptyView(30),
Container(
// width: h(16),
child: Text(
'${setmeal.numStr ?? ''}${setmeal.spec}',
overflow: TextOverflow.ellipsis,
maxLines: 1,
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(32)),
)),
],
)),
),
);
}
},
);
}
// // 总count数
// int _getItemListCount() {
// return data.length + 1;
// }
// 根据index展示不同的widget
Widget buildItemWidget(BuildContext context, int index) {
return _itemBuildWidget(context, index);
}
// header内容
Widget _buildHeaderWidget(BuildContext context, String title) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
padding: EdgeInsets.symmetric(horizontal: w(16), vertical: w(14)),
child: Text(
title,
style: TextStyle(
color: MyColours.color_E6000000,
fontSize: font(16),
),
)),
Padding(
padding: EdgeInsets.only(left: w(16)),
child: MyDivider(
double.infinity,
w(0.5),
color: MyColours.color_E7E7E7,
))
],
);
}
@override
Widget build(BuildContext context) {
feastModel = Provider.of<FeastModel>(context, listen: true);
return Scaffold(
body: Container(),
);
String sellername =
Provider.of<UserModel>(context, listen: false).user.sellername;
String sellerAdr =
Provider.of<UserModel>(context, listen: false).user.sellerAddr;
User user = Provider.of<UserModel>(context, listen: false).user;
String servicePerson = '${user.nickName ?? ''} ${user.userphone ?? ''}';
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.setmealDetail.mealName ?? ''}',
style: TextStyle(
fontSize: font(14),
color: Colors.transparent),
),
VEmptyView(10),
Text(
'套餐价格 | ${widget.setmealDetail.price}元',
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.setmealDetail.mealName ?? ''}',
style: TextStyle(
fontSize: font(14),
color: MyColours.color_CFB53B),
),
VEmptyView(10),
Text(
'套餐价格 | ${widget.setmealDetail.price}元',
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),
),
],
))),
]),
ListView.builder(
shrinkWrap: true,
controller: controller,
// padding: EdgeInsets.only(right: w(12)),
itemCount: data.length,
itemBuilder: (BuildContext context, int index) {
return buildItemWidget(context, index);
},
)
]))),
)),
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.goFeastDishSharePage(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.goFeastDishSharePage(context);
},
),
)
],
))
],
),
));
}
}
... ...
... ... @@ -133,7 +133,7 @@ class _FeastSetmealManagePageState extends State<FeastSetmealManagePage> {
Spacer(),
InkWell(
onTap: () {
NavigatorUtil.goFeastDishSharePage(context,data.id);
NavigatorUtil.goFeastDishSharePage(context,data);
},
child: Text(
'预览&分享',
... ...
... ... @@ -110,7 +110,7 @@ class _MenuManagePageState extends State<MenuManagePage> {
}
_getDzSellerConf() async {
bool success = await menuManageProvider.getDzSellerConf(context);
bool success = await menuManageProvider.getDzSellerConf(context,showLoading: false);
if (success) {
themeColerModel1 = themeColorData[menuManageProvider
.dzSellerConfModel.cookStyle ==
... ... @@ -291,7 +291,7 @@ class _MenuManagePageState extends State<MenuManagePage> {
spreadRadius: w(20))
])),
VEmptyView(20),
model.price == null
model.spec != null
? Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: _priceWidget(model))
... ... @@ -317,7 +317,7 @@ class _MenuManagePageState extends State<MenuManagePage> {
List<Widget> _priceWidget(MenuSunModel model) {
List<SpecModel> tempPrice = [];
if (model.price == null) {
if (model.spec != null) {
//新添加菜品
model.spec.forEach((element) {
if (element.status == '1') {
... ... @@ -405,7 +405,7 @@ class _MenuManagePageState extends State<MenuManagePage> {
spreadRadius: w(20))
])),
VEmptyView(20),
model.price == null
model.spec != null
? Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: _priceWidget(model))
... ... @@ -494,7 +494,7 @@ class _MenuManagePageState extends State<MenuManagePage> {
),
)),
HEmptyView(10),
model.price == null
model.spec != null
? Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: _priceWidget(model))
... ... @@ -582,7 +582,7 @@ class _MenuManagePageState extends State<MenuManagePage> {
VEmptyView(20),
Padding(
padding: EdgeInsets.symmetric(horizontal: w(10)),
child: model.price == null
child: model.spec != null
? Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: _priceWidget(model))
... ...
... ... @@ -350,7 +350,7 @@ class _MenuThemeColorSetPageState extends State<MenuThemeColorSetPage> {
spreadRadius: w(20))
])),
VEmptyView(20),
model.price == null
model.spec != null
? Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: _priceWidget(model))
... ... @@ -376,7 +376,7 @@ class _MenuThemeColorSetPageState extends State<MenuThemeColorSetPage> {
List<Widget> _priceWidget(MenuSunModel model) {
List<SpecModel> tempPrice = [];
if (model.price == null) {
if (model.spec != null) {
//新添加菜品
model.spec.forEach((element) {
if (element.status == '1') {
... ... @@ -464,7 +464,7 @@ class _MenuThemeColorSetPageState extends State<MenuThemeColorSetPage> {
spreadRadius: w(20))
])),
VEmptyView(20),
model.price == null
model.spec != null
? Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: _priceWidget(model))
... ... @@ -553,7 +553,7 @@ class _MenuThemeColorSetPageState extends State<MenuThemeColorSetPage> {
),
)),
HEmptyView(10),
model.price == null
model.spec != null
? Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: _priceWidget(model))
... ... @@ -641,7 +641,7 @@ class _MenuThemeColorSetPageState extends State<MenuThemeColorSetPage> {
VEmptyView(20),
Padding(
padding: EdgeInsets.symmetric(horizontal: w(10)),
child: model.price == null
child: model.spec != null
? Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: _priceWidget(model))
... ...
... ... @@ -35,6 +35,8 @@ 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/setmeal_by_id_model.dart';
import '../models/setmeal_model.dart';
import '../models/wine_manage_model.dart';
import '../models/wine_model.dart';
... ... @@ -1705,9 +1707,11 @@ class NavigatorUtil {
///宴会套餐分享预览
///
static void goFeastDishSharePage(BuildContext context, String setmealId,
static void goFeastDishSharePage(
BuildContext context, SetMealSunModel setmealDetail,
{replace = false}) {
_navigateTo(context, "${Routes.feast_dish_share_page}?setmealId=$setmealId",
_navigateTo(context,
"${Routes.feast_dish_share_page}?detail=${FluroConvertUtils.object2string(setmealDetail.toJson())}",
replace: replace);
}
... ...
... ... @@ -160,6 +160,7 @@ import '../models/plan_cook_by_rid_model.dart';
import '../models/plan_cook_list_model.dart';
import '../models/set_xuan_tai_model.dart';
import '../models/setmeal_by_id_model.dart';
import '../models/setmeal_model.dart';
import '../models/wine_manage_model.dart';
import '../pages/coupon/coupon_verification_detail_page.dart';
import '../pages/coupon/verification_coupon_page.dart';
... ... @@ -2772,12 +2773,12 @@ var messageRechargeInfoPageHandle = new Handler(
var feastDishSharePageHandle = new Handler(
handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) {
String setmealId = params["setmealId"].first;
// NotebookDetail detailEntity = NotebookDetail.fromJson(json
// .decode(FluroConvertUtils.fluroCnParamsDecode(params["detail"].first)));
SetMealSunModel setmealDetail = SetMealSunModel.fromJson(json
.decode(FluroConvertUtils.fluroCnParamsDecode(params["detail"].first)));
return ChangeNotifierProvider<FeastModel>(
create: (_) => FeastModel(),
child: FeastDishSharePage(setmealId: setmealId));
child: FeastDishSharePage(setmealDetail: setmealDetail));
});
///优惠券核销详情页
... ...
... ... @@ -44,6 +44,8 @@ class FluroConvertUtils {
return fluroCnParamsEncode(jsonEncode(t));
}
/// string json 转为 map
static Map<String, dynamic> string2map(String str) {
return json.decode(fluroCnParamsDecode(str));
... ...
... ... @@ -1218,9 +1218,10 @@ class Utils {
// String _thumbnail = img;
String sellerImage =
Provider.of<UserModel>(context, listen: false).user.sellerimage;
String _thumbnail = sellerImage == null || sellerImage == ''
? 'http://nosqn.colorcun.com/reserve/images/3x/%E6%9A%82%E6%97%A0.png'
: sellerImage;
// String _thumbnail = sellerImage == null || sellerImage == ''
// ? 'http://nosqn.colorcun.com/reserve/images/3x/%E6%9A%82%E6%97%A0.png'
// : sellerImage;
String _thumbnail = 'https://nosqn.colorcun.com/share_advanced_order.png';
String _title = title;
String _userName = "gh_487873d353b3";
String _path = "pack-cookbook/pages/index?rid=$rid&identity=2&sid=$sid";
... ... @@ -1706,7 +1707,7 @@ class Utils {
String _thumbnail = 'https://nosqn.colorcun.com/share_recharge.png';
String _title =
"${Provider.of<UserModel>(context, listen: false).user.sellername}诚邀您参加储值优惠活动,点击进入。";
"${Provider.of<UserModel>(context, listen: false).user.sellername}诚邀您参加“'${rechargeListSunModel.rname}'”,点击进入。";
String _userName = "gh_487873d353b3";
String _path =
"pack-activity/pack/vipRecharge?id=$rechargeid&name=${Provider.of<UserModel>(context, listen: false).user.sellername}&sid=${Provider.of<UserModel>(context, listen: false).user.sellerid}&types=3";
... ... @@ -1715,7 +1716,8 @@ class Utils {
// _path =
// "pages/customer/index?id=$rid&hasInvitation=1&hasSellerShare=1&uid=$uid";
// }
String _description = "充值优惠购买分享";
String _description =
"${Provider.of<UserModel>(context, listen: false).user.sellername}诚邀您参加“${rechargeListSunModel.rname}”,点击进入。";
// Uint8List source = await testComporessList(context, _thumbnail);
//跳转小程序
... ...