|
1
|
import 'dart:async';
|
1
|
import 'dart:async';
|
|
2
|
import 'dart:convert';
|
2
|
import 'dart:convert';
|
|
|
|
3
|
+import 'dart:io';
|
|
3
|
import 'dart:typed_data';
|
4
|
import 'dart:typed_data';
|
|
4
|
import 'dart:ui';
|
5
|
import 'dart:ui';
|
|
5
|
|
6
|
|
|
@@ -10,6 +11,7 @@ import 'package:flutter/material.dart'; |
|
@@ -10,6 +11,7 @@ import 'package:flutter/material.dart'; |
|
10
|
import 'package:flutter/rendering.dart';
|
11
|
import 'package:flutter/rendering.dart';
|
|
11
|
import 'package:flutter/services.dart';
|
12
|
import 'package:flutter/services.dart';
|
|
12
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
13
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
|
14
|
+import 'package:flutter_sms/flutter_sms.dart';
|
|
13
|
import 'package:one_key/constant/state.dart';
|
15
|
import 'package:one_key/constant/state.dart';
|
|
14
|
import 'package:one_key/models/coupon_model.dart';
|
16
|
import 'package:one_key/models/coupon_model.dart';
|
|
15
|
import 'package:one_key/models/notebook_detail.dart';
|
17
|
import 'package:one_key/models/notebook_detail.dart';
|
|
@@ -40,12 +42,15 @@ import 'package:one_key/widgets/v_empty_view.dart'; |
|
@@ -40,12 +42,15 @@ import 'package:one_key/widgets/v_empty_view.dart'; |
|
40
|
import 'package:permission_handler/permission_handler.dart';
|
42
|
import 'package:permission_handler/permission_handler.dart';
|
|
41
|
import 'package:provider/provider.dart';
|
43
|
import 'package:provider/provider.dart';
|
|
42
|
import 'package:one_key/models/table_list.dart' as t;
|
44
|
import 'package:one_key/models/table_list.dart' as t;
|
|
|
|
45
|
+import 'package:sendsms/sendsms.dart';
|
|
43
|
import 'dart:ui' as ui;
|
46
|
import 'dart:ui' as ui;
|
|
44
|
|
47
|
|
|
45
|
import '../../app.dart';
|
48
|
import '../../app.dart';
|
|
46
|
|
49
|
|
|
47
|
import '../../models/sms_info.dart';
|
50
|
import '../../models/sms_info.dart';
|
|
|
|
51
|
+import '../../provider/SmsModel.dart';
|
|
48
|
import '../../provider/customer_provider.dart';
|
52
|
import '../../provider/customer_provider.dart';
|
|
|
|
53
|
+import '../../provider/marketing_center_provider.dart';
|
|
49
|
import '../../provider/my_model.dart';
|
54
|
import '../../provider/my_model.dart';
|
|
50
|
import '../../utils/screen_util.dart';
|
55
|
import '../../utils/screen_util.dart';
|
|
51
|
import '../../widgets/special_text/my_extended_text_selection_controls.dart';
|
56
|
import '../../widgets/special_text/my_extended_text_selection_controls.dart';
|
|
@@ -166,6 +171,9 @@ class InvicationPageState extends State<InvicationPage> |
|
@@ -166,6 +171,9 @@ class InvicationPageState extends State<InvicationPage> |
|
166
|
SmsInfoData smsInfoData;
|
171
|
SmsInfoData smsInfoData;
|
|
167
|
|
172
|
|
|
168
|
ScrollController _scrollCrl = ScrollController();
|
173
|
ScrollController _scrollCrl = ScrollController();
|
|
|
|
174
|
+ bool noticeSms = false; //使用本手机发短信
|
|
|
|
175
|
+
|
|
|
|
176
|
+ String smsContent = '';
|
|
169
|
|
177
|
|
|
170
|
@override
|
178
|
@override
|
|
171
|
void initState() {
|
179
|
void initState() {
|
|
@@ -269,7 +277,9 @@ class InvicationPageState extends State<InvicationPage> |
|
@@ -269,7 +277,9 @@ class InvicationPageState extends State<InvicationPage> |
|
269
|
|
277
|
|
|
270
|
// await _couponNetworkData(isShowLoading: false);
|
278
|
// await _couponNetworkData(isShowLoading: false);
|
|
271
|
await _getCustomerActivityBaseinfo();
|
279
|
await _getCustomerActivityBaseinfo();
|
|
272
|
- _getSmsInfo(context);
|
280
|
+
|
|
|
|
281
|
+ getDzSellerConf();
|
|
|
|
282
|
+
|
|
273
|
_timerShow();
|
283
|
_timerShow();
|
|
274
|
await _getReserveDetail(showCicle: false);
|
284
|
await _getReserveDetail(showCicle: false);
|
|
275
|
|
285
|
|
|
@@ -294,6 +304,38 @@ class InvicationPageState extends State<InvicationPage> |
|
@@ -294,6 +304,38 @@ class InvicationPageState extends State<InvicationPage> |
|
294
|
user = Provider.of<UserModel>(context, listen: false).user;
|
304
|
user = Provider.of<UserModel>(context, listen: false).user;
|
|
295
|
}
|
305
|
}
|
|
296
|
|
306
|
|
|
|
|
307
|
+ getDzSellerConf() async {
|
|
|
|
308
|
+ MarketingCenterProvider marketingCenterProvider =
|
|
|
|
309
|
+ Provider.of<MarketingCenterProvider>(context, listen: false);
|
|
|
|
310
|
+ bool success = await marketingCenterProvider.getDzSellerConf(context);
|
|
|
|
311
|
+ if (success && marketingCenterProvider.dzSellerConfModel != null) {
|
|
|
|
312
|
+ noticeSms = marketingCenterProvider.dzSellerConfModel.isNotice == '1'
|
|
|
|
313
|
+ ? true
|
|
|
|
314
|
+ : false;
|
|
|
|
315
|
+ if (noticeSms) {
|
|
|
|
316
|
+ _getSmsContent();
|
|
|
|
317
|
+ } else {
|
|
|
|
318
|
+ _getSmsInfo(context);
|
|
|
|
319
|
+ }
|
|
|
|
320
|
+ } else {
|
|
|
|
321
|
+ _getSmsInfo(context);
|
|
|
|
322
|
+ // _getSmsContent();
|
|
|
|
323
|
+ }
|
|
|
|
324
|
+ }
|
|
|
|
325
|
+
|
|
|
|
326
|
+ ///获取短信内容
|
|
|
|
327
|
+ ///
|
|
|
|
328
|
+
|
|
|
|
329
|
+ _getSmsContent() async {
|
|
|
|
330
|
+ Map<String, String> params = {
|
|
|
|
331
|
+ "rid": widget.rid,
|
|
|
|
332
|
+ "sid": Provider.of<UserModel>(context, listen: false).user.sellerid
|
|
|
|
333
|
+ };
|
|
|
|
334
|
+
|
|
|
|
335
|
+ smsContent = await Provider.of<SmsModel>(context, listen: false)
|
|
|
|
336
|
+ .getSmsContent(context, params);
|
|
|
|
337
|
+ }
|
|
|
|
338
|
+
|
|
297
|
handlePostFrame(_) {
|
339
|
handlePostFrame(_) {
|
|
298
|
// if (_scrollController.hasClients) {
|
340
|
// if (_scrollController.hasClients) {
|
|
299
|
// _scrollController.jumpTo(_scrollController.position.maxScrollExtent -
|
341
|
// _scrollController.jumpTo(_scrollController.position.maxScrollExtent -
|
|
@@ -2495,85 +2537,81 @@ class InvicationPageState extends State<InvicationPage> |
|
@@ -2495,85 +2537,81 @@ class InvicationPageState extends State<InvicationPage> |
|
2495
|
needHistory: true, index: index);
|
2537
|
needHistory: true, index: index);
|
|
2496
|
},
|
2538
|
},
|
|
2497
|
child: Container(
|
2539
|
child: Container(
|
|
2498
|
- width: double.infinity,
|
|
|
|
2499
|
- height: ScreenUtil().setWidth(100),
|
|
|
|
2500
|
- decoration: BoxDecoration(
|
|
|
|
2501
|
- border: Border(
|
|
|
|
2502
|
- bottom: (index !=
|
|
|
|
2503
|
- (_baseIndoProvider
|
|
|
|
2504
|
- .userHistorys
|
|
|
|
2505
|
- .length -
|
|
|
|
2506
|
- 1) &&
|
|
|
|
2507
|
- _baseIndoProvider
|
|
|
|
2508
|
- .userHistorys
|
|
|
|
2509
|
- .length >
|
|
|
|
2510
|
- 1)
|
|
|
|
2511
|
- ? BorderSide(
|
|
|
|
2512
|
- color: MyColours
|
|
|
|
2513
|
- .color_e5e5e5,
|
|
|
|
2514
|
- width: ScreenUtil()
|
|
|
|
2515
|
- .setWidth(2))
|
|
|
|
2516
|
- : BorderSide.none)),
|
|
|
|
2517
|
- child: Align(
|
|
|
|
2518
|
- alignment:
|
|
|
|
2519
|
- Alignment.centerLeft,
|
|
|
|
2520
|
- child: Text(
|
|
|
|
2521
|
- (_nameNode.hasFocus
|
|
|
|
2522
|
- ? (_baseIndoProvider
|
|
|
|
2523
|
- .userHistorys[
|
|
|
|
2524
|
- index]
|
|
|
|
2525
|
- .rnameStr ==
|
|
|
|
2526
|
- null
|
|
|
|
2527
|
- ? ''
|
|
|
|
2528
|
- : _baseIndoProvider
|
2540
|
+ width: double.infinity,
|
|
|
|
2541
|
+ height: ScreenUtil().setWidth(100),
|
|
|
|
2542
|
+ decoration: BoxDecoration(
|
|
|
|
2543
|
+ border: Border(
|
|
|
|
2544
|
+ bottom: (index !=
|
|
|
|
2545
|
+ (_baseIndoProvider
|
|
|
|
2546
|
+ .userHistorys
|
|
|
|
2547
|
+ .length -
|
|
|
|
2548
|
+ 1) &&
|
|
|
|
2549
|
+ _baseIndoProvider
|
|
|
|
2550
|
+ .userHistorys
|
|
|
|
2551
|
+ .length >
|
|
|
|
2552
|
+ 1)
|
|
|
|
2553
|
+ ? BorderSide(
|
|
|
|
2554
|
+ color: MyColours
|
|
|
|
2555
|
+ .color_e5e5e5,
|
|
|
|
2556
|
+ width: ScreenUtil()
|
|
|
|
2557
|
+ .setWidth(2))
|
|
|
|
2558
|
+ : BorderSide.none)),
|
|
|
|
2559
|
+ child: Align(
|
|
|
|
2560
|
+ alignment: Alignment.centerLeft,
|
|
|
|
2561
|
+ child: Text(
|
|
|
|
2562
|
+ (_nameNode.hasFocus
|
|
|
|
2563
|
+ ? (_baseIndoProvider
|
|
2529
|
.userHistorys[
|
2564
|
.userHistorys[
|
|
2530
|
index]
|
2565
|
index]
|
|
2531
|
- .rnameStr)
|
|
|
|
2532
|
- : (_baseIndoProvider
|
|
|
|
2533
|
- .userHistorys[
|
|
|
|
2534
|
- index]
|
|
|
|
2535
|
- .phone ==
|
|
|
|
2536
|
- null
|
|
|
|
2537
|
- ? ''
|
|
|
|
2538
|
- : _baseIndoProvider
|
2566
|
+ .rnameStr ==
|
|
|
|
2567
|
+ null
|
|
|
|
2568
|
+ ? ''
|
|
|
|
2569
|
+ : _baseIndoProvider
|
|
|
|
2570
|
+ .userHistorys[
|
|
|
|
2571
|
+ index]
|
|
|
|
2572
|
+ .rnameStr)
|
|
|
|
2573
|
+ : (_baseIndoProvider
|
|
2539
|
.userHistorys[
|
2574
|
.userHistorys[
|
|
2540
|
index]
|
2575
|
index]
|
|
2541
|
- .phone)) +
|
|
|
|
2542
|
- ' ' +
|
|
|
|
2543
|
- (_nameNode.hasFocus
|
|
|
|
2544
|
- ? (_baseIndoProvider
|
|
|
|
2545
|
- .userHistorys[
|
|
|
|
2546
|
- index]
|
|
|
|
2547
|
- .phone ==
|
|
|
|
2548
|
- null
|
|
|
|
2549
|
- ? ''
|
|
|
|
2550
|
- : _baseIndoProvider
|
2576
|
+ .phone ==
|
|
|
|
2577
|
+ null
|
|
|
|
2578
|
+ ? ''
|
|
|
|
2579
|
+ : _baseIndoProvider
|
|
|
|
2580
|
+ .userHistorys[
|
|
|
|
2581
|
+ index]
|
|
|
|
2582
|
+ .phone)) +
|
|
|
|
2583
|
+ ' ' +
|
|
|
|
2584
|
+ (_nameNode.hasFocus
|
|
|
|
2585
|
+ ? (_baseIndoProvider
|
|
2551
|
.userHistorys[
|
2586
|
.userHistorys[
|
|
2552
|
index]
|
2587
|
index]
|
|
2553
|
- .phone)
|
|
|
|
2554
|
- : (_baseIndoProvider
|
|
|
|
2555
|
- .userHistorys[
|
|
|
|
2556
|
- index]
|
|
|
|
2557
|
- .rnameStr ==
|
|
|
|
2558
|
- null
|
|
|
|
2559
|
- ? ''
|
|
|
|
2560
|
- : _baseIndoProvider
|
2588
|
+ .phone ==
|
|
|
|
2589
|
+ null
|
|
|
|
2590
|
+ ? ''
|
|
|
|
2591
|
+ : _baseIndoProvider
|
|
|
|
2592
|
+ .userHistorys[
|
|
|
|
2593
|
+ index]
|
|
|
|
2594
|
+ .phone)
|
|
|
|
2595
|
+ : (_baseIndoProvider
|
|
2561
|
.userHistorys[
|
2596
|
.userHistorys[
|
|
2562
|
index]
|
2597
|
index]
|
|
2563
|
- .rnameStr)) +
|
|
|
|
2564
|
- ' ' +
|
|
|
|
2565
|
- _baseIndoProvider
|
|
|
|
2566
|
- .userHistorys[
|
|
|
|
2567
|
- index]
|
|
|
|
2568
|
- .nickName,
|
|
|
|
2569
|
- style: TextStyle(
|
|
|
|
2570
|
- color: MyColours
|
|
|
|
2571
|
- .color_333333,
|
|
|
|
2572
|
- fontSize: ScreenUtil()
|
|
|
|
2573
|
- .setSp(32)),
|
|
|
|
2574
|
- ))
|
|
|
|
2575
|
-
|
|
|
|
2576
|
- ),
|
2598
|
+ .rnameStr ==
|
|
|
|
2599
|
+ null
|
|
|
|
2600
|
+ ? ''
|
|
|
|
2601
|
+ : _baseIndoProvider
|
|
|
|
2602
|
+ .userHistorys[
|
|
|
|
2603
|
+ index]
|
|
|
|
2604
|
+ .rnameStr)) +
|
|
|
|
2605
|
+ ' ' +
|
|
|
|
2606
|
+ _baseIndoProvider
|
|
|
|
2607
|
+ .userHistorys[index]
|
|
|
|
2608
|
+ .nickName,
|
|
|
|
2609
|
+ style: TextStyle(
|
|
|
|
2610
|
+ color: MyColours
|
|
|
|
2611
|
+ .color_333333,
|
|
|
|
2612
|
+ fontSize: ScreenUtil()
|
|
|
|
2613
|
+ .setSp(32)),
|
|
|
|
2614
|
+ ))),
|
|
2577
|
);
|
2615
|
);
|
|
2578
|
},
|
2616
|
},
|
|
2579
|
itemExtent: ScreenUtil().setWidth(104),
|
2617
|
itemExtent: ScreenUtil().setWidth(104),
|
|
@@ -4040,6 +4078,56 @@ class InvicationPageState extends State<InvicationPage> |
|
@@ -4040,6 +4078,56 @@ class InvicationPageState extends State<InvicationPage> |
|
4040
|
// ]);
|
4078
|
// ]);
|
|
4041
|
// }
|
4079
|
// }
|
|
4042
|
|
4080
|
|
|
|
|
4081
|
+ // 跳转系统短信页面
|
|
|
|
4082
|
+ _goSendSmsPage() async {
|
|
|
|
4083
|
+ if (reserverPhone == null ||
|
|
|
|
4084
|
+ reserverPhone.isEmpty ||
|
|
|
|
4085
|
+ !Utils.phoneRegExp(reserverPhone)) {
|
|
|
|
4086
|
+ //跳转到录入联系人页面
|
|
|
|
4087
|
+ // String temp = await NavigatorUtil.goEditReserverPage(
|
|
|
|
4088
|
+ // context, widget.rid, name, sex,
|
|
|
|
4089
|
+ // needBtn: true);
|
|
|
|
4090
|
+ // if (temp != null) {
|
|
|
|
4091
|
+ // reserverPhone = temp;
|
|
|
|
4092
|
+ // }
|
|
|
|
4093
|
+ // Utils.showToast('请输入客户手机号');
|
|
|
|
4094
|
+ //显示请输入11位手机号码
|
|
|
|
4095
|
+ setState(() {
|
|
|
|
4096
|
+ showErroInfo = true;
|
|
|
|
4097
|
+ erroInfo = '请正确输入11位手机号码';
|
|
|
|
4098
|
+ });
|
|
|
|
4099
|
+
|
|
|
|
4100
|
+ return;
|
|
|
|
4101
|
+ } else {
|
|
|
|
4102
|
+ setState(() {
|
|
|
|
4103
|
+ showErroInfo = false;
|
|
|
|
4104
|
+ erroInfo = '';
|
|
|
|
4105
|
+ });
|
|
|
|
4106
|
+ //跳转
|
|
|
|
4107
|
+
|
|
|
|
4108
|
+ bool sucess = await Sendsms.onSendSMS(reserverPhone, smsContent);
|
|
|
|
4109
|
+
|
|
|
|
4110
|
+ // if (Platform.isIOS) {
|
|
|
|
4111
|
+ // // List<String> phoneNumber = ['18161963378', '18729572142', '18765432345'];
|
|
|
|
4112
|
+
|
|
|
|
4113
|
+ // try {
|
|
|
|
4114
|
+ // String _result = await sendSMS(message: smsContent, recipients: iosPhone);
|
|
|
|
4115
|
+ // // sucess = _result;
|
|
|
|
4116
|
+ // } catch (error) {
|
|
|
|
4117
|
+ // print(error.toString());
|
|
|
|
4118
|
+ // }
|
|
|
|
4119
|
+ // } else {
|
|
|
|
4120
|
+ // print('确定发送');
|
|
|
|
4121
|
+ // // String phoneNumber = "18161963378;18729572142";
|
|
|
|
4122
|
+
|
|
|
|
4123
|
+ // // await Sendsms.onGetPermission();
|
|
|
|
4124
|
+
|
|
|
|
4125
|
+ // // if (await Sendsms.hasPermission()) {
|
|
|
|
4126
|
+ // sucess = await Sendsms.onSendSMS(andriodPhone, message);
|
|
|
|
4127
|
+ // }
|
|
|
|
4128
|
+ }
|
|
|
|
4129
|
+ }
|
|
|
|
4130
|
+
|
|
4043
|
///微信通知、发短信
|
4131
|
///微信通知、发短信
|
|
4044
|
Widget _btnWidget() {
|
4132
|
Widget _btnWidget() {
|
|
4045
|
return Padding(
|
4133
|
return Padding(
|
|
@@ -4066,48 +4154,52 @@ class InvicationPageState extends State<InvicationPage> |
|
@@ -4066,48 +4154,52 @@ class InvicationPageState extends State<InvicationPage> |
|
4066
|
_showConfirmWidget(
|
4154
|
_showConfirmWidget(
|
|
4067
|
needWechat: true,
|
4155
|
needWechat: true,
|
|
4068
|
callback: () async {
|
4156
|
callback: () async {
|
|
4069
|
- if (myModel.smsInfo == '0') {
|
|
|
|
4070
|
- setState(() {
|
|
|
|
4071
|
- showErroInfo = true;
|
|
|
|
4072
|
- erroInfo = '短信余额不足,请充值短信条数';
|
|
|
|
4073
|
- });
|
|
|
|
4074
|
- return;
|
|
|
|
4075
|
- }
|
|
|
|
4076
|
- if (canSendSms) {
|
|
|
|
4077
|
- if (reserverPhone == null ||
|
|
|
|
4078
|
- reserverPhone.isEmpty ||
|
|
|
|
4079
|
- !Utils.phoneRegExp(reserverPhone)) {
|
|
|
|
4080
|
- //跳转到录入联系人页面
|
|
|
|
4081
|
- // String temp = await NavigatorUtil.goEditReserverPage(
|
|
|
|
4082
|
- // context, widget.rid, name, sex,
|
|
|
|
4083
|
- // needBtn: true);
|
|
|
|
4084
|
- // if (temp != null) {
|
|
|
|
4085
|
- // reserverPhone = temp;
|
|
|
|
4086
|
- // }
|
|
|
|
4087
|
- // Utils.showToast('请输入客户手机号');
|
|
|
|
4088
|
- //显示请输入11位手机号码
|
4157
|
+ if (noticeSms) {
|
|
|
|
4158
|
+ //跳转系统发短信
|
|
|
|
4159
|
+ _goSendSmsPage();
|
|
|
|
4160
|
+ } else {
|
|
|
|
4161
|
+ if (myModel.smsInfo == '0') {
|
|
4089
|
setState(() {
|
4162
|
setState(() {
|
|
4090
|
showErroInfo = true;
|
4163
|
showErroInfo = true;
|
|
4091
|
- erroInfo = '请正确输入11位手机号码';
|
|
|
|
4092
|
- });
|
|
|
|
4093
|
-
|
|
|
|
4094
|
- return;
|
|
|
|
4095
|
- } else if (ObjectUtil.isEmpty(
|
|
|
|
4096
|
- _baseIndoProvider.baseInfoSunModel) ||
|
|
|
|
4097
|
- ObjectUtil.isEmpty(
|
|
|
|
4098
|
- _baseIndoProvider.baseInfoSunModel.phone)) {
|
|
|
|
4099
|
- // Utils.showToast('请填写经理的联系电话');
|
|
|
|
4100
|
- DialogUtil.cupertinoAlertDialog(context,
|
|
|
|
4101
|
- title: "填写个人信息",
|
|
|
|
4102
|
- content: "暂未填写您的联系信息,请先前往填写,个人信息将会展示给您的顾客。",
|
|
|
|
4103
|
- lTitle: "取消",
|
|
|
|
4104
|
- rTitle: "去填写",
|
|
|
|
4105
|
- lCallback: () {}, rCallback: () {
|
|
|
|
4106
|
- _goBaseInfoPage();
|
4164
|
+ erroInfo = '短信余额不足,请充值短信条数';
|
|
4107
|
});
|
4165
|
});
|
|
4108
|
return;
|
4166
|
return;
|
|
4109
|
- } else {
|
|
|
|
4110
|
- /*
|
4167
|
+ }
|
|
|
|
4168
|
+ if (canSendSms) {
|
|
|
|
4169
|
+ if (reserverPhone == null ||
|
|
|
|
4170
|
+ reserverPhone.isEmpty ||
|
|
|
|
4171
|
+ !Utils.phoneRegExp(reserverPhone)) {
|
|
|
|
4172
|
+ //跳转到录入联系人页面
|
|
|
|
4173
|
+ // String temp = await NavigatorUtil.goEditReserverPage(
|
|
|
|
4174
|
+ // context, widget.rid, name, sex,
|
|
|
|
4175
|
+ // needBtn: true);
|
|
|
|
4176
|
+ // if (temp != null) {
|
|
|
|
4177
|
+ // reserverPhone = temp;
|
|
|
|
4178
|
+ // }
|
|
|
|
4179
|
+ // Utils.showToast('请输入客户手机号');
|
|
|
|
4180
|
+ //显示请输入11位手机号码
|
|
|
|
4181
|
+ setState(() {
|
|
|
|
4182
|
+ showErroInfo = true;
|
|
|
|
4183
|
+ erroInfo = '请正确输入11位手机号码';
|
|
|
|
4184
|
+ });
|
|
|
|
4185
|
+
|
|
|
|
4186
|
+ return;
|
|
|
|
4187
|
+ } else if (ObjectUtil.isEmpty(
|
|
|
|
4188
|
+ _baseIndoProvider.baseInfoSunModel) ||
|
|
|
|
4189
|
+ ObjectUtil.isEmpty(_baseIndoProvider
|
|
|
|
4190
|
+ .baseInfoSunModel.phone)) {
|
|
|
|
4191
|
+ // Utils.showToast('请填写经理的联系电话');
|
|
|
|
4192
|
+ DialogUtil.cupertinoAlertDialog(context,
|
|
|
|
4193
|
+ title: "填写个人信息",
|
|
|
|
4194
|
+ content: "暂未填写您的联系信息,请先前往填写,个人信息将会展示给您的顾客。",
|
|
|
|
4195
|
+ lTitle: "取消",
|
|
|
|
4196
|
+ rTitle: "去填写",
|
|
|
|
4197
|
+ lCallback: () {}, rCallback: () {
|
|
|
|
4198
|
+ _goBaseInfoPage();
|
|
|
|
4199
|
+ });
|
|
|
|
4200
|
+ return;
|
|
|
|
4201
|
+ } else {
|
|
|
|
4202
|
+ /*
|
|
4111
|
String dateSoltStr = '';
|
4203
|
String dateSoltStr = '';
|
|
4112
|
if (widget.dateSolt == '1') {
|
4204
|
if (widget.dateSolt == '1') {
|
|
4113
|
dateSoltStr = '早餐';
|
4205
|
dateSoltStr = '早餐';
|
|
@@ -4149,119 +4241,125 @@ class InvicationPageState extends State<InvicationPage> |
|
@@ -4149,119 +4241,125 @@ class InvicationPageState extends State<InvicationPage> |
|
4149
|
params['Strtext'] = user.sellername;
|
4241
|
params['Strtext'] = user.sellername;
|
|
4150
|
}
|
4242
|
}
|
|
4151
|
*/
|
4243
|
*/
|
|
4152
|
- setState(() {
|
|
|
|
4153
|
- showErroInfo = false;
|
|
|
|
4154
|
- erroInfo = '';
|
|
|
|
4155
|
- });
|
|
|
|
4156
|
- UserModel userModel = Provider.of<UserModel>(
|
|
|
|
4157
|
- context,
|
|
|
|
4158
|
- listen: false);
|
|
|
|
4159
|
- Map<String, String> params = {
|
|
|
|
4160
|
- "rid": widget.rid,
|
|
|
|
4161
|
- "sid": userModel.user.sellerid
|
|
|
|
4162
|
- };
|
|
|
|
4163
|
- bool success = await couponProvider
|
|
|
|
4164
|
- .sendSMSWxSendSms(context, params);
|
|
|
|
4165
|
- print(success);
|
|
|
|
4166
|
- if (success) {
|
|
|
|
4167
|
setState(() {
|
4244
|
setState(() {
|
|
4168
|
- smsTitle = '已发${couponProvider.sendSMS}次';
|
4245
|
+ showErroInfo = false;
|
|
|
|
4246
|
+ erroInfo = '';
|
|
4169
|
});
|
4247
|
});
|
|
4170
|
- canSendSms = false;
|
|
|
|
4171
|
- startCountdown(120);
|
|
|
|
4172
|
- } else {
|
|
|
|
4173
|
- if (couponProvider.errorSMS != '') {
|
4248
|
+ UserModel userModel = Provider.of<UserModel>(
|
|
|
|
4249
|
+ context,
|
|
|
|
4250
|
+ listen: false);
|
|
|
|
4251
|
+ Map<String, String> params = {
|
|
|
|
4252
|
+ "rid": widget.rid,
|
|
|
|
4253
|
+ "sid": userModel.user.sellerid
|
|
|
|
4254
|
+ };
|
|
|
|
4255
|
+ bool success = await couponProvider
|
|
|
|
4256
|
+ .sendSMSWxSendSms(context, params);
|
|
|
|
4257
|
+ print(success);
|
|
|
|
4258
|
+ if (success) {
|
|
4174
|
setState(() {
|
4259
|
setState(() {
|
|
4175
|
- showErroInfo = true;
|
|
|
|
4176
|
- erroInfo = couponProvider.errorSMS;
|
4260
|
+ smsTitle = '已发${couponProvider.sendSMS}次';
|
|
4177
|
});
|
4261
|
});
|
|
|
|
4262
|
+ canSendSms = false;
|
|
|
|
4263
|
+ startCountdown(120);
|
|
|
|
4264
|
+ } else {
|
|
|
|
4265
|
+ if (couponProvider.errorSMS != '') {
|
|
|
|
4266
|
+ setState(() {
|
|
|
|
4267
|
+ showErroInfo = true;
|
|
|
|
4268
|
+ erroInfo = couponProvider.errorSMS;
|
|
|
|
4269
|
+ });
|
|
|
|
4270
|
+ }
|
|
4178
|
}
|
4271
|
}
|
|
4179
|
- }
|
|
|
|
4180
|
- // if (success) {
|
|
|
|
4181
|
- // Utils.showToast('短信已经发送成功!');
|
|
|
|
4182
|
- // } else {
|
|
|
|
4183
|
- // Utils.showToast('发送次数太频繁!');
|
|
|
|
4184
|
- // }
|
4272
|
+ // if (success) {
|
|
|
|
4273
|
+ // Utils.showToast('短信已经发送成功!');
|
|
|
|
4274
|
+ // } else {
|
|
|
|
4275
|
+ // Utils.showToast('发送次数太频繁!');
|
|
|
|
4276
|
+ // }
|
|
4185
|
|
4277
|
|
|
|
|
4278
|
+ }
|
|
|
|
4279
|
+ } else {
|
|
|
|
4280
|
+ //显示2分钟只能发1次短信
|
|
|
|
4281
|
+ setState(() {
|
|
|
|
4282
|
+ showErroInfo = true;
|
|
|
|
4283
|
+ erroInfo = '2分钟内只能发送一条短信';
|
|
|
|
4284
|
+ });
|
|
|
|
4285
|
+ return;
|
|
4186
|
}
|
4286
|
}
|
|
4187
|
- } else {
|
|
|
|
4188
|
- //显示2分钟只能发1次短信
|
|
|
|
4189
|
- setState(() {
|
|
|
|
4190
|
- showErroInfo = true;
|
|
|
|
4191
|
- erroInfo = '2分钟内只能发送一条短信';
|
|
|
|
4192
|
- });
|
|
|
|
4193
|
- return;
|
|
|
|
4194
|
}
|
4287
|
}
|
|
4195
|
});
|
4288
|
});
|
|
4196
|
removeOverlay();
|
4289
|
removeOverlay();
|
|
4197
|
} else {
|
4290
|
} else {
|
|
4198
|
- if (myModel.smsInfo == '0') {
|
|
|
|
4199
|
- setState(() {
|
|
|
|
4200
|
- showErroInfo = true;
|
|
|
|
4201
|
- erroInfo = '短信余额不足,请充值短信条数';
|
|
|
|
4202
|
- });
|
|
|
|
4203
|
- return;
|
|
|
|
4204
|
- }
|
|
|
|
4205
|
- if (canSendSms) {
|
|
|
|
4206
|
- if (reserverPhone == null ||
|
|
|
|
4207
|
- reserverPhone.isEmpty ||
|
|
|
|
4208
|
- !Utils.phoneRegExp(reserverPhone)) {
|
|
|
|
4209
|
- //显示请输入11位手机号码
|
4291
|
+ if (noticeSms) {
|
|
|
|
4292
|
+ //跳转系统
|
|
|
|
4293
|
+ _goSendSmsPage();
|
|
|
|
4294
|
+ } else {
|
|
|
|
4295
|
+ if (myModel.smsInfo == '0') {
|
|
4210
|
setState(() {
|
4296
|
setState(() {
|
|
4211
|
showErroInfo = true;
|
4297
|
showErroInfo = true;
|
|
4212
|
- erroInfo = '请正确输入11位手机号码';
|
4298
|
+ erroInfo = '短信余额不足,请充值短信条数';
|
|
4213
|
});
|
4299
|
});
|
|
4214
|
return;
|
4300
|
return;
|
|
4215
|
- } else if (ObjectUtil.isEmpty(
|
|
|
|
4216
|
- _baseIndoProvider.baseInfoSunModel) ||
|
|
|
|
4217
|
- ObjectUtil.isEmpty(
|
|
|
|
4218
|
- _baseIndoProvider.baseInfoSunModel.phone)) {
|
|
|
|
4219
|
- // Utils.showToast('请填写经理的联系电话');
|
|
|
|
4220
|
- DialogUtil.cupertinoAlertDialog(context,
|
|
|
|
4221
|
- title: "填写个人信息",
|
|
|
|
4222
|
- content: "暂未填写您的联系信息,请先前往填写,个人信息将会展示给您的顾客。",
|
|
|
|
4223
|
- lTitle: "取消",
|
|
|
|
4224
|
- rTitle: "去填写",
|
|
|
|
4225
|
- lCallback: () {}, rCallback: () {
|
|
|
|
4226
|
- _goBaseInfoPage();
|
|
|
|
4227
|
- });
|
|
|
|
4228
|
- return;
|
|
|
|
4229
|
- } else {
|
|
|
|
4230
|
- setState(() {
|
|
|
|
4231
|
- showErroInfo = false;
|
|
|
|
4232
|
- erroInfo = '';
|
|
|
|
4233
|
- });
|
|
|
|
4234
|
- UserModel userModel =
|
|
|
|
4235
|
- Provider.of<UserModel>(context, listen: false);
|
|
|
|
4236
|
- Map<String, String> params = {
|
|
|
|
4237
|
- "rid": widget.rid,
|
|
|
|
4238
|
- "sid": userModel.user.sellerid
|
|
|
|
4239
|
- };
|
|
|
|
4240
|
- bool success = await couponProvider.sendSMSWxSendSms(
|
|
|
|
4241
|
- context, params);
|
|
|
|
4242
|
- print(success);
|
|
|
|
4243
|
- if (success) {
|
4301
|
+ }
|
|
|
|
4302
|
+ if (canSendSms) {
|
|
|
|
4303
|
+ if (reserverPhone == null ||
|
|
|
|
4304
|
+ reserverPhone.isEmpty ||
|
|
|
|
4305
|
+ !Utils.phoneRegExp(reserverPhone)) {
|
|
|
|
4306
|
+ //显示请输入11位手机号码
|
|
4244
|
setState(() {
|
4307
|
setState(() {
|
|
4245
|
- smsTitle = '已发${couponProvider.sendSMS}次';
|
4308
|
+ showErroInfo = true;
|
|
|
|
4309
|
+ erroInfo = '请正确输入11位手机号码';
|
|
|
|
4310
|
+ });
|
|
|
|
4311
|
+ return;
|
|
|
|
4312
|
+ } else if (ObjectUtil.isEmpty(
|
|
|
|
4313
|
+ _baseIndoProvider.baseInfoSunModel) ||
|
|
|
|
4314
|
+ ObjectUtil.isEmpty(
|
|
|
|
4315
|
+ _baseIndoProvider.baseInfoSunModel.phone)) {
|
|
|
|
4316
|
+ // Utils.showToast('请填写经理的联系电话');
|
|
|
|
4317
|
+ DialogUtil.cupertinoAlertDialog(context,
|
|
|
|
4318
|
+ title: "填写个人信息",
|
|
|
|
4319
|
+ content: "暂未填写您的联系信息,请先前往填写,个人信息将会展示给您的顾客。",
|
|
|
|
4320
|
+ lTitle: "取消",
|
|
|
|
4321
|
+ rTitle: "去填写",
|
|
|
|
4322
|
+ lCallback: () {}, rCallback: () {
|
|
|
|
4323
|
+ _goBaseInfoPage();
|
|
4246
|
});
|
4324
|
});
|
|
4247
|
- canSendSms = false;
|
|
|
|
4248
|
- startCountdown(120);
|
4325
|
+ return;
|
|
4249
|
} else {
|
4326
|
} else {
|
|
4250
|
- if (couponProvider.errorSMS != '') {
|
4327
|
+ setState(() {
|
|
|
|
4328
|
+ showErroInfo = false;
|
|
|
|
4329
|
+ erroInfo = '';
|
|
|
|
4330
|
+ });
|
|
|
|
4331
|
+ UserModel userModel =
|
|
|
|
4332
|
+ Provider.of<UserModel>(context, listen: false);
|
|
|
|
4333
|
+ Map<String, String> params = {
|
|
|
|
4334
|
+ "rid": widget.rid,
|
|
|
|
4335
|
+ "sid": userModel.user.sellerid
|
|
|
|
4336
|
+ };
|
|
|
|
4337
|
+ bool success = await couponProvider.sendSMSWxSendSms(
|
|
|
|
4338
|
+ context, params);
|
|
|
|
4339
|
+ print(success);
|
|
|
|
4340
|
+ if (success) {
|
|
4251
|
setState(() {
|
4341
|
setState(() {
|
|
4252
|
- showErroInfo = true;
|
|
|
|
4253
|
- erroInfo = couponProvider.errorSMS;
|
4342
|
+ smsTitle = '已发${couponProvider.sendSMS}次';
|
|
4254
|
});
|
4343
|
});
|
|
|
|
4344
|
+ canSendSms = false;
|
|
|
|
4345
|
+ startCountdown(120);
|
|
|
|
4346
|
+ } else {
|
|
|
|
4347
|
+ if (couponProvider.errorSMS != '') {
|
|
|
|
4348
|
+ setState(() {
|
|
|
|
4349
|
+ showErroInfo = true;
|
|
|
|
4350
|
+ erroInfo = couponProvider.errorSMS;
|
|
|
|
4351
|
+ });
|
|
|
|
4352
|
+ }
|
|
4255
|
}
|
4353
|
}
|
|
4256
|
}
|
4354
|
}
|
|
|
|
4355
|
+ } else {
|
|
|
|
4356
|
+ //显示2分钟只能发1次短信
|
|
|
|
4357
|
+ setState(() {
|
|
|
|
4358
|
+ showErroInfo = true;
|
|
|
|
4359
|
+ erroInfo = '2分钟内只能发送一条短信';
|
|
|
|
4360
|
+ });
|
|
|
|
4361
|
+ return;
|
|
4257
|
}
|
4362
|
}
|
|
4258
|
- } else {
|
|
|
|
4259
|
- //显示2分钟只能发1次短信
|
|
|
|
4260
|
- setState(() {
|
|
|
|
4261
|
- showErroInfo = true;
|
|
|
|
4262
|
- erroInfo = '2分钟内只能发送一条短信';
|
|
|
|
4263
|
- });
|
|
|
|
4264
|
- return;
|
|
|
|
4265
|
}
|
4363
|
}
|
|
4266
|
}
|
4364
|
}
|
|
4267
|
}),
|
4365
|
}),
|