chore
This commit is contained in:
@@ -111,7 +111,7 @@
|
||||
|
||||
async Task LoadStateProvinceAndCities()
|
||||
{
|
||||
var url = $"/api/stateprovince/tree/{CountryId}";
|
||||
var url = $"/api/area/tree/{CountryId}";
|
||||
var apiResult = await HttpService.Get<ApiResult<List<KeyValueTree>>>(url);
|
||||
if (apiResult.Success)
|
||||
{
|
||||
@@ -164,14 +164,14 @@
|
||||
{
|
||||
area = apiResult.Data;
|
||||
model = apiResult.Data.Adapt<AreaModel>();
|
||||
if (model.ParentId > 0)
|
||||
{
|
||||
cities = $"{model.StateProvinceId},{model.ParentId}";
|
||||
}
|
||||
else if (model.StateProvinceId > 0)
|
||||
{
|
||||
cities = $"{model.StateProvinceId}";
|
||||
}
|
||||
// if (model.ParentId > 0)
|
||||
// {
|
||||
// cities = $"{model.StateProvinceId},{model.ParentId}";
|
||||
// }
|
||||
// else if (model.StateProvinceId > 0)
|
||||
// {
|
||||
// cities = $"{model.StateProvinceId}";
|
||||
// }
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -186,13 +186,7 @@
|
||||
void OnCitiesChange(CascaderNode[] selectedNodes)
|
||||
{
|
||||
Console.WriteLine($"value: {cities} selected: {string.Join(",", selectedNodes.Select(x => x.Value))}");
|
||||
|
||||
model.StateProvinceId = long.Parse(selectedNodes.First().Value.ToString() ?? "0");
|
||||
model.ParentId = long.Parse(selectedNodes.Last().Value.ToString() ?? "0");
|
||||
if (model.StateProvinceId == model.ParentId)
|
||||
{
|
||||
model.ParentId = 0;
|
||||
}
|
||||
}
|
||||
|
||||
async void OnFormFinishAsync()
|
||||
|
||||
Reference in New Issue
Block a user