Browse Source

C端添加采购列表(web)

AddValidOverTime
shanji 2 years ago
parent
commit
dcda96e04c
  1. 2
      BBWY.Client/GlobalContext.cs
  2. 4
      BBWY.Client/ViewModels/MainViewModel.cs
  3. 13
      BBWY.Client/Views/Web/Web.xaml
  4. 54
      BBWY.Client/Views/Web/Web.xaml.cs

2
BBWY.Client/GlobalContext.cs

@ -9,7 +9,7 @@ namespace BBWY.Client
{
ShopServiceGroupList = new List<string>();
ShopServiceGroupLowerList = new List<string>();
ClientVersion = "10126";
ClientVersion = "10127";
}
private User user;

4
BBWY.Client/ViewModels/MainViewModel.cs

@ -175,8 +175,8 @@ namespace BBWY.Client.ViewModels
Name = "采购管理",
ChildList = new List<MenuModel>()
{
new MenuModel(){ Name="采购列表",Url="/Views/BatchPurchase/BatchPurchaseOrderList.xaml" }
//new MenuModel(){ Name="采购账单",Url="/Views/ServiceOrder/ServiceOrderList.xaml" }
new MenuModel(){ Name="采购列表",Url="/Views/BatchPurchase/BatchPurchaseOrderList.xaml" },
new MenuModel(){ Name="采购列表(Web)",Url="/Views/Web/Web.xaml" }
}
});

13
BBWY.Client/Views/Web/Web.xaml

@ -0,0 +1,13 @@
<Page x:Class="BBWY.Client.Views.Web.Web"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:BBWY.Client.Views.Web"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800"
Title="Web">
<Grid x:Name="grid">
</Grid>
</Page>

54
BBWY.Client/Views/Web/Web.xaml.cs

@ -0,0 +1,54 @@
using Microsoft.Extensions.DependencyInjection;
using System.Windows.Controls;
namespace BBWY.Client.Views.Web
{
/// <summary>
/// Web.xaml 的交互逻辑
/// </summary>
public partial class Web : Page
{
private WebView2Manager w2m;
private GlobalContext globalContext;
private bool isNavigated = false;
#if DEBUG
private string url = "http://192.168.1.4:8881/";
#else
private string url= "http://bbwyweb.qiyue666.com";
#endif
public Web()
{
InitializeComponent();
this.Loaded += Web_Loaded;
}
private void Web_Loaded(object sender, System.Windows.RoutedEventArgs e)
{
var sp = (App.Current as App).ServiceProvider;
using (var s = sp.CreateScope())
{
globalContext = s.ServiceProvider.GetRequiredService<GlobalContext>();
}
using (var s = sp.CreateScope())
{
w2m = s.ServiceProvider.GetRequiredService<WebView2Manager>();
}
w2m.Init(globalContext.User.Shop.ShopId.ToString());
grid.Children.Add(w2m.wb2);
w2m.CoreWebView2InitializationCompleted = (e) =>
{
isNavigated = true;
// w2m.wb2.CoreWebView2.Navigate($"https://neworder.shop.jd.com/order/orderDetail?orderId={orderId}");
w2m.wb2.CoreWebView2.Navigate(url);
};
if(w2m.IsInitializationCompleted && !isNavigated)
{
w2m.wb2.CoreWebView2.Navigate(url);
isNavigated = true;
}
}
}
}
Loading…
Cancel
Save