Showing
3 changed files
with
34 additions
and
4 deletions
| @@ -11,14 +11,14 @@ if (flutterRoot == null) { | @@ -11,14 +11,14 @@ if (flutterRoot == null) { | ||
| 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") | 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") |
| 12 | } | 12 | } |
| 13 | 13 | ||
| 14 | -def flutterVersionCode = "270" | 14 | +def flutterVersionCode = "271" |
| 15 | if (flutterVersionCode == null) { | 15 | if (flutterVersionCode == null) { |
| 16 | - flutterVersionCode = '270' | 16 | + flutterVersionCode = '271' |
| 17 | } | 17 | } |
| 18 | 18 | ||
| 19 | -def flutterVersionName = "2.7.0" | 19 | +def flutterVersionName = "2.7.1" |
| 20 | if (flutterVersionName == null) { | 20 | if (flutterVersionName == null) { |
| 21 | - flutterVersionName = '2.7.0' | 21 | + flutterVersionName = '2.7.1' |
| 22 | } | 22 | } |
| 23 | 23 | ||
| 24 | apply plugin: 'com.android.application' | 24 | apply plugin: 'com.android.application' |
| @@ -313,6 +313,16 @@ class InvicationPageState extends State<InvicationPage> { | @@ -313,6 +313,16 @@ class InvicationPageState extends State<InvicationPage> { | ||
| 313 | } | 313 | } |
| 314 | } | 314 | } |
| 315 | 315 | ||
| 316 | + //发送短信 | ||
| 317 | + _sendSms() async { | ||
| 318 | + UserModel userModel = Provider.of<UserModel>(context, listen: false); | ||
| 319 | + Map<String, String> params = { | ||
| 320 | + "rid": widget.rid, | ||
| 321 | + "sid": userModel.user.sellerid | ||
| 322 | + }; | ||
| 323 | + await couponProvider.sendSms(context, params); | ||
| 324 | + } | ||
| 325 | + | ||
| 316 | @override | 326 | @override |
| 317 | Widget build(BuildContext context) { | 327 | Widget build(BuildContext context) { |
| 318 | // Utils.changeStatusColor(color: Colors.transparent); | 328 | // Utils.changeStatusColor(color: Colors.transparent); |
| @@ -900,6 +910,7 @@ class InvicationPageState extends State<InvicationPage> { | @@ -900,6 +910,7 @@ class InvicationPageState extends State<InvicationPage> { | ||
| 900 | Utils.showToast("没有预订人电话信息"); | 910 | Utils.showToast("没有预订人电话信息"); |
| 901 | return; | 911 | return; |
| 902 | } | 912 | } |
| 913 | + /* 旧的发短信 | ||
| 903 | if (!couponProvider.sendSMS) { | 914 | if (!couponProvider.sendSMS) { |
| 904 | String dateSoltStr = ''; | 915 | String dateSoltStr = ''; |
| 905 | if (widget.dateSolt == '1') { | 916 | if (widget.dateSolt == '1') { |
| @@ -952,6 +963,9 @@ class InvicationPageState extends State<InvicationPage> { | @@ -952,6 +963,9 @@ class InvicationPageState extends State<InvicationPage> { | ||
| 952 | } else { | 963 | } else { |
| 953 | Utils.showToast('短信已经发送成功!'); | 964 | Utils.showToast('短信已经发送成功!'); |
| 954 | } | 965 | } |
| 966 | + */ | ||
| 967 | + | ||
| 968 | + _sendSms(); | ||
| 955 | 969 | ||
| 956 | // NavigatorUtil.goSmsPage(context, widget.rid); | 970 | // NavigatorUtil.goSmsPage(context, widget.rid); |
| 957 | }, | 971 | }, |
| @@ -452,4 +452,20 @@ class CouponProvider with ChangeNotifier { | @@ -452,4 +452,20 @@ class CouponProvider with ChangeNotifier { | ||
| 452 | return false; | 452 | return false; |
| 453 | } | 453 | } |
| 454 | } | 454 | } |
| 455 | + | ||
| 456 | + //发送短信 | ||
| 457 | + sendSms(BuildContext context, Map<String, String> params) async { | ||
| 458 | + BaseResp<dynamic> baseResp = await DioUtil() | ||
| 459 | + .request<dynamic>(context, Method.get, HttpUrl.send_sms, data: params) | ||
| 460 | + .catchError((error) { | ||
| 461 | + print(error.toString()); | ||
| 462 | + }); | ||
| 463 | + if (baseResp.code == Constant.status_success) { | ||
| 464 | + Utils.showToast("短信发送成功"); | ||
| 465 | + } else if (baseResp.code == 396) { | ||
| 466 | + Utils.showToast("短信余量不足,请前去充值"); | ||
| 467 | + } else { | ||
| 468 | + Utils.showToast(baseResp.msg ?? ""); | ||
| 469 | + } | ||
| 470 | + } | ||
| 455 | } | 471 | } |
-
Please register or login to post a comment