|
|
|
1
|
+
|
|
|
|
2
|
+// import 'dart:convert';
|
|
|
|
3
|
+
|
|
|
|
4
|
+// import 'package:common_utils/common_utils.dart';
|
|
|
|
5
|
+// import 'package:flutter/material.dart';
|
|
|
|
6
|
+// import 'package:flutter/services.dart';
|
|
|
|
7
|
+// import 'package:flutter_keyboard_visibility/flutter_keyboard_visibility.dart';
|
|
|
|
8
|
+// import 'package:flutter_picker_plus/flutter_picker_plus.dart';
|
|
|
|
9
|
+// import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
|
10
|
+// import 'package:one_key/models/coupon_model.dart';
|
|
|
|
11
|
+// import 'package:one_key/models/filter_btn_model.dart';
|
|
|
|
12
|
+// import 'package:one_key/provider/user_model.dart';
|
|
|
|
13
|
+// import 'package:one_key/route/navigator_util.dart';
|
|
|
|
14
|
+// import 'package:one_key/widgets/MyDivider.dart';
|
|
|
|
15
|
+// import 'package:one_key/widgets/system_app_bar.dart';
|
|
|
|
16
|
+// import 'package:provider/provider.dart';
|
|
|
|
17
|
+
|
|
|
|
18
|
+// import '../../../../provider/marketing_center_provider.dart';
|
|
|
|
19
|
+// import '../../../../res/colors.dart';
|
|
|
|
20
|
+// import '../../../../utils/dialog_util.dart';
|
|
|
|
21
|
+// import '../../../../utils/event_bus.dart';
|
|
|
|
22
|
+// import '../../../../utils/screen_util.dart';
|
|
|
|
23
|
+// import '../../../../utils/utils.dart';
|
|
|
|
24
|
+// import '../../../../widgets/h_empty_view.dart';
|
|
|
|
25
|
+// import '../../../../widgets/round_button.dart';
|
|
|
|
26
|
+// import '../../../../widgets/v_empty_view.dart';
|
|
|
|
27
|
+
|
|
|
|
28
|
+// /**
|
|
|
|
29
|
+// *
|
|
|
|
30
|
+// * 新建优惠券
|
|
|
|
31
|
+// */
|
|
|
|
32
|
+
|
|
|
|
33
|
+// class RechargeEditPage extends StatefulWidget {
|
|
|
|
34
|
+// final String? idstr;
|
|
|
|
35
|
+// RechargeEditPage({Key? key, this.idstr}) : super(key: key);
|
|
|
|
36
|
+
|
|
|
|
37
|
+// @override
|
|
|
|
38
|
+// _RechargeEditPageState createState() => _RechargeEditPageState();
|
|
|
|
39
|
+// }
|
|
|
|
40
|
+
|
|
|
|
41
|
+// class _RechargeEditPageState extends State<RechargeEditPage> {
|
|
|
|
42
|
+// TextEditingController nameC = TextEditingController();
|
|
|
|
43
|
+// TextEditingController priceminC = TextEditingController();
|
|
|
|
44
|
+// TextEditingController givePriceC = TextEditingController(); //赠送金额
|
|
|
|
45
|
+// TextEditingController giveScoreC = TextEditingController(); //积分
|
|
|
|
46
|
+// TextEditingController remarkC = TextEditingController(); //备注
|
|
|
|
47
|
+
|
|
|
|
48
|
+// FocusNode nameF = FocusNode();
|
|
|
|
49
|
+// FocusNode priceminF = FocusNode();
|
|
|
|
50
|
+// FocusNode givePricF = FocusNode();
|
|
|
|
51
|
+// FocusNode giveScoreF = FocusNode();
|
|
|
|
52
|
+// FocusNode remarkF = FocusNode();
|
|
|
|
53
|
+// bool fixdate = true;
|
|
|
|
54
|
+// bool weekly = false;
|
|
|
|
55
|
+// bool birthday = false;
|
|
|
|
56
|
+// final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>();
|
|
|
|
57
|
+
|
|
|
|
58
|
+// bool showDateSelWidget = false;
|
|
|
|
59
|
+// String fromDate = '点击设置开始日期'; //有效期开始时间
|
|
|
|
60
|
+// String endDate = '点击设置结束日期'; //有效期结束时间
|
|
|
|
61
|
+
|
|
|
|
62
|
+// List<FilterBtnModel>? weekData = [];
|
|
|
|
63
|
+
|
|
|
|
64
|
+// String weekShow = '点击设置可用日期';
|
|
|
|
65
|
+// bool canUse = true;
|
|
|
|
66
|
+// List<dynamic>? coupons = [];
|
|
|
|
67
|
+
|
|
|
|
68
|
+// List<dynamic>? selectIDs = [];
|
|
|
|
69
|
+
|
|
|
|
70
|
+// bool givePriceSwich = false;
|
|
|
|
71
|
+// bool giveScoreSwich = false;
|
|
|
|
72
|
+// bool giveCouponsSwich = false;
|
|
|
|
73
|
+
|
|
|
|
74
|
+// List<CouponSunModel>? couponsData = [];
|
|
|
|
75
|
+
|
|
|
|
76
|
+// MarketingCenterProvider? marketingCenterProvider;
|
|
|
|
77
|
+
|
|
|
|
78
|
+// @override
|
|
|
|
79
|
+// void initState() {
|
|
|
|
80
|
+// super.initState();
|
|
|
|
81
|
+
|
|
|
|
82
|
+// _initWeekData();
|
|
|
|
83
|
+
|
|
|
|
84
|
+// nameF.addListener(() {
|
|
|
|
85
|
+// if (nameF.hasFocus) {
|
|
|
|
86
|
+// //有焦点
|
|
|
|
87
|
+// if (showDateSelWidget) {
|
|
|
|
88
|
+// if (Navigator.canPop(context)) {
|
|
|
|
89
|
+// Navigator.pop(context);
|
|
|
|
90
|
+// }
|
|
|
|
91
|
+// showDateSelWidget = false;
|
|
|
|
92
|
+// }
|
|
|
|
93
|
+// } else {
|
|
|
|
94
|
+// //失去焦点
|
|
|
|
95
|
+// // _editingController.text = '';
|
|
|
|
96
|
+// }
|
|
|
|
97
|
+// });
|
|
|
|
98
|
+// priceminF.addListener(() {
|
|
|
|
99
|
+// if (priceminF.hasFocus) {
|
|
|
|
100
|
+// //有焦点
|
|
|
|
101
|
+// if (showDateSelWidget) {
|
|
|
|
102
|
+// if (Navigator.canPop(context)) {
|
|
|
|
103
|
+// Navigator.pop(context);
|
|
|
|
104
|
+// }
|
|
|
|
105
|
+// showDateSelWidget = false;
|
|
|
|
106
|
+// }
|
|
|
|
107
|
+// } else {
|
|
|
|
108
|
+// //失去焦点
|
|
|
|
109
|
+// // _editingController.text = '';
|
|
|
|
110
|
+// }
|
|
|
|
111
|
+// });
|
|
|
|
112
|
+// givePricF.addListener(() {
|
|
|
|
113
|
+// if (givePricF.hasFocus) {
|
|
|
|
114
|
+// //有焦点
|
|
|
|
115
|
+// if (showDateSelWidget) {
|
|
|
|
116
|
+// if (Navigator.canPop(context)) {
|
|
|
|
117
|
+// Navigator.pop(context);
|
|
|
|
118
|
+// }
|
|
|
|
119
|
+// showDateSelWidget = false;
|
|
|
|
120
|
+// }
|
|
|
|
121
|
+// } else {
|
|
|
|
122
|
+// //失去焦点
|
|
|
|
123
|
+// // _editingController.text = '';
|
|
|
|
124
|
+// }
|
|
|
|
125
|
+// });
|
|
|
|
126
|
+// giveScoreF.addListener(() {
|
|
|
|
127
|
+// if (giveScoreF.hasFocus) {
|
|
|
|
128
|
+// //有焦点
|
|
|
|
129
|
+// if (showDateSelWidget) {
|
|
|
|
130
|
+// if (Navigator.canPop(context)) {
|
|
|
|
131
|
+// Navigator.pop(context);
|
|
|
|
132
|
+// }
|
|
|
|
133
|
+// showDateSelWidget = false;
|
|
|
|
134
|
+// }
|
|
|
|
135
|
+// } else {
|
|
|
|
136
|
+// //失去焦点
|
|
|
|
137
|
+// // _editingController.text = '';
|
|
|
|
138
|
+// }
|
|
|
|
139
|
+// });
|
|
|
|
140
|
+// remarkF.addListener(() {
|
|
|
|
141
|
+// if (remarkF.hasFocus) {
|
|
|
|
142
|
+// //有焦点
|
|
|
|
143
|
+// if (showDateSelWidget) {
|
|
|
|
144
|
+// if (Navigator.canPop(context)) {
|
|
|
|
145
|
+// Navigator.pop(context);
|
|
|
|
146
|
+// }
|
|
|
|
147
|
+// showDateSelWidget = false;
|
|
|
|
148
|
+// }
|
|
|
|
149
|
+// } else {
|
|
|
|
150
|
+// //失去焦点
|
|
|
|
151
|
+// // _editingController.text = '';
|
|
|
|
152
|
+// }
|
|
|
|
153
|
+// });
|
|
|
|
154
|
+
|
|
|
|
155
|
+// WidgetsBinding.instance.addPostFrameCallback((_) {
|
|
|
|
156
|
+// if (widget.idstr != null && widget.idstr != 'null') {
|
|
|
|
157
|
+// _getNewRechargeDetail();
|
|
|
|
158
|
+// }
|
|
|
|
159
|
+// });
|
|
|
|
160
|
+// }
|
|
|
|
161
|
+
|
|
|
|
162
|
+// _getNewRechargeDetail() async {
|
|
|
|
163
|
+// bool success = await marketingCenterProvider!.getNewRechargeDetail(
|
|
|
|
164
|
+// context, widget.idstr);
|
|
|
|
165
|
+// if (success) {
|
|
|
|
166
|
+// //请求成功
|
|
|
|
167
|
+// nameC.text = marketingCenterProvider!.rechargeDetail!.rname??"";
|
|
|
|
168
|
+// priceminC.text = marketingCenterProvider!.rechargeDetail!.rechargeMoney??"";
|
|
|
|
169
|
+// givePriceSwich =
|
|
|
|
170
|
+// marketingCenterProvider!.rechargeDetail!.rechargeList!.isPrice == '1'
|
|
|
|
171
|
+// ? true
|
|
|
|
172
|
+// : false;
|
|
|
|
173
|
+// givePriceC.text =
|
|
|
|
174
|
+// marketingCenterProvider!.rechargeDetail!.rechargeList!.price!;
|
|
|
|
175
|
+// giveScoreSwich =
|
|
|
|
176
|
+// marketingCenterProvider!.rechargeDetail!.rechargeList!.isScore == '1'
|
|
|
|
177
|
+// ? true
|
|
|
|
178
|
+// : false;
|
|
|
|
179
|
+// giveScoreC.text =
|
|
|
|
180
|
+// marketingCenterProvider!.rechargeDetail!.rechargeList!.score!;
|
|
|
|
181
|
+// giveCouponsSwich =
|
|
|
|
182
|
+// marketingCenterProvider!.rechargeDetail!.rechargeList!.isCoupons == '1'
|
|
|
|
183
|
+// ? true
|
|
|
|
184
|
+// : false;
|
|
|
|
185
|
+// selectIDs =
|
|
|
|
186
|
+// marketingCenterProvider!.rechargeDetail!.rechargeList!.couponsIds;
|
|
|
|
187
|
+
|
|
|
|
188
|
+// couponsData = marketingCenterProvider!.rechargeDetail!.rechargeList!.coupons;
|
|
|
|
189
|
+// coupons =
|
|
|
|
190
|
+// marketingCenterProvider!.rechargeDetail!.rechargeList!.couponsNames;
|
|
|
|
191
|
+// fixdate = marketingCenterProvider!.rechargeDetail!.expDate!.isFix == '1'
|
|
|
|
192
|
+// ? true
|
|
|
|
193
|
+// : false;
|
|
|
|
194
|
+// // if (marketingCenterProvider.rechargeDetail.expDate.fixSdate != '') {
|
|
|
|
195
|
+// fromDate = marketingCenterProvider!.rechargeDetail!.stimeStr;
|
|
|
|
196
|
+// // }
|
|
|
|
197
|
+// // if (marketingCenterProvider.rechargeDetail.expDate.fixEdate != '') {
|
|
|
|
198
|
+// endDate = marketingCenterProvider!.rechargeDetail!.etimeStr;
|
|
|
|
199
|
+// // }
|
|
|
|
200
|
+
|
|
|
|
201
|
+// weekly = marketingCenterProvider!.rechargeDetail!.expDate!.isWeek == '1'
|
|
|
|
202
|
+// ? true
|
|
|
|
203
|
+// : false;
|
|
|
|
204
|
+// if (marketingCenterProvider!.rechargeDetail!.expDate!.weekDateShow != '') {
|
|
|
|
205
|
+// weekShow = marketingCenterProvider!.rechargeDetail!.expDate!.weekDateShow!;
|
|
|
|
206
|
+// }
|
|
|
|
207
|
+
|
|
|
|
208
|
+// if (marketingCenterProvider!.rechargeDetail!.expDate!.weekDateData!.length >
|
|
|
|
209
|
+// 0) {
|
|
|
|
210
|
+// weekData = marketingCenterProvider!.rechargeDetail!.expDate!.weekDateData;
|
|
|
|
211
|
+// }
|
|
|
|
212
|
+
|
|
|
|
213
|
+// birthday =
|
|
|
|
214
|
+// marketingCenterProvider!.rechargeDetail!.expDate!.isBirthday == '1'
|
|
|
|
215
|
+// ? true
|
|
|
|
216
|
+// : false;
|
|
|
|
217
|
+
|
|
|
|
218
|
+// remarkC.text = marketingCenterProvider!.rechargeDetail!.explain??"";
|
|
|
|
219
|
+// canUse =
|
|
|
|
220
|
+// marketingCenterProvider!.rechargeDetail!.isOpen == '1' ? true : false;
|
|
|
|
221
|
+// setState(() {});
|
|
|
|
222
|
+// }
|
|
|
|
223
|
+// }
|
|
|
|
224
|
+
|
|
|
|
225
|
+// _initWeekData() {
|
|
|
|
226
|
+// FilterBtnModel filterBtnModel = FilterBtnModel();
|
|
|
|
227
|
+// filterBtnModel.select = false;
|
|
|
|
228
|
+// filterBtnModel.title = '周日';
|
|
|
|
229
|
+// weekData!.add(filterBtnModel);
|
|
|
|
230
|
+// for (int i = 1; i < 7; i++) {
|
|
|
|
231
|
+// FilterBtnModel filterBtnModel = FilterBtnModel();
|
|
|
|
232
|
+// filterBtnModel.select = false;
|
|
|
|
233
|
+// filterBtnModel.title = '周${Utils.formatWeekDayNum(i)}';
|
|
|
|
234
|
+// weekData!.add(filterBtnModel);
|
|
|
|
235
|
+// }
|
|
|
|
236
|
+// }
|
|
|
|
237
|
+
|
|
|
|
238
|
+// ///输入框
|
|
|
|
239
|
+// Widget _textfield(String title, String hintText,
|
|
|
|
240
|
+// TextEditingController controller, FocusNode node,
|
|
|
|
241
|
+// {TextInputType textInputStyle = TextInputType.text}) {
|
|
|
|
242
|
+// return Container(
|
|
|
|
243
|
+// child: Row(
|
|
|
|
244
|
+// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
245
|
+// children: [
|
|
|
|
246
|
+// Container(
|
|
|
|
247
|
+// child: Text(
|
|
|
|
248
|
+// title,
|
|
|
|
249
|
+// style: TextStyle(
|
|
|
|
250
|
+// color: MyColours.color_515151,
|
|
|
|
251
|
+// fontSize: ScreenUtil().setSp(32)),
|
|
|
|
252
|
+// ),
|
|
|
|
253
|
+// ),
|
|
|
|
254
|
+// HEmptyView(80),
|
|
|
|
255
|
+// Expanded(
|
|
|
|
256
|
+// child: TextField(
|
|
|
|
257
|
+// controller: controller,
|
|
|
|
258
|
+// focusNode: node,
|
|
|
|
259
|
+// textAlign: TextAlign.right,
|
|
|
|
260
|
+// textAlignVertical: TextAlignVertical.bottom,
|
|
|
|
261
|
+// maxLines: 1,
|
|
|
|
262
|
+// // //光标颜色
|
|
|
|
263
|
+// // cursorColor:
|
|
|
|
264
|
+// // widget.isSelect ? Colors.white : MyColours.color_199095,
|
|
|
|
265
|
+// //输入文本的样式
|
|
|
|
266
|
+
|
|
|
|
267
|
+// inputFormatters:
|
|
|
|
268
|
+// title == '活动名称' ? [LengthLimitingTextInputFormatter(15)] : [],
|
|
|
|
269
|
+// style: TextStyle(
|
|
|
|
270
|
+// color: MyColours.color_515151,
|
|
|
|
271
|
+// fontSize: ScreenUtil().setSp(32),
|
|
|
|
272
|
+// ),
|
|
|
|
273
|
+// // focusNode: title == '券名称' ? _nameFocusNode : _requireFocusNode,
|
|
|
|
274
|
+// decoration: InputDecoration(
|
|
|
|
275
|
+// border: OutlineInputBorder(borderSide: BorderSide.none),
|
|
|
|
276
|
+// hintText: hintText,
|
|
|
|
277
|
+// hintStyle: TextStyle(
|
|
|
|
278
|
+// color: MyColours.color_999999,
|
|
|
|
279
|
+// fontSize: ScreenUtil().setSp(32),
|
|
|
|
280
|
+// ),
|
|
|
|
281
|
+// enabledBorder: new UnderlineInputBorder(
|
|
|
|
282
|
+// borderSide: BorderSide.none,
|
|
|
|
283
|
+// ),
|
|
|
|
284
|
+// focusedBorder: new UnderlineInputBorder(
|
|
|
|
285
|
+// borderSide: BorderSide.none,
|
|
|
|
286
|
+// ),
|
|
|
|
287
|
+// ),
|
|
|
|
288
|
+// onChanged: (value) {},
|
|
|
|
289
|
+// onEditingComplete: () {
|
|
|
|
290
|
+// FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘
|
|
|
|
291
|
+// },
|
|
|
|
292
|
+// keyboardType: textInputStyle,
|
|
|
|
293
|
+// ),
|
|
|
|
294
|
+// ),
|
|
|
|
295
|
+// HEmptyView(32)
|
|
|
|
296
|
+// ],
|
|
|
|
297
|
+// ),
|
|
|
|
298
|
+// );
|
|
|
|
299
|
+// }
|
|
|
|
300
|
+
|
|
|
|
301
|
+// ///时间选择
|
|
|
|
302
|
+// Widget _selectTime(String title, String hintText, GestureTapCallback onTap) {
|
|
|
|
303
|
+// return InkWell(
|
|
|
|
304
|
+// onTap: onTap,
|
|
|
|
305
|
+// child: Container(
|
|
|
|
306
|
+// // padding: EdgeInsets.symmetric(vertical: ScreenUtil().setWidth(28)),
|
|
|
|
307
|
+// child: Row(
|
|
|
|
308
|
+// crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
309
|
+// mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
310
|
+// children: [
|
|
|
|
311
|
+// Container(
|
|
|
|
312
|
+// // height: ScreenUtil().setWidth(40),
|
|
|
|
313
|
+// // color: Colors.red,
|
|
|
|
314
|
+// child: Text(
|
|
|
|
315
|
+// title,
|
|
|
|
316
|
+// style: TextStyle(
|
|
|
|
317
|
+// color: title == '点击设置可用日期'
|
|
|
|
318
|
+// ? MyColours.color_438E93
|
|
|
|
319
|
+// : MyColours.color_515151,
|
|
|
|
320
|
+// fontSize: ScreenUtil().setSp(32)),
|
|
|
|
321
|
+// ),
|
|
|
|
322
|
+// ),
|
|
|
|
323
|
+// HEmptyView(20),
|
|
|
|
324
|
+// Spacer(),
|
|
|
|
325
|
+// Text(hintText,
|
|
|
|
326
|
+// style: TextStyle(
|
|
|
|
327
|
+// color: hintText == '点击设置开始日期' || hintText == '点击设置结束日期'
|
|
|
|
328
|
+// ? MyColours.color_438E93
|
|
|
|
329
|
+// : MyColours.color_515151,
|
|
|
|
330
|
+// fontSize: ScreenUtil().setSp(32),
|
|
|
|
331
|
+// )),
|
|
|
|
332
|
+// HEmptyView(20),
|
|
|
|
333
|
+// Image.asset(
|
|
|
|
334
|
+// Utils.getImgPath('arrow_right_new'),
|
|
|
|
335
|
+// width: ScreenUtil().setWidth(20),
|
|
|
|
336
|
+// ),
|
|
|
|
337
|
+// HEmptyView(32),
|
|
|
|
338
|
+// ],
|
|
|
|
339
|
+// ),
|
|
|
|
340
|
+// ),
|
|
|
|
341
|
+// );
|
|
|
|
342
|
+// }
|
|
|
|
343
|
+
|
|
|
|
344
|
+// ///时间选择
|
|
|
|
345
|
+// Widget _select(String title, String hintText, GestureTapCallback onTap) {
|
|
|
|
346
|
+// return InkWell(
|
|
|
|
347
|
+// onTap: onTap,
|
|
|
|
348
|
+// child: Container(
|
|
|
|
349
|
+// padding: EdgeInsets.only(left: ScreenUtil().setWidth(32)),
|
|
|
|
350
|
+// child: Row(
|
|
|
|
351
|
+// crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
352
|
+// mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
353
|
+// children: [
|
|
|
|
354
|
+// Container(
|
|
|
|
355
|
+// // height: ScreenUtil().setWidth(40),
|
|
|
|
356
|
+// // color: Colors.red,
|
|
|
|
357
|
+// child: Text(
|
|
|
|
358
|
+// title,
|
|
|
|
359
|
+// style: TextStyle(
|
|
|
|
360
|
+// color: title == '点击设置可用日期'
|
|
|
|
361
|
+// ? MyColours.color_999999
|
|
|
|
362
|
+// : MyColours.color_515151,
|
|
|
|
363
|
+// fontSize: ScreenUtil().setSp(32)),
|
|
|
|
364
|
+// ),
|
|
|
|
365
|
+// ),
|
|
|
|
366
|
+// HEmptyView(20),
|
|
|
|
367
|
+// Spacer(),
|
|
|
|
368
|
+// Text(hintText,
|
|
|
|
369
|
+// style: TextStyle(
|
|
|
|
370
|
+// color: hintText == '点击设置开始日期' || hintText == '点击设置结束日期'
|
|
|
|
371
|
+// ? MyColours.color_999999
|
|
|
|
372
|
+// : MyColours.color_515151,
|
|
|
|
373
|
+// fontSize: ScreenUtil().setSp(32),
|
|
|
|
374
|
+// )),
|
|
|
|
375
|
+// HEmptyView(20),
|
|
|
|
376
|
+// Image.asset(
|
|
|
|
377
|
+// Utils.getImgPath('arrow_right_new'),
|
|
|
|
378
|
+// width: ScreenUtil().setWidth(18),
|
|
|
|
379
|
+// ),
|
|
|
|
380
|
+// HEmptyView(32),
|
|
|
|
381
|
+// ],
|
|
|
|
382
|
+// ),
|
|
|
|
383
|
+// ),
|
|
|
|
384
|
+// );
|
|
|
|
385
|
+// }
|
|
|
|
386
|
+
|
|
|
|
387
|
+// ///券说明
|
|
|
|
388
|
+// Widget _explain(String title, String hintText,
|
|
|
|
389
|
+// TextEditingController controller, FocusNode node) {
|
|
|
|
390
|
+// return Container(
|
|
|
|
391
|
+// // height: ScreenUtil().setWidth(380),
|
|
|
|
392
|
+// padding: EdgeInsets.symmetric(vertical: ScreenUtil().setWidth(28)),
|
|
|
|
393
|
+// child: Column(
|
|
|
|
394
|
+// crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
395
|
+// children: [
|
|
|
|
396
|
+// Align(
|
|
|
|
397
|
+// alignment: Alignment.centerLeft,
|
|
|
|
398
|
+// child: Text(
|
|
|
|
399
|
+// title,
|
|
|
|
400
|
+// textAlign: TextAlign.left,
|
|
|
|
401
|
+// style: TextStyle(
|
|
|
|
402
|
+// color: MyColours.color_515151,
|
|
|
|
403
|
+// fontSize: ScreenUtil().setSp(32)),
|
|
|
|
404
|
+// )),
|
|
|
|
405
|
+// VEmptyView(26),
|
|
|
|
406
|
+// Container(
|
|
|
|
407
|
+// height: ScreenUtil().setWidth(2),
|
|
|
|
408
|
+// color: MyColours.color_E7E7E7,
|
|
|
|
409
|
+// ),
|
|
|
|
410
|
+// TextField(
|
|
|
|
411
|
+// controller: controller,
|
|
|
|
412
|
+// focusNode: node,
|
|
|
|
413
|
+// // keyboardType: TextInputType.numberWithOptions(decimal: true), //键盘类型,数字键盘
|
|
|
|
414
|
+// maxLines: 3,
|
|
|
|
415
|
+// maxLength: 150,
|
|
|
|
416
|
+
|
|
|
|
417
|
+// // maxLengthEnforced: true,
|
|
|
|
418
|
+// style: TextStyle(
|
|
|
|
419
|
+// fontSize: ScreenUtil().setSp(32),
|
|
|
|
420
|
+// color: MyColours.color_333333), //输入文本的样式
|
|
|
|
421
|
+// decoration: InputDecoration(
|
|
|
|
422
|
+// contentPadding:
|
|
|
|
423
|
+// EdgeInsets.symmetric(vertical: ScreenUtil().setWidth(30)),
|
|
|
|
424
|
+// hintText: hintText,
|
|
|
|
425
|
+// hintStyle: TextStyle(
|
|
|
|
426
|
+// color: MyColours.color_999999,
|
|
|
|
427
|
+// fontSize: ScreenUtil().setSp(32),
|
|
|
|
428
|
+// ),
|
|
|
|
429
|
+
|
|
|
|
430
|
+// border: OutlineInputBorder(borderSide: BorderSide.none),
|
|
|
|
431
|
+
|
|
|
|
432
|
+// enabledBorder: new UnderlineInputBorder(
|
|
|
|
433
|
+// borderSide: BorderSide.none,
|
|
|
|
434
|
+// ),
|
|
|
|
435
|
+// focusedBorder: new UnderlineInputBorder(
|
|
|
|
436
|
+// borderSide: BorderSide.none,
|
|
|
|
437
|
+// ),
|
|
|
|
438
|
+
|
|
|
|
439
|
+// // fillColor: MyColours.color_F9F9F9,
|
|
|
|
440
|
+// // // fillColor: Colors.red,
|
|
|
|
441
|
+// // filled: true,
|
|
|
|
442
|
+// // enabledBorder: OutlineInputBorder(
|
|
|
|
443
|
+// // //未选中时候的颜色
|
|
|
|
444
|
+// // borderRadius: BorderRadius.circular(ScreenUtil().setWidth(20)),
|
|
|
|
445
|
+// // borderSide: BorderSide(
|
|
|
|
446
|
+// // color: MyColours.color_cccccc,
|
|
|
|
447
|
+// // width: ScreenUtil().setWidth(2)),
|
|
|
|
448
|
+// // ),
|
|
|
|
449
|
+// // focusedBorder: OutlineInputBorder(
|
|
|
|
450
|
+// // //选中时外边框颜色
|
|
|
|
451
|
+// // borderRadius: BorderRadius.circular(ScreenUtil().setWidth(20)),
|
|
|
|
452
|
+// // borderSide: BorderSide(
|
|
|
|
453
|
+// // color: MyColours.app_main,
|
|
|
|
454
|
+// // ),
|
|
|
|
455
|
+// // ),
|
|
|
|
456
|
+// // border: OutlineInputBorder(
|
|
|
|
457
|
+// // borderRadius:
|
|
|
|
458
|
+// // BorderRadius.circular(ScreenUtil().setWidth(20)),
|
|
|
|
459
|
+// // borderSide: BorderSide(
|
|
|
|
460
|
+// // color: Colors.red, width: ScreenUtil().setWidth(2))),
|
|
|
|
461
|
+// ),
|
|
|
|
462
|
+// onChanged: (value) {},
|
|
|
|
463
|
+// ),
|
|
|
|
464
|
+// ],
|
|
|
|
465
|
+// ),
|
|
|
|
466
|
+// );
|
|
|
|
467
|
+// }
|
|
|
|
468
|
+
|
|
|
|
469
|
+// _itemRadioWidget(bool select, String title, {GestureTapCallback? onTap}) {
|
|
|
|
470
|
+// return InkWell(
|
|
|
|
471
|
+// onTap: onTap,
|
|
|
|
472
|
+// child: Row(children: [
|
|
|
|
473
|
+// Image.asset(
|
|
|
|
474
|
+// Utils.getImgPath(
|
|
|
|
475
|
+// select ? 'plan_dish_select' : 'plan_dish_unselect'),
|
|
|
|
476
|
+// width: w(20),
|
|
|
|
477
|
+// ),
|
|
|
|
478
|
+// HEmptyView(6),
|
|
|
|
479
|
+// Text(
|
|
|
|
480
|
+// title,
|
|
|
|
481
|
+// style: TextStyle(
|
|
|
|
482
|
+// color: MyColours.color_515151,
|
|
|
|
483
|
+// fontSize: ScreenUtil().setSp(32)),
|
|
|
|
484
|
+// ),
|
|
|
|
485
|
+// ]));
|
|
|
|
486
|
+// }
|
|
|
|
487
|
+
|
|
|
|
488
|
+// ///是否立即启用
|
|
|
|
489
|
+// Widget _canUse(String title, bool swich, GestureTapCallback onTap) {
|
|
|
|
490
|
+// return InkWell(
|
|
|
|
491
|
+// onTap: onTap,
|
|
|
|
492
|
+// child: Container(
|
|
|
|
493
|
+// padding: EdgeInsets.symmetric(vertical: ScreenUtil().setWidth(24)),
|
|
|
|
494
|
+// margin: EdgeInsets.only(right: ScreenUtil().setWidth(32)),
|
|
|
|
495
|
+// child: Row(
|
|
|
|
496
|
+// crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
497
|
+// mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
498
|
+// children: [
|
|
|
|
499
|
+// Container(
|
|
|
|
500
|
+// // height: ScreenUtil().setWidth(40),
|
|
|
|
501
|
+// // color: Colors.red,
|
|
|
|
502
|
+// child: Text(
|
|
|
|
503
|
+// title,
|
|
|
|
504
|
+// style: TextStyle(
|
|
|
|
505
|
+// color: MyColours.color_515151,
|
|
|
|
506
|
+// fontSize: ScreenUtil().setSp(32)),
|
|
|
|
507
|
+// ),
|
|
|
|
508
|
+// ),
|
|
|
|
509
|
+// Spacer(),
|
|
|
|
510
|
+// Image.asset(
|
|
|
|
511
|
+// swich
|
|
|
|
512
|
+// ? Utils.getImgPath('swich_on')
|
|
|
|
513
|
+// : Utils.getImgPath('swich_off'),
|
|
|
|
514
|
+// width: ScreenUtil().setWidth(44 * 2),
|
|
|
|
515
|
+// )
|
|
|
|
516
|
+// ],
|
|
|
|
517
|
+// ),
|
|
|
|
518
|
+// ),
|
|
|
|
519
|
+// );
|
|
|
|
520
|
+// }
|
|
|
|
521
|
+
|
|
|
|
522
|
+// @override
|
|
|
|
523
|
+// Widget build(BuildContext context) {
|
|
|
|
524
|
+// marketingCenterProvider =
|
|
|
|
525
|
+// Provider.of<MarketingCenterProvider>(context, listen: true);
|
|
|
|
526
|
+// return KeyboardDismissOnTap(
|
|
|
|
527
|
+// child: Scaffold(
|
|
|
|
528
|
+// key: scaffoldKey,
|
|
|
|
529
|
+// backgroundColor: MyColours.color_ffffff,
|
|
|
|
530
|
+// appBar: SystemAppBar(
|
|
|
|
531
|
+// '充值优惠详情',
|
|
|
|
532
|
+// rightImgName: marketingCenterProvider != null &&
|
|
|
|
533
|
+// marketingCenterProvider!.rechargeDetail != null &&
|
|
|
|
534
|
+// widget.idstr != null &&
|
|
|
|
535
|
+// widget.idstr != 'null' &&
|
|
|
|
536
|
+// marketingCenterProvider!.rechargeDetail!.isOpen == '1'
|
|
|
|
537
|
+// ? 'share.png'
|
|
|
|
538
|
+// : '',
|
|
|
|
539
|
+// onTapRight: () {
|
|
|
|
540
|
+// if (widget.idstr != null &&
|
|
|
|
541
|
+// widget.idstr != 'null' &&
|
|
|
|
542
|
+// marketingCenterProvider!.rechargeDetail!.isOpen == '1') {
|
|
|
|
543
|
+// Utils.goShareBuyRechargeToWeChat(
|
|
|
|
544
|
+// context, widget.idstr, marketingCenterProvider!.rechargeDetail!);
|
|
|
|
545
|
+// }
|
|
|
|
546
|
+// },
|
|
|
|
547
|
+// ),
|
|
|
|
548
|
+// body: Column(
|
|
|
|
549
|
+// children: [
|
|
|
|
550
|
+// Expanded(
|
|
|
|
551
|
+// child: SingleChildScrollView(
|
|
|
|
552
|
+// child: Padding(
|
|
|
|
553
|
+// padding: EdgeInsets.only(left: w(32)),
|
|
|
|
554
|
+// child: Column(
|
|
|
|
555
|
+// children: [
|
|
|
|
556
|
+// _textfield('活动名称', '点击输入活动名称', nameC, nameF),
|
|
|
|
557
|
+// MyDivider(
|
|
|
|
558
|
+// double.infinity,
|
|
|
|
559
|
+// w(1),
|
|
|
|
560
|
+// color: MyColours.color_E7E7E7,
|
|
|
|
561
|
+// ),
|
|
|
|
562
|
+// VEmptyView(24),
|
|
|
|
563
|
+// _textfield('充值满', '点击输入充值金额门槛', priceminC, priceminF,
|
|
|
|
564
|
+// textInputStyle:
|
|
|
|
565
|
+// TextInputType.numberWithOptions(decimal: true)),
|
|
|
|
566
|
+// MyDivider(
|
|
|
|
567
|
+// double.infinity,
|
|
|
|
568
|
+// w(1),
|
|
|
|
569
|
+// color: MyColours.color_E7E7E7,
|
|
|
|
570
|
+// ),
|
|
|
|
571
|
+// VEmptyView(48),
|
|
|
|
572
|
+// Container(
|
|
|
|
573
|
+// alignment: Alignment.centerLeft,
|
|
|
|
574
|
+// child: Text(
|
|
|
|
575
|
+// '优惠活动',
|
|
|
|
576
|
+// style: TextStyle(
|
|
|
|
577
|
+// color: MyColours.color_515151,
|
|
|
|
578
|
+// fontSize: ScreenUtil().setSp(32)),
|
|
|
|
579
|
+// ),
|
|
|
|
580
|
+// ),
|
|
|
|
581
|
+// VEmptyView(26),
|
|
|
|
582
|
+// Column(
|
|
|
|
583
|
+// crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
584
|
+// children: [
|
|
|
|
585
|
+// Row(
|
|
|
|
586
|
+// children: [
|
|
|
|
587
|
+// InkWell(
|
|
|
|
588
|
+// onTap: () {
|
|
|
|
589
|
+// setState(() {
|
|
|
|
590
|
+// givePriceSwich = !givePriceSwich;
|
|
|
|
591
|
+// });
|
|
|
|
592
|
+// },
|
|
|
|
593
|
+// child: Padding(
|
|
|
|
594
|
+// padding: EdgeInsets.only(
|
|
|
|
595
|
+// left: w(16),
|
|
|
|
596
|
+// right: w(8),
|
|
|
|
597
|
+// ),
|
|
|
|
598
|
+// child: Image.asset(
|
|
|
|
599
|
+// Utils.getImgPath(givePriceSwich
|
|
|
|
600
|
+// ? 'f_select'
|
|
|
|
601
|
+// : 'f_select_not'),
|
|
|
|
602
|
+// width: w(20),
|
|
|
|
603
|
+// ),
|
|
|
|
604
|
+// ),
|
|
|
|
605
|
+// ),
|
|
|
|
606
|
+// Text(
|
|
|
|
607
|
+// '赠送',
|
|
|
|
608
|
+// style: TextStyle(
|
|
|
|
609
|
+// color: MyColours.color_515151,
|
|
|
|
610
|
+// fontSize: ScreenUtil().setSp(32)),
|
|
|
|
611
|
+// ),
|
|
|
|
612
|
+// HEmptyView(16),
|
|
|
|
613
|
+// Container(
|
|
|
|
614
|
+// width: w(140),
|
|
|
|
615
|
+// height: w(28),
|
|
|
|
616
|
+// alignment: Alignment.center,
|
|
|
|
617
|
+// decoration: BoxDecoration(
|
|
|
|
618
|
+// border: Border.all(
|
|
|
|
619
|
+// width: w(1),
|
|
|
|
620
|
+// color: MyColours.color_DBDBDB)),
|
|
|
|
621
|
+// child: TextField(
|
|
|
|
622
|
+// controller: givePriceC,
|
|
|
|
623
|
+// focusNode: givePricF,
|
|
|
|
624
|
+// textAlign: TextAlign.center,
|
|
|
|
625
|
+// // textAlignVertical: TextAlignVertical.bottom,
|
|
|
|
626
|
+// maxLines: 1,
|
|
|
|
627
|
+
|
|
|
|
628
|
+// // //光标颜色
|
|
|
|
629
|
+// // cursorColor:
|
|
|
|
630
|
+// // widget.isSelect ? Colors.white : MyColours.color_199095,
|
|
|
|
631
|
+// //输入文本的样式
|
|
|
|
632
|
+// style: TextStyle(
|
|
|
|
633
|
+// color: MyColours.color_515151,
|
|
|
|
634
|
+// fontSize: ScreenUtil().setSp(32),
|
|
|
|
635
|
+// ),
|
|
|
|
636
|
+// // focusNode: title == '券名称' ? _nameFocusNode : _requireFocusNode,
|
|
|
|
637
|
+// decoration: InputDecoration(
|
|
|
|
638
|
+// isCollapsed:
|
|
|
|
639
|
+// true, //重点,相当于高度包裹的意思,必须设置为true,不然有默认奇妙的最小高度
|
|
|
|
640
|
+// border: OutlineInputBorder(
|
|
|
|
641
|
+// borderSide: BorderSide.none),
|
|
|
|
642
|
+// hintText: '',
|
|
|
|
643
|
+// hintStyle: TextStyle(
|
|
|
|
644
|
+// color: MyColours.color_999999,
|
|
|
|
645
|
+// fontSize: ScreenUtil().setSp(32),
|
|
|
|
646
|
+// ),
|
|
|
|
647
|
+// enabledBorder: new UnderlineInputBorder(
|
|
|
|
648
|
+// borderSide: BorderSide.none,
|
|
|
|
649
|
+// ),
|
|
|
|
650
|
+// contentPadding: EdgeInsets.zero,
|
|
|
|
651
|
+// focusedBorder: new UnderlineInputBorder(
|
|
|
|
652
|
+// borderSide: BorderSide.none,
|
|
|
|
653
|
+// ),
|
|
|
|
654
|
+// ),
|
|
|
|
655
|
+// onChanged: (value) {},
|
|
|
|
656
|
+// onEditingComplete: () {
|
|
|
|
657
|
+// FocusScope.of(context)
|
|
|
|
658
|
+// .requestFocus(FocusNode()); //点击空白处隐藏键盘
|
|
|
|
659
|
+// },
|
|
|
|
660
|
+// keyboardType: TextInputType.numberWithOptions(
|
|
|
|
661
|
+// decimal: true),
|
|
|
|
662
|
+// ),
|
|
|
|
663
|
+// ),
|
|
|
|
664
|
+// HEmptyView(16),
|
|
|
|
665
|
+// Text(
|
|
|
|
666
|
+// '元余额',
|
|
|
|
667
|
+// style: TextStyle(
|
|
|
|
668
|
+// color: MyColours.color_515151,
|
|
|
|
669
|
+// fontSize: ScreenUtil().setSp(32)),
|
|
|
|
670
|
+// ),
|
|
|
|
671
|
+// ],
|
|
|
|
672
|
+// ),
|
|
|
|
673
|
+// VEmptyView(20),
|
|
|
|
674
|
+// Row(
|
|
|
|
675
|
+// children: [
|
|
|
|
676
|
+// InkWell(
|
|
|
|
677
|
+// onTap: () {
|
|
|
|
678
|
+// setState(() {
|
|
|
|
679
|
+// giveScoreSwich = !giveScoreSwich;
|
|
|
|
680
|
+// });
|
|
|
|
681
|
+// },
|
|
|
|
682
|
+// child: Padding(
|
|
|
|
683
|
+// padding: EdgeInsets.only(
|
|
|
|
684
|
+// left: w(16),
|
|
|
|
685
|
+// right: w(8),
|
|
|
|
686
|
+// ),
|
|
|
|
687
|
+// child: Image.asset(
|
|
|
|
688
|
+// Utils.getImgPath(giveScoreSwich
|
|
|
|
689
|
+// ? 'f_select'
|
|
|
|
690
|
+// : 'f_select_not'),
|
|
|
|
691
|
+// width: w(20),
|
|
|
|
692
|
+// ),
|
|
|
|
693
|
+// ),
|
|
|
|
694
|
+// ),
|
|
|
|
695
|
+// Text(
|
|
|
|
696
|
+// '赠送',
|
|
|
|
697
|
+// style: TextStyle(
|
|
|
|
698
|
+// color: MyColours.color_515151,
|
|
|
|
699
|
+// fontSize: ScreenUtil().setSp(32)),
|
|
|
|
700
|
+// ),
|
|
|
|
701
|
+// HEmptyView(16),
|
|
|
|
702
|
+// Container(
|
|
|
|
703
|
+// width: w(140),
|
|
|
|
704
|
+// height: w(28),
|
|
|
|
705
|
+// alignment: Alignment.center,
|
|
|
|
706
|
+// decoration: BoxDecoration(
|
|
|
|
707
|
+// border: Border.all(
|
|
|
|
708
|
+// width: w(1),
|
|
|
|
709
|
+// color: MyColours.color_DBDBDB)),
|
|
|
|
710
|
+// child: TextField(
|
|
|
|
711
|
+// controller: giveScoreC,
|
|
|
|
712
|
+// focusNode: giveScoreF,
|
|
|
|
713
|
+// textAlign: TextAlign.center,
|
|
|
|
714
|
+// // textAlignVertical: TextAlignVertical.bottom,
|
|
|
|
715
|
+// maxLines: 1,
|
|
|
|
716
|
+
|
|
|
|
717
|
+// // //光标颜色
|
|
|
|
718
|
+// // cursorColor:
|
|
|
|
719
|
+// // widget.isSelect ? Colors.white : MyColours.color_199095,
|
|
|
|
720
|
+// //输入文本的样式
|
|
|
|
721
|
+// style: TextStyle(
|
|
|
|
722
|
+// color: MyColours.color_515151,
|
|
|
|
723
|
+// fontSize: ScreenUtil().setSp(32),
|
|
|
|
724
|
+// ),
|
|
|
|
725
|
+// // focusNode: title == '券名称' ? _nameFocusNode : _requireFocusNode,
|
|
|
|
726
|
+// decoration: InputDecoration(
|
|
|
|
727
|
+// isCollapsed:
|
|
|
|
728
|
+// true, //重点,相当于高度包裹的意思,必须设置为true,不然有默认奇妙的最小高度
|
|
|
|
729
|
+// border: OutlineInputBorder(
|
|
|
|
730
|
+// borderSide: BorderSide.none),
|
|
|
|
731
|
+// hintText: '',
|
|
|
|
732
|
+// hintStyle: TextStyle(
|
|
|
|
733
|
+// color: MyColours.color_999999,
|
|
|
|
734
|
+// fontSize: ScreenUtil().setSp(32),
|
|
|
|
735
|
+// ),
|
|
|
|
736
|
+// enabledBorder: new UnderlineInputBorder(
|
|
|
|
737
|
+// borderSide: BorderSide.none,
|
|
|
|
738
|
+// ),
|
|
|
|
739
|
+// contentPadding: EdgeInsets.zero,
|
|
|
|
740
|
+// focusedBorder: new UnderlineInputBorder(
|
|
|
|
741
|
+// borderSide: BorderSide.none,
|
|
|
|
742
|
+// ),
|
|
|
|
743
|
+// ),
|
|
|
|
744
|
+// onChanged: (value) {},
|
|
|
|
745
|
+// onEditingComplete: () {
|
|
|
|
746
|
+// FocusScope.of(context)
|
|
|
|
747
|
+// .requestFocus(FocusNode()); //点击空白处隐藏键盘
|
|
|
|
748
|
+// },
|
|
|
|
749
|
+// keyboardType: TextInputType.numberWithOptions(
|
|
|
|
750
|
+// decimal: true),
|
|
|
|
751
|
+// ),
|
|
|
|
752
|
+// ),
|
|
|
|
753
|
+// HEmptyView(16),
|
|
|
|
754
|
+// Text(
|
|
|
|
755
|
+// '积分',
|
|
|
|
756
|
+// style: TextStyle(
|
|
|
|
757
|
+// color: MyColours.color_515151,
|
|
|
|
758
|
+// fontSize: ScreenUtil().setSp(32)),
|
|
|
|
759
|
+// ),
|
|
|
|
760
|
+// ],
|
|
|
|
761
|
+// ),
|
|
|
|
762
|
+// VEmptyView(20),
|
|
|
|
763
|
+// Row(
|
|
|
|
764
|
+// children: [
|
|
|
|
765
|
+// InkWell(
|
|
|
|
766
|
+// onTap: () {
|
|
|
|
767
|
+// setState(() {
|
|
|
|
768
|
+// giveCouponsSwich = !giveCouponsSwich;
|
|
|
|
769
|
+// });
|
|
|
|
770
|
+// },
|
|
|
|
771
|
+// child: Padding(
|
|
|
|
772
|
+// padding: EdgeInsets.only(
|
|
|
|
773
|
+// left: w(16),
|
|
|
|
774
|
+// right: w(8),
|
|
|
|
775
|
+// ),
|
|
|
|
776
|
+// child: Image.asset(
|
|
|
|
777
|
+// Utils.getImgPath(giveCouponsSwich
|
|
|
|
778
|
+// ? 'f_select'
|
|
|
|
779
|
+// : 'f_select_not'),
|
|
|
|
780
|
+// width: w(20),
|
|
|
|
781
|
+// ),
|
|
|
|
782
|
+// ),
|
|
|
|
783
|
+// ),
|
|
|
|
784
|
+// Text(
|
|
|
|
785
|
+// '赠送优惠券',
|
|
|
|
786
|
+// style: TextStyle(
|
|
|
|
787
|
+// color: MyColours.color_515151,
|
|
|
|
788
|
+// fontSize: ScreenUtil().setSp(32)),
|
|
|
|
789
|
+// ),
|
|
|
|
790
|
+// HEmptyView(60),
|
|
|
|
791
|
+// if (giveCouponsSwich)
|
|
|
|
792
|
+// InkWell(
|
|
|
|
793
|
+// onTap: () async {
|
|
|
|
794
|
+// FocusScope.of(context)
|
|
|
|
795
|
+// .requestFocus(FocusNode());
|
|
|
|
796
|
+// Map? object = await NavigatorUtil
|
|
|
|
797
|
+// .goRechargeSelectStoreCouponPage(
|
|
|
|
798
|
+// context, selectIDs!.join(',')) ;
|
|
|
|
799
|
+// print(object);
|
|
|
|
800
|
+// if (object != null &&
|
|
|
|
801
|
+// object['couponsid'] != null) {
|
|
|
|
802
|
+// List<CouponSunModel> data =
|
|
|
|
803
|
+// object['couponsdata'];
|
|
|
|
804
|
+
|
|
|
|
805
|
+// couponsData = [];
|
|
|
|
806
|
+// //
|
|
|
|
807
|
+// selectIDs = object['couponsid'];
|
|
|
|
808
|
+// coupons = [];
|
|
|
|
809
|
+// data.forEach((element) {
|
|
|
|
810
|
+// if (element.isCheck) {
|
|
|
|
811
|
+// coupons!.add(element.aname);
|
|
|
|
812
|
+// couponsData!.add(element);
|
|
|
|
813
|
+// }
|
|
|
|
814
|
+// });
|
|
|
|
815
|
+// setState(() {});
|
|
|
|
816
|
+// }
|
|
|
|
817
|
+// },
|
|
|
|
818
|
+// child: Text(
|
|
|
|
819
|
+// '选择优惠券',
|
|
|
|
820
|
+// style: TextStyle(
|
|
|
|
821
|
+// color: MyColours.color_438E93,
|
|
|
|
822
|
+// fontSize: ScreenUtil().setSp(32)),
|
|
|
|
823
|
+// )),
|
|
|
|
824
|
+// ],
|
|
|
|
825
|
+// ),
|
|
|
|
826
|
+// if (giveCouponsSwich) VEmptyView(20),
|
|
|
|
827
|
+// if (giveCouponsSwich)
|
|
|
|
828
|
+// Padding(
|
|
|
|
829
|
+// padding: EdgeInsets.only(
|
|
|
|
830
|
+// left: w(45),
|
|
|
|
831
|
+// right: w(8),
|
|
|
|
832
|
+// ),
|
|
|
|
833
|
+// child: Wrap(
|
|
|
|
834
|
+// spacing: w(9),
|
|
|
|
835
|
+// runSpacing: w(9),
|
|
|
|
836
|
+// alignment: WrapAlignment.start,
|
|
|
|
837
|
+// runAlignment: WrapAlignment.start,
|
|
|
|
838
|
+// children: coupons!.map((e) {
|
|
|
|
839
|
+// return Text(
|
|
|
|
840
|
+// e,
|
|
|
|
841
|
+// style: TextStyle(
|
|
|
|
842
|
+// color: MyColours.color_515151,
|
|
|
|
843
|
+// fontSize: ScreenUtil().setSp(32)),
|
|
|
|
844
|
+// );
|
|
|
|
845
|
+// }).toList())),
|
|
|
|
846
|
+// VEmptyView(20),
|
|
|
|
847
|
+// ],
|
|
|
|
848
|
+// ),
|
|
|
|
849
|
+// MyDivider(
|
|
|
|
850
|
+// double.infinity,
|
|
|
|
851
|
+// w(1),
|
|
|
|
852
|
+// color: MyColours.color_E7E7E7,
|
|
|
|
853
|
+// ),
|
|
|
|
854
|
+// VEmptyView(48),
|
|
|
|
855
|
+// Container(
|
|
|
|
856
|
+// alignment: Alignment.centerLeft,
|
|
|
|
857
|
+// child: Text(
|
|
|
|
858
|
+// '使用限制:',
|
|
|
|
859
|
+// style: TextStyle(
|
|
|
|
860
|
+// color: MyColours.color_515151,
|
|
|
|
861
|
+// fontSize: ScreenUtil().setSp(32)),
|
|
|
|
862
|
+// ),
|
|
|
|
863
|
+// ),
|
|
|
|
864
|
+// VEmptyView(24),
|
|
|
|
865
|
+// Row(
|
|
|
|
866
|
+// children: [
|
|
|
|
867
|
+// HEmptyView(30),
|
|
|
|
868
|
+// _itemRadioWidget(fixdate, '无', onTap: () {
|
|
|
|
869
|
+// if (!fixdate) {
|
|
|
|
870
|
+// setState(() {
|
|
|
|
871
|
+// fixdate = true;
|
|
|
|
872
|
+// weekly = false;
|
|
|
|
873
|
+// birthday = false;
|
|
|
|
874
|
+// });
|
|
|
|
875
|
+// }
|
|
|
|
876
|
+// }),
|
|
|
|
877
|
+// Spacer(),
|
|
|
|
878
|
+// _itemRadioWidget(weekly, '每周', onTap: () {
|
|
|
|
879
|
+// if (!weekly) {
|
|
|
|
880
|
+// setState(() {
|
|
|
|
881
|
+// weekly = true;
|
|
|
|
882
|
+// fixdate = false;
|
|
|
|
883
|
+// birthday = false;
|
|
|
|
884
|
+// });
|
|
|
|
885
|
+// }
|
|
|
|
886
|
+// }),
|
|
|
|
887
|
+// Spacer(),
|
|
|
|
888
|
+// _itemRadioWidget(birthday, '会员生日当天', onTap: () {
|
|
|
|
889
|
+// if (!birthday) {
|
|
|
|
890
|
+// setState(() {
|
|
|
|
891
|
+// birthday = true;
|
|
|
|
892
|
+// weekly = false;
|
|
|
|
893
|
+// fixdate = false;
|
|
|
|
894
|
+// });
|
|
|
|
895
|
+// }
|
|
|
|
896
|
+// }),
|
|
|
|
897
|
+// HEmptyView(30),
|
|
|
|
898
|
+// ],
|
|
|
|
899
|
+// ),
|
|
|
|
900
|
+// birthday ? SizedBox() : VEmptyView(24),
|
|
|
|
901
|
+// // fixdate
|
|
|
|
902
|
+// // ? Column(
|
|
|
|
903
|
+// // children: [
|
|
|
|
904
|
+// // _select('有效期从', fromDate, () {
|
|
|
|
905
|
+// // FocusScope.of(context)
|
|
|
|
906
|
+// // .requestFocus(FocusNode()); //点击空白处隐藏键盘
|
|
|
|
907
|
+// // //弹出时间选择器
|
|
|
|
908
|
+// // // showPickerDateTime(context);
|
|
|
|
909
|
+// // showDateSelWidget = true;
|
|
|
|
910
|
+// // DialogUtil.showPickerDateTime24(
|
|
|
|
911
|
+// // context,
|
|
|
|
912
|
+// // scaffoldKey,
|
|
|
|
913
|
+// // (value) {
|
|
|
|
914
|
+// // // {'text': picker.adapter.text, 'select': selecteds}
|
|
|
|
915
|
+// // if (value != null) {
|
|
|
|
916
|
+// // setState(() {
|
|
|
|
917
|
+// // print(value);
|
|
|
|
918
|
+// // fromDate = DateUtil.formatDateStr(
|
|
|
|
919
|
+// // value,
|
|
|
|
920
|
+// // format: DateFormats.y_mo_d);
|
|
|
|
921
|
+// // });
|
|
|
|
922
|
+// // }
|
|
|
|
923
|
+// // showDateSelWidget = false;
|
|
|
|
924
|
+// // },
|
|
|
|
925
|
+// // dateTime: DateUtil.getDateTime(fromDate),
|
|
|
|
926
|
+// // pickerDateTimeType: PickerDateTimeType.kYMD,
|
|
|
|
927
|
+// // onCancel: () {
|
|
|
|
928
|
+// // showDateSelWidget = false;
|
|
|
|
929
|
+// // });
|
|
|
|
930
|
+// // }),
|
|
|
|
931
|
+// // VEmptyView(24),
|
|
|
|
932
|
+// // _select('有效期至', endDate, () {
|
|
|
|
933
|
+// // FocusScope.of(context)
|
|
|
|
934
|
+// // .requestFocus(FocusNode()); //点击空白处隐藏键盘
|
|
|
|
935
|
+// // //弹出时间选择器
|
|
|
|
936
|
+// // // showPickerDateTime(context);
|
|
|
|
937
|
+// // showDateSelWidget = true;
|
|
|
|
938
|
+// // DialogUtil.showPickerDateTime24(
|
|
|
|
939
|
+// // context,
|
|
|
|
940
|
+// // scaffoldKey,
|
|
|
|
941
|
+// // (value) {
|
|
|
|
942
|
+// // // {'text': picker.adapter.text, 'select': selecteds}
|
|
|
|
943
|
+// // if (value != null) {
|
|
|
|
944
|
+// // setState(() {
|
|
|
|
945
|
+// // print(value);
|
|
|
|
946
|
+// // endDate = DateUtil.formatDateStr(
|
|
|
|
947
|
+// // value,
|
|
|
|
948
|
+// // format: DateFormats.y_mo_d);
|
|
|
|
949
|
+// // });
|
|
|
|
950
|
+// // }
|
|
|
|
951
|
+// // showDateSelWidget = false;
|
|
|
|
952
|
+// // },
|
|
|
|
953
|
+// // dateTime: DateUtil.getDateTime(endDate),
|
|
|
|
954
|
+// // pickerDateTimeType: PickerDateTimeType.kYMD,
|
|
|
|
955
|
+// // onCancel: () {
|
|
|
|
956
|
+// // showDateSelWidget = false;
|
|
|
|
957
|
+// // });
|
|
|
|
958
|
+// // })
|
|
|
|
959
|
+// // ],
|
|
|
|
960
|
+// // )
|
|
|
|
961
|
+// // : SizedBox(),
|
|
|
|
962
|
+// weekly
|
|
|
|
963
|
+// ? _select(weekShow, '', () async {
|
|
|
|
964
|
+// FocusScope.of(context)
|
|
|
|
965
|
+// .requestFocus(FocusNode()); //点击空白处隐藏键盘
|
|
|
|
966
|
+// //弹出时间选择器
|
|
|
|
967
|
+// // showPickerDateTime(context);
|
|
|
|
968
|
+// showDateSelWidget = false;
|
|
|
|
969
|
+
|
|
|
|
970
|
+// List<FilterBtnModel> data =
|
|
|
|
971
|
+// await DialogUtil.openWeekSelectModalBottomSheet(
|
|
|
|
972
|
+// context, weekData!);
|
|
|
|
973
|
+// if (data != null) {
|
|
|
|
974
|
+// //改变了
|
|
|
|
975
|
+// weekData = [];
|
|
|
|
976
|
+// weekData!.addAll(data);
|
|
|
|
977
|
+// weekShow = '';
|
|
|
|
978
|
+
|
|
|
|
979
|
+// weekData!.forEach((element) {
|
|
|
|
980
|
+// if (element.select!) {
|
|
|
|
981
|
+// weekShow += '${element.title} ';
|
|
|
|
982
|
+// }
|
|
|
|
983
|
+// });
|
|
|
|
984
|
+// if (weekShow.endsWith(' ')) {
|
|
|
|
985
|
+// weekShow =
|
|
|
|
986
|
+// weekShow.substring(0, weekShow.length - 1);
|
|
|
|
987
|
+// }
|
|
|
|
988
|
+// if (weekShow == '') {
|
|
|
|
989
|
+// weekShow = '点击设置可用日期';
|
|
|
|
990
|
+// }
|
|
|
|
991
|
+
|
|
|
|
992
|
+// setState(() {});
|
|
|
|
993
|
+// }
|
|
|
|
994
|
+// })
|
|
|
|
995
|
+// : SizedBox(),
|
|
|
|
996
|
+// VEmptyView(24),
|
|
|
|
997
|
+// MyDivider(
|
|
|
|
998
|
+// double.infinity,
|
|
|
|
999
|
+// w(1),
|
|
|
|
1000
|
+// color: MyColours.color_E7E7E7,
|
|
|
|
1001
|
+// ),
|
|
|
|
1002
|
+// VEmptyView(48),
|
|
|
|
1003
|
+// Container(
|
|
|
|
1004
|
+// alignment: Alignment.centerLeft,
|
|
|
|
1005
|
+// child: Text(
|
|
|
|
1006
|
+// '有效期:',
|
|
|
|
1007
|
+// style: TextStyle(
|
|
|
|
1008
|
+// color: MyColours.color_515151,
|
|
|
|
1009
|
+// fontSize: ScreenUtil().setSp(32)),
|
|
|
|
1010
|
+// ),
|
|
|
|
1011
|
+// ),
|
|
|
|
1012
|
+// VEmptyView(24),
|
|
|
|
1013
|
+// _selectTime('有效期从', fromDate, () {
|
|
|
|
1014
|
+// FocusScope.of(context)
|
|
|
|
1015
|
+// .requestFocus(FocusNode()); //点击空白处隐藏键盘
|
|
|
|
1016
|
+// //弹出时间选择器
|
|
|
|
1017
|
+// // showPickerDateTime(context);
|
|
|
|
1018
|
+// showDateSelWidget = true;
|
|
|
|
1019
|
+// DialogUtil.showPickerDateTime24(
|
|
|
|
1020
|
+// context,
|
|
|
|
1021
|
+// scaffoldKey,
|
|
|
|
1022
|
+// (value) {
|
|
|
|
1023
|
+// // {'text': picker.adapter.text, 'select': selecteds}
|
|
|
|
1024
|
+// if (value != null) {
|
|
|
|
1025
|
+// setState(() {
|
|
|
|
1026
|
+// print(value);
|
|
|
|
1027
|
+// fromDate = DateUtil.formatDateStr(value,
|
|
|
|
1028
|
+// format: DateFormats.y_mo_d);
|
|
|
|
1029
|
+// });
|
|
|
|
1030
|
+// }
|
|
|
|
1031
|
+// showDateSelWidget = false;
|
|
|
|
1032
|
+// },
|
|
|
|
1033
|
+// dateTime:fromDate == '点击设置开始日期' ? null: DateUtil.getDateTime(fromDate),
|
|
|
|
1034
|
+// pickerDateTimeType: PickerDateTimeType.kYMD,
|
|
|
|
1035
|
+// onCancel: () {
|
|
|
|
1036
|
+// showDateSelWidget = false;
|
|
|
|
1037
|
+// });
|
|
|
|
1038
|
+// }),
|
|
|
|
1039
|
+// // Container(
|
|
|
|
1040
|
+// // height: ScreenUtil().setWidth(2),
|
|
|
|
1041
|
+// // color: MyColours.color_E7E7E7,
|
|
|
|
1042
|
+// // ),
|
|
|
|
1043
|
+// VEmptyView(24),
|
|
|
|
1044
|
+// _selectTime('有效期至', endDate, () {
|
|
|
|
1045
|
+// FocusScope.of(context)
|
|
|
|
1046
|
+// .requestFocus(FocusNode()); //点击空白处隐藏键盘
|
|
|
|
1047
|
+// //弹出时间选择器
|
|
|
|
1048
|
+// // showPickerDateTime(context);
|
|
|
|
1049
|
+// showDateSelWidget = true;
|
|
|
|
1050
|
+// DialogUtil.showPickerDateTime24(
|
|
|
|
1051
|
+// context,
|
|
|
|
1052
|
+// scaffoldKey,
|
|
|
|
1053
|
+// (value) {
|
|
|
|
1054
|
+// // {'text': picker.adapter.text, 'select': selecteds}
|
|
|
|
1055
|
+// if (value != null) {
|
|
|
|
1056
|
+// setState(() {
|
|
|
|
1057
|
+// print(value);
|
|
|
|
1058
|
+// endDate = DateUtil.formatDateStr(value,
|
|
|
|
1059
|
+// format: DateFormats.y_mo_d);
|
|
|
|
1060
|
+// });
|
|
|
|
1061
|
+// }
|
|
|
|
1062
|
+// showDateSelWidget = false;
|
|
|
|
1063
|
+// },
|
|
|
|
1064
|
+// dateTime:endDate =='点击设置结束日期'?null: DateUtil.getDateTime(endDate),
|
|
|
|
1065
|
+// pickerDateTimeType: PickerDateTimeType.kYMD,
|
|
|
|
1066
|
+// onCancel: () {
|
|
|
|
1067
|
+// showDateSelWidget = false;
|
|
|
|
1068
|
+// });
|
|
|
|
1069
|
+// }),
|
|
|
|
1070
|
+// VEmptyView(24),
|
|
|
|
1071
|
+// MyDivider(
|
|
|
|
1072
|
+// double.infinity,
|
|
|
|
1073
|
+// w(1),
|
|
|
|
1074
|
+// color: MyColours.color_E7E7E7,
|
|
|
|
1075
|
+// ),
|
|
|
|
1076
|
+// VEmptyView(48),
|
|
|
|
1077
|
+// _explain('备注', '请输入备注信息', remarkC, remarkF),
|
|
|
|
1078
|
+// VEmptyView(72),
|
|
|
|
1079
|
+// _canUse('立即启用', canUse, () {
|
|
|
|
1080
|
+// setState(() {
|
|
|
|
1081
|
+// canUse = !canUse;
|
|
|
|
1082
|
+// });
|
|
|
|
1083
|
+// })
|
|
|
|
1084
|
+// ],
|
|
|
|
1085
|
+// )),
|
|
|
|
1086
|
+// )),
|
|
|
|
1087
|
+// Container(
|
|
|
|
1088
|
+// height: ScreenUtil().setWidth(91 * 2),
|
|
|
|
1089
|
+// width: double.infinity,
|
|
|
|
1090
|
+// padding: EdgeInsets.only(
|
|
|
|
1091
|
+// top: ScreenUtil().setWidth(16 * 2),
|
|
|
|
1092
|
+// bottom: ScreenUtil().setWidth(35 * 2),
|
|
|
|
1093
|
+// left: ScreenUtil().setWidth(45 * 2),
|
|
|
|
1094
|
+// right: ScreenUtil().setWidth(45 * 2),
|
|
|
|
1095
|
+// ),
|
|
|
|
1096
|
+// decoration: BoxDecoration(
|
|
|
|
1097
|
+// color: MyColours.color_ffffff,
|
|
|
|
1098
|
+// boxShadow: [
|
|
|
|
1099
|
+// BoxShadow(
|
|
|
|
1100
|
+// spreadRadius: ScreenUtil().setWidth(2),
|
|
|
|
1101
|
+// color: Color.fromRGBO(0, 0, 0, 0.1),
|
|
|
|
1102
|
+// offset: Offset(0, ScreenUtil().setWidth(-2)),
|
|
|
|
1103
|
+// blurRadius: ScreenUtil().setWidth(8))
|
|
|
|
1104
|
+// ],
|
|
|
|
1105
|
+// borderRadius: BorderRadius.all(
|
|
|
|
1106
|
+// Radius.circular(ScreenUtil().setWidth(16)),
|
|
|
|
1107
|
+// ),
|
|
|
|
1108
|
+// ),
|
|
|
|
1109
|
+// child: RoundButton(
|
|
|
|
1110
|
+// text: '保存',
|
|
|
|
1111
|
+// height: ScreenUtil().setWidth(80),
|
|
|
|
1112
|
+// radius: ScreenUtil().setWidth(14),
|
|
|
|
1113
|
+// isBold: false,
|
|
|
|
1114
|
+// fontSize: 28,
|
|
|
|
1115
|
+// onPressed: () async {
|
|
|
|
1116
|
+// if (nameC.text.trim().length == 0) {
|
|
|
|
1117
|
+// Utils.showToast('请输入活动名称!');
|
|
|
|
1118
|
+// return;
|
|
|
|
1119
|
+// }
|
|
|
|
1120
|
+// if (priceminC.text.trim().length == 0) {
|
|
|
|
1121
|
+// Utils.showToast('请输入充值门槛金额!');
|
|
|
|
1122
|
+// return;
|
|
|
|
1123
|
+// }
|
|
|
|
1124
|
+// if (!Utils.isNumeric(priceminC.text.trim())) {
|
|
|
|
1125
|
+// Utils.showToast('充值门槛金额请输入数字!');
|
|
|
|
1126
|
+// return;
|
|
|
|
1127
|
+// }
|
|
|
|
1128
|
+// if (double.parse(priceminC.text.trim()) <= 0) {
|
|
|
|
1129
|
+// Utils.showToast('充值门槛金额需大于0!');
|
|
|
|
1130
|
+// return;
|
|
|
|
1131
|
+// }
|
|
|
|
1132
|
+// //优惠活动
|
|
|
|
1133
|
+// if (!giveScoreSwich && !givePriceSwich && !giveCouponsSwich) {
|
|
|
|
1134
|
+// Utils.showToast('请选择优惠活动!');
|
|
|
|
1135
|
+// return;
|
|
|
|
1136
|
+// }
|
|
|
|
1137
|
+// if (givePriceSwich && givePriceC.text.trim().length == 0) {
|
|
|
|
1138
|
+// Utils.showToast('请输入赠送金额!');
|
|
|
|
1139
|
+// return;
|
|
|
|
1140
|
+// }
|
|
|
|
1141
|
+// if (giveScoreSwich && giveScoreC.text.trim().length == 0) {
|
|
|
|
1142
|
+// Utils.showToast('请输入赠送积分!');
|
|
|
|
1143
|
+// return;
|
|
|
|
1144
|
+// }
|
|
|
|
1145
|
+// if (giveCouponsSwich && couponsData!.length == 0) {
|
|
|
|
1146
|
+// Utils.showToast('请选择赠送的优惠券!');
|
|
|
|
1147
|
+// return;
|
|
|
|
1148
|
+// }
|
|
|
|
1149
|
+
|
|
|
|
1150
|
+// //有效期
|
|
|
|
1151
|
+// if (!fixdate && !weekly && !birthday) {
|
|
|
|
1152
|
+// Utils.showToast('请选择有效期!');
|
|
|
|
1153
|
+// return;
|
|
|
|
1154
|
+// }
|
|
|
|
1155
|
+
|
|
|
|
1156
|
+// // if (fixdate) {
|
|
|
|
1157
|
+// //固定时间段
|
|
|
|
1158
|
+
|
|
|
|
1159
|
+// if (fromDate == '点击设置开始日期') {
|
|
|
|
1160
|
+// Utils.showToast('请设置有效期的开始日期!');
|
|
|
|
1161
|
+// return;
|
|
|
|
1162
|
+// }
|
|
|
|
1163
|
+
|
|
|
|
1164
|
+// if (endDate == '点击设置结束日期') {
|
|
|
|
1165
|
+// Utils.showToast('请设置有效期的结束日期!');
|
|
|
|
1166
|
+// return;
|
|
|
|
1167
|
+// }
|
|
|
|
1168
|
+// if (DateUtil.getDateTime(endDate)
|
|
|
|
1169
|
+// .compareTo(DateUtil.getDateTime(fromDate)) <
|
|
|
|
1170
|
+// 0) {
|
|
|
|
1171
|
+// Utils.showToast('有效期结束日期不能早于开始日期!');
|
|
|
|
1172
|
+// return;
|
|
|
|
1173
|
+// }
|
|
|
|
1174
|
+// // }
|
|
|
|
1175
|
+
|
|
|
|
1176
|
+// if (weekly && weekShow == '点击设置可用日期') {
|
|
|
|
1177
|
+// Utils.showToast('请设置可用日期!');
|
|
|
|
1178
|
+// return;
|
|
|
|
1179
|
+// }
|
|
|
|
1180
|
+
|
|
|
|
1181
|
+// String from = fromDate + ' 00:00:00';
|
|
|
|
1182
|
+// String end = endDate + ' 23:59:59';
|
|
|
|
1183
|
+// String stime = fromDate == '点击设置开始日期'
|
|
|
|
1184
|
+// ? ""
|
|
|
|
1185
|
+// : '${(DateUtil.getDateMsByTimeStr(from)! / 1000).floor()}';
|
|
|
|
1186
|
+// String etime = endDate == '点击设置结束日期'
|
|
|
|
1187
|
+// ? ''
|
|
|
|
1188
|
+// : '${(DateUtil.getDateMsByTimeStr(end)! / 1000).floor()}';
|
|
|
|
1189
|
+
|
|
|
|
1190
|
+// Map discounts = {
|
|
|
|
1191
|
+// 'is_price': givePriceSwich ? '1' : '0', //优惠活动,赠送金额
|
|
|
|
1192
|
+// 'is_score': giveScoreSwich ? '1' : '0', //赠送积分
|
|
|
|
1193
|
+// 'is_coupons': giveCouponsSwich ? '1' : '0', //赠送优惠券
|
|
|
|
1194
|
+// 'price': givePriceC.text,
|
|
|
|
1195
|
+// 'score': giveScoreC.text,
|
|
|
|
1196
|
+// 'coupons': couponsData,
|
|
|
|
1197
|
+// 'coupons_ids': selectIDs,
|
|
|
|
1198
|
+// 'coupons_names': coupons
|
|
|
|
1199
|
+// };
|
|
|
|
1200
|
+
|
|
|
|
1201
|
+// String discountsStr = json.encode(discounts);
|
|
|
|
1202
|
+// print(discountsStr);
|
|
|
|
1203
|
+
|
|
|
|
1204
|
+// Map date = {
|
|
|
|
1205
|
+// 'is_fix': fixdate ? '1' : '0',
|
|
|
|
1206
|
+// 'is_week': weekly ? '1' : '0',
|
|
|
|
1207
|
+// 'is_birthday': birthday ? '1' : '0',
|
|
|
|
1208
|
+// // 'fix_sdate': fixdate ? fromDate : '', // 开始时间
|
|
|
|
1209
|
+// // 'fix_edate': fixdate ? endDate : '', //结束时间
|
|
|
|
1210
|
+// 'week_date_show': weekly ? weekShow : '',
|
|
|
|
1211
|
+// 'week_date_data': weekly ? weekData : ''
|
|
|
|
1212
|
+// };
|
|
|
|
1213
|
+
|
|
|
|
1214
|
+// String dateStr = json.encode(date);
|
|
|
|
1215
|
+// print(dateStr);
|
|
|
|
1216
|
+// Map<String, String?> pramas = {
|
|
|
|
1217
|
+// 'sellerid': Provider.of<UserModel>(context, listen: false)
|
|
|
|
1218
|
+// .user!
|
|
|
|
1219
|
+// .sellerid,
|
|
|
|
1220
|
+// 'uid': Provider.of<UserModel>(context, listen: false)
|
|
|
|
1221
|
+// .user!
|
|
|
|
1222
|
+// .openid,
|
|
|
|
1223
|
+// 'rname': nameC.text,
|
|
|
|
1224
|
+// 'recharge_money': priceminC.text,
|
|
|
|
1225
|
+// 'recharge_list': discountsStr,
|
|
|
|
1226
|
+// 'exp_date': dateStr,
|
|
|
|
1227
|
+// 'explain': remarkC.text,
|
|
|
|
1228
|
+// 'is_open': canUse ? '1' : '0',
|
|
|
|
1229
|
+// 'stime': stime,
|
|
|
|
1230
|
+// 'etime': etime
|
|
|
|
1231
|
+// };
|
|
|
|
1232
|
+// if (widget.idstr != null && widget.idstr != 'null') {
|
|
|
|
1233
|
+// pramas['id'] = widget.idstr;
|
|
|
|
1234
|
+// }
|
|
|
|
1235
|
+
|
|
|
|
1236
|
+// bool success = await marketingCenterProvider!.createNewRecharge(
|
|
|
|
1237
|
+// context, pramas);
|
|
|
|
1238
|
+
|
|
|
|
1239
|
+// if (success) {
|
|
|
|
1240
|
+// //成功后返回前面列表
|
|
|
|
1241
|
+// if (Navigator.canPop(context)) {
|
|
|
|
1242
|
+// Navigator.pop(context);
|
|
|
|
1243
|
+// }
|
|
|
|
1244
|
+// //刷新列表
|
|
|
|
1245
|
+// bus.emit('refresh_marketting_page_recharge');
|
|
|
|
1246
|
+// bus.emit('refresh_recharge_home');
|
|
|
|
1247
|
+// }
|
|
|
|
1248
|
+
|
|
|
|
1249
|
+// // "stime": fromDate == '点击选择'
|
|
|
|
1250
|
+// // ? ""
|
|
|
|
1251
|
+// // : '${DateUtil.getDateMsByTimeStr(fromDate) / 1000}',
|
|
|
|
1252
|
+// // "etime": endDate == '点击选择'
|
|
|
|
1253
|
+// // ? ''
|
|
|
|
1254
|
+// // : '${DateUtil.getDateMsByTimeStr(endDate) / 1000}',
|
|
|
|
1255
|
+// // UserModel userModel =
|
|
|
|
1256
|
+// // Provider.of<UserModel>(context, listen: false);
|
|
|
|
1257
|
+// // if (userModel.user.role_name == '管理员' ||
|
|
|
|
1258
|
+// // userModel.user.role_name == '店长') {
|
|
|
|
1259
|
+// // NavigatorUtil.goRechargeEditPage(context);
|
|
|
|
1260
|
+// // } else {
|
|
|
|
1261
|
+// // bool needRefresh =
|
|
|
|
1262
|
+// // await NavigatorUtil.goCouponEditPage(context);
|
|
|
|
1263
|
+// // print(needRefresh);
|
|
|
|
1264
|
+// // if (needRefresh != null && needRefresh) {
|
|
|
|
1265
|
+// // bus.emit('refresh_coupon_list_f');
|
|
|
|
1266
|
+// // //刷新页面数据
|
|
|
|
1267
|
+// // // _controller.callRefresh();
|
|
|
|
1268
|
+// // // _couponNetworkData(tabController.index);
|
|
|
|
1269
|
+// // }
|
|
|
|
1270
|
+// // }
|
|
|
|
1271
|
+// },
|
|
|
|
1272
|
+// ),
|
|
|
|
1273
|
+// )
|
|
|
|
1274
|
+// ],
|
|
|
|
1275
|
+// ),
|
|
|
|
1276
|
+// ));
|
|
|
|
1277
|
+// }
|
|
|
|
1278
|
+// } |