|
@@ -61,8 +61,7 @@ class _ReapSampleBasicDetailPageState extends BaseLifecycleState<ReapSampleBasic
|
61
|
61
|
List<CardMenuData> personList = [];
|
62
|
62
|
|
63
|
63
|
/// 获取行政区划列表
|
64
|
|
- Future<List<CardMenuData>?> getDistrictList(num level, {num? id, bool showLoading = true}) async {
|
65
|
|
- if (showLoading) MyNavigator.showLoading();
|
|
64
|
+ Future<List<CardMenuData>?> getDistrictList(num level, {num? id}) async {
|
66
|
65
|
try {
|
67
|
66
|
var rsp = await MyApi.get().districtList(level, id: id);
|
68
|
67
|
List<CardMenuData> list = (rsp.data ?? []).map((e) => CardMenuData(e.uname, e.id)).toList();
|
|
@@ -71,12 +70,10 @@ class _ReapSampleBasicDetailPageState extends BaseLifecycleState<ReapSampleBasic
|
71
|
70
|
} else if (level == 5) {
|
72
|
71
|
cunList.value = list;
|
73
|
72
|
}
|
74
|
|
- if (showLoading) MyNavigator.dismissLoading();
|
75
|
73
|
return list;
|
76
|
74
|
} catch (e) {
|
77
|
75
|
logger.e(e);
|
78
|
76
|
}
|
79
|
|
- if (showLoading) MyNavigator.dismissLoading();
|
80
|
77
|
return null;
|
81
|
78
|
}
|
82
|
79
|
|
|
@@ -200,7 +197,7 @@ class _ReapSampleBasicDetailPageState extends BaseLifecycleState<ReapSampleBasic
|
200
|
197
|
MyNavigator.showLoading();
|
201
|
198
|
bool stepSuccess = false;
|
202
|
199
|
// 省
|
203
|
|
- var provinceList = await getDistrictList(1, showLoading: false);
|
|
200
|
+ var provinceList = await getDistrictList(1);
|
204
|
201
|
if (provinceList != null) {
|
205
|
202
|
for (CardMenuData item in provinceList) {
|
206
|
203
|
if (item.name == province) {
|
|
@@ -212,7 +209,7 @@ class _ReapSampleBasicDetailPageState extends BaseLifecycleState<ReapSampleBasic
|
212
|
209
|
if (stepSuccess) {
|
213
|
210
|
stepSuccess = false;
|
214
|
211
|
// 市
|
215
|
|
- var cityList = await getDistrictList(2, id: sheng.value!.value, showLoading: false);
|
|
212
|
+ var cityList = await getDistrictList(2, id: sheng.value!.value);
|
216
|
213
|
if (cityList == null) return;
|
217
|
214
|
for (CardMenuData item in cityList) {
|
218
|
215
|
if (item.name == city) {
|
|
@@ -226,7 +223,7 @@ class _ReapSampleBasicDetailPageState extends BaseLifecycleState<ReapSampleBasic
|
226
|
223
|
stepSuccess = false;
|
227
|
224
|
// 区
|
228
|
225
|
if (district.isNotEmpty) {
|
229
|
|
- var districtList = await getDistrictList(3, id: shi.value!.value, showLoading: false);
|
|
226
|
+ var districtList = await getDistrictList(3, id: shi.value!.value);
|
230
|
227
|
if (districtList == null) return;
|
231
|
228
|
for (CardMenuData item in districtList) {
|
232
|
229
|
if (item.name == district) {
|
|
@@ -434,6 +431,10 @@ class _ReapSampleBasicDetailPageState extends BaseLifecycleState<ReapSampleBasic
|
434
|
431
|
data = widget.data;
|
435
|
432
|
isDetail = widget.detail;
|
436
|
433
|
widget.ctrl.verifyData = verifyData;
|
|
434
|
+ }
|
|
435
|
+
|
|
436
|
+ @override
|
|
437
|
+ void onFirstShow(Duration timeStamp) {
|
437
|
438
|
// 土壤信息
|
438
|
439
|
getTrxxList();
|
439
|
440
|
|