|
|
|
1
|
+import 'dart:ui';
|
|
|
|
2
|
+
|
|
1
|
import 'package:flutter/material.dart';
|
3
|
import 'package:flutter/material.dart';
|
|
2
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
4
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
|
5
|
+import 'package:one_key/provider/user_model.dart';
|
|
3
|
import 'package:one_key/widgets/system_app_bar.dart';
|
6
|
import 'package:one_key/widgets/system_app_bar.dart';
|
|
|
|
7
|
+import 'package:provider/provider.dart';
|
|
4
|
|
8
|
|
|
|
|
9
|
+import '../../../provider/customer_provider.dart';
|
|
5
|
import '../../../res/colors.dart';
|
10
|
import '../../../res/colors.dart';
|
|
|
|
11
|
+import '../../../route/navigator_util.dart';
|
|
|
|
12
|
+import '../../../utils/dialog_util.dart';
|
|
|
|
13
|
+import '../../../utils/event_bus.dart';
|
|
6
|
import '../../../utils/screen_util.dart';
|
14
|
import '../../../utils/screen_util.dart';
|
|
|
|
15
|
+import '../../../utils/utils.dart';
|
|
|
|
16
|
+import '../../../widgets/h_empty_view.dart';
|
|
|
|
17
|
+import '../../../widgets/round_button.dart';
|
|
|
|
18
|
+import '../../../widgets/v_empty_view.dart';
|
|
|
|
19
|
+
|
|
|
|
20
|
+typedef ClickCallback = void Function(dynamic value);
|
|
7
|
|
21
|
|
|
8
|
class WineSettingMsgPage extends StatefulWidget {
|
22
|
class WineSettingMsgPage extends StatefulWidget {
|
|
9
|
const WineSettingMsgPage();
|
23
|
const WineSettingMsgPage();
|
|
@@ -13,28 +27,142 @@ class WineSettingMsgPage extends StatefulWidget { |
|
@@ -13,28 +27,142 @@ class WineSettingMsgPage extends StatefulWidget { |
|
13
|
}
|
27
|
}
|
|
14
|
|
28
|
|
|
15
|
class _WineSettingMsgPageState extends State<WineSettingMsgPage> {
|
29
|
class _WineSettingMsgPageState extends State<WineSettingMsgPage> {
|
|
16
|
- String contentChangeStart = '尊敬的@var(clientname),您好!您的酒水@var(beveragename)已经在我店存放@var(days)了。点击这里编辑您的短信内容。上面的文字时固定不可编辑的。';
|
|
|
|
17
|
- TextEditingController controller = TextEditingController();
|
|
|
|
18
|
-
|
|
|
|
19
|
-
|
30
|
+ String contentChangeStart =
|
|
|
|
31
|
+ '尊敬的@var(clientname),您好!您的酒水@var(beveragename)已经在我店存放@var(days)了。';
|
|
|
|
32
|
+ TextEditingController controller = TextEditingController();
|
|
|
|
33
|
+
|
|
|
|
34
|
+ CustomerProvider customerProvider;
|
|
|
|
35
|
+ List<String> couponList = [];
|
|
|
|
36
|
+ bool isUse = false;
|
|
|
|
37
|
+ String youhui = '选择优惠';
|
|
|
|
38
|
+ int couponSelectIndex = 0;
|
|
|
|
39
|
+
|
|
|
|
40
|
+ @override
|
|
|
|
41
|
+ void initState() {
|
|
|
|
42
|
+ super.initState();
|
|
|
|
43
|
+ WidgetsBinding.instance.addPostFrameCallback((_) async {
|
|
|
|
44
|
+ _couponNetworkData();
|
|
|
|
45
|
+ });
|
|
|
|
46
|
+ bus.on('refresh_wine_msg', (arg) {
|
|
|
|
47
|
+ _couponNetworkData();
|
|
|
|
48
|
+ });
|
|
|
|
49
|
+ }
|
|
|
|
50
|
+
|
|
|
|
51
|
+ @override
|
|
|
|
52
|
+ void dispose() {
|
|
|
|
53
|
+ super.dispose();
|
|
|
|
54
|
+ bus.off('refresh_wine_msg');
|
|
|
|
55
|
+ }
|
|
|
|
56
|
+
|
|
|
|
57
|
+ ///消费券
|
|
|
|
58
|
+ _couponNetworkData({bool isShowLoading = true}) async {
|
|
|
|
59
|
+ // customerMakingProvider.couponSelectIndex = 0;
|
|
|
|
60
|
+ Map<String, String> params = {
|
|
|
|
61
|
+ "uid": Provider.of<UserModel>(context, listen: false).user.openid,
|
|
|
|
62
|
+ 'status': '1'
|
|
|
|
63
|
+ };
|
|
|
|
64
|
+ await customerProvider.getCustomerSelectActivityNew(context, params,
|
|
|
|
65
|
+ isShowLoading: isShowLoading);
|
|
|
|
66
|
+ //此人已经新建好券
|
|
|
|
67
|
+ if (customerProvider.couponListSelect.length > 0) {
|
|
|
|
68
|
+ // couponProvider.initCouponSelect(context);
|
|
|
|
69
|
+ couponList = [];
|
|
|
|
70
|
+ for (int i = 0; i < customerProvider.couponListSelect.length; i++) {
|
|
|
|
71
|
+ couponList.add(customerProvider.couponListSelect[i].aname);
|
|
|
|
72
|
+ }
|
|
|
|
73
|
+ customerProvider.notifyListeners();
|
|
|
|
74
|
+ } else {
|
|
|
|
75
|
+ //没有新建的优惠券
|
|
|
|
76
|
+ }
|
|
|
|
77
|
+ }
|
|
|
|
78
|
+
|
|
|
|
79
|
+ _buttonChoose(String title, ClickCallback callback) {
|
|
|
|
80
|
+ return InkWell(
|
|
|
|
81
|
+ onTap: () {
|
|
|
|
82
|
+ callback(title);
|
|
|
|
83
|
+ },
|
|
|
|
84
|
+ child: Padding(
|
|
|
|
85
|
+ padding: EdgeInsets.symmetric(
|
|
|
|
86
|
+ horizontal: ScreenUtil().setWidth(20),
|
|
|
|
87
|
+ vertical: ScreenUtil().setWidth(10)),
|
|
|
|
88
|
+ // height: ScreenUtil().setWidth(50),
|
|
|
|
89
|
+ // decoration: BoxDecoration(
|
|
|
|
90
|
+ // // border: Border.all(
|
|
|
|
91
|
+ // // width: ScreenUtil().setWidth(2),
|
|
|
|
92
|
+ // // color: MyColours.color_199095),
|
|
|
|
93
|
+ // borderRadius: BorderRadius.circular(ScreenUtil().setWidth(10))),
|
|
|
|
94
|
+ child: Row(
|
|
|
|
95
|
+ children: [
|
|
|
|
96
|
+ Expanded(
|
|
|
|
97
|
+ child: Text(
|
|
|
|
98
|
+ title,
|
|
|
|
99
|
+ textAlign: TextAlign.right,
|
|
|
|
100
|
+ overflow: TextOverflow.ellipsis,
|
|
|
|
101
|
+ style: TextStyle(
|
|
|
|
102
|
+ color: title == '时间(选填)' ||
|
|
|
|
103
|
+ title == '(选填)' ||
|
|
|
|
104
|
+ title == '选择优惠' ||
|
|
|
|
105
|
+ !isUse
|
|
|
|
106
|
+ ? MyColours.color_999999
|
|
|
|
107
|
+ : MyColours.color_438E93,
|
|
|
|
108
|
+ fontWeight: FontWeight.bold,
|
|
|
|
109
|
+ fontSize: ScreenUtil().setWidth(30)),
|
|
|
|
110
|
+ )),
|
|
|
|
111
|
+ HEmptyView(20),
|
|
|
|
112
|
+ Image.asset(
|
|
|
|
113
|
+ // Utils.getImgPath(!customerMakingProvider.isUse
|
|
|
|
114
|
+ // ? 'c_arrow_down_unsel'
|
|
|
|
115
|
+ // : 'c_arrow_down'),
|
|
|
|
116
|
+ Utils.getImgPath(isUse ? 'down_c' : 'quan_down_f'),
|
|
|
|
117
|
+ width: ScreenUtil().setWidth(44),
|
|
|
|
118
|
+ // height: ScreenUtil().setWidth(10),
|
|
|
|
119
|
+ )
|
|
|
|
120
|
+ ],
|
|
|
|
121
|
+ )));
|
|
|
|
122
|
+ }
|
|
|
|
123
|
+
|
|
|
|
124
|
+ _insertUrllink(String link) {
|
|
|
|
125
|
+ // *************开始直接插入会报错***********还没有改
|
|
|
|
126
|
+
|
|
|
|
127
|
+ var cursorPos = controller.selection.base.offset; //获取到光标的在字符串的位置
|
|
|
|
128
|
+
|
|
|
|
129
|
+ if (cursorPos < 0) {
|
|
|
|
130
|
+ controller.text += link;
|
|
|
|
131
|
+ } else {
|
|
|
|
132
|
+ String textAfterCursor =
|
|
|
|
133
|
+ controller.text.substring(cursorPos); //把字符串从光标的位置截取,光标后面的
|
|
|
|
134
|
+
|
|
|
|
135
|
+ String textBeforeCursor =
|
|
|
|
136
|
+ controller.text.substring(0, cursorPos); //光标前面的字符串
|
|
|
|
137
|
+ controller.text =
|
|
|
|
138
|
+ textBeforeCursor + link + textAfterCursor; //把想要的插入的内容拼接在光标位置处
|
|
|
|
139
|
+
|
|
|
|
140
|
+ controller.selection =
|
|
|
|
141
|
+ TextSelection.collapsed(offset: controller.text.length);
|
|
|
|
142
|
+ }
|
|
|
|
143
|
+ }
|
|
|
|
144
|
+
|
|
20
|
@override
|
145
|
@override
|
|
21
|
Widget build(BuildContext context) {
|
146
|
Widget build(BuildContext context) {
|
|
|
|
147
|
+ customerProvider = Provider.of<CustomerProvider>(context, listen: true);
|
|
22
|
return Scaffold(
|
148
|
return Scaffold(
|
|
23
|
- appBar: SystemAppBar('fff'),
|
|
|
|
24
|
- body: SingleChildScrollView(child:
|
|
|
|
25
|
- Column(children: [
|
|
|
|
26
|
- Container(
|
|
|
|
27
|
- width: double.infinity,
|
|
|
|
28
|
- padding: EdgeInsets.all(w(10)),
|
|
|
|
29
|
- margin: EdgeInsets.symmetric(horizontal: w(16)),
|
|
|
|
30
|
- decoration: BoxDecoration(
|
|
|
|
31
|
- border: Border.all(
|
|
|
|
32
|
- color: MyColours.color_DBDBDB, width: w(1)),
|
|
|
|
33
|
- borderRadius: BorderRadius.circular(r(8))),
|
|
|
|
34
|
- child: Column(
|
|
|
|
35
|
- crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
36
|
- children: [
|
|
|
|
37
|
-
|
149
|
+ appBar: SystemAppBar('存酒超期通知短信内容设置'),
|
|
|
|
150
|
+ body: Column(children: [
|
|
|
|
151
|
+ Expanded(
|
|
|
|
152
|
+ child: SingleChildScrollView(
|
|
|
|
153
|
+ child: Column(
|
|
|
|
154
|
+ children: [
|
|
|
|
155
|
+ Container(
|
|
|
|
156
|
+ width: double.infinity,
|
|
|
|
157
|
+ padding: EdgeInsets.all(w(10)),
|
|
|
|
158
|
+ margin: EdgeInsets.symmetric(horizontal: w(16)),
|
|
|
|
159
|
+ decoration: BoxDecoration(
|
|
|
|
160
|
+ border: Border.all(
|
|
|
|
161
|
+ color: MyColours.color_DBDBDB, width: w(1)),
|
|
|
|
162
|
+ borderRadius: BorderRadius.circular(r(8))),
|
|
|
|
163
|
+ child: Column(
|
|
|
|
164
|
+ crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
165
|
+ children: [
|
|
38
|
Text(
|
166
|
Text(
|
|
39
|
contentChangeStart,
|
167
|
contentChangeStart,
|
|
40
|
style: TextStyle(
|
168
|
style: TextStyle(
|
|
@@ -42,63 +170,221 @@ class _WineSettingMsgPageState extends State<WineSettingMsgPage> { |
|
@@ -42,63 +170,221 @@ class _WineSettingMsgPageState extends State<WineSettingMsgPage> { |
|
42
|
color: MyColours.color_66000000,
|
170
|
color: MyColours.color_66000000,
|
|
43
|
fontSize: font(14)),
|
171
|
fontSize: font(14)),
|
|
44
|
),
|
172
|
),
|
|
45
|
- TextField(
|
|
|
|
46
|
- enabled: true,
|
|
|
|
47
|
- controller: controller,
|
|
|
|
48
|
- // textAlign: TextAlign.right,
|
|
|
|
49
|
- // textAlignVertical: TextAlignVertical.bottom,
|
|
|
|
50
|
- maxLines: 10,
|
|
|
|
51
|
-
|
|
|
|
52
|
- // inputFormatters: title == '金额'
|
|
|
|
53
|
- // ? [
|
|
|
|
54
|
- // FilteringTextInputFormatter(RegExp("[0-9.]"),
|
|
|
|
55
|
- // allow: true),
|
|
|
|
56
|
- // MyNumberTextInputFormatter(digit: 2),
|
|
|
|
57
|
- // ]
|
|
|
|
58
|
- // : [],
|
|
|
|
59
|
-
|
|
|
|
60
|
- // //光标颜色
|
|
|
|
61
|
- // cursorColor:
|
|
|
|
62
|
- // widget.isSelect ? Colors.white : MyColours.color_199095,
|
|
|
|
63
|
- //输入文本的样式
|
|
|
|
64
|
- style: TextStyle(
|
|
|
|
65
|
- fontSize: ScreenUtil().setSp(28),
|
|
|
|
66
|
- color: MyColours.color_515151),
|
|
|
|
67
|
- // focusNode: focusNode,
|
|
|
|
68
|
- decoration: InputDecoration(
|
|
|
|
69
|
- border:
|
|
|
|
70
|
- OutlineInputBorder(borderSide: BorderSide.none),
|
|
|
|
71
|
- hintText:
|
|
|
|
72
|
- '以上内容为固定不可编辑,点击这里开始编辑短信内容' ,
|
|
|
|
73
|
- hintStyle: TextStyle(
|
|
|
|
74
|
- color: MyColours.color_999999,
|
|
|
|
75
|
- fontSize: ScreenUtil().setSp(28),
|
173
|
+ TextField(
|
|
|
|
174
|
+ enabled: true,
|
|
|
|
175
|
+ controller: controller,
|
|
|
|
176
|
+ // textAlign: TextAlign.right,
|
|
|
|
177
|
+ // textAlignVertical: TextAlignVertical.bottom,
|
|
|
|
178
|
+ maxLines: 8,
|
|
|
|
179
|
+
|
|
|
|
180
|
+ // inputFormatters: title == '金额'
|
|
|
|
181
|
+ // ? [
|
|
|
|
182
|
+ // FilteringTextInputFormatter(RegExp("[0-9.]"),
|
|
|
|
183
|
+ // allow: true),
|
|
|
|
184
|
+ // MyNumberTextInputFormatter(digit: 2),
|
|
|
|
185
|
+ // ]
|
|
|
|
186
|
+ // : [],
|
|
|
|
187
|
+
|
|
|
|
188
|
+ // //光标颜色
|
|
|
|
189
|
+ // cursorColor:
|
|
|
|
190
|
+ // widget.isSelect ? Colors.white : MyColours.color_199095,
|
|
|
|
191
|
+ //输入文本的样式
|
|
|
|
192
|
+ style: TextStyle(
|
|
|
|
193
|
+ fontSize: ScreenUtil().setSp(28),
|
|
|
|
194
|
+ color: MyColours.color_515151),
|
|
|
|
195
|
+ // focusNode: focusNode,
|
|
|
|
196
|
+ decoration: InputDecoration(
|
|
|
|
197
|
+ border:
|
|
|
|
198
|
+ OutlineInputBorder(borderSide: BorderSide.none),
|
|
|
|
199
|
+ hintText: '点击这里编辑您的短信内容。上面的文字是固定不可编辑的。',
|
|
|
|
200
|
+ hintStyle: TextStyle(
|
|
|
|
201
|
+ color: MyColours.color_999999,
|
|
|
|
202
|
+ fontSize: ScreenUtil().setSp(28),
|
|
|
|
203
|
+ ),
|
|
|
|
204
|
+ contentPadding: EdgeInsets.zero,
|
|
76
|
),
|
205
|
),
|
|
77
|
- contentPadding: EdgeInsets.zero,
|
206
|
+ onChanged: (value) {
|
|
|
|
207
|
+ //添加的代码:光标一直在文本框后面
|
|
|
|
208
|
+ // controller.value = TextEditingValue(
|
|
|
|
209
|
+ // text: controller.text,
|
|
|
|
210
|
+ // selection:
|
|
|
|
211
|
+ // TextSelection.fromPosition(TextPosition(
|
|
|
|
212
|
+ // affinity: TextAffinity.downstream,
|
|
|
|
213
|
+ // offset: controller.text.length,
|
|
|
|
214
|
+ // )));
|
|
|
|
215
|
+ // setState(() {
|
|
|
|
216
|
+ // _cursorPosition = controller.selection.baseOffset;
|
|
|
|
217
|
+ // });
|
|
|
|
218
|
+ },
|
|
|
|
219
|
+ onEditingComplete: () {
|
|
|
|
220
|
+ FocusScope.of(context)
|
|
|
|
221
|
+ .requestFocus(FocusNode()); //点击空白处隐藏键盘
|
|
|
|
222
|
+ },
|
|
|
|
223
|
+ // keyboardType: inputType,
|
|
78
|
),
|
224
|
),
|
|
79
|
- onChanged: (value) {
|
|
|
|
80
|
- //添加的代码:光标一直在文本框后面
|
|
|
|
81
|
- // controller.value = TextEditingValue(
|
|
|
|
82
|
- // text: controller.text,
|
|
|
|
83
|
- // selection:
|
|
|
|
84
|
- // TextSelection.fromPosition(TextPosition(
|
|
|
|
85
|
- // affinity: TextAffinity.downstream,
|
|
|
|
86
|
- // offset: controller.text.length,
|
|
|
|
87
|
- // )));
|
|
|
|
88
|
- // setState(() {
|
|
|
|
89
|
- // _cursorPosition = controller.selection.baseOffset;
|
|
|
|
90
|
- // });
|
|
|
|
91
|
- },
|
|
|
|
92
|
- onEditingComplete: () {
|
|
|
|
93
|
- FocusScope.of(context)
|
|
|
|
94
|
- .requestFocus(FocusNode()); //点击空白处隐藏键盘
|
|
|
|
95
|
- },
|
|
|
|
96
|
- // keyboardType: inputType,
|
|
|
|
97
|
- )
|
|
|
|
98
|
- ],
|
225
|
+ ],
|
|
|
|
226
|
+ ),
|
|
99
|
),
|
227
|
),
|
|
100
|
- ),
|
|
|
|
101
|
- ],),),
|
|
|
|
102
|
- );
|
228
|
+ Container(
|
|
|
|
229
|
+ width: double.infinity,
|
|
|
|
230
|
+ // padding: EdgeInsets.all(w(10)),
|
|
|
|
231
|
+ margin: EdgeInsets.symmetric(horizontal: w(16)),
|
|
|
|
232
|
+ child: Column(
|
|
|
|
233
|
+ children: [
|
|
|
|
234
|
+ VEmptyView(36),
|
|
|
|
235
|
+ InkWell(
|
|
|
|
236
|
+ onTap: () {
|
|
|
|
237
|
+ isUse = !isUse;
|
|
|
|
238
|
+ if (!isUse) {
|
|
|
|
239
|
+ youhui = '选择优惠';
|
|
|
|
240
|
+ }
|
|
|
|
241
|
+ setState(() {});
|
|
|
|
242
|
+ },
|
|
|
|
243
|
+ child: Row(children: [
|
|
|
|
244
|
+ Image.asset(
|
|
|
|
245
|
+ Utils.getImgPath(
|
|
|
|
246
|
+ isUse ? 'f_select' : 'f_select_not'),
|
|
|
|
247
|
+ width: ScreenUtil().setWidth(44)),
|
|
|
|
248
|
+ HEmptyView(15),
|
|
|
|
249
|
+ Text(
|
|
|
|
250
|
+ '在当前位置插入优惠',
|
|
|
|
251
|
+ style: TextStyle(
|
|
|
|
252
|
+ fontSize: ScreenUtil().setSp(32),
|
|
|
|
253
|
+ fontWeight: FontWeight.bold,
|
|
|
|
254
|
+ color: MyColours.color_515151),
|
|
|
|
255
|
+ ),
|
|
|
|
256
|
+ ])),
|
|
|
|
257
|
+ VEmptyView(26),
|
|
|
|
258
|
+ if (isUse)
|
|
|
|
259
|
+ Row(children: [
|
|
|
|
260
|
+ Expanded(
|
|
|
|
261
|
+ child: Container(
|
|
|
|
262
|
+ height: ScreenUtil().setWidth(70),
|
|
|
|
263
|
+ // width: ScreenUtil().setWidth(130),
|
|
|
|
264
|
+ decoration: BoxDecoration(
|
|
|
|
265
|
+ borderRadius: BorderRadius.circular(
|
|
|
|
266
|
+ ScreenUtil().setWidth(10)),
|
|
|
|
267
|
+ color: MyColours.color_DBDBDB),
|
|
|
|
268
|
+ child: _buttonChoose(youhui, (value) {
|
|
|
|
269
|
+ if (isUse) {
|
|
|
|
270
|
+ FocusScope.of(context)
|
|
|
|
271
|
+ .requestFocus(FocusNode()); //隐藏键盘
|
|
|
|
272
|
+ if (couponList == null ||
|
|
|
|
273
|
+ couponList.length == 0) {
|
|
|
|
274
|
+ Utils.showToast('暂无优惠券,请创建新优惠');
|
|
|
|
275
|
+ return;
|
|
|
|
276
|
+ }
|
|
|
|
277
|
+ DialogUtil.showSelectCusmanDialog(
|
|
|
|
278
|
+ context, couponList,
|
|
|
|
279
|
+ (value) async {
|
|
|
|
280
|
+ if (value != null) {
|
|
|
|
281
|
+ if (customerProvider
|
|
|
|
282
|
+ .couponListSelect[
|
|
|
|
283
|
+ value.first]
|
|
|
|
284
|
+ .urllink ==
|
|
|
|
285
|
+ null) {
|
|
|
|
286
|
+ //创建链接
|
|
|
|
287
|
+ //创建券的二维码
|
|
|
|
288
|
+ Map<String, String> param = {
|
|
|
|
289
|
+ "sid": Provider.of<UserModel>(
|
|
|
|
290
|
+ context,
|
|
|
|
291
|
+ listen: false)
|
|
|
|
292
|
+ .user
|
|
|
|
293
|
+ .sellerid,
|
|
|
|
294
|
+ "id": customerProvider
|
|
|
|
295
|
+ .couponListSelect[
|
|
|
|
296
|
+ value.first]
|
|
|
|
297
|
+ .id,
|
|
|
|
298
|
+ };
|
|
|
|
299
|
+ dynamic object =
|
|
|
|
300
|
+ await customerProvider
|
|
|
|
301
|
+ .createActivityUrlLink(
|
|
|
|
302
|
+ context, param);
|
|
|
|
303
|
+ if (object is bool) {
|
|
|
|
304
|
+ //
|
|
|
|
305
|
+
|
|
|
|
306
|
+ } else {
|
|
|
|
307
|
+ //成功
|
|
|
|
308
|
+ _insertUrllink(object);
|
|
|
|
309
|
+ }
|
|
|
|
310
|
+ } else {
|
|
|
|
311
|
+ // 直接使用
|
|
|
|
312
|
+ setState(() {
|
|
|
|
313
|
+ couponSelectIndex =
|
|
|
|
314
|
+ value.first;
|
|
|
|
315
|
+ youhui = couponList[
|
|
|
|
316
|
+ couponSelectIndex];
|
|
|
|
317
|
+ });
|
|
|
|
318
|
+
|
|
|
|
319
|
+ _insertUrllink(customerProvider
|
|
|
|
320
|
+ .couponListSelect[
|
|
|
|
321
|
+ value.first]
|
|
|
|
322
|
+ .urllink);
|
|
|
|
323
|
+ }
|
|
|
|
324
|
+ }
|
|
|
|
325
|
+ },
|
|
|
|
326
|
+ selecteds:
|
|
|
|
327
|
+ couponSelectIndex == null
|
|
|
|
328
|
+ ? []
|
|
|
|
329
|
+ : [couponSelectIndex])
|
|
|
|
330
|
+ .then((value) {});
|
|
|
|
331
|
+ }
|
|
|
|
332
|
+ }))),
|
|
|
|
333
|
+ HEmptyView(30),
|
|
|
|
334
|
+ InkWell(
|
|
|
|
335
|
+ onTap: () async {
|
|
|
|
336
|
+ if (isUse) {
|
|
|
|
337
|
+ // NavigatorUtil.goMarketingRecordsDetailPage(context);
|
|
|
|
338
|
+ bool needRefresh =
|
|
|
|
339
|
+ await NavigatorUtil.goCouponEditPage(
|
|
|
|
340
|
+ context);
|
|
|
|
341
|
+ print(needRefresh);
|
|
|
|
342
|
+ if (needRefresh != null && needRefresh) {
|
|
|
|
343
|
+ //刷新页面数据
|
|
|
|
344
|
+ // _controller.callRefresh();
|
|
|
|
345
|
+ _couponNetworkData();
|
|
|
|
346
|
+ }
|
|
|
|
347
|
+ }
|
|
|
|
348
|
+ },
|
|
|
|
349
|
+ child: Text('创建新优惠',
|
|
|
|
350
|
+ style: TextStyle(
|
|
|
|
351
|
+ decoration: TextDecoration.underline,
|
|
|
|
352
|
+ color: isUse
|
|
|
|
353
|
+ ? MyColours.color_438E93
|
|
|
|
354
|
+ : MyColours.color_999999,
|
|
|
|
355
|
+ fontWeight: FontWeight.bold,
|
|
|
|
356
|
+ fontSize: ScreenUtil().setSp(28)))),
|
|
|
|
357
|
+ ]),
|
|
|
|
358
|
+ ],
|
|
|
|
359
|
+ ))
|
|
|
|
360
|
+ ],
|
|
|
|
361
|
+ ),
|
|
|
|
362
|
+ ),
|
|
|
|
363
|
+ ),
|
|
|
|
364
|
+ Container(
|
|
|
|
365
|
+ padding: EdgeInsets.only(
|
|
|
|
366
|
+ left: w(23), right: w(23), top: w(12), bottom: w(25)),
|
|
|
|
367
|
+ child: Row(
|
|
|
|
368
|
+ children: [
|
|
|
|
369
|
+ Expanded(
|
|
|
|
370
|
+ child: RoundButton(
|
|
|
|
371
|
+ text: '保存',
|
|
|
|
372
|
+ gradientStart: MyColours.color_438E93,
|
|
|
|
373
|
+ gradientEnd: MyColours.color_438E93,
|
|
|
|
374
|
+ // borderColor: MyColours.color_999999,
|
|
|
|
375
|
+ radius: r(5),
|
|
|
|
376
|
+ height: w(43),
|
|
|
|
377
|
+ fontSize: 32,
|
|
|
|
378
|
+
|
|
|
|
379
|
+ isBold: true,
|
|
|
|
380
|
+ onPressed: () {
|
|
|
|
381
|
+ //群发短信
|
|
|
|
382
|
+ // _createMarketing();
|
|
|
|
383
|
+ },
|
|
|
|
384
|
+ )),
|
|
|
|
385
|
+ ],
|
|
|
|
386
|
+ ),
|
|
|
|
387
|
+ )
|
|
|
|
388
|
+ ]));
|
|
103
|
}
|
389
|
}
|
|
104
|
-} |
|
|
|
|
|
390
|
+} |