|
|
|
import 'dart:async';
|
|
|
|
import 'dart:convert';
|
|
|
|
import 'dart:io';
|
|
|
|
import 'dart:typed_data';
|
|
|
|
import 'dart:ui';
|
|
|
|
|
|
...
|
...
|
@@ -10,6 +11,7 @@ import 'package:flutter/material.dart'; |
|
|
|
import 'package:flutter/rendering.dart';
|
|
|
|
import 'package:flutter/services.dart';
|
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
|
import 'package:flutter_sms/flutter_sms.dart';
|
|
|
|
import 'package:one_key/constant/state.dart';
|
|
|
|
import 'package:one_key/models/coupon_model.dart';
|
|
|
|
import 'package:one_key/models/notebook_detail.dart';
|
|
...
|
...
|
@@ -40,12 +42,15 @@ import 'package:one_key/widgets/v_empty_view.dart'; |
|
|
|
import 'package:permission_handler/permission_handler.dart';
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
import 'package:one_key/models/table_list.dart' as t;
|
|
|
|
import 'package:sendsms/sendsms.dart';
|
|
|
|
import 'dart:ui' as ui;
|
|
|
|
|
|
|
|
import '../../app.dart';
|
|
|
|
|
|
|
|
import '../../models/sms_info.dart';
|
|
|
|
import '../../provider/SmsModel.dart';
|
|
|
|
import '../../provider/customer_provider.dart';
|
|
|
|
import '../../provider/marketing_center_provider.dart';
|
|
|
|
import '../../provider/my_model.dart';
|
|
|
|
import '../../utils/screen_util.dart';
|
|
|
|
import '../../widgets/special_text/my_extended_text_selection_controls.dart';
|
|
...
|
...
|
@@ -166,6 +171,9 @@ class InvicationPageState extends State<InvicationPage> |
|
|
|
SmsInfoData smsInfoData;
|
|
|
|
|
|
|
|
ScrollController _scrollCrl = ScrollController();
|
|
|
|
bool noticeSms = false; //使用本手机发短信
|
|
|
|
|
|
|
|
String smsContent = '';
|
|
|
|
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
...
|
...
|
@@ -269,7 +277,9 @@ class InvicationPageState extends State<InvicationPage> |
|
|
|
|
|
|
|
// await _couponNetworkData(isShowLoading: false);
|
|
|
|
await _getCustomerActivityBaseinfo();
|
|
|
|
_getSmsInfo(context);
|
|
|
|
|
|
|
|
getDzSellerConf();
|
|
|
|
|
|
|
|
_timerShow();
|
|
|
|
await _getReserveDetail(showCicle: false);
|
|
|
|
|
|
...
|
...
|
@@ -294,6 +304,38 @@ class InvicationPageState extends State<InvicationPage> |
|
|
|
user = Provider.of<UserModel>(context, listen: false).user;
|
|
|
|
}
|
|
|
|
|
|
|
|
getDzSellerConf() async {
|
|
|
|
MarketingCenterProvider marketingCenterProvider =
|
|
|
|
Provider.of<MarketingCenterProvider>(context, listen: false);
|
|
|
|
bool success = await marketingCenterProvider.getDzSellerConf(context);
|
|
|
|
if (success && marketingCenterProvider.dzSellerConfModel != null) {
|
|
|
|
noticeSms = marketingCenterProvider.dzSellerConfModel.isNotice == '1'
|
|
|
|
? true
|
|
|
|
: false;
|
|
|
|
if (noticeSms) {
|
|
|
|
_getSmsContent();
|
|
|
|
} else {
|
|
|
|
_getSmsInfo(context);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
_getSmsInfo(context);
|
|
|
|
// _getSmsContent();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
///获取短信内容
|
|
|
|
///
|
|
|
|
|
|
|
|
_getSmsContent() async {
|
|
|
|
Map<String, String> params = {
|
|
|
|
"rid": widget.rid,
|
|
|
|
"sid": Provider.of<UserModel>(context, listen: false).user.sellerid
|
|
|
|
};
|
|
|
|
|
|
|
|
smsContent = await Provider.of<SmsModel>(context, listen: false)
|
|
|
|
.getSmsContent(context, params);
|
|
|
|
}
|
|
|
|
|
|
|
|
handlePostFrame(_) {
|
|
|
|
// if (_scrollController.hasClients) {
|
|
|
|
// _scrollController.jumpTo(_scrollController.position.maxScrollExtent -
|
|
...
|
...
|
@@ -2495,85 +2537,81 @@ class InvicationPageState extends State<InvicationPage> |
|
|
|
needHistory: true, index: index);
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
width: double.infinity,
|
|
|
|
height: ScreenUtil().setWidth(100),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
border: Border(
|
|
|
|
bottom: (index !=
|
|
|
|
(_baseIndoProvider
|
|
|
|
.userHistorys
|
|
|
|
.length -
|
|
|
|
1) &&
|
|
|
|
_baseIndoProvider
|
|
|
|
.userHistorys
|
|
|
|
.length >
|
|
|
|
1)
|
|
|
|
? BorderSide(
|
|
|
|
color: MyColours
|
|
|
|
.color_e5e5e5,
|
|
|
|
width: ScreenUtil()
|
|
|
|
.setWidth(2))
|
|
|
|
: BorderSide.none)),
|
|
|
|
child: Align(
|
|
|
|
alignment:
|
|
|
|
Alignment.centerLeft,
|
|
|
|
child: Text(
|
|
|
|
(_nameNode.hasFocus
|
|
|
|
? (_baseIndoProvider
|
|
|
|
.userHistorys[
|
|
|
|
index]
|
|
|
|
.rnameStr ==
|
|
|
|
null
|
|
|
|
? ''
|
|
|
|
: _baseIndoProvider
|
|
|
|
width: double.infinity,
|
|
|
|
height: ScreenUtil().setWidth(100),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
border: Border(
|
|
|
|
bottom: (index !=
|
|
|
|
(_baseIndoProvider
|
|
|
|
.userHistorys
|
|
|
|
.length -
|
|
|
|
1) &&
|
|
|
|
_baseIndoProvider
|
|
|
|
.userHistorys
|
|
|
|
.length >
|
|
|
|
1)
|
|
|
|
? BorderSide(
|
|
|
|
color: MyColours
|
|
|
|
.color_e5e5e5,
|
|
|
|
width: ScreenUtil()
|
|
|
|
.setWidth(2))
|
|
|
|
: BorderSide.none)),
|
|
|
|
child: Align(
|
|
|
|
alignment: Alignment.centerLeft,
|
|
|
|
child: Text(
|
|
|
|
(_nameNode.hasFocus
|
|
|
|
? (_baseIndoProvider
|
|
|
|
.userHistorys[
|
|
|
|
index]
|
|
|
|
.rnameStr)
|
|
|
|
: (_baseIndoProvider
|
|
|
|
.userHistorys[
|
|
|
|
index]
|
|
|
|
.phone ==
|
|
|
|
null
|
|
|
|
? ''
|
|
|
|
: _baseIndoProvider
|
|
|
|
.rnameStr ==
|
|
|
|
null
|
|
|
|
? ''
|
|
|
|
: _baseIndoProvider
|
|
|
|
.userHistorys[
|
|
|
|
index]
|
|
|
|
.rnameStr)
|
|
|
|
: (_baseIndoProvider
|
|
|
|
.userHistorys[
|
|
|
|
index]
|
|
|
|
.phone)) +
|
|
|
|
' ' +
|
|
|
|
(_nameNode.hasFocus
|
|
|
|
? (_baseIndoProvider
|
|
|
|
.userHistorys[
|
|
|
|
index]
|
|
|
|
.phone ==
|
|
|
|
null
|
|
|
|
? ''
|
|
|
|
: _baseIndoProvider
|
|
|
|
.phone ==
|
|
|
|
null
|
|
|
|
? ''
|
|
|
|
: _baseIndoProvider
|
|
|
|
.userHistorys[
|
|
|
|
index]
|
|
|
|
.phone)) +
|
|
|
|
' ' +
|
|
|
|
(_nameNode.hasFocus
|
|
|
|
? (_baseIndoProvider
|
|
|
|
.userHistorys[
|
|
|
|
index]
|
|
|
|
.phone)
|
|
|
|
: (_baseIndoProvider
|
|
|
|
.userHistorys[
|
|
|
|
index]
|
|
|
|
.rnameStr ==
|
|
|
|
null
|
|
|
|
? ''
|
|
|
|
: _baseIndoProvider
|
|
|
|
.phone ==
|
|
|
|
null
|
|
|
|
? ''
|
|
|
|
: _baseIndoProvider
|
|
|
|
.userHistorys[
|
|
|
|
index]
|
|
|
|
.phone)
|
|
|
|
: (_baseIndoProvider
|
|
|
|
.userHistorys[
|
|
|
|
index]
|
|
|
|
.rnameStr)) +
|
|
|
|
' ' +
|
|
|
|
_baseIndoProvider
|
|
|
|
.userHistorys[
|
|
|
|
index]
|
|
|
|
.nickName,
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours
|
|
|
|
.color_333333,
|
|
|
|
fontSize: ScreenUtil()
|
|
|
|
.setSp(32)),
|
|
|
|
))
|
|
|
|
|
|
|
|
),
|
|
|
|
.rnameStr ==
|
|
|
|
null
|
|
|
|
? ''
|
|
|
|
: _baseIndoProvider
|
|
|
|
.userHistorys[
|
|
|
|
index]
|
|
|
|
.rnameStr)) +
|
|
|
|
' ' +
|
|
|
|
_baseIndoProvider
|
|
|
|
.userHistorys[index]
|
|
|
|
.nickName,
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours
|
|
|
|
.color_333333,
|
|
|
|
fontSize: ScreenUtil()
|
|
|
|
.setSp(32)),
|
|
|
|
))),
|
|
|
|
);
|
|
|
|
},
|
|
|
|
itemExtent: ScreenUtil().setWidth(104),
|
|
...
|
...
|
@@ -4040,6 +4078,56 @@ class InvicationPageState extends State<InvicationPage> |
|
|
|
// ]);
|
|
|
|
// }
|
|
|
|
|
|
|
|
// 跳转系统短信页面
|
|
|
|
_goSendSmsPage() async {
|
|
|
|
if (reserverPhone == null ||
|
|
|
|
reserverPhone.isEmpty ||
|
|
|
|
!Utils.phoneRegExp(reserverPhone)) {
|
|
|
|
//跳转到录入联系人页面
|
|
|
|
// String temp = await NavigatorUtil.goEditReserverPage(
|
|
|
|
// context, widget.rid, name, sex,
|
|
|
|
// needBtn: true);
|
|
|
|
// if (temp != null) {
|
|
|
|
// reserverPhone = temp;
|
|
|
|
// }
|
|
|
|
// Utils.showToast('请输入客户手机号');
|
|
|
|
//显示请输入11位手机号码
|
|
|
|
setState(() {
|
|
|
|
showErroInfo = true;
|
|
|
|
erroInfo = '请正确输入11位手机号码';
|
|
|
|
});
|
|
|
|
|
|
|
|
return;
|
|
|
|
} else {
|
|
|
|
setState(() {
|
|
|
|
showErroInfo = false;
|
|
|
|
erroInfo = '';
|
|
|
|
});
|
|
|
|
//跳转
|
|
|
|
|
|
|
|
bool sucess = await Sendsms.onSendSMS(reserverPhone, smsContent);
|
|
|
|
|
|
|
|
// if (Platform.isIOS) {
|
|
|
|
// // List<String> phoneNumber = ['18161963378', '18729572142', '18765432345'];
|
|
|
|
|
|
|
|
// try {
|
|
|
|
// String _result = await sendSMS(message: smsContent, recipients: iosPhone);
|
|
|
|
// // sucess = _result;
|
|
|
|
// } catch (error) {
|
|
|
|
// print(error.toString());
|
|
|
|
// }
|
|
|
|
// } else {
|
|
|
|
// print('确定发送');
|
|
|
|
// // String phoneNumber = "18161963378;18729572142";
|
|
|
|
|
|
|
|
// // await Sendsms.onGetPermission();
|
|
|
|
|
|
|
|
// // if (await Sendsms.hasPermission()) {
|
|
|
|
// sucess = await Sendsms.onSendSMS(andriodPhone, message);
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
///微信通知、发短信
|
|
|
|
Widget _btnWidget() {
|
|
|
|
return Padding(
|
|
...
|
...
|
@@ -4066,48 +4154,52 @@ class InvicationPageState extends State<InvicationPage> |
|
|
|
_showConfirmWidget(
|
|
|
|
needWechat: true,
|
|
|
|
callback: () async {
|
|
|
|
if (myModel.smsInfo == '0') {
|
|
|
|
setState(() {
|
|
|
|
showErroInfo = true;
|
|
|
|
erroInfo = '短信余额不足,请充值短信条数';
|
|
|
|
});
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (canSendSms) {
|
|
|
|
if (reserverPhone == null ||
|
|
|
|
reserverPhone.isEmpty ||
|
|
|
|
!Utils.phoneRegExp(reserverPhone)) {
|
|
|
|
//跳转到录入联系人页面
|
|
|
|
// String temp = await NavigatorUtil.goEditReserverPage(
|
|
|
|
// context, widget.rid, name, sex,
|
|
|
|
// needBtn: true);
|
|
|
|
// if (temp != null) {
|
|
|
|
// reserverPhone = temp;
|
|
|
|
// }
|
|
|
|
// Utils.showToast('请输入客户手机号');
|
|
|
|
//显示请输入11位手机号码
|
|
|
|
if (noticeSms) {
|
|
|
|
//跳转系统发短信
|
|
|
|
_goSendSmsPage();
|
|
|
|
} else {
|
|
|
|
if (myModel.smsInfo == '0') {
|
|
|
|
setState(() {
|
|
|
|
showErroInfo = true;
|
|
|
|
erroInfo = '请正确输入11位手机号码';
|
|
|
|
});
|
|
|
|
|
|
|
|
return;
|
|
|
|
} else if (ObjectUtil.isEmpty(
|
|
|
|
_baseIndoProvider.baseInfoSunModel) ||
|
|
|
|
ObjectUtil.isEmpty(
|
|
|
|
_baseIndoProvider.baseInfoSunModel.phone)) {
|
|
|
|
// Utils.showToast('请填写经理的联系电话');
|
|
|
|
DialogUtil.cupertinoAlertDialog(context,
|
|
|
|
title: "填写个人信息",
|
|
|
|
content: "暂未填写您的联系信息,请先前往填写,个人信息将会展示给您的顾客。",
|
|
|
|
lTitle: "取消",
|
|
|
|
rTitle: "去填写",
|
|
|
|
lCallback: () {}, rCallback: () {
|
|
|
|
_goBaseInfoPage();
|
|
|
|
erroInfo = '短信余额不足,请充值短信条数';
|
|
|
|
});
|
|
|
|
return;
|
|
|
|
} else {
|
|
|
|
/*
|
|
|
|
}
|
|
|
|
if (canSendSms) {
|
|
|
|
if (reserverPhone == null ||
|
|
|
|
reserverPhone.isEmpty ||
|
|
|
|
!Utils.phoneRegExp(reserverPhone)) {
|
|
|
|
//跳转到录入联系人页面
|
|
|
|
// String temp = await NavigatorUtil.goEditReserverPage(
|
|
|
|
// context, widget.rid, name, sex,
|
|
|
|
// needBtn: true);
|
|
|
|
// if (temp != null) {
|
|
|
|
// reserverPhone = temp;
|
|
|
|
// }
|
|
|
|
// Utils.showToast('请输入客户手机号');
|
|
|
|
//显示请输入11位手机号码
|
|
|
|
setState(() {
|
|
|
|
showErroInfo = true;
|
|
|
|
erroInfo = '请正确输入11位手机号码';
|
|
|
|
});
|
|
|
|
|
|
|
|
return;
|
|
|
|
} else if (ObjectUtil.isEmpty(
|
|
|
|
_baseIndoProvider.baseInfoSunModel) ||
|
|
|
|
ObjectUtil.isEmpty(_baseIndoProvider
|
|
|
|
.baseInfoSunModel.phone)) {
|
|
|
|
// Utils.showToast('请填写经理的联系电话');
|
|
|
|
DialogUtil.cupertinoAlertDialog(context,
|
|
|
|
title: "填写个人信息",
|
|
|
|
content: "暂未填写您的联系信息,请先前往填写,个人信息将会展示给您的顾客。",
|
|
|
|
lTitle: "取消",
|
|
|
|
rTitle: "去填写",
|
|
|
|
lCallback: () {}, rCallback: () {
|
|
|
|
_goBaseInfoPage();
|
|
|
|
});
|
|
|
|
return;
|
|
|
|
} else {
|
|
|
|
/*
|
|
|
|
String dateSoltStr = '';
|
|
|
|
if (widget.dateSolt == '1') {
|
|
|
|
dateSoltStr = '早餐';
|
|
...
|
...
|
@@ -4149,119 +4241,125 @@ class InvicationPageState extends State<InvicationPage> |
|
|
|
params['Strtext'] = user.sellername;
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
setState(() {
|
|
|
|
showErroInfo = false;
|
|
|
|
erroInfo = '';
|
|
|
|
});
|
|
|
|
UserModel userModel = Provider.of<UserModel>(
|
|
|
|
context,
|
|
|
|
listen: false);
|
|
|
|
Map<String, String> params = {
|
|
|
|
"rid": widget.rid,
|
|
|
|
"sid": userModel.user.sellerid
|
|
|
|
};
|
|
|
|
bool success = await couponProvider
|
|
|
|
.sendSMSWxSendSms(context, params);
|
|
|
|
print(success);
|
|
|
|
if (success) {
|
|
|
|
setState(() {
|
|
|
|
smsTitle = '已发${couponProvider.sendSMS}次';
|
|
|
|
showErroInfo = false;
|
|
|
|
erroInfo = '';
|
|
|
|
});
|
|
|
|
canSendSms = false;
|
|
|
|
startCountdown(120);
|
|
|
|
} else {
|
|
|
|
if (couponProvider.errorSMS != '') {
|
|
|
|
UserModel userModel = Provider.of<UserModel>(
|
|
|
|
context,
|
|
|
|
listen: false);
|
|
|
|
Map<String, String> params = {
|
|
|
|
"rid": widget.rid,
|
|
|
|
"sid": userModel.user.sellerid
|
|
|
|
};
|
|
|
|
bool success = await couponProvider
|
|
|
|
.sendSMSWxSendSms(context, params);
|
|
|
|
print(success);
|
|
|
|
if (success) {
|
|
|
|
setState(() {
|
|
|
|
showErroInfo = true;
|
|
|
|
erroInfo = couponProvider.errorSMS;
|
|
|
|
smsTitle = '已发${couponProvider.sendSMS}次';
|
|
|
|
});
|
|
|
|
canSendSms = false;
|
|
|
|
startCountdown(120);
|
|
|
|
} else {
|
|
|
|
if (couponProvider.errorSMS != '') {
|
|
|
|
setState(() {
|
|
|
|
showErroInfo = true;
|
|
|
|
erroInfo = couponProvider.errorSMS;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// if (success) {
|
|
|
|
// Utils.showToast('短信已经发送成功!');
|
|
|
|
// } else {
|
|
|
|
// Utils.showToast('发送次数太频繁!');
|
|
|
|
// }
|
|
|
|
// if (success) {
|
|
|
|
// Utils.showToast('短信已经发送成功!');
|
|
|
|
// } else {
|
|
|
|
// Utils.showToast('发送次数太频繁!');
|
|
|
|
// }
|
|
|
|
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
//显示2分钟只能发1次短信
|
|
|
|
setState(() {
|
|
|
|
showErroInfo = true;
|
|
|
|
erroInfo = '2分钟内只能发送一条短信';
|
|
|
|
});
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
//显示2分钟只能发1次短信
|
|
|
|
setState(() {
|
|
|
|
showErroInfo = true;
|
|
|
|
erroInfo = '2分钟内只能发送一条短信';
|
|
|
|
});
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
removeOverlay();
|
|
|
|
} else {
|
|
|
|
if (myModel.smsInfo == '0') {
|
|
|
|
setState(() {
|
|
|
|
showErroInfo = true;
|
|
|
|
erroInfo = '短信余额不足,请充值短信条数';
|
|
|
|
});
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (canSendSms) {
|
|
|
|
if (reserverPhone == null ||
|
|
|
|
reserverPhone.isEmpty ||
|
|
|
|
!Utils.phoneRegExp(reserverPhone)) {
|
|
|
|
//显示请输入11位手机号码
|
|
|
|
if (noticeSms) {
|
|
|
|
//跳转系统
|
|
|
|
_goSendSmsPage();
|
|
|
|
} else {
|
|
|
|
if (myModel.smsInfo == '0') {
|
|
|
|
setState(() {
|
|
|
|
showErroInfo = true;
|
|
|
|
erroInfo = '请正确输入11位手机号码';
|
|
|
|
erroInfo = '短信余额不足,请充值短信条数';
|
|
|
|
});
|
|
|
|
return;
|
|
|
|
} else if (ObjectUtil.isEmpty(
|
|
|
|
_baseIndoProvider.baseInfoSunModel) ||
|
|
|
|
ObjectUtil.isEmpty(
|
|
|
|
_baseIndoProvider.baseInfoSunModel.phone)) {
|
|
|
|
// Utils.showToast('请填写经理的联系电话');
|
|
|
|
DialogUtil.cupertinoAlertDialog(context,
|
|
|
|
title: "填写个人信息",
|
|
|
|
content: "暂未填写您的联系信息,请先前往填写,个人信息将会展示给您的顾客。",
|
|
|
|
lTitle: "取消",
|
|
|
|
rTitle: "去填写",
|
|
|
|
lCallback: () {}, rCallback: () {
|
|
|
|
_goBaseInfoPage();
|
|
|
|
});
|
|
|
|
return;
|
|
|
|
} else {
|
|
|
|
setState(() {
|
|
|
|
showErroInfo = false;
|
|
|
|
erroInfo = '';
|
|
|
|
});
|
|
|
|
UserModel userModel =
|
|
|
|
Provider.of<UserModel>(context, listen: false);
|
|
|
|
Map<String, String> params = {
|
|
|
|
"rid": widget.rid,
|
|
|
|
"sid": userModel.user.sellerid
|
|
|
|
};
|
|
|
|
bool success = await couponProvider.sendSMSWxSendSms(
|
|
|
|
context, params);
|
|
|
|
print(success);
|
|
|
|
if (success) {
|
|
|
|
}
|
|
|
|
if (canSendSms) {
|
|
|
|
if (reserverPhone == null ||
|
|
|
|
reserverPhone.isEmpty ||
|
|
|
|
!Utils.phoneRegExp(reserverPhone)) {
|
|
|
|
//显示请输入11位手机号码
|
|
|
|
setState(() {
|
|
|
|
smsTitle = '已发${couponProvider.sendSMS}次';
|
|
|
|
showErroInfo = true;
|
|
|
|
erroInfo = '请正确输入11位手机号码';
|
|
|
|
});
|
|
|
|
return;
|
|
|
|
} else if (ObjectUtil.isEmpty(
|
|
|
|
_baseIndoProvider.baseInfoSunModel) ||
|
|
|
|
ObjectUtil.isEmpty(
|
|
|
|
_baseIndoProvider.baseInfoSunModel.phone)) {
|
|
|
|
// Utils.showToast('请填写经理的联系电话');
|
|
|
|
DialogUtil.cupertinoAlertDialog(context,
|
|
|
|
title: "填写个人信息",
|
|
|
|
content: "暂未填写您的联系信息,请先前往填写,个人信息将会展示给您的顾客。",
|
|
|
|
lTitle: "取消",
|
|
|
|
rTitle: "去填写",
|
|
|
|
lCallback: () {}, rCallback: () {
|
|
|
|
_goBaseInfoPage();
|
|
|
|
});
|
|
|
|
canSendSms = false;
|
|
|
|
startCountdown(120);
|
|
|
|
return;
|
|
|
|
} else {
|
|
|
|
if (couponProvider.errorSMS != '') {
|
|
|
|
setState(() {
|
|
|
|
showErroInfo = false;
|
|
|
|
erroInfo = '';
|
|
|
|
});
|
|
|
|
UserModel userModel =
|
|
|
|
Provider.of<UserModel>(context, listen: false);
|
|
|
|
Map<String, String> params = {
|
|
|
|
"rid": widget.rid,
|
|
|
|
"sid": userModel.user.sellerid
|
|
|
|
};
|
|
|
|
bool success = await couponProvider.sendSMSWxSendSms(
|
|
|
|
context, params);
|
|
|
|
print(success);
|
|
|
|
if (success) {
|
|
|
|
setState(() {
|
|
|
|
showErroInfo = true;
|
|
|
|
erroInfo = couponProvider.errorSMS;
|
|
|
|
smsTitle = '已发${couponProvider.sendSMS}次';
|
|
|
|
});
|
|
|
|
canSendSms = false;
|
|
|
|
startCountdown(120);
|
|
|
|
} else {
|
|
|
|
if (couponProvider.errorSMS != '') {
|
|
|
|
setState(() {
|
|
|
|
showErroInfo = true;
|
|
|
|
erroInfo = couponProvider.errorSMS;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
//显示2分钟只能发1次短信
|
|
|
|
setState(() {
|
|
|
|
showErroInfo = true;
|
|
|
|
erroInfo = '2分钟内只能发送一条短信';
|
|
|
|
});
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
//显示2分钟只能发1次短信
|
|
|
|
setState(() {
|
|
|
|
showErroInfo = true;
|
|
|
|
erroInfo = '2分钟内只能发送一条短信';
|
|
|
|
});
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}),
|
...
|
...
|
|