Commit d04993d6d63c59aac9a4a9f9100687ab342f3f8b

Authored by wdn127929
1 parent c5e456df

接口返回状态判断修改

... ... @@ -548,7 +548,7 @@
CODE_SIGN_ENTITLEMENTS = Runner/RunnerProfile.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 52493;
CURRENT_PROJECT_VERSION = 52495;
DEVELOPMENT_TEAM = 8J59HM8B82;
ENABLE_BITCODE = NO;
FLUTTER_BUILD_MODE = release;
... ... @@ -696,7 +696,7 @@
CODE_SIGN_ENTITLEMENTS = "Runner/一键订Debug.entitlements";
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 52493;
CURRENT_PROJECT_VERSION = 52495;
DEVELOPMENT_TEAM = 8J59HM8B82;
ENABLE_BITCODE = NO;
FLUTTER_BUILD_MODE = debug;
... ... @@ -732,7 +732,7 @@
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 52493;
CURRENT_PROJECT_VERSION = 52495;
DEVELOPMENT_TEAM = 8J59HM8B82;
ENABLE_BITCODE = NO;
FLUTTER_BUILD_MODE = release;
... ...
import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:one_key/constant/constant.dart';
import 'package:one_key/constant/error.dart';
... ... @@ -126,7 +128,8 @@ class CouponProvider with ChangeNotifier {
BuildContext context, Map<String, String> params,
{isShowLoading = true}) async {
BaseResp<dynamic> baseResp = await DioUtil()
.request<dynamic>(context, Method.post, HttpUrl.create_customer_activity,
.request<dynamic>(
context, Method.post, HttpUrl.create_customer_activity,
data: params, showLoading: isShowLoading)
.catchError((error) {
print(error.toString());
... ... @@ -151,7 +154,7 @@ class CouponProvider with ChangeNotifier {
// pageState = PageState.ConnectivityError;
return false;
} else {
couponId = baseResp.data['id'];
couponId = baseResp.data['id'];
// pageState = PageState.Success;
return true;
}
... ... @@ -167,8 +170,6 @@ class CouponProvider with ChangeNotifier {
}
}
//
///客户经理获取所创建活动列表
... ... @@ -749,7 +750,8 @@ class CouponProvider with ChangeNotifier {
BuildContext context, Map<String, String> params,
{isShowLoading = true}) async {
BaseResp<dynamic> baseResp = await DioUtil()
.request<dynamic>(context, Method.post, HttpUrl.get_order_recharge_by_id,
.request<dynamic>(
context, Method.post, HttpUrl.get_order_recharge_by_id,
data: params, showLoading: isShowLoading)
.catchError((error) {
print(error.toString());
... ... @@ -785,9 +787,25 @@ class CouponProvider with ChangeNotifier {
if (error is MyError) {}
});
if (baseResp.code == Constant.status_success) {
Utils.showToast("短信发送成功");
sendSMS++;
return true;
if (baseResp.data is String) {
if (jsonDecode(baseResp.data)['status'] == 'success') {
Utils.showToast("短信发送成功");
sendSMS++;
return true;
} else if (jsonDecode(baseResp.data)['status'] == '2') {
Utils.showToast("订单已到店,不可发送短信!");
return false;
} else if (jsonDecode(baseResp.data)['status'] == '4') {
Utils.showToast("订单已取消,不可发送短信!");
return false;
} else {
Utils.showToast("发送失败,请稍后重试!");
return false;
}
}
} else {
if (baseResp.code == 396) {
//余量不足
... ...