Commit 204caef7e5337411418902107ff71480aedf7f67

Authored by wdn127929
1 parent e68bea49

分享优惠券和充值优惠

@@ -510,7 +510,7 @@ @@ -510,7 +510,7 @@
510 CODE_SIGN_ENTITLEMENTS = Runner/RunnerProfile.entitlements; 510 CODE_SIGN_ENTITLEMENTS = Runner/RunnerProfile.entitlements;
511 CODE_SIGN_IDENTITY = "Apple Development"; 511 CODE_SIGN_IDENTITY = "Apple Development";
512 CODE_SIGN_STYLE = Automatic; 512 CODE_SIGN_STYLE = Automatic;
513 - CURRENT_PROJECT_VERSION = 476; 513 + CURRENT_PROJECT_VERSION = 483;
514 DEVELOPMENT_TEAM = 8J59HM8B82; 514 DEVELOPMENT_TEAM = 8J59HM8B82;
515 ENABLE_BITCODE = NO; 515 ENABLE_BITCODE = NO;
516 FLUTTER_BUILD_MODE = release; 516 FLUTTER_BUILD_MODE = release;
@@ -525,7 +525,7 @@ @@ -525,7 +525,7 @@
525 "$(inherited)", 525 "$(inherited)",
526 "$(PROJECT_DIR)/Flutter", 526 "$(PROJECT_DIR)/Flutter",
527 ); 527 );
528 - MARKETING_VERSION = 4.8.0; 528 + MARKETING_VERSION = 4.8.3;
529 PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine; 529 PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine;
530 PRODUCT_NAME = Runner; 530 PRODUCT_NAME = Runner;
531 PROVISIONING_PROFILE_SPECIFIER = ""; 531 PROVISIONING_PROFILE_SPECIFIER = "";
@@ -656,10 +656,10 @@ @@ -656,10 +656,10 @@
656 CODE_SIGN_ENTITLEMENTS = "Runner/一键订Debug.entitlements"; 656 CODE_SIGN_ENTITLEMENTS = "Runner/一键订Debug.entitlements";
657 CODE_SIGN_IDENTITY = "Apple Development"; 657 CODE_SIGN_IDENTITY = "Apple Development";
658 CODE_SIGN_STYLE = Automatic; 658 CODE_SIGN_STYLE = Automatic;
659 - CURRENT_PROJECT_VERSION = 476; 659 + CURRENT_PROJECT_VERSION = 483;
660 DEVELOPMENT_TEAM = 8J59HM8B82; 660 DEVELOPMENT_TEAM = 8J59HM8B82;
661 ENABLE_BITCODE = NO; 661 ENABLE_BITCODE = NO;
662 - FLUTTER_BUILD_MODE = release; 662 + FLUTTER_BUILD_MODE = debug;
663 FRAMEWORK_SEARCH_PATHS = ( 663 FRAMEWORK_SEARCH_PATHS = (
664 "$(inherited)", 664 "$(inherited)",
665 "$(PROJECT_DIR)/Flutter", 665 "$(PROJECT_DIR)/Flutter",
@@ -671,7 +671,7 @@ @@ -671,7 +671,7 @@
671 "$(inherited)", 671 "$(inherited)",
672 "$(PROJECT_DIR)/Flutter", 672 "$(PROJECT_DIR)/Flutter",
673 ); 673 );
674 - MARKETING_VERSION = 4.8.0; 674 + MARKETING_VERSION = 4.8.3;
675 PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine; 675 PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine;
676 PRODUCT_NAME = Runner; 676 PRODUCT_NAME = Runner;
677 PROVISIONING_PROFILE_SPECIFIER = ""; 677 PROVISIONING_PROFILE_SPECIFIER = "";
@@ -692,7 +692,7 @@ @@ -692,7 +692,7 @@
692 CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; 692 CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
693 CODE_SIGN_IDENTITY = "Apple Development"; 693 CODE_SIGN_IDENTITY = "Apple Development";
694 CODE_SIGN_STYLE = Automatic; 694 CODE_SIGN_STYLE = Automatic;
695 - CURRENT_PROJECT_VERSION = 476; 695 + CURRENT_PROJECT_VERSION = 483;
696 DEVELOPMENT_TEAM = 8J59HM8B82; 696 DEVELOPMENT_TEAM = 8J59HM8B82;
697 ENABLE_BITCODE = NO; 697 ENABLE_BITCODE = NO;
698 FLUTTER_BUILD_MODE = release; 698 FLUTTER_BUILD_MODE = release;
@@ -707,7 +707,7 @@ @@ -707,7 +707,7 @@
707 "$(inherited)", 707 "$(inherited)",
708 "$(PROJECT_DIR)/Flutter", 708 "$(PROJECT_DIR)/Flutter",
709 ); 709 );
710 - MARKETING_VERSION = 4.8.0; 710 + MARKETING_VERSION = 4.8.3;
711 PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine; 711 PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine;
712 PRODUCT_NAME = Runner; 712 PRODUCT_NAME = Runner;
713 PROVISIONING_PROFILE_SPECIFIER = ""; 713 PROVISIONING_PROFILE_SPECIFIER = "";
@@ -88,6 +88,9 @@ class CouponSunModel extends Object { @@ -88,6 +88,9 @@ class CouponSunModel extends Object {
88 @JsonKey(name: 'exp_date') 88 @JsonKey(name: 'exp_date')
89 ExpDate expDate; 89 ExpDate expDate;
90 90
  91 + @JsonKey(name: 'nick_name')
  92 + String nickNameShow;
  93 +
91 bool isCheck = false; 94 bool isCheck = false;
92 bool showText = false; 95 bool showText = false;
93 96
@@ -111,7 +114,8 @@ class CouponSunModel extends Object { @@ -111,7 +114,8 @@ class CouponSunModel extends Object {
111 this.isOpenBool, 114 this.isOpenBool,
112 this.price, 115 this.price,
113 this.use, 116 this.use,
114 - this.expDate); 117 + this.expDate,
  118 + this.nickNameShow);
115 119
116 factory CouponSunModel.fromJson(Map<String, dynamic> srcJson) => 120 factory CouponSunModel.fromJson(Map<String, dynamic> srcJson) =>
117 _$CouponSunModelFromJson(srcJson); 121 _$CouponSunModelFromJson(srcJson);
@@ -58,6 +58,7 @@ CouponSunModel _$CouponSunModelFromJson(Map<String, dynamic> json) { @@ -58,6 +58,7 @@ CouponSunModel _$CouponSunModelFromJson(Map<String, dynamic> json) {
58 : (json['exp_date'] is Map) 58 : (json['exp_date'] is Map)
59 ? ExpDate.fromJson(json['exp_date']) 59 ? ExpDate.fromJson(json['exp_date'])
60 : null, 60 : null,
  61 + json['nick_name'] as String,
61 ); 62 );
62 } 63 }
63 64
@@ -82,7 +83,8 @@ Map<String, dynamic> _$CouponSunModelToJson(CouponSunModel instance) => @@ -82,7 +83,8 @@ Map<String, dynamic> _$CouponSunModelToJson(CouponSunModel instance) =>
82 'isOpenBool': instance.isOpenBool, 83 'isOpenBool': instance.isOpenBool,
83 'price': instance.price, 84 'price': instance.price,
84 'use': instance.use, 85 'use': instance.use,
85 - 'exp_date': instance.expDate 86 + 'exp_date': instance.expDate,
  87 + 'nick_name':instance.nickNameShow
86 }; 88 };
87 89
88 CouponUse _$CouponUseFromJson(Map<String, dynamic> json) { 90 CouponUse _$CouponUseFromJson(Map<String, dynamic> json) {
@@ -46,13 +46,13 @@ class _CouponDetailPageState extends State<CouponDetailPage> { @@ -46,13 +46,13 @@ class _CouponDetailPageState extends State<CouponDetailPage> {
46 super.initState(); 46 super.initState();
47 47
48 WidgetsBinding.instance.addPostFrameCallback((_) { 48 WidgetsBinding.instance.addPostFrameCallback((_) {
49 - if (widget.idstr != null && widget.idstr != 'null') {  
50 - _getActivityById();  
51 - } else {  
52 - couponProvider.couponSunModel = widget.couponSunModel;  
53 - pageState = PageState.Success;  
54 - setState(() {});  
55 - } 49 + // if (widget.idstr != null && widget.idstr != 'null') {
  50 + _getActivityById();
  51 + // } else {
  52 + // couponProvider.couponSunModel = widget.couponSunModel;
  53 + // pageState = PageState.Success;
  54 + // setState(() {});
  55 + // }
56 }); 56 });
57 } 57 }
58 58
@@ -214,7 +214,9 @@ class _CouponDetailPageState extends State<CouponDetailPage> { @@ -214,7 +214,9 @@ class _CouponDetailPageState extends State<CouponDetailPage> {
214 onTap: () { 214 onTap: () {
215 Navigator.pop(context); 215 Navigator.pop(context);
216 }, 216 },
217 - rightImgName: couponProvider.couponSunModel.isType == '1' && 217 + rightImgName: couponProvider != null &&
  218 + couponProvider.couponSunModel != null &&
  219 + couponProvider.couponSunModel.isType == '1' &&
218 couponProvider.couponSunModel.isExamine == '1' && 220 couponProvider.couponSunModel.isExamine == '1' &&
219 couponProvider.couponSunModel.status == '1' 221 couponProvider.couponSunModel.status == '1'
220 ? 'share.png' 222 ? 'share.png'
@@ -224,7 +226,8 @@ class _CouponDetailPageState extends State<CouponDetailPage> { @@ -224,7 +226,8 @@ class _CouponDetailPageState extends State<CouponDetailPage> {
224 couponProvider.couponSunModel.isExamine == '1' && 226 couponProvider.couponSunModel.isExamine == '1' &&
225 couponProvider.couponSunModel.status == '1') { 227 couponProvider.couponSunModel.status == '1') {
226 //店铺可核销券 228 //店铺可核销券
227 - Utils.goShareBuyCouponToWeChat(context, widget.idstr); 229 + Utils.goShareBuyCouponToWeChat(
  230 + context, widget.idstr, couponProvider.couponSunModel.use,couponProvider.couponSunModel);
228 } 231 }
229 }, 232 },
230 ), 233 ),
@@ -424,18 +427,22 @@ class _CouponDetailPageState extends State<CouponDetailPage> { @@ -424,18 +427,22 @@ class _CouponDetailPageState extends State<CouponDetailPage> {
424 color: MyColours.color_E7E7E7, 427 color: MyColours.color_E7E7E7,
425 ), 428 ),
426 VEmptyView(24), 429 VEmptyView(24),
427 - _select(  
428 - '谁可以发放',  
429 - '查看',  
430 - () async {  
431 - await NavigatorUtil  
432 - .goCouponToPersonnalPage(  
433 - context,  
434 - couponProvider  
435 - .couponSunModel.uidList,  
436 - onlyShow: true);  
437 - },  
438 - ) 430 + _item(
  431 + '谁可以发放',
  432 + couponProvider
  433 + .couponSunModel.nickNameShow),
  434 + // _select(
  435 + // '谁可以发放',
  436 + // '查看',
  437 + // () async {
  438 + // await NavigatorUtil
  439 + // .goCouponToPersonnalPage(
  440 + // context,
  441 + // couponProvider
  442 + // .couponSunModel.uidList,
  443 + // onlyShow: true);
  444 + // },
  445 + // )
439 ], 446 ],
440 ) 447 )
441 : SizedBox(), 448 : SizedBox(),
@@ -1035,6 +1035,10 @@ class _CouponEidtPageState extends State<CouponEidtPage> { @@ -1035,6 +1035,10 @@ class _CouponEidtPageState extends State<CouponEidtPage> {
1035 Utils.showToast('请设置可用日期!'); 1035 Utils.showToast('请设置可用日期!');
1036 return; 1036 return;
1037 } 1037 }
  1038 + if (uids == null || uids == '') {
  1039 + Utils.showToast('请设置发放人!');
  1040 + return;
  1041 + }
1038 } 1042 }
1039 if (_couponRequireEditControl.text.trim().length == 0) { 1043 if (_couponRequireEditControl.text.trim().length == 0) {
1040 Utils.showToast('请填写券要求'); 1044 Utils.showToast('请填写券要求');
@@ -1054,6 +1058,7 @@ class _CouponEidtPageState extends State<CouponEidtPage> { @@ -1054,6 +1058,7 @@ class _CouponEidtPageState extends State<CouponEidtPage> {
1054 Utils.showToast('有效期结束时间不能早于起始时间'); 1058 Utils.showToast('有效期结束时间不能早于起始时间');
1055 return; 1059 return;
1056 } 1060 }
  1061 +
1057 // ***参数*** 1062 // ***参数***
1058 // _couponNameEditControl.text 1063 // _couponNameEditControl.text
1059 // _couponRequireEditControl.text 1064 // _couponRequireEditControl.text
  1 +import 'package:flutter/material.dart';
  2 +import 'package:flutter_easyrefresh/easy_refresh.dart';
  3 +import 'package:flutter_screenutil/flutter_screenutil.dart';
  4 +import 'package:one_key/constant/state.dart';
  5 +import 'package:one_key/models/personnel_manage_model.dart';
  6 +import 'package:one_key/pages/coupon/coupon_item_f.dart';
  7 +import 'package:one_key/provider/coupon_provider.dart';
  8 +import 'package:one_key/provider/personnel_provider.dart';
  9 +import 'package:one_key/provider/user_model.dart';
  10 +import 'package:one_key/res/colors.dart';
  11 +import 'package:one_key/route/navigator_util.dart';
  12 +import 'package:one_key/utils/event_bus.dart';
  13 +import 'package:one_key/widgets/page_exception.dart';
  14 +import 'package:one_key/widgets/v_empty_view.dart';
  15 +import 'package:provider/provider.dart';
  16 +
  17 +import 'coupon_verification_item_f.dart';
  18 +
  19 +/**
  20 + * 已核销列表
  21 + */
  22 +class CouponHasVerificationPage extends StatefulWidget {
  23 + CouponHasVerificationPage({Key key}) : super(key: key);
  24 +
  25 + @override
  26 + _CouponHasVerificationPageState createState() =>
  27 + _CouponHasVerificationPageState();
  28 +}
  29 +
  30 +class _CouponHasVerificationPageState extends State<CouponHasVerificationPage> {
  31 + CouponProvider couponProvider;
  32 + EasyRefreshController _controller = EasyRefreshController();
  33 + PersonnelProvider personnelProvider;
  34 + List<PersonnelManageSunModel> authUserLists = [];
  35 +
  36 + @override
  37 + void initState() {
  38 + // TODO: implement initState
  39 + super.initState();
  40 +
  41 + WidgetsBinding.instance.addPostFrameCallback((_) {
  42 + couponProvider.pageStateVerification = PageState.Success;
  43 + couponProvider.notifyListeners();
  44 + // _couponNetworkData(widget.index, isShowLoading: false);
  45 +
  46 + bus.on("refresh_coupon_verification_list", (arg) {
  47 + // _couponNetworkData(widget.index);
  48 + });
  49 + });
  50 + }
  51 +
  52 + @override
  53 + void dispose() {
  54 + super.dispose();
  55 + bus.off('refresh_coupon_verification_list');
  56 + }
  57 +
  58 + ///获取优惠券列表数据
  59 + _couponNetworkData(int index, {bool isShowLoading = true}) async {
  60 + Map<String, String> params = {
  61 + "uid": Provider.of<UserModel>(context, listen: false).user.openid,
  62 + // 'is_time': '0'
  63 + "is_type": index.toString()
  64 + };
  65 + await couponProvider.getCustomerActivity(context, params, index,
  66 + isShowLoading: isShowLoading);
  67 + }
  68 +
  69 + ///修改活动信息
  70 + _setCustomerActivity(int index) async {
  71 + Map<String, String> params = {
  72 + "id": couponProvider.couponList[index].id,
  73 + "status": couponProvider.couponList[index].isOpenBool ? '1' : '0',
  74 + 'is_open': couponProvider.couponList[index].isOpenBool ? '1' : '0',
  75 + };
  76 + bool isSuccess = await couponProvider.setCustomerActivity(context, params,
  77 + isShowLoading: false);
  78 + print(isSuccess);
  79 + // _couponNetworkData(widget.index, isShowLoading: false);
  80 + // if (isSuccess) {
  81 + // couponProvider.notifyListeners();
  82 + // } else {
  83 + // couponProvider.couponList[index].isOpenBool =
  84 + // !couponProvider.couponList[index].isOpenBool;
  85 + // couponProvider.notifyListeners();
  86 + // }
  87 + }
  88 +
  89 + @override
  90 + Widget build(BuildContext context) {
  91 + couponProvider = Provider.of<CouponProvider>(context, listen: true);
  92 + personnelProvider = Provider.of<PersonnelProvider>(context, listen: true);
  93 +
  94 + return Container(
  95 + color: MyColours.color_f3f3f3,
  96 + child: Consumer<CouponProvider>(builder: (context, model, _) {
  97 + if (model.pageStateVerification != PageState.Success) {
  98 + return ExceptionPage(
  99 + pageState: model.pageStateVerification,
  100 + callback: () {
  101 + // offset = 0;
  102 + // getMessage(showLoading: true);
  103 +
  104 + // if (model.pageStateVerification == PageState.Empty) {
  105 + // NavigatorUtil.goCouponHistoryPage(context);
  106 + // } else {
  107 + // // _couponNetworkData(widget.index);
  108 + // }
  109 + },
  110 + emptyMsg: "暂时没有列表信息哦,",
  111 + emptyImg: "empty_search",
  112 + showMsg: "加载中,请稍后...",
  113 + );
  114 + } else {
  115 + return EasyRefresh.custom(
  116 + controller: _controller,
  117 + shrinkWrap: true,
  118 + slivers: [
  119 + SliverList(
  120 + delegate: SliverChildBuilderDelegate(
  121 + (BuildContext context, int index) {
  122 + return CouponVerificationItemF(
  123 + // from: 'quan',
  124 + // couponSonModel: couponProvider.couponList[index],
  125 + // showBtn: true,
  126 + // onPressedSwich: () {
  127 + // couponProvider.couponList[index].isOpenBool =
  128 + // !couponProvider.couponList[index].isOpenBool;
  129 + // _setCustomerActivity(index);
  130 + // },
  131 + onPressed: () {
  132 + NavigatorUtil.goCouponVerificationDetailPage(
  133 + context, couponProvider.couponList[index],
  134 + idStr: couponProvider.couponList[index].id);
  135 + },
  136 + );
  137 + }, childCount: couponProvider.couponList.length),
  138 + ),
  139 + // SliverList(
  140 + // delegate: SliverChildBuilderDelegate(
  141 + // (BuildContext context, int index) {
  142 + // return Column(
  143 + // children: [
  144 + // InkWell(
  145 + // onTap: () {
  146 + // NavigatorUtil.goCouponHistoryPage(context);
  147 + // },
  148 + // child: RichText(
  149 + // text: TextSpan(
  150 + // style: TextStyle(
  151 + // fontSize: ScreenUtil().setSp(28),
  152 + // ),
  153 + // children: [
  154 + // TextSpan(
  155 + // text: '没有更多了,',
  156 + // style: TextStyle(
  157 + // color: MyColours.color_000000)),
  158 + // TextSpan(
  159 + // text: '查看过期优惠券',
  160 + // style: TextStyle(
  161 + // color: MyColours.color_438E93)),
  162 + // ]))),
  163 + // VEmptyView(80)
  164 + // ],
  165 + // );
  166 + // }, childCount: 1),
  167 + // )
  168 + ],
  169 + // onRefresh: () async {
  170 + // // offset = 0;
  171 + // // getMessage(showLoading: false);
  172 + // },
  173 + // onLoad: () async {
  174 + // // offset++;
  175 + // // getMessage(showLoading: false);
  176 + // },
  177 + );
  178 + }
  179 + }),
  180 + );
  181 + }
  182 +}
@@ -19,6 +19,7 @@ import 'package:barcode_scan2/barcode_scan2.dart'; @@ -19,6 +19,7 @@ import 'package:barcode_scan2/barcode_scan2.dart';
19 import '../../utils/dialog_util.dart'; 19 import '../../utils/dialog_util.dart';
20 import '../../utils/misc.dart'; 20 import '../../utils/misc.dart';
21 import '../../utils/utils.dart'; 21 import '../../utils/utils.dart';
  22 +import 'coupon_has_verification_page.dart';
22 23
23 /** 24 /**
24 * 优惠券列表 25 * 优惠券列表
@@ -86,7 +87,7 @@ class _CouponPageState extends State<CouponPage> with TickerProviderStateMixin { @@ -86,7 +87,7 @@ class _CouponPageState extends State<CouponPage> with TickerProviderStateMixin {
86 // // _numberOfCameras = await BarcodeScanner.numberOfCameras; 87 // // _numberOfCameras = await BarcodeScanner.numberOfCameras;
87 // setState(() {}); 88 // setState(() {});
88 // }); 89 // });
89 - tabController = TabController(length: 3, vsync: this); 90 + tabController = TabController(length: 4, vsync: this);
90 tabController.addListener(() { 91 tabController.addListener(() {
91 // couponProvider.couponList = []; 92 // couponProvider.couponList = [];
92 // couponProvider.pageState = PageState.Loading; 93 // couponProvider.pageState = PageState.Loading;
@@ -202,6 +203,9 @@ class _CouponPageState extends State<CouponPage> with TickerProviderStateMixin { @@ -202,6 +203,9 @@ class _CouponPageState extends State<CouponPage> with TickerProviderStateMixin {
202 ), 203 ),
203 Tab( 204 Tab(
204 text: "我的优惠券", 205 text: "我的优惠券",
  206 + ),
  207 + Tab(
  208 + text: "核销记录",
205 ) 209 )
206 ], 210 ],
207 indicatorColor: MyColours.color_438E93, 211 indicatorColor: MyColours.color_438E93,
@@ -232,57 +236,61 @@ class _CouponPageState extends State<CouponPage> with TickerProviderStateMixin { @@ -232,57 +236,61 @@ class _CouponPageState extends State<CouponPage> with TickerProviderStateMixin {
232 ChangeNotifierProvider<PersonnelProvider>( 236 ChangeNotifierProvider<PersonnelProvider>(
233 create: (_) => PersonnelProvider(), 237 create: (_) => PersonnelProvider(),
234 child: CouponSunPage(index: 2)), 238 child: CouponSunPage(index: 2)),
  239 + ChangeNotifierProvider<PersonnelProvider>(
  240 + create: (_) => PersonnelProvider(),
  241 + child: CouponHasVerificationPage()),
235 ], 242 ],
236 ), 243 ),
237 ), 244 ),
238 - Container(  
239 - height: ScreenUtil().setWidth(91 * 2),  
240 - width: double.infinity,  
241 - padding: EdgeInsets.only(  
242 - top: ScreenUtil().setWidth(16 * 2),  
243 - bottom: ScreenUtil().setWidth(35 * 2),  
244 - left: ScreenUtil().setWidth(45 * 2),  
245 - right: ScreenUtil().setWidth(45 * 2),  
246 - ),  
247 - decoration: BoxDecoration(  
248 - color: MyColours.color_ffffff,  
249 - boxShadow: [  
250 - BoxShadow(  
251 - spreadRadius: ScreenUtil().setWidth(2),  
252 - color: Color.fromRGBO(0, 0, 0, 0.1),  
253 - offset: Offset(0, ScreenUtil().setWidth(-2)),  
254 - blurRadius: ScreenUtil().setWidth(8))  
255 - ],  
256 - borderRadius: BorderRadius.all(  
257 - Radius.circular(ScreenUtil().setWidth(16)), 245 + if (tabController.index != 3)
  246 + Container(
  247 + height: ScreenUtil().setWidth(91 * 2),
  248 + width: double.infinity,
  249 + padding: EdgeInsets.only(
  250 + top: ScreenUtil().setWidth(16 * 2),
  251 + bottom: ScreenUtil().setWidth(35 * 2),
  252 + left: ScreenUtil().setWidth(45 * 2),
  253 + right: ScreenUtil().setWidth(45 * 2),
258 ), 254 ),
259 - ),  
260 - child: RoundButton(  
261 - text: '创建新的优惠券',  
262 - height: ScreenUtil().setWidth(80),  
263 - radius: ScreenUtil().setWidth(14),  
264 - isBold: false,  
265 - fontSize: 28,  
266 - onPressed: () async {  
267 - UserModel userModel =  
268 - Provider.of<UserModel>(context, listen: false);  
269 - if (userModel.user.role_name == '管理员' ||  
270 - userModel.user.role_name == '店长') {  
271 - NavigatorUtil.goCouponCreateSelectTypePage(context);  
272 - } else {  
273 - bool needRefresh =  
274 - await NavigatorUtil.goCouponEditPage(context);  
275 - print(needRefresh);  
276 - if (needRefresh != null && needRefresh) {  
277 - bus.emit('refresh_coupon_list_f');  
278 - //刷新页面数据  
279 - // _controller.callRefresh();  
280 - // _couponNetworkData(tabController.index); 255 + decoration: BoxDecoration(
  256 + color: MyColours.color_ffffff,
  257 + boxShadow: [
  258 + BoxShadow(
  259 + spreadRadius: ScreenUtil().setWidth(2),
  260 + color: Color.fromRGBO(0, 0, 0, 0.1),
  261 + offset: Offset(0, ScreenUtil().setWidth(-2)),
  262 + blurRadius: ScreenUtil().setWidth(8))
  263 + ],
  264 + borderRadius: BorderRadius.all(
  265 + Radius.circular(ScreenUtil().setWidth(16)),
  266 + ),
  267 + ),
  268 + child: RoundButton(
  269 + text: '创建新的优惠券',
  270 + height: ScreenUtil().setWidth(80),
  271 + radius: ScreenUtil().setWidth(14),
  272 + isBold: false,
  273 + fontSize: 28,
  274 + onPressed: () async {
  275 + UserModel userModel =
  276 + Provider.of<UserModel>(context, listen: false);
  277 + if (userModel.user.role_name == '管理员' ||
  278 + userModel.user.role_name == '店长') {
  279 + NavigatorUtil.goCouponCreateSelectTypePage(context);
  280 + } else {
  281 + bool needRefresh =
  282 + await NavigatorUtil.goCouponEditPage(context);
  283 + print(needRefresh);
  284 + if (needRefresh != null && needRefresh) {
  285 + bus.emit('refresh_coupon_list_f');
  286 + //刷新页面数据
  287 + // _controller.callRefresh();
  288 + // _couponNetworkData(tabController.index);
  289 + }
281 } 290 }
282 - }  
283 - },  
284 - ),  
285 - ) 291 + },
  292 + ),
  293 + )
286 ], 294 ],
287 ), 295 ),
288 // child: Column( 296 // child: Column(
@@ -52,6 +52,7 @@ class _CouponSunPageState extends State<CouponSunPage> { @@ -52,6 +52,7 @@ class _CouponSunPageState extends State<CouponSunPage> {
52 52
53 @override 53 @override
54 void dispose() { 54 void dispose() {
  55 +
55 super.dispose(); 56 super.dispose();
56 } 57 }
57 58
  1 +import 'package:common_utils/common_utils.dart';
  2 +import 'package:flutter/material.dart';
  3 +import 'package:flutter_picker/flutter_picker.dart';
  4 +import 'package:flutter_screenutil/flutter_screenutil.dart';
  5 +import 'package:fluttertoast/fluttertoast.dart';
  6 +import 'package:one_key/constant/state.dart';
  7 +import 'package:one_key/models/coupon_model.dart';
  8 +import 'package:one_key/provider/coupon_provider.dart';
  9 +import 'package:one_key/provider/user_model.dart';
  10 +import 'package:one_key/res/colors.dart';
  11 +import 'package:one_key/utils/dialog_util.dart';
  12 +import 'package:one_key/utils/event_bus.dart';
  13 +import 'package:one_key/route/navigator_util.dart';
  14 +import 'package:one_key/utils/utils.dart';
  15 +import 'package:one_key/widgets/h_empty_view.dart';
  16 +import 'package:one_key/widgets/round_button.dart';
  17 +import 'package:one_key/widgets/system_app_bar.dart';
  18 +import 'package:one_key/widgets/v_empty_view.dart';
  19 +import 'package:provider/provider.dart';
  20 +
  21 +import '../../utils/screen_util.dart';
  22 +import '../../widgets/page_exception.dart';
  23 +
  24 +/**
  25 + * 新建券
  26 + */
  27 +
  28 +class CouponVerificationDetailPage extends StatefulWidget {
  29 + final CouponSunModel couponSunModel;
  30 + final String idstr;
  31 + CouponVerificationDetailPage({Key key, this.couponSunModel, this.idstr})
  32 + : super(key: key);
  33 +
  34 + @override
  35 + _CouponVerificationDetailPageState createState() =>
  36 + _CouponVerificationDetailPageState();
  37 +}
  38 +
  39 +class _CouponVerificationDetailPageState
  40 + extends State<CouponVerificationDetailPage> {
  41 + ScrollController controller = ScrollController();
  42 + final heightCell = ScreenUtil().setWidth(80);
  43 + CouponProvider couponProvider;
  44 + PageState pageState = PageState.Loading;
  45 +
  46 + @override
  47 + void initState() {
  48 + super.initState();
  49 +
  50 + WidgetsBinding.instance.addPostFrameCallback((_) {
  51 + // if (widget.idstr != null && widget.idstr != 'null') {
  52 + _getActivityById();
  53 + // } else {
  54 + // couponProvider.couponSunModel = widget.couponSunModel;
  55 + // pageState = PageState.Success;
  56 + // setState(() {});
  57 + // }
  58 + });
  59 + }
  60 +
  61 + _getActivityById() async {
  62 + pageState = PageState.Loading;
  63 + bool success = await couponProvider
  64 + .getActivityById(context, {'id': widget.idstr}, isShowLoading: false);
  65 + if (success) {
  66 + pageState = PageState.Success;
  67 + } else {
  68 + pageState = PageState.ConnectivityError;
  69 + }
  70 + setState(() {});
  71 + }
  72 +
  73 + ///时间选择
  74 + Widget _select(String title, String hintText, GestureTapCallback onTap) {
  75 + return InkWell(
  76 + onTap: onTap,
  77 + child: Container(
  78 + padding: EdgeInsets.symmetric(vertical: ScreenUtil().setWidth(28)),
  79 + child: Row(
  80 + crossAxisAlignment: CrossAxisAlignment.center,
  81 + mainAxisAlignment: MainAxisAlignment.center,
  82 + children: [
  83 + Container(
  84 + // height: ScreenUtil().setWidth(40),
  85 + // color: Colors.red,
  86 + child: Text(
  87 + title,
  88 + style: TextStyle(
  89 + color: MyColours.color_515151,
  90 + fontSize: ScreenUtil().setSp(32)),
  91 + ),
  92 + ),
  93 + HEmptyView(20),
  94 + Spacer(),
  95 + Text(hintText,
  96 + style: TextStyle(
  97 + color: hintText == '点击选择'
  98 + ? MyColours.color_999999
  99 + : MyColours.color_515151,
  100 + fontSize: ScreenUtil().setSp(32),
  101 + )),
  102 + HEmptyView(20),
  103 + Image.asset(
  104 + Utils.getImgPath('arrow_right_new'),
  105 + width: ScreenUtil().setWidth(20),
  106 + ),
  107 + HEmptyView(32),
  108 + ],
  109 + ),
  110 + ),
  111 + );
  112 + }
  113 +
  114 + ///输入框
  115 + Widget _item(String title, String subTitle) {
  116 + return Container(
  117 + padding: EdgeInsets.symmetric(vertical: ScreenUtil().setWidth(24)),
  118 + child: Row(
  119 + crossAxisAlignment: CrossAxisAlignment.center,
  120 + mainAxisAlignment: MainAxisAlignment.center,
  121 + children: [
  122 + Container(
  123 + child: Text(
  124 + title,
  125 + style: TextStyle(
  126 + color: MyColours.color_515151,
  127 + fontSize: ScreenUtil().setSp(32)),
  128 + ),
  129 + ),
  130 + HEmptyView(60),
  131 + Expanded(
  132 + child: Text(
  133 + subTitle,
  134 + maxLines: 20,
  135 + textAlign: TextAlign.right,
  136 + overflow: TextOverflow.ellipsis,
  137 + style: TextStyle(
  138 + color: Color.fromRGBO(0, 0, 0, 0.4),
  139 + fontSize: ScreenUtil().setSp(32),
  140 + ),
  141 + ))
  142 + ],
  143 + ),
  144 + );
  145 + }
  146 +
  147 + ///输入框
  148 + Widget _textShow(String title, String subtitle) {
  149 + return Container(
  150 + padding: EdgeInsets.only(
  151 + left: w(15),
  152 + ),
  153 + child: Row(
  154 + mainAxisAlignment: MainAxisAlignment.spaceBetween,
  155 + children: [
  156 + Container(
  157 + child: Text(
  158 + title,
  159 + style: TextStyle(
  160 + color: Color.fromRGBO(0, 0, 0, 0.9),
  161 + fontSize: ScreenUtil().setSp(32)),
  162 + ),
  163 + ),
  164 + Spacer(),
  165 + Text(
  166 + subtitle,
  167 +
  168 + //输入文本的样式
  169 + style: TextStyle(
  170 + color: Color.fromRGBO(0, 0, 0, 0.4),
  171 + fontSize: ScreenUtil().setSp(32),
  172 + ),
  173 + ),
  174 + ],
  175 + ),
  176 + );
  177 + }
  178 +
  179 + ///是否立即启用
  180 + Widget _canUse(String title, bool swich) {
  181 + return Container(
  182 + padding: EdgeInsets.symmetric(vertical: ScreenUtil().setWidth(24)),
  183 + child: Row(
  184 + crossAxisAlignment: CrossAxisAlignment.center,
  185 + mainAxisAlignment: MainAxisAlignment.center,
  186 + children: [
  187 + Container(
  188 + // height: ScreenUtil().setWidth(40),
  189 + // color: Colors.red,
  190 + child: Text(
  191 + title,
  192 + style: TextStyle(
  193 + color: MyColours.color_515151,
  194 + fontSize: ScreenUtil().setSp(32)),
  195 + ),
  196 + ),
  197 + Spacer(),
  198 + Image.asset(
  199 + swich
  200 + ? Utils.getImgPath('swich_on')
  201 + : Utils.getImgPath('swich_off'),
  202 + width: ScreenUtil().setWidth(44 * 2),
  203 + )
  204 + ],
  205 + ),
  206 + );
  207 + }
  208 +
  209 + @override
  210 + Widget build(BuildContext context) {
  211 + couponProvider = Provider.of<CouponProvider>(context, listen: true);
  212 + return Scaffold(
  213 + backgroundColor: MyColours.color_ffffff,
  214 + appBar: SystemAppBar(
  215 + '优惠券详情',
  216 + onTap: () {
  217 + Navigator.pop(context);
  218 + },
  219 + rightImgName: couponProvider.couponSunModel.isType == '1' &&
  220 + couponProvider.couponSunModel.isExamine == '1' &&
  221 + couponProvider.couponSunModel.status == '1'
  222 + ? 'share.png'
  223 + : null,
  224 + onTapRight: () {
  225 + if (couponProvider.couponSunModel.isType == '1' &&
  226 + couponProvider.couponSunModel.isExamine == '1' &&
  227 + couponProvider.couponSunModel.status == '1') {
  228 + //店铺可核销券
  229 + Utils.goShareBuyCouponToWeChat(
  230 + context,
  231 + widget.idstr,
  232 + couponProvider.couponSunModel.use,
  233 + couponProvider.couponSunModel);
  234 + }
  235 + },
  236 + ),
  237 + body: Consumer<CouponProvider>(builder: (context, model, _) {
  238 + if (pageState != PageState.Success) {
  239 + return ExceptionPage(
  240 + pageState: pageState,
  241 + callback: () {
  242 + _getActivityById();
  243 + },
  244 + emptyMsg: "暂时没有数据哦,",
  245 + emptyImg: "empty_search",
  246 + showMsg: "加载中,请稍后...",
  247 + );
  248 + } else {
  249 + return Column(children: [
  250 + Expanded(
  251 + child: SingleChildScrollView(
  252 + controller: controller,
  253 + physics: BouncingScrollPhysics(),
  254 + child: Padding(
  255 + padding: EdgeInsets.symmetric(
  256 + horizontal: ScreenUtil().setWidth(32)),
  257 + child: Column(
  258 + children: [
  259 + VEmptyView(56),
  260 + _item(
  261 + '券类型',
  262 + couponProvider.couponSunModel.isType == '1'
  263 + ? '店铺优惠券'
  264 + : '我的优惠券'),
  265 + Container(
  266 + height: ScreenUtil().setWidth(2),
  267 + color: MyColours.color_E7E7E7,
  268 + ),
  269 + VEmptyView(24),
  270 + _item('券编码', 'NO.01774420230223150306'),
  271 + Container(
  272 + height: ScreenUtil().setWidth(2),
  273 + color: MyColours.color_E7E7E7,
  274 + ),
  275 + VEmptyView(24),
  276 + _item('券名称', couponProvider.couponSunModel.aname),
  277 + Container(
  278 + height: ScreenUtil().setWidth(2),
  279 + color: MyColours.color_E7E7E7,
  280 + ),
  281 +
  282 + VEmptyView(24),
  283 + if (couponProvider.couponSunModel.use != null)
  284 + Column(
  285 + crossAxisAlignment: CrossAxisAlignment.start,
  286 + children: [
  287 + // _item(
  288 + // '券用途',
  289 + // couponProvider.couponSunModel.use.isCash
  290 + // ? '代金券'
  291 + // : couponProvider
  292 + // .couponSunModel.use.isDiscount
  293 + // ? '折扣券'
  294 + // : couponProvider
  295 + // .couponSunModel.use.isDish
  296 + // ? '菜品券'
  297 + // : ''),
  298 + // Container(
  299 + // height: ScreenUtil().setWidth(2),
  300 + // color: MyColours.color_E7E7E7,
  301 + // ),
  302 + // VEmptyView(24),
  303 + // _item(
  304 + // couponProvider.couponSunModel.use.isCash
  305 + // ? '金额'
  306 + // : couponProvider
  307 + // .couponSunModel.use.isDiscount
  308 + // ? '折扣率'
  309 + // : couponProvider
  310 + // .couponSunModel.use.isDish
  311 + // ? '菜品'
  312 + // : '',
  313 + // couponProvider.couponSunModel.use.isCash
  314 + // ? '${couponProvider.couponSunModel.use.cash}元'
  315 + // : couponProvider
  316 + // .couponSunModel.use.isDiscount
  317 + // ? '${couponProvider.couponSunModel.use.discount}折'
  318 + // : couponProvider
  319 + // .couponSunModel.use.isDish
  320 + // ? couponProvider
  321 + // .couponSunModel.use.dish
  322 + // : ''),
  323 + // Container(
  324 + // height: ScreenUtil().setWidth(2),
  325 + // color: MyColours.color_E7E7E7,
  326 + // ),
  327 + // VEmptyView(24),
  328 + _item(
  329 + '销售价',
  330 + '${couponProvider.couponSunModel.price}元' ??
  331 + ''),
  332 + Container(
  333 + height: ScreenUtil().setWidth(2),
  334 + color: MyColours.color_E7E7E7,
  335 + ),
  336 + VEmptyView(24),
  337 + ],
  338 + ),
  339 + _item('券要求', couponProvider.couponSunModel.desc),
  340 + Container(
  341 + height: ScreenUtil().setWidth(2),
  342 + color: MyColours.color_E7E7E7,
  343 + ),
  344 + VEmptyView(24),
  345 + _item(
  346 + '有效期从',
  347 + Utils.getDateStrFromJiekou(
  348 + couponProvider.couponSunModel.stime)),
  349 + Container(
  350 + height: ScreenUtil().setWidth(2),
  351 + color: MyColours.color_E7E7E7,
  352 + ),
  353 + VEmptyView(24),
  354 + _item(
  355 + '有效期至',
  356 + Utils.getDateStrFromJiekou(
  357 + couponProvider.couponSunModel.etime)),
  358 +
  359 + Column(children: [
  360 + Container(
  361 + height: ScreenUtil().setWidth(2),
  362 + color: MyColours.color_E7E7E7,
  363 + ),
  364 + VEmptyView(24),
  365 + _item(
  366 + '使用限制',
  367 + couponProvider.couponSunModel.expDate.isNone
  368 + ? '无'
  369 + : couponProvider
  370 + .couponSunModel.expDate.isBirthday
  371 + ? '会员生日当天'
  372 + : couponProvider
  373 + .couponSunModel.expDate.isWeek
  374 + ? '每周指定日期餐段可用'
  375 + : ''),
  376 + if (couponProvider.couponSunModel.expDate.isWeek)
  377 + Align(
  378 + alignment: Alignment.centerLeft,
  379 + child: Padding(
  380 + padding: EdgeInsets.only(left: w(16)),
  381 + child: Text(
  382 + couponProvider
  383 + .couponSunModel.expDate.weekShow,
  384 + textAlign: TextAlign.left,
  385 + style: TextStyle(
  386 + height: 1.5,
  387 + fontSize: font(16),
  388 + color: MyColours.color_999999),
  389 + ),
  390 + )),
  391 + if (couponProvider.couponSunModel.expDate.isWeek)
  392 + VEmptyView(24),
  393 + ]),
  394 +
  395 + // couponProvider.couponSunModel.isType == '1'
  396 + // ? Column(
  397 + // crossAxisAlignment:
  398 + // CrossAxisAlignment.start,
  399 + // children: [
  400 + // Container(
  401 + // height: ScreenUtil().setWidth(2),
  402 + // color: MyColours.color_E7E7E7,
  403 + // ),
  404 + // VEmptyView(24),
  405 + // _item('创建人',
  406 + // couponProvider.couponSunModel.uid),
  407 + // ],
  408 + // )
  409 + // : SizedBox(),
  410 + Column(
  411 + crossAxisAlignment: CrossAxisAlignment.start,
  412 + children: [
  413 + Container(
  414 + height: ScreenUtil().setWidth(2),
  415 + color: MyColours.color_E7E7E7,
  416 + ),
  417 + VEmptyView(24),
  418 + _item('核销日期', '2023-05-05'),
  419 + Container(
  420 + height: ScreenUtil().setWidth(2),
  421 + color: MyColours.color_E7E7E7,
  422 + ),
  423 + VEmptyView(24),
  424 + _item('核销人', '核销人'),
  425 + // _select(
  426 + // '谁可以发放',
  427 + // '查看',
  428 + // () async {
  429 + // await NavigatorUtil
  430 + // .goCouponToPersonnalPage(
  431 + // context,
  432 + // couponProvider
  433 + // .couponSunModel.uidList,
  434 + // onlyShow: true);
  435 + // },
  436 + // )
  437 + ],
  438 + ),
  439 + couponProvider.couponSunModel.explain != null &&
  440 + couponProvider.couponSunModel.explain != ''
  441 + ? Container(
  442 + height: ScreenUtil().setWidth(2),
  443 + color: MyColours.color_E7E7E7,
  444 + )
  445 + : SizedBox(),
  446 + couponProvider.couponSunModel.explain != null &&
  447 + couponProvider.couponSunModel.explain != ''
  448 + ? VEmptyView(24)
  449 + : SizedBox(),
  450 + couponProvider.couponSunModel.explain != null &&
  451 + couponProvider.couponSunModel.explain != ''
  452 + ? _item('券说明', '')
  453 + : SizedBox(),
  454 + Container(
  455 + height: ScreenUtil().setWidth(2),
  456 + color: MyColours.color_E7E7E7,
  457 + ),
  458 + VEmptyView(24),
  459 + if (couponProvider.couponSunModel.explain != null &&
  460 + couponProvider.couponSunModel.explain != '')
  461 + Align(
  462 + alignment: Alignment.centerLeft,
  463 + child: Text(
  464 + couponProvider.couponSunModel.explain,
  465 + textAlign: TextAlign.left,
  466 + style: TextStyle(
  467 + // height: 1.5,
  468 + fontSize: font(16),
  469 + color: MyColours.color_999999),
  470 + ),
  471 + ),
  472 + if (couponProvider.couponSunModel.explain != null &&
  473 + couponProvider.couponSunModel.explain != '')
  474 + VEmptyView(24),
  475 + // Container(
  476 + // height: ScreenUtil().setWidth(2),
  477 + // color: MyColours.color_E7E7E7,
  478 + // ),
  479 + VEmptyView(24),
  480 + _canUse(
  481 + '立即启用',
  482 + couponProvider.couponSunModel.status == '1'
  483 + ? true
  484 + : false)
  485 + ],
  486 + ))),
  487 + )
  488 + ]);
  489 + }
  490 + }));
  491 + }
  492 +}
  1 +import 'package:flutter/material.dart';
  2 +import 'package:flutter/rendering.dart';
  3 +import 'package:one_key/res/colors.dart';
  4 +import 'package:one_key/widgets/v_empty_view.dart';
  5 +
  6 +import '../../utils/screen_util.dart';
  7 +
  8 +class CouponVerificationItemF extends StatefulWidget {
  9 + final VoidCallback onPressed;
  10 + CouponVerificationItemF({Key key, this.onPressed}) : super(key: key);
  11 +
  12 + @override
  13 + _CouponVerificationItemFState createState() =>
  14 + _CouponVerificationItemFState();
  15 +}
  16 +
  17 +class _CouponVerificationItemFState extends State<CouponVerificationItemF> {
  18 + @override
  19 + Widget build(BuildContext context) {
  20 + return InkWell(
  21 + onTap: widget.onPressed,
  22 + child: Container(
  23 + margin: EdgeInsets.only(bottom: w(16), left: w(20), right: w(20)),
  24 + decoration: BoxDecoration(
  25 + color: MyColours.color_ffffff,
  26 + borderRadius: BorderRadius.circular(r(8)),
  27 + ),
  28 + child: Column(
  29 + crossAxisAlignment: CrossAxisAlignment.start,
  30 + children: [
  31 + Container(
  32 + width: double.infinity,
  33 + decoration: BoxDecoration(
  34 + color: MyColours.color_DBDBDB,
  35 + borderRadius: BorderRadius.only(
  36 + topLeft: Radius.circular(r(8)),
  37 + topRight: Radius.circular(r(8))),
  38 + ),
  39 + padding:
  40 + EdgeInsets.symmetric(horizontal: w(20), vertical: w(4)),
  41 + constraints: BoxConstraints(minHeight: w(25)),
  42 + child: Row(
  43 + children: [
  44 + Expanded(
  45 + flex: 1,
  46 + child: Text(
  47 + '200元代金券',
  48 + style: TextStyle(
  49 + color: MyColours.color_999999,
  50 + fontSize: font(16),
  51 + fontWeight: FontWeight.bold,
  52 + ),
  53 + )),
  54 + Expanded(
  55 + flex: 2,
  56 + child: Text(
  57 + 'NO.01774420230223150306',
  58 + textAlign: TextAlign.right,
  59 + style: TextStyle(
  60 + color: MyColours.color_999999,
  61 + fontSize: font(12),
  62 + fontWeight: FontWeight.bold,
  63 + ),
  64 + ))
  65 + ],
  66 + ),
  67 + ),
  68 + VEmptyView(24),
  69 + Padding(
  70 + padding: EdgeInsets.symmetric(horizontal: w(20)),
  71 + child: Text(
  72 + '核销:张阿生',
  73 + style: TextStyle(
  74 + color: MyColours.color_999999,
  75 + fontSize: font(12),
  76 + fontWeight: FontWeight.bold,
  77 + ),
  78 + ),
  79 + ),
  80 + VEmptyView(10),
  81 + Padding(
  82 + padding: EdgeInsets.symmetric(horizontal: w(20)),
  83 + child: Text(
  84 + '日期:2023-05-05',
  85 + style: TextStyle(
  86 + color: MyColours.color_999999,
  87 + fontSize: font(12),
  88 + fontWeight: FontWeight.bold,
  89 + ),
  90 + ),
  91 + ),
  92 + VEmptyView(24),
  93 + ],
  94 + ),
  95 + )) ;
  96 + }
  97 +}
@@ -159,7 +159,9 @@ class _RechargeDetailPageState extends State<RechargeDetailPage> { @@ -159,7 +159,9 @@ class _RechargeDetailPageState extends State<RechargeDetailPage> {
159 backgroundColor: MyColours.color_ffffff, 159 backgroundColor: MyColours.color_ffffff,
160 appBar: SystemAppBar( 160 appBar: SystemAppBar(
161 '充值优惠详情', 161 '充值优惠详情',
162 - rightImgName: widget.idstr != null && 162 + rightImgName: marketingCenterProvider != null &&
  163 + marketingCenterProvider.rechargeDetail != null &&
  164 + widget.idstr != null &&
163 widget.idstr != 'null' && 165 widget.idstr != 'null' &&
164 marketingCenterProvider.rechargeDetail.isOpen == '1' 166 marketingCenterProvider.rechargeDetail.isOpen == '1'
165 ? 'share.png' 167 ? 'share.png'
@@ -168,7 +170,7 @@ class _RechargeDetailPageState extends State<RechargeDetailPage> { @@ -168,7 +170,7 @@ class _RechargeDetailPageState extends State<RechargeDetailPage> {
168 if (widget.idstr != null && 170 if (widget.idstr != null &&
169 widget.idstr != 'null' && 171 widget.idstr != 'null' &&
170 marketingCenterProvider.rechargeDetail.isOpen == '1') { 172 marketingCenterProvider.rechargeDetail.isOpen == '1') {
171 - Utils.goShareBuyRechargeToWeChat(context, widget.idstr); 173 + Utils.goShareBuyRechargeToWeChat(context, widget.idstr,marketingCenterProvider.rechargeDetail);
172 } 174 }
173 }, 175 },
174 ), 176 ),
@@ -514,7 +514,9 @@ class _RechargeEditPageState extends State<RechargeEditPage> { @@ -514,7 +514,9 @@ class _RechargeEditPageState extends State<RechargeEditPage> {
514 backgroundColor: MyColours.color_ffffff, 514 backgroundColor: MyColours.color_ffffff,
515 appBar: SystemAppBar( 515 appBar: SystemAppBar(
516 '充值优惠详情', 516 '充值优惠详情',
517 - rightImgName: widget.idstr != null && 517 + rightImgName: marketingCenterProvider != null &&
  518 + marketingCenterProvider.rechargeDetail != null &&
  519 + widget.idstr != null &&
518 widget.idstr != 'null' && 520 widget.idstr != 'null' &&
519 marketingCenterProvider.rechargeDetail.isOpen == '1' 521 marketingCenterProvider.rechargeDetail.isOpen == '1'
520 ? 'share.png' 522 ? 'share.png'
@@ -523,7 +525,8 @@ class _RechargeEditPageState extends State<RechargeEditPage> { @@ -523,7 +525,8 @@ class _RechargeEditPageState extends State<RechargeEditPage> {
523 if (widget.idstr != null && 525 if (widget.idstr != null &&
524 widget.idstr != 'null' && 526 widget.idstr != 'null' &&
525 marketingCenterProvider.rechargeDetail.isOpen == '1') { 527 marketingCenterProvider.rechargeDetail.isOpen == '1') {
526 - Utils.goShareBuyRechargeToWeChat(context, widget.idstr); 528 + Utils.goShareBuyRechargeToWeChat(
  529 + context, widget.idstr, marketingCenterProvider.rechargeDetail);
527 } 530 }
528 }, 531 },
529 ), 532 ),
@@ -1064,8 +1064,8 @@ class _MenuManagePageState extends State<MenuManagePage> { @@ -1064,8 +1064,8 @@ class _MenuManagePageState extends State<MenuManagePage> {
1064 Positioned( 1064 Positioned(
1065 bottom: 1065 bottom:
1066 ScreenUtil().setWidth(14), 1066 ScreenUtil().setWidth(14),
1067 - right:  
1068 - ScreenUtil().setWidth(150), 1067 + right: ScreenUtil()
  1068 + .setWidth(150),
1069 child: model.status == '1' 1069 child: model.status == '1'
1070 ? SizedBox() 1070 ? SizedBox()
1071 : Image.asset( 1071 : Image.asset(
@@ -21,6 +21,7 @@ class CouponProvider with ChangeNotifier { @@ -21,6 +21,7 @@ class CouponProvider with ChangeNotifier {
21 PageState pageStateMine = PageState.Loading; 21 PageState pageStateMine = PageState.Loading;
22 PageState pageStateHistory = PageState.Loading; 22 PageState pageStateHistory = PageState.Loading;
23 PageState pageStateSelect = PageState.Loading; 23 PageState pageStateSelect = PageState.Loading;
  24 + PageState pageStateVerification = PageState.Loading;
24 bool hasModify = false; 25 bool hasModify = false;
25 int sendSMS = 0; 26 int sendSMS = 0;
26 27
@@ -1710,4 +1710,13 @@ class NavigatorUtil { @@ -1710,4 +1710,13 @@ class NavigatorUtil {
1710 _navigateTo(context, "${Routes.feast_dish_share_page}?setmealId=$setmealId", 1710 _navigateTo(context, "${Routes.feast_dish_share_page}?setmealId=$setmealId",
1711 replace: replace); 1711 replace: replace);
1712 } 1712 }
  1713 +
  1714 + /// 优惠券核销详情页
  1715 + static Future<dynamic> goCouponVerificationDetailPage(
  1716 + BuildContext context, CouponSunModel couponSunModel,
  1717 + {replace = false, String idStr}) {
  1718 + return _navigateTo(context,
  1719 + "${Routes.coupon_verification_detail_page}?couponSunModel=${FluroConvertUtils.object2string(couponSunModel)}&idStr=$idStr",
  1720 + replace: replace);
  1721 + }
1713 } 1722 }
@@ -96,7 +96,7 @@ import 'package:one_key/pages/my/personnel_type/personnel_password_show_page.dar @@ -96,7 +96,7 @@ import 'package:one_key/pages/my/personnel_type/personnel_password_show_page.dar
96 import 'package:one_key/pages/my/base_info.dart'; 96 import 'package:one_key/pages/my/base_info.dart';
97 import 'package:one_key/pages/my/book_time_set.dart'; 97 import 'package:one_key/pages/my/book_time_set.dart';
98 import 'package:one_key/pages/my/contant_page.dart'; 98 import 'package:one_key/pages/my/contant_page.dart';
99 -// import 'package:one_key/pages/my/menu_type/menu_add_dishes_page_old.dart'; 99 +// import 'package:one_key/pages/my/menu_type/menu_add_dishes_page_old.dart';
100 import 'package:one_key/pages/my/menu_type/menu_category_page.dart'; 100 import 'package:one_key/pages/my/menu_type/menu_category_page.dart';
101 // import 'package:one_key/pages/my/menu_type/menu_manage_page_old.dart'; 101 // import 'package:one_key/pages/my/menu_type/menu_manage_page_old.dart';
102 import 'package:one_key/pages/my/my_integral_page.dart'; 102 import 'package:one_key/pages/my/my_integral_page.dart';
@@ -161,6 +161,7 @@ import '../models/plan_cook_list_model.dart'; @@ -161,6 +161,7 @@ import '../models/plan_cook_list_model.dart';
161 import '../models/set_xuan_tai_model.dart'; 161 import '../models/set_xuan_tai_model.dart';
162 import '../models/setmeal_by_id_model.dart'; 162 import '../models/setmeal_by_id_model.dart';
163 import '../models/wine_manage_model.dart'; 163 import '../models/wine_manage_model.dart';
  164 +import '../pages/coupon/coupon_verification_detail_page.dart';
164 import '../pages/coupon/verification_coupon_page.dart'; 165 import '../pages/coupon/verification_coupon_page.dart';
165 import '../pages/feast/feast_board.dart'; 166 import '../pages/feast/feast_board.dart';
166 import '../pages/feast/feast_create_page.dart'; 167 import '../pages/feast/feast_create_page.dart';
@@ -2776,5 +2777,19 @@ var feastDishSharePageHandle = new Handler( @@ -2776,5 +2777,19 @@ var feastDishSharePageHandle = new Handler(
2776 // .decode(FluroConvertUtils.fluroCnParamsDecode(params["detail"].first))); 2777 // .decode(FluroConvertUtils.fluroCnParamsDecode(params["detail"].first)));
2777 return ChangeNotifierProvider<FeastModel>( 2778 return ChangeNotifierProvider<FeastModel>(
2778 create: (_) => FeastModel(), 2779 create: (_) => FeastModel(),
2779 - child: FeastDishSharePage(setmealId:setmealId)); 2780 + child: FeastDishSharePage(setmealId: setmealId));
  2781 +});
  2782 +
  2783 +///优惠券核销详情页
  2784 +var couponVerificationDetailPageHandle = new Handler(
  2785 + handlerFunc: (BuildContext context, Map<String, List<Object>> params) {
  2786 + String idStr = params["idStr"].first;
  2787 + CouponSunModel couponSunModel;
  2788 + if (idStr == null || idStr == 'null') {
  2789 + couponSunModel = CouponSunModel.fromJson(json.decode(
  2790 + FluroConvertUtils.fluroCnParamsDecode(params["couponSunModel"].first)));
  2791 + }
  2792 +
  2793 + return CouponVerificationDetailPage(
  2794 + couponSunModel: couponSunModel, idstr: idStr);
2780 }); 2795 });
@@ -263,6 +263,12 @@ class Routes { @@ -263,6 +263,12 @@ class Routes {
263 */ 263 */
264 static String feast_dish_share_page = "/feast_dish_share_page"; //宴会套餐分享页面 264 static String feast_dish_share_page = "/feast_dish_share_page"; //宴会套餐分享页面
265 265
  266 + /**
  267 + * 优惠券
  268 + */
  269 + static String coupon_verification_detail_page = "/coupon_verification_detail_page"; //优惠券核销详情
  270 +
  271 +
266 static void configureRoutes(FluroRouter router) { 272 static void configureRoutes(FluroRouter router) {
267 router.notFoundHandler = new Handler( 273 router.notFoundHandler = new Handler(
268 handlerFunc: (BuildContext context, Map<String, List<String>> params) { 274 handlerFunc: (BuildContext context, Map<String, List<String>> params) {
@@ -493,5 +499,7 @@ class Routes { @@ -493,5 +499,7 @@ class Routes {
493 handler: messageRechargeInfoPageHandle); 499 handler: messageRechargeInfoPageHandle);
494 500
495 router.define(feast_dish_share_page, handler: feastDishSharePageHandle); 501 router.define(feast_dish_share_page, handler: feastDishSharePageHandle);
  502 + router.define(coupon_verification_detail_page,handler: couponVerificationDetailPageHandle);
  503 +
496 } 504 }
497 } 505 }
@@ -35,6 +35,9 @@ import 'package:permission_handler/permission_handler.dart'; @@ -35,6 +35,9 @@ import 'package:permission_handler/permission_handler.dart';
35 import 'package:path_provider/path_provider.dart'; 35 import 'package:path_provider/path_provider.dart';
36 import 'package:image_cropper/image_cropper.dart'; 36 import 'package:image_cropper/image_cropper.dart';
37 import 'dart:math'; 37 import 'dart:math';
  38 +
  39 +import '../models/coupon_model.dart';
  40 +import '../models/recharge_list_model.dart';
38 // import 'dart:typed_data'; 41 // import 'dart:typed_data';
39 42
40 typedef BookTimeSetCallback = void Function(bool needChange); 43 typedef BookTimeSetCallback = void Function(bool needChange);
@@ -1562,21 +1565,20 @@ class Utils { @@ -1562,21 +1565,20 @@ class Utils {
1562 // "https://xt04.colorcun.com/h5/index.html#/?id=163854&hasInvitation=1"; 1565 // "https://xt04.colorcun.com/h5/index.html#/?id=163854&hasInvitation=1";
1563 // String _thumbnail = 1566 // String _thumbnail =
1564 // "https://qn.colorcun.com/reserve/images/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_201911151148572.jpg"; 1567 // "https://qn.colorcun.com/reserve/images/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_201911151148572.jpg";
1565 - String sellerImage =  
1566 - Provider.of<UserModel>(context, listen: false).user.sellerimage;  
1567 - String _thumbnail = sellerImage == null || sellerImage == ''  
1568 - ? 'http://nosqn.colorcun.com/reserve/images/3x/%E6%9A%82%E6%97%A0.png'  
1569 - : sellerImage;  
1570 - String _title = "充值优惠列表购买分享"; 1568 + // String sellerImage =
  1569 + // Provider.of<UserModel>(context, listen: false).user.sellerimage;
  1570 + String _thumbnail = 'https://nosqn.colorcun.com/share_recharge.png';
  1571 + String _title =
  1572 + "${Provider.of<UserModel>(context, listen: false).user.sellername}诚邀您参加储值优惠活动,点击进入。";
1571 String _userName = "gh_487873d353b3"; 1573 String _userName = "gh_487873d353b3";
1572 String _path = 1574 String _path =
1573 - "pack-cookbook/pages/favourableList?sellerName=${Provider.of<UserModel>(context, listen: false).user.sellername}&sellerid=${Provider.of<UserModel>(context, listen: false).user.sellerid}"; 1575 + "pack-cookbook/pages/favourableList?sellerName=${Provider.of<UserModel>(context, listen: false).user.sellername}&sellerid=${Provider.of<UserModel>(context, listen: false).user.sellerid}&types=3";
1574 // if (Provider.of<UserModel>(context, listen: false).user.sellerid == '677') { 1576 // if (Provider.of<UserModel>(context, listen: false).user.sellerid == '677') {
1575 // //京厨九跳转新的邀请函地址 1577 // //京厨九跳转新的邀请函地址
1576 // _path = 1578 // _path =
1577 // "pages/customer/index?id=$rid&hasInvitation=1&hasSellerShare=1&uid=$uid"; 1579 // "pages/customer/index?id=$rid&hasInvitation=1&hasSellerShare=1&uid=$uid";
1578 // } 1580 // }
1579 - String _description = "充值优惠列表购买分享"; 1581 + String _description = "诚邀您参加储值优惠活动,点击进入。";
1580 // Uint8List source = await testComporessList(context, _thumbnail); 1582 // Uint8List source = await testComporessList(context, _thumbnail);
1581 1583
1582 //跳转小程序 1584 //跳转小程序
@@ -1608,18 +1610,50 @@ class Utils { @@ -1608,18 +1610,50 @@ class Utils {
1608 } 1610 }
1609 1611
1610 //跳转到优惠券购买页面 1612 //跳转到优惠券购买页面
1611 - static goShareBuyCouponToWeChat(BuildContext context, String couponid) async { 1613 + static goShareBuyCouponToWeChat(BuildContext context, String couponid,
  1614 + CouponUse use, CouponSunModel couponSunModel) async {
1612 String _webPageUrl = "http://colorcun.com/"; 1615 String _webPageUrl = "http://colorcun.com/";
1613 // String _thumbnail = 1616 // String _thumbnail =
1614 // "https://xt04.colorcun.com/h5/index.html#/?id=163854&hasInvitation=1"; 1617 // "https://xt04.colorcun.com/h5/index.html#/?id=163854&hasInvitation=1";
1615 // String _thumbnail = 1618 // String _thumbnail =
1616 // "https://qn.colorcun.com/reserve/images/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_201911151148572.jpg"; 1619 // "https://qn.colorcun.com/reserve/images/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_201911151148572.jpg";
1617 - String sellerImage =  
1618 - Provider.of<UserModel>(context, listen: false).user.sellerimage;  
1619 - String _thumbnail = sellerImage == null || sellerImage == ''  
1620 - ? 'http://nosqn.colorcun.com/reserve/images/3x/%E6%9A%82%E6%97%A0.png'  
1621 - : sellerImage;  
1622 - String _title = "优惠券购买分享"; 1620 + // String sellerImage =
  1621 + // Provider.of<UserModel>(context, listen: false).user.sellerimage;
  1622 + String price = couponSunModel.price;
  1623 + String _thumbnail = 'https://nosqn.colorcun.com/share_recharge.png';
  1624 + String _title =
  1625 + "${Provider.of<UserModel>(context, listen: false).user.sellername}向您推荐一张优惠券,点击获取。";
  1626 + if (use != null) {
  1627 + if (use.isCash) {
  1628 + _thumbnail = 'https://nosqn.colorcun.com/share_money.png';
  1629 + if (price == '0') {
  1630 + _title =
  1631 + '免费获取${Provider.of<UserModel>(context, listen: false).user.sellername}${use.cash}元代金券,点击进入。';
  1632 + } else {
  1633 + _title =
  1634 + '仅需${price}元,获取${Provider.of<UserModel>(context, listen: false).user.sellername}${use.cash}元代金券,点击进入。';
  1635 + }
  1636 + } else if (use.isDiscount) {
  1637 + _thumbnail = 'https://nosqn.colorcun.com/share_discount.png';
  1638 + if (price == '0') {
  1639 + _title =
  1640 + '免费获取${Provider.of<UserModel>(context, listen: false).user.sellername}${use.discount}折折扣券,点击进入。';
  1641 + } else {
  1642 + _title =
  1643 + '仅需${price}元,获取${Provider.of<UserModel>(context, listen: false).user.sellername}${use.discount}折折扣券,点击进入。';
  1644 + }
  1645 + } else if (use.isDish) {
  1646 + _thumbnail = 'https://nosqn.colorcun.com/share_dish.png';
  1647 + if (price == '0') {
  1648 + _title =
  1649 + '免费获取${Provider.of<UserModel>(context, listen: false).user.sellername}${use.dish},点击进入。';
  1650 + } else {
  1651 + _title =
  1652 + '仅需${price}元,获取${Provider.of<UserModel>(context, listen: false).user.sellername}${use.dish},点击进入。';
  1653 + }
  1654 + }
  1655 + }
  1656 +
1623 String _userName = "gh_487873d353b3"; 1657 String _userName = "gh_487873d353b3";
1624 String _path = 1658 String _path =
1625 "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"; 1659 "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 { @@ -1660,19 +1694,19 @@ class Utils {
1660 } 1694 }
1661 1695
1662 //跳转到充值优惠购买页面 1696 //跳转到充值优惠购买页面
1663 - static goShareBuyRechargeToWeChat(  
1664 - BuildContext context, String rechargeid) async { 1697 + static goShareBuyRechargeToWeChat(BuildContext context, String rechargeid,
  1698 + RechargeListSunModel rechargeListSunModel) async {
1665 String _webPageUrl = "http://colorcun.com/"; 1699 String _webPageUrl = "http://colorcun.com/";
1666 // String _thumbnail = 1700 // String _thumbnail =
1667 // "https://xt04.colorcun.com/h5/index.html#/?id=163854&hasInvitation=1"; 1701 // "https://xt04.colorcun.com/h5/index.html#/?id=163854&hasInvitation=1";
1668 // String _thumbnail = 1702 // String _thumbnail =
1669 // "https://qn.colorcun.com/reserve/images/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_201911151148572.jpg"; 1703 // "https://qn.colorcun.com/reserve/images/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_201911151148572.jpg";
1670 - String sellerImage =  
1671 - Provider.of<UserModel>(context, listen: false).user.sellerimage;  
1672 - String _thumbnail = sellerImage == null || sellerImage == ''  
1673 - ? 'http://nosqn.colorcun.com/reserve/images/3x/%E6%9A%82%E6%97%A0.png'  
1674 - : sellerImage;  
1675 - String _title = "充值优惠购买分享"; 1704 + // String sellerImage =
  1705 + // Provider.of<UserModel>(context, listen: false).user.sellerimage;
  1706 + String _thumbnail = 'https://nosqn.colorcun.com/share_recharge.png';
  1707 +
  1708 + String _title =
  1709 + "${Provider.of<UserModel>(context, listen: false).user.sellername}诚邀您参加储值优惠活动,点击进入。";
1676 String _userName = "gh_487873d353b3"; 1710 String _userName = "gh_487873d353b3";
1677 String _path = 1711 String _path =
1678 "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"; 1712 "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";