|
@@ -41,6 +41,8 @@ class CouponProvider with ChangeNotifier { |
|
@@ -41,6 +41,8 @@ class CouponProvider with ChangeNotifier { |
|
41
|
List<IsExamineSunModel> isExamineList = []; //商家券核销列表
|
41
|
List<IsExamineSunModel> isExamineList = []; //商家券核销列表
|
|
42
|
IsExamineSunModel isExamineDetail;
|
42
|
IsExamineSunModel isExamineDetail;
|
|
43
|
String errorSMS = '';
|
43
|
String errorSMS = '';
|
|
|
|
44
|
+
|
|
|
|
45
|
+ String couponId = '';
|
|
44
|
CouponProvider() {
|
46
|
CouponProvider() {
|
|
45
|
// for (int i = 0; i < 20; i++) {
|
47
|
// for (int i = 0; i < 20; i++) {
|
|
46
|
// swichStateData.add(true);
|
48
|
// swichStateData.add(true);
|
|
@@ -149,6 +151,7 @@ class CouponProvider with ChangeNotifier { |
|
@@ -149,6 +151,7 @@ class CouponProvider with ChangeNotifier { |
|
149
|
// pageState = PageState.ConnectivityError;
|
151
|
// pageState = PageState.ConnectivityError;
|
|
150
|
return false;
|
152
|
return false;
|
|
151
|
} else {
|
153
|
} else {
|
|
|
|
154
|
+ couponId = baseResp.data['id'];
|
|
152
|
// pageState = PageState.Success;
|
155
|
// pageState = PageState.Success;
|
|
153
|
return true;
|
156
|
return true;
|
|
154
|
}
|
157
|
}
|
|
@@ -164,6 +167,56 @@ class CouponProvider with ChangeNotifier { |
|
@@ -164,6 +167,56 @@ class CouponProvider with ChangeNotifier { |
|
164
|
}
|
167
|
}
|
|
165
|
}
|
168
|
}
|
|
166
|
|
169
|
|
|
|
|
170
|
+ ///CreateActivityUrlLink
|
|
|
|
171
|
+ Future<dynamic> createActivityUrlLink(
|
|
|
|
172
|
+ BuildContext context, Map<String, String> params,
|
|
|
|
173
|
+ {isShowLoading = true}) async {
|
|
|
|
174
|
+ BaseResp<dynamic> baseResp = await DioUtil()
|
|
|
|
175
|
+ .request<dynamic>(context, Method.get, HttpUrl.create_activity_url_link,
|
|
|
|
176
|
+ data: params, showLoading: isShowLoading)
|
|
|
|
177
|
+ .catchError((error) {
|
|
|
|
178
|
+ print(error.toString());
|
|
|
|
179
|
+ if (error is MyError) {
|
|
|
|
180
|
+ // switch (error.type) {
|
|
|
|
181
|
+ // case 1:
|
|
|
|
182
|
+ // pageState = PageState.ConnectivityError;
|
|
|
|
183
|
+ // break;
|
|
|
|
184
|
+ // case 2:
|
|
|
|
185
|
+ // pageState = PageState.ConnectivityTimeOut;
|
|
|
|
186
|
+ // break;
|
|
|
|
187
|
+ // default:
|
|
|
|
188
|
+ // pageState = PageState.ConnectivityError;
|
|
|
|
189
|
+ // break;
|
|
|
|
190
|
+ // }
|
|
|
|
191
|
+ }
|
|
|
|
192
|
+ // notifyListeners();
|
|
|
|
193
|
+ return false;
|
|
|
|
194
|
+ });
|
|
|
|
195
|
+ if (baseResp.code == Constant.status_success) {
|
|
|
|
196
|
+ if (baseResp.data.isEmpty) {
|
|
|
|
197
|
+ // pageState = PageState.ConnectivityError;
|
|
|
|
198
|
+ return false;
|
|
|
|
199
|
+ } else {
|
|
|
|
200
|
+ if( '${baseResp.data['errcode']}' == '0'){
|
|
|
|
201
|
+ return true;
|
|
|
|
202
|
+ }
|
|
|
|
203
|
+ // pageState = PageState.Success;
|
|
|
|
204
|
+ return false;
|
|
|
|
205
|
+ }
|
|
|
|
206
|
+
|
|
|
|
207
|
+ // notifyListeners();
|
|
|
|
208
|
+ // return NotebookDetail.fromJson(baseResp.data);
|
|
|
|
209
|
+ } else {
|
|
|
|
210
|
+ // pageState = PageState.ConnectivityError;
|
|
|
|
211
|
+ if (baseResp != null) {
|
|
|
|
212
|
+ Utils.showToast(baseResp.msg ?? "");
|
|
|
|
213
|
+ }
|
|
|
|
214
|
+ return false;
|
|
|
|
215
|
+ }
|
|
|
|
216
|
+ }
|
|
|
|
217
|
+
|
|
|
|
218
|
+ //
|
|
|
|
219
|
+
|
|
167
|
///客户经理获取所创建活动列表
|
220
|
///客户经理获取所创建活动列表
|
|
168
|
Future<List<CouponSunModel>> getCustomerActivity(
|
221
|
Future<List<CouponSunModel>> getCustomerActivity(
|
|
169
|
BuildContext context, Map<String, String> params, int index,
|
222
|
BuildContext context, Map<String, String> params, int index,
|