Commit 05090e8c0b572ea284d3f1ff293d53a2d1dd9d77

Authored by weixin_45529955
1 parent a52a03d1

发短信防抖

... ... @@ -457,7 +457,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 5600;
CURRENT_PROJECT_VERSION = 5601;
DEVELOPMENT_TEAM = 8J59HM8B82;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
... ... @@ -640,7 +640,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 5600;
CURRENT_PROJECT_VERSION = 5601;
DEVELOPMENT_TEAM = 8J59HM8B82;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
... ... @@ -666,7 +666,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 5600;
CURRENT_PROJECT_VERSION = 5601;
DEVELOPMENT_TEAM = 8J59HM8B82;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
... ...
... ... @@ -5341,6 +5341,31 @@ class InvicationPageState extends State<InvicationPage>
}
}
_send() async {
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}次';
});
canSendSms = false;
startCountdown(120);
} else {
if (couponProvider.errorSMS != '') {
setState(() {
showErroInfo = true;
erroInfo = couponProvider.errorSMS;
});
}
}
}
///微信通知、发短信
Widget _btnWidget() {
return Padding(
... ... @@ -5459,30 +5484,9 @@ class InvicationPageState extends State<InvicationPage>
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}次';
});
canSendSms = false;
startCountdown(120);
} else {
if (couponProvider.errorSMS != '') {
setState(() {
showErroInfo = true;
erroInfo = couponProvider.errorSMS;
});
}
}
JhCommonUtils.debounce(() => _send());
// if (success) {
// Utils.showToast('短信已经发送成功!');
// } else {
... ... @@ -5542,29 +5546,8 @@ class InvicationPageState extends State<InvicationPage>
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}次';
});
canSendSms = false;
startCountdown(120);
} else {
if (couponProvider.errorSMS != '') {
setState(() {
showErroInfo = true;
erroInfo = couponProvider.errorSMS;
});
}
}
JhCommonUtils.debounce(() => _send());
}
} else {
//显示2分钟只能发1次短信
... ...