/// <summary> /// 获取单据 /// </summary> /// <param name="billId"></param> /// <returns></returns> public async Task <AllocationBillModel> GetBillAsync(int billId, bool force = false, CancellationToken calToken = default) { var model = new AllocationBillModel(); try { int storeId = Settings.StoreId; int userId = Settings.UserId; var api = RefitServiceBuilder.Build <IAllocationApi>(URL); var cacheKey = RefitServiceBuilder.Cacher("AllocationService.GetBillAsync", storeId, userId, billId); var results = await _makeRequest.StartUseCache(api.GetBillAsync(storeId, userId, billId, calToken), cacheKey, force, calToken); if (results != null && results?.Code >= 0) { model = results?.Data; } return(model); } catch (Exception e) { e.HandleException(); return(null); } }
public override void OnNavigatedTo(INavigationParameters parameters) { base.OnNavigatedTo(parameters); parameters.TryGetValue("Bill", out AllocationBillModel bill); if (bill != null) { Bill = bill; } }