Commit 204caef7e5337411418902107ff71480aedf7f67

Authored by wdn127929
1 parent e68bea49

分享优惠券和充值优惠

... ... @@ -510,7 +510,7 @@
CODE_SIGN_ENTITLEMENTS = Runner/RunnerProfile.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 476;
CURRENT_PROJECT_VERSION = 483;
DEVELOPMENT_TEAM = 8J59HM8B82;
ENABLE_BITCODE = NO;
FLUTTER_BUILD_MODE = release;
... ... @@ -525,7 +525,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
MARKETING_VERSION = 4.8.0;
MARKETING_VERSION = 4.8.3;
PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine;
PRODUCT_NAME = Runner;
PROVISIONING_PROFILE_SPECIFIER = "";
... ... @@ -656,10 +656,10 @@
CODE_SIGN_ENTITLEMENTS = "Runner/一键订Debug.entitlements";
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 476;
CURRENT_PROJECT_VERSION = 483;
DEVELOPMENT_TEAM = 8J59HM8B82;
ENABLE_BITCODE = NO;
FLUTTER_BUILD_MODE = release;
FLUTTER_BUILD_MODE = debug;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
... ... @@ -671,7 +671,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
MARKETING_VERSION = 4.8.0;
MARKETING_VERSION = 4.8.3;
PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine;
PRODUCT_NAME = Runner;
PROVISIONING_PROFILE_SPECIFIER = "";
... ... @@ -692,7 +692,7 @@
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 476;
CURRENT_PROJECT_VERSION = 483;
DEVELOPMENT_TEAM = 8J59HM8B82;
ENABLE_BITCODE = NO;
FLUTTER_BUILD_MODE = release;
... ... @@ -707,7 +707,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
MARKETING_VERSION = 4.8.0;
MARKETING_VERSION = 4.8.3;
PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine;
PRODUCT_NAME = Runner;
PROVISIONING_PROFILE_SPECIFIER = "";
... ...
... ... @@ -88,6 +88,9 @@ class CouponSunModel extends Object {
@JsonKey(name: 'exp_date')
ExpDate expDate;
@JsonKey(name: 'nick_name')
String nickNameShow;
bool isCheck = false;
bool showText = false;
... ... @@ -111,7 +114,8 @@ class CouponSunModel extends Object {
this.isOpenBool,
this.price,
this.use,
this.expDate);
this.expDate,
this.nickNameShow);
factory CouponSunModel.fromJson(Map<String, dynamic> srcJson) =>
_$CouponSunModelFromJson(srcJson);
... ...
... ... @@ -58,6 +58,7 @@ CouponSunModel _$CouponSunModelFromJson(Map<String, dynamic> json) {
: (json['exp_date'] is Map)
? ExpDate.fromJson(json['exp_date'])
: null,
json['nick_name'] as String,
);
}
... ... @@ -82,7 +83,8 @@ Map<String, dynamic> _$CouponSunModelToJson(CouponSunModel instance) =>
'isOpenBool': instance.isOpenBool,
'price': instance.price,
'use': instance.use,
'exp_date': instance.expDate
'exp_date': instance.expDate,
'nick_name':instance.nickNameShow
};
CouponUse _$CouponUseFromJson(Map<String, dynamic> json) {
... ...
... ... @@ -46,13 +46,13 @@ class _CouponDetailPageState extends State<CouponDetailPage> {
super.initState();
WidgetsBinding.instance.addPostFrameCallback((_) {
if (widget.idstr != null && widget.idstr != 'null') {
_getActivityById();
} else {
couponProvider.couponSunModel = widget.couponSunModel;
pageState = PageState.Success;
setState(() {});
}
// if (widget.idstr != null && widget.idstr != 'null') {
_getActivityById();
// } else {
// couponProvider.couponSunModel = widget.couponSunModel;
// pageState = PageState.Success;
// setState(() {});
// }
});
}
... ... @@ -214,7 +214,9 @@ class _CouponDetailPageState extends State<CouponDetailPage> {
onTap: () {
Navigator.pop(context);
},
rightImgName: couponProvider.couponSunModel.isType == '1' &&
rightImgName: couponProvider != null &&
couponProvider.couponSunModel != null &&
couponProvider.couponSunModel.isType == '1' &&
couponProvider.couponSunModel.isExamine == '1' &&
couponProvider.couponSunModel.status == '1'
? 'share.png'
... ... @@ -224,7 +226,8 @@ class _CouponDetailPageState extends State<CouponDetailPage> {
couponProvider.couponSunModel.isExamine == '1' &&
couponProvider.couponSunModel.status == '1') {
//店铺可核销券
Utils.goShareBuyCouponToWeChat(context, widget.idstr);
Utils.goShareBuyCouponToWeChat(
context, widget.idstr, couponProvider.couponSunModel.use,couponProvider.couponSunModel);
}
},
),
... ... @@ -424,18 +427,22 @@ class _CouponDetailPageState extends State<CouponDetailPage> {
color: MyColours.color_E7E7E7,
),
VEmptyView(24),
_select(
'谁可以发放',
'查看',
() async {
await NavigatorUtil
.goCouponToPersonnalPage(
context,
couponProvider
.couponSunModel.uidList,
onlyShow: true);
},
)
_item(
'谁可以发放',
couponProvider
.couponSunModel.nickNameShow),
// _select(
// '谁可以发放',
// '查看',
// () async {
// await NavigatorUtil
// .goCouponToPersonnalPage(
// context,
// couponProvider
// .couponSunModel.uidList,
// onlyShow: true);
// },
// )
],
)
: SizedBox(),
... ...
... ... @@ -1035,6 +1035,10 @@ class _CouponEidtPageState extends State<CouponEidtPage> {
Utils.showToast('请设置可用日期!');
return;
}
if (uids == null || uids == '') {
Utils.showToast('请设置发放人!');
return;
}
}
if (_couponRequireEditControl.text.trim().length == 0) {
Utils.showToast('请填写券要求');
... ... @@ -1054,6 +1058,7 @@ class _CouponEidtPageState extends State<CouponEidtPage> {
Utils.showToast('有效期结束时间不能早于起始时间');
return;
}
// ***参数***
// _couponNameEditControl.text
// _couponRequireEditControl.text
... ...
import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:one_key/constant/state.dart';
import 'package:one_key/models/personnel_manage_model.dart';
import 'package:one_key/pages/coupon/coupon_item_f.dart';
import 'package:one_key/provider/coupon_provider.dart';
import 'package:one_key/provider/personnel_provider.dart';
import 'package:one_key/provider/user_model.dart';
import 'package:one_key/res/colors.dart';
import 'package:one_key/route/navigator_util.dart';
import 'package:one_key/utils/event_bus.dart';
import 'package:one_key/widgets/page_exception.dart';
import 'package:one_key/widgets/v_empty_view.dart';
import 'package:provider/provider.dart';
import 'coupon_verification_item_f.dart';
/**
* 已核销列表
*/
class CouponHasVerificationPage extends StatefulWidget {
CouponHasVerificationPage({Key key}) : super(key: key);
@override
_CouponHasVerificationPageState createState() =>
_CouponHasVerificationPageState();
}
class _CouponHasVerificationPageState extends State<CouponHasVerificationPage> {
CouponProvider couponProvider;
EasyRefreshController _controller = EasyRefreshController();
PersonnelProvider personnelProvider;
List<PersonnelManageSunModel> authUserLists = [];
@override
void initState() {
// TODO: implement initState
super.initState();
WidgetsBinding.instance.addPostFrameCallback((_) {
couponProvider.pageStateVerification = PageState.Success;
couponProvider.notifyListeners();
// _couponNetworkData(widget.index, isShowLoading: false);
bus.on("refresh_coupon_verification_list", (arg) {
// _couponNetworkData(widget.index);
});
});
}
@override
void dispose() {
super.dispose();
bus.off('refresh_coupon_verification_list');
}
///获取优惠券列表数据
_couponNetworkData(int index, {bool isShowLoading = true}) async {
Map<String, String> params = {
"uid": Provider.of<UserModel>(context, listen: false).user.openid,
// 'is_time': '0'
"is_type": index.toString()
};
await couponProvider.getCustomerActivity(context, params, index,
isShowLoading: isShowLoading);
}
///修改活动信息
_setCustomerActivity(int index) async {
Map<String, String> params = {
"id": couponProvider.couponList[index].id,
"status": couponProvider.couponList[index].isOpenBool ? '1' : '0',
'is_open': couponProvider.couponList[index].isOpenBool ? '1' : '0',
};
bool isSuccess = await couponProvider.setCustomerActivity(context, params,
isShowLoading: false);
print(isSuccess);
// _couponNetworkData(widget.index, isShowLoading: false);
// if (isSuccess) {
// couponProvider.notifyListeners();
// } else {
// couponProvider.couponList[index].isOpenBool =
// !couponProvider.couponList[index].isOpenBool;
// couponProvider.notifyListeners();
// }
}
@override
Widget build(BuildContext context) {
couponProvider = Provider.of<CouponProvider>(context, listen: true);
personnelProvider = Provider.of<PersonnelProvider>(context, listen: true);
return Container(
color: MyColours.color_f3f3f3,
child: Consumer<CouponProvider>(builder: (context, model, _) {
if (model.pageStateVerification != PageState.Success) {
return ExceptionPage(
pageState: model.pageStateVerification,
callback: () {
// offset = 0;
// getMessage(showLoading: true);
// if (model.pageStateVerification == PageState.Empty) {
// NavigatorUtil.goCouponHistoryPage(context);
// } else {
// // _couponNetworkData(widget.index);
// }
},
emptyMsg: "暂时没有列表信息哦,",
emptyImg: "empty_search",
showMsg: "加载中,请稍后...",
);
} else {
return EasyRefresh.custom(
controller: _controller,
shrinkWrap: true,
slivers: [
SliverList(
delegate: SliverChildBuilderDelegate(
(BuildContext context, int index) {
return CouponVerificationItemF(
// from: 'quan',
// couponSonModel: couponProvider.couponList[index],
// showBtn: true,
// onPressedSwich: () {
// couponProvider.couponList[index].isOpenBool =
// !couponProvider.couponList[index].isOpenBool;
// _setCustomerActivity(index);
// },
onPressed: () {
NavigatorUtil.goCouponVerificationDetailPage(
context, couponProvider.couponList[index],
idStr: couponProvider.couponList[index].id);
},
);
}, childCount: couponProvider.couponList.length),
),
// SliverList(
// delegate: SliverChildBuilderDelegate(
// (BuildContext context, int index) {
// return Column(
// children: [
// InkWell(
// onTap: () {
// NavigatorUtil.goCouponHistoryPage(context);
// },
// child: RichText(
// text: TextSpan(
// style: TextStyle(
// fontSize: ScreenUtil().setSp(28),
// ),
// children: [
// TextSpan(
// text: '没有更多了,',
// style: TextStyle(
// color: MyColours.color_000000)),
// TextSpan(
// text: '查看过期优惠券',
// style: TextStyle(
// color: MyColours.color_438E93)),
// ]))),
// VEmptyView(80)
// ],
// );
// }, childCount: 1),
// )
],
// onRefresh: () async {
// // offset = 0;
// // getMessage(showLoading: false);
// },
// onLoad: () async {
// // offset++;
// // getMessage(showLoading: false);
// },
);
}
}),
);
}
}
... ...
... ... @@ -19,6 +19,7 @@ import 'package:barcode_scan2/barcode_scan2.dart';
import '../../utils/dialog_util.dart';
import '../../utils/misc.dart';
import '../../utils/utils.dart';
import 'coupon_has_verification_page.dart';
/**
* 优惠券列表
... ... @@ -86,7 +87,7 @@ class _CouponPageState extends State<CouponPage> with TickerProviderStateMixin {
// // _numberOfCameras = await BarcodeScanner.numberOfCameras;
// setState(() {});
// });
tabController = TabController(length: 3, vsync: this);
tabController = TabController(length: 4, vsync: this);
tabController.addListener(() {
// couponProvider.couponList = [];
// couponProvider.pageState = PageState.Loading;
... ... @@ -202,6 +203,9 @@ class _CouponPageState extends State<CouponPage> with TickerProviderStateMixin {
),
Tab(
text: "我的优惠券",
),
Tab(
text: "核销记录",
)
],
indicatorColor: MyColours.color_438E93,
... ... @@ -232,57 +236,61 @@ class _CouponPageState extends State<CouponPage> with TickerProviderStateMixin {
ChangeNotifierProvider<PersonnelProvider>(
create: (_) => PersonnelProvider(),
child: CouponSunPage(index: 2)),
ChangeNotifierProvider<PersonnelProvider>(
create: (_) => PersonnelProvider(),
child: CouponHasVerificationPage()),
],
),
),
Container(
height: ScreenUtil().setWidth(91 * 2),
width: double.infinity,
padding: EdgeInsets.only(
top: ScreenUtil().setWidth(16 * 2),
bottom: ScreenUtil().setWidth(35 * 2),
left: ScreenUtil().setWidth(45 * 2),
right: ScreenUtil().setWidth(45 * 2),
),
decoration: BoxDecoration(
color: MyColours.color_ffffff,
boxShadow: [
BoxShadow(
spreadRadius: ScreenUtil().setWidth(2),
color: Color.fromRGBO(0, 0, 0, 0.1),
offset: Offset(0, ScreenUtil().setWidth(-2)),
blurRadius: ScreenUtil().setWidth(8))
],
borderRadius: BorderRadius.all(
Radius.circular(ScreenUtil().setWidth(16)),
if (tabController.index != 3)
Container(
height: ScreenUtil().setWidth(91 * 2),
width: double.infinity,
padding: EdgeInsets.only(
top: ScreenUtil().setWidth(16 * 2),
bottom: ScreenUtil().setWidth(35 * 2),
left: ScreenUtil().setWidth(45 * 2),
right: ScreenUtil().setWidth(45 * 2),
),
),
child: RoundButton(
text: '创建新的优惠券',
height: ScreenUtil().setWidth(80),
radius: ScreenUtil().setWidth(14),
isBold: false,
fontSize: 28,
onPressed: () async {
UserModel userModel =
Provider.of<UserModel>(context, listen: false);
if (userModel.user.role_name == '管理员' ||
userModel.user.role_name == '店长') {
NavigatorUtil.goCouponCreateSelectTypePage(context);
} else {
bool needRefresh =
await NavigatorUtil.goCouponEditPage(context);
print(needRefresh);
if (needRefresh != null && needRefresh) {
bus.emit('refresh_coupon_list_f');
//刷新页面数据
// _controller.callRefresh();
// _couponNetworkData(tabController.index);
decoration: BoxDecoration(
color: MyColours.color_ffffff,
boxShadow: [
BoxShadow(
spreadRadius: ScreenUtil().setWidth(2),
color: Color.fromRGBO(0, 0, 0, 0.1),
offset: Offset(0, ScreenUtil().setWidth(-2)),
blurRadius: ScreenUtil().setWidth(8))
],
borderRadius: BorderRadius.all(
Radius.circular(ScreenUtil().setWidth(16)),
),
),
child: RoundButton(
text: '创建新的优惠券',
height: ScreenUtil().setWidth(80),
radius: ScreenUtil().setWidth(14),
isBold: false,
fontSize: 28,
onPressed: () async {
UserModel userModel =
Provider.of<UserModel>(context, listen: false);
if (userModel.user.role_name == '管理员' ||
userModel.user.role_name == '店长') {
NavigatorUtil.goCouponCreateSelectTypePage(context);
} else {
bool needRefresh =
await NavigatorUtil.goCouponEditPage(context);
print(needRefresh);
if (needRefresh != null && needRefresh) {
bus.emit('refresh_coupon_list_f');
//刷新页面数据
// _controller.callRefresh();
// _couponNetworkData(tabController.index);
}
}
}
},
),
)
},
),
)
],
),
// child: Column(
... ...
... ... @@ -52,6 +52,7 @@ class _CouponSunPageState extends State<CouponSunPage> {
@override
void dispose() {
super.dispose();
}
... ...
import 'package:common_utils/common_utils.dart';
import 'package:flutter/material.dart';
import 'package:flutter_picker/flutter_picker.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:one_key/constant/state.dart';
import 'package:one_key/models/coupon_model.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/dialog_util.dart';
import 'package:one_key/utils/event_bus.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:provider/provider.dart';
import '../../utils/screen_util.dart';
import '../../widgets/page_exception.dart';
/**
* 新建券
*/
class CouponVerificationDetailPage extends StatefulWidget {
final CouponSunModel couponSunModel;
final String idstr;
CouponVerificationDetailPage({Key key, this.couponSunModel, this.idstr})
: super(key: key);
@override
_CouponVerificationDetailPageState createState() =>
_CouponVerificationDetailPageState();
}
class _CouponVerificationDetailPageState
extends State<CouponVerificationDetailPage> {
ScrollController controller = ScrollController();
final heightCell = ScreenUtil().setWidth(80);
CouponProvider couponProvider;
PageState pageState = PageState.Loading;
@override
void initState() {
super.initState();
WidgetsBinding.instance.addPostFrameCallback((_) {
// if (widget.idstr != null && widget.idstr != 'null') {
_getActivityById();
// } else {
// couponProvider.couponSunModel = widget.couponSunModel;
// pageState = PageState.Success;
// setState(() {});
// }
});
}
_getActivityById() async {
pageState = PageState.Loading;
bool success = await couponProvider
.getActivityById(context, {'id': widget.idstr}, isShowLoading: false);
if (success) {
pageState = PageState.Success;
} else {
pageState = PageState.ConnectivityError;
}
setState(() {});
}
///时间选择
Widget _select(String title, String hintText, GestureTapCallback onTap) {
return InkWell(
onTap: onTap,
child: Container(
padding: EdgeInsets.symmetric(vertical: ScreenUtil().setWidth(28)),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
// height: ScreenUtil().setWidth(40),
// color: Colors.red,
child: Text(
title,
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(32)),
),
),
HEmptyView(20),
Spacer(),
Text(hintText,
style: TextStyle(
color: hintText == '点击选择'
? MyColours.color_999999
: MyColours.color_515151,
fontSize: ScreenUtil().setSp(32),
)),
HEmptyView(20),
Image.asset(
Utils.getImgPath('arrow_right_new'),
width: ScreenUtil().setWidth(20),
),
HEmptyView(32),
],
),
),
);
}
///输入框
Widget _item(String title, String subTitle) {
return Container(
padding: EdgeInsets.symmetric(vertical: ScreenUtil().setWidth(24)),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
child: Text(
title,
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(32)),
),
),
HEmptyView(60),
Expanded(
child: Text(
subTitle,
maxLines: 20,
textAlign: TextAlign.right,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: Color.fromRGBO(0, 0, 0, 0.4),
fontSize: ScreenUtil().setSp(32),
),
))
],
),
);
}
///输入框
Widget _textShow(String title, String subtitle) {
return Container(
padding: EdgeInsets.only(
left: w(15),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Container(
child: Text(
title,
style: TextStyle(
color: Color.fromRGBO(0, 0, 0, 0.9),
fontSize: ScreenUtil().setSp(32)),
),
),
Spacer(),
Text(
subtitle,
//输入文本的样式
style: TextStyle(
color: Color.fromRGBO(0, 0, 0, 0.4),
fontSize: ScreenUtil().setSp(32),
),
),
],
),
);
}
///是否立即启用
Widget _canUse(String title, bool swich) {
return Container(
padding: EdgeInsets.symmetric(vertical: ScreenUtil().setWidth(24)),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
// height: ScreenUtil().setWidth(40),
// color: Colors.red,
child: Text(
title,
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(32)),
),
),
Spacer(),
Image.asset(
swich
? Utils.getImgPath('swich_on')
: Utils.getImgPath('swich_off'),
width: ScreenUtil().setWidth(44 * 2),
)
],
),
);
}
@override
Widget build(BuildContext context) {
couponProvider = Provider.of<CouponProvider>(context, listen: true);
return Scaffold(
backgroundColor: MyColours.color_ffffff,
appBar: SystemAppBar(
'优惠券详情',
onTap: () {
Navigator.pop(context);
},
rightImgName: couponProvider.couponSunModel.isType == '1' &&
couponProvider.couponSunModel.isExamine == '1' &&
couponProvider.couponSunModel.status == '1'
? 'share.png'
: null,
onTapRight: () {
if (couponProvider.couponSunModel.isType == '1' &&
couponProvider.couponSunModel.isExamine == '1' &&
couponProvider.couponSunModel.status == '1') {
//店铺可核销券
Utils.goShareBuyCouponToWeChat(
context,
widget.idstr,
couponProvider.couponSunModel.use,
couponProvider.couponSunModel);
}
},
),
body: Consumer<CouponProvider>(builder: (context, model, _) {
if (pageState != PageState.Success) {
return ExceptionPage(
pageState: pageState,
callback: () {
_getActivityById();
},
emptyMsg: "暂时没有数据哦,",
emptyImg: "empty_search",
showMsg: "加载中,请稍后...",
);
} else {
return Column(children: [
Expanded(
child: SingleChildScrollView(
controller: controller,
physics: BouncingScrollPhysics(),
child: Padding(
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(32)),
child: Column(
children: [
VEmptyView(56),
_item(
'券类型',
couponProvider.couponSunModel.isType == '1'
? '店铺优惠券'
: '我的优惠券'),
Container(
height: ScreenUtil().setWidth(2),
color: MyColours.color_E7E7E7,
),
VEmptyView(24),
_item('券编码', 'NO.01774420230223150306'),
Container(
height: ScreenUtil().setWidth(2),
color: MyColours.color_E7E7E7,
),
VEmptyView(24),
_item('券名称', couponProvider.couponSunModel.aname),
Container(
height: ScreenUtil().setWidth(2),
color: MyColours.color_E7E7E7,
),
VEmptyView(24),
if (couponProvider.couponSunModel.use != null)
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// _item(
// '券用途',
// couponProvider.couponSunModel.use.isCash
// ? '代金券'
// : couponProvider
// .couponSunModel.use.isDiscount
// ? '折扣券'
// : couponProvider
// .couponSunModel.use.isDish
// ? '菜品券'
// : ''),
// Container(
// height: ScreenUtil().setWidth(2),
// color: MyColours.color_E7E7E7,
// ),
// VEmptyView(24),
// _item(
// couponProvider.couponSunModel.use.isCash
// ? '金额'
// : couponProvider
// .couponSunModel.use.isDiscount
// ? '折扣率'
// : couponProvider
// .couponSunModel.use.isDish
// ? '菜品'
// : '',
// couponProvider.couponSunModel.use.isCash
// ? '${couponProvider.couponSunModel.use.cash}元'
// : couponProvider
// .couponSunModel.use.isDiscount
// ? '${couponProvider.couponSunModel.use.discount}折'
// : couponProvider
// .couponSunModel.use.isDish
// ? couponProvider
// .couponSunModel.use.dish
// : ''),
// Container(
// height: ScreenUtil().setWidth(2),
// color: MyColours.color_E7E7E7,
// ),
// VEmptyView(24),
_item(
'销售价',
'${couponProvider.couponSunModel.price}元' ??
''),
Container(
height: ScreenUtil().setWidth(2),
color: MyColours.color_E7E7E7,
),
VEmptyView(24),
],
),
_item('券要求', couponProvider.couponSunModel.desc),
Container(
height: ScreenUtil().setWidth(2),
color: MyColours.color_E7E7E7,
),
VEmptyView(24),
_item(
'有效期从',
Utils.getDateStrFromJiekou(
couponProvider.couponSunModel.stime)),
Container(
height: ScreenUtil().setWidth(2),
color: MyColours.color_E7E7E7,
),
VEmptyView(24),
_item(
'有效期至',
Utils.getDateStrFromJiekou(
couponProvider.couponSunModel.etime)),
Column(children: [
Container(
height: ScreenUtil().setWidth(2),
color: MyColours.color_E7E7E7,
),
VEmptyView(24),
_item(
'使用限制',
couponProvider.couponSunModel.expDate.isNone
? '无'
: couponProvider
.couponSunModel.expDate.isBirthday
? '会员生日当天'
: couponProvider
.couponSunModel.expDate.isWeek
? '每周指定日期餐段可用'
: ''),
if (couponProvider.couponSunModel.expDate.isWeek)
Align(
alignment: Alignment.centerLeft,
child: Padding(
padding: EdgeInsets.only(left: w(16)),
child: Text(
couponProvider
.couponSunModel.expDate.weekShow,
textAlign: TextAlign.left,
style: TextStyle(
height: 1.5,
fontSize: font(16),
color: MyColours.color_999999),
),
)),
if (couponProvider.couponSunModel.expDate.isWeek)
VEmptyView(24),
]),
// couponProvider.couponSunModel.isType == '1'
// ? Column(
// crossAxisAlignment:
// CrossAxisAlignment.start,
// children: [
// Container(
// height: ScreenUtil().setWidth(2),
// color: MyColours.color_E7E7E7,
// ),
// VEmptyView(24),
// _item('创建人',
// couponProvider.couponSunModel.uid),
// ],
// )
// : SizedBox(),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
height: ScreenUtil().setWidth(2),
color: MyColours.color_E7E7E7,
),
VEmptyView(24),
_item('核销日期', '2023-05-05'),
Container(
height: ScreenUtil().setWidth(2),
color: MyColours.color_E7E7E7,
),
VEmptyView(24),
_item('核销人', '核销人'),
// _select(
// '谁可以发放',
// '查看',
// () async {
// await NavigatorUtil
// .goCouponToPersonnalPage(
// context,
// couponProvider
// .couponSunModel.uidList,
// onlyShow: true);
// },
// )
],
),
couponProvider.couponSunModel.explain != null &&
couponProvider.couponSunModel.explain != ''
? Container(
height: ScreenUtil().setWidth(2),
color: MyColours.color_E7E7E7,
)
: SizedBox(),
couponProvider.couponSunModel.explain != null &&
couponProvider.couponSunModel.explain != ''
? VEmptyView(24)
: SizedBox(),
couponProvider.couponSunModel.explain != null &&
couponProvider.couponSunModel.explain != ''
? _item('券说明', '')
: SizedBox(),
Container(
height: ScreenUtil().setWidth(2),
color: MyColours.color_E7E7E7,
),
VEmptyView(24),
if (couponProvider.couponSunModel.explain != null &&
couponProvider.couponSunModel.explain != '')
Align(
alignment: Alignment.centerLeft,
child: Text(
couponProvider.couponSunModel.explain,
textAlign: TextAlign.left,
style: TextStyle(
// height: 1.5,
fontSize: font(16),
color: MyColours.color_999999),
),
),
if (couponProvider.couponSunModel.explain != null &&
couponProvider.couponSunModel.explain != '')
VEmptyView(24),
// Container(
// height: ScreenUtil().setWidth(2),
// color: MyColours.color_E7E7E7,
// ),
VEmptyView(24),
_canUse(
'立即启用',
couponProvider.couponSunModel.status == '1'
? true
: false)
],
))),
)
]);
}
}));
}
}
... ...
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:one_key/res/colors.dart';
import 'package:one_key/widgets/v_empty_view.dart';
import '../../utils/screen_util.dart';
class CouponVerificationItemF extends StatefulWidget {
final VoidCallback onPressed;
CouponVerificationItemF({Key key, this.onPressed}) : super(key: key);
@override
_CouponVerificationItemFState createState() =>
_CouponVerificationItemFState();
}
class _CouponVerificationItemFState extends State<CouponVerificationItemF> {
@override
Widget build(BuildContext context) {
return InkWell(
onTap: widget.onPressed,
child: Container(
margin: EdgeInsets.only(bottom: w(16), left: w(20), right: w(20)),
decoration: BoxDecoration(
color: MyColours.color_ffffff,
borderRadius: BorderRadius.circular(r(8)),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: double.infinity,
decoration: BoxDecoration(
color: MyColours.color_DBDBDB,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(r(8)),
topRight: Radius.circular(r(8))),
),
padding:
EdgeInsets.symmetric(horizontal: w(20), vertical: w(4)),
constraints: BoxConstraints(minHeight: w(25)),
child: Row(
children: [
Expanded(
flex: 1,
child: Text(
'200元代金券',
style: TextStyle(
color: MyColours.color_999999,
fontSize: font(16),
fontWeight: FontWeight.bold,
),
)),
Expanded(
flex: 2,
child: Text(
'NO.01774420230223150306',
textAlign: TextAlign.right,
style: TextStyle(
color: MyColours.color_999999,
fontSize: font(12),
fontWeight: FontWeight.bold,
),
))
],
),
),
VEmptyView(24),
Padding(
padding: EdgeInsets.symmetric(horizontal: w(20)),
child: Text(
'核销:张阿生',
style: TextStyle(
color: MyColours.color_999999,
fontSize: font(12),
fontWeight: FontWeight.bold,
),
),
),
VEmptyView(10),
Padding(
padding: EdgeInsets.symmetric(horizontal: w(20)),
child: Text(
'日期:2023-05-05',
style: TextStyle(
color: MyColours.color_999999,
fontSize: font(12),
fontWeight: FontWeight.bold,
),
),
),
VEmptyView(24),
],
),
)) ;
}
}
... ...
... ... @@ -159,7 +159,9 @@ class _RechargeDetailPageState extends State<RechargeDetailPage> {
backgroundColor: MyColours.color_ffffff,
appBar: SystemAppBar(
'充值优惠详情',
rightImgName: widget.idstr != null &&
rightImgName: marketingCenterProvider != null &&
marketingCenterProvider.rechargeDetail != null &&
widget.idstr != null &&
widget.idstr != 'null' &&
marketingCenterProvider.rechargeDetail.isOpen == '1'
? 'share.png'
... ... @@ -168,7 +170,7 @@ class _RechargeDetailPageState extends State<RechargeDetailPage> {
if (widget.idstr != null &&
widget.idstr != 'null' &&
marketingCenterProvider.rechargeDetail.isOpen == '1') {
Utils.goShareBuyRechargeToWeChat(context, widget.idstr);
Utils.goShareBuyRechargeToWeChat(context, widget.idstr,marketingCenterProvider.rechargeDetail);
}
},
),
... ...
... ... @@ -514,7 +514,9 @@ class _RechargeEditPageState extends State<RechargeEditPage> {
backgroundColor: MyColours.color_ffffff,
appBar: SystemAppBar(
'充值优惠详情',
rightImgName: widget.idstr != null &&
rightImgName: marketingCenterProvider != null &&
marketingCenterProvider.rechargeDetail != null &&
widget.idstr != null &&
widget.idstr != 'null' &&
marketingCenterProvider.rechargeDetail.isOpen == '1'
? 'share.png'
... ... @@ -523,7 +525,8 @@ class _RechargeEditPageState extends State<RechargeEditPage> {
if (widget.idstr != null &&
widget.idstr != 'null' &&
marketingCenterProvider.rechargeDetail.isOpen == '1') {
Utils.goShareBuyRechargeToWeChat(context, widget.idstr);
Utils.goShareBuyRechargeToWeChat(
context, widget.idstr, marketingCenterProvider.rechargeDetail);
}
},
),
... ...
... ... @@ -1064,8 +1064,8 @@ class _MenuManagePageState extends State<MenuManagePage> {
Positioned(
bottom:
ScreenUtil().setWidth(14),
right:
ScreenUtil().setWidth(150),
right: ScreenUtil()
.setWidth(150),
child: model.status == '1'
? SizedBox()
: Image.asset(
... ...
... ... @@ -21,6 +21,7 @@ class CouponProvider with ChangeNotifier {
PageState pageStateMine = PageState.Loading;
PageState pageStateHistory = PageState.Loading;
PageState pageStateSelect = PageState.Loading;
PageState pageStateVerification = PageState.Loading;
bool hasModify = false;
int sendSMS = 0;
... ...
... ... @@ -1710,4 +1710,13 @@ class NavigatorUtil {
_navigateTo(context, "${Routes.feast_dish_share_page}?setmealId=$setmealId",
replace: replace);
}
/// 优惠券核销详情页
static Future<dynamic> goCouponVerificationDetailPage(
BuildContext context, CouponSunModel couponSunModel,
{replace = false, String idStr}) {
return _navigateTo(context,
"${Routes.coupon_verification_detail_page}?couponSunModel=${FluroConvertUtils.object2string(couponSunModel)}&idStr=$idStr",
replace: replace);
}
}
... ...
... ... @@ -96,7 +96,7 @@ import 'package:one_key/pages/my/personnel_type/personnel_password_show_page.dar
import 'package:one_key/pages/my/base_info.dart';
import 'package:one_key/pages/my/book_time_set.dart';
import 'package:one_key/pages/my/contant_page.dart';
// import 'package:one_key/pages/my/menu_type/menu_add_dishes_page_old.dart';
// import 'package:one_key/pages/my/menu_type/menu_add_dishes_page_old.dart';
import 'package:one_key/pages/my/menu_type/menu_category_page.dart';
// import 'package:one_key/pages/my/menu_type/menu_manage_page_old.dart';
import 'package:one_key/pages/my/my_integral_page.dart';
... ... @@ -161,6 +161,7 @@ import '../models/plan_cook_list_model.dart';
import '../models/set_xuan_tai_model.dart';
import '../models/setmeal_by_id_model.dart';
import '../models/wine_manage_model.dart';
import '../pages/coupon/coupon_verification_detail_page.dart';
import '../pages/coupon/verification_coupon_page.dart';
import '../pages/feast/feast_board.dart';
import '../pages/feast/feast_create_page.dart';
... ... @@ -2776,5 +2777,19 @@ var feastDishSharePageHandle = new Handler(
// .decode(FluroConvertUtils.fluroCnParamsDecode(params["detail"].first)));
return ChangeNotifierProvider<FeastModel>(
create: (_) => FeastModel(),
child: FeastDishSharePage(setmealId:setmealId));
child: FeastDishSharePage(setmealId: setmealId));
});
///优惠券核销详情页
var couponVerificationDetailPageHandle = new Handler(
handlerFunc: (BuildContext context, Map<String, List<Object>> params) {
String idStr = params["idStr"].first;
CouponSunModel couponSunModel;
if (idStr == null || idStr == 'null') {
couponSunModel = CouponSunModel.fromJson(json.decode(
FluroConvertUtils.fluroCnParamsDecode(params["couponSunModel"].first)));
}
return CouponVerificationDetailPage(
couponSunModel: couponSunModel, idstr: idStr);
});
... ...
... ... @@ -263,6 +263,12 @@ class Routes {
*/
static String feast_dish_share_page = "/feast_dish_share_page"; //宴会套餐分享页面
/**
* 优惠券
*/
static String coupon_verification_detail_page = "/coupon_verification_detail_page"; //优惠券核销详情
static void configureRoutes(FluroRouter router) {
router.notFoundHandler = new Handler(
handlerFunc: (BuildContext context, Map<String, List<String>> params) {
... ... @@ -493,5 +499,7 @@ class Routes {
handler: messageRechargeInfoPageHandle);
router.define(feast_dish_share_page, handler: feastDishSharePageHandle);
router.define(coupon_verification_detail_page,handler: couponVerificationDetailPageHandle);
}
}
... ...
... ... @@ -35,6 +35,9 @@ import 'package:permission_handler/permission_handler.dart';
import 'package:path_provider/path_provider.dart';
import 'package:image_cropper/image_cropper.dart';
import 'dart:math';
import '../models/coupon_model.dart';
import '../models/recharge_list_model.dart';
// import 'dart:typed_data';
typedef BookTimeSetCallback = void Function(bool needChange);
... ... @@ -1562,21 +1565,20 @@ class Utils {
// "https://xt04.colorcun.com/h5/index.html#/?id=163854&hasInvitation=1";
// String _thumbnail =
// "https://qn.colorcun.com/reserve/images/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_201911151148572.jpg";
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 _title = "充值优惠列表购买分享";
// String sellerImage =
// Provider.of<UserModel>(context, listen: false).user.sellerimage;
String _thumbnail = 'https://nosqn.colorcun.com/share_recharge.png';
String _title =
"${Provider.of<UserModel>(context, listen: false).user.sellername}诚邀您参加储值优惠活动,点击进入。";
String _userName = "gh_487873d353b3";
String _path =
"pack-cookbook/pages/favourableList?sellerName=${Provider.of<UserModel>(context, listen: false).user.sellername}&sellerid=${Provider.of<UserModel>(context, listen: false).user.sellerid}";
"pack-cookbook/pages/favourableList?sellerName=${Provider.of<UserModel>(context, listen: false).user.sellername}&sellerid=${Provider.of<UserModel>(context, listen: false).user.sellerid}&types=3";
// if (Provider.of<UserModel>(context, listen: false).user.sellerid == '677') {
// //京厨九跳转新的邀请函地址
// _path =
// "pages/customer/index?id=$rid&hasInvitation=1&hasSellerShare=1&uid=$uid";
// }
String _description = "充值优惠列表购买分享";
String _description = "诚邀您参加储值优惠活动,点击进入。";
// Uint8List source = await testComporessList(context, _thumbnail);
//跳转小程序
... ... @@ -1608,18 +1610,50 @@ class Utils {
}
//跳转到优惠券购买页面
static goShareBuyCouponToWeChat(BuildContext context, String couponid) async {
static goShareBuyCouponToWeChat(BuildContext context, String couponid,
CouponUse use, CouponSunModel couponSunModel) async {
String _webPageUrl = "http://colorcun.com/";
// String _thumbnail =
// "https://xt04.colorcun.com/h5/index.html#/?id=163854&hasInvitation=1";
// String _thumbnail =
// "https://qn.colorcun.com/reserve/images/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_201911151148572.jpg";
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 _title = "优惠券购买分享";
// String sellerImage =
// Provider.of<UserModel>(context, listen: false).user.sellerimage;
String price = couponSunModel.price;
String _thumbnail = 'https://nosqn.colorcun.com/share_recharge.png';
String _title =
"${Provider.of<UserModel>(context, listen: false).user.sellername}向您推荐一张优惠券,点击获取。";
if (use != null) {
if (use.isCash) {
_thumbnail = 'https://nosqn.colorcun.com/share_money.png';
if (price == '0') {
_title =
'免费获取${Provider.of<UserModel>(context, listen: false).user.sellername}${use.cash}元代金券,点击进入。';
} else {
_title =
'仅需${price}元,获取${Provider.of<UserModel>(context, listen: false).user.sellername}${use.cash}元代金券,点击进入。';
}
} else if (use.isDiscount) {
_thumbnail = 'https://nosqn.colorcun.com/share_discount.png';
if (price == '0') {
_title =
'免费获取${Provider.of<UserModel>(context, listen: false).user.sellername}${use.discount}折折扣券,点击进入。';
} else {
_title =
'仅需${price}元,获取${Provider.of<UserModel>(context, listen: false).user.sellername}${use.discount}折折扣券,点击进入。';
}
} else if (use.isDish) {
_thumbnail = 'https://nosqn.colorcun.com/share_dish.png';
if (price == '0') {
_title =
'免费获取${Provider.of<UserModel>(context, listen: false).user.sellername}${use.dish},点击进入。';
} else {
_title =
'仅需${price}元,获取${Provider.of<UserModel>(context, listen: false).user.sellername}${use.dish},点击进入。';
}
}
}
String _userName = "gh_487873d353b3";
String _path =
"pack-activity/pack/buyCoupon?id=$couponid&name=${Provider.of<UserModel>(context, listen: false).user.sellername}&sid=${Provider.of<UserModel>(context, listen: false).user.sellerid}&types=3";
... ... @@ -1660,19 +1694,19 @@ class Utils {
}
//跳转到充值优惠购买页面
static goShareBuyRechargeToWeChat(
BuildContext context, String rechargeid) async {
static goShareBuyRechargeToWeChat(BuildContext context, String rechargeid,
RechargeListSunModel rechargeListSunModel) async {
String _webPageUrl = "http://colorcun.com/";
// String _thumbnail =
// "https://xt04.colorcun.com/h5/index.html#/?id=163854&hasInvitation=1";
// String _thumbnail =
// "https://qn.colorcun.com/reserve/images/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_201911151148572.jpg";
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 _title = "充值优惠购买分享";
// String sellerImage =
// Provider.of<UserModel>(context, listen: false).user.sellerimage;
String _thumbnail = 'https://nosqn.colorcun.com/share_recharge.png';
String _title =
"${Provider.of<UserModel>(context, listen: false).user.sellername}诚邀您参加储值优惠活动,点击进入。";
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";
... ...