Commit bad84057fb9f6bbf07a21300a10bd5a37fb20b49

Authored by wdn127929
1 parent 5dd3f388

短信修改

... ... @@ -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 = "271"
def flutterVersionCode = "272"
if (flutterVersionCode == null) {
flutterVersionCode = '271'
flutterVersionCode = '272'
}
def flutterVersionName = "2.7.1"
def flutterVersionName = "2.7.2"
if (flutterVersionName == null) {
flutterVersionName = '2.7.1'
flutterVersionName = '2.7.2'
}
apply plugin: 'com.android.application'
... ...
... ... @@ -910,8 +910,9 @@ class InvicationPageState extends State<InvicationPage> {
Utils.showToast("没有预订人电话信息");
return;
}
/* 旧的发短信
if (!couponProvider.sendSMS) {
/*
String dateSoltStr = '';
if (widget.dateSolt == '1') {
dateSoltStr = '早餐';
... ... @@ -952,20 +953,27 @@ class InvicationPageState extends State<InvicationPage> {
} else {
params['Strtext'] = user.sellername;
}
*/
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) {
Utils.showToast('短信已经发送成功!');
} else {
Utils.showToast('发送次数太频繁!');
}
// if (success) {
// Utils.showToast('短信已经发送成功!');
// } else {
// Utils.showToast('发送次数太频繁!');
// }
} else {
Utils.showToast('短信已经发送成功!');
}
*/
_sendSms();
// _sendSms();
// NavigatorUtil.goSmsPage(context, widget.rid);
},
... ...
... ... @@ -414,43 +414,51 @@ class CouponProvider with ChangeNotifier {
if (error is MyError) {}
});
if (baseResp.code == Constant.status_success) {
if (baseResp.data == null) {
return false;
} else {
if (baseResp.data['errcode'].toString() == '0') {
if (WxSendSmsModel.fromJson(baseResp.responseData)
.data
.sendStatusList
.length >
0) {
String code = WxSendSmsModel.fromJson(baseResp.responseData)
.data
.sendStatusList[0]
.code;
if (code == 'Ok') {
sendSMS = true;
return true;
} else if (code ==
'LimitExceeded.PhoneNumberSameContentDailyLimit') {
return false;
} else {
return false;
}
} else {
return false;
}
} else {
Utils.showToast(baseResp.data['errmsg']);
return false;
}
}
Utils.showToast("短信发送成功");
sendSMS = true;
return true;
} else {
if (baseResp != null) {
Utils.showToast(baseResp.msg ?? "");
}
Utils.showToast(baseResp.msg ?? "");
return false;
}
// if (baseResp.code == Constant.status_success) {
// if (baseResp.data == null) {
// return false;
// } else {
// if (baseResp.data['errcode'].toString() == '0') {
// if (WxSendSmsModel.fromJson(baseResp.responseData)
// .data
// .sendStatusList
// .length >
// 0) {
// String code = WxSendSmsModel.fromJson(baseResp.responseData)
// .data
// .sendStatusList[0]
// .code;
// if (code == 'Ok') {
// sendSMS = true;
// return true;
// } else if (code ==
// 'LimitExceeded.PhoneNumberSameContentDailyLimit') {
// return false;
// } else {
// return false;
// }
// } else {
// return false;
// }
// } else {
// Utils.showToast(baseResp.data['errmsg']);
// return false;
// }
// }
// } else {
// if (baseResp != null) {
// Utils.showToast(baseResp.msg ?? "");
// }
// return false;
// }
}
//发送短信
... ...