|
...
|
...
|
@@ -41,6 +41,8 @@ class CouponProvider with ChangeNotifier { |
|
|
|
List<IsExamineSunModel> isExamineList = []; //商家券核销列表
|
|
|
|
IsExamineSunModel isExamineDetail;
|
|
|
|
String errorSMS = '';
|
|
|
|
|
|
|
|
String couponId = '';
|
|
|
|
CouponProvider() {
|
|
|
|
// for (int i = 0; i < 20; i++) {
|
|
|
|
// swichStateData.add(true);
|
|
...
|
...
|
@@ -149,6 +151,7 @@ class CouponProvider with ChangeNotifier { |
|
|
|
// pageState = PageState.ConnectivityError;
|
|
|
|
return false;
|
|
|
|
} else {
|
|
|
|
couponId = baseResp.data['id'];
|
|
|
|
// pageState = PageState.Success;
|
|
|
|
return true;
|
|
|
|
}
|
|
...
|
...
|
@@ -164,6 +167,56 @@ class CouponProvider with ChangeNotifier { |
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
///CreateActivityUrlLink
|
|
|
|
Future<dynamic> createActivityUrlLink(
|
|
|
|
BuildContext context, Map<String, String> params,
|
|
|
|
{isShowLoading = true}) async {
|
|
|
|
BaseResp<dynamic> baseResp = await DioUtil()
|
|
|
|
.request<dynamic>(context, Method.get, HttpUrl.create_activity_url_link,
|
|
|
|
data: params, showLoading: isShowLoading)
|
|
|
|
.catchError((error) {
|
|
|
|
print(error.toString());
|
|
|
|
if (error is MyError) {
|
|
|
|
// switch (error.type) {
|
|
|
|
// case 1:
|
|
|
|
// pageState = PageState.ConnectivityError;
|
|
|
|
// break;
|
|
|
|
// case 2:
|
|
|
|
// pageState = PageState.ConnectivityTimeOut;
|
|
|
|
// break;
|
|
|
|
// default:
|
|
|
|
// pageState = PageState.ConnectivityError;
|
|
|
|
// break;
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
// notifyListeners();
|
|
|
|
return false;
|
|
|
|
});
|
|
|
|
if (baseResp.code == Constant.status_success) {
|
|
|
|
if (baseResp.data.isEmpty) {
|
|
|
|
// pageState = PageState.ConnectivityError;
|
|
|
|
return false;
|
|
|
|
} else {
|
|
|
|
if( '${baseResp.data['errcode']}' == '0'){
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
// pageState = PageState.Success;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
// notifyListeners();
|
|
|
|
// return NotebookDetail.fromJson(baseResp.data);
|
|
|
|
} else {
|
|
|
|
// pageState = PageState.ConnectivityError;
|
|
|
|
if (baseResp != null) {
|
|
|
|
Utils.showToast(baseResp.msg ?? "");
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
///客户经理获取所创建活动列表
|
|
|
|
Future<List<CouponSunModel>> getCustomerActivity(
|
|
|
|
BuildContext context, Map<String, String> params, int index,
|
...
|
...
|
|