Commit 5dd3f38818edaa5bef814b6c57f8297d2d2c7536

Authored by wdn127929
1 parent f34cc103

短信新接口

... ... @@ -11,14 +11,14 @@ if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
def flutterVersionCode = "270"
def flutterVersionCode = "271"
if (flutterVersionCode == null) {
flutterVersionCode = '270'
flutterVersionCode = '271'
}
def flutterVersionName = "2.7.0"
def flutterVersionName = "2.7.1"
if (flutterVersionName == null) {
flutterVersionName = '2.7.0'
flutterVersionName = '2.7.1'
}
apply plugin: 'com.android.application'
... ...
... ... @@ -313,6 +313,16 @@ class InvicationPageState extends State<InvicationPage> {
}
}
//发送短信
_sendSms() async {
UserModel userModel = Provider.of<UserModel>(context, listen: false);
Map<String, String> params = {
"rid": widget.rid,
"sid": userModel.user.sellerid
};
await couponProvider.sendSms(context, params);
}
@override
Widget build(BuildContext context) {
// Utils.changeStatusColor(color: Colors.transparent);
... ... @@ -900,6 +910,7 @@ class InvicationPageState extends State<InvicationPage> {
Utils.showToast("没有预订人电话信息");
return;
}
/* 旧的发短信
if (!couponProvider.sendSMS) {
String dateSoltStr = '';
if (widget.dateSolt == '1') {
... ... @@ -952,6 +963,9 @@ class InvicationPageState extends State<InvicationPage> {
} else {
Utils.showToast('短信已经发送成功!');
}
*/
_sendSms();
// NavigatorUtil.goSmsPage(context, widget.rid);
},
... ...
... ... @@ -452,4 +452,20 @@ class CouponProvider with ChangeNotifier {
return false;
}
}
//发送短信
sendSms(BuildContext context, Map<String, String> params) async {
BaseResp<dynamic> baseResp = await DioUtil()
.request<dynamic>(context, Method.get, HttpUrl.send_sms, data: params)
.catchError((error) {
print(error.toString());
});
if (baseResp.code == Constant.status_success) {
Utils.showToast("短信发送成功");
} else if (baseResp.code == 396) {
Utils.showToast("短信余量不足,请前去充值");
} else {
Utils.showToast(baseResp.msg ?? "");
}
}
}
... ...