10 changed files with 176 additions and 5 deletions
@ -0,0 +1,45 @@ |
|||
using BBWY.Client.APIServices; |
|||
using BBWY.Client.Models; |
|||
using BBWY.Common.Models; |
|||
using System.Collections.Generic; |
|||
using System.Collections.ObjectModel; |
|||
using System.Threading.Tasks; |
|||
using System.Windows; |
|||
|
|||
namespace BBWY.Client.ViewModels |
|||
{ |
|||
public class ChoosePurchaseSchemeViewModel : BaseVM, IDenpendency |
|||
{ |
|||
private PurchaseService purchaseService; |
|||
private GlobalContext globalContext; |
|||
|
|||
public string SkuId { get; set; } |
|||
public IList<PurchaseScheme> PurchaseSchemeList { get; set; } |
|||
|
|||
public ChoosePurchaseSchemeViewModel(PurchaseService purchaseService, GlobalContext globalContext) |
|||
{ |
|||
this.purchaseService = purchaseService; |
|||
this.globalContext = globalContext; |
|||
PurchaseSchemeList = new ObservableCollection<PurchaseScheme>(); |
|||
} |
|||
|
|||
protected override void Load() |
|||
{ |
|||
PurchaseSchemeList.Clear(); |
|||
Task.Factory.StartNew(() => purchaseService.GetPurchaseSchemeList(SkuId, globalContext.User.Shop.ShopId)).ContinueWith(t => |
|||
{ |
|||
var r = t.Result; |
|||
if (!r.Success) |
|||
{ |
|||
App.Current.Dispatcher.Invoke(() => MessageBox.Show(r.Msg, "获取采购方案")); |
|||
return; |
|||
} |
|||
|
|||
App.Current.Dispatcher.Invoke(() => |
|||
{ |
|||
foreach (var apiModel in r.Data) PurchaseSchemeList.Add(PurchaseScheme.Convert(apiModel)); |
|||
}); |
|||
}); |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,28 @@ |
|||
<c:BWindow x:Class="BBWY.Client.Views.Order.ChoosePurchaseScheme" |
|||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
|||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
|||
xmlns:local="clr-namespace:BBWY.Client.Views.Order" |
|||
xmlns:c="clr-namespace:BBWY.Controls;assembly=BBWY.Controls" |
|||
mc:Ignorable="d" |
|||
Title="ChoosePurchaseScheme" Height="200" Width="800" |
|||
Style="{StaticResource bwstyle}" |
|||
MinButtonVisibility="Collapsed" |
|||
MaxButtonVisibility="Collapsed" |
|||
DataContext="{Binding ChoosePurchaseScheme,Source={StaticResource Locator}}"> |
|||
<Grid> |
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="30"/> |
|||
<RowDefinition/> |
|||
<RowDefinition Height="40"/> |
|||
</Grid.RowDefinitions> |
|||
<Border BorderThickness="0,0,0,1" BorderBrush="{StaticResource MainMenu.BorderBrush}" |
|||
Background="{StaticResource Border.Background}"> |
|||
<TextBlock Text="选择采购商" Style="{StaticResource middleTextBlock}"/> |
|||
</Border> |
|||
<DataGrid Grid.Row="1"> |
|||
|
|||
</DataGrid> |
|||
</Grid> |
|||
</c:BWindow> |
@ -0,0 +1,15 @@ |
|||
using BBWY.Controls; |
|||
|
|||
namespace BBWY.Client.Views.Order |
|||
{ |
|||
/// <summary>
|
|||
/// ChoosePurchaseScheme.xaml 的交互逻辑
|
|||
/// </summary>
|
|||
public partial class ChoosePurchaseScheme : BWindow |
|||
{ |
|||
public ChoosePurchaseScheme() |
|||
{ |
|||
InitializeComponent(); |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,11 @@ |
|||
namespace BBWY.Server.Model.Dto |
|||
{ |
|||
public class JDShopToken |
|||
{ |
|||
public string Access_Token { get; set; } |
|||
|
|||
public int Code { get; set; } |
|||
|
|||
public bool IsSuccess { get; set; } |
|||
} |
|||
} |
Loading…
Reference in new issue