Compare commits
19
Commits
main
..
e12c419ef3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e12c419ef3 | ||
|
|
11599bc7d3 | ||
|
|
e4e8c34f8d | ||
|
|
39648cd9a9 | ||
|
|
f7082d8a7a | ||
|
|
b7abfb79c6 | ||
|
|
57c8b69252 | ||
|
|
4f1fa75ec8 | ||
|
|
a18191b1a6 | ||
|
|
4e449f31bd | ||
|
|
d77ec5cc2e | ||
|
|
66f1381950 | ||
|
|
dad8846752 | ||
|
|
be54dff06b | ||
|
|
f772c35ede | ||
|
|
993a91a545 | ||
|
|
446224f4cf | ||
|
|
ce828fe467 | ||
|
|
726eb6de16 |
No files matched your search
@@ -1,63 +0,0 @@
|
||||
###############################################################################
|
||||
# Set default behavior to automatically normalize line endings.
|
||||
###############################################################################
|
||||
* text=auto
|
||||
|
||||
###############################################################################
|
||||
# Set default behavior for command prompt diff.
|
||||
#
|
||||
# This is need for earlier builds of msysgit that does not have it on by
|
||||
# default for csharp files.
|
||||
# Note: This is only used by command line
|
||||
###############################################################################
|
||||
#*.cs diff=csharp
|
||||
|
||||
###############################################################################
|
||||
# Set the merge driver for project and solution files
|
||||
#
|
||||
# Merging from the command prompt will add diff markers to the files if there
|
||||
# are conflicts (Merging from VS is not affected by the settings below, in VS
|
||||
# the diff markers are never inserted). Diff markers may cause the following
|
||||
# file extensions to fail to load in VS. An alternative would be to treat
|
||||
# these files as binary and thus will always conflict and require user
|
||||
# intervention with every merge. To do so, just uncomment the entries below
|
||||
###############################################################################
|
||||
#*.sln merge=binary
|
||||
#*.csproj merge=binary
|
||||
#*.vbproj merge=binary
|
||||
#*.vcxproj merge=binary
|
||||
#*.vcproj merge=binary
|
||||
#*.dbproj merge=binary
|
||||
#*.fsproj merge=binary
|
||||
#*.lsproj merge=binary
|
||||
#*.wixproj merge=binary
|
||||
#*.modelproj merge=binary
|
||||
#*.sqlproj merge=binary
|
||||
#*.wwaproj merge=binary
|
||||
|
||||
###############################################################################
|
||||
# behavior for image files
|
||||
#
|
||||
# image files are treated as binary by default.
|
||||
###############################################################################
|
||||
#*.jpg binary
|
||||
#*.png binary
|
||||
#*.gif binary
|
||||
|
||||
###############################################################################
|
||||
# diff behavior for common document formats
|
||||
#
|
||||
# Convert binary document formats to text before diffing them. This feature
|
||||
# is only available from the command line. Turn it on by uncommenting the
|
||||
# entries below.
|
||||
###############################################################################
|
||||
#*.doc diff=astextplain
|
||||
#*.DOC diff=astextplain
|
||||
#*.docx diff=astextplain
|
||||
#*.DOCX diff=astextplain
|
||||
#*.dot diff=astextplain
|
||||
#*.DOT diff=astextplain
|
||||
#*.pdf diff=astextplain
|
||||
#*.PDF diff=astextplain
|
||||
#*.rtf diff=astextplain
|
||||
#*.RTF diff=astextplain
|
||||
+93
-19
@@ -17,6 +17,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_SolutionItems", "_Solution
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
.editorconfig = .editorconfig
|
||||
.gitignore = .gitignore
|
||||
Directory.Build.props = Directory.Build.props
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WxOrder.Framework", "WxOrder.Framework\WxOrder.Framework.csproj", "{3123963C-A0EC-4AD5-9916-DC063F73490B}"
|
||||
@@ -25,7 +26,15 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".test", ".test", "{14261B9B
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WXOrder.Test", "test\WXOrder.Test\WXOrder.Test.csproj", "{3790EC79-EA1D-4660-AB0D-EA0DE4FF77B7}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OrderSupportTicket", "OrderSupportTicket\OrderSupportTicket.csproj", "{22D31944-2087-437A-B374-C0874E9EC53A}"
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Trade.Client", "Source\Trade.Client\Trade.Client.csproj", "{BCABF48D-183D-A66F-33B6-B865CC0AD623}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MAX.Core", "Source\MAX.Core\MAX.Core.csproj", "{313C8137-00DA-4116-B3B4-68FC45CC0CE7}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Trade.Framework", "Source\Trade.Framework\Trade.Framework.csproj", "{0180FDFA-6984-462D-B406-65B460CDB47A}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Main.Test", "Main.Test\Main.Test.csproj", "{890E871A-F6E7-42DA-85D5-3BF2F8ECAEDF}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MAX.Framework", "Source\MAX.Framework\MAX.Framework.csproj", "{EABFACFE-C74D-4111-9683-C6E7714F432D}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
@@ -75,8 +84,8 @@ Global
|
||||
{5A410EB5-06AD-97BB-2314-9D7A808E12F7}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{5A410EB5-06AD-97BB-2314-9D7A808E12F7}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{5A410EB5-06AD-97BB-2314-9D7A808E12F7}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{5A410EB5-06AD-97BB-2314-9D7A808E12F7}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{5A410EB5-06AD-97BB-2314-9D7A808E12F7}.Debug|x64.Build.0 = Debug|x64
|
||||
{5A410EB5-06AD-97BB-2314-9D7A808E12F7}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{5A410EB5-06AD-97BB-2314-9D7A808E12F7}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{5A410EB5-06AD-97BB-2314-9D7A808E12F7}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{5A410EB5-06AD-97BB-2314-9D7A808E12F7}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{5A410EB5-06AD-97BB-2314-9D7A808E12F7}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
@@ -119,22 +128,86 @@ Global
|
||||
{3790EC79-EA1D-4660-AB0D-EA0DE4FF77B7}.Release|x64.Build.0 = Release|Any CPU
|
||||
{3790EC79-EA1D-4660-AB0D-EA0DE4FF77B7}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{3790EC79-EA1D-4660-AB0D-EA0DE4FF77B7}.Release|x86.Build.0 = Release|Any CPU
|
||||
{22D31944-2087-437A-B374-C0874E9EC53A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{22D31944-2087-437A-B374-C0874E9EC53A}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{22D31944-2087-437A-B374-C0874E9EC53A}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{22D31944-2087-437A-B374-C0874E9EC53A}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{22D31944-2087-437A-B374-C0874E9EC53A}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{22D31944-2087-437A-B374-C0874E9EC53A}.Debug|x64.Build.0 = Debug|x64
|
||||
{22D31944-2087-437A-B374-C0874E9EC53A}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{22D31944-2087-437A-B374-C0874E9EC53A}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{22D31944-2087-437A-B374-C0874E9EC53A}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{22D31944-2087-437A-B374-C0874E9EC53A}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{22D31944-2087-437A-B374-C0874E9EC53A}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{22D31944-2087-437A-B374-C0874E9EC53A}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{22D31944-2087-437A-B374-C0874E9EC53A}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{22D31944-2087-437A-B374-C0874E9EC53A}.Release|x64.Build.0 = Release|Any CPU
|
||||
{22D31944-2087-437A-B374-C0874E9EC53A}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{22D31944-2087-437A-B374-C0874E9EC53A}.Release|x86.Build.0 = Release|Any CPU
|
||||
{BCABF48D-183D-A66F-33B6-B865CC0AD623}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{BCABF48D-183D-A66F-33B6-B865CC0AD623}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{BCABF48D-183D-A66F-33B6-B865CC0AD623}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{BCABF48D-183D-A66F-33B6-B865CC0AD623}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{BCABF48D-183D-A66F-33B6-B865CC0AD623}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{BCABF48D-183D-A66F-33B6-B865CC0AD623}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{BCABF48D-183D-A66F-33B6-B865CC0AD623}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{BCABF48D-183D-A66F-33B6-B865CC0AD623}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{BCABF48D-183D-A66F-33B6-B865CC0AD623}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{BCABF48D-183D-A66F-33B6-B865CC0AD623}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{BCABF48D-183D-A66F-33B6-B865CC0AD623}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{BCABF48D-183D-A66F-33B6-B865CC0AD623}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{BCABF48D-183D-A66F-33B6-B865CC0AD623}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{BCABF48D-183D-A66F-33B6-B865CC0AD623}.Release|x64.Build.0 = Release|Any CPU
|
||||
{BCABF48D-183D-A66F-33B6-B865CC0AD623}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{BCABF48D-183D-A66F-33B6-B865CC0AD623}.Release|x86.Build.0 = Release|Any CPU
|
||||
{313C8137-00DA-4116-B3B4-68FC45CC0CE7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{313C8137-00DA-4116-B3B4-68FC45CC0CE7}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{313C8137-00DA-4116-B3B4-68FC45CC0CE7}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{313C8137-00DA-4116-B3B4-68FC45CC0CE7}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{313C8137-00DA-4116-B3B4-68FC45CC0CE7}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{313C8137-00DA-4116-B3B4-68FC45CC0CE7}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{313C8137-00DA-4116-B3B4-68FC45CC0CE7}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{313C8137-00DA-4116-B3B4-68FC45CC0CE7}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{313C8137-00DA-4116-B3B4-68FC45CC0CE7}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{313C8137-00DA-4116-B3B4-68FC45CC0CE7}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{313C8137-00DA-4116-B3B4-68FC45CC0CE7}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{313C8137-00DA-4116-B3B4-68FC45CC0CE7}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{313C8137-00DA-4116-B3B4-68FC45CC0CE7}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{313C8137-00DA-4116-B3B4-68FC45CC0CE7}.Release|x64.Build.0 = Release|Any CPU
|
||||
{313C8137-00DA-4116-B3B4-68FC45CC0CE7}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{313C8137-00DA-4116-B3B4-68FC45CC0CE7}.Release|x86.Build.0 = Release|Any CPU
|
||||
{0180FDFA-6984-462D-B406-65B460CDB47A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{0180FDFA-6984-462D-B406-65B460CDB47A}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{0180FDFA-6984-462D-B406-65B460CDB47A}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{0180FDFA-6984-462D-B406-65B460CDB47A}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{0180FDFA-6984-462D-B406-65B460CDB47A}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{0180FDFA-6984-462D-B406-65B460CDB47A}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{0180FDFA-6984-462D-B406-65B460CDB47A}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{0180FDFA-6984-462D-B406-65B460CDB47A}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{0180FDFA-6984-462D-B406-65B460CDB47A}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{0180FDFA-6984-462D-B406-65B460CDB47A}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{0180FDFA-6984-462D-B406-65B460CDB47A}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{0180FDFA-6984-462D-B406-65B460CDB47A}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{0180FDFA-6984-462D-B406-65B460CDB47A}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{0180FDFA-6984-462D-B406-65B460CDB47A}.Release|x64.Build.0 = Release|Any CPU
|
||||
{0180FDFA-6984-462D-B406-65B460CDB47A}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{0180FDFA-6984-462D-B406-65B460CDB47A}.Release|x86.Build.0 = Release|Any CPU
|
||||
{890E871A-F6E7-42DA-85D5-3BF2F8ECAEDF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{890E871A-F6E7-42DA-85D5-3BF2F8ECAEDF}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{890E871A-F6E7-42DA-85D5-3BF2F8ECAEDF}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{890E871A-F6E7-42DA-85D5-3BF2F8ECAEDF}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{890E871A-F6E7-42DA-85D5-3BF2F8ECAEDF}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{890E871A-F6E7-42DA-85D5-3BF2F8ECAEDF}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{890E871A-F6E7-42DA-85D5-3BF2F8ECAEDF}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{890E871A-F6E7-42DA-85D5-3BF2F8ECAEDF}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{890E871A-F6E7-42DA-85D5-3BF2F8ECAEDF}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{890E871A-F6E7-42DA-85D5-3BF2F8ECAEDF}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{890E871A-F6E7-42DA-85D5-3BF2F8ECAEDF}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{890E871A-F6E7-42DA-85D5-3BF2F8ECAEDF}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{890E871A-F6E7-42DA-85D5-3BF2F8ECAEDF}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{890E871A-F6E7-42DA-85D5-3BF2F8ECAEDF}.Release|x64.Build.0 = Release|Any CPU
|
||||
{890E871A-F6E7-42DA-85D5-3BF2F8ECAEDF}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{890E871A-F6E7-42DA-85D5-3BF2F8ECAEDF}.Release|x86.Build.0 = Release|Any CPU
|
||||
{EABFACFE-C74D-4111-9683-C6E7714F432D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{EABFACFE-C74D-4111-9683-C6E7714F432D}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{EABFACFE-C74D-4111-9683-C6E7714F432D}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{EABFACFE-C74D-4111-9683-C6E7714F432D}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{EABFACFE-C74D-4111-9683-C6E7714F432D}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{EABFACFE-C74D-4111-9683-C6E7714F432D}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{EABFACFE-C74D-4111-9683-C6E7714F432D}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{EABFACFE-C74D-4111-9683-C6E7714F432D}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{EABFACFE-C74D-4111-9683-C6E7714F432D}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{EABFACFE-C74D-4111-9683-C6E7714F432D}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{EABFACFE-C74D-4111-9683-C6E7714F432D}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{EABFACFE-C74D-4111-9683-C6E7714F432D}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{EABFACFE-C74D-4111-9683-C6E7714F432D}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{EABFACFE-C74D-4111-9683-C6E7714F432D}.Release|x64.Build.0 = Release|Any CPU
|
||||
{EABFACFE-C74D-4111-9683-C6E7714F432D}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{EABFACFE-C74D-4111-9683-C6E7714F432D}.Release|x86.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
@@ -144,6 +217,7 @@ Global
|
||||
{1AD45D66-6872-4522-ACF0-04E2C0514048} = {4A54DC2A-B47C-4ED1-A482-EE60161DB2C3}
|
||||
{5A410EB5-06AD-97BB-2314-9D7A808E12F7} = {1A7830FA-AC8F-40FB-A232-F0626812B8BE}
|
||||
{3790EC79-EA1D-4660-AB0D-EA0DE4FF77B7} = {14261B9B-E3EA-4BC0-B08D-4B3591AC13E5}
|
||||
{890E871A-F6E7-42DA-85D5-3BF2F8ECAEDF} = {14261B9B-E3EA-4BC0-B08D-4B3591AC13E5}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {38687A61-0347-49AC-98C7-E7F7148C0234}
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
<OutputPath>..\bin\</OutputPath>
|
||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
|
||||
<Platforms>AnyCPU;x64</Platforms>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
|
||||
@@ -38,7 +37,6 @@
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Management" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
@@ -59,7 +57,6 @@
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\AllBase\29WxOrderAllBase.csproj" />
|
||||
<ProjectReference Include="..\OrderSupportTicket\OrderSupportTicket.csproj" />
|
||||
<ProjectReference Include="..\Work\29WxOrderWork.csproj" />
|
||||
<ProjectReference Include="..\WxOrder.Framework\WxOrder.Framework.csproj" />
|
||||
</ItemGroup>
|
||||
@@ -67,26 +64,11 @@
|
||||
<!-- 资源文件:SDK 样式工程默认不会把图片/图标作为 Resource,这里按原工程显式声明 -->
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\**\*" />
|
||||
<None Remove="Ctrls\BuyerCtrls\Resources\pdd_afterorder.js" />
|
||||
<None Remove="Ctrls\PDDInvoice\Resources\invoice.js" />
|
||||
<None Remove="Ctrls\PDDInvoice\Resources\order.js" />
|
||||
<Resource Include="29wx.ico" />
|
||||
<Resource Include="29_common_icon.ico" />
|
||||
<Resource Include="Ctrls\BuyerCtrls\Resources\pdd_afterorder.js" />
|
||||
<Resource Include="Ctrls\PDDInvoice\Resources\invoice.js" />
|
||||
<Resource Include="Ctrls\PDDInvoice\Resources\order.js" />
|
||||
<Resource Include="gear.ico" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Update="Ctrls\BuyerCtrls\PddBuyOrderCtrl.xaml.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Update="Views\ChangePickNoView.xaml.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Common\" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -1,90 +0,0 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>net462</TargetFramework>
|
||||
<RootNamespace>_29WxOrderWpf</RootNamespace>
|
||||
<AssemblyName>29WxFindOrder</AssemblyName>
|
||||
<UseWPF>true</UseWPF>
|
||||
<ApplicationIcon>gear.ico</ApplicationIcon>
|
||||
<LangVersion>12</LangVersion>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<OutputPath>..\bin\</OutputPath>
|
||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
|
||||
<Platforms>AnyCPU;x64</Platforms>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>..\..\KJD Cef138\Bin\</OutputPath>
|
||||
<DefineConstants>TRACE;RELEASE</DefineConstants>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="CefSharp.Common" Version="138.0.340" />
|
||||
<PackageReference Include="CefSharp.Wpf" Version="138.0.340" />
|
||||
<PackageReference Include="chromiumembeddedframework.runtime.win-x64" Version="138.0.34" />
|
||||
<PackageReference Include="chromiumembeddedframework.runtime.win-x86" Version="138.0.34" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
|
||||
<PackageReference Include="WPFCommon" Version="1.2.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Management" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Xaml" />
|
||||
<Reference Include="WindowsBase" />
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="PresentationFramework" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Reference Include="NaiBa.Util">
|
||||
<HintPath>..\DllReference\NaiBa.Util.dll</HintPath>
|
||||
<Private>true</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\AllBase\29WxOrderAllBase.csproj" />
|
||||
<ProjectReference Include="..\OrderSupportTicket\OrderSupportTicket.csproj" />
|
||||
<ProjectReference Include="..\Work\29WxOrderWork.csproj" />
|
||||
<ProjectReference Include="..\WxOrder.Framework\WxOrder.Framework.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<!-- 资源文件:SDK 样式工程默认不会把图片/图标作为 Resource,这里按原工程显式声明 -->
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\**\*" />
|
||||
<None Remove="Ctrls\PDDInvoice\Resources\invoice.js" />
|
||||
<None Remove="Ctrls\PDDInvoice\Resources\order.js" />
|
||||
<Resource Include="29wx.ico" />
|
||||
<Resource Include="29_common_icon.ico" />
|
||||
<Resource Include="Ctrls\PDDInvoice\Resources\invoice.js" />
|
||||
<Resource Include="Ctrls\PDDInvoice\Resources\order.js" />
|
||||
<Resource Include="gear.ico" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Update="Ctrls\BuyerCtrls\PddBuyOrderCtrl.xaml.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Update="Views\ChangePickNoView.xaml.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Common\" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
+42
-38
@@ -1,41 +1,45 @@
|
||||
<Application
|
||||
x:Class="_29WxOrderWpf.App"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:converters="clr-namespace:_29WxOrderWpf.Converters"
|
||||
xmlns:local="clr-namespace:_29WxOrderWpf">
|
||||
<Application.Resources>
|
||||
<ResourceDictionary>
|
||||
<converters:HasValueToVisibilityConverter x:Key="hasValueToVisibilityConverter" />
|
||||
<converters:HasTextToVisibilityConverter x:Key="HasTextVisibility" />
|
||||
<converters:TextEllipsisConverter x:Key="TextEllipsisConverter" />
|
||||
<converters:TextEllipsisConverter26 x:Key="TextEllipsisConverter26" />
|
||||
<converters:TextEllipsisConverter8 x:Key="TextEllipsisConverter8" />
|
||||
<converters:NotHasTextToVisibilityConverter x:Key="NotHasTextVisibility" />
|
||||
<converters:VisibleToVisibilityConverter x:Key="visibleToVisibilityConverter" />
|
||||
<converters:ImageUrlToBitmapImageConverter x:Key="ImageUrlToBitmapImage" />
|
||||
<converters:ValueMinus24Converter x:Key="ValueMinus24Converter" />
|
||||
<converters:FenToYuanConverter x:Key="FenToYuanConverter" />
|
||||
<converters:StatusToColorBrushConverter x:Key="statusToColorBrushConverter" />
|
||||
<converters:ListBoxIndexConverter x:Key="listBoxIndexConverter" />
|
||||
<converters:FlagColorConverter x:Key="flagColorConverter" />
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="Styles/BaseWindowStyle.xaml" />
|
||||
<ResourceDictionary Source="Styles/BaseDataGridStyle.xaml" />
|
||||
<ResourceDictionary Source="Styles/BaseButtonStyle.xaml" />
|
||||
<ResourceDictionary Source="Styles/BaseTextBoxStyle.xaml" />
|
||||
<ResourceDictionary Source="Styles/BaseComboBoxStyle.xaml" />
|
||||
<ResourceDictionary Source="Styles/UcImageButtonStyle.xaml" />
|
||||
<ResourceDictionary Source="Styles/UcWaterMarkTextBoxStyle.xaml" />
|
||||
<ResourceDictionary Source="Styles/StaticImageDictionary.xaml" />
|
||||
<ResourceDictionary Source="Styles/StaticColorBrushDictionary.xaml" />
|
||||
<ResourceDictionary Source="Styles/StaticImageBrushDictionary.xaml" />
|
||||
<!-- 可以添加更多资源字典 -->
|
||||
<ResourceDictionary Source="/Ctrls/Statistics/General.xaml" />
|
||||
x:Class="_29WxOrderWpf.App"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:converters="clr-namespace:_29WxOrderWpf.Converters"
|
||||
xmlns:local="clr-namespace:_29WxOrderWpf"
|
||||
StartupUri="MainWindow.xaml">
|
||||
<Application.Resources>
|
||||
<ResourceDictionary>
|
||||
<converters:HasValueToVisibilityConverter x:Key="hasValueToVisibilityConverter" />
|
||||
<converters:HasTextToVisibilityConverter x:Key="HasTextVisibility" />
|
||||
<converters:TextEllipsisConverter x:Key="TextEllipsisConverter" />
|
||||
<converters:TextEllipsisConverter26 x:Key="TextEllipsisConverter26" />
|
||||
<converters:NotHasTextToVisibilityConverter x:Key="NotHasTextVisibility" />
|
||||
<converters:VisibleToVisibilityConverter x:Key="visibleToVisibilityConverter" />
|
||||
<converters:ImageUrlToBitmapImageConverter x:Key="ImageUrlToBitmapImage" />
|
||||
<converters:ValueMinus24Converter x:Key="ValueMinus24Converter" />
|
||||
<converters:FenToYuanConverter x:Key="FenToYuanConverter" />
|
||||
<converters:StatusToColorBrushConverter x:Key="statusToColorBrushConverter" />
|
||||
<converters:ListBoxIndexConverter x:Key="listBoxIndexConverter" />
|
||||
<converters:FlagColorConverter x:Key="flagColorConverter" />
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/Basic.xaml" />
|
||||
<ResourceDictionary Source="pack://application:,,,/WxOrder.Framework;component/Resources/SkinLocal.xaml" />
|
||||
<ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/Theme.xaml" />
|
||||
|
||||
<ResourceDictionary Source="pack://application:,,,/WxOrder.Framework;component/Resources/Theme.xaml" />
|
||||
<ResourceDictionary Source="Styles/TabControlStyle.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
</Application.Resources>
|
||||
|
||||
<ResourceDictionary Source="Styles/BaseWindowStyle.xaml" />
|
||||
<ResourceDictionary Source="Styles/BaseDataGridStyle.xaml" />
|
||||
<ResourceDictionary Source="Styles/BaseButtonStyle.xaml" />
|
||||
<ResourceDictionary Source="Styles/BaseTextBoxStyle.xaml" />
|
||||
<ResourceDictionary Source="Styles/BaseComboBoxStyle.xaml" />
|
||||
<ResourceDictionary Source="Styles/UcImageButtonStyle.xaml" />
|
||||
<ResourceDictionary Source="Styles/UcWaterMarkTextBoxStyle.xaml" />
|
||||
<ResourceDictionary Source="Styles/StaticImageDictionary.xaml" />
|
||||
<ResourceDictionary Source="Styles/StaticColorBrushDictionary.xaml" />
|
||||
<ResourceDictionary Source="Styles/StaticImageBrushDictionary.xaml" />
|
||||
<!-- 可以添加更多资源字典 -->
|
||||
<ResourceDictionary Source="/Ctrls/Statistics/General.xaml" />
|
||||
|
||||
<ResourceDictionary Source="pack://application:,,,/WxOrder.Framework;component/Resources/Theme.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
</Application.Resources>
|
||||
</Application>
|
||||
+16
-18
@@ -108,7 +108,7 @@ namespace _29WxOrderWpf
|
||||
string str = GetExceptionMsg(ex, string.Empty);
|
||||
NaiBa.Util.Helper.LogHelper.WriteWithTime("SystemError:" + str);
|
||||
//BaseMsgForm.ShowError(str, "系统错误");
|
||||
BaseMsgWindow.ShowError(str, "系统错误", null, MsgWindowLevel.LARGE);
|
||||
BaseMsgWindow.ShowError(str, "系统错误");
|
||||
}
|
||||
|
||||
#region 初始化cef
|
||||
@@ -141,31 +141,29 @@ namespace _29WxOrderWpf
|
||||
#endif
|
||||
Cef.Initialize(settings);
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
}
|
||||
|
||||
new MainWindow().Show();
|
||||
}
|
||||
//static void Application_ThreadException(object sender, System.Threading.ThreadExceptionEventArgs e)
|
||||
//{
|
||||
// string str = GetExceptionMsg(e.Exception, e.ToString());
|
||||
// NaiBa.Util.Helper.LogHelper.WriteWithTime("SystemError:" + str);
|
||||
// BaseMsgWindow.ShowError(str, "系统错误");
|
||||
//}
|
||||
|
||||
//static void Application_ThreadException(object sender, System.Threading.ThreadExceptionEventArgs e)
|
||||
//{
|
||||
// string str = GetExceptionMsg(e.Exception, e.ToString());
|
||||
// NaiBa.Util.Helper.LogHelper.WriteWithTime("SystemError:" + str);
|
||||
// BaseMsgWindow.ShowError(str, "系统错误");
|
||||
//}
|
||||
|
||||
private void Current_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
|
||||
private void Current_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
|
||||
{
|
||||
string str = GetExceptionMsg(e.Exception, e.ToString());
|
||||
NaiBa.Util.Helper.LogHelper.WriteWithTime("SystemError:" + str);
|
||||
BaseMsgWindow.ShowError(str, "系统错误", null, MsgWindowLevel.LARGE);
|
||||
}
|
||||
BaseMsgWindow.ShowError(str, "系统错误");
|
||||
}
|
||||
|
||||
static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
|
||||
{
|
||||
string str = GetExceptionMsg(e.ExceptionObject as Exception, e.ToString());
|
||||
NaiBa.Util.Helper.LogHelper.WriteWithTime("SystemError:" + str);
|
||||
BaseMsgWindow.ShowError(str, "系统错误", null, MsgWindowLevel.LARGE);
|
||||
}
|
||||
BaseMsgWindow.ShowError(str, "系统错误");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 生成自定义异常消息
|
||||
@@ -190,8 +188,8 @@ namespace _29WxOrderWpf
|
||||
}
|
||||
sb.AppendLine("***************************************************************");
|
||||
NaiBa.Util.Helper.LogHelper.WriteWithTime("Error:" + sb);
|
||||
BaseMsgWindow.ShowError(sb.ToString(), "系统错误", null, MsgWindowLevel.LARGE);
|
||||
return sb.ToString();
|
||||
BaseMsgWindow.ShowError(sb.ToString(), "系统错误");
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using AllBase.Helper;
|
||||
using NaiBa.Util.Extension;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -50,14 +49,14 @@ namespace _29WxOrderWpf.BaseWindows
|
||||
|
||||
BaseMsgWindow msgBox = null;
|
||||
Window owner = window ?? MainWindow.Instance;
|
||||
//owner.Dispatcher.Invoke(() =>
|
||||
Application.Current.Dispatcher.Invoke(() =>
|
||||
{
|
||||
|
||||
owner.Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
msgBox = CreateMsgForm(msg, title, wl);
|
||||
msgBox.imgTip.Source = Application.Current.Resources["imgBaseMsgInfo"] as ImageSource;
|
||||
//msgBox.Owner = owner;
|
||||
msgBox.Owner = owner;
|
||||
msgBox.ShowDialog();
|
||||
});
|
||||
}));
|
||||
return msgBox;
|
||||
}
|
||||
|
||||
@@ -66,26 +65,24 @@ namespace _29WxOrderWpf.BaseWindows
|
||||
string title = string.IsNullOrEmpty(caption) ? "系统错误" : caption;
|
||||
BaseMsgWindow msgBox = null;
|
||||
Window owner = window ?? MainWindow.Instance;
|
||||
//owner.Dispatcher.Invoke(() =>
|
||||
Application.Current.Dispatcher.Invoke(() =>
|
||||
{
|
||||
owner.Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
msgBox = CreateMsgForm(msg, title, wl);
|
||||
msgBox.imgTip.Source = Application.Current.Resources["imgBaseMsgErr"] as ImageSource;
|
||||
//msgBox.Owner = owner;
|
||||
msgBox.Owner = owner;
|
||||
msgBox.ShowDialog();
|
||||
});
|
||||
}));
|
||||
return msgBox;
|
||||
}
|
||||
|
||||
public static BaseMsgWindow ShowConfirm(string msg, string caption = "", Window window = null, MsgWindowLevel fl = MsgWindowLevel.MEDIUM, int? boxHeight = null)
|
||||
public static BaseMsgWindow ShowConfirm(string msg, string caption = "", Window window = null, MsgWindowLevel fl = MsgWindowLevel.MEDIUM)
|
||||
{
|
||||
string title = string.IsNullOrEmpty(caption) ? "确认系统提示" : caption;
|
||||
|
||||
BaseMsgWindow msgBox = null;
|
||||
Window owner = window ?? MainWindow.Instance;
|
||||
//owner.Dispatcher.Invoke(() =>
|
||||
Application.Current.Dispatcher.Invoke(() =>
|
||||
{
|
||||
owner.Dispatcher.Invoke(() =>
|
||||
{
|
||||
msgBox = new BaseMsgWindow
|
||||
{
|
||||
lblTitle = { Content = title },
|
||||
@@ -95,11 +92,9 @@ namespace _29WxOrderWpf.BaseWindows
|
||||
if (fl.Equals(MsgWindowLevel.LARGE))
|
||||
{
|
||||
msgBox.Width = (int)MsgWindowLevel.LARGE;
|
||||
if (boxHeight == null)
|
||||
boxHeight = 500;
|
||||
msgBox.Height = boxHeight.ParseToInt();
|
||||
msgBox.Height = 500;
|
||||
}
|
||||
//msgBox.Owner = owner;
|
||||
msgBox.Owner = owner;
|
||||
msgBox.ShowDialog();
|
||||
});
|
||||
return msgBox;
|
||||
@@ -124,8 +119,8 @@ namespace _29WxOrderWpf.BaseWindows
|
||||
MainWindow.Instance.borderMessage.BorderBrush = Application.Current.Resources["pageColorBrush"] as SolidColorBrush;
|
||||
MainWindow.Instance.tbMessage.Foreground = Application.Current.Resources["pageColorBrush"] as SolidColorBrush;
|
||||
}
|
||||
if (type.ToLower() == "err" || type.ToLower() == "error")
|
||||
{
|
||||
if (type.ToLower() == "error")
|
||||
{
|
||||
MainWindow.Instance.borderMessage.BorderBrush = Application.Current.Resources["PageWarningBrush"] as SolidColorBrush;
|
||||
MainWindow.Instance.tbMessage.Foreground = Application.Current.Resources["PageWarningBrush"] as SolidColorBrush;
|
||||
}
|
||||
|
||||
+2
-1
@@ -5,9 +5,10 @@ using System.Threading.Tasks;
|
||||
using System.Windows.Input;
|
||||
using System.Reflection.Emit;
|
||||
using System.Resources;
|
||||
using _29WxOrderWpf.Commands;
|
||||
|
||||
|
||||
namespace WxOrder.Framework.Commons
|
||||
namespace _29WxOrderWpf.Common
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
@@ -0,0 +1,285 @@
|
||||
using System.Linq.Expressions;
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Input;
|
||||
using System.Reflection.Emit;
|
||||
using System.Resources;
|
||||
using _29WxOrderWpf.Commands;
|
||||
|
||||
namespace _29WxOrderWpf.Common
|
||||
{
|
||||
/// <summary>
|
||||
/// Provides an implementation of the <see cref="IAsyncCommand"/> with a generic parameter type.
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
public class AsyncDelegateCommand<T> : DelegateCommandBase, IAsyncCommand
|
||||
{
|
||||
private bool _enableParallelExecution = false;
|
||||
private bool _isExecuting = false;
|
||||
private readonly Func<T, CancellationToken, Task> _executeMethod;
|
||||
private Func<T, bool> _canExecuteMethod;
|
||||
private Func<CancellationToken> _getCancellationToken = () => CancellationToken.None;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new instance of <see cref="AsyncDelegateCommand{T}"/> with the <see cref="Func{Task}"/> to invoke on execution.
|
||||
/// </summary>
|
||||
/// <param name="executeMethod">The <see cref="Func{T, Task}"/> to invoke when <see cref="ICommand.Execute(object)"/> is called.</param>
|
||||
public AsyncDelegateCommand(Func<T, Task> executeMethod)
|
||||
#if NET6_0_OR_GREATER
|
||||
: this((p,t) => executeMethod(p).WaitAsync(t), _ => true)
|
||||
#else
|
||||
: this((p, t) => executeMethod(p), _ => true)
|
||||
#endif
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new instance of <see cref="AsyncDelegateCommand{T}"/> with the <see cref="Func{Task}"/> to invoke on execution.
|
||||
/// </summary>
|
||||
/// <param name="executeMethod">The <see cref="Func{T, CancellationToken, Task}"/> to invoke when <see cref="ICommand.Execute(object)"/> is called.</param>
|
||||
public AsyncDelegateCommand(Func<T, CancellationToken, Task> executeMethod)
|
||||
: this(executeMethod, _ => true)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new instance of <see cref="DelegateCommand"/> with the <see cref="Func{Task}"/> to invoke on execution
|
||||
/// and a <see langword="Func" /> to query for determining if the command can execute.
|
||||
/// </summary>
|
||||
/// <param name="executeMethod">The <see cref="Func{T, Task}"/> to invoke when <see cref="ICommand.Execute"/> is called.</param>
|
||||
/// <param name="canExecuteMethod">The delegate to invoke when <see cref="ICommand.CanExecute"/> is called</param>
|
||||
public AsyncDelegateCommand(Func<T, Task> executeMethod, Func<T, bool> canExecuteMethod)
|
||||
#if NET6_0_OR_GREATER
|
||||
: this((p, c) => executeMethod(p).WaitAsync(c), canExecuteMethod)
|
||||
#else
|
||||
: this((p, c) => executeMethod(p), canExecuteMethod)
|
||||
#endif
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new instance of <see cref="DelegateCommand"/> with the <see cref="Func{Task}"/> to invoke on execution
|
||||
/// and a <see langword="Func" /> to query for determining if the command can execute.
|
||||
/// </summary>
|
||||
/// <param name="executeMethod">The <see cref="Func{T, CancellationToken, Task}"/> to invoke when <see cref="ICommand.Execute"/> is called.</param>
|
||||
/// <param name="canExecuteMethod">The delegate to invoke when <see cref="ICommand.CanExecute"/> is called</param>
|
||||
public AsyncDelegateCommand(Func<T, CancellationToken, Task> executeMethod, Func<T, bool> canExecuteMethod)
|
||||
: base()
|
||||
{
|
||||
if (executeMethod == null || canExecuteMethod == null)
|
||||
throw new ArgumentNullException(nameof(executeMethod), "Neither the executeMethod nor the canExecuteMethod delegates can be null");
|
||||
|
||||
|
||||
_executeMethod = executeMethod;
|
||||
_canExecuteMethod = canExecuteMethod;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the current state of the AsyncDelegateCommand
|
||||
/// </summary>
|
||||
public bool IsExecuting
|
||||
{
|
||||
get => _isExecuting;
|
||||
private set
|
||||
{
|
||||
_isExecuting = value;
|
||||
OnCanExecuteChanged();
|
||||
}
|
||||
}
|
||||
|
||||
///<summary>
|
||||
/// Executes the command.
|
||||
///</summary>
|
||||
public async Task Execute(T parameter, CancellationToken? cancellationToken = null)
|
||||
{
|
||||
var token = cancellationToken ?? _getCancellationToken();
|
||||
|
||||
try
|
||||
{
|
||||
if (!_enableParallelExecution && IsExecuting)
|
||||
return;
|
||||
|
||||
IsExecuting = true;
|
||||
await _executeMethod(parameter, token)
|
||||
.ConfigureAwait(false);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
finally
|
||||
{
|
||||
IsExecuting = false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determines if the command can be executed.
|
||||
/// </summary>
|
||||
/// <returns>Returns <see langword="true"/> if the command can execute,otherwise returns <see langword="false"/>.</returns>
|
||||
public bool CanExecute(T parameter)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!_enableParallelExecution && IsExecuting)
|
||||
return false;
|
||||
|
||||
return _canExecuteMethod?.Invoke(parameter) ?? true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
throw;
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Handle the internal invocation of <see cref="ICommand.Execute(object)"/>
|
||||
/// </summary>
|
||||
/// <param name="parameter">Command Parameter</param>
|
||||
protected override async void Execute(object parameter)
|
||||
{
|
||||
var cancellationToken = _getCancellationToken();
|
||||
T parameterAsT;
|
||||
try
|
||||
{
|
||||
parameterAsT = (T)parameter;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
|
||||
// If we had an exception casting the parameter to T ,
|
||||
// we would have already returned. We want to surface any
|
||||
// exceptions thrown by the Execute method.
|
||||
await Execute(parameterAsT, cancellationToken)
|
||||
.ConfigureAwait(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Handle the internal invocation of <see cref="ICommand.CanExecute(object)"/>
|
||||
/// </summary>
|
||||
/// <param name="parameter"></param>
|
||||
/// <returns><see langword="true"/> if the Command Can Execute, otherwise <see langword="false" /></returns>
|
||||
protected override bool CanExecute(object parameter)
|
||||
{
|
||||
try
|
||||
{
|
||||
return CanExecute((T)parameter);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Enables Parallel Execution of Async Tasks
|
||||
/// </summary>
|
||||
/// <returns>The current instance of <see cref="AsyncDelegateCommand{T}"/>.</returns>
|
||||
public AsyncDelegateCommand<T> EnableParallelExecution()
|
||||
{
|
||||
_enableParallelExecution = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the <see cref="CancellationTokenSourceFactory(Func{CancellationToken})"/> based on the specified timeout.
|
||||
/// </summary>
|
||||
/// <param name="timeout">A specified timeout.</param>
|
||||
/// <returns>The current instance of <see cref="AsyncDelegateCommand{T}"/>.</returns>
|
||||
public AsyncDelegateCommand<T> CancelAfter(TimeSpan timeout) =>
|
||||
CancellationTokenSourceFactory(() => new CancellationTokenSource(timeout).Token);
|
||||
|
||||
/// <summary>
|
||||
/// Provides a delegate callback to provide a default CancellationToken when the Command is invoked.
|
||||
/// </summary>
|
||||
/// <param name="factory">The default <see cref="CancellationToken"/> Factory.</param>
|
||||
/// <returns>The current instance of <see cref="AsyncDelegateCommand{T}"/>.</returns>
|
||||
public AsyncDelegateCommand<T> CancellationTokenSourceFactory(Func<CancellationToken> factory)
|
||||
{
|
||||
_getCancellationToken = factory;
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Observes a property that implements INotifyPropertyChanged, and automatically calls DelegateCommandBase.RaiseCanExecuteChanged on property changed notifications.
|
||||
/// </summary>
|
||||
/// <typeparam name="TType">The type of the return value of the method that this delegate encapsulates</typeparam>
|
||||
/// <param name="propertyExpression">The property expression. Example: ObservesProperty(() => PropertyName).</param>
|
||||
/// <returns>The current instance of <see cref="AsyncDelegateCommand{T}"/>.</returns>
|
||||
public AsyncDelegateCommand<T> ObservesProperty<TType>(Expression<Func<TType>> propertyExpression)
|
||||
{
|
||||
ObservesPropertyInternal(propertyExpression);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Observes a property that is used to determine if this command can execute, and if it implements INotifyPropertyChanged it will automatically call DelegateCommandBase.RaiseCanExecuteChanged on property changed notifications.
|
||||
/// </summary>
|
||||
/// <param name="canExecuteExpression">The property expression. Example: ObservesCanExecute(() => PropertyName).</param>
|
||||
/// <returns>The current instance of <see cref="AsyncDelegateCommand{T}"/>.</returns>
|
||||
public AsyncDelegateCommand<T> ObservesCanExecute(Expression<Func<bool>> canExecuteExpression)
|
||||
{
|
||||
Expression<Func<T, bool>> expression = Expression.Lambda<Func<T, bool>>(canExecuteExpression.Body, Expression.Parameter(typeof(T), "o"));
|
||||
_canExecuteMethod = expression.Compile();
|
||||
ObservesPropertyInternal(canExecuteExpression);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Provides the ability to connect a delegate to catch exceptions encountered by CanExecute or the Execute methods of the DelegateCommand
|
||||
/// </summary>
|
||||
/// <param name="catch">TThe callback when a specific exception is encountered</param>
|
||||
/// <returns>The current instance of <see cref="AsyncDelegateCommand{T}"/>.</returns>
|
||||
public AsyncDelegateCommand<T> Catch<TException>(Action<TException> @catch)
|
||||
where TException : Exception
|
||||
{
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Provides the ability to connect a delegate to catch exceptions encountered by CanExecute or the Execute methods of the DelegateCommand
|
||||
/// </summary>
|
||||
/// <param name="catch">The generic / default callback when an exception is encountered</param>
|
||||
/// <returns>The current instance of <see cref="AsyncDelegateCommand{T}"/>.</returns>
|
||||
public AsyncDelegateCommand<T> Catch(Action<Exception> @catch)
|
||||
{
|
||||
return this;
|
||||
}
|
||||
|
||||
async Task IAsyncCommand.ExecuteAsync(object parameter)
|
||||
{
|
||||
try
|
||||
{
|
||||
// If T is not nullable this may throw an exception
|
||||
await Execute((T)parameter, _getCancellationToken());
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
async Task IAsyncCommand.ExecuteAsync(object parameter, CancellationToken cancellationToken)
|
||||
{
|
||||
try
|
||||
{
|
||||
// If T is not nullable this may throw an exception
|
||||
await Execute((T)parameter, cancellationToken);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -5,7 +5,7 @@ using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
|
||||
namespace WxOrder.Framework.Commons
|
||||
namespace _29WxOrderWpf.Common
|
||||
{
|
||||
public static class DebugVisibility
|
||||
{
|
||||
+1
-1
@@ -2,7 +2,7 @@ using System;
|
||||
using System.Linq.Expressions;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace WxOrder.Framework.Commons
|
||||
namespace _29WxOrderWpf.Commands
|
||||
{
|
||||
/// <summary>
|
||||
/// An <see cref="ICommand"/> whose delegates do not take any parameters for <see cref="Execute()"/> and <see cref="CanExecute()"/>.
|
||||
+1
-1
@@ -8,7 +8,7 @@ using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace WxOrder.Framework.Commons
|
||||
namespace _29WxOrderWpf.Commands
|
||||
{
|
||||
public abstract class DelegateCommandBase : ICommand
|
||||
{
|
||||
+1
-1
@@ -3,7 +3,7 @@ using System.Linq.Expressions;
|
||||
using System.Reflection;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace WxOrder.Framework.Commons
|
||||
namespace _29WxOrderWpf.Commands
|
||||
{
|
||||
|
||||
public class DelegateCommand<T> : DelegateCommandBase
|
||||
@@ -0,0 +1,23 @@
|
||||
<Window
|
||||
x:Class="_29WxOrderWpf.Common.DialogWindow"
|
||||
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:local="clr-namespace:_29WxOrderWpf.Common"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
Title="{Binding Title}"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
Background="#FFFFFF"
|
||||
WindowStartupLocation="CenterOwner"
|
||||
mc:Ignorable="d">
|
||||
<Window.Resources>
|
||||
<Style x:Key="DialogWindowStyle" TargetType="Window">
|
||||
<Setter Property="Tag" Value="Default" />
|
||||
<Setter Property="ResizeMode" Value="NoResize" />
|
||||
<Setter Property="ShowInTaskbar" Value="False" />
|
||||
<Setter Property="WindowChrome.GlassFrameThickness" Value="-1" />
|
||||
</Style>
|
||||
</Window.Resources>
|
||||
<Grid />
|
||||
</Window>
|
||||
+4
-10
@@ -6,27 +6,23 @@ using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Interop;
|
||||
using WxOrder.Framework.Commons;
|
||||
using WxOrder.Framework.Commons.Dialogs;
|
||||
|
||||
|
||||
|
||||
namespace WxOrder.Framework.Commons
|
||||
namespace _29WxOrderWpf.Common
|
||||
{
|
||||
/// <summary>
|
||||
/// DialogWindow.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class DialogWindow : Window, IDialogWindow
|
||||
public partial class DialogWindow : Window
|
||||
{
|
||||
private readonly Style dialogWindowStyle;
|
||||
private bool isConstructorSuccessful = false;
|
||||
private UserControl _content;
|
||||
public DialogWindow(Window owner = null)
|
||||
public DialogWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
Owner = owner ?? Application.Current.Windows
|
||||
.OfType<Window>()
|
||||
.FirstOrDefault(w => w.IsActive) ?? Application.Current.MainWindow;
|
||||
Owner = Application.Current.MainWindow;
|
||||
isConstructorSuccessful = true;
|
||||
dialogWindowStyle = (Style)TryFindResource("DialogWindowStyle");
|
||||
Loaded += DialogWindow_Loaded;
|
||||
@@ -105,8 +101,6 @@ namespace WxOrder.Framework.Commons
|
||||
private const int GWL_STYLE = -16;
|
||||
private const int WS_MINIMIZEBOX = 0x00020000;
|
||||
|
||||
public IDialogResult Result { get; set; }
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
private static extern int GetWindowLong(IntPtr hWnd, int nIndex);
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
|
||||
namespace WxOrder.Framework.Commons
|
||||
namespace _29WxOrderWpf.Common
|
||||
{
|
||||
/// <summary>
|
||||
/// 弹出窗口属性值
|
||||
+1
-1
@@ -5,7 +5,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace WxOrder.Framework.Commons;
|
||||
namespace MAX.Core.Helpers;
|
||||
public class EnvironmentHelper
|
||||
{
|
||||
private static string? _currentEnvironment;
|
||||
@@ -2,7 +2,7 @@
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace WxOrder.Framework.Commons
|
||||
namespace _29WxOrderWpf.Common
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
+1
-1
@@ -3,7 +3,7 @@ using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace WxOrder.Framework.Commons
|
||||
namespace _29WxOrderWpf.Common
|
||||
{
|
||||
/// <summary>
|
||||
/// 让页面级 ScrollViewer 在鼠标悬停在子控件(如 DataGrid、图表等)上时也能随鼠标滚轮滚动。
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
namespace WxOrder.Framework.Commons.pinyin.Data
|
||||
namespace TinyPinyin.Data
|
||||
{
|
||||
public static class PinyinCode1
|
||||
{
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
namespace WxOrder.Framework.Commons.pinyin.Data
|
||||
namespace TinyPinyin.Data
|
||||
{
|
||||
public static class PinyinCode2
|
||||
{
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
namespace WxOrder.Framework.Commons.pinyin.Data
|
||||
namespace TinyPinyin.Data
|
||||
{
|
||||
public static class PinyinCode3
|
||||
{
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
using System;
|
||||
|
||||
namespace WxOrder.Framework.Commons.pinyin.Data
|
||||
namespace TinyPinyin.Data
|
||||
{
|
||||
public static class PinyinData
|
||||
{
|
||||
@@ -1,9 +1,9 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using WxOrder.Framework.Commons.pinyin.Data;
|
||||
using TinyPinyin.Data;
|
||||
|
||||
namespace WxOrder.Framework.Commons.pinyin
|
||||
namespace TinyPinyin
|
||||
{
|
||||
public static class Engine
|
||||
{
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace WxOrder.Framework.Commons.pinyin
|
||||
namespace TinyPinyin
|
||||
{
|
||||
public interface IPinyinDict
|
||||
{
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace WxOrder.Framework.Commons.pinyin
|
||||
namespace TinyPinyin
|
||||
{
|
||||
public abstract class PinyinDict : IPinyinDict
|
||||
{
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
using System.Linq;
|
||||
|
||||
namespace WxOrder.Framework.Commons.pinyin
|
||||
namespace TinyPinyin
|
||||
{
|
||||
public static class PinyinHelper
|
||||
{
|
||||
@@ -5,192 +5,55 @@ using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Threading;
|
||||
using Work;
|
||||
|
||||
namespace _29WxOrderWpf.Converters
|
||||
{
|
||||
public class ImageUrlToBitmapImageConverter : IMultiValueConverter
|
||||
{
|
||||
/// <summary> 缓存上限,防止大量缩略图重复下载导致内存膨胀 </summary>
|
||||
private const int MaxCacheCount = 200;
|
||||
public class ImageUrlToBitmapImageConverter : IValueConverter
|
||||
{
|
||||
/// <summary> 缓存上限,防止大量缩略图重复下载导致内存膨胀 </summary>
|
||||
private const int MaxCacheCount = 200;
|
||||
|
||||
private readonly ConcurrentDictionary<string, BitmapImage> _imageCache = new ConcurrentDictionary<string, BitmapImage>();
|
||||
private readonly ConcurrentDictionary<string, BitmapImage> _imageCache = new ConcurrentDictionary<string, BitmapImage>();
|
||||
|
||||
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
if (values.Length == 0 || values[0] == DependencyProperty.UnsetValue)
|
||||
return null;
|
||||
var url = values[0] as string;
|
||||
var isLoad = values[1] is bool b && b;
|
||||
if (!isLoad || string.IsNullOrEmpty(url))
|
||||
return null; // 或返回占位图
|
||||
if (Uri.IsWellFormedUriString(url, UriKind.Absolute))
|
||||
{
|
||||
if (_imageCache.TryGetValue(url, out BitmapImage cached))
|
||||
{
|
||||
return cached;
|
||||
}
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
if (value is string url && Uri.IsWellFormedUriString(url, UriKind.Absolute))
|
||||
{
|
||||
if (_imageCache.TryGetValue(url, out BitmapImage cached))
|
||||
{
|
||||
return cached;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
// 直接加载绑定如果遇到有问题的网络图片会直接崩溃。
|
||||
BitmapImage bitMap = AllBase.ImageBuild.LoadBitmipImageFromUrl(url);
|
||||
if (bitMap != null)
|
||||
{
|
||||
if (_imageCache.Count >= MaxCacheCount)
|
||||
{
|
||||
_imageCache.Clear();
|
||||
}
|
||||
_imageCache[url] = bitMap;
|
||||
}
|
||||
return bitMap;
|
||||
}
|
||||
catch
|
||||
{
|
||||
try
|
||||
{
|
||||
// 直接加载绑定如果遇到有问题的网络图片会直接崩溃。
|
||||
BitmapImage bitMap = AllBase.ImageBuild.LoadBitmipImageFromUrl(url);
|
||||
if (bitMap != null)
|
||||
{
|
||||
if (_imageCache.Count >= MaxCacheCount)
|
||||
{
|
||||
_imageCache.Clear();
|
||||
}
|
||||
_imageCache[url] = bitMap;
|
||||
}
|
||||
return bitMap;
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
// 建议作为静态字段复用,不要每次调用都 new HttpClient()
|
||||
private static readonly HttpClient _httpClient = new HttpClient();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public class ImageLoadRequest
|
||||
{
|
||||
public string Url { get; set; }
|
||||
public bool IsLoad { get; set; }
|
||||
|
||||
// 用于避免相同状态重复触发下载逻辑
|
||||
public override bool Equals(object obj) =>
|
||||
obj is ImageLoadRequest other && other.Url == Url && other.IsLoad == IsLoad;
|
||||
|
||||
public override int GetHashCode() => Url.GetHashCode();
|
||||
}
|
||||
|
||||
public class ImageLoadRequestConverter : IMultiValueConverter
|
||||
{
|
||||
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
var url = values[0] as string;
|
||||
var isLoad = values.Length > 1 && values[1] is bool b && b;
|
||||
return new ImageLoadRequest { Url = url, IsLoad = isLoad };
|
||||
}
|
||||
|
||||
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
|
||||
=> throw new NotSupportedException();
|
||||
}
|
||||
|
||||
public static class AsyncImageLoader
|
||||
{
|
||||
private static readonly HttpClient _httpClient = new HttpClient();
|
||||
private static readonly ConcurrentDictionary<string, Task<BitmapImage>> _cache
|
||||
= new ConcurrentDictionary<string, Task<BitmapImage>>();
|
||||
|
||||
public static readonly DependencyProperty RequestProperty =
|
||||
DependencyProperty.RegisterAttached(
|
||||
"Request",
|
||||
typeof(ImageLoadRequest),
|
||||
typeof(AsyncImageLoader),
|
||||
new PropertyMetadata(null, OnRequestChanged));
|
||||
|
||||
public static ImageLoadRequest GetRequest(DependencyObject obj) => (ImageLoadRequest)obj.GetValue(RequestProperty);
|
||||
public static void SetRequest(DependencyObject obj, ImageLoadRequest value) => obj.SetValue(RequestProperty, value);
|
||||
|
||||
private static readonly DependencyProperty CurrentUrlProperty =
|
||||
DependencyProperty.RegisterAttached("CurrentUrl", typeof(string), typeof(AsyncImageLoader), new PropertyMetadata(null));
|
||||
private static string GetCurrentUrl(DependencyObject obj) => (string)obj.GetValue(CurrentUrlProperty);
|
||||
private static void SetCurrentUrl(DependencyObject obj, string value) => obj.SetValue(CurrentUrlProperty, value);
|
||||
|
||||
private static readonly DependencyProperty CtsProperty =
|
||||
DependencyProperty.RegisterAttached("Cts", typeof(CancellationTokenSource), typeof(AsyncImageLoader), new PropertyMetadata(null));
|
||||
private static CancellationTokenSource GetCts(DependencyObject obj) => (CancellationTokenSource)obj.GetValue(CtsProperty);
|
||||
private static void SetCts(DependencyObject obj, CancellationTokenSource value) => obj.SetValue(CtsProperty, value);
|
||||
|
||||
private static void OnRequestChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
if (!(d is Image image)) return;
|
||||
|
||||
// 值没变(Equals 重写过),不做任何事,避免无意义触发
|
||||
if (Equals(e.OldValue, e.NewValue)) return;
|
||||
|
||||
var request = e.NewValue as ImageLoadRequest;
|
||||
|
||||
GetCts(image)?.Cancel();
|
||||
|
||||
if (request == null || !request.IsLoad || string.IsNullOrEmpty(request.Url))
|
||||
{
|
||||
return; // 滚动中,不加载,保留原图,不产生任何开销
|
||||
}
|
||||
|
||||
string url = request.Url;
|
||||
SetCurrentUrl(image, url);
|
||||
var cts = new CancellationTokenSource();
|
||||
SetCts(image, cts);
|
||||
|
||||
// 关键:把真正的下载动作丢到 Dispatcher 队列里、用较低优先级去做,
|
||||
// 避免在当前这一帧的布局/绑定更新过程中做任何"重"的同步开销,
|
||||
// 也顺便起到一个天然的"防抖"效果——如果这一帧内 Request 又变了
|
||||
// (比如滚动中又切回别的 item),上面的 Cancel() 已经先取消了。
|
||||
image.Dispatcher.BeginInvoke(DispatcherPriority.Background, new Action(async () =>
|
||||
{
|
||||
if (cts.IsCancellationRequested) return;
|
||||
|
||||
try
|
||||
{
|
||||
var bitmap = await LoadBitmapAsync(url, cts.Token);
|
||||
if (bitmap != null && GetCurrentUrl(image) == url && !cts.IsCancellationRequested)
|
||||
{
|
||||
image.Source = bitmap;
|
||||
}
|
||||
}
|
||||
catch (OperationCanceledException) { }
|
||||
catch (Exception ex)
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine($"Error loading image from {url}: {ex.Message}");
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
private static Task<BitmapImage> LoadBitmapAsync(string url, CancellationToken token)
|
||||
{
|
||||
return _cache.GetOrAdd(url, async u =>
|
||||
{
|
||||
using var response = await _httpClient.GetAsync(u, token);
|
||||
response.EnsureSuccessStatusCode();
|
||||
var data = await response.Content.ReadAsByteArrayAsync();
|
||||
|
||||
using var stream = new MemoryStream(data);
|
||||
var bitmap = new BitmapImage();
|
||||
bitmap.BeginInit();
|
||||
bitmap.CreateOptions = BitmapCreateOptions.PreservePixelFormat | BitmapCreateOptions.IgnoreColorProfile;
|
||||
bitmap.CacheOption = BitmapCacheOption.OnLoad;
|
||||
bitmap.StreamSource = stream;
|
||||
bitmap.DecodePixelWidth = 200;
|
||||
bitmap.EndInit();
|
||||
bitmap.Freeze();
|
||||
return bitmap;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
throw new NotImplementedException(); // 不需要反向转换,所以不实现。
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -15,13 +15,10 @@ namespace _29WxOrderWpf.Converters
|
||||
{
|
||||
ListBoxItem item = (ListBoxItem)value;
|
||||
ListBox listView = ItemsControl.ItemsControlFromItemContainer(item) as ListBox;
|
||||
if (listView == null)
|
||||
return 0;
|
||||
|
||||
return listView.ItemContainerGenerator.IndexFromContainer(item) + 1;
|
||||
}
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace _29WxOrderWpf.Converters
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
if (value == null)
|
||||
if ( value == null)
|
||||
return Visibility.Collapsed;
|
||||
return !value.ParseToString().Trim().IsNullOrEmpty() ? Visibility.Visible : Visibility.Collapsed;
|
||||
}
|
||||
@@ -53,36 +53,20 @@ namespace _29WxOrderWpf.Converters
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 超出26个字的文本显示省略号
|
||||
/// </summary>
|
||||
public class TextEllipsisConverter26 : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
if (value.ParseToString().Length > 26)
|
||||
return string.Join("", value.ParseToString().Take(26)) + "…";
|
||||
return value.ParseToString();
|
||||
}
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
throw new NotImplementedException(); // 单向绑定可不实现
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 超出10个字的文本显示省略号
|
||||
/// </summary>
|
||||
public class TextEllipsisConverter8 : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
if (value.ParseToString().Length > 8)
|
||||
return string.Join("", value.ParseToString().Take(8)) + "…";
|
||||
return value.ParseToString();
|
||||
}
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
throw new NotImplementedException(); // 单向绑定可不实现
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 超出26个字的文本显示省略号
|
||||
/// </summary>
|
||||
public class TextEllipsisConverter26 : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
if (value.ParseToString().Length > 26)
|
||||
return string.Join("", value.ParseToString().Take(26)) + "…";
|
||||
return value.ParseToString();
|
||||
}
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
throw new NotImplementedException(); // 单向绑定可不实现
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -1,247 +1,49 @@
|
||||
<UserControl
|
||||
x:Class="_29WxOrderWpf.Ctrls.BuyerCtrls.PDDBuyerSelectCtrl"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:c="WxOrder.Framework"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:_29WxOrderWpf.Ctrls.BuyerCtrls"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:userctrls="clr-namespace:_29WxOrderWpf.UserControls"
|
||||
xmlns:wpf="WPFCommon"
|
||||
d:DesignHeight="30"
|
||||
d:DesignWidth="320"
|
||||
Loaded="UserControl_Loaded"
|
||||
mc:Ignorable="d">
|
||||
<Grid Margin="0,0,0,-26">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto" />
|
||||
<ColumnDefinition Width="auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
|
||||
<wpf:SpacingStackPanel
|
||||
Grid.Column="1"
|
||||
VerticalAlignment="Center"
|
||||
Orientation="Vertical"
|
||||
VerticalSpacing="2">
|
||||
<WrapPanel x:Name="wpPddBuyer">
|
||||
|
||||
<Image
|
||||
Width="24"
|
||||
Height="24"
|
||||
Margin="4,0,0,0"
|
||||
Cursor="Hand"
|
||||
MouseLeftButtonUp="Image_MouseLeftButtonUp"
|
||||
Source="{StaticResource imgBuyerOrder}" />
|
||||
|
||||
<CheckBox
|
||||
x:Name="chkPddBuyerLogin"
|
||||
Margin="2,2,2,2"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
VerticalContentAlignment="Center"
|
||||
d:IsChecked="True"
|
||||
BorderBrush="{StaticResource mainColorBrush}"
|
||||
Click="chkBuyerLogin_Click"
|
||||
FontSize="12"
|
||||
IsChecked="True" />
|
||||
<ComboBox
|
||||
x:Name="cmbPddBuyer"
|
||||
Grid.Column="1"
|
||||
Width="180"
|
||||
Height="24"
|
||||
Margin="0,0,0,0"
|
||||
VerticalContentAlignment="Center"
|
||||
MouseLeftButtonUp="cmbPddBuyer_MouseLeftButtonUp"
|
||||
SelectedIndex="0"
|
||||
SelectionChanged="cmbPddBuyer_SelectionChanged"
|
||||
Style="{StaticResource RoundedComboBox}">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<!--<Grid HorizontalAlignment="Stretch" MinWidth="{Binding RelativeSource={RelativeSource Self}, Path=ActualWidth}">-->
|
||||
<Grid
|
||||
Height="auto"
|
||||
MinWidth="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type ComboBox}}, Path=ActualWidth, Converter={StaticResource ValueMinus24Converter}}"
|
||||
HorizontalAlignment="Stretch">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="120*" />
|
||||
<ColumnDefinition Width="auto" />
|
||||
<ColumnDefinition Width="auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock
|
||||
x:Name="tbName"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding buyer_nick}" />
|
||||
<userctrls:UcImageButton
|
||||
x:Name="btnDeleteItem"
|
||||
Grid.Column="0"
|
||||
Width="15"
|
||||
Height="15"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
ButtonImage="{StaticResource imgCloseGray}"
|
||||
Click="btnDeleteItem_Click"
|
||||
Cursor="Hand"
|
||||
MouseOverButtonImage="{StaticResource imgCloseGray}"
|
||||
MousePressButtonImage="{StaticResource imgCloseGray}"
|
||||
Tag="{Binding ElementName=tbName, Path=Text}"
|
||||
Visibility="Collapsed" />
|
||||
<TextBlock
|
||||
x:Name="tbStatus"
|
||||
Grid.Column="2"
|
||||
VerticalAlignment="Center"
|
||||
Foreground="{Binding status, Converter={StaticResource statusToColorBrushConverter}}"
|
||||
Text="{Binding status}" />
|
||||
</Grid>
|
||||
<DataTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter TargetName="btnDeleteItem" Property="Visibility" Value="Visible" />
|
||||
</Trigger>
|
||||
</DataTemplate.Triggers>
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
<!--<TextBlock Text="选择买手" Grid.Column="12" Margin="12,0,0,0" VerticalAlignment="Center" IsHitTestVisible="False" Foreground="LightGray"
|
||||
Visibility="{Binding ElementName=cmbBuyer,Path=Text,Converter={StaticResource NotHasTextVisibility}}"></TextBlock>-->
|
||||
<Button
|
||||
x:Name="btnLoginPdd"
|
||||
Grid.Column="2"
|
||||
Width="56"
|
||||
Height="24"
|
||||
Margin="4,0,0,0"
|
||||
Click="btnLoginPdd_Click"
|
||||
Content="多多登录"
|
||||
Style="{StaticResource BasePageButtonStyle}" />
|
||||
</WrapPanel>
|
||||
|
||||
<WrapPanel
|
||||
x:Name="wpTaobaoBuyer"
|
||||
d:Visibility="Visible"
|
||||
Visibility="Visible">
|
||||
|
||||
<Image
|
||||
x:Name="imgTb"
|
||||
Width="24"
|
||||
Height="24"
|
||||
Margin="4,0,0,0"
|
||||
Cursor="Hand"
|
||||
MouseLeftButtonUp="imgTb_MouseLeftButtonUp"
|
||||
Source="{StaticResource imgBuyerOrder}" />
|
||||
|
||||
<CheckBox
|
||||
x:Name="chkTbBuyerLogin"
|
||||
Margin="2,2,2,2"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
VerticalContentAlignment="Center"
|
||||
BorderBrush="{StaticResource mainColorBrush}"
|
||||
Click="chkBuyerLogin_Click"
|
||||
FontSize="12"
|
||||
IsChecked="False" />
|
||||
<ComboBox
|
||||
x:Name="cmbTaobaoBuyer"
|
||||
Grid.Column="1"
|
||||
Width="180"
|
||||
Height="24"
|
||||
Margin="0,0,0,0"
|
||||
VerticalContentAlignment="Center"
|
||||
MouseLeftButtonUp="cmbTaobao_MouseLeftButtonUp"
|
||||
SelectedIndex="0"
|
||||
SelectionChanged="cmbTaobao_SelectionChanged"
|
||||
Style="{StaticResource RoundedComboBox}">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<!--<Grid HorizontalAlignment="Stretch" MinWidth="{Binding RelativeSource={RelativeSource Self}, Path=ActualWidth}">-->
|
||||
<Grid
|
||||
Height="auto"
|
||||
MinWidth="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type ComboBox}}, Path=ActualWidth, Converter={StaticResource ValueMinus24Converter}}"
|
||||
HorizontalAlignment="Stretch">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="120*" />
|
||||
<ColumnDefinition Width="auto" />
|
||||
<ColumnDefinition Width="auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock
|
||||
x:Name="tbName"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding buyer_nick}" />
|
||||
<userctrls:UcImageButton
|
||||
x:Name="btnDeleteItem"
|
||||
Grid.Column="0"
|
||||
Width="15"
|
||||
Height="15"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
ButtonImage="{StaticResource imgCloseGray}"
|
||||
Click="btnDeleteTaobaoItem_Click"
|
||||
Cursor="Hand"
|
||||
MouseOverButtonImage="{StaticResource imgCloseGray}"
|
||||
MousePressButtonImage="{StaticResource imgCloseGray}"
|
||||
Tag="{Binding ElementName=tbName, Path=Text}"
|
||||
Visibility="Collapsed" />
|
||||
<TextBlock
|
||||
x:Name="tbStatus"
|
||||
Grid.Column="2"
|
||||
VerticalAlignment="Center"
|
||||
Foreground="{Binding status, Converter={StaticResource statusToColorBrushConverter}}"
|
||||
Text="{Binding status}" />
|
||||
</Grid>
|
||||
<DataTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter TargetName="btnDeleteItem" Property="Visibility" Value="Visible" />
|
||||
</Trigger>
|
||||
</DataTemplate.Triggers>
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
<!--<TextBlock Text="选择买手" Grid.Column="12" Margin="12,0,0,0" VerticalAlignment="Center" IsHitTestVisible="False" Foreground="LightGray"
|
||||
Visibility="{Binding ElementName=cmbBuyer,Path=Text,Converter={StaticResource NotHasTextVisibility}}"></TextBlock>-->
|
||||
<Button
|
||||
x:Name="btnLoginTaobao"
|
||||
Grid.Column="2"
|
||||
Width="56"
|
||||
Height="24"
|
||||
Margin="4,0,0,0"
|
||||
Click="btnLoginTaobao_Click"
|
||||
Content="淘宝登录"
|
||||
Style="{StaticResource BasePageButtonStyle}" />
|
||||
</WrapPanel>
|
||||
</wpf:SpacingStackPanel>
|
||||
<Button
|
||||
x:Name="btnSwitch"
|
||||
Grid.Column="2"
|
||||
Width="24"
|
||||
Height="24"
|
||||
Margin="4,0,0,0"
|
||||
c:DebugVisibility.Enable="True"
|
||||
d:Visibility="Visible"
|
||||
Click="btnSwitch_Click"
|
||||
Style="{StaticResource BasePageButtonStyle}"
|
||||
Visibility="Collapsed">
|
||||
<TextBlock
|
||||
Grid.Column="2"
|
||||
Margin="0,0,0,1"
|
||||
d:Visibility="Visible"
|
||||
FontSize="18"
|
||||
Foreground="{StaticResource mainColorLightBrush}"
|
||||
IsHitTestVisible="False"
|
||||
Style="{StaticResource TextBlockIcon}"
|
||||
Text="{StaticResource txt-arrow_sync_circle}" />
|
||||
</Button>
|
||||
<!-- Text="{StaticResource txt-arrow_clockwise}" -->
|
||||
<!--<Image
|
||||
x:Name="切换"
|
||||
Grid.Column="2"
|
||||
Width="24"
|
||||
Height="24"
|
||||
Margin="4,0,0,0"
|
||||
c:DebugVisibility.Enable="True"
|
||||
Cursor="Hand"
|
||||
Source="{StaticResource imgBuyerOrder}" />-->
|
||||
</Grid>
|
||||
<UserControl x:Class="_29WxOrderWpf.Ctrls.BuyerCtrls.PDDBuyerSelectCtrl"
|
||||
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:_29WxOrderWpf.Ctrls.BuyerCtrls" xmlns:userctrls="clr-namespace:_29WxOrderWpf.UserControls"
|
||||
mc:Ignorable="d" Loaded="UserControl_Loaded"
|
||||
d:DesignHeight="30" d:DesignWidth="300">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto"></ColumnDefinition>
|
||||
<ColumnDefinition Width="*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="auto"></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Image Margin="4,0,0,0" Width="24" Height="24" Source="{StaticResource imgBuyerOrder}" MouseLeftButtonUp="Image_MouseLeftButtonUp" Cursor="Hand"></Image>
|
||||
<ComboBox Grid.Column="1" x:Name="cmbPddBuyer" Margin="8,0,0,0" VerticalContentAlignment="Center" Style="{StaticResource RoundedComboBox}" Height="24"
|
||||
MouseLeftButtonUp="cmbPddBuyer_MouseLeftButtonUp" SelectionChanged="cmbPddBuyer_SelectionChanged" SelectedIndex="0">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<!--<Grid HorizontalAlignment="Stretch" MinWidth="{Binding RelativeSource={RelativeSource Self}, Path=ActualWidth}">-->
|
||||
<Grid HorizontalAlignment="Stretch" MinWidth="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type ComboBox}},
|
||||
Path=ActualWidth, Converter={StaticResource ValueMinus24Converter}}" Height="auto">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="120*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="auto"></ColumnDefinition>
|
||||
<ColumnDefinition Width="auto"></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock x:Name="tbName" Text="{Binding buyer_nick}" VerticalAlignment="Center"/>
|
||||
<userctrls:UcImageButton Width="15" Height="15" ButtonImage="{StaticResource imgCloseGray}" BorderThickness="0" Cursor="Hand" Grid.Column="0" Visibility="Collapsed"
|
||||
MouseOverButtonImage="{StaticResource imgCloseGray}" MousePressButtonImage="{StaticResource imgCloseGray}" Background="Transparent"
|
||||
x:Name="btnDeleteItem" Tag="{Binding ElementName=tbName, Path=Text}" HorizontalAlignment="Right" VerticalAlignment="Center"
|
||||
Click="btnDeleteItem_Click"/>
|
||||
<TextBlock x:Name="tbStatus" Text="{Binding status}" Foreground="{Binding status, Converter={StaticResource statusToColorBrushConverter}}" Grid.Column="2"
|
||||
VerticalAlignment="Center"/>
|
||||
</Grid>
|
||||
<DataTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter TargetName="btnDeleteItem" Property="Visibility" Value="Visible"/>
|
||||
</Trigger>
|
||||
</DataTemplate.Triggers>
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
<!--<TextBlock Text="选择买手" Grid.Column="12" Margin="12,0,0,0" VerticalAlignment="Center" IsHitTestVisible="False" Foreground="LightGray"
|
||||
Visibility="{Binding ElementName=cmbBuyer,Path=Text,Converter={StaticResource NotHasTextVisibility}}"></TextBlock>-->
|
||||
<Button Grid.Column="2" x:Name="btnLoginPdd" Style="{StaticResource BasePageButtonStyle}" Margin="4,0,0,0"
|
||||
Content="多多登录" Width="56" Height="24" Click="btnLoginPdd_Click"/>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -1,5 +1,5 @@
|
||||
using _29WxOrderWpf.BaseWindows;
|
||||
using _29WxOrderWpf.Ctrls.OrderCtrls;
|
||||
using _29WxOrderWpf.Common;
|
||||
using _29WxOrderWpf.ViewModels;
|
||||
using _29WxOrderWpf.Views;
|
||||
using AllBase;
|
||||
@@ -24,7 +24,6 @@ using System.Windows.Shapes;
|
||||
using TemuKJD.ToolForms;
|
||||
using Work;
|
||||
using Work.BaseForms;
|
||||
using WxOrder.Framework.Commons;
|
||||
|
||||
namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
||||
{
|
||||
@@ -41,7 +40,6 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
||||
private void UserControl_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
cmbPddBuyer.ItemsSource = GlobalConfig.PDDBuyerLoginList;
|
||||
cmbTaobaoBuyer.ItemsSource = GlobalConfig.TaobaoBuyerLoginList;
|
||||
}
|
||||
|
||||
private void btnLoginPdd_Click(object sender, RoutedEventArgs e)
|
||||
@@ -147,247 +145,48 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
||||
});
|
||||
}
|
||||
}
|
||||
//var pddBuyer =
|
||||
|
||||
//var ids = dgvBuyer.Rows.Cast<DataGridViewRow>().Where(r => r.Cells["colSelect"].Value.ParseToBool() == true).Select(s => s.Cells["colBuyerId"].Value.ParseToString()).ToList();
|
||||
//var buyers = GlobalConfig.PDDBuyerLoginList.Where(b => ids.Contains(b.buyer_id)).ToList();
|
||||
//this.statusBar.pgbTaskProgress.Maximum = buyers.Count;
|
||||
//pbLoading.Visible = true;
|
||||
|
||||
//Task.Run(() =>
|
||||
//{
|
||||
// int i = 0;
|
||||
// foreach (var buyer in buyers)
|
||||
// {
|
||||
// i++;
|
||||
// this.Invoke(new Action(() =>
|
||||
// {
|
||||
// this.statusBar.lblTaskStatus.Text = "正在删除...";
|
||||
// this.statusBar.pgbTaskProgress.Value = i;
|
||||
// this.statusBar.pgbTaskProgress.Text = i + "/" + buyers.Count;
|
||||
// }));
|
||||
|
||||
|
||||
|
||||
// Thread.Sleep(100);
|
||||
// }
|
||||
// this.Invoke(new Action(() =>
|
||||
// {
|
||||
// this.statusBar.lblTaskStatus.Text = "删除完成";
|
||||
// this.statusBar.pgbTaskProgress.Value = buyers.Count;
|
||||
// this.statusBar.pgbTaskProgress.Text = buyers.Count + "/" + buyers.Count;
|
||||
// }));
|
||||
// GetPddBuyer();
|
||||
//});
|
||||
}
|
||||
|
||||
int buyZIndex = 2;
|
||||
private void Image_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (MainWindow.Instance.gridTbBuyerOrderReadCtrl.Visibility != Visibility.Visible)
|
||||
MainWindow.Instance.gridTbBuyerOrderReadCtrl.Visibility = Visibility.Visible;
|
||||
if (Panel.GetZIndex(MainWindow.Instance.gridTbBuyerOrderReadCtrl) < 1)
|
||||
Panel.SetZIndex(MainWindow.Instance.gridTbBuyerOrderReadCtrl, 1);
|
||||
if (MainWindow.Instance.gridPddBuyerOrderReadCtrl.Visibility != Visibility.Visible)
|
||||
MainWindow.Instance.gridPddBuyerOrderReadCtrl.Visibility = Visibility.Visible;
|
||||
if (Panel.GetZIndex(MainWindow.Instance.gridPddBuyerOrderReadCtrl) < 1)
|
||||
Panel.SetZIndex(MainWindow.Instance.gridPddBuyerOrderReadCtrl, 1);
|
||||
else
|
||||
Panel.SetZIndex(MainWindow.Instance.gridTbBuyerOrderReadCtrl, -1);
|
||||
|
||||
Panel.SetZIndex(MainWindow.Instance.pddBuyerOrderReadCtrl, buyZIndex++);
|
||||
MainWindow.Instance.pddBuyerOrderReadCtrl.Visibility = Visibility.Visible;
|
||||
MainWindow.Instance.tbBuyerOrderReadCtrl.Visibility = Visibility.Visible;
|
||||
|
||||
//if (/*wpPddBuyer.Visibility == Visibility.Visible*/ chkPddBuyerLogin.IsChecked == true)
|
||||
//{
|
||||
// if (MainWindow.Instance.gridTbBuyerOrderReadCtrl.Visibility != Visibility.Visible)
|
||||
// MainWindow.Instance.gridTbBuyerOrderReadCtrl.Visibility = Visibility.Visible;
|
||||
// if (Panel.GetZIndex(MainWindow.Instance.gridTbBuyerOrderReadCtrl) < 1)
|
||||
// Panel.SetZIndex(MainWindow.Instance.gridTbBuyerOrderReadCtrl, 1);
|
||||
// else
|
||||
// Panel.SetZIndex(MainWindow.Instance.gridTbBuyerOrderReadCtrl, -1);
|
||||
|
||||
// Panel.SetZIndex(MainWindow.Instance.pddBuyerOrderReadCtrl, buyZIndex++);
|
||||
// MainWindow.Instance.pddBuyerOrderReadCtrl.Visibility = Visibility.Visible;
|
||||
// MainWindow.Instance.tbBuyerOrderReadCtrl.Visibility = Visibility.Visible;
|
||||
//}
|
||||
//else if (/*wpTaobaoBuyer.Visibility == Visibility.Visible*/ chkTbBuyerLogin.IsChecked == true)
|
||||
//{
|
||||
// if (MainWindow.Instance.gridTbBuyerOrderReadCtrl.Visibility != Visibility.Visible)
|
||||
// MainWindow.Instance.gridTbBuyerOrderReadCtrl.Visibility = Visibility.Visible;
|
||||
// if (Panel.GetZIndex(MainWindow.Instance.gridTbBuyerOrderReadCtrl) < 1)
|
||||
// Panel.SetZIndex(MainWindow.Instance.gridTbBuyerOrderReadCtrl, 1);
|
||||
// else
|
||||
// Panel.SetZIndex(MainWindow.Instance.gridTbBuyerOrderReadCtrl, -1);
|
||||
|
||||
// Panel.SetZIndex(MainWindow.Instance.tbBuyerOrderReadCtrl, buyZIndex++);
|
||||
// MainWindow.Instance.pddBuyerOrderReadCtrl.Visibility = Visibility.Visible;
|
||||
// MainWindow.Instance.tbBuyerOrderReadCtrl.Visibility = Visibility.Visible;
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// Panel.SetZIndex(MainWindow.Instance.gridTbBuyerOrderReadCtrl, -1);
|
||||
//}
|
||||
|
||||
}
|
||||
|
||||
private void btnSwitch_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (wpPddBuyer.Visibility == Visibility.Visible)
|
||||
{
|
||||
wpPddBuyer.Visibility = Visibility.Collapsed;
|
||||
wpTaobaoBuyer.Visibility = Visibility.Visible;
|
||||
GlobalConfig.CurrentBuyPlatform = "tb";
|
||||
foreach (var order in GlobalConfig.lstOrder)
|
||||
{
|
||||
//OrderListCtrl.InitOrderObservableProp(order);
|
||||
foreach (var orderItem in order.orderItems)
|
||||
{
|
||||
orderItem.UpdateOrderItemBuyButton();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
wpPddBuyer.Visibility = Visibility.Visible;
|
||||
wpTaobaoBuyer.Visibility = Visibility.Collapsed;
|
||||
GlobalConfig.CurrentBuyPlatform = "pdd";
|
||||
foreach (var order in GlobalConfig.lstOrder)
|
||||
{
|
||||
//OrderListCtrl.InitOrderObservableProp(order);
|
||||
foreach (var orderItem in order.orderItems)
|
||||
{
|
||||
orderItem.UpdateOrderItemBuyButton();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void btnLoginTaobao_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
BuyerLoginInfo buyer = null;
|
||||
if (cmbTaobaoBuyer.SelectedItem != null)
|
||||
{
|
||||
buyer = cmbTaobaoBuyer.SelectedItem as BuyerLoginInfo;
|
||||
}
|
||||
|
||||
TaobaoLoginView taobaoBuyerForm = new TaobaoLoginView(buyer);
|
||||
taobaoBuyerForm.ViewModel.OpenType = EnumOpenType.login;
|
||||
taobaoBuyerForm.ViewModel.InitUrl = "https://login.taobao.com/havanaone/login/login.htm";
|
||||
new DialogWindow()
|
||||
{
|
||||
Title = "淘宝买手登录",
|
||||
Content = taobaoBuyerForm,
|
||||
}.ShowDialog();
|
||||
|
||||
MainWindow.Instance.GetTaobaoBuyer();
|
||||
|
||||
}
|
||||
|
||||
private void cmbTaobao_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
BuyerLoginInfo buyer = null;
|
||||
if (cmbTaobaoBuyer.SelectedItem != null)
|
||||
{
|
||||
buyer = cmbTaobaoBuyer.SelectedItem as BuyerLoginInfo;
|
||||
}
|
||||
GlobalConfig.CurrentTaobaoBuyer = buyer;
|
||||
}
|
||||
|
||||
private void cmbTaobao_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (e.GetPosition(sender as IInputElement).X > cmbTaobaoBuyer.ActualWidth - 18)
|
||||
return;
|
||||
|
||||
BuyerLoginInfo buyer = null;
|
||||
if (cmbTaobaoBuyer.SelectedItem != null)
|
||||
{
|
||||
buyer = cmbTaobaoBuyer.SelectedItem as BuyerLoginInfo;
|
||||
}
|
||||
if (buyer == null)
|
||||
return;
|
||||
|
||||
bool islogin = false;
|
||||
//TaobaoBuyOrderViewModel.CheckBuyerLogin(new List<BuyerLoginInfo> { buyer }, false);
|
||||
TaobaoLoginView buyerLoginForm = new TaobaoLoginView(buyer);
|
||||
if (buyer.status == "在线")
|
||||
{
|
||||
buyerLoginForm.ViewModel.OpenType = EnumOpenType.manage;
|
||||
buyerLoginForm.ViewModel.InitUrl = "https://buyertrade.taobao.com/trade/itemlist/list_bought_items.htm?";
|
||||
|
||||
new DialogWindow()
|
||||
{
|
||||
Width = 1280,
|
||||
Height = 800,
|
||||
Title = "买手主页",
|
||||
Content = buyerLoginForm,
|
||||
}.Show();
|
||||
}
|
||||
else
|
||||
{
|
||||
buyerLoginForm.ViewModel.OpenType = EnumOpenType.login;
|
||||
buyerLoginForm.ViewModel.InitUrl = "https://login.taobao.com/havanaone/login/login.htm";
|
||||
|
||||
new DialogWindow()
|
||||
{
|
||||
Width = 1280,
|
||||
Height = 800,
|
||||
Title = "买手登录",
|
||||
Content = buyerLoginForm,
|
||||
}.ShowDialog();
|
||||
}
|
||||
if (islogin)
|
||||
MainWindow.Instance.GetTaobaoBuyer();
|
||||
}
|
||||
|
||||
private void btnDeleteTaobaoItem_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (BaseMsgWindow.ShowConfirm("确定删除吗?删除后不可恢复!").DialogResult != true)
|
||||
return;
|
||||
|
||||
if (sender is Button btn)
|
||||
{
|
||||
if (btn.DataContext is BuyerLoginInfo buyer)
|
||||
{
|
||||
Task.Run(() =>
|
||||
{
|
||||
var url = BaseClass.Build29WxObjString("user/del_taobao_buyer");
|
||||
var data = UserLogin.GetSignaturex()
|
||||
+ "&buyer_id=" + buyer.buyer_id;
|
||||
var result = GetHtml.PostUtf8(url, data);
|
||||
if (result.Contains("\"code\":200"))
|
||||
{
|
||||
Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
GlobalConfig.TaobaoBuyerLoginList.Remove(buyer);
|
||||
this.cmbPddBuyer.SelectedIndex = 0;
|
||||
}));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private async void chkBuyerLogin_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
if (sender == chkPddBuyerLogin)
|
||||
{
|
||||
chkPddBuyerLogin.IsChecked = true;
|
||||
chkTbBuyerLogin.IsChecked = false;
|
||||
|
||||
GlobalConfig.CurrentBuyPlatform = "pdd";
|
||||
foreach (var order in GlobalConfig.lstOrder)
|
||||
{
|
||||
//OrderListCtrl.InitOrderObservableProp(order);
|
||||
foreach (var orderItem in order.orderItems)
|
||||
{
|
||||
await Task.Run(() =>
|
||||
{
|
||||
orderItem.UpdateOrderItemBuyButton();
|
||||
orderItem.SetAbnormalAndDirectBtnVisibility();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
chkPddBuyerLogin.IsChecked = false;
|
||||
chkTbBuyerLogin.IsChecked = true;
|
||||
|
||||
GlobalConfig.CurrentBuyPlatform = "tb";
|
||||
foreach (var order in GlobalConfig.lstOrder)
|
||||
{
|
||||
//OrderListCtrl.InitOrderObservableProp(order);
|
||||
foreach (var orderItem in order.orderItems)
|
||||
{
|
||||
await Task.Run(() =>
|
||||
{
|
||||
orderItem.UpdateOrderItemBuyButton();
|
||||
orderItem.SetAbnormalAndDirectBtnVisibility();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void imgTb_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (MainWindow.Instance.gridTbBuyerOrderReadCtrl.Visibility != Visibility.Visible)
|
||||
MainWindow.Instance.gridTbBuyerOrderReadCtrl.Visibility = Visibility.Visible;
|
||||
if (Panel.GetZIndex(MainWindow.Instance.gridTbBuyerOrderReadCtrl) < 1)
|
||||
Panel.SetZIndex(MainWindow.Instance.gridTbBuyerOrderReadCtrl, 1);
|
||||
else
|
||||
Panel.SetZIndex(MainWindow.Instance.gridTbBuyerOrderReadCtrl, -1);
|
||||
|
||||
Panel.SetZIndex(MainWindow.Instance.tbBuyerOrderReadCtrl, buyZIndex++);
|
||||
MainWindow.Instance.pddBuyerOrderReadCtrl.Visibility = Visibility.Visible;
|
||||
MainWindow.Instance.tbBuyerOrderReadCtrl.Visibility = Visibility.Visible;
|
||||
Panel.SetZIndex(MainWindow.Instance.gridPddBuyerOrderReadCtrl, -1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,735 +0,0 @@
|
||||
<UserControl
|
||||
x:Class="_29WxOrderWpf.Ctrls.BuyerCtrls.PDDMultiBuyerOrderReadCtrl"
|
||||
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:local="clr-namespace:_29WxOrderWpf.Ctrls.BuyerCtrls"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
x:Name="pddMultiBuyerOrderReadCtrl"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="1000"
|
||||
Loaded="UserControl_Loaded"
|
||||
mc:Ignorable="d">
|
||||
<Border
|
||||
Background="White"
|
||||
BorderBrush="{StaticResource pageColorBrush}"
|
||||
BorderThickness="1,1,0,1"
|
||||
CornerRadius="5,0,0,5">
|
||||
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="40" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<Button
|
||||
x:Name="btnHideAll"
|
||||
Grid.Row="1"
|
||||
Width="25"
|
||||
Height="60"
|
||||
Margin="-20,0,0,20"
|
||||
HorizontalAlignment="left"
|
||||
Click="btnHideAll_Click"
|
||||
Style="{StaticResource BasePageButtonStyle}">
|
||||
<TextBlock Margin="0,0,5,0">
|
||||
关<LineBreak />
|
||||
闭</TextBlock>
|
||||
</Button>
|
||||
<Grid Margin="0,0,0,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto" />
|
||||
<ColumnDefinition Width="auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Image
|
||||
Width="16"
|
||||
Height="16"
|
||||
Margin="12,0,4,0"
|
||||
Cursor="Hand"
|
||||
MouseLeftButtonUp="btnHideAll_Click"
|
||||
Source="{StaticResource imgCloseGray}"
|
||||
Visibility="Collapsed" />
|
||||
<WrapPanel Grid.Column="1" VerticalAlignment="Center">
|
||||
|
||||
<CheckBox
|
||||
x:Name="chkAutoReadBuyerOrder"
|
||||
Margin="6,0"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
BorderBrush="{StaticResource mainColorBrush}"
|
||||
Checked="chkAutoReadBuyerOrder_CheckedChanged"
|
||||
Content="自动读多多买手单"
|
||||
FontSize="12"
|
||||
IsChecked="true"
|
||||
Unchecked="chkAutoReadBuyerOrder_CheckedChanged" />
|
||||
|
||||
<CheckBox
|
||||
x:Name="chkHideNoWxIdOrder"
|
||||
Margin="6,0"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
BorderBrush="{StaticResource mainColorBrush}"
|
||||
Checked="chkHideNoWxIdOrder_CheckedChanged"
|
||||
Content="隐藏无微信订单的买手单"
|
||||
FontSize="12"
|
||||
IsChecked="True"
|
||||
Unchecked="chkHideNoWxIdOrder_CheckedChanged" />
|
||||
<CheckBox
|
||||
x:Name="chkAutoAfterSale"
|
||||
Margin="6,0"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
BorderBrush="{StaticResource mainColorBrush}"
|
||||
Checked="chkAutoAfterSale_Checked"
|
||||
Content="未发货订单自动售后"
|
||||
FontSize="12"
|
||||
IsChecked="True"
|
||||
Unchecked="chkAutoAfterSale_Checked"
|
||||
Visibility="Visible" />
|
||||
<Button
|
||||
x:Name="btnSearch"
|
||||
Grid.Column="8"
|
||||
Width="118"
|
||||
Height="24"
|
||||
Margin="4,0,0,0"
|
||||
Click="btnSearch_Click"
|
||||
Content="刷新订单"
|
||||
Style="{StaticResource BasePageButtonStyle}" />
|
||||
<Button
|
||||
x:Name="btnNextBuyer"
|
||||
Grid.Column="8"
|
||||
Height="24"
|
||||
Margin="4,0,0,0"
|
||||
Padding="4,0"
|
||||
Click="btnNextBuyer_Click"
|
||||
Content="下一个买手"
|
||||
Style="{StaticResource BasePageButtonStyle}" />
|
||||
</WrapPanel>
|
||||
|
||||
<TextBox
|
||||
x:Name="txtFilter"
|
||||
Grid.Column="2"
|
||||
Height="28"
|
||||
Margin="28,0,8,0"
|
||||
VerticalContentAlignment="Center"
|
||||
BorderBrush="{StaticResource pageColorBrush}"
|
||||
BorderThickness="1"
|
||||
Style="{StaticResource BaseRoundCornerTextBoxStyle}"
|
||||
TextChanged="txtFilter_TextChanged" />
|
||||
<Button
|
||||
x:Name="btnFilter"
|
||||
Grid.Column="3"
|
||||
Width="50"
|
||||
Height="24"
|
||||
Margin="4,0,8,0"
|
||||
Click="btnFilter_Click"
|
||||
Content="过滤"
|
||||
Style="{StaticResource BasePageButtonStyle}" />
|
||||
</Grid>
|
||||
<Grid
|
||||
x:Name="GridCef"
|
||||
Grid.Row="1"
|
||||
Background="LightGray" />
|
||||
<Grid
|
||||
Grid.Row="1"
|
||||
Margin="2,2,0,334"
|
||||
HorizontalAlignment="Left">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto" />
|
||||
<ColumnDefinition Width="auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Border
|
||||
x:Name="borderPddBuyer"
|
||||
Width="138"
|
||||
Background="White"
|
||||
CornerRadius="0,4,4,0">
|
||||
<Grid>
|
||||
<ListBox x:Name="lbPddBuyer">
|
||||
<!-- 使用自定义属性模板去除ListBox高亮显示框 -->
|
||||
<ListBox.ItemContainerStyle>
|
||||
<Style TargetType="ListBoxItem">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ListBoxItem">
|
||||
<ContentPresenter
|
||||
Content="{TemplateBinding Content}"
|
||||
ContentStringFormat="{TemplateBinding ContentStringFormat}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}" />
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</ListBox.ItemContainerStyle>
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<!--<local:ShopListRowCtrl></local:ShopListRowCtrl>-->
|
||||
<Border
|
||||
MinHeight="50"
|
||||
Margin="0,0,0,0"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"
|
||||
BorderBrush="{StaticResource ListRowBorderColorBrush}"
|
||||
BorderThickness="0,0,0,1"
|
||||
CornerRadius="0">
|
||||
<Border.Style>
|
||||
<!-- 鼠标进入或悬停Border时切换颜色(悬停时Border的填充控件必须有填充Border,所在层级不限,仅填充透明Grid则触发器无效) -->
|
||||
<Style TargetType="Border">
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="Background" Value="{StaticResource ListRowHoverBackColorBrush}" />
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Border.Style>
|
||||
|
||||
<Grid x:Name="gridListItem">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition x:Name="colCheck" Width="25*" />
|
||||
<ColumnDefinition x:Name="colBuyerName" Width="100*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<CheckBox
|
||||
Grid.Column="0"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Background="Transparent"
|
||||
Click="CheckBox_Click"
|
||||
IsChecked="{Binding IsSelect, Mode=TwoWay}" />
|
||||
<TextBox
|
||||
x:Name="txtBuyerNick"
|
||||
Grid.Column="1"
|
||||
HorizontalContentAlignment="Left"
|
||||
VerticalContentAlignment="Center"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
Cursor="Hand"
|
||||
IsReadOnly="True"
|
||||
Loaded="txtBuyerNick_Loaded"
|
||||
Text="{Binding buyer_nick}"
|
||||
TextWrapping="Wrap" />
|
||||
</Grid>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
</Grid>
|
||||
</Border>
|
||||
<Border
|
||||
Grid.Column="1"
|
||||
Height="60"
|
||||
Margin="-2,0,0,0"
|
||||
VerticalAlignment="Center"
|
||||
Panel.ZIndex="-1"
|
||||
Background="{StaticResource pageColorBrush}"
|
||||
CornerRadius="0,5,5,0"
|
||||
Cursor="Hand">
|
||||
<Button
|
||||
x:Name="btnHideBuyer"
|
||||
Grid.Column="1"
|
||||
Width="20"
|
||||
Height="60"
|
||||
Margin="0,0,0,0"
|
||||
Padding="0,0,0,0"
|
||||
VerticalContentAlignment="Center"
|
||||
Click="btnHideBuyer_Click"
|
||||
Content="◀"
|
||||
Style="{StaticResource BasePageButtonStyle}" />
|
||||
</Border>
|
||||
</Grid>
|
||||
<Grid
|
||||
Grid.Row="1"
|
||||
Margin="0"
|
||||
VerticalAlignment="Bottom"
|
||||
Background="Transparent"
|
||||
Visibility="Visible">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto" />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Button
|
||||
x:Name="btnHide"
|
||||
Width="60"
|
||||
Height="25"
|
||||
Margin="0,0,0,-10"
|
||||
Padding="0,2,0,0"
|
||||
VerticalContentAlignment="top"
|
||||
Click="btnHide_Click"
|
||||
Content="▼"
|
||||
Style="{StaticResource BasePageButtonStyle}" />
|
||||
<Grid
|
||||
x:Name="gridTable"
|
||||
Grid.Row="1"
|
||||
Height="330"
|
||||
Margin="2"
|
||||
VerticalAlignment="Bottom"
|
||||
Background="White"
|
||||
Visibility="Visible">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="40" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<Label
|
||||
x:Name="lblMsg"
|
||||
Margin="180,0,0,0"
|
||||
VerticalAlignment="Center"
|
||||
Panel.ZIndex="1"
|
||||
Content="正在操作:" />
|
||||
|
||||
<TabControl
|
||||
x:Name="tabOrderType"
|
||||
Grid.Row="1"
|
||||
Margin="0,-32,0,1"
|
||||
VerticalAlignment="Stretch">
|
||||
<TabControl.Resources>
|
||||
<Style TargetType="{x:Type TabControl}">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type TabControl}">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<Border
|
||||
Grid.Row="1"
|
||||
MinHeight="4"
|
||||
Background="#f8f8f9"
|
||||
BorderBrush="#e0e0e0"
|
||||
BorderThickness="1,1,1,0"
|
||||
CornerRadius="0,4,0,0">
|
||||
<ContentPresenter x:Name="PART_SelectedContentHost" ContentSource="SelectedContent" />
|
||||
</Border>
|
||||
<Border
|
||||
Margin="0,0,0,0"
|
||||
HorizontalAlignment="Left"
|
||||
Background="#e8e8e9"
|
||||
BorderBrush="#e1e1e1"
|
||||
BorderThickness="1,1,1,0"
|
||||
CornerRadius="4,4,0,0">
|
||||
<TabPanel
|
||||
x:Name="HeaderPanel"
|
||||
Background="Transparent"
|
||||
IsItemsHost="True" />
|
||||
</Border>
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
<Style TargetType="TabItem">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="TabItem">
|
||||
<Border
|
||||
Name="Border"
|
||||
Margin="-1,-2,-1,0"
|
||||
BorderThickness="1,1,1,0"
|
||||
CornerRadius="4,4,0,0">
|
||||
<ContentPresenter
|
||||
x:Name="ContentSite"
|
||||
Margin="10,5"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
ContentSource="Header" />
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsSelected" Value="True">
|
||||
<Setter TargetName="Border" Property="Background" Value="#f8f8f9" />
|
||||
<Setter TargetName="Border" Property="BorderBrush" Value="#e0e0e0" />
|
||||
<Setter TargetName="Border" Property="Margin" Value="-1,-3,-1,-1" />
|
||||
<Setter Property="Foreground" Value="{StaticResource pageColorBrush}" />
|
||||
<Setter Property="Panel.ZIndex" Value="100" />
|
||||
</Trigger>
|
||||
<Trigger Property="IsSelected" Value="False">
|
||||
<Setter TargetName="Border" Property="Background" Value="Transparent" />
|
||||
<Setter Property="Foreground" Value="#999999" />
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</TabControl.Resources>
|
||||
<TabItem Header="买手订单">
|
||||
<DataGrid
|
||||
x:Name="dgBuyerOrder"
|
||||
Grid.Row="1"
|
||||
AutoGenerateColumns="False"
|
||||
CanUserAddRows="False"
|
||||
CanUserDeleteRows="False"
|
||||
ColumnHeaderHeight="30"
|
||||
HorizontalGridLinesBrush="{StaticResource HorizontalGridLinesBrush}"
|
||||
LoadingRow="dgBuyerOrder_LoadingRow"
|
||||
RowHeaderWidth="0"
|
||||
RowHeight="50"
|
||||
SelectionChanged="dgBuyerOrder_SelectionChanged"
|
||||
VerticalGridLinesBrush="{StaticResource VerticalGridLinesBrush}">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn
|
||||
Width="40"
|
||||
Binding="{Binding Header, RelativeSource={RelativeSource AncestorType={x:Type DataGridRow}, Mode=FindAncestor}}"
|
||||
CanUserSort="False"
|
||||
Header="序列"
|
||||
IsReadOnly="True">
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextWrapping" Value="Wrap" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="Margin" Value="5" />
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn
|
||||
Width="0.6*"
|
||||
Binding="{Binding WxSendTypeStr}"
|
||||
Header="是否直发">
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextWrapping" Value="Wrap" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="Margin" Value="5" />
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn
|
||||
Width="1.5*"
|
||||
Binding="{Binding order_sn}"
|
||||
Header="拍单订单号">
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextWrapping" Value="Wrap" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="Margin" Value="5" />
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn
|
||||
Width="1.5*"
|
||||
Binding="{Binding ShopOrderIdStr}"
|
||||
Header="店铺订单号">
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextWrapping" Value="Wrap" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="Margin" Value="5" />
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn
|
||||
Width="1*"
|
||||
Binding="{Binding buyerName}"
|
||||
Header="买手名称">
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextWrapping" Value="Wrap" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="Margin" Value="5" />
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn
|
||||
Width="0.8*"
|
||||
Binding="{Binding OrderTimeStr}"
|
||||
Header="拍单时间">
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextWrapping" Value="Wrap" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="Margin" Value="5" />
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn
|
||||
Width="1.8*"
|
||||
Binding="{Binding ProdInfoStr}"
|
||||
Header="商品信息">
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextWrapping" Value="Wrap" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="Margin" Value="5" />
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn
|
||||
Width="0.8*"
|
||||
Binding="{Binding AmoutValue}"
|
||||
Header="金额">
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextWrapping" Value="Wrap" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="Margin" Value="5" />
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn
|
||||
Width="1*"
|
||||
Binding="{Binding order_status_prompt}"
|
||||
Header="订单状态">
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextWrapping" Value="Wrap" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="Margin" Value="5" />
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn
|
||||
Width="1*"
|
||||
Binding="{Binding outExpressCompanyCode}"
|
||||
Header="物流名称">
|
||||
<!-- outExpressCompanyName -->
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextWrapping" Value="Wrap" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="Margin" Value="5" />
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn
|
||||
Width="1*"
|
||||
Binding="{Binding tracking_number}"
|
||||
Header="物流单号">
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextWrapping" Value="Wrap" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="Margin" Value="5" />
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn
|
||||
Width="1*"
|
||||
Binding="{Binding sendStatus}"
|
||||
Header="订单信息">
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextWrapping" Value="Wrap" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="Margin" Value="5" />
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTemplateColumn
|
||||
x:Name="colSendBuyerOrder"
|
||||
Width="0.6*"
|
||||
Header="手动发送">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<Grid>
|
||||
|
||||
<Button
|
||||
x:Name="btnSendBuyerOrder"
|
||||
Grid.Row="2"
|
||||
Grid.Column="1"
|
||||
Margin="4,0,0,0"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Background="Transparent"
|
||||
BorderBrush="Transparent"
|
||||
Click="btnSendBuyerOrder_Click"
|
||||
Content="发送"
|
||||
Foreground="{StaticResource PageLinkBrush}"
|
||||
Visibility="{Binding TransitWarehouseIdStr, Converter={StaticResource HasTextVisibility}}" />
|
||||
<Button
|
||||
x:Name="btnSendDirectBuyerOrder"
|
||||
Grid.Row="2"
|
||||
Grid.Column="1"
|
||||
Margin="4,0,0,0"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Background="Transparent"
|
||||
BorderBrush="Transparent"
|
||||
Click="btnSendBuyerOrder_Click"
|
||||
Content="发送"
|
||||
Foreground="{StaticResource PageLinkBrush}"
|
||||
Visibility="{Binding WxSendTypeStr, Converter={StaticResource HasTextVisibility}}" />
|
||||
<!-- 直发单直发标注不为空 -->
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</TabItem>
|
||||
<TabItem Header="买手售后">
|
||||
|
||||
<DataGrid
|
||||
x:Name="dgBuyerAfterSale"
|
||||
Grid.Row="1"
|
||||
AutoGenerateColumns="False"
|
||||
CanUserAddRows="False"
|
||||
CanUserDeleteRows="False"
|
||||
ColumnHeaderHeight="30"
|
||||
HorizontalGridLinesBrush="{StaticResource HorizontalGridLinesBrush}"
|
||||
LoadingRow="dgBuyerOrder_LoadingRow"
|
||||
RowHeaderWidth="0"
|
||||
RowHeight="50"
|
||||
VerticalGridLinesBrush="{StaticResource VerticalGridLinesBrush}">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn
|
||||
Width="40"
|
||||
Binding="{Binding Header, RelativeSource={RelativeSource AncestorType={x:Type DataGridRow}, Mode=FindAncestor}}"
|
||||
CanUserSort="False"
|
||||
Header="序列"
|
||||
IsReadOnly="True">
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextWrapping" Value="Wrap" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="Margin" Value="5" />
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn
|
||||
Width="0.6*"
|
||||
Binding="{Binding WxSendTypeStr}"
|
||||
Header="是否直发">
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextWrapping" Value="Wrap" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="Margin" Value="5" />
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn
|
||||
Width="1.5*"
|
||||
Binding="{Binding afterSalesId}"
|
||||
Header="售后单号">
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextWrapping" Value="Wrap" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="Margin" Value="5" />
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn
|
||||
Width="1.5*"
|
||||
Binding="{Binding orderSn}"
|
||||
Header="拍单订单号">
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextWrapping" Value="Wrap" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="Margin" Value="5" />
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn
|
||||
Width="1.5*"
|
||||
Binding="{Binding ShopOrderIdStr}"
|
||||
Header="店铺订单号">
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextWrapping" Value="Wrap" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="Margin" Value="5" />
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn
|
||||
Width="1*"
|
||||
Binding="{Binding buyerName}"
|
||||
Header="买手名称">
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextWrapping" Value="Wrap" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="Margin" Value="5" />
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn
|
||||
Width="0.8*"
|
||||
Binding="{Binding orderDate}"
|
||||
Header="拍单日期">
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextWrapping" Value="Wrap" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="Margin" Value="5" />
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn
|
||||
Width="1.8*"
|
||||
Binding="{Binding ProdInfoStr}"
|
||||
Header="商品信息">
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextWrapping" Value="Wrap" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="Margin" Value="5" />
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn
|
||||
Width="0.8*"
|
||||
Binding="{Binding OrderAmountValue}"
|
||||
Header="订单金额">
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextWrapping" Value="Wrap" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="Margin" Value="5" />
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn
|
||||
Width="0.8*"
|
||||
Binding="{Binding RefundAmountValue}"
|
||||
Header="售后金额">
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextWrapping" Value="Wrap" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="Margin" Value="5" />
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn
|
||||
Width="1*"
|
||||
Binding="{Binding AfterSaleStatusStr}"
|
||||
Header="售后状态">
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextWrapping" Value="Wrap" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="Margin" Value="5" />
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn
|
||||
Width="1*"
|
||||
Binding="{Binding sendStatus}"
|
||||
Header="订单信息">
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextWrapping" Value="Wrap" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="Margin" Value="5" />
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<!--<DataGridTemplateColumn Width="0.6*" Header="手动发送" x:Name="colSendBuyerOrderAfterSale" >
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<Button Grid.Column="1" Grid.Row="2" x:Name="btnSendBuyerOrder" VerticalAlignment="Center" Background="Transparent" HorizontalAlignment="Center"
|
||||
Foreground="{StaticResource PageLinkBrush}" BorderBrush="Transparent" Margin="4,0,0,0" Content="发送" Click="btnSendBuyerOrder_Click"
|
||||
Visibility="{Binding TransitWarehouseIdStr, Converter={StaticResource HasTextVisibility}}"></Button>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>-->
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Border>
|
||||
</UserControl>
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,598 +0,0 @@
|
||||
<UserControl
|
||||
x:Class="_29WxOrderWpf.Ctrls.BuyerCtrls.PddBuyOrderCtrl"
|
||||
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:local="clr-namespace:_29WxOrderWpf.Ctrls.BuyerCtrls"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:uc="clr-namespace:_29WxOrderWpf.UserControls"
|
||||
xmlns:wpf="WPFCommon"
|
||||
x:Name="pddBuyOrderCtrl"
|
||||
Width="1360"
|
||||
Height="768"
|
||||
MinWidth="800"
|
||||
MinHeight="600"
|
||||
d:Height="800"
|
||||
Loaded="pddBuyOrderCtrl_Loaded"
|
||||
mc:Ignorable="d">
|
||||
<UserControl.Resources>
|
||||
<BooleanToVisibilityConverter x:Key="BoolToVis" />
|
||||
|
||||
<Style BasedOn="{StaticResource TitleContentBaseStyle}" TargetType="wpf:TitleContent">
|
||||
<Setter Property="Placement" Value="Left" />
|
||||
<Setter Property="TitleVerticalAlignment" Value="Center" />
|
||||
<Setter Property="LeftTitlePadding" Value="0,0,0,0" />
|
||||
</Style>
|
||||
<Style TargetType="wpf:SpacingStackPanel">
|
||||
<Setter Property="Margin" Value="3,0" />
|
||||
</Style>
|
||||
|
||||
</UserControl.Resources>
|
||||
<Grid Background="White">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="28" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- 地址栏 -->
|
||||
<Border
|
||||
Grid.Row="0"
|
||||
Background="White"
|
||||
BorderBrush="#E0E0E0"
|
||||
BorderThickness="0,0,0,1">
|
||||
<TextBox
|
||||
x:Name="txtAddress"
|
||||
Margin="3,2"
|
||||
VerticalContentAlignment="Center"
|
||||
BorderBrush="#D0D0D0"
|
||||
BorderThickness="1"
|
||||
KeyDown="txtAddress_KeyDown"
|
||||
Text="{Binding Address, UpdateSourceTrigger=PropertyChanged}" />
|
||||
</Border>
|
||||
|
||||
<!-- 主区域:浏览器 -->
|
||||
<Grid Grid.Row="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="auto" />
|
||||
<ColumnDefinition Width="500" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!-- 浏览器容器 -->
|
||||
<Grid
|
||||
x:Name="BrowserHost"
|
||||
Grid.Column="0"
|
||||
Background="White"
|
||||
ClipToBounds="True">
|
||||
<TextBlock
|
||||
Margin="0,-140,0,0"
|
||||
Padding="30,20"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Panel.ZIndex="99"
|
||||
d:Text="ErrorMsg"
|
||||
Background="#C0FFFFFF"
|
||||
FontSize="20"
|
||||
Foreground="Red"
|
||||
IsHitTestVisible="False"
|
||||
Text="{Binding ErrorMsg}"
|
||||
TextWrapping="Wrap"
|
||||
Visibility="{Binding ErrorMsg, Converter={StaticResource HasTextVisibility}}" />
|
||||
<TextBlock
|
||||
Margin="0,0,0,0"
|
||||
Padding="30,20"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Panel.ZIndex="99"
|
||||
d:Text="TransitErrorMsg"
|
||||
Background="#C0FFFFFF"
|
||||
FontSize="20"
|
||||
Foreground="Red"
|
||||
IsHitTestVisible="False"
|
||||
Text="{Binding TransitErrorMsg}"
|
||||
TextWrapping="Wrap"
|
||||
Visibility="{Binding TransitErrorMsg, Converter={StaticResource HasTextVisibility}}" />
|
||||
</Grid>
|
||||
<GridSplitter
|
||||
Grid.Column="1"
|
||||
Width="5"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"
|
||||
Background="#d0d0d0"
|
||||
ResizeBehavior="PreviousAndNext"
|
||||
ShowsPreview="True" />
|
||||
|
||||
<Grid Grid.Column="2">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<wpf:SpacingStackPanel
|
||||
Grid.Row="0"
|
||||
Margin="4"
|
||||
Orientation="Vertical"
|
||||
VerticalSpacing="4">
|
||||
|
||||
<Grid>
|
||||
<Image
|
||||
x:Name="imgOrderItem"
|
||||
Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
Width="100"
|
||||
Height="100"
|
||||
Margin="0,4,8,0"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Top"
|
||||
Panel.ZIndex="1"
|
||||
Cursor="Hand"
|
||||
MouseDown="imgOrderItem_MouseDown"
|
||||
Source="{Binding Img}" />
|
||||
<wpf:SpacingStackPanel
|
||||
Width="250"
|
||||
Margin="4"
|
||||
HorizontalAlignment="Right"
|
||||
Orientation="Vertical"
|
||||
VerticalSpacing="4">
|
||||
<CheckBox
|
||||
x:Name="chkDirectOrder"
|
||||
Margin="0,0,0,8"
|
||||
d:IsChecked="True"
|
||||
BorderBrush="{StaticResource mainColorBrush}"
|
||||
Content="保存地址时替换为云仓地址"
|
||||
FontSize="12" />
|
||||
<wpf:TitleContent
|
||||
Title="店铺名称:"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Top"
|
||||
TitleHorizontalAlignment="Right"
|
||||
TitleWidth="85">
|
||||
<TextBox
|
||||
x:Name="txtShopName"
|
||||
Height="20"
|
||||
BorderBrush="{StaticResource pageColorBrush}"
|
||||
BorderThickness="1"
|
||||
Style="{StaticResource BaseRoundCornerTextBoxStyle}"
|
||||
Text="{Binding txtShopNameVal}" />
|
||||
</wpf:TitleContent>
|
||||
<wpf:TitleContent
|
||||
Title="订单编号:"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Top"
|
||||
TitleHorizontalAlignment="Right"
|
||||
TitleWidth="85">
|
||||
<TextBox
|
||||
x:Name="txtOrderId"
|
||||
Height="20"
|
||||
BorderBrush="{StaticResource pageColorBrush}"
|
||||
BorderThickness="1"
|
||||
Style="{StaticResource BaseRoundCornerTextBoxStyle}"
|
||||
Text="{Binding txtOrderIdVal}" />
|
||||
</wpf:TitleContent>
|
||||
</wpf:SpacingStackPanel>
|
||||
|
||||
</Grid>
|
||||
|
||||
|
||||
<TextBlock FontSize="14" FontWeight="Bold">店铺商品信息:</TextBlock>
|
||||
<wpf:TitleContent
|
||||
x:Name="tcShopGoodsName"
|
||||
Title="店铺标题:"
|
||||
TitleHorizontalAlignment="Right"
|
||||
TitleWidth="85">
|
||||
<TextBox
|
||||
x:Name="txtShopGoodsName"
|
||||
Height="20"
|
||||
BorderBrush="{StaticResource pageColorBrush}"
|
||||
BorderThickness="1"
|
||||
Style="{StaticResource BaseRoundCornerTextBoxStyle}"
|
||||
Text="{Binding txtShopGoodsNameVal}" />
|
||||
</wpf:TitleContent>
|
||||
<wpf:TitleContent
|
||||
Title="店铺规格:"
|
||||
TitleHorizontalAlignment="Right"
|
||||
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
|
||||
<TextBox
|
||||
x:Name="txtShopSpecName"
|
||||
Height="20"
|
||||
BorderBrush="{StaticResource pageColorBrush}"
|
||||
BorderThickness="1"
|
||||
Style="{StaticResource BaseRoundCornerTextBoxStyle}"
|
||||
Text="{Binding txtShopSpecNameVal}" />
|
||||
</wpf:TitleContent>
|
||||
<wpf:TitleContent
|
||||
Title="店铺商品ID:"
|
||||
TitleHorizontalAlignment="Right"
|
||||
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
|
||||
<TextBox
|
||||
x:Name="txtShopGoodsId"
|
||||
Height="20"
|
||||
BorderBrush="{StaticResource pageColorBrush}"
|
||||
BorderThickness="1"
|
||||
Style="{StaticResource BaseRoundCornerTextBoxStyle}"
|
||||
Text="{Binding txtShopGoodsIdVal}" />
|
||||
</wpf:TitleContent>
|
||||
<wpf:TitleContent
|
||||
Title="店铺SKUID:"
|
||||
TitleHorizontalAlignment="Right"
|
||||
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
|
||||
<TextBox
|
||||
x:Name="txtShopSkuId"
|
||||
Height="20"
|
||||
BorderBrush="{StaticResource pageColorBrush}"
|
||||
BorderThickness="1"
|
||||
Style="{StaticResource BaseRoundCornerTextBoxStyle}"
|
||||
Text="{Binding txtShopSkuIdVal}" />
|
||||
</wpf:TitleContent>
|
||||
<wpf:TitleContent
|
||||
Title="平台商品编码:"
|
||||
TitleHorizontalAlignment="Right"
|
||||
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
|
||||
<TextBox
|
||||
x:Name="txtSpuCode"
|
||||
Height="20"
|
||||
BorderBrush="{StaticResource pageColorBrush}"
|
||||
BorderThickness="1"
|
||||
Style="{StaticResource BaseRoundCornerTextBoxStyle}"
|
||||
Text="{Binding txtSpuCodeVal}" />
|
||||
</wpf:TitleContent>
|
||||
<wpf:TitleContent
|
||||
Title="平台SKU编码:"
|
||||
TitleHorizontalAlignment="Right"
|
||||
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
|
||||
<TextBox
|
||||
x:Name="txtSkuCode"
|
||||
Height="20"
|
||||
BorderBrush="{StaticResource pageColorBrush}"
|
||||
BorderThickness="1"
|
||||
Style="{StaticResource BaseRoundCornerTextBoxStyle}"
|
||||
Text="{Binding txtSkuCodeVal}" />
|
||||
</wpf:TitleContent>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1.04*" />
|
||||
<ColumnDefinition Width="0.96*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<wpf:TitleContent
|
||||
Title="数量:"
|
||||
Grid.Column="0"
|
||||
TitleHorizontalAlignment="Right"
|
||||
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
|
||||
<TextBox
|
||||
x:Name="txtShopOrderItemCnt"
|
||||
Height="22"
|
||||
BorderBrush="{StaticResource pageColorBrush}"
|
||||
BorderThickness="1"
|
||||
FontSize="15"
|
||||
FontWeight="bold"
|
||||
Foreground="Red"
|
||||
Style="{StaticResource BaseRoundCornerTextBoxStyle}"
|
||||
Text="{Binding txtShopOrderItemCntVal}" />
|
||||
</wpf:TitleContent>
|
||||
<wpf:TitleContent
|
||||
Title=" 总价:"
|
||||
Grid.Column="1"
|
||||
Margin="10,0,0,0"
|
||||
TitleHorizontalAlignment="Right">
|
||||
<TextBox
|
||||
x:Name="txtShopOrderItemPrice"
|
||||
Height="22"
|
||||
BorderBrush="{StaticResource pageColorBrush}"
|
||||
BorderThickness="1"
|
||||
FontSize="15"
|
||||
FontWeight="bold"
|
||||
Foreground="Red"
|
||||
Style="{StaticResource BaseRoundCornerTextBoxStyle}"
|
||||
Text="{Binding txtShopOrderItemPriceVal}" />
|
||||
</wpf:TitleContent>
|
||||
</Grid>
|
||||
|
||||
<wpf:SpacingStackPanel
|
||||
Grid.Row="0"
|
||||
Margin="0"
|
||||
Orientation="Vertical"
|
||||
VerticalSpacing="4"
|
||||
Visibility="{Binding BuyInfoVisivility}">
|
||||
<TextBlock
|
||||
Margin="0,4,0,0"
|
||||
FontSize="14"
|
||||
FontWeight="Bold">
|
||||
买手拍单信息:
|
||||
</TextBlock>
|
||||
<wpf:TitleContent
|
||||
Title="商品标题:"
|
||||
TitleHorizontalAlignment="Right"
|
||||
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
|
||||
<TextBox
|
||||
x:Name="txtBuyGoodsName"
|
||||
Height="20"
|
||||
BorderBrush="{StaticResource pageColorBrush}"
|
||||
BorderThickness="1"
|
||||
Style="{StaticResource BaseRoundCornerTextBoxStyle}"
|
||||
Text="{Binding txtBuyGoodsNameVal}" />
|
||||
</wpf:TitleContent>
|
||||
<wpf:TitleContent
|
||||
Title="规格名称:"
|
||||
TitleHorizontalAlignment="Right"
|
||||
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
|
||||
<TextBox
|
||||
x:Name="txtBuySkuName"
|
||||
Height="20"
|
||||
BorderBrush="{StaticResource pageColorBrush}"
|
||||
BorderThickness="1"
|
||||
Style="{StaticResource BaseRoundCornerTextBoxStyle}"
|
||||
Text="{Binding txtBuySkuNameVal}" />
|
||||
</wpf:TitleContent>
|
||||
<wpf:TitleContent
|
||||
Title="拍单商品ID:"
|
||||
TitleHorizontalAlignment="Right"
|
||||
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
|
||||
<TextBox
|
||||
x:Name="txtBuyGoodsId"
|
||||
Height="20"
|
||||
BorderBrush="{StaticResource pageColorBrush}"
|
||||
BorderThickness="1"
|
||||
Style="{StaticResource BaseRoundCornerTextBoxStyle}"
|
||||
Text="{Binding txtBuyGoodsIdVal}" />
|
||||
</wpf:TitleContent>
|
||||
<wpf:TitleContent
|
||||
Title="拍单SKUID:"
|
||||
TitleHorizontalAlignment="Right"
|
||||
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
|
||||
<TextBox
|
||||
x:Name="txtBuySkuId"
|
||||
Height="20"
|
||||
BorderBrush="{StaticResource pageColorBrush}"
|
||||
BorderThickness="1"
|
||||
Style="{StaticResource BaseRoundCornerTextBoxStyle}"
|
||||
Text="{Binding txtBuySkuIdVal}" />
|
||||
</wpf:TitleContent>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1.04*" />
|
||||
<ColumnDefinition Width="0.96*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<wpf:TitleContent
|
||||
Title="拍单数量:"
|
||||
Grid.Column="0"
|
||||
TitleHorizontalAlignment="Right"
|
||||
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
|
||||
<TextBox
|
||||
x:Name="txtBuyCnt"
|
||||
Height="22"
|
||||
BorderBrush="{StaticResource pageColorBrush}"
|
||||
BorderThickness="1"
|
||||
FontSize="15"
|
||||
FontWeight="bold"
|
||||
Foreground="Red"
|
||||
Style="{StaticResource BaseRoundCornerTextBoxStyle}"
|
||||
Text="{Binding txtBuyCntVal}" />
|
||||
</wpf:TitleContent>
|
||||
<wpf:TitleContent
|
||||
Title="拍单总价:"
|
||||
Grid.Column="1"
|
||||
Margin="10,0,0,0"
|
||||
TitleHorizontalAlignment="Right">
|
||||
<TextBox
|
||||
x:Name="txtBuyPrice"
|
||||
Height="22"
|
||||
BorderBrush="{StaticResource pageColorBrush}"
|
||||
BorderThickness="1"
|
||||
FontSize="15"
|
||||
FontWeight="bold"
|
||||
Foreground="Red"
|
||||
Style="{StaticResource BaseRoundCornerTextBoxStyle}"
|
||||
Text="{Binding txtBuyPriceVal}" />
|
||||
</wpf:TitleContent>
|
||||
</Grid>
|
||||
<wpf:TitleContent
|
||||
Title="拍单订单号:"
|
||||
TitleHorizontalAlignment="Right"
|
||||
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
|
||||
<TextBox
|
||||
x:Name="txtBuyOrderId"
|
||||
Height="20"
|
||||
BorderBrush="{StaticResource pageColorBrush}"
|
||||
BorderThickness="1"
|
||||
Style="{StaticResource BaseRoundCornerTextBoxStyle}"
|
||||
Text="{Binding txtBuyOrderIdVal}" />
|
||||
</wpf:TitleContent>
|
||||
|
||||
<wpf:TitleContent
|
||||
Title="溯源码:"
|
||||
TitleHorizontalAlignment="Right"
|
||||
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
|
||||
<TextBox
|
||||
x:Name="txtSourceCode"
|
||||
Height="20"
|
||||
Background="#DDDDDD"
|
||||
BorderBrush="#999999"
|
||||
IsEnabled="False"
|
||||
Style="{StaticResource BaseRoundCornerTextBoxStyle}"
|
||||
Text="{Binding txtSourceCodeVal}" />
|
||||
</wpf:TitleContent>
|
||||
|
||||
<wpf:TitleContent
|
||||
x:Name="tcBuyAddress"
|
||||
Title="中转地址:"
|
||||
TitleHorizontalAlignment="Right"
|
||||
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
|
||||
<TextBox
|
||||
x:Name="txtBuyTransitWarehouse"
|
||||
Height="20"
|
||||
BorderBrush="{StaticResource pageColorBrush}"
|
||||
BorderThickness="1"
|
||||
Style="{StaticResource BaseRoundCornerTextBoxStyle}"
|
||||
Text="{Binding txtBuyTransitWarehouseVal}" />
|
||||
</wpf:TitleContent>
|
||||
<Grid>
|
||||
<Button
|
||||
x:Name="btnReMap"
|
||||
Grid.Column="1"
|
||||
Height="20"
|
||||
MinWidth="48"
|
||||
Margin="0"
|
||||
Padding="4,0"
|
||||
HorizontalAlignment="Left"
|
||||
Command="{Binding ReMapCommand}"
|
||||
Content="重新关联商品"
|
||||
FontSize="12"
|
||||
Style="{StaticResource BasePageButtonLightStyle}" />
|
||||
<Button
|
||||
x:Name="btnCopyCurrentFullAddress"
|
||||
Grid.Column="1"
|
||||
Height="20"
|
||||
MinWidth="48"
|
||||
Margin="85,0,0,0"
|
||||
Padding="4,0"
|
||||
HorizontalAlignment="Left"
|
||||
Command="{Binding CopyCurrentFullAddressCommand}"
|
||||
Content="复制完整中转地址"
|
||||
FontSize="12"
|
||||
Style="{StaticResource BasePageButtonLightStyle}"
|
||||
Visibility="{Binding CurrentFullTransitAddress, Converter={StaticResource HasTextVisibility}}" />
|
||||
<Button
|
||||
x:Name="btnManualUpdateBuyOrder"
|
||||
Grid.Column="1"
|
||||
Height="20"
|
||||
MinWidth="48"
|
||||
Margin="0"
|
||||
Padding="4,0"
|
||||
HorizontalAlignment="Right"
|
||||
Command="{Binding ManualUpdateBuyOrderCommand}"
|
||||
Content="手动确认拍单"
|
||||
FontSize="12"
|
||||
Style="{StaticResource BasePageButtonStyle}" />
|
||||
</Grid>
|
||||
</wpf:SpacingStackPanel>
|
||||
</wpf:SpacingStackPanel>
|
||||
|
||||
<wpf:SpacingStackPanel
|
||||
Grid.Row="2"
|
||||
Margin="4"
|
||||
Orientation="Vertical"
|
||||
VerticalSpacing="4"
|
||||
Visibility="{Binding MapInfoVisivility}">
|
||||
<TextBlock
|
||||
Margin="0,4,0,0"
|
||||
FontSize="14"
|
||||
FontWeight="Bold">
|
||||
关联商品信息:
|
||||
</TextBlock>
|
||||
<wpf:TitleContent
|
||||
Title="商品标题:"
|
||||
TitleHorizontalAlignment="Right"
|
||||
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
|
||||
<TextBox
|
||||
x:Name="txtMapGoodsName"
|
||||
Height="20"
|
||||
BorderBrush="{StaticResource pageColorBrush}"
|
||||
BorderThickness="1"
|
||||
Style="{StaticResource BaseRoundCornerTextBoxStyle}"
|
||||
Text="{Binding txtMapGoodsNameVal}" />
|
||||
</wpf:TitleContent>
|
||||
<wpf:TitleContent
|
||||
Title="规格名称:"
|
||||
TitleHorizontalAlignment="Right"
|
||||
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
|
||||
<TextBox
|
||||
x:Name="txtMapSkuName"
|
||||
Height="20"
|
||||
BorderBrush="{StaticResource pageColorBrush}"
|
||||
BorderThickness="1"
|
||||
Style="{StaticResource BaseRoundCornerTextBoxStyle}"
|
||||
Text="{Binding txtMapSkuNameVal}" />
|
||||
</wpf:TitleContent>
|
||||
<wpf:TitleContent
|
||||
Title="关联商品ID:"
|
||||
TitleHorizontalAlignment="Right"
|
||||
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
|
||||
<TextBox
|
||||
x:Name="txtMapGoodsId"
|
||||
Height="20"
|
||||
BorderBrush="{StaticResource pageColorBrush}"
|
||||
BorderThickness="1"
|
||||
Style="{StaticResource BaseRoundCornerTextBoxStyle}"
|
||||
Text="{Binding txtMapGoodsIdVal}" />
|
||||
</wpf:TitleContent>
|
||||
<wpf:TitleContent
|
||||
Title="关联SKUID:"
|
||||
TitleHorizontalAlignment="Right"
|
||||
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
|
||||
<TextBox
|
||||
x:Name="txtMapSkuId"
|
||||
Height="20"
|
||||
BorderBrush="{StaticResource pageColorBrush}"
|
||||
BorderThickness="1"
|
||||
Style="{StaticResource BaseRoundCornerTextBoxStyle}"
|
||||
Text="{Binding txtMapSkuIdVal}" />
|
||||
</wpf:TitleContent>
|
||||
|
||||
<wpf:TitleContent
|
||||
Title="发货地:"
|
||||
TitleHorizontalAlignment="Right"
|
||||
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBox
|
||||
x:Name="txtSendProvince"
|
||||
Height="20"
|
||||
BorderBrush="{StaticResource pageColorBrush}"
|
||||
BorderThickness="1"
|
||||
Style="{StaticResource BaseRoundCornerTextBoxStyle}"
|
||||
Text="{Binding txtSendProvinceVal}" />
|
||||
<Button
|
||||
x:Name="btnManualUpdateSendProvince"
|
||||
Grid.Column="1"
|
||||
Height="20"
|
||||
MinWidth="48"
|
||||
Margin="3,0,0,0"
|
||||
Padding="4,0"
|
||||
HorizontalAlignment="Right"
|
||||
d:Opacity="0.5"
|
||||
Content="手动更新发货地"
|
||||
FontSize="12"
|
||||
Style="{StaticResource BasePageButtonStyle}" />
|
||||
</Grid>
|
||||
|
||||
</wpf:TitleContent>
|
||||
<wpf:TitleContent
|
||||
Title="中转仓:"
|
||||
TitleHorizontalAlignment="Right"
|
||||
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
|
||||
<ComboBox
|
||||
x:Name="cmbTransitWarehouse"
|
||||
Height="22"
|
||||
SelectedIndex="0"
|
||||
SelectedValue="{Binding cmbTransitWarehouseVal}"
|
||||
SelectionChanged="cmbTransitWarehouse_SelectionChanged"
|
||||
Style="{StaticResource RoundedComboBox}">
|
||||
<!--<ComboBoxItem Content="仓库地址" />-->
|
||||
</ComboBox>
|
||||
</wpf:TitleContent>
|
||||
<wpf:TitleContent
|
||||
Title=""
|
||||
TitleHorizontalAlignment="Right"
|
||||
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
|
||||
<Button
|
||||
x:Name="btnManualUpdateTransitWarehouse"
|
||||
Grid.Column="1"
|
||||
Height="20"
|
||||
MinWidth="48"
|
||||
Margin="0"
|
||||
Padding="4,0"
|
||||
HorizontalAlignment="Right"
|
||||
Command="{Binding UpdateTransitWarehouseCommand}"
|
||||
Content="确认商品关联"
|
||||
FontSize="12"
|
||||
Style="{StaticResource BasePageButtonStyle}" />
|
||||
</wpf:TitleContent>
|
||||
|
||||
</wpf:SpacingStackPanel>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -1,95 +0,0 @@
|
||||
using _29WxOrderWpf.ViewModels;
|
||||
using AllBase.Model.DBModel;
|
||||
using CefSharp.Wpf;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace _29WxOrderWpf.Ctrls.BuyerCtrls;
|
||||
|
||||
/// <summary>
|
||||
/// PddBuyOrderCtrl.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class PddBuyOrderCtrl : UserControl
|
||||
{
|
||||
|
||||
/// <summary>视图模型</summary>
|
||||
public PddBuyOrderViewModel ViewModel { get; }
|
||||
|
||||
public PddBuyOrderCtrl(BuyerLoginInfo buyerInfo, oms_wei_order_item_info orderItemInfo)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
foreach (var warehouse in TransitWarehouseData.TransitWarehouseList)
|
||||
{
|
||||
this.cmbTransitWarehouse.Items.Add(warehouse.TransName + " " + warehouse.TransFullAddress);
|
||||
}
|
||||
|
||||
ViewModel = new PddBuyOrderViewModel(buyerInfo, orderItemInfo);
|
||||
ViewModel.BrowserCreated += ViewModel_BrowserCreated;
|
||||
ViewModel.RequestClose += ViewModel_RequestClose;
|
||||
DataContext = ViewModel;
|
||||
}
|
||||
|
||||
private async void pddBuyOrderCtrl_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
//btnManualUpdateSendProvince.Visibility = Visibility.Collapsed;
|
||||
if (this.ViewModel.BuyType == "direct")
|
||||
{
|
||||
this.tcBuyAddress.Title = "拍单地址:";
|
||||
}
|
||||
|
||||
await ViewModel.Start();
|
||||
}
|
||||
private void ViewModel_BrowserCreated(ChromiumWebBrowser browser)
|
||||
{
|
||||
Grid.SetRow(browser, 0);
|
||||
Grid.SetColumn(browser, 0);
|
||||
BrowserHost.Children.Add(browser);
|
||||
}
|
||||
|
||||
private void ViewModel_RequestClose()
|
||||
{
|
||||
Window parentWindow = Window.GetWindow(this);
|
||||
if (this.IsLoaded && parentWindow != null)
|
||||
parentWindow.Close();
|
||||
}
|
||||
|
||||
private void txtAddress_KeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (e.Key == Key.Enter)
|
||||
{
|
||||
ViewModel.ReloadCommand.Execute(null);
|
||||
}
|
||||
}
|
||||
|
||||
private void cmbTransitWarehouse_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void imgOrderItem_MouseDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (imgOrderItem.Width == 100)
|
||||
{
|
||||
imgOrderItem.Width = 500;
|
||||
imgOrderItem.Height = 500;
|
||||
}
|
||||
else
|
||||
{
|
||||
imgOrderItem.Width = 100;
|
||||
imgOrderItem.Height = 100;
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -1,563 +0,0 @@
|
||||
<UserControl
|
||||
x:Class="_29WxOrderWpf.Ctrls.BuyerCtrls.TaobaoBuyOrderCtrl"
|
||||
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:local="clr-namespace:_29WxOrderWpf.Ctrls.BuyerCtrls"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:uc="clr-namespace:_29WxOrderWpf.UserControls"
|
||||
xmlns:wpf="WPFCommon"
|
||||
x:Name="taobaoBuyOrderCtrl"
|
||||
Width="1360"
|
||||
Height="768"
|
||||
MinWidth="800"
|
||||
MinHeight="600"
|
||||
d:Height="800"
|
||||
Loaded="taobaoBuyOrderCtrl_Loaded"
|
||||
mc:Ignorable="d">
|
||||
<UserControl.Resources>
|
||||
<BooleanToVisibilityConverter x:Key="BoolToVis" />
|
||||
|
||||
<Style BasedOn="{StaticResource TitleContentBaseStyle}" TargetType="wpf:TitleContent">
|
||||
<Setter Property="Placement" Value="Left" />
|
||||
<Setter Property="TitleVerticalAlignment" Value="Center" />
|
||||
<Setter Property="LeftTitlePadding" Value="0,0,0,0" />
|
||||
</Style>
|
||||
<Style TargetType="wpf:SpacingStackPanel">
|
||||
<Setter Property="Margin" Value="3,0" />
|
||||
</Style>
|
||||
|
||||
</UserControl.Resources>
|
||||
<Grid Background="White">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="28" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- 地址栏 -->
|
||||
<Border
|
||||
Grid.Row="0"
|
||||
Background="White"
|
||||
BorderBrush="#E0E0E0"
|
||||
BorderThickness="0,0,0,1">
|
||||
<TextBox
|
||||
x:Name="txtAddress"
|
||||
Margin="3,2"
|
||||
VerticalContentAlignment="Center"
|
||||
BorderBrush="#D0D0D0"
|
||||
BorderThickness="1"
|
||||
KeyDown="txtAddress_KeyDown"
|
||||
Text="{Binding Address, UpdateSourceTrigger=PropertyChanged}" />
|
||||
</Border>
|
||||
|
||||
<!-- 主区域:浏览器 -->
|
||||
<Grid Grid.Row="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="auto" />
|
||||
<ColumnDefinition Width="300" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!-- 浏览器容器 -->
|
||||
<Grid
|
||||
x:Name="BrowserHost"
|
||||
Grid.Column="0"
|
||||
Background="White"
|
||||
ClipToBounds="True">
|
||||
<TextBlock
|
||||
Margin="0,-140,0,0"
|
||||
Padding="30,20"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Panel.ZIndex="99"
|
||||
d:Text="ErrorMsg"
|
||||
Background="#C0FFFFFF"
|
||||
FontSize="20"
|
||||
Foreground="Red"
|
||||
IsHitTestVisible="False"
|
||||
Text="{Binding ErrorMsg}"
|
||||
TextWrapping="Wrap"
|
||||
Visibility="{Binding ErrorMsg, Converter={StaticResource HasTextVisibility}}" />
|
||||
<TextBlock
|
||||
Margin="0,0,0,0"
|
||||
Padding="30,20"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Panel.ZIndex="99"
|
||||
d:Text="TransitErrorMsg"
|
||||
Background="#C0FFFFFF"
|
||||
FontSize="20"
|
||||
Foreground="Red"
|
||||
IsHitTestVisible="False"
|
||||
Text="{Binding TransitErrorMsg}"
|
||||
TextWrapping="Wrap"
|
||||
Visibility="{Binding TransitErrorMsg, Converter={StaticResource HasTextVisibility}}" />
|
||||
</Grid>
|
||||
<GridSplitter
|
||||
Grid.Column="1"
|
||||
Width="5"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"
|
||||
Background="#d0d0d0"
|
||||
ResizeBehavior="PreviousAndNext"
|
||||
ShowsPreview="True" />
|
||||
|
||||
<Grid Grid.Column="2">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<wpf:SpacingStackPanel
|
||||
Grid.Row="0"
|
||||
Margin="4"
|
||||
Orientation="Vertical"
|
||||
VerticalSpacing="4">
|
||||
|
||||
<Image
|
||||
x:Name="imgOrderItem"
|
||||
Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
Width="100"
|
||||
Height="100"
|
||||
Margin="0,2,8,2"
|
||||
VerticalAlignment="Top"
|
||||
Cursor="Hand"
|
||||
MouseDown="imgOrderItem_MouseDown"
|
||||
Source="{Binding Img}" />
|
||||
|
||||
<TextBlock FontSize="14" FontWeight="Bold">店铺商品信息:</TextBlock>
|
||||
<wpf:TitleContent
|
||||
x:Name="tcShopGoodsName"
|
||||
Title="店铺标题:"
|
||||
TitleHorizontalAlignment="Right"
|
||||
TitleWidth="85">
|
||||
<TextBox
|
||||
x:Name="txtShopGoodsName"
|
||||
Height="20"
|
||||
BorderBrush="{StaticResource pageColorBrush}"
|
||||
BorderThickness="1"
|
||||
Style="{StaticResource BaseRoundCornerTextBoxStyle}"
|
||||
Text="{Binding txtShopGoodsNameVal}" />
|
||||
</wpf:TitleContent>
|
||||
<wpf:TitleContent
|
||||
Title="店铺规格:"
|
||||
TitleHorizontalAlignment="Right"
|
||||
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
|
||||
<TextBox
|
||||
x:Name="txtShopSpecName"
|
||||
Height="20"
|
||||
BorderBrush="{StaticResource pageColorBrush}"
|
||||
BorderThickness="1"
|
||||
Style="{StaticResource BaseRoundCornerTextBoxStyle}"
|
||||
Text="{Binding txtShopSpecNameVal}" />
|
||||
</wpf:TitleContent>
|
||||
<wpf:TitleContent
|
||||
Title="店铺商品ID:"
|
||||
TitleHorizontalAlignment="Right"
|
||||
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
|
||||
<TextBox
|
||||
x:Name="txtShopGoodsId"
|
||||
Height="20"
|
||||
BorderBrush="{StaticResource pageColorBrush}"
|
||||
BorderThickness="1"
|
||||
Style="{StaticResource BaseRoundCornerTextBoxStyle}"
|
||||
Text="{Binding txtShopGoodsIdVal}" />
|
||||
</wpf:TitleContent>
|
||||
<wpf:TitleContent
|
||||
Title="店铺SKUID:"
|
||||
TitleHorizontalAlignment="Right"
|
||||
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
|
||||
<TextBox
|
||||
x:Name="txtShopSkuId"
|
||||
Height="20"
|
||||
BorderBrush="{StaticResource pageColorBrush}"
|
||||
BorderThickness="1"
|
||||
Style="{StaticResource BaseRoundCornerTextBoxStyle}"
|
||||
Text="{Binding txtShopSkuIdVal}" />
|
||||
</wpf:TitleContent>
|
||||
<wpf:TitleContent
|
||||
Title="平台商品编码:"
|
||||
TitleHorizontalAlignment="Right"
|
||||
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
|
||||
<TextBox
|
||||
x:Name="txtSpuCode"
|
||||
Height="20"
|
||||
BorderBrush="{StaticResource pageColorBrush}"
|
||||
BorderThickness="1"
|
||||
Style="{StaticResource BaseRoundCornerTextBoxStyle}"
|
||||
Text="{Binding txtSpuCodeVal}" />
|
||||
</wpf:TitleContent>
|
||||
<wpf:TitleContent
|
||||
Title="平台SKU编码:"
|
||||
TitleHorizontalAlignment="Right"
|
||||
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
|
||||
<TextBox
|
||||
x:Name="txtSkuCode"
|
||||
Height="20"
|
||||
BorderBrush="{StaticResource pageColorBrush}"
|
||||
BorderThickness="1"
|
||||
Style="{StaticResource BaseRoundCornerTextBoxStyle}"
|
||||
Text="{Binding txtSkuCodeVal}" />
|
||||
</wpf:TitleContent>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1.04*" />
|
||||
<ColumnDefinition Width="0.96*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<wpf:TitleContent
|
||||
Title="数量:"
|
||||
Grid.Column="0"
|
||||
TitleHorizontalAlignment="Right"
|
||||
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
|
||||
<TextBox
|
||||
x:Name="txtShopOrderItemCnt"
|
||||
Height="22"
|
||||
BorderBrush="{StaticResource pageColorBrush}"
|
||||
BorderThickness="1"
|
||||
FontSize="15"
|
||||
FontWeight="bold"
|
||||
Foreground="Red"
|
||||
Style="{StaticResource BaseRoundCornerTextBoxStyle}"
|
||||
Text="{Binding txtShopOrderItemCntVal}" />
|
||||
</wpf:TitleContent>
|
||||
<wpf:TitleContent
|
||||
Title=" 总价:"
|
||||
Grid.Column="1"
|
||||
Margin="10,0,0,0"
|
||||
TitleHorizontalAlignment="Right">
|
||||
<TextBox
|
||||
x:Name="txtShopOrderItemPrice"
|
||||
Height="22"
|
||||
BorderBrush="{StaticResource pageColorBrush}"
|
||||
BorderThickness="1"
|
||||
FontSize="15"
|
||||
FontWeight="bold"
|
||||
Foreground="Red"
|
||||
Style="{StaticResource BaseRoundCornerTextBoxStyle}"
|
||||
Text="{Binding txtShopOrderItemPriceVal}" />
|
||||
</wpf:TitleContent>
|
||||
</Grid>
|
||||
|
||||
<wpf:SpacingStackPanel
|
||||
Grid.Row="0"
|
||||
Margin="0"
|
||||
Orientation="Vertical"
|
||||
VerticalSpacing="4"
|
||||
Visibility="{Binding BuyInfoVisivility}">
|
||||
<TextBlock
|
||||
Margin="0,4,0,0"
|
||||
FontSize="14"
|
||||
FontWeight="Bold">
|
||||
买手拍单信息:
|
||||
</TextBlock>
|
||||
<wpf:TitleContent
|
||||
Title="商品标题:"
|
||||
TitleHorizontalAlignment="Right"
|
||||
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
|
||||
<TextBox
|
||||
x:Name="txtBuyGoodsName"
|
||||
Height="20"
|
||||
BorderBrush="{StaticResource pageColorBrush}"
|
||||
BorderThickness="1"
|
||||
Style="{StaticResource BaseRoundCornerTextBoxStyle}"
|
||||
Text="{Binding txtBuyGoodsNameVal}" />
|
||||
</wpf:TitleContent>
|
||||
<wpf:TitleContent
|
||||
Title="规格名称:"
|
||||
TitleHorizontalAlignment="Right"
|
||||
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
|
||||
<TextBox
|
||||
x:Name="txtBuySkuName"
|
||||
Height="20"
|
||||
BorderBrush="{StaticResource pageColorBrush}"
|
||||
BorderThickness="1"
|
||||
Style="{StaticResource BaseRoundCornerTextBoxStyle}"
|
||||
Text="{Binding txtBuySkuNameVal}" />
|
||||
</wpf:TitleContent>
|
||||
<wpf:TitleContent
|
||||
Title="拍单商品ID:"
|
||||
TitleHorizontalAlignment="Right"
|
||||
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
|
||||
<TextBox
|
||||
x:Name="txtBuyGoodsId"
|
||||
Height="20"
|
||||
BorderBrush="{StaticResource pageColorBrush}"
|
||||
BorderThickness="1"
|
||||
Style="{StaticResource BaseRoundCornerTextBoxStyle}"
|
||||
Text="{Binding txtBuyGoodsIdVal}" />
|
||||
</wpf:TitleContent>
|
||||
<wpf:TitleContent
|
||||
Title="拍单SKUID:"
|
||||
TitleHorizontalAlignment="Right"
|
||||
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
|
||||
<TextBox
|
||||
x:Name="txtBuySkuId"
|
||||
Height="20"
|
||||
BorderBrush="{StaticResource pageColorBrush}"
|
||||
BorderThickness="1"
|
||||
Style="{StaticResource BaseRoundCornerTextBoxStyle}"
|
||||
Text="{Binding txtBuySkuIdVal}" />
|
||||
</wpf:TitleContent>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1.04*" />
|
||||
<ColumnDefinition Width="0.96*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<wpf:TitleContent
|
||||
Title="拍单数量:"
|
||||
Grid.Column="0"
|
||||
TitleHorizontalAlignment="Right"
|
||||
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
|
||||
<TextBox
|
||||
x:Name="txtBuyCnt"
|
||||
Height="22"
|
||||
BorderBrush="{StaticResource pageColorBrush}"
|
||||
BorderThickness="1"
|
||||
FontSize="15"
|
||||
FontWeight="bold"
|
||||
Foreground="Red"
|
||||
Style="{StaticResource BaseRoundCornerTextBoxStyle}"
|
||||
Text="{Binding txtBuyCntVal}" />
|
||||
</wpf:TitleContent>
|
||||
<wpf:TitleContent
|
||||
Title="拍单总价:"
|
||||
Grid.Column="1"
|
||||
Margin="10,0,0,0"
|
||||
TitleHorizontalAlignment="Right">
|
||||
<TextBox
|
||||
x:Name="txtBuyPrice"
|
||||
Height="22"
|
||||
BorderBrush="{StaticResource pageColorBrush}"
|
||||
BorderThickness="1"
|
||||
FontSize="15"
|
||||
FontWeight="bold"
|
||||
Foreground="Red"
|
||||
Style="{StaticResource BaseRoundCornerTextBoxStyle}"
|
||||
Text="{Binding txtBuyPriceVal}" />
|
||||
</wpf:TitleContent>
|
||||
</Grid>
|
||||
<wpf:TitleContent
|
||||
Title="拍单订单号:"
|
||||
TitleHorizontalAlignment="Right"
|
||||
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
|
||||
<TextBox
|
||||
x:Name="txtBuyOrderId"
|
||||
Height="20"
|
||||
BorderBrush="{StaticResource pageColorBrush}"
|
||||
BorderThickness="1"
|
||||
Style="{StaticResource BaseRoundCornerTextBoxStyle}"
|
||||
Text="{Binding txtBuyOrderIdVal}" />
|
||||
</wpf:TitleContent>
|
||||
|
||||
<wpf:TitleContent
|
||||
Title="溯源码:"
|
||||
TitleHorizontalAlignment="Right"
|
||||
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
|
||||
<TextBox
|
||||
x:Name="txtSourceCode"
|
||||
Height="20"
|
||||
Background="#DDDDDD"
|
||||
BorderBrush="#999999"
|
||||
IsEnabled="False"
|
||||
Style="{StaticResource BaseRoundCornerTextBoxStyle}"
|
||||
Text="{Binding txtSourceCodeVal}" />
|
||||
</wpf:TitleContent>
|
||||
|
||||
<wpf:TitleContent
|
||||
x:Name="tcBuyAddress"
|
||||
Title="中转地址:"
|
||||
TitleHorizontalAlignment="Right"
|
||||
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
|
||||
<TextBox
|
||||
x:Name="txtBuyTransitWarehouse"
|
||||
Height="20"
|
||||
BorderBrush="{StaticResource pageColorBrush}"
|
||||
BorderThickness="1"
|
||||
Style="{StaticResource BaseRoundCornerTextBoxStyle}"
|
||||
Text="{Binding txtBuyTransitWarehouseVal}" />
|
||||
</wpf:TitleContent>
|
||||
<Grid>
|
||||
<Button
|
||||
x:Name="btnReMap"
|
||||
Grid.Column="1"
|
||||
Height="20"
|
||||
MinWidth="48"
|
||||
Margin="0"
|
||||
Padding="4,0"
|
||||
HorizontalAlignment="Left"
|
||||
Command="{Binding ReMapCommand}"
|
||||
Content="重新关联商品"
|
||||
FontSize="12"
|
||||
Style="{StaticResource BasePageButtonLightStyle}" />
|
||||
<Button
|
||||
x:Name="btnCopyCurrentFullAddress"
|
||||
Grid.Column="1"
|
||||
Height="20"
|
||||
MinWidth="48"
|
||||
Margin="85,0,0,0"
|
||||
Padding="4,0"
|
||||
HorizontalAlignment="Left"
|
||||
Command="{Binding CopyCurrentFullAddressCommand}"
|
||||
Content="复制完整中转地址"
|
||||
FontSize="12"
|
||||
Style="{StaticResource BasePageButtonLightStyle}"
|
||||
Visibility="{Binding CurrentFullTransitAddress, Converter={StaticResource HasTextVisibility}}" />
|
||||
<Button
|
||||
x:Name="btnManualUpdateBuyOrder"
|
||||
Grid.Column="1"
|
||||
Height="20"
|
||||
MinWidth="48"
|
||||
Margin="0"
|
||||
Padding="4,0"
|
||||
HorizontalAlignment="Right"
|
||||
Command="{Binding ManualUpdateBuyOrderCommand}"
|
||||
Content="手动确认拍单"
|
||||
FontSize="12"
|
||||
Style="{StaticResource BasePageButtonStyle}" />
|
||||
</Grid>
|
||||
<TextBlock
|
||||
Width="auto"
|
||||
Padding="0,3"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Panel.ZIndex="99"
|
||||
Background="#C0FFFFFF"
|
||||
FontSize="16"
|
||||
Foreground="#EE0000"
|
||||
IsHitTestVisible="False"
|
||||
Text=" 淘宝网页跳转速度较慢,请耐心等待"
|
||||
TextWrapping="Wrap" />
|
||||
</wpf:SpacingStackPanel>
|
||||
</wpf:SpacingStackPanel>
|
||||
|
||||
<wpf:SpacingStackPanel
|
||||
Grid.Row="2"
|
||||
Margin="4"
|
||||
Orientation="Vertical"
|
||||
VerticalSpacing="4"
|
||||
Visibility="{Binding MapInfoVisivility}">
|
||||
<TextBlock
|
||||
Margin="0,4,0,0"
|
||||
FontSize="14"
|
||||
FontWeight="Bold">
|
||||
关联商品信息:
|
||||
</TextBlock>
|
||||
<wpf:TitleContent
|
||||
Title="商品标题:"
|
||||
TitleHorizontalAlignment="Right"
|
||||
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
|
||||
<TextBox
|
||||
x:Name="txtMapGoodsName"
|
||||
Height="20"
|
||||
BorderBrush="{StaticResource pageColorBrush}"
|
||||
BorderThickness="1"
|
||||
Style="{StaticResource BaseRoundCornerTextBoxStyle}"
|
||||
Text="{Binding txtMapGoodsNameVal}" />
|
||||
</wpf:TitleContent>
|
||||
<wpf:TitleContent
|
||||
Title="规格名称:"
|
||||
TitleHorizontalAlignment="Right"
|
||||
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
|
||||
<TextBox
|
||||
x:Name="txtMapSkuName"
|
||||
Height="20"
|
||||
BorderBrush="{StaticResource pageColorBrush}"
|
||||
BorderThickness="1"
|
||||
Style="{StaticResource BaseRoundCornerTextBoxStyle}"
|
||||
Text="{Binding txtMapSkuNameVal}" />
|
||||
</wpf:TitleContent>
|
||||
<wpf:TitleContent
|
||||
Title="关联商品ID:"
|
||||
TitleHorizontalAlignment="Right"
|
||||
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
|
||||
<TextBox
|
||||
x:Name="txtMapGoodsId"
|
||||
Height="20"
|
||||
BorderBrush="{StaticResource pageColorBrush}"
|
||||
BorderThickness="1"
|
||||
Style="{StaticResource BaseRoundCornerTextBoxStyle}"
|
||||
Text="{Binding txtMapGoodsIdVal}" />
|
||||
</wpf:TitleContent>
|
||||
<wpf:TitleContent
|
||||
Title="关联SKUID:"
|
||||
TitleHorizontalAlignment="Right"
|
||||
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
|
||||
<TextBox
|
||||
x:Name="txtMapSkuId"
|
||||
Height="20"
|
||||
BorderBrush="{StaticResource pageColorBrush}"
|
||||
BorderThickness="1"
|
||||
Style="{StaticResource BaseRoundCornerTextBoxStyle}"
|
||||
Text="{Binding txtMapSkuIdVal}" />
|
||||
</wpf:TitleContent>
|
||||
|
||||
<wpf:TitleContent
|
||||
Title="发货地:"
|
||||
TitleHorizontalAlignment="Right"
|
||||
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBox
|
||||
x:Name="txtSendProvince"
|
||||
Height="20"
|
||||
BorderBrush="{StaticResource pageColorBrush}"
|
||||
BorderThickness="1"
|
||||
Style="{StaticResource BaseRoundCornerTextBoxStyle}"
|
||||
Text="{Binding txtSendProvinceVal}" />
|
||||
<Button
|
||||
x:Name="btnManualUpdateSendProvince"
|
||||
Grid.Column="1"
|
||||
Height="20"
|
||||
MinWidth="48"
|
||||
Margin="3,0,0,0"
|
||||
Padding="4,0"
|
||||
HorizontalAlignment="Right"
|
||||
d:Opacity="0.5"
|
||||
Content="手动更新发货地"
|
||||
FontSize="12"
|
||||
Style="{StaticResource BasePageButtonStyle}" />
|
||||
</Grid>
|
||||
|
||||
</wpf:TitleContent>
|
||||
<wpf:TitleContent
|
||||
Title="中转仓:"
|
||||
TitleHorizontalAlignment="Right"
|
||||
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
|
||||
<ComboBox
|
||||
x:Name="cmbTransitWarehouse"
|
||||
Height="22"
|
||||
SelectedIndex="0"
|
||||
SelectedValue="{Binding cmbTransitWarehouseVal}"
|
||||
SelectionChanged="cmbTransitWarehouse_SelectionChanged"
|
||||
Style="{StaticResource RoundedComboBox}">
|
||||
<!--<ComboBoxItem Content="仓库地址" />-->
|
||||
</ComboBox>
|
||||
</wpf:TitleContent>
|
||||
<wpf:TitleContent
|
||||
Title=""
|
||||
TitleHorizontalAlignment="Right"
|
||||
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
|
||||
<Button
|
||||
x:Name="btnManualUpdateTransitWarehouse"
|
||||
Grid.Column="1"
|
||||
Height="20"
|
||||
MinWidth="48"
|
||||
Margin="0"
|
||||
Padding="4,0"
|
||||
HorizontalAlignment="Right"
|
||||
Command="{Binding UpdateTransitWarehouseCommand}"
|
||||
Content="确认商品关联"
|
||||
FontSize="12"
|
||||
Style="{StaticResource BasePageButtonStyle}" />
|
||||
</wpf:TitleContent>
|
||||
|
||||
|
||||
</wpf:SpacingStackPanel>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -1,106 +0,0 @@
|
||||
using _29WxOrderWpf.ViewModels;
|
||||
using AllBase.Model.DBModel;
|
||||
using CefSharp.Wpf;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace _29WxOrderWpf.Ctrls.BuyerCtrls;
|
||||
|
||||
/// <summary>
|
||||
/// TaobaoBuyOrderCtrl.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class TaobaoBuyOrderCtrl : UserControl
|
||||
{
|
||||
|
||||
/// <summary>视图模型</summary>
|
||||
public TaobaoBuyOrderViewModel ViewModel { get; }
|
||||
|
||||
public TaobaoBuyOrderCtrl(BuyerLoginInfo buyerInfo, oms_wei_order_item_info orderItemInfo)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
foreach (var warehouse in TransitWarehouseData.TransitWarehouseList)
|
||||
{
|
||||
this.cmbTransitWarehouse.Items.Add(warehouse.TransName + " " + warehouse.TransFullAddress);
|
||||
}
|
||||
|
||||
ViewModel = new TaobaoBuyOrderViewModel(buyerInfo, orderItemInfo);
|
||||
ViewModel.BrowserCreated += ViewModel_BrowserCreated;
|
||||
ViewModel.RequestClose += ViewModel_RequestClose;
|
||||
DataContext = ViewModel;
|
||||
}
|
||||
|
||||
private async void taobaoBuyOrderCtrl_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
btnManualUpdateSendProvince.Visibility = Visibility.Collapsed;
|
||||
if (this.ViewModel.BuyType == "direct")
|
||||
{
|
||||
this.tcBuyAddress.Title = "拍单地址:";
|
||||
}
|
||||
Window parentWindow = Window.GetWindow(this);
|
||||
if (this.IsLoaded && parentWindow != null)
|
||||
{
|
||||
parentWindow.Closed += ParentWindow_Closed;
|
||||
}
|
||||
|
||||
await ViewModel.Start();
|
||||
}
|
||||
|
||||
private void ParentWindow_Closed(object sender, EventArgs e)
|
||||
{
|
||||
ViewModel.Stop();
|
||||
}
|
||||
|
||||
private void ViewModel_BrowserCreated(ChromiumWebBrowser browser)
|
||||
{
|
||||
Grid.SetRow(browser, 0);
|
||||
Grid.SetColumn(browser, 0);
|
||||
BrowserHost.Children.Add(browser);
|
||||
}
|
||||
|
||||
private void ViewModel_RequestClose()
|
||||
{
|
||||
Window parentWindow = Window.GetWindow(this);
|
||||
if (this.IsLoaded && parentWindow != null)
|
||||
parentWindow.Close();
|
||||
}
|
||||
|
||||
private void txtAddress_KeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (e.Key == Key.Enter)
|
||||
{
|
||||
ViewModel.ReloadCommand.Execute(null);
|
||||
}
|
||||
}
|
||||
|
||||
private void cmbTransitWarehouse_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void imgOrderItem_MouseDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (imgOrderItem.Width == 100)
|
||||
{
|
||||
imgOrderItem.Width = 300;
|
||||
imgOrderItem.Height = 300;
|
||||
}
|
||||
else
|
||||
{
|
||||
imgOrderItem.Width = 100;
|
||||
imgOrderItem.Height = 100;
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,735 +0,0 @@
|
||||
<UserControl
|
||||
x:Class="_29WxOrderWpf.Ctrls.BuyerCtrls.TbBuyerOrderReadCtrl"
|
||||
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:local="clr-namespace:_29WxOrderWpf.Ctrls.BuyerCtrls"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
x:Name="tbBuyerOrderReadCtrl"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="1000"
|
||||
Loaded="UserControl_Loaded"
|
||||
mc:Ignorable="d">
|
||||
<Border
|
||||
Background="White"
|
||||
BorderBrush="{StaticResource pageColorBrush}"
|
||||
BorderThickness="1,1,0,1"
|
||||
CornerRadius="5,0,0,5">
|
||||
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="40" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<Button
|
||||
x:Name="btnHideAll"
|
||||
Grid.Row="1"
|
||||
Width="25"
|
||||
Height="60"
|
||||
Margin="-20,0,0,20"
|
||||
HorizontalAlignment="left"
|
||||
Click="btnHideAll_Click"
|
||||
Style="{StaticResource BasePageButtonStyle}">
|
||||
<TextBlock Margin="0,0,5,0">
|
||||
关<LineBreak />
|
||||
闭</TextBlock>
|
||||
</Button>
|
||||
<Grid Margin="0,0,0,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto" />
|
||||
<ColumnDefinition Width="auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Image
|
||||
Width="16"
|
||||
Height="16"
|
||||
Margin="12,0,4,0"
|
||||
Cursor="Hand"
|
||||
MouseLeftButtonUp="btnHideAll_Click"
|
||||
Source="{StaticResource imgCloseGray}"
|
||||
Visibility="Collapsed" />
|
||||
<WrapPanel Grid.Column="1" VerticalAlignment="Center">
|
||||
|
||||
<CheckBox
|
||||
x:Name="chkAutoReadBuyerOrder"
|
||||
Margin="6,0"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
BorderBrush="{StaticResource mainColorBrush}"
|
||||
Checked="chkAutoReadBuyerOrder_CheckedChanged"
|
||||
Content="自动读淘宝买手单"
|
||||
FontSize="12"
|
||||
IsChecked="true"
|
||||
Unchecked="chkAutoReadBuyerOrder_CheckedChanged" />
|
||||
|
||||
<CheckBox
|
||||
x:Name="chkHideNoWxIdOrder"
|
||||
Margin="6,0"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
BorderBrush="{StaticResource mainColorBrush}"
|
||||
Checked="chkHideNoWxIdOrder_CheckedChanged"
|
||||
Content="隐藏无微信订单的买手单"
|
||||
FontSize="12"
|
||||
IsChecked="True"
|
||||
Unchecked="chkHideNoWxIdOrder_CheckedChanged" />
|
||||
<CheckBox
|
||||
x:Name="chkAutoAfterSale"
|
||||
Margin="6,0"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
BorderBrush="{StaticResource mainColorBrush}"
|
||||
Checked="chkAutoAfterSale_Checked"
|
||||
Content="未发货订单自动售后"
|
||||
FontSize="12"
|
||||
IsChecked="True"
|
||||
Unchecked="chkAutoAfterSale_Checked"
|
||||
Visibility="Visible" />
|
||||
<Button
|
||||
x:Name="btnSearch"
|
||||
Grid.Column="8"
|
||||
Width="118"
|
||||
Height="24"
|
||||
Margin="4,0,0,0"
|
||||
Click="btnSearch_Click"
|
||||
Content="刷新订单"
|
||||
Style="{StaticResource BasePageButtonStyle}" />
|
||||
<Button
|
||||
x:Name="btnNextBuyer"
|
||||
Grid.Column="8"
|
||||
Height="24"
|
||||
Margin="4,0,0,0"
|
||||
Padding="4,0"
|
||||
Click="btnNextBuyer_Click"
|
||||
Content="下一个买手"
|
||||
Style="{StaticResource BasePageButtonStyle}" />
|
||||
</WrapPanel>
|
||||
|
||||
<TextBox
|
||||
x:Name="txtFilter"
|
||||
Grid.Column="2"
|
||||
Height="28"
|
||||
Margin="28,0,8,0"
|
||||
VerticalContentAlignment="Center"
|
||||
BorderBrush="{StaticResource pageColorBrush}"
|
||||
BorderThickness="1"
|
||||
Style="{StaticResource BaseRoundCornerTextBoxStyle}"
|
||||
TextChanged="txtFilter_TextChanged" />
|
||||
<Button
|
||||
x:Name="btnFilter"
|
||||
Grid.Column="3"
|
||||
Width="50"
|
||||
Height="24"
|
||||
Margin="4,0,8,0"
|
||||
Click="btnFilter_Click"
|
||||
Content="过滤"
|
||||
Style="{StaticResource BasePageButtonStyle}" />
|
||||
</Grid>
|
||||
<Grid
|
||||
x:Name="GridCef"
|
||||
Grid.Row="1"
|
||||
Background="LightGray" />
|
||||
<Grid
|
||||
Grid.Row="1"
|
||||
Margin="2,2,0,334"
|
||||
HorizontalAlignment="Left">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto" />
|
||||
<ColumnDefinition Width="auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Border
|
||||
x:Name="borderTbBuyer"
|
||||
Width="138"
|
||||
Background="White"
|
||||
CornerRadius="0,4,4,0">
|
||||
<Grid>
|
||||
<ListBox x:Name="lbTbBuyer">
|
||||
<!-- 使用自定义属性模板去除ListBox高亮显示框 -->
|
||||
<ListBox.ItemContainerStyle>
|
||||
<Style TargetType="ListBoxItem">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ListBoxItem">
|
||||
<ContentPresenter
|
||||
Content="{TemplateBinding Content}"
|
||||
ContentStringFormat="{TemplateBinding ContentStringFormat}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}" />
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</ListBox.ItemContainerStyle>
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<!--<local:ShopListRowCtrl></local:ShopListRowCtrl>-->
|
||||
<Border
|
||||
MinHeight="50"
|
||||
Margin="0,0,0,0"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"
|
||||
BorderBrush="{StaticResource ListRowBorderColorBrush}"
|
||||
BorderThickness="0,0,0,1"
|
||||
CornerRadius="0">
|
||||
<Border.Style>
|
||||
<!-- 鼠标进入或悬停Border时切换颜色(悬停时Border的填充控件必须有填充Border,所在层级不限,仅填充透明Grid则触发器无效) -->
|
||||
<Style TargetType="Border">
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="Background" Value="{StaticResource ListRowHoverBackColorBrush}" />
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Border.Style>
|
||||
|
||||
<Grid x:Name="gridListItem">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition x:Name="colCheck" Width="25*" />
|
||||
<ColumnDefinition x:Name="colBuyerName" Width="100*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<CheckBox
|
||||
Grid.Column="0"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Background="Transparent"
|
||||
Click="CheckBox_Click"
|
||||
IsChecked="{Binding IsSelect, Mode=TwoWay}" />
|
||||
<TextBox
|
||||
x:Name="txtBuyerNick"
|
||||
Grid.Column="1"
|
||||
HorizontalContentAlignment="Left"
|
||||
VerticalContentAlignment="Center"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
Cursor="Hand"
|
||||
IsReadOnly="True"
|
||||
Loaded="txtBuyerNick_Loaded"
|
||||
Text="{Binding buyer_nick}"
|
||||
TextWrapping="Wrap" />
|
||||
</Grid>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
</Grid>
|
||||
</Border>
|
||||
<Border
|
||||
Grid.Column="1"
|
||||
Height="60"
|
||||
Margin="-2,0,0,0"
|
||||
VerticalAlignment="Center"
|
||||
Panel.ZIndex="-1"
|
||||
Background="{StaticResource pageColorBrush}"
|
||||
CornerRadius="0,5,5,0"
|
||||
Cursor="Hand">
|
||||
<Button
|
||||
x:Name="btnHideBuyer"
|
||||
Grid.Column="1"
|
||||
Width="20"
|
||||
Height="60"
|
||||
Margin="0,0,0,0"
|
||||
Padding="0,0,0,0"
|
||||
VerticalContentAlignment="Center"
|
||||
Click="btnHideBuyer_Click"
|
||||
Content="◀"
|
||||
Style="{StaticResource BasePageButtonStyle}" />
|
||||
</Border>
|
||||
</Grid>
|
||||
<Grid
|
||||
Grid.Row="1"
|
||||
Margin="0"
|
||||
VerticalAlignment="Bottom"
|
||||
Background="Transparent"
|
||||
Visibility="Visible">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto" />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Button
|
||||
x:Name="btnHide"
|
||||
Width="60"
|
||||
Height="25"
|
||||
Margin="0,0,0,-10"
|
||||
Padding="0,2,0,0"
|
||||
VerticalContentAlignment="top"
|
||||
Click="btnHide_Click"
|
||||
Content="▼"
|
||||
Style="{StaticResource BasePageButtonStyle}" />
|
||||
<Grid
|
||||
x:Name="gridTable"
|
||||
Grid.Row="1"
|
||||
Height="330"
|
||||
Margin="2"
|
||||
VerticalAlignment="Bottom"
|
||||
Background="White"
|
||||
Visibility="Visible">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="40" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<Label
|
||||
x:Name="lblMsg"
|
||||
Margin="180,0,0,0"
|
||||
VerticalAlignment="Center"
|
||||
Panel.ZIndex="1"
|
||||
Content="正在操作:" />
|
||||
|
||||
<TabControl
|
||||
x:Name="tabOrderType"
|
||||
Grid.Row="1"
|
||||
Margin="0,-32,0,1"
|
||||
VerticalAlignment="Stretch">
|
||||
<TabControl.Resources>
|
||||
<Style TargetType="{x:Type TabControl}">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type TabControl}">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<Border
|
||||
Grid.Row="1"
|
||||
MinHeight="4"
|
||||
Background="#f8f8f9"
|
||||
BorderBrush="#e0e0e0"
|
||||
BorderThickness="1,1,1,0"
|
||||
CornerRadius="0,4,0,0">
|
||||
<ContentPresenter x:Name="PART_SelectedContentHost" ContentSource="SelectedContent" />
|
||||
</Border>
|
||||
<Border
|
||||
Margin="0,0,0,0"
|
||||
HorizontalAlignment="Left"
|
||||
Background="#e8e8e9"
|
||||
BorderBrush="#e1e1e1"
|
||||
BorderThickness="1,1,1,0"
|
||||
CornerRadius="4,4,0,0">
|
||||
<TabPanel
|
||||
x:Name="HeaderPanel"
|
||||
Background="Transparent"
|
||||
IsItemsHost="True" />
|
||||
</Border>
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
<Style TargetType="TabItem">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="TabItem">
|
||||
<Border
|
||||
Name="Border"
|
||||
Margin="-1,-2,-1,0"
|
||||
BorderThickness="1,1,1,0"
|
||||
CornerRadius="4,4,0,0">
|
||||
<ContentPresenter
|
||||
x:Name="ContentSite"
|
||||
Margin="10,5"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
ContentSource="Header" />
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsSelected" Value="True">
|
||||
<Setter TargetName="Border" Property="Background" Value="#f8f8f9" />
|
||||
<Setter TargetName="Border" Property="BorderBrush" Value="#e0e0e0" />
|
||||
<Setter TargetName="Border" Property="Margin" Value="-1,-3,-1,-1" />
|
||||
<Setter Property="Foreground" Value="{StaticResource pageColorBrush}" />
|
||||
<Setter Property="Panel.ZIndex" Value="100" />
|
||||
</Trigger>
|
||||
<Trigger Property="IsSelected" Value="False">
|
||||
<Setter TargetName="Border" Property="Background" Value="Transparent" />
|
||||
<Setter Property="Foreground" Value="#999999" />
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</TabControl.Resources>
|
||||
<TabItem Header="买手订单">
|
||||
<DataGrid
|
||||
x:Name="dgBuyerOrder"
|
||||
Grid.Row="1"
|
||||
AutoGenerateColumns="False"
|
||||
CanUserAddRows="False"
|
||||
CanUserDeleteRows="False"
|
||||
ColumnHeaderHeight="30"
|
||||
HorizontalGridLinesBrush="{StaticResource HorizontalGridLinesBrush}"
|
||||
LoadingRow="dgBuyerOrder_LoadingRow"
|
||||
RowHeaderWidth="0"
|
||||
RowHeight="50"
|
||||
SelectionChanged="dgBuyerOrder_SelectionChanged"
|
||||
VerticalGridLinesBrush="{StaticResource VerticalGridLinesBrush}">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn
|
||||
Width="40"
|
||||
Binding="{Binding Header, RelativeSource={RelativeSource AncestorType={x:Type DataGridRow}, Mode=FindAncestor}}"
|
||||
CanUserSort="False"
|
||||
Header="序列"
|
||||
IsReadOnly="True">
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextWrapping" Value="Wrap" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="Margin" Value="5" />
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn
|
||||
Width="0.6*"
|
||||
Binding="{Binding WxSendTypeStr}"
|
||||
Header="是否直发">
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextWrapping" Value="Wrap" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="Margin" Value="5" />
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn
|
||||
Width="1.5*"
|
||||
Binding="{Binding order_sn}"
|
||||
Header="拍单订单号">
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextWrapping" Value="Wrap" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="Margin" Value="5" />
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn
|
||||
Width="1.5*"
|
||||
Binding="{Binding ShopOrderIdStr}"
|
||||
Header="店铺订单号">
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextWrapping" Value="Wrap" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="Margin" Value="5" />
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn
|
||||
Width="1*"
|
||||
Binding="{Binding buyerName}"
|
||||
Header="买手名称">
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextWrapping" Value="Wrap" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="Margin" Value="5" />
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn
|
||||
Width="0.8*"
|
||||
Binding="{Binding OrderTimeStr}"
|
||||
Header="拍单时间">
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextWrapping" Value="Wrap" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="Margin" Value="5" />
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn
|
||||
Width="1.8*"
|
||||
Binding="{Binding ProdInfoStr}"
|
||||
Header="商品信息">
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextWrapping" Value="Wrap" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="Margin" Value="5" />
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn
|
||||
Width="0.8*"
|
||||
Binding="{Binding AmoutValue}"
|
||||
Header="金额">
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextWrapping" Value="Wrap" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="Margin" Value="5" />
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn
|
||||
Width="1*"
|
||||
Binding="{Binding order_status_prompt}"
|
||||
Header="订单状态">
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextWrapping" Value="Wrap" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="Margin" Value="5" />
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn
|
||||
Width="1*"
|
||||
Binding="{Binding outExpressCompanyCode}"
|
||||
Header="物流名称">
|
||||
<!-- outExpressCompanyName -->
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextWrapping" Value="Wrap" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="Margin" Value="5" />
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn
|
||||
Width="1*"
|
||||
Binding="{Binding tracking_number}"
|
||||
Header="物流单号">
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextWrapping" Value="Wrap" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="Margin" Value="5" />
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn
|
||||
Width="1*"
|
||||
Binding="{Binding sendStatus}"
|
||||
Header="订单信息">
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextWrapping" Value="Wrap" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="Margin" Value="5" />
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTemplateColumn
|
||||
x:Name="colSendBuyerOrder"
|
||||
Width="0.6*"
|
||||
Header="手动发送">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<Grid>
|
||||
|
||||
<Button
|
||||
x:Name="btnSendBuyerOrder"
|
||||
Grid.Row="2"
|
||||
Grid.Column="1"
|
||||
Margin="4,0,0,0"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Background="Transparent"
|
||||
BorderBrush="Transparent"
|
||||
Click="btnSendBuyerOrder_Click"
|
||||
Content="发送"
|
||||
Foreground="{StaticResource PageLinkBrush}"
|
||||
Visibility="{Binding TransitWarehouseIdStr, Converter={StaticResource HasTextVisibility}}" />
|
||||
<Button
|
||||
x:Name="btnSendDirectBuyerOrder"
|
||||
Grid.Row="2"
|
||||
Grid.Column="1"
|
||||
Margin="4,0,0,0"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Background="Transparent"
|
||||
BorderBrush="Transparent"
|
||||
Click="btnSendBuyerOrder_Click"
|
||||
Content="发送"
|
||||
Foreground="{StaticResource PageLinkBrush}"
|
||||
Visibility="{Binding WxSendTypeStr, Converter={StaticResource HasTextVisibility}}" />
|
||||
<!-- 直发单直发标注不为空 -->
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</TabItem>
|
||||
<TabItem Header="买手售后">
|
||||
|
||||
<DataGrid
|
||||
x:Name="dgBuyerAfterSale"
|
||||
Grid.Row="1"
|
||||
AutoGenerateColumns="False"
|
||||
CanUserAddRows="False"
|
||||
CanUserDeleteRows="False"
|
||||
ColumnHeaderHeight="30"
|
||||
HorizontalGridLinesBrush="{StaticResource HorizontalGridLinesBrush}"
|
||||
LoadingRow="dgBuyerOrder_LoadingRow"
|
||||
RowHeaderWidth="0"
|
||||
RowHeight="50"
|
||||
VerticalGridLinesBrush="{StaticResource VerticalGridLinesBrush}">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn
|
||||
Width="40"
|
||||
Binding="{Binding Header, RelativeSource={RelativeSource AncestorType={x:Type DataGridRow}, Mode=FindAncestor}}"
|
||||
CanUserSort="False"
|
||||
Header="序列"
|
||||
IsReadOnly="True">
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextWrapping" Value="Wrap" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="Margin" Value="5" />
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn
|
||||
Width="0.6*"
|
||||
Binding="{Binding WxSendTypeStr}"
|
||||
Header="是否直发">
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextWrapping" Value="Wrap" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="Margin" Value="5" />
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn
|
||||
Width="1.5*"
|
||||
Binding="{Binding afterSalesId}"
|
||||
Header="售后单号">
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextWrapping" Value="Wrap" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="Margin" Value="5" />
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn
|
||||
Width="1.5*"
|
||||
Binding="{Binding orderSn}"
|
||||
Header="拍单订单号">
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextWrapping" Value="Wrap" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="Margin" Value="5" />
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn
|
||||
Width="1.5*"
|
||||
Binding="{Binding ShopOrderIdStr}"
|
||||
Header="店铺订单号">
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextWrapping" Value="Wrap" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="Margin" Value="5" />
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn
|
||||
Width="1*"
|
||||
Binding="{Binding buyerName}"
|
||||
Header="买手名称">
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextWrapping" Value="Wrap" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="Margin" Value="5" />
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn
|
||||
Width="0.8*"
|
||||
Binding="{Binding orderDate}"
|
||||
Header="拍单日期">
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextWrapping" Value="Wrap" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="Margin" Value="5" />
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn
|
||||
Width="1.8*"
|
||||
Binding="{Binding ProdInfoStr}"
|
||||
Header="商品信息">
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextWrapping" Value="Wrap" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="Margin" Value="5" />
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn
|
||||
Width="0.8*"
|
||||
Binding="{Binding OrderAmountValue}"
|
||||
Header="订单金额">
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextWrapping" Value="Wrap" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="Margin" Value="5" />
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn
|
||||
Width="0.8*"
|
||||
Binding="{Binding RefundAmountValue}"
|
||||
Header="售后金额">
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextWrapping" Value="Wrap" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="Margin" Value="5" />
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn
|
||||
Width="1*"
|
||||
Binding="{Binding AfterSaleStatusStr}"
|
||||
Header="售后状态">
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextWrapping" Value="Wrap" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="Margin" Value="5" />
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn
|
||||
Width="1*"
|
||||
Binding="{Binding sendStatus}"
|
||||
Header="订单信息">
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextWrapping" Value="Wrap" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="Margin" Value="5" />
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<!--<DataGridTemplateColumn Width="0.6*" Header="手动发送" x:Name="colSendBuyerOrderAfterSale" >
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<Button Grid.Column="1" Grid.Row="2" x:Name="btnSendBuyerOrder" VerticalAlignment="Center" Background="Transparent" HorizontalAlignment="Center"
|
||||
Foreground="{StaticResource PageLinkBrush}" BorderBrush="Transparent" Margin="4,0,0,0" Content="发送" Click="btnSendBuyerOrder_Click"
|
||||
Visibility="{Binding TransitWarehouseIdStr, Converter={StaticResource HasTextVisibility}}"></Button>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>-->
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Border>
|
||||
</UserControl>
|
||||
File diff suppressed because it is too large.
Load diff
@@ -11,7 +11,7 @@ using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using WxOrder.Framework.Commons.pinyin;
|
||||
using TinyPinyin;
|
||||
|
||||
namespace _29WxOrderWpf.Ctrls.Commons
|
||||
{
|
||||
|
||||
@@ -1,91 +0,0 @@
|
||||
using _29WxOrderWpf.BaseWindows;
|
||||
using _29WxOrderWpf.Ctrls.BuyerCtrls;
|
||||
using _29WxOrderWpf.ViewModels;
|
||||
using AllBase;
|
||||
using AllBase.Helper;
|
||||
using AllBase.Model.DBModel;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using TemuKJD.ToolForms;
|
||||
using WxOrder.Framework.Commons;
|
||||
|
||||
namespace _29WxOrderWpf.Ctrls.OrderCtrls;
|
||||
|
||||
internal class OrderBuyerOrdersHelper
|
||||
{
|
||||
public static void ShowBuyerOrder(oms_wei_order_item_info orderItem, string buyerAccount, string buyerName, string outOrderId, bool isShowOrderList = false)
|
||||
{
|
||||
if (outOrderId.StartsWith("tb_")) // 淘宝买手及订单
|
||||
{
|
||||
var buyer = GlobalConfig.TaobaoBuyerLoginList.FirstOrDefault(p => p.buyer_id == buyerAccount || p.buyer_name == buyerName);
|
||||
if (buyer == null)
|
||||
{
|
||||
BaseMsgWindow.ShowError("该订单买手号未在当前账户登录");
|
||||
return;
|
||||
}
|
||||
|
||||
var url = "";
|
||||
if (isShowOrderList)
|
||||
url = "https://buyertrade.taobao.com/trade/itemlist/list_bought_items.htm?";
|
||||
else
|
||||
url = "https://trade.tmall.com/detail/orderDetail.htm?bizOrderId=" + outOrderId.Replace("tb_", "");
|
||||
|
||||
TaobaoBuyOrderCtrl taobaoBuyView = new TaobaoBuyOrderCtrl(GlobalConfig.CurrentTaobaoBuyer, orderItem);
|
||||
taobaoBuyView.ViewModel.InitUrl = url;
|
||||
new DialogWindow()
|
||||
{
|
||||
Title = "订单查看 - 当前买手 " + buyer.buyer_nick,
|
||||
Content = taobaoBuyView,
|
||||
Width = SystemParameters.PrimaryScreenWidth < 1920 ? SystemParameters.PrimaryScreenWidth : SystemParameters.PrimaryScreenWidth * 90 / 100,
|
||||
Height = SystemParameters.PrimaryScreenHeight * 90 / 100,
|
||||
WindowStartupLocation = WindowStartupLocation.CenterScreen,
|
||||
}.ShowDialog();
|
||||
}
|
||||
else // 拼多多买手及订单
|
||||
{
|
||||
var buyer = GlobalConfig.PDDBuyerLoginList.FirstOrDefault(p => p.buyer_id == buyerAccount || p.buyer_name == buyerName);
|
||||
if (buyer == null)
|
||||
{
|
||||
BaseMsgWindow.ShowError("该订单买手号未在当前账户登录");
|
||||
return;
|
||||
}
|
||||
|
||||
var url = "";
|
||||
if (isShowOrderList)
|
||||
url = "https://mobile.yangkeduo.com/index.html"; /* 订单列表 */
|
||||
else
|
||||
url = "https://mobile.yangkeduo.com/order.html?order_sn=" + outOrderId + "&page_from=1&main_orders=1&is_tester=1&refer_page_name=my_order" +
|
||||
"&refer_page_id=10032_" + BaseClass.DateTimeToTimestampMilliseconds(DateTime.Now) + "_" + Randomx.GetWordNumber(10) + "&refer_page_sn=10032";
|
||||
|
||||
// 拍单的时候检测一下买手号
|
||||
if (buyer.status == "在线")
|
||||
{
|
||||
PddMobileLoginViewModel.CheckBuyerLogin(buyer);
|
||||
}
|
||||
if (buyer.status != "在线")
|
||||
{
|
||||
BaseMsgWindow.ShowError("买手号掉线");
|
||||
return;
|
||||
}
|
||||
|
||||
PddMobileBuyOrderForm buyOrderForm = new PddMobileBuyOrderForm(MainWindow.Instance.orderListCtrl.FilterOneOrder, StartUp.UpdateBalance, orderItem, buyer, orderItem.PddBuyMap)
|
||||
{
|
||||
TitleText = "订单查看 - 当前买手 " + buyer.buyer_nick,
|
||||
InitUrl = url /* 订单页面 */
|
||||
};
|
||||
buyOrderForm.pnlBuy.Visible = false;
|
||||
|
||||
//已有拍单关联的控制界面显示隐藏
|
||||
if (orderItem.PddBuyMap != null)
|
||||
{
|
||||
buyOrderForm.pnlBuy.Visible = true;
|
||||
buyOrderForm.pnlMap.Visible = false;
|
||||
}
|
||||
buyOrderForm.ShowDialog();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,547 +0,0 @@
|
||||
using _29WxOrderWpf.BaseWindows;
|
||||
using AllBase;
|
||||
using AllBase.Helper;
|
||||
using AllBase.Model.DBModel;
|
||||
using NaiBa.Util.Extension;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Work;
|
||||
|
||||
namespace _29WxOrderWpf.Ctrls.OrderCtrls;
|
||||
|
||||
public class OrderGetOrderListHelper
|
||||
{
|
||||
/// <summary>
|
||||
/// 增量读取全部订单信息
|
||||
/// </summary>
|
||||
/// <param name="lastUpdateTime"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task GetWxOrderIncrementAsync(DateTime? lastUpdateTime)
|
||||
{
|
||||
if (lastUpdateTime == null || lastUpdateTime == DateTime.MinValue)
|
||||
return;
|
||||
|
||||
var shopIdList = GlobalConfig.ShopLoginList.Select(s => s.ErpShopId.ToString()).ToList();
|
||||
var shopIds = string.Join(",", shopIdList);
|
||||
|
||||
var existOrderIdList = GlobalConfig.ShopLoginList.Select(s => s.ErpShopId.ToString()).ToList();
|
||||
var updateOrderList = await GetOrderInfoBase(null, 0, shopIds, lastUpdateTime);
|
||||
var updateOrderIdList = GlobalConfig.ShopLoginList.Select(s => s.ErpShopId.ToString()).ToList();
|
||||
var orderIdList = existOrderIdList;
|
||||
orderIdList.AddRange(updateOrderIdList);
|
||||
orderIdList = orderIdList.Distinct().ToList();
|
||||
|
||||
while(orderIdList.Count > 0 )
|
||||
{
|
||||
var orderIdTake = orderIdList.Take(500).ToList();
|
||||
orderIdList.RemoveAll(o => orderIdTake.Contains(o));
|
||||
|
||||
var orderIds = string.Join(",", orderIdTake);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 读取买手号订单对应的微信店铺订单信息
|
||||
/// </summary>
|
||||
/// <param name="order_ids"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<List<oms_wei_order_info>> GetOrderInfo(string order_ids)
|
||||
{
|
||||
return await GetOrderInfoBase(order_ids);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 读取订单详情信息
|
||||
/// </summary>
|
||||
/// <param name="orderIds"></param>
|
||||
/// <returns></returns>
|
||||
static async Task<List<oms_wei_order_info>> GetOrderInfoBase(string orderIds, int pageSize = 100, string shopIds = null, DateTime? beginUpdateTime = null, DateTime? endUpdateTime = null)
|
||||
{
|
||||
if (string.IsNullOrEmpty(orderIds))
|
||||
return new List<oms_wei_order_info>();
|
||||
|
||||
Thread.Sleep(100);
|
||||
try
|
||||
{
|
||||
var url = BaseClass.Build29WxObjString("order/get_erp_order_list");
|
||||
var data = UserLogin.GetSignaturex();
|
||||
data += "&erp_order_id_in=" + orderIds;
|
||||
data += "&page_size=" + pageSize;
|
||||
if (!string.IsNullOrWhiteSpace(shopIds))
|
||||
data += "&erp_shop_id_in=" + shopIds;
|
||||
if (beginUpdateTime != null && beginUpdateTime != DateTime.MinValue)
|
||||
{
|
||||
var startTime = BaseClass.DateTimeToTimestampSeconds(beginUpdateTime.Value);
|
||||
data += "&start_time=" + startTime;
|
||||
}
|
||||
if (endUpdateTime != null && endUpdateTime != DateTime.MinValue)
|
||||
{
|
||||
var endTime = BaseClass.DateTimeToTimestampSeconds(endUpdateTime.Value);
|
||||
data += "&end_time=" + endTime;
|
||||
}
|
||||
var html = GetHtml.PostUtf8(url, data);
|
||||
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
||||
html = GetHtml.PostUtf8(url, data);
|
||||
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
||||
{
|
||||
throw new Exception("订单读取失败 " + BaseRegex.GetStringJson(ref html, "msg"));
|
||||
}
|
||||
List<oms_wei_order_info> orders = new List<oms_wei_order_info>();
|
||||
orders = JsonHelper.DeserializeJsonToList<oms_wei_order_info>(JObject.Parse(html)["data"].ParseToString());
|
||||
if (orders == null)
|
||||
orders = new List<oms_wei_order_info>();
|
||||
|
||||
var orderItems = await GetOrderItemInfo(orderIds);
|
||||
foreach (var orderItem in orderItems)
|
||||
{
|
||||
var order = orders.FirstOrDefault(o => o.order_id == orderItem.order_id);
|
||||
orderItem.ItemOrder = order;
|
||||
order.orderItems.Add(orderItem);
|
||||
}
|
||||
return orders;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
BaseMsgWindow.ShowAnimateMessage(ex.Message, "Error", 6);
|
||||
return new List<oms_wei_order_info>();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 读取订单详情信息
|
||||
/// </summary>
|
||||
/// <param name="order_ids"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<List<oms_wei_order_item_info>> GetOrderItemInfo(string order_ids)
|
||||
{
|
||||
if (string.IsNullOrEmpty(order_ids))
|
||||
return new List<oms_wei_order_item_info>();
|
||||
var url = BaseClass.Build29WxObjString("order/get_erp_order_item_list");
|
||||
var data = UserLogin.GetSignaturex();
|
||||
data += "&erp_order_id_in=" + order_ids;
|
||||
data += "&page_size=" + 2500;
|
||||
var html = await GetHtml.PostUtf8Async(url, data);
|
||||
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
||||
html = await GetHtml.PostUtf8Async(url, data);
|
||||
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
||||
{
|
||||
BaseMsgWindow.ShowAnimateMessage("订单详情读取失败 " + BaseRegex.GetStringJson(ref html, "msg"), "Error", 5);
|
||||
}
|
||||
List<oms_wei_order_item_info> orderItems = new List<oms_wei_order_item_info>();
|
||||
try
|
||||
{
|
||||
orderItems = JsonHelper.DeserializeJsonToList<oms_wei_order_item_info>(JObject.Parse(html)["data"].ParseToString());
|
||||
if (orderItems == null)
|
||||
orderItems = new List<oms_wei_order_item_info>();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
orderItems = new List<oms_wei_order_item_info>();
|
||||
BaseMsgWindow.ShowAnimateMessage("订单详情读取失败 " + ex.Message, "Error", 5);
|
||||
}
|
||||
return orderItems;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 读取售后单
|
||||
/// </summary>
|
||||
/// <param name="order_ids"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<List<oms_wei_refund_info>> GetOrderRefundInfo(string order_ids)
|
||||
{
|
||||
if (string.IsNullOrEmpty(order_ids))
|
||||
return new List<oms_wei_refund_info>();
|
||||
Thread.Sleep(100);
|
||||
var url2 = BaseClass.Build29WxObjString("order/get_erp_refund_list");
|
||||
var data2 = UserLogin.GetSignaturex();
|
||||
data2 += "&erp_order_id_in=" + order_ids;
|
||||
var html2 = await GetHtml.PostUtf8Async(url2, data2);
|
||||
if (string.IsNullOrEmpty(html2) || !html2.Contains("\"code\":200"))
|
||||
html2 = await GetHtml.PostUtf8Async(url2, data2);
|
||||
if (string.IsNullOrEmpty(html2) || !html2.Contains("\"code\":200"))
|
||||
{
|
||||
//BaseMsgWindow.ShowError(MainWindow.Instance, "订单读取失败 " + BaseRegex.GetStringJson(ref html, "msg"));
|
||||
//break;
|
||||
}
|
||||
List<oms_wei_refund_info> refunds = new List<oms_wei_refund_info>();
|
||||
try { refunds = JsonHelper.DeserializeJsonToList<oms_wei_refund_info>(JObject.Parse(html2)["data"].ParseToString()); } catch { }
|
||||
return refunds;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 读取扩展订单信息
|
||||
/// </summary>
|
||||
/// <param name="order_ids"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<List<order_item_ext>> GetOrderItemExts(string order_ids)
|
||||
{
|
||||
List<order_item_ext> existOrderExtList = new List<order_item_ext>();
|
||||
if (!string.IsNullOrEmpty(order_ids))
|
||||
{
|
||||
var url = BaseClass.Build29WxObjString("order/wx_get_order_item_ext_info");
|
||||
var data = UserLogin.GetSignaturex();
|
||||
data += "&wx_order_id_in=" + order_ids;
|
||||
var html = await GetHtml.PostUtf8Async(url, data);
|
||||
if (!html.Contains("\"code\":200"))
|
||||
html = await GetHtml.PostUtf8Async(url, data);
|
||||
if (!html.Contains("\"code\":200"))
|
||||
{
|
||||
BaseMsgWindow.ShowAnimateMessage("订单扩展信息查询失败 " + BaseRegex.GetStringJson(ref html, "msg"), "Error", 5);
|
||||
}
|
||||
try
|
||||
{
|
||||
existOrderExtList = JsonHelper.DeserializeJsonToList<order_item_ext>(JsonHelper.JObjectParse(html)["data"].ParseToString());
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
return existOrderExtList;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 读取中转仓订单发货包裹信息
|
||||
/// </summary>
|
||||
/// <param name="order_ids"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<List<oms_wei_external_procurement_log_info>> GetTransitWarehouseList(string order_ids)
|
||||
{
|
||||
if (string.IsNullOrEmpty(order_ids))
|
||||
return new List<oms_wei_external_procurement_log_info>();
|
||||
|
||||
var url3 = BaseClass.Build29WxObjString("order/wx_get_transit_order");
|
||||
var data3 = UserLogin.GetSignaturex();
|
||||
data3 += "&order_no=" + order_ids;
|
||||
data3 += "&page_size=5000";
|
||||
var html3 = await GetHtml.PostUtf8Async(url3, data3);
|
||||
if (string.IsNullOrEmpty(html3) || !html3.Contains("\"code\":200"))
|
||||
html3 = await GetHtml.PostUtf8Async(url3, data3);
|
||||
if (string.IsNullOrEmpty(html3) || !html3.Contains("\"code\":200"))
|
||||
{
|
||||
BaseMsgWindow.ShowAnimateMessage("订单读取失败 " + BaseRegex.GetStringJson(ref html3, "msg"), "Error", 5);
|
||||
}
|
||||
List<oms_wei_external_procurement_log_info> transitOrderList = new List<oms_wei_external_procurement_log_info>();
|
||||
try
|
||||
{
|
||||
transitOrderList = JsonHelper.DeserializeJsonToList<oms_wei_external_procurement_log_info>(JObject.Parse(html3)["data"].ParseToString());
|
||||
return transitOrderList;
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
return new List<oms_wei_external_procurement_log_info>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 读取中转仓额外包裹
|
||||
/// </summary>
|
||||
/// <param name="order_ids"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<List<oms_wei_transfer_extra_package>> GetTransitExtraPackageList(string order_ids)
|
||||
{
|
||||
if (string.IsNullOrEmpty(order_ids))
|
||||
return new List<oms_wei_transfer_extra_package>();
|
||||
|
||||
var url3 = BaseClass.Build29WxObjString("order/wx_get_transfer_extra_package");
|
||||
var data3 = UserLogin.GetSignaturex();
|
||||
data3 += "&order_no=" + order_ids;
|
||||
var html3 = await GetHtml.PostUtf8Async(url3, data3);
|
||||
if (string.IsNullOrEmpty(html3) || !html3.Contains("\"code\":200"))
|
||||
html3 = await GetHtml.PostUtf8Async(url3, data3);
|
||||
if (string.IsNullOrEmpty(html3) || !html3.Contains("\"code\":200"))
|
||||
{
|
||||
BaseMsgWindow.ShowAnimateMessage("订单读取失败 " + BaseRegex.GetStringJson(ref html3, "msg"), "Error", 5);
|
||||
}
|
||||
List<oms_wei_transfer_extra_package> transitExtraPackageList = new List<oms_wei_transfer_extra_package>();
|
||||
try
|
||||
{
|
||||
transitExtraPackageList = JsonHelper.DeserializeJsonToList<oms_wei_transfer_extra_package>(JObject.Parse(html3)["data"].ParseToString());
|
||||
return transitExtraPackageList;
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
return new List<oms_wei_transfer_extra_package>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 读取中转仓退货包裹
|
||||
/// </summary>
|
||||
/// <param name="order_ids"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<List<oms_wei_external_procurement_after_sale_info>> GetTransitWarehouseAfterSaleList(string order_ids)
|
||||
{
|
||||
if (string.IsNullOrEmpty(order_ids))
|
||||
return new List<oms_wei_external_procurement_after_sale_info>();
|
||||
|
||||
// 读取中转仓处理售后单
|
||||
var url5 = BaseClass.Build29WxObjString("order/wx_get_transit_warehouse_aftersale_list");
|
||||
var data5 = UserLogin.GetSignaturex();
|
||||
data5 += "&wx_order_id_in=" + order_ids;
|
||||
var html5 = await GetHtml.PostUtf8Async(url5, data5);
|
||||
if (string.IsNullOrEmpty(html5) || !html5.Contains("\"code\":200"))
|
||||
html5 = await GetHtml.PostUtf8Async(url5, data5);
|
||||
if (string.IsNullOrEmpty(html5) || !html5.Contains("\"code\":200"))
|
||||
{
|
||||
BaseMsgWindow.ShowAnimateMessage("云仓售后订单读取失败 " + BaseRegex.GetStringJson(ref html5, "msg"), "Error", 5);
|
||||
}
|
||||
List<oms_wei_external_procurement_after_sale_info> transitAfterSaleList = new List<oms_wei_external_procurement_after_sale_info>();
|
||||
try
|
||||
{
|
||||
transitAfterSaleList = JsonHelper.DeserializeJsonToList<oms_wei_external_procurement_after_sale_info>(JObject.Parse(html5)["data"].ParseToString())
|
||||
.OrderByDescending(p => p.created_time).ToList();
|
||||
if (transitAfterSaleList != null)
|
||||
return transitAfterSaleList;
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
return new List<oms_wei_external_procurement_after_sale_info>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 读取退货仓包裹
|
||||
/// </summary>
|
||||
/// <param name="order_ids"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<List<distrib_return_order_info>> GetTransitReturnOrderList(string order_ids)
|
||||
{
|
||||
if (string.IsNullOrEmpty(order_ids))
|
||||
return new List<distrib_return_order_info>();
|
||||
|
||||
// 读取退货仓包裹
|
||||
var url5 = BaseClass.Build29WxObjString("order/wx_get_erp_return_order_list");
|
||||
var data5 = UserLogin.GetSignaturex();
|
||||
data5 += "&erp_order_id_in=" + order_ids;
|
||||
var html5 = await GetHtml.PostUtf8Async(url5, data5);
|
||||
if (string.IsNullOrEmpty(html5) || !html5.Contains("\"code\":200"))
|
||||
html5 = await GetHtml.PostUtf8Async(url5, data5);
|
||||
if (string.IsNullOrEmpty(html5) || !html5.Contains("\"code\":200"))
|
||||
{
|
||||
BaseMsgWindow.ShowAnimateMessage("云仓分销退货订单读取失败 " + BaseRegex.GetStringJson(ref html5, "msg"), "Error", 5);
|
||||
}
|
||||
List<distrib_return_order_info> transitAfterSaleList = new List<distrib_return_order_info>();
|
||||
try
|
||||
{
|
||||
transitAfterSaleList = JsonHelper.DeserializeJsonToList<distrib_return_order_info>(JObject.Parse(html5)["data"].ParseToString())
|
||||
.OrderByDescending(p => p.created_at).ToList();
|
||||
if (transitAfterSaleList != null)
|
||||
return transitAfterSaleList;
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
return new List<distrib_return_order_info>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 读取多多买手单
|
||||
/// </summary>
|
||||
/// <param name="order_ids"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<List<order_pdd_buyer_order>> GetPddBuyerOrders(string order_ids)
|
||||
{
|
||||
if (string.IsNullOrEmpty(order_ids))
|
||||
return new List<order_pdd_buyer_order>();
|
||||
|
||||
var url4 = BaseClass.Build29WxObjString("order/wx_get_buyer_order_list");
|
||||
var data4 = UserLogin.GetSignaturex();
|
||||
data4 += "&wx_order_id_in=" + order_ids;
|
||||
var html4 = await GetHtml.PostUtf8Async(url4, data4);
|
||||
if (string.IsNullOrEmpty(html4) || !html4.Contains("\"code\":200"))
|
||||
html4 = await GetHtml.PostUtf8Async(url4, data4);
|
||||
if (string.IsNullOrEmpty(html4) || !html4.Contains("\"code\":200"))
|
||||
{
|
||||
BaseMsgWindow.ShowAnimateMessage("订单读取失败(买手) " + BaseRegex.GetStringJson(ref html4, "msg"), "Error", 5);
|
||||
}
|
||||
List<order_pdd_buyer_order> pddBuyerOrders = new List<order_pdd_buyer_order>();
|
||||
try
|
||||
{
|
||||
pddBuyerOrders = JsonHelper.DeserializeJsonToList<order_pdd_buyer_order>(JObject.Parse(html4)["data"].ParseToString())
|
||||
.OrderByDescending(p => p.TransitCreateTime).ToList();
|
||||
return pddBuyerOrders;
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
return new List<order_pdd_buyer_order>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 读取淘宝买手单
|
||||
/// </summary>
|
||||
/// <param name="order_ids"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<List<order_pdd_buyer_order>> GetTbBuyerOrders(string order_ids)
|
||||
{
|
||||
if (string.IsNullOrEmpty(order_ids))
|
||||
return new List<order_pdd_buyer_order>();
|
||||
|
||||
var url4 = BaseClass.Build29WxObjString("order/wx_get_tb_buyer_order_list");
|
||||
var data4 = UserLogin.GetSignaturex();
|
||||
data4 += "&wx_order_id_in=" + order_ids;
|
||||
var html4 = await GetHtml.PostUtf8Async(url4, data4);
|
||||
if (string.IsNullOrEmpty(html4) || !html4.Contains("\"code\":200"))
|
||||
html4 = await GetHtml.PostUtf8Async(url4, data4);
|
||||
if (string.IsNullOrEmpty(html4) || !html4.Contains("\"code\":200"))
|
||||
{
|
||||
BaseMsgWindow.ShowAnimateMessage("订单读取失败(买手) " + BaseRegex.GetStringJson(ref html4, "msg"), "Error", 5);
|
||||
}
|
||||
List<order_pdd_buyer_order> pddBuyerOrders = new List<order_pdd_buyer_order>();
|
||||
try
|
||||
{
|
||||
pddBuyerOrders = JsonHelper.DeserializeJsonToList<order_pdd_buyer_order>(JObject.Parse(html4)["data"].ParseToString())
|
||||
.OrderByDescending(p => p.TransitCreateTime).ToList();
|
||||
return pddBuyerOrders;
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
return new List<order_pdd_buyer_order>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 读取多多售后
|
||||
/// </summary>
|
||||
/// <param name="order_ids"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<List<order_pdd_buyer_after_sale>> GetPddBuyerAfterSales(string order_ids)
|
||||
{
|
||||
var url6 = BaseClass.Build29WxObjString("order/wx_get_buyer_after_sale_list");
|
||||
var data6 = UserLogin.GetSignaturex();
|
||||
data6 += "&wx_order_id_in=" + order_ids;
|
||||
List<order_pdd_buyer_after_sale> pddBuyerAfterSales = new List<order_pdd_buyer_after_sale>();
|
||||
if (!string.IsNullOrEmpty(order_ids))
|
||||
{
|
||||
var html6 = await GetHtml.PostUtf8Async(url6, data6);
|
||||
if (string.IsNullOrEmpty(html6) || !html6.Contains("\"code\":200"))
|
||||
html6 = await GetHtml.PostUtf8Async(url6, data6);
|
||||
if (string.IsNullOrEmpty(html6) || !html6.Contains("\"code\":200"))
|
||||
{
|
||||
BaseMsgWindow.ShowAnimateMessage("订单读取失败(买手售后) " + BaseRegex.GetStringJson(ref html6, "msg"), "Error", 6);
|
||||
return new List<order_pdd_buyer_after_sale>();
|
||||
}
|
||||
try
|
||||
{
|
||||
pddBuyerAfterSales = JsonHelper.DeserializeJsonToList<order_pdd_buyer_after_sale>(JObject.Parse(html6)["data"].ParseToString()).OrderByDescending(p => p.TransitCreateTime).ToList();
|
||||
return pddBuyerAfterSales;
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
return new List<order_pdd_buyer_after_sale>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 读取淘宝售后
|
||||
/// </summary>
|
||||
/// <param name="order_ids"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<List<order_pdd_buyer_after_sale>> GetTbBuyerAfterSales(string order_ids)
|
||||
{
|
||||
var url6 = BaseClass.Build29WxObjString("order/wx_get_tb_buyer_after_sale_list");
|
||||
var data6 = UserLogin.GetSignaturex();
|
||||
data6 += "&wx_order_id_in=" + order_ids;
|
||||
List<order_pdd_buyer_after_sale> pddBuyerAfterSales = new List<order_pdd_buyer_after_sale>();
|
||||
if (!string.IsNullOrEmpty(order_ids))
|
||||
{
|
||||
var html6 = await GetHtml.PostUtf8Async(url6, data6);
|
||||
if (string.IsNullOrEmpty(html6) || !html6.Contains("\"code\":200"))
|
||||
html6 = await GetHtml.PostUtf8Async(url6, data6);
|
||||
if (string.IsNullOrEmpty(html6) || !html6.Contains("\"code\":200"))
|
||||
{
|
||||
BaseMsgWindow.ShowAnimateMessage("订单读取失败(买手售后) " + BaseRegex.GetStringJson(ref html6, "msg"), "Error", 6);
|
||||
return new List<order_pdd_buyer_after_sale>();
|
||||
}
|
||||
try
|
||||
{
|
||||
pddBuyerAfterSales = JsonHelper.DeserializeJsonToList<order_pdd_buyer_after_sale>(JObject.Parse(html6)["data"].ParseToString()).OrderByDescending(p => p.TransitCreateTime).ToList();
|
||||
return pddBuyerAfterSales;
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
return new List<order_pdd_buyer_after_sale>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 读取同步单信息
|
||||
/// </summary>
|
||||
/// <param name="buyer_order_ids"></param>
|
||||
/// <param name="not_upload_pickup_status"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<List<yh_sync_logistics>> GetSyncLogistics(string buyer_order_ids, int? not_upload_pickup_status = null)
|
||||
{
|
||||
var url6 = BaseClass.Build29WxObjString("order/wx_get_sync_waybill");
|
||||
var data6 = UserLogin.GetSignaturex();
|
||||
data6 += "&order_id=" + buyer_order_ids;
|
||||
if (not_upload_pickup_status != null)
|
||||
data6 += "¬_upload_pickup_status=" + not_upload_pickup_status;
|
||||
List<yh_sync_logistics> pddBuyerAfterSales = new List<yh_sync_logistics>();
|
||||
if (!string.IsNullOrEmpty(buyer_order_ids))
|
||||
{
|
||||
var html6 = await GetHtml.PostUtf8Async(url6, data6);
|
||||
if (string.IsNullOrEmpty(html6) || !html6.Contains("\"code\":200"))
|
||||
html6 = await GetHtml.PostUtf8Async(url6, data6);
|
||||
if (string.IsNullOrEmpty(html6) || !html6.Contains("\"code\":200"))
|
||||
{
|
||||
BaseMsgWindow.ShowAnimateMessage("订单读取失败(买手售后) " + BaseRegex.GetStringJson(ref html6, "msg"), "Error", 6);
|
||||
return new List<yh_sync_logistics>();
|
||||
}
|
||||
try
|
||||
{
|
||||
pddBuyerAfterSales = JsonHelper.DeserializeJsonToList<yh_sync_logistics>(JObject.Parse(html6)["data"].ParseToString()).OrderByDescending(p => p.id).ToList();
|
||||
return pddBuyerAfterSales;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
}
|
||||
}
|
||||
return new List<yh_sync_logistics>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 读取店铺物流信息
|
||||
/// </summary>
|
||||
/// <param name="order_ids"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<List<oms_wei_ewaybill_path>> GetEWaybillPath(string order_ids)
|
||||
{
|
||||
List<oms_wei_ewaybill_path> oms_wei_ewaybill_path_list = null;
|
||||
if (!string.IsNullOrEmpty(order_ids))
|
||||
{
|
||||
try
|
||||
{
|
||||
var url = BaseClass.Build29WxObjString("order/wx_get_erp_ewaybill_path_latest_list");
|
||||
var data = UserLogin.GetSignaturex();
|
||||
data += "&erp_order_id_in=" + order_ids;
|
||||
var html = await GetHtml.PostUtf8Async(url, data);
|
||||
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
||||
html = await GetHtml.PostUtf8Async(url, data);
|
||||
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
||||
{
|
||||
BaseMsgWindow.ShowAnimateMessage("物流查询失败 " + BaseRegex.GetStringJson(ref html, "msg"), "Error", 6);
|
||||
}
|
||||
else
|
||||
{
|
||||
oms_wei_ewaybill_path_list = JsonHelper.DeserializeJsonToList<oms_wei_ewaybill_path>(JObject.Parse(html)["data"].ParseToString()).OrderByDescending(p => p.update_time).ToList();
|
||||
return oms_wei_ewaybill_path_list;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
return new List<oms_wei_ewaybill_path>();
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
using _29WxOrderWpf.BaseWindows;
|
||||
using WxOrder.Framework.Commons;
|
||||
using _29WxOrderWpf.Commands;
|
||||
using _29WxOrderWpf.Common;
|
||||
using _29WxOrderWpf.Ctrls.PDDInvoice;
|
||||
using _29WxOrderWpf.Ctrls.Statistics;
|
||||
using _29WxOrderWpf.Services;
|
||||
@@ -14,7 +15,6 @@ using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Input;
|
||||
using Work._29Tools.BLL;
|
||||
using WxOrder.Framework.Commons.Dialogs;
|
||||
using static _29WxOrderWpf.Services.ShipGiftService;
|
||||
|
||||
namespace _29WxOrderWpf.Ctrls.OrderCtrls;
|
||||
@@ -22,18 +22,22 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls;
|
||||
public partial class OrderListCtrl
|
||||
{
|
||||
#region 统计
|
||||
private ShopRevenueStatisticsView _statisticsDialog;
|
||||
private DialogWindow _statisticsDialog;
|
||||
public ICommand ShowShopRevenueStatisticsDialogViewCommand => new DelegateCommand(ShowShopRevenueStatisticsDialogView);
|
||||
|
||||
private void ShowShopRevenueStatisticsDialogView()
|
||||
{
|
||||
if (_statisticsDialog == null)
|
||||
{
|
||||
_statisticsDialog = new ShopRevenueStatisticsView();
|
||||
_statisticsDialog = new DialogWindow()
|
||||
{
|
||||
Title = "统计",
|
||||
Content = new ShopRevenueStatisticsView(),
|
||||
|
||||
};
|
||||
_statisticsDialog.Closed += (s, e) => _statisticsDialog = null;
|
||||
}
|
||||
_statisticsDialog.Show();
|
||||
_statisticsDialog.Activate();
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -158,7 +162,7 @@ public partial class OrderListCtrl
|
||||
if (ret)
|
||||
{
|
||||
sucessCount++;
|
||||
await this.GetOrder(item.order_id);
|
||||
this.GetOrder(item.order_id);
|
||||
SetProgress(index, count);
|
||||
item.IsSelect = false;
|
||||
}
|
||||
@@ -308,8 +312,11 @@ public partial class OrderListCtrl
|
||||
|
||||
private void ShowPDDInvoiceDialog()
|
||||
{
|
||||
var view = new PDDInvoiceView();
|
||||
DialogService.ShowOrActivateWindow(view);
|
||||
new DialogWindow
|
||||
{
|
||||
Title = "发票助手",
|
||||
Content = new PDDInvoiceView()
|
||||
}.Show();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
x:Class="_29WxOrderWpf.Ctrls.OrderCtrls.OrderListCtrl"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:c="WxOrder.Framework"
|
||||
xmlns:c="clr-namespace:_29WxOrderWpf.Common"
|
||||
xmlns:converters="clr-namespace:_29WxOrderWpf.Converters"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:_29WxOrderWpf.Ctrls.OrderCtrls"
|
||||
@@ -10,7 +10,6 @@
|
||||
xmlns:usercontrols="clr-namespace:_29WxOrderWpf.UserControls"
|
||||
xmlns:utils="clr-namespace:_29WxOrderWpf.Utils"
|
||||
xmlns:wpf="WPFCommon"
|
||||
d:DataContext="{d:DesignInstance Type=local:OrderListCtrl}"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="1560"
|
||||
Loaded="Window_Loaded"
|
||||
@@ -145,7 +144,6 @@
|
||||
VerticalContentAlignment="Center"
|
||||
BorderBrush="Transparent"
|
||||
SelectedIndex="0"
|
||||
SelectionChanged="cmbTimeType_SelectionChanged"
|
||||
Style="{StaticResource RoundedComboBox}"
|
||||
Text="更新时间">
|
||||
<ComboBoxItem>
|
||||
@@ -170,8 +168,7 @@
|
||||
Grid.Column="7"
|
||||
Margin="0,0,14,0"
|
||||
VerticalAlignment="Center"
|
||||
BorderThickness="0"
|
||||
SelectedDate="{Binding DateStart}" />
|
||||
BorderThickness="0" />
|
||||
|
||||
<!-- 结束时间 -->
|
||||
<Border
|
||||
@@ -187,8 +184,7 @@
|
||||
Grid.Column="8"
|
||||
Margin="10,0,4,0"
|
||||
VerticalAlignment="Center"
|
||||
BorderThickness="0"
|
||||
SelectedDate="{Binding DateEnd}" />
|
||||
BorderThickness="0" />
|
||||
<CheckBox
|
||||
x:Name="chkEndDate"
|
||||
Grid.Column="8"
|
||||
@@ -196,7 +192,6 @@
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
BorderBrush="{StaticResource mainColorBrush}"
|
||||
Click="chkEndDate_Click"
|
||||
FontSize="12" />
|
||||
|
||||
<Button
|
||||
@@ -265,18 +260,17 @@
|
||||
Unchecked="chkAutoReadBuyerOrder_CheckedChanged" />
|
||||
|
||||
<CheckBox
|
||||
x:Name="chkSyncDirectOrderWaybill"
|
||||
x:Name="chkHideGreenFlag"
|
||||
Grid.Column="12"
|
||||
Margin="2,0"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
d:Opacity="0.5"
|
||||
d:Visibility="Visible"
|
||||
d:IsChecked="True"
|
||||
BorderBrush="{StaticResource mainColorBrush}"
|
||||
Click="chkSyncDirectOrderWaybill_Click"
|
||||
Content="同步物流单"
|
||||
Click="chkHideGreenFlag_Click"
|
||||
Content="隐藏标记订单"
|
||||
FontSize="12"
|
||||
IsChecked="False"
|
||||
Visibility="Collapsed" />
|
||||
IsChecked="{Binding orderFilterConfig.chkHideGreenFlagIsChecked}" />
|
||||
</WrapPanel>
|
||||
|
||||
<wpf:SpacingStackPanel Grid.Column="13" HorizontalSpacing="5">
|
||||
@@ -309,26 +303,6 @@
|
||||
Grid.Row="1"
|
||||
Margin="8,0,0,2">
|
||||
<WrapPanel x:Name="wpFilter" VerticalAlignment="Top">
|
||||
<CheckBox
|
||||
x:Name="chkHideGreenFlag"
|
||||
Grid.Column="12"
|
||||
Margin="2,0"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
d:IsChecked="True"
|
||||
BorderBrush="{StaticResource mainColorBrush}"
|
||||
Click="chkHideGreenFlag_Click"
|
||||
Content="隐藏标记订单"
|
||||
FontSize="12"
|
||||
IsChecked="{Binding orderFilterConfig.chkHideGreenFlagIsChecked}" />
|
||||
<Polyline
|
||||
Grid.Column="5"
|
||||
Width="10"
|
||||
Margin="2,0"
|
||||
VerticalAlignment="Center"
|
||||
Points="5,0 5,4 5,0"
|
||||
Stroke="{StaticResource mainColorBrush}"
|
||||
StrokeThickness="2" />
|
||||
<CheckBox
|
||||
x:Name="chkOnlyWarehouseOrder"
|
||||
Margin="0,2,3,2"
|
||||
@@ -355,7 +329,14 @@
|
||||
FontSize="12"
|
||||
IsChecked="{Binding orderFilterConfig.chkNoMultiOrderIsChecked}"
|
||||
Unchecked="chkSubFilterSonditions_Checked" />
|
||||
|
||||
<Polyline
|
||||
Grid.Column="5"
|
||||
Width="10"
|
||||
Margin="2,0"
|
||||
VerticalAlignment="Center"
|
||||
Points="5,0 5,4 5,0"
|
||||
Stroke="{StaticResource mainColorBrush}"
|
||||
StrokeThickness="2" />
|
||||
<CheckBox
|
||||
x:Name="chkTransitOrder"
|
||||
Margin="0,2,3,2"
|
||||
@@ -491,8 +472,8 @@
|
||||
SelectedIndex="0"
|
||||
SelectionChanged="ComboBox_SelectionChanged"
|
||||
Style="{StaticResource RoundedComboBox}">
|
||||
<ComboBoxItem Content="礼品一" />
|
||||
<ComboBoxItem Content="礼品二(实物)" />
|
||||
<ComboBoxItem Content="1.55" />
|
||||
<ComboBoxItem Content="1.6" />
|
||||
</ComboBox>
|
||||
</wpf:TitleContent>
|
||||
<Button
|
||||
@@ -505,24 +486,6 @@
|
||||
Content="同步订单"
|
||||
Style="{StaticResource BasePageButtonStyle}"
|
||||
ToolTip="同步选中的订单或选中的店铺" />
|
||||
<Polyline
|
||||
Grid.Column="5"
|
||||
Width="10"
|
||||
Margin="2,0"
|
||||
VerticalAlignment="Center"
|
||||
Points="5,0 5,4 5,0"
|
||||
Stroke="{StaticResource mainColorBrush}"
|
||||
StrokeThickness="2" />
|
||||
<CheckBox
|
||||
x:Name="chkNoPickupNumOrder"
|
||||
Margin="2,0"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
BorderBrush="{StaticResource mainColorBrush}"
|
||||
Click="chkNoPickupNumOrder_Click"
|
||||
Content="仅显示无取件码同步物流单"
|
||||
FontSize="12"
|
||||
IsChecked="False" />
|
||||
</WrapPanel>
|
||||
</Border>
|
||||
<Grid
|
||||
@@ -607,10 +570,9 @@
|
||||
</TabControl.Resources>
|
||||
<TabItem
|
||||
MinWidth="60"
|
||||
d:Header="待采购"
|
||||
Background="Transparent"
|
||||
BorderBrush="Transparent"
|
||||
Header="{Binding WaitBuyTabTxt}"
|
||||
Header="待采购"
|
||||
SizeChanged="TabItem_SizeChanged">
|
||||
<Border
|
||||
Padding="0,10"
|
||||
@@ -634,7 +596,7 @@
|
||||
VerticalAlignment="Center"
|
||||
BorderBrush="{StaticResource mainColorBrush}"
|
||||
Click="chkMapProd_Click"
|
||||
Content="选择SKU"
|
||||
Content="已关联商品"
|
||||
FontSize="12" />
|
||||
<CheckBox
|
||||
x:Name="chkMapSku"
|
||||
@@ -645,37 +607,7 @@
|
||||
Click="chkMapProd_Click"
|
||||
Content="已关联拍单"
|
||||
FontSize="12" />
|
||||
<Button
|
||||
x:Name="btnAutoBuy"
|
||||
Width="Auto"
|
||||
Height="22"
|
||||
MinWidth="48"
|
||||
Margin="8,0,4,0"
|
||||
Padding="4,0"
|
||||
Click="btnAutoBuy_Click"
|
||||
Content="自动拍单"
|
||||
FontSize="12"
|
||||
Style="{StaticResource BasePageButtonStyle}" />
|
||||
<!-- c:DebugVisibility.Enable="true" -->
|
||||
<Button
|
||||
x:Name="btnAutoBuyIntorduction"
|
||||
Width="Auto"
|
||||
Height="22"
|
||||
MinWidth="48"
|
||||
Margin="0,0,8,0"
|
||||
Padding="4,0"
|
||||
Click="btnAutoBuyIntroduction_Click"
|
||||
Content="自动拍单设置说明"
|
||||
FontSize="12"
|
||||
Style="{StaticResource BasePageButtonLightStyle}" />
|
||||
<Polyline
|
||||
Grid.Column="5"
|
||||
Width="10"
|
||||
Margin="2,0"
|
||||
VerticalAlignment="Center"
|
||||
Points="5,0 5,4 5,0"
|
||||
Stroke="{StaticResource mainColorBrush}"
|
||||
StrokeThickness="2" />
|
||||
|
||||
<Button
|
||||
Width="Auto"
|
||||
Height="22"
|
||||
@@ -691,58 +623,35 @@
|
||||
</TabItem>
|
||||
<TabItem
|
||||
MinWidth="60"
|
||||
d:Header="异常需重拍"
|
||||
Background="Transparent"
|
||||
BorderBrush="Transparent"
|
||||
Foreground="#FFEE0099"
|
||||
Header="{Binding AbnormalTabTxt}"
|
||||
Header="异常需重拍"
|
||||
SizeChanged="TabItem_SizeChanged" />
|
||||
<TabItem
|
||||
MinWidth="60"
|
||||
d:Header="待发货"
|
||||
Header="{Binding WaitSendTabTxt}"
|
||||
Header="待发货"
|
||||
SizeChanged="TabItem_SizeChanged">
|
||||
<Border
|
||||
Margin="4,0,4,4"
|
||||
BorderBrush="#e0e0e0"
|
||||
BorderThickness="0,0,0,1">
|
||||
<WrapPanel>
|
||||
<CheckBox
|
||||
x:Name="chkDirectSendFailed"
|
||||
Margin="6,8"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
BorderBrush="{StaticResource mainColorBrush}"
|
||||
Click="chkDirectSendFailed_Click"
|
||||
Content="直拍发货失败"
|
||||
FontSize="12" />
|
||||
<CheckBox
|
||||
x:Name="chkWaitSend48HourNoWaybill"
|
||||
Margin="6,8"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
BorderBrush="{StaticResource mainColorBrush}"
|
||||
Click="chkWaitSendNoWaybill_Click"
|
||||
Content="48小时未发货"
|
||||
FontSize="12" />
|
||||
<CheckBox
|
||||
x:Name="chkWaitSend72HourNoWaybill"
|
||||
Margin="6,8"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
BorderBrush="{StaticResource mainColorBrush}"
|
||||
Click="chkWaitSendNoWaybill_Click"
|
||||
Content="72小时未发货"
|
||||
FontSize="12" />
|
||||
</WrapPanel>
|
||||
<CheckBox
|
||||
x:Name="chkDirectSendFailed"
|
||||
Margin="6,8"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
BorderBrush="{StaticResource mainColorBrush}"
|
||||
Click="chkDirectSendFailed_Click"
|
||||
Content="直拍发货失败"
|
||||
FontSize="12" />
|
||||
</Border>
|
||||
</TabItem>
|
||||
<TabItem
|
||||
MinWidth="60"
|
||||
d:Header="待收货"
|
||||
Background="Transparent"
|
||||
BorderBrush="Transparent"
|
||||
Header="{Binding WaitReceiveTabTxt}"
|
||||
Header="待收货"
|
||||
SizeChanged="TabItem_SizeChanged">
|
||||
<Border
|
||||
Margin="4,0,4,4"
|
||||
@@ -761,43 +670,15 @@
|
||||
<ColumnDefinition Width="auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<WrapPanel>
|
||||
<CheckBox
|
||||
x:Name="chkNeedCheckExpress"
|
||||
Margin="6,8"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
BorderBrush="{StaticResource mainColorBrush}"
|
||||
Click="chkNeedCheckExpress_Click"
|
||||
Content="需核对物流"
|
||||
FontSize="12" />
|
||||
<Polyline
|
||||
Grid.Column="3"
|
||||
Width="10"
|
||||
Margin="5,0"
|
||||
VerticalAlignment="Center"
|
||||
Points="5,0 5,8 5,0"
|
||||
Stroke="{StaticResource mainColorBrush}"
|
||||
StrokeThickness="2" />
|
||||
<CheckBox
|
||||
x:Name="chk48HourNoWaybill"
|
||||
Margin="6,8"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
BorderBrush="{StaticResource mainColorBrush}"
|
||||
Click="chkNoWaybill_Click"
|
||||
Content="48小时未发货"
|
||||
FontSize="12" />
|
||||
<CheckBox
|
||||
x:Name="chk72HourNoWaybill"
|
||||
Margin="6,8"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
BorderBrush="{StaticResource mainColorBrush}"
|
||||
Click="chkNoWaybill_Click"
|
||||
Content="72小时未发货"
|
||||
FontSize="12" />
|
||||
</WrapPanel>
|
||||
<CheckBox
|
||||
x:Name="chkNeedCheckExpress"
|
||||
Margin="6,8"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
BorderBrush="{StaticResource mainColorBrush}"
|
||||
Click="chkNeedCheckExpress_Click"
|
||||
Content="需核对物流"
|
||||
FontSize="12" />
|
||||
<WrapPanel
|
||||
Grid.Column="2"
|
||||
d:Opacity="0.2"
|
||||
@@ -878,11 +759,10 @@
|
||||
</TabItem>
|
||||
<TabItem
|
||||
MinWidth="60"
|
||||
d:Header="需处理售后单"
|
||||
Background="#FF6666"
|
||||
BorderBrush="Transparent"
|
||||
Foreground="#FF2222"
|
||||
Header="{Binding EmergencyManualReturnOrderTabTxt}"
|
||||
Header="需处理售后单"
|
||||
SizeChanged="TabItem_SizeChanged">
|
||||
<Border
|
||||
Margin="4,0,4,4"
|
||||
@@ -1101,14 +981,13 @@
|
||||
<ComboBoxItem Content="请选择" />
|
||||
<ComboBoxItem Content="未申请" />
|
||||
<ComboBoxItem Content="申请中" />
|
||||
<ComboBoxItem Content="申请失败" />
|
||||
<ComboBoxItem Content="申请成功" />
|
||||
<ComboBoxItem Content="拒收失败" />
|
||||
<ComboBoxItem Content="拒收成功" />
|
||||
</ComboBox>
|
||||
</wpf:TitleContent>
|
||||
<wpf:TitleContent
|
||||
Title="拦截退回总店状态"
|
||||
Margin="8,0,4,0"
|
||||
Margin="4,0,4,0"
|
||||
VerticalContentAlignment="Center"
|
||||
FontSize="12"
|
||||
Foreground="Black"
|
||||
@@ -1124,7 +1003,7 @@
|
||||
<ComboBoxItem Content="请选择" />
|
||||
<ComboBoxItem Content="未拦截" />
|
||||
<ComboBoxItem Content="拦截中" />
|
||||
<ComboBoxItem Content="拦截失败" />
|
||||
<!--<ComboBoxItem Content="拦截失败" />-->
|
||||
<ComboBoxItem Content="拦截成功" />
|
||||
</ComboBox>
|
||||
</wpf:TitleContent>
|
||||
@@ -1157,11 +1036,10 @@
|
||||
</TabItem>
|
||||
<TabItem
|
||||
MinWidth="60"
|
||||
d:Header="退货仓自动售后单"
|
||||
Background="Transparent"
|
||||
BorderBrush="Transparent"
|
||||
Foreground="#FF7744"
|
||||
Header="{Binding EmergencyDistribReturnOrderTabTxt}"
|
||||
Header="退货仓自动售后单"
|
||||
SizeChanged="TabItem_SizeChanged">
|
||||
<Border
|
||||
Margin="4,0,4,4"
|
||||
@@ -1182,7 +1060,17 @@
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<WrapPanel>
|
||||
|
||||
<Button
|
||||
x:Name="btnBatchRefund2"
|
||||
Grid.Column="1"
|
||||
Height="20"
|
||||
MinWidth="48"
|
||||
Margin="6,6"
|
||||
Padding="4,0"
|
||||
Click="btnBatchRefund_Click"
|
||||
Content="批量申请买手售后"
|
||||
FontSize="12"
|
||||
Style="{StaticResource BasePageButtonStyle}" />
|
||||
<CheckBox
|
||||
x:Name="chkShopIsRefund"
|
||||
Grid.Column="0"
|
||||
@@ -1221,83 +1109,16 @@
|
||||
Click="chkUpShopAddressAnalyseFailed_Click"
|
||||
Content="总店地址解析失败"
|
||||
FontSize="12" />
|
||||
<Polyline
|
||||
Grid.Column="14"
|
||||
Width="10"
|
||||
Margin="5,0"
|
||||
VerticalAlignment="Center"
|
||||
Points="5,0 5,8 5,0"
|
||||
Stroke="{StaticResource mainColorBrush}"
|
||||
StrokeThickness="2"
|
||||
Visibility="Visible" />
|
||||
|
||||
<wpf:TitleContent
|
||||
Title="买手退货状态"
|
||||
Margin="4,0,4,0"
|
||||
VerticalContentAlignment="Center"
|
||||
FontSize="12"
|
||||
Foreground="Black"
|
||||
Placement="Left"
|
||||
TitleVerticalAlignment="Center">
|
||||
<ComboBox
|
||||
x:Name="cmbReturnOrderBuyerStatus"
|
||||
Width="130"
|
||||
Height="23"
|
||||
SelectedIndex="0"
|
||||
SelectionChanged="cmbReturnOrderBuyerStatus_SelectionChanged"
|
||||
Style="{StaticResource RoundedComboBox}">
|
||||
<ComboBoxItem Content="请选择" />
|
||||
<ComboBoxItem Content="买手待申请售后" />
|
||||
<ComboBoxItem Content="买手待退货" />
|
||||
<ComboBoxItem Content="买手已寄出待商家退款" />
|
||||
<ComboBoxItem Content="买手退货失败" />
|
||||
</ComboBox>
|
||||
</wpf:TitleContent>
|
||||
<Button
|
||||
x:Name="btnBatchRefund2"
|
||||
Grid.Column="1"
|
||||
Height="20"
|
||||
MinWidth="48"
|
||||
Margin="6,6"
|
||||
Padding="4,0"
|
||||
Click="btnBatchRefund_Click"
|
||||
Content="批量申请买手售后"
|
||||
FontSize="12"
|
||||
Style="{StaticResource BasePageButtonStyle}" />
|
||||
<wpf:TitleContent
|
||||
Title="退货仓状态"
|
||||
Margin="8,0,4,0"
|
||||
VerticalContentAlignment="Center"
|
||||
FontSize="12"
|
||||
Foreground="Black"
|
||||
Placement="Left"
|
||||
TitleVerticalAlignment="Center">
|
||||
<ComboBox
|
||||
x:Name="cmbReturnOrderStatus"
|
||||
Width="100"
|
||||
Height="23"
|
||||
SelectedIndex="0"
|
||||
SelectionChanged="cmbReturnOrderStatus_SelectionChanged"
|
||||
Style="{StaticResource RoundedComboBox}">
|
||||
<ComboBoxItem Content="请选择" />
|
||||
<ComboBoxItem Content="未创建" />
|
||||
<ComboBoxItem Content="创建失败" />
|
||||
<ComboBoxItem Content="已创建未到仓" />
|
||||
<ComboBoxItem Content="已到仓" />
|
||||
<ComboBoxItem Content="已发回" />
|
||||
</ComboBox>
|
||||
</wpf:TitleContent>
|
||||
</WrapPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
</TabItem>
|
||||
<TabItem
|
||||
MinWidth="60"
|
||||
d:Header="售后完成单"
|
||||
Background="Transparent"
|
||||
BorderBrush="Transparent"
|
||||
Foreground="#FFaa77"
|
||||
Header="{Binding RefundTabTxt}"
|
||||
Header="售后完成单"
|
||||
SizeChanged="TabItem_SizeChanged">
|
||||
<Border
|
||||
Margin="4,0,4,4"
|
||||
@@ -1385,10 +1206,9 @@
|
||||
</TabItem>
|
||||
<TabItem
|
||||
MinWidth="60"
|
||||
d:Header="全部订单"
|
||||
Background="Transparent"
|
||||
BorderBrush="Transparent"
|
||||
Header="{Binding AllOrderTabTxt}"
|
||||
Header="全部订单"
|
||||
SizeChanged="TabItem_SizeChanged" />
|
||||
<!--<TabItem Header="发货异常">
|
||||
<Grid Background="#FFE5E5E5"/>
|
||||
@@ -1419,8 +1239,7 @@
|
||||
CanUserReorderColumns="False"
|
||||
ColumnDisplayIndexChanged="dgOrderHeader_ColumnDisplayIndexChanged"
|
||||
ColumnHeaderHeight="{Binding ElementName=lstTitle, Path=ActualHeight}"
|
||||
LayoutUpdated="dgOrderHeader_LayoutUpdated"
|
||||
Sorting="dgOrderHeader_Sorting">
|
||||
LayoutUpdated="dgOrderHeader_LayoutUpdated">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn
|
||||
Width="38"
|
||||
@@ -1467,20 +1286,9 @@
|
||||
Header="店铺单号"
|
||||
HeaderStyle="{StaticResource BaseDataGridColumnHeaderStyle}" />
|
||||
<DataGridTextColumn
|
||||
x:Name="dgHeaderTime"
|
||||
Width="90*"
|
||||
Header="交易时间 ▼"
|
||||
HeaderStyle="{StaticResource BaseDataGridColumnHeaderStyle}">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<!-- 设置 Cursor 为 Hand -->
|
||||
<TextBlock
|
||||
x:Name="tbHeaderTimeTxt"
|
||||
Cursor="Hand"
|
||||
Text="{Binding RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}, Path=DataContext.ColumnHeaderTitle}" />
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
</DataGridTextColumn>
|
||||
Header="交易时间"
|
||||
HeaderStyle="{StaticResource BaseDataGridColumnHeaderStyle}" />
|
||||
<DataGridTextColumn
|
||||
Width="65*"
|
||||
Header="利润"
|
||||
@@ -1512,14 +1320,9 @@
|
||||
Grid.Row="4"
|
||||
Margin="7,0,7,0"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
AlternationCount="1000000"
|
||||
BorderThickness="0"
|
||||
ScrollViewer.CanContentScroll="True"
|
||||
VirtualizingPanel.IsVirtualizingWhenGrouping="True"
|
||||
VirtualizingPanel.ScrollUnit="Pixel"
|
||||
VirtualizingStackPanel.IsVirtualizing="True"
|
||||
VirtualizingStackPanel.VirtualizationMode="Recycling">
|
||||
<!-- VirtualizingStackPanel.VirtualizationMode="Recycling" -->
|
||||
VirtualizingPanel.ScrollUnit="Pixel">
|
||||
<!-- 使用自定义属性模板去除ListBox高亮显示框 -->
|
||||
<ListBox.ItemContainerStyle>
|
||||
<Style TargetType="ListBoxItem">
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -43,53 +43,8 @@
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="6" />
|
||||
<RowDefinition Height="auto" />
|
||||
<RowDefinition Height="auto" />
|
||||
<RowDefinition Height="auto" />
|
||||
<RowDefinition Height="auto" />
|
||||
<RowDefinition Height="auto" />
|
||||
<RowDefinition Height="6" />
|
||||
</Grid.RowDefinitions>
|
||||
<local:OrderListRowItemCtrl
|
||||
Grid.Row="1"
|
||||
DataContext="{Binding orderItem}"
|
||||
Visibility="{Binding OrderItemVisibility}" />
|
||||
<!--<local:OrderListRowItemCtrl
|
||||
Grid.Row="2"
|
||||
DataContext="{Binding orderItem2}"
|
||||
Visibility="{Binding OrderItemVisibility}" />
|
||||
<local:OrderListRowItemCtrl
|
||||
Grid.Row="3"
|
||||
DataContext="{Binding orderItem2}"
|
||||
Visibility="{Binding OrderItemVisibility}" />
|
||||
<local:OrderListRowItemCtrl
|
||||
Grid.Row="4"
|
||||
DataContext="{Binding orderItem3}"
|
||||
Visibility="{Binding OrderItemVisibility}" />
|
||||
<local:OrderListRowItemCtrl
|
||||
Grid.Row="5"
|
||||
DataContext="{Binding orderItem4}"
|
||||
Visibility="{Binding OrderItemVisibility}" />-->
|
||||
<!--<ItemsControl Grid.Row="1" ItemsSource="{Binding orderItems}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<local:OrderListRowItemCtrl DataContext="{Binding}" />
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>-->
|
||||
<!--<ListBox
|
||||
Grid.Row="1"
|
||||
ItemsSource="{Binding orderItems}"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Disabled"
|
||||
VirtualizingStackPanel.IsVirtualizing="True"
|
||||
VirtualizingStackPanel.VirtualizationMode="Recycling">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<local:OrderListRowItemCtrl DataContext="{Binding}" />
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>-->
|
||||
<!--<TextBlock Text="{Binding ProductName}" Margin="20,0,0,0"/>-->
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
|
||||
@@ -41,23 +41,21 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
|
||||
private async void OrderListRowCtrl_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
//await Task.Run(() => { Thread.Sleep(1); });
|
||||
|
||||
//if (this.DataContext is oms_wei_order_info order)
|
||||
//{
|
||||
// int index = 0;
|
||||
// foreach (var orderItem in order.orderItems)
|
||||
// {
|
||||
// gridChildOrder.RowDefinitions.Insert(gridChildOrder.RowDefinitions.Count - 1, new RowDefinition() { Height = GridLength.Auto });
|
||||
// index++;
|
||||
// var rowItem = new OrderListRowItemCtrl() { DataContext = orderItem, Name = "rowItem" + index };
|
||||
// Grid.SetRow(rowItem, index);
|
||||
// this.gridChildOrder.Children.Add(rowItem);
|
||||
// if (index >= 5)
|
||||
// break;
|
||||
// }
|
||||
//}
|
||||
}
|
||||
if (this.DataContext is oms_wei_order_info order)
|
||||
{
|
||||
int index = 0;
|
||||
foreach (var orderItem in order.orderItems)
|
||||
{
|
||||
gridChildOrder.RowDefinitions.Insert(gridChildOrder.RowDefinitions.Count - 1, new RowDefinition() { Height = GridLength.Auto });
|
||||
index++;
|
||||
var rowItem = new OrderListRowItemCtrl() { DataContext = orderItem, Name = "rowItem" + index };
|
||||
Grid.SetRow(rowItem, index);
|
||||
this.gridChildOrder.Children.Add(rowItem);
|
||||
if (index >= 5)
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void CheckBox_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:uc="clr-namespace:_29WxOrderWpf.UserControls"
|
||||
d:DesignHeight="50"
|
||||
d:DesignWidth="850"
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<Border Background="{StaticResource ListRowBorderColorBrush}" CornerRadius="12,12,0,0">
|
||||
@@ -26,7 +26,6 @@
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="auto" />
|
||||
<ColumnDefinition Width="auto" />
|
||||
<ColumnDefinition Width="auto" />
|
||||
<ColumnDefinition Width="20" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBox
|
||||
@@ -40,7 +39,7 @@
|
||||
Foreground="{Binding OrderBuyTypeColor}"
|
||||
IsReadOnly="True"
|
||||
Text="{Binding OrderBuyType}"
|
||||
Visibility="{Binding OrderBuyTypeVisibility}" />
|
||||
Visibility="{Binding OrderBuyType, Converter={StaticResource HasTextVisibility}}" />
|
||||
<TextBox
|
||||
Grid.Column="1"
|
||||
Margin="8,8,-4,8"
|
||||
@@ -159,7 +158,7 @@
|
||||
BorderThickness="0"
|
||||
FontSize="7"
|
||||
FontWeight="Bold"
|
||||
Foreground="{Binding Shop.LoginStatusStrColor}"
|
||||
Foreground="{Binding Shop.LoginStatusStr, Converter={StaticResource statusToColorBrushConverter}}"
|
||||
IsReadOnly="True"
|
||||
Text="{Binding Shop.LoginStatusStr}"
|
||||
WaterMark="店铺状态" />
|
||||
@@ -168,7 +167,6 @@
|
||||
Grid.Column="6"
|
||||
Margin="4,8,4,8"
|
||||
VerticalAlignment="Center"
|
||||
d:Text="店铺名称"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
Cursor="Hand"
|
||||
@@ -207,27 +205,13 @@
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
FontSize="14"
|
||||
Foreground="#FF8888"
|
||||
Foreground="Gray"
|
||||
IsReadOnly="True"
|
||||
Text="{Binding OrderDiffItemCountStr}"
|
||||
WaterMark="该订单共有 1 条不同商品记录" />
|
||||
|
||||
<TextBlock
|
||||
Grid.Column="11"
|
||||
Margin="0,0,8,0"
|
||||
HorizontalAlignment="Right"
|
||||
Cursor="Hand"
|
||||
FontSize="20"
|
||||
FontWeight="Bold"
|
||||
Foreground="{StaticResource mainColorBrush}"
|
||||
MouseLeftButtonUp="TextBlock_MouseLeftButtonUp"
|
||||
Style="{StaticResource TextBlockIcon}"
|
||||
Text="{StaticResource txt-arrow_sync}"
|
||||
ToolTip="刷新订单状态" />
|
||||
<!-- Foreground="{Binding ElementName=b_gift, Path=BorderBrush}" -->
|
||||
<TextBlock
|
||||
Grid.Column="12"
|
||||
Margin="0,0,8,0"
|
||||
Margin="10"
|
||||
VerticalAlignment="Center"
|
||||
d:Text="仅退款/退货退款"
|
||||
Foreground="Gray"
|
||||
@@ -235,8 +219,9 @@
|
||||
|
||||
<Border
|
||||
x:Name="borderFlag"
|
||||
Grid.Column="13"
|
||||
Grid.Column="12"
|
||||
Width="auto"
|
||||
Height="15"
|
||||
Margin="2"
|
||||
VerticalAlignment="Center"
|
||||
Background="Transparent"
|
||||
@@ -244,13 +229,6 @@
|
||||
MouseLeftButtonDown="borderFlag_MouseLeftButtonDown">
|
||||
<!--<Path Margin="0,0,0,0" Fill="{StaticResource FlagGrayBrush}" Data="M 0,0 L 1,0 L 1,1 L 10,1 L 7,4 L 10,7 L 1,7 L 1,12 L 0,12 Z" Stretch="Uniform" />-->
|
||||
<WrapPanel VerticalAlignment="Center">
|
||||
<Button
|
||||
Width="60"
|
||||
Height="22"
|
||||
Margin="0,0,10,0"
|
||||
Click="btn_createOrderSupportTicket"
|
||||
Content="创建工单"
|
||||
Style="{StaticResource BasePageButtonStyle}" />
|
||||
<TextBlock
|
||||
VerticalAlignment="Center"
|
||||
FontSize="12"
|
||||
@@ -262,10 +240,9 @@
|
||||
Margin="2,0,0,0"
|
||||
d:Fill="SkyBlue"
|
||||
Data="M 0,0 L 1,0 L 1,1 L 10,1 L 7,4 L 10,7 L 1,7 L 1,12 L 0,12 Z"
|
||||
Fill="{Binding ColourFlagBrush}"
|
||||
Fill="{Binding colour_flag, Converter={StaticResource flagColorConverter}}"
|
||||
Stretch="Uniform" />
|
||||
<!-- ColourFlagBrush -->
|
||||
<!-- Fill="{Binding colour_flag, Converter={StaticResource flagColorConverter}}" -->
|
||||
|
||||
</WrapPanel>
|
||||
</Border>
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ using AllBase;
|
||||
using AllBase.Helper;
|
||||
using AllBase.Model.DBModel;
|
||||
using NaiBa.Util.Extension;
|
||||
using OrderSupportTicket.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -26,45 +25,43 @@ using Work._29Tools.Forms.ShopForms;
|
||||
|
||||
namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
{
|
||||
/// <summary>
|
||||
/// OrderListRowHeaderCtrl.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class OrderListRowHeaderCtrl : UserControl
|
||||
{
|
||||
public static DateTime LastRefreshTime = DateTime.Now.AddSeconds(-5);
|
||||
/// <summary>
|
||||
/// OrderListRowHeaderCtrl.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class OrderListRowHeaderCtrl : UserControl
|
||||
{
|
||||
public OrderListRowHeaderCtrl()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.DataContextChanged += OrderListRowHeaderCtrl_DataContextChanged;
|
||||
txtOrderId.AddHandler(TextBox.MouseUpEvent, new MouseButtonEventHandler(txtOrderId_MouseLeftButtonUp), true);
|
||||
txtShopName.AddHandler(TextBox.MouseUpEvent, new MouseButtonEventHandler(txtShopName_MouseLeftButtonUp), true);
|
||||
}
|
||||
|
||||
public OrderListRowHeaderCtrl()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.DataContextChanged += OrderListRowHeaderCtrl_DataContextChanged;
|
||||
txtOrderId.AddHandler(TextBox.MouseUpEvent, new MouseButtonEventHandler(txtOrderId_MouseLeftButtonUp), true);
|
||||
txtShopName.AddHandler(TextBox.MouseUpEvent, new MouseButtonEventHandler(txtShopName_MouseLeftButtonUp), true);
|
||||
}
|
||||
private void txtShopName_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (this.DataContext is oms_wei_order_info order)
|
||||
{
|
||||
var shop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ErpShopId == order.shop_id.ParseToString());
|
||||
if (shop != null)
|
||||
{
|
||||
WXShopLoginForm shopLoginForm = new WXShopLoginForm(shop);
|
||||
ShopBLL.CheckShopLogin(shop);
|
||||
if (shop.LoginStatus == "登录成功")
|
||||
{
|
||||
// 在线直接进店
|
||||
shopLoginForm.openType = EnumOpenType.manage;
|
||||
shopLoginForm.WindowState = System.Windows.Forms.FormWindowState.Maximized;
|
||||
shopLoginForm.InitUrl = "https://store.weixin.qq.com/shop/home";
|
||||
shopLoginForm.Show();
|
||||
}
|
||||
else
|
||||
{
|
||||
// 掉线登录
|
||||
shopLoginForm.openType = EnumOpenType.login;
|
||||
shopLoginForm.ShowDialog();
|
||||
|
||||
private void txtShopName_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (this.DataContext is oms_wei_order_info order)
|
||||
{
|
||||
var shop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ErpShopId == order.shop_id.ParseToString());
|
||||
if (shop != null)
|
||||
{
|
||||
WXShopLoginForm shopLoginForm = new WXShopLoginForm(shop);
|
||||
ShopBLL.CheckShopLogin(shop);
|
||||
if (shop.LoginStatus == "登录成功")
|
||||
{
|
||||
// 在线直接进店
|
||||
shopLoginForm.openType = EnumOpenType.manage;
|
||||
shopLoginForm.WindowState = System.Windows.Forms.FormWindowState.Maximized;
|
||||
shopLoginForm.InitUrl = "https://store.weixin.qq.com/shop/home";
|
||||
shopLoginForm.Show();
|
||||
}
|
||||
else
|
||||
{
|
||||
// 掉线登录
|
||||
shopLoginForm.openType = EnumOpenType.login;
|
||||
shopLoginForm.ShowDialog();
|
||||
|
||||
if (shop.LoginStatus == "登录成功")
|
||||
if (shop.LoginStatus == "登录成功")
|
||||
{
|
||||
shop.Is29Supplier = false;
|
||||
for (int i = 0; i < 100; i++)
|
||||
@@ -85,87 +82,87 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
if (i * 20 >= totalCount)
|
||||
break;
|
||||
}
|
||||
|
||||
foreach (var ord in GlobalConfig.lstFilterOrder.Where(o => o.shop_id.ParseToString() == shop.ErpShopId).ToList())
|
||||
{
|
||||
// 更新代发管理情况
|
||||
foreach (var orderItem in ord.orderItems)
|
||||
Dispatcher.Invoke(new Action(() => { orderItem.UpdateOrderItemBuyButton(); }));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var ord in GlobalConfig.lstFilterOrder.Where(o => o.shop_id.ParseToString() == shop.ErpShopId).ToList())
|
||||
{
|
||||
// 更新代发管理情况
|
||||
foreach (var orderItem in ord.orderItems)
|
||||
Dispatcher.Invoke(new Action(() => { orderItem.UpdateOrderItemBuyButton(); }));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
private void txtOrderId_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (this.DataContext is oms_wei_order_info order)
|
||||
{
|
||||
var shop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ErpShopId == order.shop_id.ParseToString());
|
||||
if (shop != null)
|
||||
{
|
||||
WXShopLoginForm shopLoginForm = new WXShopLoginForm(shop);
|
||||
shopLoginForm.openType = EnumOpenType.manage;
|
||||
shopLoginForm.WindowState = System.Windows.Forms.FormWindowState.Maximized;
|
||||
|
||||
{
|
||||
shopLoginForm.InitUrl = "https://store.weixin.qq.com/shop/order/detail?orderid=" + order.order_id;
|
||||
}
|
||||
shopLoginForm.Show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void txtOrderId_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (this.DataContext is oms_wei_order_info order)
|
||||
{
|
||||
var shop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ErpShopId == order.shop_id.ParseToString());
|
||||
if (shop != null)
|
||||
{
|
||||
WXShopLoginForm shopLoginForm = new WXShopLoginForm(shop);
|
||||
shopLoginForm.openType = EnumOpenType.manage;
|
||||
shopLoginForm.WindowState = System.Windows.Forms.FormWindowState.Maximized;
|
||||
private void OrderListRowHeaderCtrl_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
if (this.DataContext is oms_wei_order_info order)
|
||||
{
|
||||
if (order.orderItems.Count > 5)
|
||||
{
|
||||
txtCount.Text = "该订单共计 " + order.orderItems.Count + " 件商品";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
shopLoginForm.InitUrl = "https://store.weixin.qq.com/shop/order/detail?orderid=" + order.order_id;
|
||||
}
|
||||
shopLoginForm.Show();
|
||||
}
|
||||
}
|
||||
}
|
||||
private void Path_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
//var orderId = ((sender as Border)?.Tag).ParseToString();
|
||||
if (this.DataContext is oms_wei_order_info order)
|
||||
{
|
||||
|
||||
private void OrderListRowHeaderCtrl_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
if (this.DataContext is oms_wei_order_info order)
|
||||
{
|
||||
if (order.orderItems.Count > 5)
|
||||
{
|
||||
//txtCount.Text = "该订单共计 " + order.orderItems.Count + " 件商品";
|
||||
}
|
||||
}
|
||||
}
|
||||
try
|
||||
{
|
||||
//Clipboard.SetText(order.order_id); // 复制成功,但会报错,改为SetDataObject
|
||||
Clipboard.SetDataObject(order.order_id);
|
||||
BaseMsgWindow.ShowAnimateMessage("复制成功");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
BaseMsgWindow.ShowError("复制失败 " + ex.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void Path_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
//var orderId = ((sender as Border)?.Tag).ParseToString();
|
||||
if (this.DataContext is oms_wei_order_info order)
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
//Clipboard.SetText(order.order_id); // 复制成功,但会报错,改为SetDataObject
|
||||
Clipboard.SetDataObject(order.order_id);
|
||||
BaseMsgWindow.ShowAnimateMessage("复制成功");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
BaseMsgWindow.ShowError("复制失败 " + ex.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void pathShop_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (this.DataContext is oms_wei_order_info order)
|
||||
{
|
||||
var shop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ErpShopId == order.shop_id.ParseToString());
|
||||
if (shop != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
Clipboard.SetDataObject(shop.ShopAccount);
|
||||
BaseMsgWindow.ShowAnimateMessage("复制成功");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
BaseMsgWindow.ShowError("复制失败 " + ex.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
private void pathShop_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (this.DataContext is oms_wei_order_info order)
|
||||
{
|
||||
var shop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ErpShopId == order.shop_id.ParseToString());
|
||||
if (shop != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
Clipboard.SetDataObject(shop.ShopAccount);
|
||||
BaseMsgWindow.ShowAnimateMessage("复制成功");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
BaseMsgWindow.ShowError("复制失败 " + ex.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void borderFlag_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
@@ -198,59 +195,9 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
order.colour_flag = flag;
|
||||
Thread.Sleep(1000);
|
||||
Dispatcher.Invoke(new Action(() => { MainWindow.Instance.orderListCtrl.FilterOneOrder(order); }));
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 创建工单
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private async void btn_createOrderSupportTicket(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!(this.DataContext is oms_wei_order_info order))
|
||||
return;
|
||||
|
||||
var shop = order.Shop
|
||||
?? GlobalConfig.ShopLoginList.FirstOrDefault(
|
||||
s => s.ErpShopId == order.shop_id.ParseToString());
|
||||
var appId = shop?.ShopId?.Trim();
|
||||
if (string.IsNullOrWhiteSpace(appId)
|
||||
|| string.IsNullOrWhiteSpace(order.order_id))
|
||||
{
|
||||
BaseMsgWindow.ShowAnimateMessage(
|
||||
"订单缺少店铺 APPID 或订单号,无法创建工单",
|
||||
"Error",
|
||||
5);
|
||||
return;
|
||||
}
|
||||
|
||||
var ticketOrder = TicketOrderOption.FromWechatOrder(order, appId);
|
||||
|
||||
try
|
||||
{
|
||||
await MainWindow.Instance.CreateOrderSupportTicketAsync(ticketOrder);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
BaseMsgWindow.ShowError("打开工单窗口失败:" + ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
private async void TextBlock_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (!(this.DataContext is oms_wei_order_info order))
|
||||
return;
|
||||
|
||||
if (LastRefreshTime > DateTime.Now.AddSeconds(-5))
|
||||
{
|
||||
BaseMsgWindow.ShowAnimateMessage("操作太快了请稍候再点击", "Error", 5);
|
||||
return;
|
||||
}
|
||||
|
||||
LastRefreshTime = DateTime.Now;
|
||||
await Task.Run(async () => { await MainWindow.Instance.orderListCtrl.GetOrder(order.order_id); });
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -2,7 +2,7 @@
|
||||
x:Class="_29WxOrderWpf.Ctrls.OrderCtrls.OrderTaskDialogView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:comn="WxOrder.Framework"
|
||||
xmlns:comn="clr-namespace:_29WxOrderWpf.Common"
|
||||
xmlns:converters="clr-namespace:_29WxOrderWpf.Converters"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:_29WxOrderWpf.Ctrls.OrderCtrls"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using WxOrder.Framework.Commons;
|
||||
using _29WxOrderWpf.Commands;
|
||||
using _29WxOrderWpf.Services;
|
||||
using AllBase.Model.MvvmBaseClasses;
|
||||
using AllBase.Util;
|
||||
|
||||
@@ -1,85 +0,0 @@
|
||||
<UserControl
|
||||
x:Class="_29WxOrderWpf.Ctrls.OrderCtrls.OrderTransitListCtrl"
|
||||
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:local="clr-namespace:_29WxOrderWpf.Ctrls.OrderCtrls"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:wpf="WPFCommon"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
Background="White"
|
||||
Foreground="DimGray"
|
||||
Loaded="OrderTransitListCtrl_Loaded"
|
||||
mc:Ignorable="d">
|
||||
<UserControl.Resources>
|
||||
<Style BasedOn="{StaticResource TitleContentBaseStyle}" TargetType="wpf:TitleContent">
|
||||
<Setter Property="Placement" Value="Left" />
|
||||
<Setter Property="TitleVerticalAlignment" Value="Center" />
|
||||
<Setter Property="LeftTitlePadding" Value="0,0,0,0" />
|
||||
</Style>
|
||||
<Style TargetType="wpf:SpacingStackPanel">
|
||||
<Setter Property="Margin" Value="3,0" />
|
||||
</Style>
|
||||
</UserControl.Resources>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<StackPanel Height="30" Orientation="Horizontal">
|
||||
<TextBlock
|
||||
Margin="10,0,0,0"
|
||||
VerticalAlignment="Center"
|
||||
Text="店铺:" />
|
||||
<TextBox
|
||||
VerticalContentAlignment="Center"
|
||||
d:Text="音诉云仓"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
Foreground="DimGray"
|
||||
IsReadOnly="True"
|
||||
Text="{Binding ShopNameStr}" />
|
||||
<TextBlock
|
||||
Margin="10,0,0,0"
|
||||
VerticalAlignment="Center"
|
||||
Text="订单号:" />
|
||||
<TextBox
|
||||
VerticalContentAlignment="Center"
|
||||
d:Text="3700000000000000"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
Foreground="DimGray"
|
||||
IsReadOnly="True"
|
||||
Text="{Binding OrderIdStr}" />
|
||||
</StackPanel>
|
||||
<ListBox
|
||||
x:Name="lbxTransitList"
|
||||
Grid.Row="4"
|
||||
Margin="7,0,7,0"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
BorderThickness="0">
|
||||
<!-- 使用自定义属性模板去除ListBox高亮显示框 -->
|
||||
<ListBox.ItemContainerStyle>
|
||||
<Style TargetType="ListBoxItem">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ListBoxItem">
|
||||
<ContentPresenter
|
||||
Content="{TemplateBinding Content}"
|
||||
ContentStringFormat="{TemplateBinding ContentStringFormat}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}" />
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</ListBox.ItemContainerStyle>
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<!-- 此处绑定将数据源传递给子自定义控件 -->
|
||||
<local:OrderTransitListDetailCtrl DataContext="{Binding}" />
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -1,64 +0,0 @@
|
||||
using AllBase.Model.DBModel;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace _29WxOrderWpf.Ctrls.OrderCtrls;
|
||||
|
||||
/// <summary>
|
||||
/// OrderTransitListCtrl.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class OrderTransitListCtrl : UserControl
|
||||
{
|
||||
OrderTransitListCtrlViewModel ViewModel;
|
||||
|
||||
public OrderTransitListCtrl(oms_wei_order_item_transit_model transitInfo)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
UpdateViewModel(transitInfo);
|
||||
}
|
||||
|
||||
public void UpdateViewModel(oms_wei_order_item_transit_model transitInfo)
|
||||
{
|
||||
ViewModel = new OrderTransitListCtrlViewModel(transitInfo);
|
||||
ViewModel.RequestClose += ViewModel_RequestClose;
|
||||
|
||||
DataContext = ViewModel;
|
||||
this.lbxTransitList.ItemsSource = ViewModel.TransitInfo.OrderItemTransitDetailList;
|
||||
}
|
||||
|
||||
private void ViewModel_RequestClose()
|
||||
{
|
||||
Window parentWindow = Window.GetWindow(this);
|
||||
if (this.IsLoaded && parentWindow != null)
|
||||
parentWindow.Close();
|
||||
}
|
||||
|
||||
private void OrderTransitListCtrl_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Window parentWindow = Window.GetWindow(this);
|
||||
if (parentWindow != null)
|
||||
{
|
||||
parentWindow.Closed += ChangeWaybillView_Closed;
|
||||
}
|
||||
ViewModel.Start();
|
||||
}
|
||||
|
||||
private void ChangeWaybillView_Closed(object sender, EventArgs e)
|
||||
{
|
||||
ViewModel.Stop();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,62 +0,0 @@
|
||||
using AllBase.Model.DBModel;
|
||||
using AllBase.Model.MvvmBaseClasses;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace _29WxOrderWpf.Ctrls.OrderCtrls;
|
||||
|
||||
public class OrderTransitListCtrlViewModel : PropertyNotifyObject
|
||||
{
|
||||
private volatile bool _isWindowLoaded = false;
|
||||
|
||||
public oms_wei_order_item_transit_model TransitInfo
|
||||
{
|
||||
get { return this.GetValue(x => x.TransitInfo); }
|
||||
set { this.SetValue(x => x.TransitInfo, value); }
|
||||
}
|
||||
public oms_wei_order_item_info OrderItem
|
||||
{
|
||||
get { return this.GetValue(x => x.OrderItem); }
|
||||
set { this.SetValue(x => x.OrderItem, value); }
|
||||
}
|
||||
public string OrderIdStr
|
||||
{
|
||||
get { return this.GetValue(x => x.OrderIdStr); }
|
||||
set { this.SetValue(x => x.OrderIdStr, value); }
|
||||
}
|
||||
public string ShopNameStr
|
||||
{
|
||||
get { return this.GetValue(x => x.ShopNameStr); }
|
||||
set { this.SetValue(x => x.ShopNameStr, value); }
|
||||
}
|
||||
|
||||
|
||||
/// <summary>请求关闭窗口</summary>
|
||||
public event Action RequestClose;
|
||||
|
||||
public OrderTransitListCtrlViewModel(oms_wei_order_item_transit_model transitInfo)
|
||||
{
|
||||
TransitInfo = transitInfo;
|
||||
OrderItem = transitInfo?.OrderItem;
|
||||
OrderIdStr = OrderItem?.order_id;
|
||||
ShopNameStr = OrderItem?.ItemOrder?.Shop?.ShopAccount;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 窗口加载完成时调用
|
||||
/// </summary>
|
||||
public void Start()
|
||||
{
|
||||
_isWindowLoaded = true;
|
||||
}
|
||||
/// <summary>
|
||||
/// 窗口关闭时调用,停止后台任务
|
||||
/// </summary>
|
||||
public void Stop()
|
||||
{
|
||||
_isWindowLoaded = false;
|
||||
}
|
||||
}
|
||||
@@ -1,411 +0,0 @@
|
||||
<UserControl
|
||||
x:Class="_29WxOrderWpf.Ctrls.OrderCtrls.OrderTransitListDetailCtrl"
|
||||
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:local="clr-namespace:_29WxOrderWpf.Ctrls.OrderCtrls"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:wpf="WPFCommon"
|
||||
d:DesignHeight="280"
|
||||
d:DesignWidth="1200"
|
||||
Background="White"
|
||||
mc:Ignorable="d">
|
||||
<UserControl.Resources>
|
||||
<Style BasedOn="{StaticResource TitleContentBaseStyle}" TargetType="wpf:TitleContent">
|
||||
<Setter Property="Placement" Value="Left" />
|
||||
<Setter Property="TitleVerticalAlignment" Value="Center" />
|
||||
<Setter Property="LeftTitlePadding" Value="0,0,0,0" />
|
||||
</Style>
|
||||
<Style TargetType="wpf:SpacingStackPanel">
|
||||
<Setter Property="Margin" Value="3,0" />
|
||||
</Style>
|
||||
</UserControl.Resources>
|
||||
<Border
|
||||
MinHeight="50"
|
||||
Margin="5"
|
||||
BorderBrush="#8087CEEB"
|
||||
BorderThickness="1"
|
||||
CornerRadius="10">
|
||||
<Grid Opacity="{Binding Opacity}">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<Border Background="#5087CEEB" CornerRadius="8,8,0,0">
|
||||
<StackPanel MinHeight="30" Orientation="Horizontal">
|
||||
<TextBlock
|
||||
Margin="10,0,0,0"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
Text="仓库订单号" />
|
||||
<TextBox
|
||||
VerticalContentAlignment="Center"
|
||||
d:Text="261008-123456789012345"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
Foreground="DimGray"
|
||||
IsReadOnly="True"
|
||||
Text="{Binding OrderCode}" />
|
||||
<TextBlock
|
||||
Margin="10,0,0,0"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
d:Text="发货包裹"
|
||||
FontWeight="Bold"
|
||||
Foreground="{Binding TransitTypeStrColor}"
|
||||
Text="{Binding TransitTypeStr}" />
|
||||
<TextBox
|
||||
VerticalContentAlignment="Center"
|
||||
d:Text="ABCDEF1"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
Foreground="DimGray"
|
||||
IsReadOnly="True"
|
||||
Text="{Binding SourceCode}" />
|
||||
</StackPanel>
|
||||
</Border>
|
||||
<Grid Grid.Row="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="0.7*" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="0.5*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Border
|
||||
Margin="0,10"
|
||||
BorderBrush="LightSkyBlue"
|
||||
BorderThickness="0,0,1,0">
|
||||
<wpf:SpacingStackPanel
|
||||
Margin="10,10"
|
||||
VerticalAlignment="Center"
|
||||
Orientation="Vertical"
|
||||
VerticalSpacing="4">
|
||||
<wpf:TitleContent Title="交易单号:" Foreground="#FF666666">
|
||||
<TextBox
|
||||
d:Text="371234567890123456"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
Foreground="#FF888888"
|
||||
IsReadOnly="True"
|
||||
Text="{Binding WxOrderId}"
|
||||
TextWrapping="Wrap" />
|
||||
</wpf:TitleContent>
|
||||
<wpf:TitleContent Title="采购账户:" Foreground="#FF666666">
|
||||
<WrapPanel>
|
||||
<TextBox
|
||||
x:Name="txtOutOrderBuyer"
|
||||
d:Text="张三"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
Cursor="Hand"
|
||||
Foreground="#AA0000FF"
|
||||
IsReadOnly="True"
|
||||
Tag="{Binding OutBuyerId}"
|
||||
Text="{Binding OutBuyerName}"
|
||||
TextWrapping="Wrap" />
|
||||
<Border
|
||||
x:Name="borderTransitBuyerRefundStatus"
|
||||
Height="auto"
|
||||
MinWidth="30"
|
||||
Margin="2,0,0,0"
|
||||
HorizontalAlignment="Center"
|
||||
d:Background="{StaticResource PageOkBrush}"
|
||||
d:BorderBrush="{StaticResource PageOkBrush}"
|
||||
Background="{Binding TransitDetailRefundStatusBackColor}"
|
||||
BorderBrush="{Binding TransitDetailRefundStatusBackColor}"
|
||||
BorderThickness="1"
|
||||
CornerRadius="2"
|
||||
Visibility="{Binding TransitDetailRefundStatusStrVisibility}">
|
||||
<TextBlock
|
||||
x:Name="txtRefundStatus"
|
||||
MinWidth="20"
|
||||
Padding="0"
|
||||
VerticalAlignment="Center"
|
||||
d:Text="退货成功"
|
||||
Background="Transparent"
|
||||
Foreground="White"
|
||||
Text="{Binding TransitDetailRefundStatusStr}" />
|
||||
</Border>
|
||||
</WrapPanel>
|
||||
|
||||
</wpf:TitleContent>
|
||||
<wpf:TitleContent Title="采购单号:" Foreground="#FF666666">
|
||||
|
||||
<TextBox
|
||||
x:Name="txtOutOrderId"
|
||||
d:Text="261008-1234567890123456"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
Cursor="Hand"
|
||||
Foreground="#AA0000FF"
|
||||
IsReadOnly="True"
|
||||
Text="{Binding OutOrderId}"
|
||||
TextWrapping="Wrap" />
|
||||
</wpf:TitleContent>
|
||||
<wpf:TitleContent Title="下单时间:" Foreground="#FF666666">
|
||||
<TextBox
|
||||
d:Text="26-10-07 10:33:33"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
Foreground="#FF888888"
|
||||
IsReadOnly="True"
|
||||
Text="{Binding WxOrderCreateTimeStr}"
|
||||
TextWrapping="Wrap" />
|
||||
</wpf:TitleContent>
|
||||
<wpf:TitleContent Title="添加时间:" Foreground="#FF666666">
|
||||
<TextBox
|
||||
d:Text="26-10-07 18:33:33"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
Foreground="#FF888888"
|
||||
IsReadOnly="True"
|
||||
Text="{Binding TransitAddTimeStr}"
|
||||
TextWrapping="Wrap" />
|
||||
</wpf:TitleContent>
|
||||
<wpf:TitleContent Title="创建时间:" Foreground="#FF666666">
|
||||
<TextBox
|
||||
d:Text="26-10-08 00:33:33"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
Foreground="#FF888888"
|
||||
IsReadOnly="True"
|
||||
Text="{Binding CreateTimeStr}"
|
||||
TextWrapping="Wrap" />
|
||||
</wpf:TitleContent>
|
||||
<!--<wpf:TitleContent Title="店铺名称:">
|
||||
<TextBox
|
||||
d:Text="芥麦亚"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
IsReadOnly="True"
|
||||
Text="{Binding ShopName}"
|
||||
TextWrapping="Wrap" />
|
||||
</wpf:TitleContent>-->
|
||||
</wpf:SpacingStackPanel>
|
||||
</Border>
|
||||
<Border
|
||||
Grid.Column="1"
|
||||
Margin="0,10"
|
||||
BorderBrush="LightSkyBlue"
|
||||
BorderThickness="0,0,1,0"
|
||||
Opacity="0.5">
|
||||
<wpf:SpacingStackPanel
|
||||
Margin="10,10"
|
||||
VerticalAlignment="Center"
|
||||
Orientation="Vertical"
|
||||
VerticalSpacing="4">
|
||||
<wpf:TitleContent
|
||||
Title="{Binding WarehouseName}"
|
||||
d:Title="上海仓"
|
||||
FontWeight="Bold">
|
||||
<WrapPanel>
|
||||
<TextBox
|
||||
d:Text="已出仓"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
FontWeight="Normal"
|
||||
IsReadOnly="True"
|
||||
Text="{Binding WarehouseStatus}"
|
||||
TextWrapping="Wrap" />
|
||||
</WrapPanel>
|
||||
|
||||
</wpf:TitleContent>
|
||||
<wpf:TitleContent Title="入库单号:">
|
||||
<TextBox
|
||||
d:Text="JTSD-JT12345678901122"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
IsReadOnly="True"
|
||||
Text="{Binding UpperWaybill}"
|
||||
TextWrapping="Wrap" />
|
||||
</wpf:TitleContent>
|
||||
<wpf:TitleContent Title="出库单号:">
|
||||
<TextBox
|
||||
d:Text="YD-3111111555555123"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
IsReadOnly="True"
|
||||
Text="{Binding DownWaybill}"
|
||||
TextWrapping="Wrap" />
|
||||
</wpf:TitleContent>
|
||||
<wpf:TitleContent Title="货架号:">
|
||||
<TextBox
|
||||
d:Text="EB3021"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
IsReadOnly="True"
|
||||
Text="{Binding ShelfCodeStr}"
|
||||
TextWrapping="Wrap" />
|
||||
</wpf:TitleContent>
|
||||
<wpf:TitleContent Title="货架记录时间:">
|
||||
<TextBox
|
||||
d:Text="26-10-08 00:33:33"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
IsReadOnly="True"
|
||||
Text="{Binding ShelfTimeStr}"
|
||||
TextWrapping="Wrap" />
|
||||
</wpf:TitleContent>
|
||||
</wpf:SpacingStackPanel>
|
||||
</Border>
|
||||
<Border
|
||||
Grid.Column="2"
|
||||
Margin="0,10"
|
||||
BorderBrush="LightSkyBlue"
|
||||
BorderThickness="0,0,1,0"
|
||||
Opacity="0.5">
|
||||
<wpf:SpacingStackPanel
|
||||
Margin="10,10"
|
||||
VerticalAlignment="Center"
|
||||
Orientation="Vertical"
|
||||
VerticalSpacing="4">
|
||||
<wpf:TitleContent Title="作废状态:" FontWeight="Bold">
|
||||
<TextBox
|
||||
d:Text="已作废"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
FontWeight="Normal"
|
||||
IsReadOnly="True"
|
||||
Text="{Binding TransitVoidStatus}"
|
||||
TextWrapping="Wrap" />
|
||||
</wpf:TitleContent>
|
||||
<wpf:TitleContent Title="拒收状态:" FontWeight="Bold">
|
||||
<TextBox
|
||||
d:Text="拒收失败"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
FontWeight="Normal"
|
||||
IsReadOnly="True"
|
||||
Text="{Binding TransitRejectStatus}"
|
||||
TextWrapping="Wrap" />
|
||||
</wpf:TitleContent>
|
||||
<wpf:TitleContent Title="拦截状态:" FontWeight="Bold">
|
||||
<TextBox
|
||||
d:Text="已拦截"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
FontWeight="Normal"
|
||||
IsReadOnly="True"
|
||||
Text="{Binding TransitReturnStatus}"
|
||||
TextWrapping="Wrap" />
|
||||
</wpf:TitleContent>
|
||||
</wpf:SpacingStackPanel>
|
||||
</Border>
|
||||
<Border
|
||||
Grid.Column="3"
|
||||
Margin="0,10"
|
||||
BorderBrush="LightSkyBlue"
|
||||
BorderThickness="0,0,1,0"
|
||||
Opacity="0.5">
|
||||
<wpf:SpacingStackPanel
|
||||
Margin="10,10"
|
||||
VerticalAlignment="Center"
|
||||
Orientation="Vertical"
|
||||
VerticalSpacing="4">
|
||||
<wpf:TitleContent Title="到仓时间:">
|
||||
<TextBox
|
||||
d:Text="26-10-07 10:33:33"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
IsReadOnly="True"
|
||||
Text="{Binding InboundTimeStr}"
|
||||
TextWrapping="Wrap" />
|
||||
</wpf:TitleContent>
|
||||
<wpf:TitleContent Title="取号时间:">
|
||||
<TextBox
|
||||
d:Text="26-10-08 00:33:33"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
IsReadOnly="True"
|
||||
Text="{Binding PickUpTimeStr}"
|
||||
TextWrapping="Wrap" />
|
||||
</wpf:TitleContent>
|
||||
<wpf:TitleContent Title="出仓时间:">
|
||||
<TextBox
|
||||
d:Text="26-10-07 10:33:33"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
IsReadOnly="True"
|
||||
Text="{Binding OutboundTimeStr}"
|
||||
TextWrapping="Wrap" />
|
||||
</wpf:TitleContent>
|
||||
</wpf:SpacingStackPanel>
|
||||
</Border>
|
||||
<Border Grid.Column="4">
|
||||
<wpf:SpacingStackPanel
|
||||
Grid.Column="8"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Orientation="Vertical"
|
||||
VerticalSpacing="5">
|
||||
<Button
|
||||
x:Name="btnVoidPackage"
|
||||
MinWidth="38"
|
||||
MinHeight="20"
|
||||
Margin="0,0,0,0"
|
||||
Padding="2"
|
||||
HorizontalAlignment="Center"
|
||||
d:Visibility="Visible"
|
||||
Click="btnVoidPackage_Click"
|
||||
Style="{StaticResource BasePageButtonLightStyle}"
|
||||
Visibility="{Binding VoidPackageBtnVisibility}">
|
||||
作废包裹
|
||||
</Button>
|
||||
<Button
|
||||
x:Name="btnAddEditTransitWarehouseReject_New"
|
||||
MinWidth="38"
|
||||
MinHeight="20"
|
||||
Margin="0,0,0,0"
|
||||
Padding="2"
|
||||
HorizontalAlignment="Center"
|
||||
d:Visibility="Visible"
|
||||
Click="btnAddEditTransitWarehouseReject_Click"
|
||||
Style="{StaticResource BasePageButtonLightStyle}"
|
||||
Visibility="{Binding RejectPackageBtnVisibility}">
|
||||
<!--<TextBlock>
|
||||
云仓拒收<LineBreak />
|
||||
退回总店</TextBlock>-->
|
||||
云仓拒收退回总店
|
||||
</Button>
|
||||
<Button
|
||||
x:Name="btnAddEditTransitWarehouseAfterSale_n1"
|
||||
MinWidth="38"
|
||||
MinHeight="20"
|
||||
Margin="0,0,0,0"
|
||||
Padding="2"
|
||||
Click="btnAddEditTransitWarehouseAfterSale_Click"
|
||||
Style="{StaticResource BasePageButtonLightStyle}"
|
||||
Visibility="{Binding ReturnPackageBtnVisibility}">
|
||||
拒收失败转寄总店
|
||||
</Button>
|
||||
<Button
|
||||
x:Name="btnAddEditTransitWarehouseAfterSale_n2"
|
||||
MinWidth="38"
|
||||
MinHeight="20"
|
||||
Margin="0,0,0,0"
|
||||
Padding="2"
|
||||
Click="btnAddEditTransitWarehouseAfterSale_Click"
|
||||
Style="{StaticResource BasePageButtonLightStyle}"
|
||||
Visibility="{Binding InterceptPackageBtnVisibility}">
|
||||
出库拦截退回仓库
|
||||
</Button>
|
||||
<Button
|
||||
x:Name="btnTransitExtraPackages"
|
||||
Height="20"
|
||||
MinWidth="38"
|
||||
Margin="0,0,0,0"
|
||||
Padding="2"
|
||||
HorizontalAlignment="Center"
|
||||
d:Visibility="Visible"
|
||||
Click="btnTransitExtraPackages_Click"
|
||||
Content="滞留补发买家"
|
||||
FontSize="11"
|
||||
Style="{StaticResource BasePageButtonLightStyle}"
|
||||
Visibility="{Binding ExtraPackagesBtnVisibility}" />
|
||||
</wpf:SpacingStackPanel>
|
||||
</Border>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Border>
|
||||
</UserControl>
|
||||
@@ -1,246 +0,0 @@
|
||||
using _29WxOrderWpf.BaseWindows;
|
||||
using _29WxOrderWpf.Views;
|
||||
using AllBase;
|
||||
using AllBase.Helper;
|
||||
using AllBase.Model.DBModel;
|
||||
using NaiBa.Util.Extension;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
using Work;
|
||||
using Work._29Tools.BLL;
|
||||
using WxOrder.Framework.Commons;
|
||||
|
||||
namespace _29WxOrderWpf.Ctrls.OrderCtrls;
|
||||
|
||||
/// <summary>
|
||||
/// OrderTransitListDetailCtrl.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class OrderTransitListDetailCtrl : UserControl
|
||||
{
|
||||
public OrderTransitListDetailCtrl()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
this.txtOutOrderId.AddHandler(TextBox.MouseUpEvent, new MouseButtonEventHandler(txtOutOrderId_MouseLeftButtonUp), true);
|
||||
this.txtOutOrderBuyer.AddHandler(TextBox.MouseUpEvent, new MouseButtonEventHandler(txtOutOrderId_MouseLeftButtonUp), true);
|
||||
}
|
||||
|
||||
/// <summary> 作废包裹 </summary>
|
||||
private async void btnVoidPackage_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (this.DataContext is oms_wei_order_item_transit_detail_info transitDetailInfo)
|
||||
{
|
||||
btnVoidPackage.IsEnabled = false;
|
||||
var orderItem = transitDetailInfo.oms_wei_order_item_info;
|
||||
var transitOrder = transitDetailInfo.oms_wei_external_procurement_log_info;
|
||||
var returnOrder = transitDetailInfo.oms_wei_external_procurement_after_sale_info;
|
||||
var extOrder = transitDetailInfo.oms_wei_transfer_extra_package;
|
||||
|
||||
// 作废发货包裹
|
||||
if (transitOrder != null)
|
||||
{
|
||||
transitOrder = orderItem.ItemTransitOrders.FirstOrDefault(t => t.order_code == transitOrder.order_code) ?? transitOrder;
|
||||
await OrderTransitService.VoidOrder(orderItem, transitOrder);
|
||||
}
|
||||
// 作废退货包裹
|
||||
else if (returnOrder != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
var voidResult = await OrderTransitService.VoidAfterSalePackage(orderItem, returnOrder);
|
||||
if (!string.IsNullOrEmpty(voidResult))
|
||||
BaseMsgWindow.ShowInfo(voidResult);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
BaseMsgWindow.ShowError(ex.Message);
|
||||
}
|
||||
}
|
||||
// 作废额外包裹
|
||||
else if (extOrder != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
var voidResult = await OrderTransitService.VoidExtraPackage(orderItem, extOrder);
|
||||
if (!string.IsNullOrEmpty(voidResult))
|
||||
BaseMsgWindow.ShowInfo(voidResult);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
BaseMsgWindow.ShowError(ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
RefreshListCtrl(orderItem);
|
||||
btnVoidPackage.IsEnabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary> 拒收包裹 </summary>
|
||||
private async void btnAddEditTransitWarehouseReject_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (this.DataContext is oms_wei_order_item_transit_detail_info transitDetailInfo)
|
||||
{
|
||||
btnAddEditTransitWarehouseReject_New.IsEnabled = false;
|
||||
|
||||
var orderItem = transitDetailInfo.oms_wei_order_item_info;
|
||||
var transitOrder = transitDetailInfo.oms_wei_external_procurement_log_info;
|
||||
var returnOrder = transitDetailInfo.oms_wei_external_procurement_after_sale_info;
|
||||
var extOrder = transitDetailInfo.oms_wei_transfer_extra_package;
|
||||
|
||||
// 拒收发货包裹
|
||||
if (transitOrder != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
var rejectRst = await OrderTransitService.RejectTransitOrder(orderItem, transitOrder);
|
||||
if (!string.IsNullOrEmpty(rejectRst))
|
||||
BaseMsgWindow.ShowInfo(rejectRst);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
BaseMsgWindow.ShowError(ex.Message);
|
||||
}
|
||||
|
||||
}
|
||||
// 拒收额外包裹(额外包裹暂不支持多件商品发货,故暂不存在拒收功能)
|
||||
else if (extOrder != null)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
RefreshListCtrl(orderItem);
|
||||
btnAddEditTransitWarehouseReject_New.IsEnabled = true;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void btnAddEditTransitWarehouseAfterSale_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (this.DataContext is oms_wei_order_item_transit_detail_info transitDetailInfo)
|
||||
{
|
||||
btnAddEditTransitWarehouseAfterSale_n1.IsEnabled = false;
|
||||
btnAddEditTransitWarehouseAfterSale_n2.IsEnabled = false;
|
||||
|
||||
var orderItem = transitDetailInfo.oms_wei_order_item_info;
|
||||
var transitOrder = transitDetailInfo.oms_wei_external_procurement_log_info;
|
||||
var returnOrder = transitDetailInfo.oms_wei_external_procurement_after_sale_info;
|
||||
var extOrder = transitDetailInfo.oms_wei_transfer_extra_package;
|
||||
|
||||
if (transitOrder != null)
|
||||
{
|
||||
bool isOutWarehouse = sender == btnAddEditTransitWarehouseAfterSale_n2;
|
||||
OrderListRowItemCtrl.ShowReturnPackageWindow(orderItem, transitDetailInfo, isOutWarehouse);
|
||||
}
|
||||
else if (extOrder != null)
|
||||
{
|
||||
bool isOutWarehouse = sender == btnAddEditTransitWarehouseAfterSale_n2;
|
||||
OrderListRowItemCtrl.ShowReturnPackageWindow(orderItem, transitDetailInfo, isOutWarehouse);
|
||||
}
|
||||
|
||||
RefreshListCtrl(orderItem);
|
||||
btnAddEditTransitWarehouseAfterSale_n1.IsEnabled = true;
|
||||
btnAddEditTransitWarehouseAfterSale_n2.IsEnabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void btnTransitExtraPackages_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
// 滞留补发买家(补发包裹)
|
||||
if (this.DataContext is oms_wei_order_item_transit_detail_info transitDetailInfo)
|
||||
{
|
||||
var orderItem = transitDetailInfo.oms_wei_order_item_info;
|
||||
var transitOrder = transitDetailInfo.oms_wei_external_procurement_log_info;
|
||||
var returnOrder = transitDetailInfo.oms_wei_external_procurement_after_sale_info;
|
||||
var extOrder = transitDetailInfo.oms_wei_transfer_extra_package;
|
||||
|
||||
if (transitOrder != null)
|
||||
{
|
||||
// 不是中转仓,直接返回
|
||||
if (transitOrder == null)
|
||||
{
|
||||
BaseMsgWindow.ShowError("非中转仓订单不支持补发!");
|
||||
return;
|
||||
}
|
||||
|
||||
TransitExtraPackagesView transitExtraPackagesView = new TransitExtraPackagesView(orderItem.ItemOrder, orderItem, transitOrder);
|
||||
new DialogWindow()
|
||||
{
|
||||
Title = "滞留补发买家",
|
||||
Content = transitExtraPackagesView,
|
||||
}.ShowDialog();
|
||||
}
|
||||
|
||||
RefreshListCtrl(orderItem);
|
||||
}
|
||||
}
|
||||
|
||||
public void RefreshListCtrl(oms_wei_order_item_info orderItem)
|
||||
{
|
||||
// 更新列表
|
||||
if (FindParent<OrderTransitListCtrl>(this) is OrderTransitListCtrl transitListCtrl)
|
||||
{
|
||||
oms_wei_order_item_transit_model transitInfo = new oms_wei_order_item_transit_model()
|
||||
{
|
||||
OrderItem = GlobalConfig.lstOrder.FirstOrDefault(o => o.order_id == orderItem?.order_id)?.orderItems.FirstOrDefault(oi => oi.sku_id == orderItem?.sku_id),
|
||||
};
|
||||
transitListCtrl.UpdateViewModel(transitInfo);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找指定类型的父级控件
|
||||
/// </summary>
|
||||
/// <typeparam name="T">目标父控件类型</typeparam>
|
||||
/// <param name="child">起始子控件</param>
|
||||
/// <returns>找到的父控件,未找到则返回 null</returns>
|
||||
public static T FindParent<T>(DependencyObject child) where T : DependencyObject
|
||||
{
|
||||
DependencyObject parentObject = VisualTreeHelper.GetParent(child);
|
||||
|
||||
if (parentObject == null) return null;
|
||||
|
||||
if (parentObject is T parent)
|
||||
{
|
||||
return parent;
|
||||
}
|
||||
else
|
||||
{
|
||||
// 递归继续向上查找
|
||||
return FindParent<T>(parentObject);
|
||||
}
|
||||
}
|
||||
|
||||
private void txtOutOrderId_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (this.DataContext is oms_wei_order_item_transit_detail_info transitDetailInfo && transitDetailInfo.oms_wei_order_item_info is oms_wei_order_item_info orderItem)
|
||||
{
|
||||
var buyerId = txtOutOrderBuyer.Tag as string;
|
||||
var buyerName = txtOutOrderBuyer.Text;
|
||||
var outOrderId = txtOutOrderId.Text;
|
||||
if (string.IsNullOrEmpty(buyerName) || string.IsNullOrEmpty(outOrderId))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
bool isShowOrderList = sender == txtOutOrderBuyer;
|
||||
|
||||
OrderBuyerOrdersHelper.ShowBuyerOrder(orderItem, buyerId, buyerName, outOrderId, isShowOrderList);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,351 +0,0 @@
|
||||
using _29WxOrderWpf.BaseWindows;
|
||||
using _29WxOrderWpf.Ctrls.BuyerCtrls;
|
||||
using _29WxOrderWpf.ViewModels;
|
||||
using _29WxOrderWpf.Views;
|
||||
using AllBase;
|
||||
using AllBase.Helper;
|
||||
using AllBase.Model.DBModel;
|
||||
using AllBase.Model.Result;
|
||||
using NaiBa.Util.Extension;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Work;
|
||||
using Work._29Tools.BLL;
|
||||
using WxOrder.Framework.Commons;
|
||||
|
||||
namespace _29WxOrderWpf.Ctrls.OrderCtrls;
|
||||
|
||||
internal class OrderTransitService
|
||||
{
|
||||
/// <summary>
|
||||
/// 作废中转仓发货包裹
|
||||
/// </summary>
|
||||
/// <param name="orderItem"></param>
|
||||
/// <param name="isSilent"></param>
|
||||
/// <param name="UpdateOrderBeforeVoid">作废前是否更新服务端订单状态</param>
|
||||
public static async Task VoidOrder(oms_wei_order_item_info orderItem, oms_wei_external_procurement_log_info transitOrder = null, bool isSilent = false, bool UpdateOrderBeforeVoid = true)
|
||||
{
|
||||
if (!isSilent)
|
||||
{
|
||||
if (BaseMsgWindow.ShowConfirm("确定作废当前包裹吗?").DialogResult == false)
|
||||
return;
|
||||
}
|
||||
|
||||
// 作废前查询订单状态
|
||||
var orderId = orderItem.order_id;
|
||||
var skuId = orderItem.sku_id;
|
||||
if (UpdateOrderBeforeVoid)
|
||||
await Task.Run(async() => { await MainWindow.Instance.orderListCtrl.GetOrder(orderId); });
|
||||
|
||||
var newOrder = GlobalConfig.lstOrder.FirstOrDefault(or => or.order_id == orderId);
|
||||
if (newOrder?.orderItems.Count == 1)
|
||||
orderItem = newOrder?.orderItems?.FirstOrDefault();
|
||||
else
|
||||
orderItem = newOrder?.orderItems?.FirstOrDefault(oi => oi.sku_id == skuId);
|
||||
|
||||
if (orderItem == null)
|
||||
{
|
||||
if (!isSilent)
|
||||
BaseMsgWindow.ShowError("订单查询失败,请重试");
|
||||
return;
|
||||
}
|
||||
if (transitOrder == null)
|
||||
transitOrder = orderItem.ItemTransitOrder ?? orderItem.ItemTransitOrderWithVoid;
|
||||
|
||||
if (transitOrder == null)
|
||||
{
|
||||
if (!isSilent)
|
||||
BaseMsgWindow.ShowError("要作废的中转订单不存在,请确认后重试");
|
||||
return;
|
||||
}
|
||||
|
||||
// 先作废后申请买手退款
|
||||
// 订单作废接口(作废重拍)
|
||||
//postman request POST 'http://localhost:8088/oms-api/external_procurement/discardOrder' \
|
||||
// --header 'Content-Type: application/json' \
|
||||
// --body '{
|
||||
// "orderNo":"12334534534",
|
||||
// "outOrderNo":"12312312"
|
||||
//}' 成功返回code:0 失败返回code:1
|
||||
|
||||
string url2 = "https://po.e57.cn/prod-api/api/oms-api/external_procurement/discardOrder";
|
||||
var data2 = new JObject();
|
||||
data2["orderNo"] = orderItem.order_id;
|
||||
//data2["outOrderNo"] = transitOrder.out_order_no;
|
||||
data2["outOrderNo"] = transitOrder.order_code;
|
||||
var dataStr2 = JsonHelper.SerializeObject(data2);
|
||||
var discardRst = await HttpResponseWXBLL.e57PostResponseAsync(url2, dataStr2);
|
||||
if (discardRst.Contains("\"code\":0") || discardRst.Contains("\"code\":200"))
|
||||
{
|
||||
//MainWindow.Instance.orderListCtrl.GetOrder(orderId);
|
||||
// 修改为在买手退款流程后提示作废信息
|
||||
}
|
||||
else
|
||||
{
|
||||
var msg = BaseRegex.GetStringJsonByRegs(ref discardRst, discardRst, "msg");
|
||||
if (!isSilent)
|
||||
BaseMsgWindow.ShowInfo("订单作废失败,服务端返回 " + msg);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
#region 处理买手售后
|
||||
if (transitOrder.out_order_no.ParseToString().StartsWith("tb_")) // 淘宝买手售后
|
||||
{
|
||||
if (!isSilent)
|
||||
BaseMsgWindow.ShowError("淘宝买手暂不支持自动售后,作废后请手动申请售后");
|
||||
else
|
||||
transitOrder.refund_status = "淘宝买手暂不支持自动售后,作废后需手动申请售后";
|
||||
}
|
||||
else // 拼多多买手售后
|
||||
{
|
||||
bool noBuyer = false;
|
||||
var buyer = GlobalConfig.PDDBuyerLoginList.FirstOrDefault(b => b.buyer_id == transitOrder.buyer_account || b.buyer_name == transitOrder.buyer_account);
|
||||
if (buyer == null)
|
||||
{
|
||||
if (!isSilent)
|
||||
if (BaseMsgWindow.ShowConfirm("拍单买手不存在,点击确定直接作废中转单并手动取消买手单,点击取消登录买手后重试").DialogResult != true)
|
||||
return;
|
||||
noBuyer = true;
|
||||
}
|
||||
|
||||
// 检测一下买手号
|
||||
if (GlobalConfig.CurrentPddBuyer.status == "在线")
|
||||
{
|
||||
await Task.Run(() =>
|
||||
{
|
||||
PddMobileLoginViewModel.CheckBuyerLogin(GlobalConfig.CurrentPddBuyer);
|
||||
});
|
||||
}
|
||||
if (GlobalConfig.CurrentPddBuyer.status != "在线")
|
||||
{
|
||||
if (!isSilent)
|
||||
if (BaseMsgWindow.ShowConfirm("买手号掉线,点击确定直接作废中转单并手动取消买手单,点击取消登录买手后重试").DialogResult != true)
|
||||
return;
|
||||
noBuyer = true;
|
||||
}
|
||||
|
||||
if (!noBuyer)
|
||||
{
|
||||
PddBuyerOrderLiteInfo order = null;
|
||||
order = PDDBuyerOrderReadCtrl.lstPddBuyerOrderInfoLite.FirstOrDefault(o => o.order_sn == transitOrder.out_order_no);
|
||||
if (order == null)
|
||||
order = new PddBuyerOrderLiteInfo()
|
||||
{
|
||||
order_status_prompt = "待发货",
|
||||
order_amount = transitOrder.out_amount,
|
||||
order_sn = transitOrder.out_order_no
|
||||
};
|
||||
PDDBuyerOrderReadCtrl.lstPddBuyerOrderInfoLite.Add(order);
|
||||
|
||||
var pddAfterRst = "";
|
||||
await Task.Run(() =>
|
||||
{
|
||||
pddAfterRst = PDDBuyerOrderReadCtrl.SimPddAfterSale(buyer, order);
|
||||
});
|
||||
|
||||
if (pddAfterRst.Contains("\"after_sales_status\":1") || pddAfterRst.Contains("该订单已全额退款") || pddAfterRst.Contains("订单未付款"))
|
||||
{
|
||||
// 保存退款成功状态
|
||||
order.order_status_prompt = pddAfterRst.Contains("订单未付款") ? "订单未付款" : "退款成功";
|
||||
// 中转仓订单买手号售后信息 存到服务端
|
||||
var refundRst = PDDBuyerOrderReadCtrl.SendTransitAfterSaleE57(order);
|
||||
if (refundRst.Contains("<code>0</code>") || refundRst.Contains("<code>200</code>"))
|
||||
{
|
||||
order.sendStatus = "退款成功 买手退款信息更新成功";
|
||||
}
|
||||
else
|
||||
{
|
||||
var msg = BaseRegex.GetStringXml(ref refundRst, "msg");
|
||||
order.sendStatus = "退款成功 买手退款信息更新失败,服务端返回 " + msg;
|
||||
}
|
||||
NaiBa.Util.Helper.ConfigHelper.SaveConfig("pdd_buyer_order_list", PDDBuyerOrderReadCtrl.lstPddBuyerOrderInfoLite);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!isSilent)
|
||||
if (BaseMsgWindow.ShowConfirm("买手退款失败,点击确定直接作废中转单并手动取消买手单,点击取消稍候重试").DialogResult != true)
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 更新拍单余额
|
||||
StartUp.UpdateBalance();
|
||||
#endregion
|
||||
|
||||
#region 立即更新订单
|
||||
transitOrder = orderItem.ItemTransitOrders.FirstOrDefault(o => o.order_code == transitOrder.order_code) ?? transitOrder;
|
||||
transitOrder.order_void_status = 1;
|
||||
orderItem.SetOrderItemTextProperty();
|
||||
#endregion
|
||||
|
||||
#region 重新过滤订单
|
||||
OrderListCtrl.InitOrderItemObservableProp(orderItem);
|
||||
MainWindow.Instance.orderListCtrl.FilterOrders();
|
||||
if (!isSilent)
|
||||
BaseMsgWindow.ShowInfo("订单作废成功,请重新拍单");
|
||||
#endregion
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 作废售后包裹
|
||||
/// </summary>
|
||||
/// <param name="returnOrder"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<string> VoidAfterSalePackage(oms_wei_order_item_info orderItem, oms_wei_external_procurement_after_sale_info returnOrder)
|
||||
{
|
||||
string typeStr = returnOrder?.pack_type == 1 ? "作废分销发货退货包裹" : "作废额外包裹退货包裹";
|
||||
string msg = $@"确定{typeStr}吗?";
|
||||
|
||||
if (BaseMsgWindow.ShowConfirm(msg, typeStr, null, MsgWindowLevel.MEDIUM, 300).DialogResult != true)
|
||||
return "";
|
||||
|
||||
string url2 = "https://po.e57.cn/prod-api/api/oms-api/external_procurement/orders/interceptReturn";
|
||||
var data = new JObject();
|
||||
data["externalOrderNo"] = returnOrder.external_order_no;
|
||||
data["orderNo"] = returnOrder.order_no; // 订单编号
|
||||
data["orderCode"] = returnOrder.order_code;
|
||||
data["packType"] = returnOrder.pack_type; /* 1作废分销发货退货包裹 2作废额外包裹退货包裹 */
|
||||
var dataStr2 = JsonHelper.SerializeObject(data);
|
||||
var voidRst = await HttpResponseWXBLL.e57PostResponseAsync(url2, dataStr2);
|
||||
|
||||
if (voidRst.Contains("\"code\":0") || voidRst.Contains("\"code\":200"))
|
||||
{
|
||||
StartUp.UpdateBalance();
|
||||
returnOrder.order_void_status = 1;
|
||||
orderItem.SetOrderItemTextProperty();
|
||||
return typeStr + "成功!";
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception(typeStr + "失败,服务端返回:" + BaseRegex.GetStringJsonByRegs(ref voidRst, voidRst, "msg"));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 作废额外包裹
|
||||
/// </summary>
|
||||
/// <param name="orderItem"></param>
|
||||
/// <param name="extraOrder"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="Exception"></exception>
|
||||
public static async Task<string> VoidExtraPackage(oms_wei_order_item_info orderItem, oms_wei_transfer_extra_package extraOrder)
|
||||
{
|
||||
string typeStr = "作废额外包裹";
|
||||
string msg = $@"确定{typeStr}吗?";
|
||||
|
||||
if (BaseMsgWindow.ShowConfirm(msg, typeStr, null, MsgWindowLevel.MEDIUM, 300).DialogResult != true)
|
||||
return "";
|
||||
|
||||
var data = new JObject();
|
||||
data["batchId"] = extraOrder.batchId;
|
||||
data["orderCode"] = extraOrder.order_code;
|
||||
var dataStr = JsonHelper.SerializeObject(data);
|
||||
var url = "https://po.e57.cn/prod-api/api/oms-api/external_procurement/extraOrders/void";
|
||||
var voidRst = await HttpResponseWXBLL.e57PostResponseAsync(url, dataStr);
|
||||
if (BaseRegex.GetStringJson(ref voidRst, "code") != "0" && BaseRegex.GetStringJson(ref voidRst, "code") != "200")
|
||||
{
|
||||
throw new Exception("作废额外包裹失败,服务端返回:" + BaseRegex.GetStringJsonByRegs(ref voidRst, voidRst, "msg"));
|
||||
}
|
||||
StartUp.UpdateBalance();
|
||||
extraOrder.order_void_status = 1;
|
||||
orderItem.SetOrderItemTextProperty();
|
||||
//MainWindow.Instance.orderListCtrl.FilterOneOrder(orderItem.order_id);
|
||||
return "作废额外包裹成功!";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 云仓申请拒收退回总店
|
||||
/// </summary>
|
||||
/// <param name="orderItem"></param>
|
||||
public static async Task<string> RejectTransitOrder(oms_wei_order_item_info orderItem, oms_wei_external_procurement_log_info _itemTransitOrder)
|
||||
{
|
||||
string msg = $@"
|
||||
云仓拒收退回总店
|
||||
|
||||
说 明:店铺产生售后,拒收成功,货物会原物流退回总店。
|
||||
拒收条件:(总店物流没到云仓/未签收前)。顺丰/京东无法
|
||||
拒收,直接总店申请仅退款让总店拦截。
|
||||
收 费:免费";
|
||||
|
||||
if (BaseMsgWindow.ShowConfirm(msg, "云仓拒收退回总店", null, MsgWindowLevel.LARGE, 300).DialogResult != true)
|
||||
return "";
|
||||
|
||||
orderItem.ItemTransitOrders = await OrderGetOrderListHelper.GetTransitWarehouseList(orderItem.order_id);
|
||||
orderItem.PddBuyerOrders = (await OrderGetOrderListHelper.GetPddBuyerOrders(orderItem.order_id)).Where(o => o.wx_send_type == 0).ToList();
|
||||
orderItem.PddBuyerOrders.AddRange((await OrderGetOrderListHelper.GetTbBuyerOrders(orderItem.order_id)).Where(o => o.wx_send_type == 0).ToList());
|
||||
OrderListCtrl.InitOrderItemObservableProp(orderItem);
|
||||
|
||||
var itemTransitOrder = orderItem.ItemTransitOrders.FirstOrDefault(o => o.order_code == _itemTransitOrder?.order_code && o.out_order_no == _itemTransitOrder?.out_order_no);
|
||||
if (itemTransitOrder == null)
|
||||
itemTransitOrder = _itemTransitOrder;
|
||||
|
||||
//if (itemTransitOrder?.warehouse_status == 3) { BaseMsgWindow.ShowError("商品已拒收或拦截!"); return; }
|
||||
//if (itemTransitOrder?.warehouse_status == 2) { BaseMsgWindow.ShowError("商品已出库,请选择退回中转仓!"); return; }
|
||||
//if (string.IsNullOrEmpty(orderItem.PddBuyerOrder?.order_sn)) { BaseMsgWindow.ShowError("商品未出单,请直接去拼多多买手申请退款"); return; }
|
||||
if (itemTransitOrder?.has_reject == 1 || itemTransitOrder?.has_reject == 3)
|
||||
{
|
||||
//BaseMsgWindow.ShowAnimateMessage("已申请拒收", "Msg", 3);
|
||||
return "已申请过拒收";
|
||||
}
|
||||
|
||||
// 中转仓拒收(已产生物流)
|
||||
string url = "https://po.e57.cn/prod-api/api/oms-api/external_procurement/orders/rejectApply";
|
||||
var dataObj = new JObject();
|
||||
dataObj["orderCode"] = itemTransitOrder?.order_code;
|
||||
dataObj["orderId"] = orderItem.order_id;
|
||||
dataObj["logisticsExpressCode"] = orderItem.PddBuyerOrder?.order_sn;
|
||||
var data = JsonHelper.SerializeObject(dataObj);
|
||||
var html = HttpResponseWXBLL.e57PostResponse(url, data, "");
|
||||
int rejectStatus = 0;
|
||||
if (html.Contains("<code>0</code>") || html.Contains("<code>200</code>"))
|
||||
{
|
||||
rejectStatus = 1;
|
||||
//BaseMsgWindow.ShowAnimateMessage("申请成功", "Msg", 3);
|
||||
}
|
||||
else
|
||||
{
|
||||
rejectStatus = 2;
|
||||
var err = BaseRegex.GetStringXmlByRegs(ref html, html, "msg");
|
||||
//BaseMsgWindow.ShowAnimateMessage("申请失败", "Error", 3);
|
||||
throw new Exception("申请失败" + err);
|
||||
}
|
||||
url = BaseClass.Build29WxObjString("order/wx_update_transit_order_reject_status");
|
||||
data = UserLogin.GetSignaturex();
|
||||
data += "&order_no=" + orderItem.order_id;
|
||||
data += "&order_sku_id=" + orderItem.sku_id;
|
||||
data += "&has_reject=" + rejectStatus;
|
||||
html = await GetHtml.PostUtf8Async(url, data);
|
||||
|
||||
itemTransitOrder.has_reject = rejectStatus;
|
||||
OrderListCtrl.InitOrderItemObservableProp(orderItem);
|
||||
|
||||
return "申请成功";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 申请拒收后查询拒收状态
|
||||
/// </summary>
|
||||
/// <param name="orderItem"></param>
|
||||
/// <param name="upperWaybill"></param>
|
||||
public static void ShowRejectTransitOrder(oms_wei_order_item_info orderItem, string upperWaybill)
|
||||
{
|
||||
BaiduGetWaybillInfoView buyerLoginForm = new BaiduGetWaybillInfoView(orderItem);
|
||||
buyerLoginForm.ViewModel.InitUrl = "https://www.baidu.com/s?ie=UTF-8&wd=" + upperWaybill;
|
||||
|
||||
new DialogWindow()
|
||||
{
|
||||
Width = 1280,
|
||||
Height = 800,
|
||||
Title = "物流拒收查询",
|
||||
Content = buyerLoginForm,
|
||||
}.Show();
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -1,140 +0,0 @@
|
||||
// 填写信息
|
||||
function changeReactInputValue(inputDom, newText) {
|
||||
let lastValue = inputDom.value;
|
||||
inputDom.value = newText;
|
||||
let event = new Event('input', { bubbles: true });
|
||||
event.simulated = true;
|
||||
let tracker = inputDom._valueTracker;
|
||||
if (tracker) {
|
||||
tracker.setValue(lastValue);
|
||||
}
|
||||
inputDom.dispatchEvent(event);
|
||||
}
|
||||
|
||||
// 异步 sleep
|
||||
function sleep(ms) {
|
||||
return new Promise(resolve => setTimeout(resolve, ms));
|
||||
}
|
||||
|
||||
// 查找元素(支持选择器或XPath)
|
||||
function findElement(selector, isXPath = true) {
|
||||
if (isXPath) {
|
||||
return document.evaluate(
|
||||
selector,
|
||||
document,
|
||||
null,
|
||||
XPathResult.FIRST_ORDERED_NODE_TYPE,
|
||||
null
|
||||
).singleNodeValue;
|
||||
} else {
|
||||
return document.querySelector(selector);
|
||||
}
|
||||
}
|
||||
|
||||
// 完整流程
|
||||
async function changeTbAddress(data = {}) {
|
||||
const {
|
||||
transitAddress = ''
|
||||
} = data;
|
||||
|
||||
console.log('📝 开始自动填写地址...');
|
||||
|
||||
// 1. 点击"修改"按钮,弹出修改地址框
|
||||
var btnType = findElement('(//a[contains(text(), "修改")])[1]');
|
||||
for (i = 0; i < 10; i++) {
|
||||
if (!btnType) {
|
||||
console.warn('⚠️ 找不到"修改"按钮,等待重试' + i);
|
||||
await sleep(500);
|
||||
btnType = findElement('(//a[contains(text(), "修改")])[1]');
|
||||
}
|
||||
}
|
||||
if (!btnType) {
|
||||
console.warn('⚠️ 找不到"修改"按钮');
|
||||
return false;
|
||||
}
|
||||
btnType.click();
|
||||
console.log('✅ 已点击"修改"按钮');
|
||||
await sleep(500);
|
||||
|
||||
return true;
|
||||
|
||||
// // 2. 填充并自动识别收货地址
|
||||
// const invoiceTitle = findElement('//label[contains(text(), "发票抬头")]/following-sibling::textarea[1]') ||
|
||||
// findElement('//*[contains(text(), "发票抬头")]/following-sibling::textarea[1]');
|
||||
// if (invoiceTitle) {
|
||||
// changeReactInputValue(invoiceTitle, title);
|
||||
// console.log('✅ 发票抬头已填充');
|
||||
// } else {
|
||||
// console.warn('⚠️ 未找到发票抬头控件');
|
||||
// }
|
||||
|
||||
// // 3. 查找并填充税号
|
||||
// const taxNumberInput = findElement('//label[contains(text(), "税号")]/following-sibling::input[1]') ||
|
||||
// findElement('//*[contains(text(), "税号")]/following-sibling::input[1]');
|
||||
// if (taxNumberInput) {
|
||||
// changeReactInputValue(taxNumberInput, taxNumber);
|
||||
// console.log('✅ 税号已填充');
|
||||
// } else {
|
||||
// console.warn('⚠️ 未找到税号控件');
|
||||
// }
|
||||
|
||||
// await sleep(300);
|
||||
|
||||
// // 4. 查找并点击"申请发票"按钮
|
||||
// const applyBtn = findElement('//*[contains(text(), "申请发票")]');
|
||||
// if (!applyBtn) {
|
||||
// console.error('❌ 未找到"申请发票"按钮');
|
||||
// return false;
|
||||
// }
|
||||
|
||||
// applyBtn.scrollIntoView({ behavior: 'smooth', block: 'center' });
|
||||
// await sleep(300);
|
||||
// applyBtn.click();
|
||||
// console.log('✅ 已点击"申请发票"按钮');
|
||||
|
||||
// // 5. 等待弹窗/状态出现
|
||||
// await sleep(300);
|
||||
|
||||
// // 6. 判断状态
|
||||
// // 检查是否有"已经申请过"的提示
|
||||
// const alreadyApplied = findElement('//*[contains(text(), "您已经提交过发票申请了")]')
|
||||
|
||||
|
||||
// if (alreadyApplied) {
|
||||
// console.log('✅ 已经申请过,无需重复操作');
|
||||
// return true;
|
||||
// }
|
||||
// const successElement = findElement('//*[text()="确认发票信息无误后再提交"]');
|
||||
// if (successElement == null) {
|
||||
// return false;
|
||||
// }
|
||||
// // 检查是否有"确认开具"按钮或提示
|
||||
// const confirmBtn = findElement('//*[text()= "确认"]');
|
||||
|
||||
// if (confirmBtn) {
|
||||
// console.log('✅ 找到"确认"按钮,准备点击...');
|
||||
// await sleep(200);
|
||||
// confirmBtn.click();
|
||||
// console.log('✅ 已点击"确认"按钮');
|
||||
// return true;
|
||||
// }
|
||||
|
||||
// // 如果都没有找到
|
||||
// console.warn('⚠️ 未找到"已经申请过"或"确认"按钮,请手动检查');
|
||||
// return false;
|
||||
}
|
||||
|
||||
// ========== 调用 ==========
|
||||
(async function () {
|
||||
try {
|
||||
const result = await changeTbAddress({
|
||||
transitAddress: '{中转仓地址}'
|
||||
});
|
||||
console.log('执行结果:', result);
|
||||
// 批量开票时,C# 端轮询该变量获取执行结果
|
||||
window.__invoiceApplyResult = result;
|
||||
} catch (ex) {
|
||||
console.error('执行异常:', ex);
|
||||
window.__invoiceApplyResult = false;
|
||||
}
|
||||
})();
|
||||
@@ -1,87 +0,0 @@
|
||||
<UserControl
|
||||
x:Class="_29WxOrderWpf.Ctrls.PDDInvoice.PDDInvoiceDialog"
|
||||
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:local="clr-namespace:_29WxOrderWpf.Ctrls.PDDInvoice"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:wpf="WPFCommon"
|
||||
Width="400"
|
||||
Height="250"
|
||||
d:Background="White"
|
||||
d:DataContext="{d:DesignInstance Type=local:PDDInvoiceDialog}"
|
||||
mc:Ignorable="d">
|
||||
<UserControl.Resources>
|
||||
<Style BasedOn="{StaticResource TitleContentBaseStyle}" TargetType="wpf:TitleContent">
|
||||
<Setter Property="Placement" Value="Left" />
|
||||
<Setter Property="Height" Value="28" />
|
||||
<Setter Property="TitleVerticalAlignment" Value="Center" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||
<Setter Property="TitleHorizontalAlignment" Value="Right" />
|
||||
<Setter Property="TitleWidth" Value="50" />
|
||||
<Style.Resources>
|
||||
<Style TargetType="TextBox">
|
||||
<Setter Property="Height" Value="28" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||
</Style>
|
||||
|
||||
</Style.Resources>
|
||||
</Style>
|
||||
</UserControl.Resources>
|
||||
<Border
|
||||
Margin="10"
|
||||
Padding="5"
|
||||
BorderBrush="Gray"
|
||||
BorderThickness="1">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<wpf:SpacingStackPanel
|
||||
Grid.Row="0"
|
||||
Orientation="Vertical"
|
||||
VerticalSpacing="10">
|
||||
<wpf:TitleContent Title="公司:">
|
||||
<TextBox d:Text="嵩县雷神商贸有限责任公司" Text="{Binding Config.Title}" />
|
||||
</wpf:TitleContent>
|
||||
<wpf:TitleContent Title="税号:">
|
||||
<TextBox d:Text="91410325MADQERT68E" Text="{Binding Config.TaxNo}" />
|
||||
</wpf:TitleContent>
|
||||
|
||||
<wpf:TitleContent Title="最大金额:">
|
||||
<wpf:NumberBox
|
||||
Width="80"
|
||||
HorizontalAlignment="Left"
|
||||
Maximum="999999"
|
||||
Minimum="0"
|
||||
Value="{Binding Config.MaxAmount}" />
|
||||
</wpf:TitleContent>
|
||||
<wpf:TitleContent Title="数据保存:">
|
||||
<CheckBox IsChecked="{Binding Config.IsSaveData}" />
|
||||
</wpf:TitleContent>
|
||||
</wpf:SpacingStackPanel>
|
||||
<Border
|
||||
Grid.Row="1"
|
||||
Margin="-5"
|
||||
Padding="0,5"
|
||||
BorderBrush="Gray"
|
||||
BorderThickness="0,1,0,0">
|
||||
<wpf:SpacingStackPanel HorizontalAlignment="Center" HorizontalSpacing="30">
|
||||
<Button
|
||||
Padding="10,5"
|
||||
Command="{Binding ConfirmCommand}"
|
||||
Content="确定"
|
||||
Style="{StaticResource BasePageButtonStyle}" />
|
||||
<Button
|
||||
Padding="10,5"
|
||||
Command="{Binding CancelCommand}"
|
||||
Content="取消"
|
||||
Style="{StaticResource BasePageButtonLightStyle}" />
|
||||
</wpf:SpacingStackPanel>
|
||||
</Border>
|
||||
</Grid>
|
||||
|
||||
</Border>
|
||||
</UserControl>
|
||||
@@ -1,87 +0,0 @@
|
||||
using WxOrder.Framework.Commons;
|
||||
using WxOrder.Framework.Commons;
|
||||
using _29WxOrderWpf.Ctrls.PDDInvoice.ViewModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
using WPFCommon.Models;
|
||||
using WxOrder.Framework.Commons.Dialogs;
|
||||
using static Org.BouncyCastle.Math.EC.ECCurve;
|
||||
|
||||
namespace _29WxOrderWpf.Ctrls.PDDInvoice;
|
||||
|
||||
/// <summary>
|
||||
/// PDDInvoiceDialog.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class PDDInvoiceDialog : UserControl, IDialogAware
|
||||
{
|
||||
public PDDInvoiceDialog(InvoiceConfig config)
|
||||
{
|
||||
InitializeComponent();
|
||||
DataContext = this;
|
||||
Config = new InvoiceConfig();
|
||||
Config.Assign(config);
|
||||
}
|
||||
public string Title { get; set; }
|
||||
public event Action<IDialogResult> RequestClose;
|
||||
|
||||
private void PDDInvoiceDialog_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
public void OnDialogOpened(IDialogParameters parameters)
|
||||
{
|
||||
Title = "设置";
|
||||
}
|
||||
|
||||
private void ViewModel_RequestClose()
|
||||
{
|
||||
Window parentWindow = Window.GetWindow(this);
|
||||
if (this.IsLoaded && parentWindow != null)
|
||||
parentWindow.Close();
|
||||
}
|
||||
|
||||
|
||||
public InvoiceConfig Config { get; }
|
||||
|
||||
public ICommand ConfirmCommand => new DelegateCommand(Confirm);
|
||||
|
||||
private void Confirm()
|
||||
{
|
||||
RequestClose?.Invoke(new DialogResult(ButtonResult.OK, new DialogParameters
|
||||
{
|
||||
{ "config",Config}
|
||||
}));
|
||||
}
|
||||
public ICommand CancelCommand => new DelegateCommand(Cancel);
|
||||
|
||||
|
||||
private void Cancel()
|
||||
{
|
||||
RequestClose?.Invoke(new DialogResult(ButtonResult.Cancel));
|
||||
}
|
||||
|
||||
public bool CanCloseDialog()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public void OnDialogClosed()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -2,29 +2,29 @@
|
||||
x:Class="_29WxOrderWpf.Ctrls.PDDInvoice.PDDInvoiceView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:comm="WxOrder.Framework"
|
||||
xmlns:common="WxOrder.Framework"
|
||||
xmlns:comm="clr-namespace:_29WxOrderWpf.Common"
|
||||
xmlns:common="clr-namespace:_29WxOrderWpf.Common"
|
||||
xmlns:converters="clr-namespace:_29WxOrderWpf.Converters"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:vm="clr-namespace:_29WxOrderWpf.Ctrls.PDDInvoice.ViewModels"
|
||||
xmlns:wpf="clr-namespace:WPFCommon.Controls;assembly=WPFCommon"
|
||||
comm:DialogWindowProperty.ResizeMode="CanResizeWithGrip"
|
||||
comm:DialogWindowProperty.ShowMinButton="True"
|
||||
comm:DialogWindowProperty.ShowMinButton="False"
|
||||
common:DialogWindowProperty.Height="720"
|
||||
common:DialogWindowProperty.Width="1260"
|
||||
d:DataContext="{d:DesignInstance Type=vm:PDDInvoiceViewModel,
|
||||
IsDesignTimeCreatable=True}"
|
||||
d:DesignHeight="720"
|
||||
d:DesignWidth="1960"
|
||||
d:DesignWidth="1260"
|
||||
Background="White"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<UserControl.Resources>
|
||||
<BooleanToVisibilityConverter x:Key="BooleanToVisibility" />
|
||||
<converters:ImageUrlToBitmapImageConverter x:Key="ImageUrlToBitmapImageConverter" />
|
||||
<converters:ImageUrlToBitmapImageConverter x:Key="ImageUrlToBitmapImage" />
|
||||
<converters:InverseVisibleToVisibilityConverter x:Key="InverseBooleanToVisibility" />
|
||||
<converters:ImageLoadRequestConverter x:Key="ImageLoadRequestConverter" />
|
||||
|
||||
<!-- 原型配色 -->
|
||||
<SolidColorBrush x:Key="PageBgBrush" Color="#F5F6F8" />
|
||||
<SolidColorBrush x:Key="CardBgBrush" Color="#FFFFFF" />
|
||||
@@ -50,7 +50,7 @@
|
||||
|
||||
<!-- 搜索 / 表单输入框 -->
|
||||
<Style x:Key="SearchTextBoxStyle" TargetType="TextBox">
|
||||
<Setter Property="Height" Value="30" />
|
||||
<Setter Property="Height" Value="36" />
|
||||
<Setter Property="Padding" Value="12,0" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||
<Setter Property="FontSize" Value="13" />
|
||||
@@ -81,9 +81,76 @@
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
<Style BasedOn="{StaticResource BasePageButtonStyle}" TargetType="Button">
|
||||
<Setter Property="Height" Value="30" />
|
||||
|
||||
<!-- 主按钮 -->
|
||||
<Style x:Key="PrimaryButtonStyle" TargetType="Button">
|
||||
<Setter Property="Height" Value="36" />
|
||||
<Setter Property="Padding" Value="18,0" />
|
||||
<Setter Property="Foreground" Value="White" />
|
||||
<Setter Property="Background" Value="{StaticResource PrimaryBrush}" />
|
||||
<Setter Property="FontSize" Value="13" />
|
||||
<Setter Property="Cursor" Value="Hand" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="Button">
|
||||
<Border
|
||||
x:Name="border"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
Background="{TemplateBinding Background}"
|
||||
CornerRadius="4">
|
||||
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter TargetName="border" Property="Background" Value="{StaticResource PrimaryHoverBrush}" />
|
||||
</Trigger>
|
||||
<Trigger Property="IsPressed" Value="True">
|
||||
<Setter TargetName="border" Property="Opacity" Value="0.8" />
|
||||
</Trigger>
|
||||
<Trigger Property="IsEnabled" Value="False">
|
||||
<Setter TargetName="border" Property="Opacity" Value="0.5" />
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<!-- 默认按钮 -->
|
||||
<Style x:Key="DefaultButtonStyle" TargetType="Button">
|
||||
<Setter Property="Height" Value="36" />
|
||||
<Setter Property="Padding" Value="18,0" />
|
||||
<Setter Property="Foreground" Value="{StaticResource TextNormalBrush}" />
|
||||
<Setter Property="Background" Value="White" />
|
||||
<Setter Property="BorderBrush" Value="{StaticResource InputBorderBrush}" />
|
||||
<Setter Property="BorderThickness" Value="1" />
|
||||
<Setter Property="FontSize" Value="13" />
|
||||
<Setter Property="Cursor" Value="Hand" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="Button">
|
||||
<Border
|
||||
x:Name="border"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="4">
|
||||
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter TargetName="border" Property="Background" Value="#F5F7FA" />
|
||||
</Trigger>
|
||||
<Trigger Property="IsPressed" Value="True">
|
||||
<Setter TargetName="border" Property="Opacity" Value="0.8" />
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<!-- 文字链接按钮 -->
|
||||
<Style x:Key="LinkButtonStyle" TargetType="Button">
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
@@ -129,7 +196,7 @@
|
||||
<Border Padding="10,10,10,0">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="30" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
@@ -138,9 +205,10 @@
|
||||
<Border Grid.Row="0">
|
||||
|
||||
<wpf:SpacingStackPanel Background="{StaticResource CardBgBrush}" HorizontalSpacing="10">
|
||||
<Grid Width="200">
|
||||
<Grid Width="300">
|
||||
<TextBox
|
||||
x:Name="txtSearch"
|
||||
Height="30"
|
||||
Padding="5,0,0,0"
|
||||
KeyDown="txtSearch_KeyDown"
|
||||
Style="{StaticResource SearchTextBoxStyle}"
|
||||
@@ -154,56 +222,17 @@
|
||||
Text="请输入订单号 / 商品名称"
|
||||
Visibility="{Binding Text, ElementName=txtSearch, Converter={StaticResource NotHasTextVisibility}}" />
|
||||
</Grid>
|
||||
<wpf:TitleContent
|
||||
Title="发票状态"
|
||||
Placement="Left"
|
||||
TitleVerticalAlignment="Center">
|
||||
<ComboBox
|
||||
Width="100"
|
||||
Height="30"
|
||||
d:SelectedIndex="0"
|
||||
SelectedIndex="{Binding InvoiceStatus}"
|
||||
Style="{StaticResource RoundedComboBox}">
|
||||
<ComboBoxItem Content="全部" />
|
||||
<ComboBoxItem Content="待开票" />
|
||||
<ComboBoxItem Content="已申请" />
|
||||
</ComboBox>
|
||||
|
||||
</wpf:TitleContent>
|
||||
<wpf:TitleContent
|
||||
Title="时间范围:"
|
||||
HorizontalContentAlignment="Center"
|
||||
Placement="Left"
|
||||
TitleVerticalAlignment="Center">
|
||||
<WrapPanel>
|
||||
<DatePicker
|
||||
Height="30"
|
||||
VerticalAlignment="Center"
|
||||
VerticalContentAlignment="Center"
|
||||
d:SelectedDate="2026/01/01"
|
||||
SelectedDate="{Binding StartTime}" />
|
||||
<Border
|
||||
Width="5"
|
||||
Height="1"
|
||||
BorderBrush="LightGray"
|
||||
BorderThickness="1" />
|
||||
<DatePicker
|
||||
Height="30"
|
||||
VerticalAlignment="Center"
|
||||
VerticalContentAlignment="Center"
|
||||
d:SelectedDate="2026/01/01"
|
||||
SelectedDate="{Binding EndTime}" />
|
||||
|
||||
</WrapPanel>
|
||||
</wpf:TitleContent>
|
||||
<Button
|
||||
Width="50"
|
||||
Height="30"
|
||||
Command="{Binding SearchCommand}"
|
||||
Content="搜索" />
|
||||
Content="搜索"
|
||||
Style="{StaticResource BasePageButtonStyle}" />
|
||||
<Button
|
||||
Height="30"
|
||||
Command="{Binding ResetCommand}"
|
||||
Content="重置"
|
||||
Style="{StaticResource LinkButtonStyle}" />
|
||||
Style="{StaticResource DefaultButtonStyle}" />
|
||||
|
||||
<wpf:TitleContent
|
||||
Title="买手号:"
|
||||
@@ -218,9 +247,11 @@
|
||||
Style="{StaticResource RoundedComboBox}" />
|
||||
</wpf:TitleContent>
|
||||
<Button
|
||||
Height="30"
|
||||
Padding="5,0"
|
||||
Command="{Binding ReadOrderCommand}"
|
||||
Content="读取订单"
|
||||
Style="{StaticResource BasePageButtonStyle}"
|
||||
Visibility="{Binding IsReadOrder, Converter={StaticResource Boolean2VisibilityReConverter}}" />
|
||||
<Button
|
||||
Height="30"
|
||||
@@ -230,22 +261,13 @@
|
||||
Style="{StaticResource BasePageButtonStyle}"
|
||||
Visibility="{Binding IsReadOrder, Converter={StaticResource Boolean2VisibilityConverter}}" />
|
||||
<Button
|
||||
Height="30"
|
||||
Padding="10,0"
|
||||
Command="{Binding BatchInvoiceCommand}"
|
||||
Content="批量开票"
|
||||
Visibility="{Binding IsBatchInvoicing, Converter={StaticResource Boolean2VisibilityReConverter}}" />
|
||||
<Button
|
||||
Padding="10,0"
|
||||
Command="{Binding StopBatchInvoiceCommand}"
|
||||
Content="停止开票"
|
||||
Visibility="{Binding IsBatchInvoicing, Converter={StaticResource Boolean2VisibilityConverter}}" />
|
||||
<Button
|
||||
Padding="10,0"
|
||||
Command="{Binding ShowSettingDialogCommand}"
|
||||
Content="设置"
|
||||
Style="{StaticResource BasePageButtonLightStyle}" />
|
||||
Style="{StaticResource BasePageButtonStyle}" />
|
||||
|
||||
<!--<wpf:TitleContent
|
||||
<wpf:TitleContent
|
||||
Title="公司:"
|
||||
Placement="Left"
|
||||
TitleVerticalAlignment="Center">
|
||||
@@ -277,12 +299,11 @@
|
||||
Maximum="999999"
|
||||
Minimum="0"
|
||||
Value="{Binding MaxAmount}" />
|
||||
</wpf:TitleContent>-->
|
||||
</wpf:TitleContent>
|
||||
<CheckBox
|
||||
VerticalContentAlignment="Center"
|
||||
Content="显示订单窗口"
|
||||
IsChecked="{Binding IsOrderListDialogOpen}" />
|
||||
|
||||
</wpf:SpacingStackPanel>
|
||||
</Border>
|
||||
<!-- 订单列表(已移除分页与订单分组) -->
|
||||
@@ -382,18 +403,15 @@
|
||||
<Border Background="White">
|
||||
<!-- 列表(虚拟化滚动加载) -->
|
||||
<ItemsControl
|
||||
x:Name="itemsControl"
|
||||
Margin="0,2,0,-2"
|
||||
Padding="0"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
ItemsSource="{Binding OrdersView}">
|
||||
ItemsSource="{Binding Orders}">
|
||||
<ItemsControl.Template>
|
||||
<ControlTemplate TargetType="ItemsControl">
|
||||
<ScrollViewer
|
||||
x:Name="PART_ScrollViewer"
|
||||
CanContentScroll="True"
|
||||
HorizontalScrollBarVisibility="Disabled"
|
||||
ScrollChanged="ScrollViewer_ScrollChanged"
|
||||
VerticalScrollBarVisibility="Auto">
|
||||
<ItemsPresenter />
|
||||
</ScrollViewer>
|
||||
@@ -461,7 +479,8 @@
|
||||
Grid.Column="0"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
IsChecked="{Binding IsSelected}" />
|
||||
IsChecked="{Binding IsSelected}"
|
||||
IsEnabled="{Binding IsSelected}" />
|
||||
|
||||
<!-- 商品 -->
|
||||
<Grid Grid.Column="1" VerticalAlignment="Center">
|
||||
@@ -474,27 +493,7 @@
|
||||
Height="72"
|
||||
Background="#EEEEEE"
|
||||
CornerRadius="5">
|
||||
<Image Stretch="UniformToFill">
|
||||
<converters:AsyncImageLoader.Request>
|
||||
<MultiBinding Converter="{StaticResource ImageLoadRequestConverter}">
|
||||
<Binding Path="ThumbUrl" />
|
||||
<Binding Path="DataContext.IsLoadImage" RelativeSource="{RelativeSource AncestorType=UserControl}" />
|
||||
</MultiBinding>
|
||||
</converters:AsyncImageLoader.Request>
|
||||
</Image>
|
||||
<!--<Image
|
||||
converters:AsyncImageLoader.IsLoadImage="{Binding RelativeSource={RelativeSource AncestorType=UserControl}, Path=DataContext.IsLoadImage}"
|
||||
converters:AsyncImageLoader.SourceUrl="{Binding ThumbUrl}"
|
||||
Stretch="UniformToFill">
|
||||
-->
|
||||
<!--<Image.Source>
|
||||
<MultiBinding Converter="{StaticResource ImageUrlToBitmapImageConverter}" Mode="OneWay">
|
||||
<Binding IsAsync="True" Path="ThumbUrl" />
|
||||
<Binding Path="DataContext.IsLoadImage" RelativeSource="{RelativeSource AncestorType=UserControl}" />
|
||||
</MultiBinding>
|
||||
</Image.Source>-->
|
||||
<!--
|
||||
</Image>-->
|
||||
<Image Source="{Binding ThumbUrl, Converter={StaticResource ImageUrlToBitmapImage}, IsAsync=True}" Stretch="UniformToFill" />
|
||||
</Border>
|
||||
<StackPanel
|
||||
Grid.Column="1"
|
||||
@@ -654,12 +653,13 @@
|
||||
Value="{Binding ProgressValue}" />
|
||||
<Grid Margin="10,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="100*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<TextBox
|
||||
Grid.Column="0"
|
||||
Grid.Row="2"
|
||||
Grid.Column="1"
|
||||
Margin="4,0,0,0"
|
||||
VerticalAlignment="Center"
|
||||
d:Text="共计:{}"
|
||||
@@ -668,17 +668,6 @@
|
||||
Foreground="White"
|
||||
IsReadOnly="True"
|
||||
Text="{Binding BottomMsg}" />
|
||||
<TextBox
|
||||
Grid.Column="1"
|
||||
Margin="4,0,0,0"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalContentAlignment="Right"
|
||||
d:Text="共计:{}"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
Foreground="White"
|
||||
IsReadOnly="True"
|
||||
Text="{Binding BottomRMsg}" />
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using _29WxOrderWpf.Ctrls.PDDInvoice.ViewModels;
|
||||
using CefSharp.DevTools.Overlay;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -14,7 +13,6 @@ using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
using System.Windows.Threading;
|
||||
|
||||
namespace _29WxOrderWpf.Ctrls.PDDInvoice;
|
||||
|
||||
@@ -23,17 +21,10 @@ namespace _29WxOrderWpf.Ctrls.PDDInvoice;
|
||||
/// </summary>
|
||||
public partial class PDDInvoiceView : UserControl
|
||||
{
|
||||
private PDDInvoiceViewModel vm = new PDDInvoiceViewModel();
|
||||
public PDDInvoiceView()
|
||||
{
|
||||
InitializeComponent();
|
||||
DataContext = vm;
|
||||
vm.BatchInvoiceChanged += Vm_BatchInvoiceChanged;
|
||||
}
|
||||
|
||||
private void Vm_BatchInvoiceChanged(object sender, int e)
|
||||
{
|
||||
ScrollToCurrent(e);
|
||||
DataContext = new PDDInvoiceViewModel();
|
||||
}
|
||||
|
||||
private void txtSearch_KeyDown(object sender, KeyEventArgs e)
|
||||
@@ -43,60 +34,4 @@ public partial class PDDInvoiceView : UserControl
|
||||
viewModel.SearchCommand.Execute(null);
|
||||
}
|
||||
}
|
||||
private DispatcherTimer _scrollStopTimer;
|
||||
|
||||
|
||||
private void ScrollViewer_ScrollChanged(object sender, ScrollChangedEventArgs e)
|
||||
{
|
||||
// 每次滚动都重置计时器
|
||||
if (_scrollStopTimer == null)
|
||||
{
|
||||
_scrollStopTimer = new DispatcherTimer
|
||||
{
|
||||
Interval = TimeSpan.FromMilliseconds(100) // 200ms 内无滚动视为停止
|
||||
};
|
||||
_scrollStopTimer.Tick += ScrollStopTimer_Tick;
|
||||
}
|
||||
|
||||
_scrollStopTimer.Stop();
|
||||
_scrollStopTimer.Start();
|
||||
(DataContext as PDDInvoiceViewModel).IsLoadImage = false;
|
||||
}
|
||||
private void ScrollStopTimer_Tick(object sender, EventArgs e)
|
||||
{
|
||||
_scrollStopTimer.Stop();
|
||||
|
||||
// 用 Background 优先级设置,避免和当前这一帧的滚动惯性/渲染争抢,
|
||||
// 让 UI 线程先把滚动动画收尾,再去处理这一波图片加载触发
|
||||
Dispatcher.BeginInvoke(DispatcherPriority.Background, new Action(() =>
|
||||
{
|
||||
vm.IsLoadImage = true;
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
private void ScrollToCurrent(int index)
|
||||
{
|
||||
|
||||
if (itemsControl == null) return;
|
||||
|
||||
// 方案A:逻辑滚动(你的 CanContentScroll=True,推荐)
|
||||
var sv = itemsControl.Template.FindName("PART_ScrollViewer", itemsControl) as ScrollViewer;
|
||||
if (sv != null)
|
||||
{
|
||||
|
||||
if (index >= 0)
|
||||
{
|
||||
sv.ScrollToVerticalOffset(index - 1);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// 方案B:兜底,用容器 BringIntoView
|
||||
itemsControl.UpdateLayout();
|
||||
var container = itemsControl.ItemContainerGenerator
|
||||
.ContainerFromItem(vm.SelectedOrder) as FrameworkElement;
|
||||
container?.BringIntoView();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,302 +1,134 @@
|
||||
/*!
|
||||
* invoice_hook.js · v1.0.0
|
||||
* 发票申请 Hook
|
||||
* - 使用 window.InvoiceApply 统一暴露接口
|
||||
* - 支持重复注入,不重复自动执行
|
||||
* - CEF 可通过 window.InvoiceApply.__installed 判断脚本是否已注入
|
||||
* - 执行结果保存在 window.__invoiceApplyResult
|
||||
*/
|
||||
; (function (global) {
|
||||
'use strict';
|
||||
|
||||
// 已注入时不重复创建对象或重复自动执行
|
||||
if (global.InvoiceApply && global.InvoiceApply.__installed) {
|
||||
return;
|
||||
// 填写信息
|
||||
function changeReactInputValue(inputDom, newText) {
|
||||
let lastValue = inputDom.value;
|
||||
inputDom.value = newText;
|
||||
let event = new Event('input', { bubbles: true });
|
||||
event.simulated = true;
|
||||
let tracker = inputDom._valueTracker;
|
||||
if (tracker) {
|
||||
tracker.setValue(lastValue);
|
||||
}
|
||||
inputDom.dispatchEvent(event);
|
||||
}
|
||||
|
||||
var VERSION = '1.0.0';
|
||||
var state = {
|
||||
installed: false,
|
||||
running: false,
|
||||
result: null,
|
||||
error: null,
|
||||
lastRunAt: null
|
||||
};
|
||||
// 异步 sleep
|
||||
function sleep(ms) {
|
||||
return new Promise(resolve => setTimeout(resolve, ms));
|
||||
}
|
||||
|
||||
function sleep(ms) {
|
||||
return new Promise(function (resolve) {
|
||||
global.setTimeout(resolve, ms);
|
||||
});
|
||||
// 查找元素(支持选择器或XPath)
|
||||
function findElement(selector, isXPath = true) {
|
||||
if (isXPath) {
|
||||
return document.evaluate(
|
||||
selector,
|
||||
document,
|
||||
null,
|
||||
XPathResult.FIRST_ORDERED_NODE_TYPE,
|
||||
null
|
||||
).singleNodeValue;
|
||||
} else {
|
||||
return document.querySelector(selector);
|
||||
}
|
||||
}
|
||||
|
||||
// 支持 XPath 或 CSS 选择器
|
||||
function findElement(selector, isXPath) {
|
||||
if (isXPath === undefined) isXPath = true;
|
||||
// 完整流程
|
||||
async function fillInvoiceAndApply(data = {}) {
|
||||
const {
|
||||
title = '某某科技有限公司',
|
||||
taxNumber = '91110000123456789X'
|
||||
} = data;
|
||||
|
||||
try {
|
||||
if (isXPath) {
|
||||
return global.document.evaluate(
|
||||
selector,
|
||||
global.document,
|
||||
null,
|
||||
global.XPathResult.FIRST_ORDERED_NODE_TYPE,
|
||||
null
|
||||
).singleNodeValue;
|
||||
}
|
||||
|
||||
return global.document.querySelector(selector);
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
function changeReactInputValue(inputDom, newText) {
|
||||
if (!inputDom) return false;
|
||||
|
||||
var lastValue = inputDom.value;
|
||||
var valueSetter = null;
|
||||
|
||||
// 优先使用原生 input/textarea value setter,便于 React 感知值变化
|
||||
try {
|
||||
var proto = inputDom.tagName === 'TEXTAREA'
|
||||
? global.HTMLTextAreaElement.prototype
|
||||
: global.HTMLInputElement.prototype;
|
||||
|
||||
valueSetter = Object.getOwnPropertyDescriptor(proto, 'value');
|
||||
} catch (e) {
|
||||
// ignore
|
||||
}
|
||||
|
||||
try {
|
||||
if (valueSetter && valueSetter.set) {
|
||||
valueSetter.set.call(inputDom, newText);
|
||||
} else {
|
||||
inputDom.value = newText;
|
||||
}
|
||||
} catch (e) {
|
||||
inputDom.value = newText;
|
||||
}
|
||||
|
||||
try {
|
||||
var tracker = inputDom._valueTracker;
|
||||
if (tracker) {
|
||||
tracker.setValue(lastValue);
|
||||
}
|
||||
} catch (e) {
|
||||
// ignore
|
||||
}
|
||||
|
||||
var event;
|
||||
|
||||
try {
|
||||
event = new global.Event('input', { bubbles: true });
|
||||
} catch (e) {
|
||||
event = global.document.createEvent('Event');
|
||||
event.initEvent('input', true, false);
|
||||
}
|
||||
|
||||
event.simulated = true;
|
||||
inputDom.dispatchEvent(event);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
async function fillInvoiceAndApply(data) {
|
||||
data = data || {};
|
||||
|
||||
var title = data.title === undefined
|
||||
? '某某科技有限公司'
|
||||
: data.title;
|
||||
|
||||
var taxNumber = data.taxNumber === undefined
|
||||
? '91110000123456789X'
|
||||
: data.taxNumber;
|
||||
|
||||
console.log('[InvoiceApply] 开始填充发票信息...');
|
||||
|
||||
// 1. 点击“企业”按钮
|
||||
var invoiceType = findElement('//*[contains(text(), "企业")]');
|
||||
|
||||
if (!invoiceType) {
|
||||
console.warn('[InvoiceApply] 找不到“企业”按钮');
|
||||
return false;
|
||||
}
|
||||
|
||||
invoiceType.click();
|
||||
|
||||
console.log('[InvoiceApply] 已点击“企业”按钮');
|
||||
|
||||
await sleep(500);
|
||||
|
||||
// 2. 填充发票抬头
|
||||
var invoiceTitle =
|
||||
findElement('//label[contains(text(), "发票抬头")]/following-sibling::textarea[1]') ||
|
||||
findElement('//*[contains(text(), "发票抬头")]/following-sibling::textarea[1]');
|
||||
|
||||
if (invoiceTitle) {
|
||||
changeReactInputValue(invoiceTitle, title);
|
||||
console.log('[InvoiceApply] 发票抬头已填充');
|
||||
} else {
|
||||
console.warn('[InvoiceApply] 未找到发票抬头控件');
|
||||
}
|
||||
|
||||
// 3. 填充税号
|
||||
var taxNumberInput =
|
||||
findElement('//label[contains(text(), "税号")]/following-sibling::input[1]') ||
|
||||
findElement('//*[contains(text(), "税号")]/following-sibling::input[1]');
|
||||
|
||||
if (taxNumberInput) {
|
||||
changeReactInputValue(taxNumberInput, taxNumber);
|
||||
console.log('[InvoiceApply] 税号已填充');
|
||||
} else {
|
||||
console.warn('[InvoiceApply] 未找到税号控件');
|
||||
}
|
||||
|
||||
await sleep(300);
|
||||
|
||||
// 4. 点击“申请发票”
|
||||
var applyBtn = findElement('//*[contains(text(), "申请发票")]');
|
||||
|
||||
if (!applyBtn) {
|
||||
console.error('[InvoiceApply] 未找到“申请发票”按钮');
|
||||
return false;
|
||||
}
|
||||
|
||||
if (applyBtn.scrollIntoView) {
|
||||
applyBtn.scrollIntoView({
|
||||
behavior: 'smooth',
|
||||
block: 'center'
|
||||
});
|
||||
}
|
||||
|
||||
await sleep(300);
|
||||
|
||||
applyBtn.click();
|
||||
|
||||
console.log('[InvoiceApply] 已点击“申请发票”按钮');
|
||||
|
||||
// 5. 等待弹窗或状态出现
|
||||
await sleep(300);
|
||||
|
||||
// 6. 判断申请状态
|
||||
var alreadyApplied = findElement(
|
||||
'//*[contains(text(), "您已经提交过发票申请了")]'
|
||||
);
|
||||
|
||||
if (alreadyApplied) {
|
||||
console.log('[InvoiceApply] 已经申请过,无需重复操作');
|
||||
return true;
|
||||
}
|
||||
|
||||
var successElement = findElement(
|
||||
'//*[text()="确认发票信息无误后再提交"]'
|
||||
);
|
||||
|
||||
if (!successElement) {
|
||||
console.warn('[InvoiceApply] 未检测到确认发票信息的提示');
|
||||
return false;
|
||||
}
|
||||
|
||||
var confirmBtn = findElement('//*[text()="确认"]');
|
||||
|
||||
if (confirmBtn) {
|
||||
console.log('[InvoiceApply] 找到“确认”按钮');
|
||||
|
||||
await sleep(200);
|
||||
confirmBtn.click();
|
||||
console.log(
|
||||
'[InvoiceApply] 已识别确认步骤,未自动提交最终确认'
|
||||
);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
console.warn(
|
||||
'[InvoiceApply] 未找到“已经申请过”提示或“确认”按钮'
|
||||
);
|
||||
console.log('📝 开始填充发票信息...');
|
||||
|
||||
// 1. 点击"企业"按钮
|
||||
const invoiceType = findElement('//*[contains(text(), "企业")]');
|
||||
if (!invoiceType) {
|
||||
console.warn('⚠️ 找不到"企业"按钮');
|
||||
return false;
|
||||
}
|
||||
|
||||
function run(data) {
|
||||
if (state.running) {
|
||||
return Promise.reject(
|
||||
new Error('发票申请脚本正在执行,请勿重复调用')
|
||||
);
|
||||
}
|
||||
invoiceType.click();
|
||||
console.log('✅ 已点击"企业"按钮');
|
||||
await sleep(500);
|
||||
|
||||
state.running = true;
|
||||
state.result = null;
|
||||
state.error = null;
|
||||
state.lastRunAt = Date.now();
|
||||
|
||||
global.__invoiceApplyResult = null;
|
||||
|
||||
return fillInvoiceAndApply(data)
|
||||
.then(function (result) {
|
||||
state.result = !!result;
|
||||
global.__invoiceApplyResult = state.result;
|
||||
|
||||
return state.result;
|
||||
})
|
||||
.catch(function (ex) {
|
||||
state.error = String((ex && ex.message) || ex);
|
||||
state.result = false;
|
||||
global.__invoiceApplyResult = false;
|
||||
|
||||
console.error('[InvoiceApply] 执行异常:', ex);
|
||||
|
||||
return false;
|
||||
})
|
||||
.then(
|
||||
function (result) {
|
||||
state.running = false;
|
||||
return result;
|
||||
},
|
||||
function (ex) {
|
||||
state.running = false;
|
||||
throw ex;
|
||||
}
|
||||
);
|
||||
// 2. 查找并填充发票抬头
|
||||
const invoiceTitle = findElement('//label[contains(text(), "发票抬头")]/following-sibling::textarea[1]') ||
|
||||
findElement('//*[contains(text(), "发票抬头")]/following-sibling::textarea[1]');
|
||||
if (invoiceTitle) {
|
||||
changeReactInputValue(invoiceTitle, title);
|
||||
console.log('✅ 发票抬头已填充');
|
||||
} else {
|
||||
console.warn('⚠️ 未找到发票抬头控件');
|
||||
}
|
||||
|
||||
var api = {
|
||||
version: VERSION,
|
||||
run: run,
|
||||
findElement: findElement,
|
||||
changeReactInputValue: changeReactInputValue,
|
||||
// 3. 查找并填充税号
|
||||
const taxNumberInput = findElement('//label[contains(text(), "税号")]/following-sibling::input[1]') ||
|
||||
findElement('//*[contains(text(), "税号")]/following-sibling::input[1]');
|
||||
if (taxNumberInput) {
|
||||
changeReactInputValue(taxNumberInput, taxNumber);
|
||||
console.log('✅ 税号已填充');
|
||||
} else {
|
||||
console.warn('⚠️ 未找到税号控件');
|
||||
}
|
||||
|
||||
get state() {
|
||||
return state;
|
||||
},
|
||||
await sleep(300);
|
||||
|
||||
get __installed() {
|
||||
return state.installed;
|
||||
}
|
||||
};
|
||||
// 4. 查找并点击"申请发票"按钮
|
||||
const applyBtn = findElement('//*[contains(text(), "申请发票")]');
|
||||
if (!applyBtn) {
|
||||
console.error('❌ 未找到"申请发票"按钮');
|
||||
return false;
|
||||
}
|
||||
|
||||
function install() {
|
||||
if (state.installed) {
|
||||
return api;
|
||||
}
|
||||
applyBtn.scrollIntoView({ behavior: 'smooth', block: 'center' });
|
||||
await sleep(300);
|
||||
applyBtn.click();
|
||||
console.log('✅ 已点击"申请发票"按钮');
|
||||
|
||||
state.installed = true;
|
||||
// 5. 等待弹窗/状态出现
|
||||
await sleep(300);
|
||||
|
||||
console.log('[InvoiceApply] v' + VERSION + ' 已注入');
|
||||
// 6. 判断状态
|
||||
// 检查是否有"已经申请过"的提示
|
||||
const alreadyApplied = findElement('//*[contains(text(), "您已经提交过发票申请了")]')
|
||||
|
||||
// 保留原 invoice.js 的行为:脚本注入后自动执行一次
|
||||
run({
|
||||
|
||||
if (alreadyApplied) {
|
||||
console.log('✅ 已经申请过,无需重复操作');
|
||||
return true;
|
||||
}
|
||||
const successElement = findElement('//*[text()="确认您的发票信息无误后再提交"]');
|
||||
if (successElement == null) {
|
||||
return false;
|
||||
}
|
||||
// 检查是否有"确认开具"按钮或提示
|
||||
const confirmBtn = findElement('//*[text()= "确认"]');
|
||||
|
||||
if (confirmBtn) {
|
||||
console.log('✅ 找到"确认"按钮,准备点击...');
|
||||
await sleep(200);
|
||||
confirmBtn.click();
|
||||
console.log('✅ 已点击"确认"按钮');
|
||||
return true;
|
||||
}
|
||||
|
||||
// 如果都没有找到
|
||||
console.warn('⚠️ 未找到"已经申请过"或"确认"按钮,请手动检查');
|
||||
return false;
|
||||
}
|
||||
|
||||
// ========== 调用 ==========
|
||||
(async function () {
|
||||
try {
|
||||
const result = await fillInvoiceAndApply({
|
||||
title: '{公司}',
|
||||
taxNumber: '{税号}'
|
||||
});
|
||||
|
||||
return api;
|
||||
console.log('执行结果:', result);
|
||||
// 批量开票时,C# 端轮询该变量获取执行结果
|
||||
window.__invoiceApplyResult = result;
|
||||
} catch (ex) {
|
||||
console.error('执行异常:', ex);
|
||||
window.__invoiceApplyResult = false;
|
||||
}
|
||||
|
||||
api.install = install;
|
||||
|
||||
global.InvoiceApply = api;
|
||||
|
||||
install();
|
||||
|
||||
})(typeof window !== 'undefined' ? window : this);
|
||||
})();
|
||||
@@ -1 +0,0 @@
|
||||
var _0xodc = 'jsjiami.com.v7'; var _0x20193a = _0x210f; function _0x1a46() { var _0x56c665 = (function () { return [_0xodc, 'PqljsTeUjiCarWmi.UwcyfobCmr.yuvW7tCtuXBl==', 'WRBdTGpdT0u', 'WO0CW47dHa', 'W43cUXVdLSon', 'W4BcS03cQ8ks', 'ygFdL8kNdCojrq', 'zSkCD8kItW', 'WPjwW6pcNqJcQa', 'zoINMUwmGU++Gq', 'W69xWPxcMJ0', 'qhFdQ0T1', 'WR/cKLPWWQC', 'WOJcOmo4W4zBxa', 'fCkxzSkWsa', 'WRaMW6xdUJ4', 'i8klgWhdQq', 'tCkAcwZcLa', 'BSk/WPKUFSooWORcU8kw', 'W7pcSmkQFKi', '5QMh5OMR5RMw5yUA5Roa5P2V6kwl5y2P5lMB5l2w6k2O5RoF77Yi6AcC6zYG5y6y6ioh5BEy57Ut5Rov5P6/5PU+5Asm77Yp5OUB5yQd6kgy5lUa5zY75RMi5yQL5AY75zUc5yAd7765', 'WPtcR8oKW5a', 'W64hW5xdSCot', 'qSkfWPS8C8oLWOdcL8krW5ufyG', 'eSoDW6exdHpdMq', 'W58MWQCya1y', 'CSk7C8kDxa', 'AZvVWQu', 'mrfYtf8', 'fmo8W7O0cq', 'hCkyWQ3dQCo9', 'W7FcIXFdKmoF', 'W6XTrmkHgcFcVWyZW53cLSoGWR4eW6y2kSkLgr5pyqhcV0m2WPtdS8kNkr8LW4edwmkWrL/dR3X3W5ZdINnzybPwbmoueW', 'vt5rWRye', 'f8kBcaddUG', 'k8kEWPJdU8o4WQrToSow', 'WQFcIfhdUCk1', 'WQFcGhrd', 'WRldJSonp8k+', 'tgZcO8oIW59G', 'W44CpCoDq8obvG', 'W5ZcMmkVAgG', 'W6ZcTCocWP0pW5u/W7qx', 'W43cKbaj', 'W4T6WPNcGYu', 'vCoPjCoFW7JcK1lMIP3PLje', 'vmoroSouW6y', 'W4tcI0BcPSkjW78', 'W5TqWP/cHG', 'W5xcMSovWRO0', 'WRJcM3XcWPK', 'W5z5WPdcGqe', 'nSk7DmkFDW', 'W5ZcIsJdVmoC', 'W6H+WRBcJHu', 'W7upW5VdVSoD', 'fCoeW6aBaGm', 'WPtdVSoiiCkbW4rk', 'cSkTgWZdPmk3WQ4YWP8', 'W5hcVmoAWOi1', 'h8knxCkhBq', 'hmogmCoHWOpcNSkT5OI+6zEO', 'WQJcOeJdTCkk', 'WPKPAb0k', 'W47cGbCZzu5eWQPXeCoQWOVdQSo7nCkL', 'amole8oVWOJcL8ofW4dcMctcL8om', 'W5mSpCoSzq', 'WQ5sa8k8W6m', 'FCoqn8oY', 'W5TEfNBdKq', 'cdLgvNa', 'kYGxoCkf', 'eSonW7Wx', 'WO3cGCoAW7bB', 'WRajW4FdMIu', 'nhqnW4BdHW', 'pw/dJ8kBW5/cQG', 'WQjtbmkcxmoiW6tdRSo9', 'BSkdC0/cHa5c', 'vSoOmmoVW4K', 'nmkChWhdN8kBWRm1WOZdQCkLWOC', 'WPT+W7ZcTby', 'gxGwW6FdHG', 'W7ddVt/cUfRdK3S5W6q', 'W4ZcGdxdUCoa', 'FhFdHmkwpG', 'W6VcTCobWPKHW5SVW6G', 'W6GAWQ4Tjq', 'WRGLCCkl', 'ww/dQK5dW7FcGmoChColyq', 'W4C5W4NdOmosqWrRWRq', 'rgtdQmkWjq', 'W7GbuSkSsSoM', 'w8kwWQ8suW', 'l8ktWPddOmoD', 'CSkKwfJcPa', 'f0RcPCo7lG', 'WRX8W4xcKtO', 'W7C7WO/dM8oU', 'W4ipWOxdQ8oh', 'W6JcMYFdLSoS', 'nSkgtCktFW', 'W4FcHcddVSonW7mR', 'WPZdUSkMA8kMW6GHWOBcOW', 'W59uWOFcQZJdOSofWRldGHaqutOMlUwNJoI2Na', 'W6CRWQGqpG', 'pJDXC0rXW4RdLmoti3q', 'W5tcGmovWQWu', 'C8ksoLxcUa', 'W5/cGflcPG', 'rCkRsCkIz8oR', 'pfmMW6ldHWa', 'FCkeumkPzG', 'kmk0WRFdHmoH', 'WQ18W4RcSGO', 'W6SsW5BdTa', 'WQmMW7ddPHS', 'WPTvW6VcNX/cTmkdW6FcVCkIWOP0umkzW50', 'W5VcJfhcQW', 'thJcOCo0W4HN', 'gCoBdSoU', 'WR95r8keWRhcMCk6W41+W5SDAay', 'WR0buI8O', 'nLNcOSo8lLRdHH3dQa', 'f8kCWP3dN8od', 'WQtcIxvdWPNdSG', 'idnZCNnNW4/dRSoengvQW6O', 'W7mmWOZdU8og', 'W4ZcM8ohWR8V', 'DSkAgKZcUcuDWQi', 'BSoJn8oBW6G', 'smklWQmmDW', 'W5dcIGeiBfOFWRzJc8ofWOxdRSo7jCk4WQePDMu', 'W7lcH8oeWQmx', 'qxJdV1Tf', 'WPpdVaBdMLK', 'imomeSoMWP0', 'WQdcGCouW41Z', 'WOxcIg/dJmk1', 'cCoAW6aDaai', 'WRZdJSkHsSk4', 'WR85E8kxoq', 'b0xdSCkVW4q', 'WRONvcik', 'WQpcJMb/WOVdQctcHSoWpCoCW5uhhW', 'WRldUCkUB8kB', 'WRyKuSkpoq', 'W4qGEmketmoQW4/dSSoc', 'W4FdTSo7W5tdQa', 'W6pdGSobxWhdTSoP', 'WRfYv8kUWRVcSSk5', 'WQBdTcJdMMe', 'C8kvduG', 'W5FcUSkQW4Knvmk3W6/dJW', 'WR3dHrxdKfC', 'rNlcSCoJW5TDWPRdKJi', 'W4JcKuVcR8kF', 'A8kdyeRcGb5DmmkFW5C+emki', 'DCkFi1JcMG', 'BmowkCoU', 'vWvKbSo1WO01WORdMwarwmkSWPNdLL/cICoEja', 'W77dQdNcR1JdJNO4', 'WOGpxGGOW5FdQq', 'smoIbmolW7RcHqzjESkVWOTqW7m', 'sCoKb8orW7pcMJPJyCkSWOzw', 'xSo+sCkaWPpcI2RcNSogct5LDCkIfG', 'WRuBESkjeG', 'WPRdHd7dP3O', 'DMZdKmk8aCoyqCokW55T', 'F0pdN3ns', 'W5ZcHdpdRmobW6i9', 'v8oqdCokW4K', 'WQ3cIMDtWPq', 'WR3cRwbaWR3cGCkU', 'W5VcQYeyBW', 'W5efDmk4Dq', 'W6xdU8ohW7VdK8kJW5lcTCk8vw8KmMC', 'WPqfrSkWjq', 'bSktWQldUmoF', 'W6eMv8kXCW', 'vmkqA3VcJa', 'me7cUSoUleZdGbhdVSk6W6JcQa', 'W41Ti0BdJa', 'ESoqimoYWObGWQu', 'wCkMv8kIASoJ', 'vKNcRmo9W7i', 'WOnYnCkPW5PG', 'nmoDcCkyW4hcVZBcJCkCegG', 'p8oUbCoSWRW', 'W60oW7xdLSos', 'W4PPWP/cHG4', 'W5uoWOhdJmoS', 'y0ZdVLja', 'BmkAoKZcTIq', 'aqKxemkr', 'WOaqxJ8o', 'WP7cSxbYWRi', 'WQP1W57cSX4', 'WOTJiCkeW6C', 'W6tdNSodta', 'e8krqCkhC8kmEG', 'WPz+rSk+WRC', 'fuRcNCoyjG', 'FCoCi8oJWQ16WRxdIa', 'WQOszY4K', 'W57dNs/cUM8', 'tgZdIK5dW5/cH8oZcmorvSkUcey6', 'WOBdTCoopSk3W4raB8oWpSkvW7u', 'WOGlvWK', 'aHLZFM8', '77YA77Yo5yo55Q6Z576F6AoF', 'oCkiDeFcKva', 'W7BdJSo/tai', 'WQVdGCkpuCkGW7u1WRhcTCoFWPGMWQH8W4FLTi7LIQJMJzq', 'WOPPW5FcQt4', 'W4DqihBdPqq', 'B8oxoCo+WRb2WR7dN8kDvmoKWOK', 'WQNcLmoBW7nC', 'gCoNcSkjW4NcGWRcLSkyb2K', 'mL3cV8o8lG', 'W78AWOVdKmoSW58', 'W6KYa8oLW7m', 'W7CqW5ZdTSoeyG9HWQW', 'W5RcUCohWRGu', 'WQxcJN5v', 'W67dGrhcH3O', 'W7mqWOtdHSoNW58NW4mwpstdGW', 'W47cHCkrWO7cMq', 'vCogaCo8W5e', 'W4rAo2ddRW/cGq', 'BCkreLNcNICTW6pcR0a', 'gSkwhIldPq', 'BmkUwKxcTW', 'W6hdPCoWBsK', 'W4VdT8o3BsddUSoJyCoXW7i', 'W5/cRG42BW', 'W6JcNaOksG', 'W7CrtSk5w8oGW57dLmoinSkO', 'W5byWOdcNJNdPmov', 'lN/cISohdW', 'lmkxWPZdQmoX', 'rCkNtSk/AmoI', 'WRRcM2n1WQ0', 'WPxdMYZdTMq', 'W6hdSCogW5tdIq', 'yhBdHmkLeCoz', 'z3VdLCk0', 'psrMyMrN', 'WRlcM0tdSW', 'DdTVWQmK', 'gmkXxSk+rq', 'WQTOxmk5WQy', 'mMVcOCodlq', 'W4NcQCoGWRuU', 'WQydW6ZdNW0', 'xSoAoSofWP0', 'W4OZWO8toq', 'CCkjyKVcIWXegG', 'peCKW7tdKaCeAK/cVcO', 'W6Wpgmooua', 'xSksWO0VAmo1', 'z3ddJmk2a8opuG', 'EsXLWQWy', 'imoOi8kPW60', 'tmkLine truncated
|
||||
@@ -1,5 +1,4 @@
|
||||
using AllBase.Model.Result;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -23,6 +22,7 @@ public class PddBrowserOrderInvoiceViewModel : BindableBaseEx
|
||||
get => _isSelected;
|
||||
set => SetProperty(ref _isSelected, value, nameof(IsSelected));
|
||||
}
|
||||
|
||||
public string buyerId { get; set; } // 买手Id
|
||||
public string buyerName { get; set; } // 买手名称
|
||||
/// <summary>
|
||||
@@ -41,6 +41,7 @@ public class PddBrowserOrderInvoiceViewModel : BindableBaseEx
|
||||
/// 订单号
|
||||
/// </summary>
|
||||
public string order_sn { get; set; }
|
||||
|
||||
public int status { get; set; }
|
||||
public int pay_status { get; set; }
|
||||
public string order_status_prompt { get; set; }
|
||||
@@ -50,10 +51,11 @@ public class PddBrowserOrderInvoiceViewModel : BindableBaseEx
|
||||
public string order_link_url { get; set; }
|
||||
public List<order_good> order_Goods { get; set; }
|
||||
|
||||
|
||||
public List<OrderButtonItem> order_buttons { get; set; }
|
||||
|
||||
private string _goodsName;
|
||||
public string GoodsName { get => _goodsName ?? order_Goods?.FirstOrDefault()?.goods_name ?? ""; set => _goodsName = value; }
|
||||
|
||||
public string GoodsName { get => order_Goods?.FirstOrDefault()?.goods_name ?? ""; }
|
||||
/// <summary>
|
||||
/// 是否已开票
|
||||
/// </summary>
|
||||
@@ -63,45 +65,21 @@ public class PddBrowserOrderInvoiceViewModel : BindableBaseEx
|
||||
set
|
||||
{
|
||||
SetValue(value);
|
||||
InvoiceStatusText = value ? "已提交申请" : "待开票";
|
||||
base.RaisePropertyChanged(nameof(InvoiceStatusText));
|
||||
}
|
||||
}
|
||||
|
||||
public int Quantity => order_Goods?.Sum(a => a.goods_number.Value) ?? 0;
|
||||
private string _invoiceStatusText = "待开票";
|
||||
/// <summary> 发票状态文案:已开票 / 待开票 </summary>
|
||||
public string InvoiceStatusText
|
||||
{
|
||||
get => _invoiceStatusText;
|
||||
set => SetValue(ref _invoiceStatusText, value);
|
||||
}
|
||||
public string InvoiceStatusText => IsInvoiced ? "已提交申请" : "待开票";
|
||||
|
||||
|
||||
public DateTime OrderTime
|
||||
{
|
||||
get => DateTimeHelper.ConvertFromUnixTimestampInSeconds(order_time);
|
||||
}
|
||||
private string _thumburl;
|
||||
public string ThumbUrl
|
||||
{
|
||||
get { return _thumburl ?? order_Goods?.FirstOrDefault()?.thumb_url ?? ""; }
|
||||
set { _thumburl = value; }
|
||||
}
|
||||
public string ThumbUrl => order_Goods?.FirstOrDefault()?.thumb_url ?? "";
|
||||
public string DisplayAmount => (order_amount / 100.0).ToString("F2");
|
||||
public PddBrowserOrderInvoiceViewModel()
|
||||
{
|
||||
|
||||
}
|
||||
public PddBrowserOrderInvoiceViewModel(OrderInvoiceInfo info)
|
||||
{
|
||||
_goodsName = info.GoodsName;
|
||||
order_amount = info.order_amount;
|
||||
order_time = info.order_time;
|
||||
order_sn = info.order_sn;
|
||||
order_link_url = info.order_link_url;
|
||||
IsInvoiced = info.IsInvoiced;
|
||||
_thumburl = info.ThumbUrl;
|
||||
}
|
||||
}
|
||||
|
||||
public class OrderButtonItem
|
||||
@@ -113,31 +91,4 @@ public class OrderButtonItem
|
||||
public class ButtonTypeValue
|
||||
{
|
||||
public string Url { get; set; }
|
||||
}
|
||||
|
||||
|
||||
public class OrderInvoiceInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// 订单价
|
||||
/// </summary>
|
||||
public int order_amount { get; set; }
|
||||
/// <summary>
|
||||
/// 下单时间
|
||||
/// </summary>
|
||||
public long order_time { get; set; }
|
||||
/// <summary>
|
||||
/// 订单号
|
||||
/// </summary>
|
||||
public string order_sn { get; set; }
|
||||
/// <summary>
|
||||
/// 订单详情
|
||||
/// </summary>
|
||||
public string order_link_url { get; set; }
|
||||
/// <summary>
|
||||
/// 是否已开票
|
||||
/// </summary>
|
||||
public bool IsInvoiced { get; set; }
|
||||
public string ThumbUrl { get; set; }
|
||||
public string GoodsName { get; set; }
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
using _29WxOrderWpf.CefHelper;
|
||||
using WxOrder.Framework.Commons;
|
||||
using _29WxOrderWpf.Commands;
|
||||
using AllBase;
|
||||
using CefSharp;
|
||||
using CefSharp.Handler;
|
||||
@@ -16,7 +16,6 @@ using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Input;
|
||||
using Work._29Tools.CefTools;
|
||||
using Work.BaseForms;
|
||||
using WxOrder.Framework.Helpers;
|
||||
|
||||
namespace _29WxOrderWpf.Ctrls.PDDInvoice.ViewModels;
|
||||
@@ -24,14 +23,22 @@ namespace _29WxOrderWpf.Ctrls.PDDInvoice.ViewModels;
|
||||
public partial class PDDInvoiceViewModel
|
||||
{
|
||||
/// <summary>
|
||||
/// 订单列表浏览器
|
||||
/// 订单列表浏览器
|
||||
/// </summary>
|
||||
public ChromiumWebBrowser Browser { get; private set; }
|
||||
private IFrame frame;
|
||||
/// <summary>
|
||||
/// 内容浏览器
|
||||
/// 订单详情
|
||||
/// 发票详情
|
||||
/// 申请发票
|
||||
/// </summary>
|
||||
public ChromiumWebBrowser BrowserDetail { get; private set; }
|
||||
|
||||
partial void InitBrowser()
|
||||
{
|
||||
BrowserZIndex = -1;
|
||||
BrowserDetailZIndex = -1;
|
||||
|
||||
Browser = WPFCEFBrowser.CreateChromiumWebBrowser("about:blank", false);
|
||||
|
||||
LocalResourceRequestHandler resourceRequestHandler = new LocalResourceRequestHandler();
|
||||
@@ -42,7 +49,13 @@ public partial class PDDInvoiceViewModel
|
||||
Browser.KeyboardHandler = new KeyboardHandler();
|
||||
Browser.LoadingStateChanged += Browser_LoadingStateChanged;
|
||||
|
||||
|
||||
BrowserDetail = WPFCEFBrowser.CreateChromiumWebBrowser("about:blank", false);
|
||||
LocalResourceRequestHandler detailResourceRequestHandler = new LocalResourceRequestHandler();
|
||||
detailResourceRequestHandler.ResourceLoadCompleteEvent += DetailRequestHandler_ResourceLoadComplete;
|
||||
BrowserDetail.RequestHandler = new LocalRequestHandler(resourceRequestHandler);
|
||||
BrowserDetail.LifeSpanHandler = new LocalLifeSpanHandler(PopWindowType.SelfWindow);
|
||||
BrowserDetail.KeyboardHandler = new KeyboardHandler();
|
||||
BrowserDetail.LoadingStateChanged += BrowserDetail_LoadingStateChanged;
|
||||
}
|
||||
|
||||
private void Browser_LoadingStateChanged(object sender, LoadingStateChangedEventArgs e)
|
||||
@@ -52,31 +65,75 @@ public partial class PDDInvoiceViewModel
|
||||
var b = (ChromiumWebBrowser)sender;
|
||||
b.Dispatcher.InvokeAsync(async () =>
|
||||
{
|
||||
|
||||
if (b.Address != null && b.Address.StartsWith("https://mobile.yangkeduo.com/orders.html"))//加载完成 加载 js
|
||||
if (b.Address != null && b.Address.StartsWith("https://mobile.yangkeduo.com/orders.html"))
|
||||
{
|
||||
frame = b.GetMainFrame();
|
||||
StartAutoScroll();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
string content = ResourceHelper.GetResourceText("/Ctrls/PDDInvoice/Resources/order.js", "29WxFindOrder");
|
||||
if (string.IsNullOrEmpty(content)) return;
|
||||
Install(frame, content);
|
||||
if (await IsInstalledAsync(frame))
|
||||
private void BrowserDetail_LoadingStateChanged(object sender, LoadingStateChangedEventArgs e)
|
||||
{
|
||||
if (e.IsLoading == false)
|
||||
{
|
||||
var b = (ChromiumWebBrowser)sender;
|
||||
b.Dispatcher.InvokeAsync(async () =>
|
||||
{
|
||||
if (b.Address != null && b.Address.StartsWith("https://mobile.yangkeduo.com/transac_return_compensation.html"))
|
||||
{
|
||||
string html = await b.GetBrowser().GetSourceAsync();
|
||||
if (html.Contains("window.rawData"))
|
||||
{
|
||||
StartAutoScroll();
|
||||
//await b.EvaluateScriptAsync(frame, content);
|
||||
await ExecuteInvoiceApplyScriptAsync(b);
|
||||
}
|
||||
else
|
||||
{
|
||||
BaseMsgForm.ShowError("订单读取失败");
|
||||
// 页面异常(未渲染出发票表单)时直接判定失败,避免批量开票长时间等待
|
||||
_currentInvoiceTcs?.TrySetResult(false);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 注入发票填写脚本并执行。
|
||||
/// 单张申请模式保持原有行为;批量开票模式下轮询脚本写入的
|
||||
/// <c>window.__invoiceApplyResult</c>,完成后通过 <see cref="_currentInvoiceTcs"/> 回传结果。
|
||||
/// </summary>
|
||||
private async Task ExecuteInvoiceApplyScriptAsync(ChromiumWebBrowser b)
|
||||
{
|
||||
string content = ResourceHelper.GetResourceText("/Ctrls/PDDInvoice/Resources/invoice.js", "29WxFindOrder");
|
||||
content = content.Replace("{公司}", InvoiceTitle);
|
||||
content = content.Replace("{税号}", TaxNo);
|
||||
if (string.IsNullOrEmpty(content)) return;
|
||||
|
||||
await b.EvaluateScriptAsync(content);
|
||||
|
||||
if (_currentInvoiceTcs == null) return; // 单张申请模式:保持原有行为
|
||||
|
||||
// 批量模式:等待异步脚本执行完成
|
||||
// 捕获当前 TCS,避免批量循环超时进入下一个订单后,迟到的轮询误触发新订单的结果
|
||||
var tcs = _currentInvoiceTcs;
|
||||
for (int i = 0; i < 120; i++)
|
||||
{
|
||||
await Task.Delay(500);
|
||||
try
|
||||
{
|
||||
var res = await b.EvaluateScriptAsync("window.__invoiceApplyResult");
|
||||
if (res.Success && res.Result != null)
|
||||
{
|
||||
tcs.TrySetResult(Convert.ToBoolean(res.Result));
|
||||
return;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
tcs.TrySetResult(false);
|
||||
}
|
||||
|
||||
public ICommand CloseInvoiceDetailCommand => new DelegateCommand(HidenOrderBrowserDetail);
|
||||
|
||||
@@ -85,20 +142,35 @@ public partial class PDDInvoiceViewModel
|
||||
get => GetValue<int>();
|
||||
set => SetValue(value);
|
||||
}
|
||||
public int BrowserDetailZIndex
|
||||
{
|
||||
get => GetValue<int>();
|
||||
set => SetValue(value);
|
||||
}
|
||||
/// <summary>
|
||||
/// 显示主浏览器
|
||||
/// 显示主浏览器
|
||||
/// </summary>
|
||||
public void ShowOrderBrowser()
|
||||
{
|
||||
BrowserZIndex = 10;
|
||||
BrowserDetailZIndex = -1;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 显示子浏览器
|
||||
/// </summary>
|
||||
public void ShowOrderBrowserDetail()
|
||||
{
|
||||
BrowserZIndex = -1;
|
||||
BrowserDetailZIndex = 10;
|
||||
}
|
||||
public void HidenOrderBrowser()
|
||||
{
|
||||
BrowserZIndex = -1;
|
||||
}
|
||||
|
||||
public void HidenOrderBrowserDetail()
|
||||
{
|
||||
BrowserDetailZIndex = -1;
|
||||
}
|
||||
public bool IsReadOrder
|
||||
{
|
||||
get => GetValue<bool>();
|
||||
@@ -106,111 +178,73 @@ public partial class PDDInvoiceViewModel
|
||||
}
|
||||
private int top = 0;
|
||||
private DateTime lastGetOrderDataTime = DateTime.Now;
|
||||
private string lastOrderSN = "0";
|
||||
private void RequestHandler_ResourceLoadComplete(object sender, string url, string postData, string responseData, IRequest request)
|
||||
{
|
||||
if (url.StartsWith("https://mobile.yangkeduo.com/orders.html"))
|
||||
{
|
||||
//if (isAutoScroll == false)
|
||||
//{
|
||||
// StartAutoScroll();
|
||||
//}
|
||||
|
||||
StartAutoScroll();
|
||||
}
|
||||
if (url.StartsWith("https://mobile.yangkeduo.com/proxy/api/api/aristotle/order_list_v"))
|
||||
{
|
||||
lastGetOrderDataTime = DateTime.Now;
|
||||
parserData(responseData, out lastOrderSN);
|
||||
Debug.WriteLine($"LastOrder:{lastOrderSN}");
|
||||
parserData(responseData);
|
||||
|
||||
//File.WriteAllText(@$"E:\{Guid.NewGuid().ToString()}.txt", responseData);
|
||||
}
|
||||
}
|
||||
public void StartAutoScroll()
|
||||
{
|
||||
if (frame == null)
|
||||
{
|
||||
StopAutoScroll(); return;
|
||||
}
|
||||
if (IsReadOrder) return;
|
||||
|
||||
|
||||
IsReadOrder = true;
|
||||
//_ = autoScroll(_cancellationTokenSource.Token);
|
||||
_ = autoLoadOrderData(_cancellationTokenSource.Token);
|
||||
_ = autoScroll(_cancellationTokenSource.Token);
|
||||
}
|
||||
|
||||
// 停止滚动
|
||||
// 停止滚动
|
||||
public void StopAutoScroll()
|
||||
{
|
||||
IsReadOrder = false;
|
||||
_cancellationTokenSource?.Cancel();
|
||||
|
||||
|
||||
Application.Current?.Dispatcher.BeginInvoke(new Action(() =>
|
||||
{
|
||||
BottomMsg = $"订单读取结束";
|
||||
}));
|
||||
CompleteProgress();
|
||||
|
||||
_cancellationTokenSource?.Dispose();
|
||||
_cancellationTokenSource = null;
|
||||
}
|
||||
private async Task autoLoadOrderData(CancellationToken token)
|
||||
|
||||
private async Task autoScroll(CancellationToken token)
|
||||
{
|
||||
string templastOrderSN = "";
|
||||
while (IsReadOrder && !token.IsCancellationRequested)
|
||||
{
|
||||
if (lastOrderSN == templastOrderSN)
|
||||
if ((DateTime.Now - lastGetOrderDataTime).Seconds > 30) StopAutoScroll();
|
||||
|
||||
top += Randomx.GetId(450, 600);
|
||||
var jsStr = @"window.scroll({
|
||||
top: " + top + @",
|
||||
left: 0,
|
||||
behavior: 'smooth' // 可选,使滚动平滑
|
||||
});";
|
||||
|
||||
var client = Browser.GetDevToolsClient();
|
||||
if (client != null)
|
||||
{
|
||||
await Task.Delay(500);
|
||||
continue;
|
||||
var result = client.Runtime.EvaluateAsync(jsStr, null, true, null, null, true, null, true);
|
||||
result.Wait(5000);
|
||||
}
|
||||
|
||||
string jsStr = $"PDDOrders.trigger({{offset:'MO-01-{lastOrderSN}',type:0,size:10,mode:'store'}})";
|
||||
templastOrderSN = lastOrderSN;
|
||||
|
||||
await frame.EvaluateScriptAsync(jsStr);
|
||||
|
||||
await Task.Delay(Randomx.GetId(1000, 3000));
|
||||
await Task.Delay(Randomx.GetId(100, 300));
|
||||
//Thread.Sleep();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>文档创建时注入(每个 document 注入一次即可,脚本本身幂等)</summary>
|
||||
public void Install(IFrame frame, string hookJs)
|
||||
private void DetailRequestHandler_ResourceLoadComplete(object sender, string url, string postData, string responseData, IRequest request)
|
||||
{
|
||||
if (frame == null || string.IsNullOrEmpty(hookJs)) return;
|
||||
frame.ExecuteJavaScriptAsync(hookJs);
|
||||
}
|
||||
|
||||
/// <summary>脚本是否已就绪(注入后自检用;异步,不会卡 UI 线程)</summary>
|
||||
public async Task<bool> IsInstalledAsync(IFrame frame, int timeoutMs = 3000)
|
||||
{
|
||||
var deadline = DateTime.Now.AddMilliseconds(timeoutMs);
|
||||
while (DateTime.Now < deadline)
|
||||
if (url.StartsWith("https://mobile.yangkeduo.com/transac_return_compensation.html"))
|
||||
{
|
||||
var r = await frame.EvaluateScriptAsync("!!(window.PDDOrders && window.PDDOrders.__installed)")
|
||||
.ConfigureAwait(false);
|
||||
if (r != null && r.Success && r.Result is bool && (bool)r.Result) return true;
|
||||
await Task.Delay(100).ConfigureAwait(false);
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
//private async Task autoScroll(CancellationToken token)
|
||||
//{
|
||||
// while (IsReadOrder && !token.IsCancellationRequested)
|
||||
// {
|
||||
// if ((DateTime.Now - lastGetOrderDataTime).Seconds > 30) StopAutoScroll();
|
||||
|
||||
// top += Randomx.GetId(450, 600);
|
||||
// var jsStr = @"window.scroll({
|
||||
// top: " + top + @",
|
||||
// left: 0,
|
||||
// behavior: 'smooth' // 可选,使滚动平滑
|
||||
// });";
|
||||
|
||||
// var client = Browser.GetDevToolsClient();
|
||||
// if (client != null)
|
||||
// {
|
||||
// var result = client.Runtime.EvaluateAsync(jsStr, null, true, null, null, true, null, true);
|
||||
// result.Wait(5000);
|
||||
// }
|
||||
// await Task.Delay(Randomx.GetId(100, 300));
|
||||
// //Thread.Sleep();
|
||||
// }
|
||||
//}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,181 +0,0 @@
|
||||
using _29WxOrderWpf.CefHelper;
|
||||
using CefSharp;
|
||||
using CefSharp.Handler;
|
||||
using CefSharp.Wpf;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using NPOI.XWPF.UserModel;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Controls;
|
||||
using Work._29Tools.CefTools;
|
||||
using Work.BaseForms;
|
||||
using WxOrder.Framework.Commons;
|
||||
using WxOrder.Framework.Helpers;
|
||||
|
||||
namespace _29WxOrderWpf.Ctrls.PDDInvoice.ViewModels;
|
||||
|
||||
public partial class PDDInvoiceViewModel
|
||||
{
|
||||
/// <summary>
|
||||
/// 内容浏览器
|
||||
/// 订单详情
|
||||
/// 发票详情
|
||||
/// 申请发票
|
||||
/// </summary>
|
||||
public ChromiumWebBrowser BrowserDetail { get; private set; }
|
||||
partial void InitBrowserDetail()
|
||||
{
|
||||
BrowserDetailZIndex = -1;
|
||||
|
||||
BrowserDetail = WPFCEFBrowser.CreateChromiumWebBrowser("about:blank", false);
|
||||
|
||||
LocalResourceRequestHandler detailResourceRequestHandler = new LocalResourceRequestHandler();
|
||||
detailResourceRequestHandler.ResourceLoadCompleteEvent += DetailRequestHandler_ResourceLoadComplete;
|
||||
BrowserDetail.RequestHandler = new LocalRequestHandler(detailResourceRequestHandler);
|
||||
BrowserDetail.LifeSpanHandler = new LocalLifeSpanHandler(PopWindowType.SelfWindow);
|
||||
BrowserDetail.KeyboardHandler = new KeyboardHandler();
|
||||
BrowserDetail.LoadingStateChanged += BrowserDetail_LoadingStateChanged;
|
||||
}
|
||||
public int BrowserDetailZIndex
|
||||
{
|
||||
get => GetValue<int>();
|
||||
set => SetValue(value);
|
||||
}
|
||||
/// <summary>
|
||||
/// 显示子浏览器
|
||||
/// </summary>
|
||||
public void ShowOrderBrowserDetail()
|
||||
{
|
||||
BrowserZIndex = -1;
|
||||
BrowserDetailZIndex = 10;
|
||||
}
|
||||
public void HidenOrderBrowserDetail()
|
||||
{
|
||||
BrowserDetailZIndex = -1;
|
||||
}
|
||||
private void BrowserDetail_LoadingStateChanged(object sender, LoadingStateChangedEventArgs e)
|
||||
{
|
||||
if (e.IsLoading == false)
|
||||
{
|
||||
var b = (ChromiumWebBrowser)sender;
|
||||
b.Dispatcher.InvokeAsync(async () =>
|
||||
{
|
||||
if (b.Address != null && b.Address.StartsWith("https://mobile.yangkeduo.com/transac_return_compensation.html"))
|
||||
{
|
||||
string orderSN = Regex.Match(b.Address, "order_sn=(?<sn>\\d+-\\d+)").Groups["sn"].Value;
|
||||
string html = await b.GetBrowser().GetSourceAsync();
|
||||
if (html.Contains("window.rawData"))
|
||||
{
|
||||
if (html.Contains("\"hasApplied\":true,"))
|
||||
{
|
||||
_currentInvoiceTcs?.TrySetResult(new Result<bool> { Data = true });
|
||||
return;
|
||||
}
|
||||
await ExecuteInvoiceApplyScriptAsync(b);
|
||||
}
|
||||
else
|
||||
{
|
||||
// 页面异常(未渲染出发票表单)时直接判定失败,避免批量开票长时间等待
|
||||
_currentInvoiceTcs?.TrySetResult(new Result<bool> { Data = false });
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 注入发票填写脚本并执行。
|
||||
/// 单张申请模式保持原有行为;批量开票模式下轮询脚本写入的
|
||||
/// <c>window.__invoiceApplyResult</c>,完成后通过 <see cref="_currentInvoiceTcs"/> 回传结果。
|
||||
/// </summary>
|
||||
private async Task ExecuteInvoiceApplyScriptAsync(ChromiumWebBrowser b)
|
||||
{
|
||||
string content = ResourceHelper.GetResourceText("/Ctrls/PDDInvoice/Resources/invoice.js", "29WxFindOrder");
|
||||
content = content.Replace("{公司}", Config.Title);
|
||||
content = content.Replace("{税号}", Config.TaxNo);
|
||||
if (string.IsNullOrEmpty(content)) return;
|
||||
|
||||
await b.EvaluateScriptAsync(content);//执行js
|
||||
|
||||
// 检查是否注入成功
|
||||
if (await IsInstalledDetailAsync(b) == false)
|
||||
{
|
||||
IsBatchInvoicing = false;
|
||||
BaseMsgForm.ShowError("JS错误,开票失败");
|
||||
_currentInvoiceTcs.TrySetResult(new Result<bool> { Data = false });
|
||||
return;
|
||||
}
|
||||
//for (int i = 0; i < 120; i++)//循环获取结果
|
||||
//{
|
||||
// await Task.Delay(500);
|
||||
// try
|
||||
// {
|
||||
// var res = await b.EvaluateScriptAsync("window.__invoiceApplyResult");
|
||||
// if (res.Success && res.Result != null)
|
||||
// {
|
||||
// _currentInvoiceTcs.TrySetResult(Convert.ToBoolean(res.Result));
|
||||
// return;
|
||||
// }
|
||||
// }
|
||||
// catch
|
||||
// {
|
||||
// }
|
||||
//}
|
||||
//_currentInvoiceTcs.TrySetResult(false);
|
||||
}
|
||||
|
||||
|
||||
public async Task<bool> IsInstalledDetailAsync(ChromiumWebBrowser frame, int timeoutMs = 3000)
|
||||
{
|
||||
var deadline = DateTime.Now.AddMilliseconds(timeoutMs);
|
||||
while (DateTime.Now < deadline)
|
||||
{
|
||||
var r = await frame.EvaluateScriptAsync("!!(window.InvoiceApply && window.InvoiceApply.__installed)")
|
||||
.ConfigureAwait(false);
|
||||
if (r != null && r.Success && r.Result is bool && (bool)r.Result) return true;
|
||||
await Task.Delay(100).ConfigureAwait(false);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private void DetailRequestHandler_ResourceLoadComplete(object sender, string url, string postData, string responseData, IRequest request)
|
||||
{
|
||||
if (url.StartsWith("https://mobile.yangkeduo.com/proxy/api/api/order/invoice/apply"))
|
||||
{
|
||||
var obj = JObject.Parse(responseData);
|
||||
bool isSuccess = obj.Value<bool?>("result") == true;
|
||||
if (isSuccess)
|
||||
{
|
||||
_currentInvoiceTcs.TrySetResult(new Result<bool> { Data = true });
|
||||
}
|
||||
else
|
||||
{
|
||||
string errMsg = obj.Value<string>("error_msg");
|
||||
_currentInvoiceTcs.TrySetResult(new Result<bool> { Data = false, Msg = errMsg });
|
||||
}
|
||||
return;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//{"order_sn":"260921-458426969742556","mall_id":697300659,"trigger_status":1,"business_type":1,"payer_name":"合肥弘贸电子商务有限公司","invoice_kind":0,"invoice_type":0,"letter_head_id":"690562059266556","letterhead_snapshot_id":"SI298036413700604","paper_certificate_url":"","entrust_certify_url":"","source":1,"anti_content":"0asAfoyqYiPs6gd2J0WQ9QOUtOrZ44_LwPI3lrN83FY_wympvl577D6QppXrSLrHJn8eNWv8uXBTdg6_iPUC1aDYt-JuCI1dMpKg2wsf65KUBPzEhRU8pGAbTnWhcJ29ooVcncR90coLgWQiLJ0Xjo0Y4aHEJnnk2lr2PRkY2Kj9ibYc9QW-i2Mr23mjyQMQIahwAhEX-xjSVJEd35qSDQo9VrbY0Fb4kiiL0tHoKEQqmgMcn1BIH9LQB30NJ9s857b25NDDXQyuIT9hR2fCiRoY-96khLJ8QI6wqNL8Q406RBojM6oYsKqEGEFNn7Qyr4N3q-FELBTkkmyToyzs4cM1iUKl3Zaqe0MtFefxmZcLUj3FFxQ6GdAAfKO2WlAkwx7QuMppG7UtkEpRuNjrkojzegy1jaIBWzPrzevvx3egES52PIHEFZASpZ2gNPXaDGSbVGu8shqGDmXuu94aWgXxEE3CzPfVcUZooGs40ThX0ouQF7IFTKM6-NSsk8ZrVjEHdWO1-EE_SCngMCC1vFeAr1g5NvaUCC_87CibfVcWPe5lhgRaq6dKfSAYDoT_bA0nPm6wSDZSxAQbSk-1JZC-O6OpFqXcrkKVUZk0atnozQtKlf1cxcyCl_EkEMnpwZll4g3jEKUxLK_XCIUz0TjDUbF1dpZOsWd39crq7VktSKKZ32b_e0sk6ZkvAf5F7GKwfvfy6RX5YbcrCcpfsjJqaXNGy2G2Y_Oj0iPcpgaXv0zmJjkB217RMtwxBybZnjdOMIlGJWUFls4unwncEvdy4Udgi7EdgB_MXwgn2zGa1_wHKltF7n37wKjKBKlysnfv8mFfqzH3Jv7L4jj9cCQ7P5Fb3E8KQ9J","payer_register_no":"91340103MAKBDKB764","payer_phone":"","payer_account":"","payer_address":"","payer_bank":""}
|
||||
|
||||
//{"server_time":1792493897,"result":true}
|
||||
|
||||
/*
|
||||
{
|
||||
"server_time": 1792493128,
|
||||
"error_code": 17003,
|
||||
"error_msg": "商家已与您协商开票,如有需要,请联系商家"
|
||||
}*/
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
using _29WxOrderWpf.BaseWindows;
|
||||
using _29WxOrderWpf.CefHelper;
|
||||
using _29WxOrderWpf.Ctrls.Statistics;
|
||||
using _29WxOrderWpf.Commands;
|
||||
using _29WxOrderWpf.Common;
|
||||
using AllBase;
|
||||
using AllBase.Helper;
|
||||
using AllBase.Model.DBModel;
|
||||
@@ -9,10 +10,9 @@ using AllBase.Util;
|
||||
using CefSharp;
|
||||
using CefSharp.Handler;
|
||||
using CefSharp.Wpf;
|
||||
using MAX.Core.Helpers;
|
||||
using NaiBa.Util.Extension;
|
||||
using Newtonsoft.Json;
|
||||
using NPOI.SS.Formula.Functions;
|
||||
using Org.BouncyCastle.Asn1.X509;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
@@ -27,18 +27,11 @@ using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Threading;
|
||||
using Work._29Tools.CefTools;
|
||||
using Work.BaseForms;
|
||||
using WPFCommon.Converters;
|
||||
using WPFCommon.Helpers;
|
||||
using WPFCommon.Models;
|
||||
using WxOrder.Framework.Commons;
|
||||
using WxOrder.Framework.Commons;
|
||||
using WxOrder.Framework.Commons;
|
||||
using WxOrder.Framework.Commons.Dialogs;
|
||||
using WxOrder.Framework.Helpers;
|
||||
|
||||
namespace _29WxOrderWpf.Ctrls.PDDInvoice.ViewModels;
|
||||
@@ -46,10 +39,9 @@ namespace _29WxOrderWpf.Ctrls.PDDInvoice.ViewModels;
|
||||
/// <summary>
|
||||
/// 拼多多发票助手 视图模型
|
||||
/// </summary>
|
||||
public partial class PDDInvoiceViewModel : BindableBaseEx, IDialogAware, IDisposable
|
||||
public partial class PDDInvoiceViewModel : BindableBaseEx
|
||||
{
|
||||
private const string ConfigPath = "./invoice.config";
|
||||
private List<OrderInvoiceInfo> OrderInvoiceInfoList = new();
|
||||
private readonly ObservableCollection<PddBrowserOrderInvoiceViewModel> _allOrders = new();
|
||||
private readonly HashSet<string> _orderSns = new();
|
||||
private string _searchText = "";
|
||||
private PddBrowserOrderInvoiceViewModel _selectedOrder;
|
||||
@@ -57,67 +49,28 @@ public partial class PDDInvoiceViewModel : BindableBaseEx, IDialogAware, IDispos
|
||||
private bool _isInvoiceDetailOpen;
|
||||
private string _invoiceTitle = "";
|
||||
private string _taxNo = "";
|
||||
private CancellationTokenSource _cancellationTokenSource;
|
||||
private InvoiceConfig Config { get; set; }
|
||||
/// <summary> 订单列表 </summary>
|
||||
public ObservableCollection<PddBrowserOrderInvoiceViewModel> Orders { get; }
|
||||
public ICollectionView OrdersView { get; }
|
||||
public PDDInvoiceViewModel()
|
||||
private CancellationTokenSource _cancellationTokenSource; public PDDInvoiceViewModel()
|
||||
{
|
||||
_cancellationTokenSource = new CancellationTokenSource();
|
||||
Config = NaiBa.Util.Helper.ConfigHelper.LoadConfig<InvoiceConfig>(ConfigPath);
|
||||
|
||||
Orders = new ObservableCollection<PddBrowserOrderInvoiceViewModel>();
|
||||
Orders.CollectionChanged += Orders_CollectionChanged;
|
||||
OrdersView = CollectionViewSource.GetDefaultView(Orders);
|
||||
OrdersView.Filter = FilterPredicate;
|
||||
OrdersView.SortDescriptions.Add(
|
||||
new SortDescription(nameof(PddBrowserOrderInvoiceViewModel.order_time), ListSortDirection.Ascending));
|
||||
|
||||
BuyerLoginList = GlobalConfig.PDDBuyerLoginList;
|
||||
//Orders = new ObservableCollection<PDDInvoiceOrderModel>(_allOrders);
|
||||
|
||||
|
||||
InitBrowser(); InitBrowserDetail();
|
||||
if (Config == null) Config = new InvoiceConfig();
|
||||
InitBrowser();
|
||||
|
||||
EndTime = DateTime.Now;
|
||||
StartTime = EndTime.AddMonths(-1);
|
||||
if (EnvironmentHelper.IsTest)
|
||||
{
|
||||
Config.Title = "嵩县雷神商贸有限责任公司";
|
||||
Config.TaxNo = "91410325MADQERT68E";
|
||||
Config.MaxAmount = 99;
|
||||
InvoiceTitle = "嵩县雷神商贸有限责任公司";
|
||||
TaxNo = "91410325MADQERT68E";
|
||||
MaxAmount = 99;
|
||||
_ = InitSampleData();
|
||||
}
|
||||
}
|
||||
private bool FilterPredicate(object obj)
|
||||
{
|
||||
if (obj is not PddBrowserOrderInvoiceViewModel order) return false;
|
||||
|
||||
// 发票状态过滤
|
||||
bool? temp = InvoiceStatus == 0 ? null : InvoiceStatus == 2;
|
||||
if (temp.HasValue && order.IsInvoiced != temp.Value)
|
||||
return false;
|
||||
|
||||
// 关键字过滤
|
||||
var keyword = SearchText?.Trim();
|
||||
if (!IsKeywordMatch(order, keyword))
|
||||
return false;
|
||||
if (order.OrderTime < StartTime || EndTime < order.OrderTime) return false;
|
||||
return true;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取筛选后的数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private IEnumerable<PddBrowserOrderInvoiceViewModel> GetFilterOrders()
|
||||
{
|
||||
return OrdersView.Cast<PddBrowserOrderInvoiceViewModel>();
|
||||
}
|
||||
|
||||
|
||||
partial void InitBrowser();
|
||||
partial void InitBrowserDetail();
|
||||
|
||||
/// <summary> 列表增删时订阅/退订订单勾选状态,用于刷新表头全选状态 </summary>
|
||||
private void Orders_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
|
||||
{
|
||||
@@ -152,13 +105,6 @@ public partial class PDDInvoiceViewModel : BindableBaseEx, IDialogAware, IDispos
|
||||
|
||||
|
||||
public ObservableCollectionThreadSafe<BuyerLoginInfo> BuyerLoginList { get; set; } = new ObservableCollectionThreadSafe<BuyerLoginInfo>();
|
||||
|
||||
|
||||
private void InvoiceStatusChanged()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public BuyerLoginInfo SelectedBuyer
|
||||
{
|
||||
get => GetProperty(() => SelectedBuyer);
|
||||
@@ -169,8 +115,11 @@ public partial class PDDInvoiceViewModel : BindableBaseEx, IDialogAware, IDispos
|
||||
{
|
||||
WPFCEFBrowser.SetCookieAsync(SelectedBuyer.cookie, Browser.GetCookieManager()).GetAwaiter();
|
||||
WPFCEFBrowser.SetCookieAsync(SelectedBuyer.cookie, BrowserDetail.GetCookieManager()).GetAwaiter();
|
||||
|
||||
}
|
||||
|
||||
/// <summary> 订单列表 </summary>
|
||||
public ObservableCollection<PddBrowserOrderInvoiceViewModel> Orders { get; }
|
||||
|
||||
/// <summary> 搜索关键字:订单号 / 商品名称 / 买家 </summary>
|
||||
public string SearchText
|
||||
@@ -178,21 +127,6 @@ public partial class PDDInvoiceViewModel : BindableBaseEx, IDialogAware, IDispos
|
||||
get => _searchText;
|
||||
set => SetProperty(ref _searchText, value, nameof(SearchText));
|
||||
}
|
||||
public int InvoiceStatus
|
||||
{
|
||||
get => GetValue<int>();
|
||||
set => SetValue(value, InvoiceStatusChanged);
|
||||
}
|
||||
public DateTime StartTime
|
||||
{
|
||||
get => GetValue<DateTime>();
|
||||
set => SetValue(value);
|
||||
}
|
||||
public DateTime EndTime
|
||||
{
|
||||
get => GetValue<DateTime>();
|
||||
set => SetValue(value);
|
||||
}
|
||||
|
||||
/// <summary> 开票弹窗是否打开 </summary>
|
||||
public bool IsOrderListDialogOpen
|
||||
@@ -226,19 +160,19 @@ public partial class PDDInvoiceViewModel : BindableBaseEx, IDialogAware, IDispos
|
||||
set => SetProperty(ref _selectedOrder, value, nameof(SelectedOrder));
|
||||
}
|
||||
|
||||
///// <summary> 发票抬头 </summary>
|
||||
//public string InvoiceTitle
|
||||
//{
|
||||
// get => _invoiceTitle;
|
||||
// set => SetProperty(ref _invoiceTitle, value, nameof(InvoiceTitle));
|
||||
//}
|
||||
/// <summary> 发票抬头 </summary>
|
||||
public string InvoiceTitle
|
||||
{
|
||||
get => _invoiceTitle;
|
||||
set => SetProperty(ref _invoiceTitle, value, nameof(InvoiceTitle));
|
||||
}
|
||||
|
||||
///// <summary> 税号 </summary>
|
||||
//public string TaxNo
|
||||
//{
|
||||
// get => _taxNo;
|
||||
// set => SetProperty(ref _taxNo, value, nameof(TaxNo));
|
||||
//}
|
||||
/// <summary> 税号 </summary>
|
||||
public string TaxNo
|
||||
{
|
||||
get => _taxNo;
|
||||
set => SetProperty(ref _taxNo, value, nameof(TaxNo));
|
||||
}
|
||||
/// <summary>
|
||||
/// 开始开票总金额
|
||||
/// </summary>
|
||||
@@ -247,14 +181,14 @@ public partial class PDDInvoiceViewModel : BindableBaseEx, IDialogAware, IDispos
|
||||
get => GetValue<decimal>();
|
||||
set => SetValue(value);
|
||||
}
|
||||
///// <summary>
|
||||
///// 最大开票金额
|
||||
///// </summary>
|
||||
//public decimal MaxAmount
|
||||
//{
|
||||
// get => GetValue<decimal>();
|
||||
// set => SetValue(value);
|
||||
//}
|
||||
/// <summary>
|
||||
/// 最大开票金额
|
||||
/// </summary>
|
||||
public decimal MaxAmount
|
||||
{
|
||||
get => GetValue<decimal>();
|
||||
set => SetValue(value);
|
||||
}
|
||||
/// <summary>
|
||||
/// 已开票金额
|
||||
/// </summary>
|
||||
@@ -271,21 +205,11 @@ public partial class PDDInvoiceViewModel : BindableBaseEx, IDialogAware, IDispos
|
||||
get => GetValue<decimal>();
|
||||
set => SetValue(value);
|
||||
}
|
||||
|
||||
public bool IsLoadImage
|
||||
{
|
||||
get => GetValue<bool>();
|
||||
set => SetValue(value);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public ICommand SearchCommand => new DelegateCommand(Search);
|
||||
|
||||
public ICommand ResetCommand => new DelegateCommand(ResetSearch);
|
||||
|
||||
public ICommand OpenInvoiceCommand => new AsyncDelegateCommand<PddBrowserOrderInvoiceViewModel>(OpenInvoice);
|
||||
public ICommand OpenInvoiceCommand => new DelegateCommand<PddBrowserOrderInvoiceViewModel>(OpenInvoice);
|
||||
|
||||
public ICommand ShowInvoiceCommand => new DelegateCommand<PddBrowserOrderInvoiceViewModel>(ShowInvoice);
|
||||
|
||||
@@ -302,6 +226,7 @@ public partial class PDDInvoiceViewModel : BindableBaseEx, IDialogAware, IDispos
|
||||
BaseMsgWindow.ShowError("未填选择买手号");
|
||||
return;
|
||||
}
|
||||
_cancellationTokenSource = new CancellationTokenSource();
|
||||
Debug.WriteLine("开始读单");
|
||||
BottomMsg = $"开始读取订单";
|
||||
StartProgress();
|
||||
@@ -310,34 +235,12 @@ public partial class PDDInvoiceViewModel : BindableBaseEx, IDialogAware, IDispos
|
||||
if (!IsReadOrder)
|
||||
{
|
||||
_orderSns.Clear();
|
||||
_allOrders.Clear();
|
||||
Orders.Clear();
|
||||
OrderInvoiceInfoList.Clear();
|
||||
|
||||
|
||||
|
||||
string path = string.Format(inviceDataPath, SelectedBuyer.buyer_id);
|
||||
if (File.Exists(NaiBa.Util.Helper.ConfigHelper.GetConfigUserPath(path)))
|
||||
{
|
||||
var ret = BaseMsgWindow.ShowConfirm("检测到已有历史数据是否加载?").DialogResult;
|
||||
if (ret == true)
|
||||
{
|
||||
var data = NaiBa.Util.Helper.ConfigHelper.LoadConfig<List<OrderInvoiceInfo>>(path);
|
||||
AddOrders(data.Select(a => new PddBrowserOrderInvoiceViewModel(a)));
|
||||
BottomMsg = $"已加载历史数据";
|
||||
return;
|
||||
}
|
||||
else if (ret == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Browser.Load("https://mobile.yangkeduo.com/orders.html");
|
||||
await Task.Delay(Timeout.Infinite, _cancellationTokenSource.Token);
|
||||
|
||||
}
|
||||
|
||||
await Task.Delay(Timeout.Infinite, _cancellationTokenSource.Token);
|
||||
|
||||
}
|
||||
catch (TaskCanceledException)
|
||||
@@ -376,7 +279,7 @@ public partial class PDDInvoiceViewModel : BindableBaseEx, IDialogAware, IDispos
|
||||
if (_isUpdatingSelectAll) return;
|
||||
if (value == true)
|
||||
{
|
||||
foreach (var order in GetFilterOrders())
|
||||
foreach (var order in Orders)
|
||||
{
|
||||
if (order.IsInvoiced == false)
|
||||
{
|
||||
@@ -435,7 +338,7 @@ public partial class PDDInvoiceViewModel : BindableBaseEx, IDialogAware, IDispos
|
||||
}
|
||||
|
||||
/// <summary> 当前正在批量处理的订单,页面脚本执行完成后通过它回传结果 </summary>
|
||||
private TaskCompletionSource<Result<bool>> _currentInvoiceTcs;
|
||||
private TaskCompletionSource<bool> _currentInvoiceTcs;
|
||||
|
||||
public ICommand BatchInvoiceCommand => new AsyncDelegateCommand(BatchInvoice);
|
||||
|
||||
@@ -446,74 +349,31 @@ public partial class PDDInvoiceViewModel : BindableBaseEx, IDialogAware, IDispos
|
||||
{
|
||||
if (IsBatchInvoicing) return;
|
||||
|
||||
if (string.IsNullOrEmpty(Config.Title) || string.IsNullOrEmpty(Config.TaxNo))
|
||||
if (string.IsNullOrEmpty(InvoiceTitle) || string.IsNullOrEmpty(TaxNo))
|
||||
{
|
||||
BaseMsgWindow.ShowError("未填写公司或税号");
|
||||
return;
|
||||
}
|
||||
|
||||
var targets = GetFilterOrders().Where(o => o.IsSelected && !o.IsInvoiced).ToList();
|
||||
var targets = Orders.Where(o => o.IsSelected && !o.IsInvoiced).ToList();
|
||||
if (targets.Count == 0)
|
||||
{
|
||||
BaseMsgWindow.ShowError("请先勾选需要开票的订单");
|
||||
return;
|
||||
}
|
||||
if (Config.MaxAmount <= 0)
|
||||
if (MaxAmount <= 0)
|
||||
{
|
||||
BaseMsgWindow.ShowError("请填写开票总金额");
|
||||
return;
|
||||
}
|
||||
var confirm = BaseMsgWindow.ShowConfirm(
|
||||
$"已勾选 {targets.Count} 个待开票订单,确定开始批量开票吗?\n请确认发票抬头与税号无误。\n开票总金额:{Config.MaxAmount}",
|
||||
$"已勾选 {targets.Count} 个待开票订单,确定开始批量开票吗?\n请确认发票抬头与税号无误。\n开票总金额:{MaxAmount}",
|
||||
"批量开票");
|
||||
if (confirm.DialogResult != true) return;
|
||||
|
||||
//Config.Title = InvoiceTitle;
|
||||
//Config.TaxNo = TaxNo;
|
||||
//Config.MaxAmount = MaxAmount;
|
||||
//NaiBa.Util.Helper.ConfigHelper.SaveConfig(ConfigPath, Config);
|
||||
try
|
||||
{
|
||||
await BatchInvoiceAsync(targets);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
BaseMsgWindow.ShowError("批量开票异常:" + ex.Message);
|
||||
|
||||
}
|
||||
finally
|
||||
{
|
||||
BaseMsgWindow.ShowInfo(BottomMsg);
|
||||
}
|
||||
await BatchInvoiceAsync(targets);
|
||||
}
|
||||
|
||||
public ICommand StopBatchInvoiceCommand => new AsyncDelegateCommand(StopBatchInvoice);
|
||||
|
||||
private async Task StopBatchInvoice()
|
||||
{
|
||||
IsBatchInvoicing = false;
|
||||
}
|
||||
|
||||
public ICommand ShowSettingDialogCommand => new DelegateCommand(ShowSettingDialog);
|
||||
|
||||
private void ShowSettingDialog()
|
||||
{
|
||||
var view = new PDDInvoiceDialog(Config);
|
||||
DialogService.ShowDialog(view, null, result =>
|
||||
{
|
||||
if (result.Result == ButtonResult.OK)
|
||||
{
|
||||
Config.Assign(view.Config);
|
||||
NaiBa.Util.Helper.ConfigHelper.SaveConfig(ConfigPath, Config);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public event EventHandler<int> BatchInvoiceChanged;
|
||||
public event Action<IDialogResult> RequestClose;
|
||||
|
||||
/// <summary>
|
||||
/// 后台批量开票:逐单加载开票页并自动填写提交,底部进度条实时更新,成功后更新列表状态
|
||||
/// </summary>
|
||||
@@ -530,21 +390,13 @@ public partial class PDDInvoiceViewModel : BindableBaseEx, IDialogAware, IDispos
|
||||
|
||||
for (int i = 0; i < targets.Count; i++)
|
||||
{
|
||||
if (IsBatchInvoicing == false)
|
||||
{
|
||||
BottomMsg = "已取消批量开票";
|
||||
return;
|
||||
}
|
||||
|
||||
if (AmountTotal >= Config.MaxAmount)
|
||||
if (AmountTotal >= MaxAmount)
|
||||
{
|
||||
return;
|
||||
}
|
||||
var order = targets[i];
|
||||
BottomMsg = $"正在批量开票:{i}/{targets.Count},当前订单:{order.order_sn}";
|
||||
ProgressValue = i;
|
||||
SelectedOrder = order;
|
||||
BatchInvoiceChanged?.Invoke(this, GetFilterOrders().ToList().IndexOf(order));
|
||||
bool ok = false;
|
||||
if (EnvironmentHelper.IsTest)
|
||||
{
|
||||
@@ -553,12 +405,12 @@ public partial class PDDInvoiceViewModel : BindableBaseEx, IDialogAware, IDispos
|
||||
}
|
||||
else
|
||||
{
|
||||
_currentInvoiceTcs = new TaskCompletionSource<Result<bool>>(TaskCreationOptions.RunContinuationsAsynchronously);
|
||||
_currentInvoiceTcs = new TaskCompletionSource<bool>(TaskCreationOptions.RunContinuationsAsynchronously);
|
||||
BrowserDetail.Load($"https://mobile.yangkeduo.com/transac_return_compensation.html?_t_timestamp=transac_modify_invoice&order_sn={order.order_sn}");
|
||||
|
||||
// 等待页面脚本执行完成(最长 60 秒)
|
||||
Task done = await Task.WhenAny(_currentInvoiceTcs.Task, Task.Delay(TimeSpan.FromSeconds(10)));
|
||||
ok = done == _currentInvoiceTcs.Task && _currentInvoiceTcs.Task.Result.Data;
|
||||
var done = await Task.WhenAny(_currentInvoiceTcs.Task, Task.Delay(TimeSpan.FromSeconds(60)));
|
||||
ok = done == _currentInvoiceTcs.Task && _currentInvoiceTcs.Task.Result;
|
||||
}
|
||||
if (ok)
|
||||
{
|
||||
@@ -566,44 +418,30 @@ public partial class PDDInvoiceViewModel : BindableBaseEx, IDialogAware, IDispos
|
||||
order.IsSelected = false;
|
||||
success++;
|
||||
AmountTotal += order.order_amount / 100m;
|
||||
if (Config.IsSaveData)
|
||||
{
|
||||
var temp = OrderInvoiceInfoList?.FirstOrDefault(a => a.order_sn == order.order_sn);
|
||||
if (temp != null) temp.IsInvoiced = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_currentInvoiceTcs.Task.IsCompleted)
|
||||
{
|
||||
order.InvoiceStatusText = _currentInvoiceTcs.Task.Result.Msg;
|
||||
}
|
||||
fail++;
|
||||
}
|
||||
ProgressValue = success + fail;
|
||||
BottomMsg = $"正在批量开票:{i}/{targets.Count},当前订单:{order.order_sn}。总金额:{AmountTotal.ToString("N2")}";
|
||||
BottomRMsg = $"批量开票状态:成功 {success} 个,失败 {fail} 个。总金额:{AmountTotal.ToString("N2")}";
|
||||
StatisticsInvoiceAmount();
|
||||
await Task.Delay(200);
|
||||
|
||||
if (Config.IsSaveData)
|
||||
{
|
||||
SaveOrderInvoiceInfo();
|
||||
}
|
||||
|
||||
await Task.Delay(1000);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
fail = targets.Count - success;
|
||||
throw ex;
|
||||
BaseMsgWindow.ShowError("批量开票异常:" + ex.Message);
|
||||
}
|
||||
finally
|
||||
{
|
||||
_currentInvoiceTcs = null;
|
||||
ProgressMaximum = targets.Count;
|
||||
ProgressValue = targets.Count;
|
||||
BottomMsg = $"批量开票完成:成功 {success} 个,失败 {fail} 个。总金额:{AmountTotal.ToString("N2")}";
|
||||
IsBatchInvoicing = false;
|
||||
BaseMsgWindow.ShowInfo(BottomMsg);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
@@ -611,8 +449,8 @@ public partial class PDDInvoiceViewModel : BindableBaseEx, IDialogAware, IDispos
|
||||
/// </summary>
|
||||
private void StatisticsInvoiceAmount()
|
||||
{
|
||||
InvoicedAmountTotal = GetFilterOrders().Where(a => a.IsInvoiced).Sum(a => a.order_amount) / 100m;
|
||||
UninvoicedAmountTotal = GetFilterOrders().Where(a => a.IsInvoiced == false).Sum(a => a.order_amount) / 100m;
|
||||
InvoicedAmountTotal = Orders.Where(a => a.IsInvoiced).Sum(a => a.order_amount) / 100m;
|
||||
UninvoicedAmountTotal = Orders.Where(a => a.IsInvoiced == false).Sum(a => a.order_amount) / 100m;
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -620,22 +458,12 @@ public partial class PDDInvoiceViewModel : BindableBaseEx, IDialogAware, IDispos
|
||||
/// <summary> 按 订单号 / 商品名称 过滤订单 </summary>
|
||||
private void Search()
|
||||
{
|
||||
OrdersView.Refresh();
|
||||
StatisticsInvoiceAmount();
|
||||
//var keyword = SearchText?.Trim();
|
||||
//bool? _tempIsInvoiced = InvoiceStatus == 0 ? null : InvoiceStatus == 2;
|
||||
//foreach (var order in Orders)
|
||||
//{
|
||||
// if (_tempIsInvoiced.HasValue)
|
||||
// {
|
||||
// if (order.IsInvoiced != _tempIsInvoiced.Value) continue;
|
||||
// }
|
||||
// if (!IsKeywordMatch(order, keyword))
|
||||
// {
|
||||
// continue;
|
||||
// }
|
||||
// Orders.Add(order);
|
||||
//}
|
||||
var keyword = SearchText?.Trim();
|
||||
Orders.Clear();
|
||||
foreach (var order in _allOrders.Where(o => IsKeywordMatch(o, keyword)))
|
||||
{
|
||||
Orders.Add(order);
|
||||
}
|
||||
}
|
||||
|
||||
private static bool IsKeywordMatch(PddBrowserOrderInvoiceViewModel order, string keyword)
|
||||
@@ -648,36 +476,22 @@ public partial class PDDInvoiceViewModel : BindableBaseEx, IDialogAware, IDispos
|
||||
private void ResetSearch()
|
||||
{
|
||||
SearchText = "";
|
||||
InvoiceStatus = 0;
|
||||
EndTime = DateTime.Now;
|
||||
StartTime = EndTime.AddMonths(-1);
|
||||
Search();
|
||||
}
|
||||
/// <summary>
|
||||
/// 申请开票
|
||||
/// </summary>
|
||||
/// <param name="order"></param>
|
||||
private async Task OpenInvoice(PddBrowserOrderInvoiceViewModel order)
|
||||
private void OpenInvoice(PddBrowserOrderInvoiceViewModel order)
|
||||
{
|
||||
SelectedOrder = order;
|
||||
if (string.IsNullOrEmpty(Config.Title) || string.IsNullOrEmpty(Config.TaxNo))
|
||||
if (string.IsNullOrEmpty(InvoiceTitle) || string.IsNullOrEmpty(TaxNo))
|
||||
{
|
||||
BaseMsgWindow.ShowError("未填写公司或税号");
|
||||
return;
|
||||
}
|
||||
BrowserDetail.Load($"https://mobile.yangkeduo.com/transac_return_compensation.html?_t_timestamp=transac_modify_invoice&order_sn={order.order_sn}");
|
||||
ShowOrderBrowserDetail();
|
||||
//BrowserDetail.Load($"https://mobile.yangkeduo.com/transac_return_compensation.html?_t_timestamp=transac_modify_invoice&order_sn={order.order_sn}");
|
||||
try
|
||||
{
|
||||
await BatchInvoiceAsync(new List<PddBrowserOrderInvoiceViewModel>
|
||||
{
|
||||
order
|
||||
});
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
BaseMsgWindow.ShowError("开票异常:" + ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
private void ShowInvoice(PddBrowserOrderInvoiceViewModel order)
|
||||
@@ -706,36 +520,36 @@ public partial class PDDInvoiceViewModel : BindableBaseEx, IDialogAware, IDispos
|
||||
|
||||
|
||||
#region 数据解析
|
||||
|
||||
private void parserData(string data)
|
||||
{
|
||||
parserData(data, out string _);
|
||||
}
|
||||
private void parserData(string data, out string lastOrderSN)
|
||||
{
|
||||
lastOrderSN = "0";
|
||||
List<PddBrowserOrderInvoiceViewModel> list = JsonHelper.DeserializeJsonToList<PddBrowserOrderInvoiceViewModel>(JsonHelper.JObjectParse(data)["orders"].ParseToString());
|
||||
|
||||
if (list.Count == 0)
|
||||
{
|
||||
StopAutoScroll();
|
||||
return;
|
||||
}
|
||||
lastOrderSN = list.Last().order_sn;
|
||||
var currentLastItem = list.Last();
|
||||
var matched = list.Where(item => item.status == 4 && item.pay_status == 2).ToList();
|
||||
|
||||
Application.Current?.Dispatcher.BeginInvoke(new Action(() =>
|
||||
var matched = list.Where(item => item.status == 4 && item.pay_status == 2).ToList();
|
||||
if (matched.Count == 0)
|
||||
{
|
||||
if (matched.Count > 0)
|
||||
return;
|
||||
}
|
||||
|
||||
// CEF 回调运行在后台线程,ObservableCollection 的更新需要切回 UI 线程
|
||||
var dispatcher = Application.Current?.Dispatcher;
|
||||
if (dispatcher == null || dispatcher.CheckAccess())
|
||||
{
|
||||
AddOrders(matched);
|
||||
}
|
||||
else
|
||||
{
|
||||
dispatcher.BeginInvoke(new Action(() =>
|
||||
{
|
||||
AddOrders(matched);
|
||||
}
|
||||
|
||||
BottomMsg = $"正在读取订单,读取日期{currentLastItem.OrderTime.ToString("yyyy-MM-dd")}";
|
||||
|
||||
}));
|
||||
|
||||
|
||||
BottomMsg = $"正在读取订单,读取日期{matched.Last().OrderTime.ToString("yyyy-MM-dd")}";
|
||||
}));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -749,31 +563,15 @@ public partial class PDDInvoiceViewModel : BindableBaseEx, IDialogAware, IDispos
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (item.IsInvoiced == false)
|
||||
_allOrders.Add(item);
|
||||
if (IsKeywordMatch(item, keyword))
|
||||
{
|
||||
item.IsInvoiced = item.order_buttons?.Any(a => a.brief_prompt == "发票详情") ?? false;
|
||||
}
|
||||
Orders.Add(item);
|
||||
|
||||
if (Config.IsSaveData)
|
||||
{
|
||||
OrderInvoiceInfoList.Add(new OrderInvoiceInfo
|
||||
{
|
||||
GoodsName = item.GoodsName,
|
||||
order_amount = item.order_amount,
|
||||
order_time = item.order_time,
|
||||
order_sn = item.order_sn,
|
||||
order_link_url = item.order_link_url,
|
||||
IsInvoiced = item.IsInvoiced,
|
||||
ThumbUrl = item.ThumbUrl
|
||||
});
|
||||
Orders.Add(item);
|
||||
}
|
||||
}
|
||||
StatisticsInvoiceAmount();
|
||||
if (Config.IsSaveData)
|
||||
{
|
||||
SaveOrderInvoiceInfo();
|
||||
}
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -810,33 +608,10 @@ public partial class PDDInvoiceViewModel : BindableBaseEx, IDialogAware, IDispos
|
||||
|
||||
}
|
||||
}
|
||||
Orders.FirstOrDefault().IsInvoiced = true;
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
private const string inviceDataPath = "inviceData_{0}";
|
||||
/// <summary>
|
||||
/// 保存数据
|
||||
/// </summary>
|
||||
private void SaveOrderInvoiceInfo()
|
||||
{
|
||||
if (SelectedBuyer == null) return;
|
||||
string path = string.Format(inviceDataPath, SelectedBuyer.buyer_id);
|
||||
NaiBa.Util.Helper.ConfigHelper.SaveConfig<List<OrderInvoiceInfo>>(path, OrderInvoiceInfoList);
|
||||
}
|
||||
private void GetOrderInvoiceInfo()
|
||||
{
|
||||
if (SelectedBuyer == null) return;
|
||||
string path = string.Format(inviceDataPath, SelectedBuyer.buyer_id);
|
||||
if (File.Exists(NaiBa.Util.Helper.ConfigHelper.GetConfigUserPath(path)))
|
||||
{
|
||||
if (BaseMsgWindow.ShowConfirm("检测到已有旧数据是否加载?").DialogResult == true)
|
||||
{
|
||||
var data = NaiBa.Util.Helper.ConfigHelper.LoadConfig<List<OrderInvoiceInfo>>(path);
|
||||
AddOrders(data.Select(a => new PddBrowserOrderInvoiceViewModel(a)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -849,13 +624,6 @@ public partial class PDDInvoiceViewModel : BindableBaseEx, IDialogAware, IDispos
|
||||
set => SetValue(ref _bottomMsg, value);
|
||||
}
|
||||
|
||||
private string _bottomRMsg = "";
|
||||
public string BottomRMsg
|
||||
{
|
||||
get => _bottomRMsg;
|
||||
set => SetValue(ref _bottomRMsg, value);
|
||||
}
|
||||
|
||||
private double _progressValue;
|
||||
public double ProgressValue
|
||||
{
|
||||
@@ -869,9 +637,6 @@ public partial class PDDInvoiceViewModel : BindableBaseEx, IDialogAware, IDispos
|
||||
get => _progressMaximum;
|
||||
set => SetValue(ref _progressMaximum, value);
|
||||
}
|
||||
|
||||
public string Title => "发票助手";
|
||||
|
||||
public void SetProgress(int value, int maxValue)
|
||||
{
|
||||
StopUnknownTotalProgressTimer();
|
||||
@@ -945,44 +710,7 @@ public partial class PDDInvoiceViewModel : BindableBaseEx, IDialogAware, IDispos
|
||||
}
|
||||
_unknownTotalProgressTimer = null;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
StopAutoScroll();
|
||||
Browser.Dispose();
|
||||
BrowserDetail.Dispose();
|
||||
}
|
||||
public void OnDialogOpened(IDialogParameters parameters)
|
||||
{
|
||||
|
||||
}
|
||||
public bool CanCloseDialog()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public void OnDialogClosed()
|
||||
{
|
||||
Dispose();
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
}
|
||||
|
||||
public class InvoiceConfig
|
||||
{
|
||||
public string Title { get; set; }
|
||||
public string TaxNo { get; set; }
|
||||
public decimal MaxAmount { get; set; }
|
||||
public bool IsSaveData { get; set; } = true;
|
||||
|
||||
public void Assign(InvoiceConfig config)
|
||||
{
|
||||
Title = config.Title;
|
||||
TaxNo = config.TaxNo;
|
||||
MaxAmount = config.MaxAmount;
|
||||
IsSaveData = config.IsSaveData;
|
||||
}
|
||||
}
|
||||
@@ -1,297 +0,0 @@
|
||||
<Window
|
||||
x:Class="_29WxOrderWpf.Ctrls.Settings.SettingsView"
|
||||
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:local="clr-namespace:_29WxOrderWpf.Ctrls.Settings"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:vm="clr-namespace:_29WxOrderWpf.ViewModels"
|
||||
xmlns:wpf="WPFCommon"
|
||||
Title="设置"
|
||||
Width="800"
|
||||
Height="450"
|
||||
d:DataContext="{d:DesignInstance Type=vm:SettingViewModel}"
|
||||
ResizeMode="NoResize"
|
||||
ShowInTaskbar="False"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
WindowState="Normal"
|
||||
mc:Ignorable="d">
|
||||
<Border BorderBrush="#e8eaed" BorderThickness="1">
|
||||
<TabControl
|
||||
ItemContainerStyle="{StaticResource SideTabItem}"
|
||||
Style="{StaticResource SideTabControl}"
|
||||
TabStripPlacement="Left">
|
||||
|
||||
<TabItem Header="拍单">
|
||||
<StackPanel>
|
||||
<Border Style="{StaticResource SettingRow}">
|
||||
<Grid Visibility="{Binding ShowEnablePddTransitTraditionalAddress}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel>
|
||||
<TextBlock Style="{StaticResource SettingTitle}" Text="云仓拍单" />
|
||||
<TextBlock Style="{StaticResource SettingDesc}" Text="多多云仓拍单随机繁体详细地址" />
|
||||
</StackPanel>
|
||||
<CheckBox
|
||||
Grid.Column="1"
|
||||
VerticalAlignment="Center"
|
||||
d:Visibility="Visible"
|
||||
IsChecked="{Binding SwitchEnablePddTransitTraditionalAddress}"
|
||||
Style="{StaticResource ToggleSwitch}" />
|
||||
</Grid>
|
||||
</Border>
|
||||
<Border Style="{StaticResource SettingRow}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel>
|
||||
<TextBlock Style="{StaticResource SettingTitle}" Text="直发拍单" />
|
||||
<TextBlock Style="{StaticResource SettingDesc}" Text="允许直发拍单" />
|
||||
</StackPanel>
|
||||
<CheckBox
|
||||
Grid.Column="1"
|
||||
VerticalAlignment="Center"
|
||||
d:Visibility="Visible"
|
||||
IsChecked="{Binding SwitchEnableDirectBuy}"
|
||||
Style="{StaticResource ToggleSwitch}" />
|
||||
</Grid>
|
||||
</Border>
|
||||
</StackPanel>
|
||||
</TabItem>
|
||||
|
||||
<TabItem Header="发货">
|
||||
<StackPanel>
|
||||
<Border Style="{StaticResource SettingRow}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel>
|
||||
<TextBlock Style="{StaticResource SettingTitle}" Text="礼品单发送" />
|
||||
<TextBlock Style="{StaticResource SettingDesc}" Text="超出6元自动改为礼品二(实物)" />
|
||||
</StackPanel>
|
||||
<CheckBox
|
||||
Grid.Column="1"
|
||||
VerticalAlignment="Center"
|
||||
d:Visibility="Visible"
|
||||
IsChecked="{Binding AutoSwitchGiftType}"
|
||||
IsEnabled="False"
|
||||
Opacity="0.5"
|
||||
Style="{StaticResource ToggleSwitch}"
|
||||
Visibility="Collapsed" />
|
||||
</Grid>
|
||||
</Border>
|
||||
</StackPanel>
|
||||
</TabItem>
|
||||
|
||||
<!-- ========== 外观 ========== -->
|
||||
<!--
|
||||
<TabItem Header="外观" Tag="🎨">
|
||||
<StackPanel
|
||||
MaxWidth="720"
|
||||
Margin="40,32,40,32"
|
||||
HorizontalAlignment="Left">
|
||||
<TextBlock Style="{StaticResource PageTitle}" Text="外观" />
|
||||
<TextBlock Style="{StaticResource PageSubtitle}" Text="自定义界面的主题、颜色和字体。" />
|
||||
|
||||
<Border Style="{StaticResource SettingsCard}">
|
||||
<StackPanel>
|
||||
<Border Style="{StaticResource SettingRow}">
|
||||
<StackPanel>
|
||||
<TextBlock Style="{StaticResource SettingTitle}" Text="主题" />
|
||||
<TextBlock Style="{StaticResource SettingDesc}" Text="选择浅色、深色或跟随系统" />
|
||||
<StackPanel Margin="0,12,0,0" Orientation="Horizontal">
|
||||
<RadioButton
|
||||
Margin="0,0,20,0"
|
||||
Content="浅色"
|
||||
IsChecked="True" />
|
||||
<RadioButton Margin="0,0,20,0" Content="深色" />
|
||||
<RadioButton Content="跟随系统" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
<Border BorderThickness="0" Style="{StaticResource SettingRow}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel>
|
||||
<TextBlock Style="{StaticResource SettingTitle}" Text="强调色" />
|
||||
<TextBlock Style="{StaticResource SettingDesc}" Text="用于按钮、选中项等强调元素" />
|
||||
</StackPanel>
|
||||
<StackPanel
|
||||
Grid.Column="1"
|
||||
VerticalAlignment="Center"
|
||||
Orientation="Horizontal">
|
||||
<Border
|
||||
Width="24"
|
||||
Height="24"
|
||||
Margin="0,0,8,0"
|
||||
Background="#0078D4"
|
||||
CornerRadius="12" />
|
||||
<Border
|
||||
Width="24"
|
||||
Height="24"
|
||||
Margin="0,0,8,0"
|
||||
Background="#6E4AFF"
|
||||
CornerRadius="12" />
|
||||
<Border
|
||||
Width="24"
|
||||
Height="24"
|
||||
Background="#E73C3C"
|
||||
CornerRadius="12" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</StackPanel>
|
||||
</TabItem>
|
||||
|
||||
-->
|
||||
<!-- ========== 账户 ========== -->
|
||||
<!--
|
||||
<TabItem Header="账户" Tag="👤">
|
||||
<StackPanel
|
||||
MaxWidth="720"
|
||||
Margin="40,32,40,32"
|
||||
HorizontalAlignment="Left">
|
||||
<TextBlock Style="{StaticResource PageTitle}" Text="账户" />
|
||||
<TextBlock Style="{StaticResource PageSubtitle}" Text="管理你的账号、头像和登录方式。" />
|
||||
|
||||
<Border Padding="20" Style="{StaticResource SettingsCard}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Border
|
||||
Width="64"
|
||||
Height="64"
|
||||
Background="#0078D4"
|
||||
CornerRadius="32">
|
||||
<TextBlock
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="28"
|
||||
Foreground="White"
|
||||
Text="A" />
|
||||
</Border>
|
||||
<StackPanel Margin="16,0,0,0" VerticalAlignment="Center">
|
||||
<TextBlock
|
||||
FontSize="16"
|
||||
FontWeight="SemiBold"
|
||||
Foreground="#1F2329"
|
||||
Text="Alex" />
|
||||
<TextBlock
|
||||
Margin="0,2,0,0"
|
||||
FontSize="13"
|
||||
Foreground="#8A9099"
|
||||
Text="alex@example.com" />
|
||||
</StackPanel>
|
||||
<Button
|
||||
Margin="20,0,0,0"
|
||||
Padding="16,6"
|
||||
VerticalAlignment="Center"
|
||||
Content="编辑资料" />
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</StackPanel>
|
||||
</TabItem>
|
||||
|
||||
-->
|
||||
<!-- ========== 隐私 ========== -->
|
||||
<!--
|
||||
<TabItem Header="隐私" Tag="🔒">
|
||||
<StackPanel
|
||||
MaxWidth="720"
|
||||
Margin="40,32,40,32"
|
||||
HorizontalAlignment="Left">
|
||||
<TextBlock Style="{StaticResource PageTitle}" Text="隐私" />
|
||||
<TextBlock Style="{StaticResource PageSubtitle}" Text="控制应用如何使用你的数据。" />
|
||||
|
||||
<Border Style="{StaticResource SettingsCard}">
|
||||
<StackPanel>
|
||||
<Border Style="{StaticResource SettingRow}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel>
|
||||
<TextBlock Style="{StaticResource SettingTitle}" Text="发送匿名使用数据" />
|
||||
<TextBlock Style="{StaticResource SettingDesc}" Text="帮助改进产品,不含个人身份信息" />
|
||||
</StackPanel>
|
||||
<CheckBox
|
||||
Grid.Column="1"
|
||||
VerticalAlignment="Center"
|
||||
IsChecked="True"
|
||||
Style="{StaticResource ToggleSwitch}" />
|
||||
</Grid>
|
||||
</Border>
|
||||
<Border BorderThickness="0" Style="{StaticResource SettingRow}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel>
|
||||
<TextBlock Style="{StaticResource SettingTitle}" Text="个性化推荐" />
|
||||
<TextBlock Style="{StaticResource SettingDesc}" Text="根据使用习惯推荐内容" />
|
||||
</StackPanel>
|
||||
<CheckBox
|
||||
Grid.Column="1"
|
||||
VerticalAlignment="Center"
|
||||
Style="{StaticResource ToggleSwitch}" />
|
||||
</Grid>
|
||||
</Border>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</StackPanel>
|
||||
</TabItem>
|
||||
|
||||
-->
|
||||
<!-- ========== 关于 ========== -->
|
||||
<!--
|
||||
<TabItem Header="关于" Tag="{StaticResource txt-table_stack_above}">
|
||||
<StackPanel
|
||||
MaxWidth="720"
|
||||
Margin="40,32,40,32"
|
||||
HorizontalAlignment="Left">
|
||||
<TextBlock Style="{StaticResource PageTitle}" Text="关于" />
|
||||
<TextBlock Style="{StaticResource PageSubtitle}" Text="版本与许可信息。" />
|
||||
|
||||
<Border Padding="20" Style="{StaticResource SettingsCard}">
|
||||
<StackPanel>
|
||||
<TextBlock
|
||||
FontSize="18"
|
||||
FontWeight="SemiBold"
|
||||
Foreground="#1F2329"
|
||||
Text="MyApp" />
|
||||
<TextBlock
|
||||
Margin="0,4,0,0"
|
||||
FontSize="13"
|
||||
Foreground="#8A9099"
|
||||
Text="版本 1.0.0 (Build 20261005)" />
|
||||
<TextBlock
|
||||
Margin="0,16,0,0"
|
||||
FontSize="12"
|
||||
Foreground="#8A9099"
|
||||
Text="© 2026 My Company. All rights reserved." />
|
||||
<StackPanel Margin="0,16,0,0" Orientation="Horizontal">
|
||||
<Button
|
||||
Margin="0,0,8,0"
|
||||
Padding="16,6"
|
||||
Content="检查更新" />
|
||||
<Button Padding="16,6" Content="查看许可" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</StackPanel>
|
||||
</TabItem>-->
|
||||
|
||||
</TabControl>
|
||||
</Border>
|
||||
</Window>
|
||||
@@ -1,65 +0,0 @@
|
||||
using _29WxOrderWpf.ViewModels;
|
||||
using AllBase;
|
||||
using AllBase.Helper;
|
||||
using AllBase.Model.Config;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Shapes;
|
||||
using Work.BaseForms;
|
||||
|
||||
namespace _29WxOrderWpf.Ctrls.Settings;
|
||||
|
||||
/// <summary>
|
||||
/// SettingsView.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class SettingsView : Window
|
||||
{
|
||||
private SettingViewModel vm;
|
||||
public SettingsView()
|
||||
{
|
||||
InitializeComponent();
|
||||
vm = new SettingViewModel();
|
||||
this.DataContext = vm;
|
||||
this.Loaded += SettingsView_Loaded;
|
||||
this.Closed += SettingsView_Closed;
|
||||
}
|
||||
private void SettingsView_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
vm.Assign(BaseClass.Setting);
|
||||
}
|
||||
private void SettingsView_Closed(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
var setting = vm.ToConfig();
|
||||
BaseClass.Setting = setting;
|
||||
NaiBa.Util.Helper.ConfigHelper.SaveConfig(SettingViewModel.SettingFileName, JsonConvert.SerializeObject(setting));
|
||||
|
||||
foreach (var order in GlobalConfig.lstOrder)
|
||||
{
|
||||
foreach (var orderItem in order.orderItems)
|
||||
{
|
||||
orderItem.UpdateOrderItemBuyButton();
|
||||
orderItem.SetAbnormalAndDirectBtnVisibility();
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
BaseMsgForm.ShowError("配置保存错误");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,356 +1,327 @@
|
||||
<UserControl
|
||||
x:Class="_29WxOrderWpf.Ctrls.ShopCtrls.ShopListCtrl"
|
||||
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:local="clr-namespace:_29WxOrderWpf.Ctrls.ShopCtrls"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
x:Name="shopListCtrl"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
Loaded="shopListCtrl_Loaded"
|
||||
mc:Ignorable="d">
|
||||
<Grid Background="{StaticResource ListCtrlBackColorBrush}">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="40" />
|
||||
<RowDefinition Height="40" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="40" />
|
||||
</Grid.RowDefinitions>
|
||||
x:Class="_29WxOrderWpf.Ctrls.ShopCtrls.ShopListCtrl"
|
||||
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:local="clr-namespace:_29WxOrderWpf.Ctrls.ShopCtrls"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
x:Name="shopListCtrl"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
Loaded="shopListCtrl_Loaded"
|
||||
mc:Ignorable="d">
|
||||
<Grid Background="{StaticResource ListCtrlBackColorBrush}">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="40" />
|
||||
<RowDefinition Height="40" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="40" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Grid x:Name="gridSearch">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock
|
||||
Grid.Column="0"
|
||||
Margin="6,0,0,0"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Text="店名" />
|
||||
<Border
|
||||
Grid.Column="1"
|
||||
Height="26"
|
||||
Margin="4"
|
||||
BorderBrush="{StaticResource mainColorBrush}"
|
||||
BorderThickness="1"
|
||||
CornerRadius="4">
|
||||
<TextBox
|
||||
x:Name="txtShopName"
|
||||
Margin="3,0"
|
||||
VerticalContentAlignment="Center"
|
||||
Style="{StaticResource BaseTextBoxStyle}" />
|
||||
</Border>
|
||||
<TextBlock
|
||||
Grid.Column="2"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Text="分组" />
|
||||
<Border
|
||||
Grid.Column="3"
|
||||
Height="26"
|
||||
Margin="4"
|
||||
BorderBrush="{StaticResource mainColorBrush}"
|
||||
BorderThickness="1"
|
||||
CornerRadius="4">
|
||||
<ComboBox
|
||||
x:Name="cmbGroup"
|
||||
Margin="3,0"
|
||||
VerticalContentAlignment="Center"
|
||||
SelectionChanged="cmbGroup_SelectionChanged"
|
||||
Style="{StaticResource BaseComboBoxStyle}" />
|
||||
</Border>
|
||||
<TextBlock
|
||||
Grid.Column="4"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Text="备注" />
|
||||
<Border
|
||||
Grid.Column="5"
|
||||
Height="26"
|
||||
Margin="4"
|
||||
BorderBrush="{StaticResource mainColorBrush}"
|
||||
BorderThickness="1"
|
||||
CornerRadius="4">
|
||||
<ComboBox
|
||||
x:Name="cmbNotes"
|
||||
Margin="3,0"
|
||||
VerticalContentAlignment="Center"
|
||||
SelectionChanged="cmbNotes_SelectionChanged"
|
||||
Style="{StaticResource BaseComboBoxStyle}" />
|
||||
</Border>
|
||||
<Button
|
||||
x:Name="btnSearch"
|
||||
Grid.Row="4"
|
||||
Grid.Column="6"
|
||||
Height="26"
|
||||
Click="btnSearch_Click"
|
||||
Content=" 搜索 "
|
||||
Style="{StaticResource BasePageButtonStyle}" />
|
||||
<Button
|
||||
x:Name="btnRestore"
|
||||
Grid.Row="4"
|
||||
Grid.Column="7"
|
||||
Height="26"
|
||||
Margin="4,0,6,0"
|
||||
Click="btnRestore_Click"
|
||||
Content=" 还原 "
|
||||
Style="{StaticResource BasePageButtonLightStyle}" />
|
||||
</Grid>
|
||||
<Grid
|
||||
x:Name="lstTitle"
|
||||
Grid.Row="1"
|
||||
Margin="4,0"
|
||||
Background="{StaticResource ListHeadBackColorBrush}">
|
||||
<Border BorderBrush="{StaticResource ListHeadBorderColorBrush}" BorderThickness="0,0,1,0">
|
||||
<DataGrid
|
||||
x:Name="dgShopHeader"
|
||||
Grid.ColumnSpan="100"
|
||||
Margin="0,0,18,0"
|
||||
AutoGenerateColumns="False"
|
||||
BorderThickness="0"
|
||||
CanUserReorderColumns="False"
|
||||
ColumnDisplayIndexChanged="dgShopHeader_ColumnDisplayIndexChanged"
|
||||
ColumnHeaderHeight="{Binding ElementName=lstTitle, Path=ActualHeight}"
|
||||
LayoutUpdated="dgShopHeader_LayoutUpdated">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTemplateColumn
|
||||
x:Name="colSelectAll"
|
||||
Width="50"
|
||||
Header="选择"
|
||||
HeaderStyle="{StaticResource BaseDataGridColumnHeaderStyle}">
|
||||
<DataGridTemplateColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<Grid Width="14" Height="14">
|
||||
<!--<CheckBox x:Name="headerCheckBox" BorderThickness="0" IsChecked="{Binding DataContext.AreAllSelected, RelativeSource={RelativeSource AncestorType=DataGrid}, UpdateSourceTrigger=PropertyChanged}" Checked="HeaderCheckBox_Checked" Unchecked="HeaderCheckBox_Unchecked"/>-->
|
||||
<CheckBox
|
||||
x:Name="chkSelectAll"
|
||||
BorderThickness="0"
|
||||
Checked="ChkSelectAll_Checked"
|
||||
IsChecked="False"
|
||||
IsThreeState="True"
|
||||
Loaded="ChkSelectAll_Loaded"
|
||||
Unchecked="ChkSelectAll_Unchecked" />
|
||||
<Border
|
||||
Width="14"
|
||||
Height="14"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Background="Transparent"
|
||||
BorderBrush="{StaticResource mainColorBrush}"
|
||||
BorderThickness="1"
|
||||
IsHitTestVisible="False" />
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.HeaderTemplate>
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<!--<CheckBox IsChecked="{Binding IsSelected, UpdateSourceTrigger=PropertyChanged}" HorizontalAlignment="Center" VerticalAlignment="Center"/>-->
|
||||
<CheckBox HorizontalAlignment="Center" VerticalAlignment="Center" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTextColumn
|
||||
Width="50*"
|
||||
Header="序号"
|
||||
HeaderStyle="{StaticResource BaseDataGridColumnHeaderStyle}" />
|
||||
<DataGridTextColumn
|
||||
Width="100*"
|
||||
Header="AppId"
|
||||
HeaderStyle="{StaticResource BaseDataGridColumnHeaderStyle}" />
|
||||
<DataGridTextColumn
|
||||
Width="100*"
|
||||
Header="店铺编号"
|
||||
HeaderStyle="{StaticResource BaseDataGridColumnHeaderStyle}" />
|
||||
<DataGridTextColumn
|
||||
Width="100*"
|
||||
Header="店铺名称"
|
||||
HeaderStyle="{StaticResource BaseDataGridColumnHeaderStyle}" />
|
||||
<DataGridTextColumn
|
||||
Width="100*"
|
||||
Header="分组"
|
||||
HeaderStyle="{StaticResource BaseDataGridColumnHeaderStyle}" />
|
||||
<DataGridTextColumn
|
||||
Width="82*"
|
||||
Header=" 备注"
|
||||
HeaderStyle="{StaticResource BaseDataGridColumnHeaderStyle}" />
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</Border>
|
||||
</Grid>
|
||||
<!--<ListBox Grid.Row="2" x:Name="lbxShop" ItemsSource="{Binding GlobalConfig.ShopLoginList}" BorderThickness="0" Margin="4,0,4,4">-->
|
||||
<ListBox
|
||||
x:Name="lbxShop"
|
||||
Grid.Row="2"
|
||||
Margin="4,0,4,4"
|
||||
BorderThickness="0"
|
||||
SelectionMode="Extended">
|
||||
<!-- 使用自定义属性模板去除ListBox高亮显示框 -->
|
||||
<ListBox.ItemContainerStyle>
|
||||
<Style TargetType="ListBoxItem">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ListBoxItem">
|
||||
<ContentPresenter
|
||||
Content="{TemplateBinding Content}"
|
||||
ContentStringFormat="{TemplateBinding ContentStringFormat}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}" />
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</ListBox.ItemContainerStyle>
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<!--<local:ShopListRowCtrl></local:ShopListRowCtrl>-->
|
||||
<Border
|
||||
MinHeight="50"
|
||||
Margin="0,0,0,0"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"
|
||||
BorderBrush="{StaticResource ListRowBorderColorBrush}"
|
||||
BorderThickness="0,0,0,1"
|
||||
CornerRadius="0">
|
||||
<Border.Style>
|
||||
<!-- 鼠标进入或悬停Border时切换颜色(悬停时Border的填充控件必须有填充Border,所在层级不限,仅填充透明Grid则触发器无效) -->
|
||||
<Style TargetType="Border">
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="Background" Value="{StaticResource ListRowHoverBackColorBrush}" />
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Border.Style>
|
||||
<Grid x:Name="gridSearch">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock
|
||||
Grid.Column="0"
|
||||
Margin="6,0,0,0"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Text="店名" />
|
||||
<Border
|
||||
Grid.Column="1"
|
||||
Height="26"
|
||||
Margin="4"
|
||||
BorderBrush="{StaticResource mainColorBrush}"
|
||||
BorderThickness="1"
|
||||
CornerRadius="4">
|
||||
<TextBox
|
||||
x:Name="txtShopName"
|
||||
Margin="3,0"
|
||||
VerticalContentAlignment="Center"
|
||||
Style="{StaticResource BaseTextBoxStyle}" />
|
||||
</Border>
|
||||
<TextBlock
|
||||
Grid.Column="2"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Text="分组" />
|
||||
<Border
|
||||
Grid.Column="3"
|
||||
Height="26"
|
||||
Margin="4"
|
||||
BorderBrush="{StaticResource mainColorBrush}"
|
||||
BorderThickness="1"
|
||||
CornerRadius="4">
|
||||
<ComboBox
|
||||
x:Name="cmbGroup"
|
||||
Margin="3,0"
|
||||
VerticalContentAlignment="Center"
|
||||
SelectionChanged="cmbGroup_SelectionChanged"
|
||||
Style="{StaticResource BaseComboBoxStyle}" />
|
||||
</Border>
|
||||
<TextBlock
|
||||
Grid.Column="4"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Text="备注" />
|
||||
<Border
|
||||
Grid.Column="5"
|
||||
Height="26"
|
||||
Margin="4"
|
||||
BorderBrush="{StaticResource mainColorBrush}"
|
||||
BorderThickness="1"
|
||||
CornerRadius="4">
|
||||
<ComboBox
|
||||
x:Name="cmbNotes"
|
||||
Margin="3,0"
|
||||
VerticalContentAlignment="Center"
|
||||
SelectionChanged="cmbNotes_SelectionChanged"
|
||||
Style="{StaticResource BaseComboBoxStyle}" />
|
||||
</Border>
|
||||
<Button
|
||||
x:Name="btnSearch"
|
||||
Grid.Row="4"
|
||||
Grid.Column="6"
|
||||
Height="26"
|
||||
Click="btnSearch_Click"
|
||||
Content=" 搜索 "
|
||||
Style="{StaticResource BasePageButtonStyle}" />
|
||||
<Button
|
||||
x:Name="btnRestore"
|
||||
Grid.Row="4"
|
||||
Grid.Column="7"
|
||||
Height="26"
|
||||
Margin="4,0,6,0"
|
||||
Click="btnRestore_Click"
|
||||
Content=" 还原 "
|
||||
Style="{StaticResource BasePageButtonLightStyle}" />
|
||||
</Grid>
|
||||
<Grid
|
||||
x:Name="lstTitle"
|
||||
Grid.Row="1"
|
||||
Margin="4,0"
|
||||
Background="{StaticResource ListHeadBackColorBrush}">
|
||||
<Border BorderBrush="{StaticResource ListHeadBorderColorBrush}" BorderThickness="0,0,1,0">
|
||||
<DataGrid
|
||||
x:Name="dgShopHeader"
|
||||
Grid.ColumnSpan="100"
|
||||
Margin="0,0,18,0"
|
||||
AutoGenerateColumns="False"
|
||||
BorderThickness="0"
|
||||
CanUserReorderColumns="False"
|
||||
ColumnDisplayIndexChanged="dgShopHeader_ColumnDisplayIndexChanged"
|
||||
ColumnHeaderHeight="{Binding ElementName=lstTitle, Path=ActualHeight}"
|
||||
LayoutUpdated="dgShopHeader_LayoutUpdated">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTemplateColumn
|
||||
x:Name="colSelectAll"
|
||||
Width="50"
|
||||
Header="选择"
|
||||
HeaderStyle="{StaticResource BaseDataGridColumnHeaderStyle}">
|
||||
<DataGridTemplateColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<Grid Width="14" Height="14">
|
||||
<!--<CheckBox x:Name="headerCheckBox" BorderThickness="0" IsChecked="{Binding DataContext.AreAllSelected, RelativeSource={RelativeSource AncestorType=DataGrid}, UpdateSourceTrigger=PropertyChanged}" Checked="HeaderCheckBox_Checked" Unchecked="HeaderCheckBox_Unchecked"/>-->
|
||||
<CheckBox
|
||||
x:Name="chkSelectAll"
|
||||
BorderThickness="0"
|
||||
Checked="ChkSelectAll_Checked"
|
||||
IsChecked="False"
|
||||
IsThreeState="True"
|
||||
Loaded="ChkSelectAll_Loaded"
|
||||
Unchecked="ChkSelectAll_Unchecked" />
|
||||
<Border
|
||||
Width="14"
|
||||
Height="14"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Background="Transparent"
|
||||
BorderBrush="{StaticResource mainColorBrush}"
|
||||
BorderThickness="1"
|
||||
IsHitTestVisible="False" />
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.HeaderTemplate>
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<!--<CheckBox IsChecked="{Binding IsSelected, UpdateSourceTrigger=PropertyChanged}" HorizontalAlignment="Center" VerticalAlignment="Center"/>-->
|
||||
<CheckBox HorizontalAlignment="Center" VerticalAlignment="Center" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTextColumn
|
||||
Width="100*"
|
||||
Header="AppId"
|
||||
HeaderStyle="{StaticResource BaseDataGridColumnHeaderStyle}" />
|
||||
<DataGridTextColumn
|
||||
Width="100*"
|
||||
Header="店铺名称"
|
||||
HeaderStyle="{StaticResource BaseDataGridColumnHeaderStyle}" />
|
||||
<DataGridTextColumn
|
||||
Width="100*"
|
||||
Header="分组"
|
||||
HeaderStyle="{StaticResource BaseDataGridColumnHeaderStyle}" />
|
||||
<DataGridTextColumn
|
||||
Width="82*"
|
||||
Header=" 备注"
|
||||
HeaderStyle="{StaticResource BaseDataGridColumnHeaderStyle}" />
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</Border>
|
||||
</Grid>
|
||||
<!--<ListBox Grid.Row="2" x:Name="lbxShop" ItemsSource="{Binding GlobalConfig.ShopLoginList}" BorderThickness="0" Margin="4,0,4,4">-->
|
||||
<ListBox
|
||||
x:Name="lbxShop"
|
||||
Grid.Row="2"
|
||||
Margin="4,0,4,4"
|
||||
BorderThickness="0"
|
||||
SelectionMode="Extended">
|
||||
<!-- 使用自定义属性模板去除ListBox高亮显示框 -->
|
||||
<ListBox.ItemContainerStyle>
|
||||
<Style TargetType="ListBoxItem">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ListBoxItem">
|
||||
<ContentPresenter
|
||||
Content="{TemplateBinding Content}"
|
||||
ContentStringFormat="{TemplateBinding ContentStringFormat}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}" />
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</ListBox.ItemContainerStyle>
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<!--<local:ShopListRowCtrl></local:ShopListRowCtrl>-->
|
||||
<Border
|
||||
MinHeight="50"
|
||||
Margin="0,0,0,0"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"
|
||||
BorderBrush="{StaticResource ListRowBorderColorBrush}"
|
||||
BorderThickness="0,0,0,1"
|
||||
CornerRadius="0">
|
||||
<Border.Style>
|
||||
<!-- 鼠标进入或悬停Border时切换颜色(悬停时Border的填充控件必须有填充Border,所在层级不限,仅填充透明Grid则触发器无效) -->
|
||||
<Style TargetType="Border">
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="Background" Value="{StaticResource ListRowHoverBackColorBrush}" />
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Border.Style>
|
||||
|
||||
<Grid x:Name="gridListItem">
|
||||
<Grid.ColumnDefinitions>
|
||||
<!--<ColumnDefinition Width="{Binding colShopIdWidth,RelativeSource={RelativeSource AncestorType={x:Type local:ShopListCtrl}}}" ></ColumnDefinition>-->
|
||||
<ColumnDefinition x:Name="colCheck" Width="50*" />
|
||||
<ColumnDefinition x:Name="colIndex" Width="50*" />
|
||||
<ColumnDefinition x:Name="colAppId" Width="100*" />
|
||||
<ColumnDefinition x:Name="colShopId" Width="100*" />
|
||||
<ColumnDefinition x:Name="colShopName" Width="100*" />
|
||||
<ColumnDefinition x:Name="colGroupName" Width="100*" />
|
||||
<ColumnDefinition x:Name="colNotes" Width="100*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<CheckBox
|
||||
Grid.Column="0"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Background="Transparent"
|
||||
Click="CheckBox_Click"
|
||||
IsChecked="{Binding IsSelect, Mode=TwoWay}"
|
||||
Tag="{Binding ShopId}" />
|
||||
<TextBox
|
||||
Grid.Column="1"
|
||||
HorizontalContentAlignment="Center"
|
||||
VerticalContentAlignment="Center"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
IsReadOnly="True"
|
||||
Text="{Binding Mode=OneWay, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ListBoxItem}}, Converter={StaticResource listBoxIndexConverter}}"
|
||||
TextWrapping="Wrap" />
|
||||
<TextBox
|
||||
Grid.Column="2"
|
||||
HorizontalContentAlignment="Center"
|
||||
VerticalContentAlignment="Center"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
IsReadOnly="True"
|
||||
Tag="{Binding ShopId}"
|
||||
Text="{Binding ShopId}"
|
||||
TextWrapping="Wrap" />
|
||||
<TextBox
|
||||
Grid.Column="3"
|
||||
HorizontalContentAlignment="Center"
|
||||
VerticalContentAlignment="Center"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
IsReadOnly="True"
|
||||
Tag="{Binding ErpShopId}"
|
||||
Text="{Binding ErpShopId}"
|
||||
TextWrapping="Wrap" />
|
||||
<TextBox
|
||||
Grid.Column="4"
|
||||
HorizontalContentAlignment="Center"
|
||||
VerticalContentAlignment="Center"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
IsReadOnly="True"
|
||||
Tag="{Binding ShopId}"
|
||||
Text="{Binding ShopAccount}"
|
||||
TextWrapping="Wrap" />
|
||||
<TextBox
|
||||
Grid.Column="5"
|
||||
HorizontalContentAlignment="Center"
|
||||
VerticalContentAlignment="Center"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
IsReadOnly="True"
|
||||
Tag="{Binding ShopId}"
|
||||
Text="{Binding GroupName}"
|
||||
TextWrapping="Wrap" />
|
||||
<TextBox
|
||||
Grid.Column="6"
|
||||
HorizontalContentAlignment="Center"
|
||||
VerticalContentAlignment="Center"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
IsReadOnly="True"
|
||||
Tag="{Binding ShopId}"
|
||||
Text="{Binding Notes}"
|
||||
TextWrapping="Wrap" />
|
||||
</Grid>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
<Grid x:Name="gridListItem">
|
||||
<Grid.ColumnDefinitions>
|
||||
<!--<ColumnDefinition Width="{Binding colShopIdWidth,RelativeSource={RelativeSource AncestorType={x:Type local:ShopListCtrl}}}" ></ColumnDefinition>-->
|
||||
<ColumnDefinition x:Name="colCheck" Width="100*" />
|
||||
<ColumnDefinition x:Name="colShopId" Width="100*" />
|
||||
<ColumnDefinition x:Name="colShopName" Width="100*" />
|
||||
<ColumnDefinition x:Name="colGroupName" Width="100*" />
|
||||
<ColumnDefinition x:Name="colNotes" Width="100*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<CheckBox
|
||||
Grid.Column="0"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Background="Transparent"
|
||||
Click="CheckBox_Click"
|
||||
IsChecked="{Binding IsSelect, Mode=TwoWay}"
|
||||
Tag="{Binding ShopId}" />
|
||||
<TextBox
|
||||
Grid.Column="1"
|
||||
HorizontalContentAlignment="Center"
|
||||
VerticalContentAlignment="Center"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
IsReadOnly="True"
|
||||
Tag="{Binding ShopId}"
|
||||
Text="{Binding ShopId}"
|
||||
TextWrapping="Wrap" />
|
||||
<TextBox
|
||||
Grid.Column="2"
|
||||
HorizontalContentAlignment="Center"
|
||||
VerticalContentAlignment="Center"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
IsReadOnly="True"
|
||||
Tag="{Binding ShopId}"
|
||||
Text="{Binding ShopAccount}"
|
||||
TextWrapping="Wrap" />
|
||||
<TextBox
|
||||
Grid.Column="3"
|
||||
HorizontalContentAlignment="Center"
|
||||
VerticalContentAlignment="Center"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
IsReadOnly="True"
|
||||
Tag="{Binding ShopId}"
|
||||
Text="{Binding GroupName}"
|
||||
TextWrapping="Wrap" />
|
||||
<TextBox
|
||||
Grid.Column="4"
|
||||
HorizontalContentAlignment="Center"
|
||||
VerticalContentAlignment="Center"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
IsReadOnly="True"
|
||||
Tag="{Binding ShopId}"
|
||||
Text="{Binding Notes}"
|
||||
TextWrapping="Wrap" />
|
||||
</Grid>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
|
||||
<Grid x:Name="gridRefreshOrSelect" Grid.Row="3">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button
|
||||
x:Name="btnRefreshShop"
|
||||
Grid.Row="4"
|
||||
Grid.Column="0"
|
||||
Height="26"
|
||||
Margin="6,0,0,0"
|
||||
Click="btnRefreshShop_Click"
|
||||
Content=" 刷新店铺 "
|
||||
Style="{StaticResource BasePageButtonStyle}" />
|
||||
<Grid x:Name="gridRefreshOrSelect" Grid.Row="3">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button
|
||||
x:Name="btnRefreshShop"
|
||||
Grid.Row="4"
|
||||
Grid.Column="0"
|
||||
Height="26"
|
||||
Margin="6,0,0,0"
|
||||
Click="btnRefreshShop_Click"
|
||||
Content=" 刷新店铺 "
|
||||
Style="{StaticResource BasePageButtonStyle}" />
|
||||
|
||||
<Button
|
||||
x:Name="btnApplySelectShop"
|
||||
Grid.Row="4"
|
||||
Grid.Column="6"
|
||||
Height="26"
|
||||
Click="btnApplySelectShop_Click"
|
||||
Content=" 确定 "
|
||||
Style="{StaticResource BasePageButtonStyle}" />
|
||||
<Button
|
||||
x:Name="btnCancelSelectShop"
|
||||
Grid.Row="4"
|
||||
Grid.Column="7"
|
||||
Height="26"
|
||||
Margin="4,0,6,0"
|
||||
Click="btnCancelSelectShop_Click"
|
||||
Content=" 取消 "
|
||||
Style="{StaticResource BasePageButtonLightStyle}" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Button
|
||||
x:Name="btnApplySelectShop"
|
||||
Grid.Row="4"
|
||||
Grid.Column="6"
|
||||
Height="26"
|
||||
Click="btnApplySelectShop_Click"
|
||||
Content=" 确定 "
|
||||
Style="{StaticResource BasePageButtonStyle}" />
|
||||
<Button
|
||||
x:Name="btnCancelSelectShop"
|
||||
Grid.Row="4"
|
||||
Grid.Column="7"
|
||||
Height="26"
|
||||
Margin="4,0,6,0"
|
||||
Click="btnCancelSelectShop_Click"
|
||||
Content=" 取消 "
|
||||
Style="{StaticResource BasePageButtonLightStyle}" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -1,255 +1,156 @@
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using WPFCommon.Models;
|
||||
|
||||
namespace _29WxOrderWpf.Ctrls.Statistics.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// 店铺营收统计 - 查询参数。
|
||||
/// 对应新接口 shop_revenue_statistics/get_shop_order_amount 与
|
||||
/// shop_revenue_statistics/get_shop_stats_details 的请求体(StartDate / EndDate / ShopIds)。
|
||||
/// 店铺营收统计 - 查询参数
|
||||
/// </summary>
|
||||
public class ShopRevenueStatisticsQuery
|
||||
{
|
||||
/// <summary>开始日期</summary>
|
||||
/// <summary>开始时间</summary>
|
||||
public DateTime StartDate { get; set; }
|
||||
|
||||
/// <summary>结束日期</summary>
|
||||
/// <summary>结束时间</summary>
|
||||
public DateTime EndDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 选中的店铺 ERP 店铺ID(ShopLoginInfo.ErpShopId)列表;
|
||||
/// 空/Null 表示全部店铺(服务层会取全部店铺的 ErpShopId)。
|
||||
/// </summary>
|
||||
public List<string> ShopIds { get; set; }
|
||||
/// <summary>
|
||||
/// 是否统计快递费用
|
||||
/// </summary>
|
||||
public bool StatPackages { get; set; }
|
||||
/// <summary>选中的店铺 app_key 列表;空/Null 表示全部店铺</summary>
|
||||
public List<string> ShopKeys { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 店铺统计记录(接口返回)。
|
||||
/// 接口返回结构:
|
||||
/// shop_revenue_statistics/GetShopStats -> Result<Dictionary<string, List<ShopStatsResponse>>>
|
||||
/// Key = 店铺ID,Value = 该店铺按 <see cref="ShopStatsGroupType"/> 聚合后的记录列表
|
||||
/// (汇总=1 条;天/周/月=每个自然日/自然周/自然月各 1 条)。
|
||||
/// 注意:接口只返回按 GroupType 聚合后的记录,不返回“整段汇总”,
|
||||
/// 页面上的汇总卡片由客户端对返回记录自行合计(GroupType=Summary 时每店铺一条,直接相加即可)。
|
||||
/// 金额字段单位均为“分”,显示时需除以 100 转为元。
|
||||
/// 店铺营收统计 - 接口返回的原始明细行。
|
||||
/// 与后端 WXOrderAmountInfo 保持一致(camelCase JSON):
|
||||
/// shopName, createTime, orderId, status, productPrice, orderPrice, purchasePrice, freight,
|
||||
/// predictCommissionFee, commissionAmount, discountedPrice, profit, purchaseStatus,
|
||||
/// outAmount, refundStatus, refundStatusString, refundAmount, externalProcurement
|
||||
/// 金额字段单位均为分(显示时需除以 100)。
|
||||
/// </summary>
|
||||
public class ShopStatsResponse
|
||||
public class ShopRevenueStatisticsRow
|
||||
{
|
||||
/// <summary>
|
||||
/// 店铺ID
|
||||
/// </summary>
|
||||
public string ShopId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 销售订单创建日期
|
||||
/// </summary>
|
||||
public DateTime StatDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 订单数(有效订单,不含退款订单)
|
||||
/// </summary>
|
||||
public int OrderCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 销售总额(分)
|
||||
/// </summary>
|
||||
public long SalesAmount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 利润(分)
|
||||
/// </summary>
|
||||
public long ProfitAmount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 平台佣金(分)
|
||||
/// </summary>
|
||||
public long PlatformFee { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 退款订单数
|
||||
/// </summary>
|
||||
public int RefundOrderCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 已成功退款金额(分,店铺端已退款成功)
|
||||
/// </summary>
|
||||
public long RefundDone { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 退款处理中金额(分,店铺端退款中)
|
||||
/// </summary>
|
||||
public long RefundPending { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 采购单数
|
||||
/// </summary>
|
||||
public int PurchaseCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 总花费金额(分,买手号采购付款金额)
|
||||
/// </summary>
|
||||
public long TotalPurchase { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 售后中买手总金额(分)
|
||||
/// </summary>
|
||||
public long TotalRefund => DoneRefund + PendingRefund + RejectedRefund;
|
||||
|
||||
/// <summary>
|
||||
/// 已成功退款金额(分,买手号采购退款成功)
|
||||
/// </summary>
|
||||
public long DoneRefund { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 未退回金额(分)
|
||||
/// </summary>
|
||||
public long PendingRefund { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 被拒绝金额(分)
|
||||
/// </summary>
|
||||
public long RejectedRefund { get; set; }
|
||||
/// <summary>
|
||||
/// 包裹费用
|
||||
/// </summary>
|
||||
public long PackageAmount { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 销售趋势记录(接口返回):跨店铺合计后的按天趋势,供综合统计页的销售趋势折线图使用。
|
||||
/// 接口返回结构:
|
||||
/// shop_revenue_statistics/GetShopStatsTrend
|
||||
/// -> Result<List<ShopStatsTrendResponse>>
|
||||
/// 请求参数:StartDate / EndDate / ShopIds(不需要 GroupType,固定按天返回)。
|
||||
/// 金额字段单位为“分”,显示时需除以 100 转为元。
|
||||
/// </summary>
|
||||
public class ShopStatsTrendResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 统计日期(天)
|
||||
/// </summary>
|
||||
public DateTime StatDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 销售额(分)
|
||||
/// </summary>
|
||||
public long SalesAmount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 订单数
|
||||
/// </summary>
|
||||
public int OrderCount { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 订单明细(接口返回):订单列表弹窗 ShowOrderDialogView 的数据行。
|
||||
/// 接口返回结构:
|
||||
/// shop_revenue_statistics/GetShopOrderDetails
|
||||
/// -> Result<List<ShopOrderDetailResponse>>
|
||||
/// 请求参数:StartDate / EndDate / ShopIds / OrderType(见 <see cref="ShopOrderDetailType"/>)。
|
||||
/// 金额字段单位均为“分”,显示时需除以 100 转为元。
|
||||
/// </summary>
|
||||
public class ShopOrderDetailResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 店铺ID
|
||||
/// </summary>
|
||||
public long ShopId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 店铺名称
|
||||
/// </summary>
|
||||
[JsonProperty("shop_name")]
|
||||
public string ShopName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 商铺订单号
|
||||
/// 下单时间(秒级时间戳)
|
||||
/// </summary>
|
||||
[JsonProperty("create_time")]
|
||||
[JsonConverter(typeof(UnixDateTimeConverter))]
|
||||
public DateTime CreateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 订单号
|
||||
/// </summary>
|
||||
[JsonProperty("order_id")]
|
||||
public string OrderId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 订单创建时间
|
||||
/// 订单状态
|
||||
/// </summary>
|
||||
public DateTime CreateTime { get; set; }
|
||||
[JsonProperty("status")]
|
||||
public int Status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 商品总价(分)
|
||||
/// </summary>
|
||||
[JsonProperty("product_price")]
|
||||
public int ProductPrice { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 订单金额(分)
|
||||
/// </summary>
|
||||
[JsonProperty("order_price")]
|
||||
public int OrderPrice { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 订单退款金额(分),即商铺订单商品明细的退款金额之和;有效订单为 0
|
||||
/// 采购价(分)
|
||||
/// </summary>
|
||||
public int OrderRefundAmount { get; set; }
|
||||
[JsonProperty("purchase_price")]
|
||||
public int PurchasePrice { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 利润
|
||||
/// 运费(分)
|
||||
/// </summary>
|
||||
public long ProfitAmount { get; set; }
|
||||
[JsonProperty("freight")]
|
||||
public int Freight { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 平台佣金
|
||||
/// 平台服务费(预计技术服务费,分)
|
||||
/// </summary>
|
||||
public long PlatformFee { get; set; }
|
||||
[JsonProperty("predict_commission_fee")]
|
||||
public int PredictCommissionFee { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 外采金额(分),即该订单下所有买手订单的购买金额之和
|
||||
/// 达人佣金(分)
|
||||
/// </summary>
|
||||
[JsonProperty("commission_amount")]
|
||||
public int CommissionAmount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 优惠金额(分)
|
||||
/// </summary>
|
||||
[JsonProperty("discounted_price")]
|
||||
public int DiscountedPrice { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 利润(分)
|
||||
/// </summary>
|
||||
[JsonProperty("profit")]
|
||||
public int Profit { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 采购状态
|
||||
/// </summary>
|
||||
[JsonProperty("purchase_status")]
|
||||
public int PurchaseStatus { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 外采金额(分),out_amount为空或0时从中转仓订单表补全
|
||||
/// </summary>
|
||||
[JsonProperty("out_amount")]
|
||||
public int OutAmount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 买手未退回金额(分),即买手订单中退款未成功的退款金额之和;无售后时为 0
|
||||
/// 售后状态(订单明细 refund_status)
|
||||
/// </summary>
|
||||
public int UnrefundedAmount { get; set; }
|
||||
|
||||
public long PackageAmount { get; set; }
|
||||
/// <summary>
|
||||
/// 买手订单信息(一个订单号对应多个买手订单)
|
||||
/// </summary>
|
||||
public List<BuyerOrderInfo> BuyerOrders { get; set; } = new List<BuyerOrderInfo>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 买手订单信息(订单明细下的子项,一个商铺订单可对应多个买手订单)
|
||||
/// </summary>
|
||||
public class BuyerOrderInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// 买手订单ID
|
||||
/// </summary>
|
||||
public long Id { get; set; }
|
||||
/// <summary>
|
||||
/// 仓库类型 0,1直发
|
||||
/// </summary>
|
||||
public int PurchaseType { get; set; }
|
||||
/// <summary>
|
||||
/// 外部订单(买手订单)号
|
||||
/// </summary>
|
||||
public string OutOrderSn { get; set; }
|
||||
[JsonProperty("refund_status")]
|
||||
public int RefundStatus { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 金额(分)
|
||||
/// 售后状态(退款单 status)
|
||||
/// </summary>
|
||||
public int OutAmount { get; set; }
|
||||
[JsonProperty("refund_status_string")]
|
||||
public string RefundStatusString { get; set; }
|
||||
|
||||
public long RefundId { get; set; }
|
||||
/// <summary>
|
||||
/// 退款金额(分)
|
||||
/// 售后退款金额(分)
|
||||
/// </summary>
|
||||
[JsonProperty("refund_amount")]
|
||||
public int RefundAmount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 退款状态
|
||||
/// 是否外采:0=未从中转仓订单表查到,1=查到
|
||||
/// </summary>
|
||||
public string RefundStatusText { get; set; }
|
||||
[JsonProperty("external_procurement")]
|
||||
public int ExternalProcurement { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 买手退款金额
|
||||
/// </summary>
|
||||
[JsonProperty("buyer_refund_amount")]
|
||||
public int BuyerRefundAmount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 买手退款状态
|
||||
/// </summary>
|
||||
[JsonProperty("buyer_refund_status")]
|
||||
public string BuyerRefundStatus { get; set; }
|
||||
|
||||
public DateTime CreateTime { get; set; }
|
||||
public string Remark { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -265,7 +166,7 @@ namespace _29WxOrderWpf.Ctrls.Statistics.Models
|
||||
/// <summary>利润(实际利润)</summary>
|
||||
public decimal Profit { get; set; }
|
||||
|
||||
/// <summary>退款金额(统计期间店铺端退款:已成功 + 处理中)</summary>
|
||||
/// <summary>退款金额(统计期间退款)</summary>
|
||||
public decimal RefundAmount { get; set; }
|
||||
|
||||
/// <summary>退款订单数</summary>
|
||||
@@ -274,10 +175,7 @@ namespace _29WxOrderWpf.Ctrls.Statistics.Models
|
||||
/// <summary>平台服务费总额(元)</summary>
|
||||
public decimal PlatformFeeTotal { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 达人佣金(元)。
|
||||
/// 新接口未提供该字段,固定为 0,保留属性与页面展示,待后端补充字段后直接接上。
|
||||
/// </summary>
|
||||
/// <summary>达人佣金(元)</summary>
|
||||
public decimal Commission { get; set; }
|
||||
|
||||
/// <summary>客单价(平均每单金额)</summary>
|
||||
@@ -297,10 +195,6 @@ namespace _29WxOrderWpf.Ctrls.Statistics.Models
|
||||
public decimal BuyerRefundSuccessedAmount { get; set; }
|
||||
/// <summary>买手号剩余退款金额(尚未成功退款的金额,元)</summary>
|
||||
public decimal BuyerRefundRemainingAmount => BuyerRefundAmount - BuyerRefundSuccessedAmount;
|
||||
/// <summary>
|
||||
/// 包裹费用
|
||||
/// </summary>
|
||||
public decimal PackageAmount { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -344,7 +238,7 @@ namespace _29WxOrderWpf.Ctrls.Statistics.Models
|
||||
/// <summary>店铺名称</summary>
|
||||
public string ShopName { get; set; }
|
||||
|
||||
/// <summary>订单数(有效订单,不含退款订单)</summary>
|
||||
/// <summary>订单数</summary>
|
||||
public int OrderCount { get; set; }
|
||||
|
||||
/// <summary>销售额(元)</summary>
|
||||
@@ -360,7 +254,7 @@ namespace _29WxOrderWpf.Ctrls.Statistics.Models
|
||||
/// <summary>平台服务费总额(元)</summary>
|
||||
public decimal PlatformFeeTotal { get; set; }
|
||||
|
||||
/// <summary>达人佣金(元)。新接口未提供该字段,固定为 0。</summary>
|
||||
/// <summary>达人佣金(元)</summary>
|
||||
public decimal Commission { get; set; }
|
||||
|
||||
/// <summary>客单价(元)</summary>
|
||||
@@ -368,10 +262,6 @@ namespace _29WxOrderWpf.Ctrls.Statistics.Models
|
||||
|
||||
/// <summary>平均利润率(利润 / 采购金额,百分数,如 12.34 表示 12.34%)</summary>
|
||||
public decimal AverageProfitRate { get; set; }
|
||||
/// <summary>
|
||||
/// 包裹费用
|
||||
/// </summary>
|
||||
public decimal PackageAmount { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -389,55 +279,6 @@ namespace _29WxOrderWpf.Ctrls.Statistics.Models
|
||||
Month = 2
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 接口聚合方式(请求参数 GroupType,按数字传值)。
|
||||
/// 每种方式都返回 Dictionary<店铺ID, List<ShopStatsResponse>>:
|
||||
/// 汇总时每个店铺 1 条,天/周/月时每个店铺每个周期 1 条。
|
||||
/// </summary>
|
||||
public enum ShopStatsGroupType
|
||||
{
|
||||
/// <summary>
|
||||
/// 汇总:每个商铺只返回一条(整个查询范围合计)
|
||||
/// </summary>
|
||||
Summary = 0,
|
||||
|
||||
/// <summary>
|
||||
/// 天:按自然日聚合,每个商铺每天一条
|
||||
/// </summary>
|
||||
Day = 1,
|
||||
|
||||
/// <summary>
|
||||
/// 周:按自然周聚合(周一为一周开始),每个商铺每周一条
|
||||
/// </summary>
|
||||
Week = 2,
|
||||
|
||||
/// <summary>
|
||||
/// 月:按自然月聚合,每个商铺每月一条
|
||||
/// </summary>
|
||||
Month = 3
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 订单明细类型(订单列表弹窗的入口类型,对应接口参数 OrderType,按数字传值)。
|
||||
/// 数值与后端枚举保持一致:有效订单=1、退款订单=2、买手未退回金额的订单=3
|
||||
/// (后端枚举里的“全部订单 All=0”本页不使用,故不定义)。
|
||||
/// </summary>
|
||||
public enum ShopOrderDetailType
|
||||
{
|
||||
/// <summary>有效订单:没有发生售后的订单(对应统计里的订单数 / 销售额 / 利润口径)</summary>
|
||||
Valid = 1,
|
||||
|
||||
/// <summary>退款订单:发生过售后的订单(对应统计里的退款订单数口径)</summary>
|
||||
Refund = 2,
|
||||
|
||||
/// <summary>买手未退回金额的订单:退款订单中买手款项还没退回的(对应统计里的未退回金额口径)</summary>
|
||||
BuyerUnrefunded = 3,
|
||||
/// <summary>
|
||||
/// 利润订单 有效订单+退款订单利润>0
|
||||
/// </summary>
|
||||
Profit = 4,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 天/周/月周期统计表格行(金额单位:元)。
|
||||
/// 按所选店铺(或全部店铺)统计:天统计每天一行;周统计每周一行;月统计每月一行。
|
||||
@@ -450,7 +291,7 @@ namespace _29WxOrderWpf.Ctrls.Statistics.Models
|
||||
/// <summary>周期显示文本(天:yyyy-MM-dd;周:yyyy-MM-dd ~ yyyy-MM-dd;月:yyyy-MM)</summary>
|
||||
public string Period { get; set; }
|
||||
|
||||
/// <summary>订单数(有效订单,不含退款订单)</summary>
|
||||
/// <summary>订单数</summary>
|
||||
public int OrderCount { get; set; }
|
||||
|
||||
/// <summary>销售额(元)</summary>
|
||||
@@ -467,7 +308,7 @@ namespace _29WxOrderWpf.Ctrls.Statistics.Models
|
||||
/// <summary>平台服务费总额(元)</summary>
|
||||
public decimal PlatformFeeTotal { get; set; }
|
||||
|
||||
/// <summary>达人佣金(元)。新接口未提供该字段,固定为 0。</summary>
|
||||
/// <summary>达人佣金(元)</summary>
|
||||
public decimal Commission { get; set; }
|
||||
|
||||
/// <summary>平均利润率(利润 / 采购金额,百分数,如 12.34 表示 12.34%)</summary>
|
||||
@@ -480,51 +321,14 @@ namespace _29WxOrderWpf.Ctrls.Statistics.Models
|
||||
public decimal AvgOrderAmount { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 店铺营收统计 - 一次查询的全部聚合结果(综合统计页使用)。
|
||||
/// 由两次请求组成:
|
||||
/// shop_revenue_statistics/GetShopStats(GroupType=Summary)-> 卡片/店铺统计表/销售占比(每店铺一条,与区间长度无关)
|
||||
/// shop_revenue_statistics/GetShopStatsTrend -> 销售趋势(跨店铺合计的按天序列)
|
||||
/// </summary>
|
||||
public class ShopRevenueStatisticsResult
|
||||
{
|
||||
/// <summary>汇总卡片数据</summary>
|
||||
public ShopRevenueSummary Summary { get; set; }
|
||||
|
||||
/// <summary>销售趋势(按天,缺失日期补 0)</summary>
|
||||
public List<RevenueTrendPoint> Trend { get; set; }
|
||||
|
||||
/// <summary>店铺销售占比(饼图)</summary>
|
||||
public List<ShopSalesProportionItem> ShopProportions { get; set; }
|
||||
|
||||
/// <summary>店铺统计表格</summary>
|
||||
public List<ShopStatisticsItem> ShopStatistics { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 店铺营收统计 - 天/周/月周期统计查询结果(周期统计页使用)。
|
||||
/// 接口不返回整段汇总,Summary 由返回的周期数据在客户端合计得出。
|
||||
/// </summary>
|
||||
public class ShopPeriodStatisticsResult
|
||||
{
|
||||
/// <summary>汇总卡片数据(整个查询时间段,客户端合计)</summary>
|
||||
public ShopRevenueSummary Summary { get; set; }
|
||||
|
||||
/// <summary>周期统计表格(天/周/月各一行)</summary>
|
||||
public List<ShopPeriodStatisticsItem> Items { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 店铺下拉选项
|
||||
/// </summary>
|
||||
public class ShopOption
|
||||
{
|
||||
/// <summary>店铺ID(ShopLoginInfo.ShopId)</summary>
|
||||
/// <summary>店铺 app_key(A.app_key)</summary>
|
||||
public string AppKey { get; set; }
|
||||
public string ShopId { get; set; }
|
||||
|
||||
/// <summary>ERP 店铺ID(ShopLoginInfo.ErpShopId),统计接口的 ShopIds 使用该字段</summary>
|
||||
public string ErpShopId { get; set; }
|
||||
|
||||
/// <summary>店铺名称</summary>
|
||||
public string ShopName { get; set; }
|
||||
}
|
||||
@@ -541,4 +345,55 @@ namespace _29WxOrderWpf.Ctrls.Statistics.Models
|
||||
public string Value { get; set; }
|
||||
}
|
||||
|
||||
class UnixDateTimeConverter : JsonConverter
|
||||
{
|
||||
public override bool CanConvert(Type objectType)
|
||||
{
|
||||
return objectType == typeof(DateTime);
|
||||
}
|
||||
|
||||
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
|
||||
{
|
||||
// 读取数值(支持 long 和 int 类型)
|
||||
if (reader.TokenType == JsonToken.Integer)
|
||||
{
|
||||
long milliseconds = (long)reader.Value;
|
||||
// Unix 纪元:1970-01-01 UTC
|
||||
//DateTime epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
|
||||
DateTime epoch = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1));
|
||||
if (milliseconds.ToString().Length == 13)
|
||||
{
|
||||
return epoch.AddMilliseconds(milliseconds);
|
||||
}
|
||||
return epoch.AddSeconds(milliseconds);
|
||||
|
||||
|
||||
}
|
||||
// 如果传入的是字符串(如 "1700000000000"),也支持
|
||||
else if (reader.TokenType == JsonToken.String)
|
||||
{
|
||||
if (long.TryParse((string)reader.Value, out long milliseconds))
|
||||
{
|
||||
//DateTime epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
|
||||
DateTime epoch = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1));
|
||||
if (milliseconds.ToString().Length == 13)
|
||||
{
|
||||
return epoch.AddMilliseconds(milliseconds);
|
||||
}
|
||||
return epoch.AddSeconds(milliseconds);
|
||||
}
|
||||
}
|
||||
throw new JsonSerializationException($"无法将 {reader.Value} 转换为 DateTime");
|
||||
}
|
||||
|
||||
|
||||
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
|
||||
{
|
||||
// 序列化时转回时间戳
|
||||
//DateTime epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
|
||||
DateTime epoch = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1));
|
||||
long milliseconds = (long)((DateTime)value - epoch).TotalMilliseconds;
|
||||
writer.WriteValue(milliseconds);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
x:Class="_29WxOrderWpf.Ctrls.Statistics.PeriodRevenueStatisticsView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:common="WxOrder.Framework"
|
||||
xmlns:common="clr-namespace:_29WxOrderWpf.Common"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:stat="clr-namespace:_29WxOrderWpf.Ctrls.Statistics"
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:vm="clr-namespace:_29WxOrderWpf.Ctrls.Statistics.ViewModels"
|
||||
xmlns:wpf="WPFCommon"
|
||||
d:DataContext="{d:DesignInstance Type=vm:ShopRevenueStatisticsViewModel,
|
||||
IsDesignTimeCreatable=True}"
|
||||
mc:Ignorable="d">
|
||||
@@ -49,9 +48,9 @@
|
||||
Width="110"
|
||||
Height="32"
|
||||
VerticalContentAlignment="Center"
|
||||
BorderThickness="1"
|
||||
DisplayMemberPath="Text"
|
||||
IsReadOnly="True"
|
||||
BorderThickness="1"
|
||||
ItemsSource="{Binding TimeRangeOptions}"
|
||||
SelectedItem="{Binding SelectedTimeRange, Mode=TwoWay}"
|
||||
Style="{StaticResource RoundedComboBox}" />
|
||||
@@ -61,10 +60,9 @@
|
||||
FontSize="14"
|
||||
Foreground="#666666"
|
||||
Text="日期" />
|
||||
<DatePicker
|
||||
<DatePicker BorderBrush="{StaticResource pageColorBrush}"
|
||||
Height="32"
|
||||
VerticalContentAlignment="Center"
|
||||
BorderBrush="{StaticResource pageColorBrush}"
|
||||
SelectedDate="{Binding StartDate, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
|
||||
<TextBlock
|
||||
Margin="6,0"
|
||||
@@ -72,10 +70,9 @@
|
||||
FontSize="14"
|
||||
Foreground="#666666"
|
||||
Text="~" />
|
||||
<DatePicker
|
||||
<DatePicker BorderBrush="{StaticResource pageColorBrush}"
|
||||
Height="32"
|
||||
VerticalContentAlignment="Center"
|
||||
BorderBrush="{StaticResource pageColorBrush}"
|
||||
SelectedDate="{Binding EndDate, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
|
||||
<TextBlock
|
||||
Margin="14,0,6,0"
|
||||
@@ -98,14 +95,6 @@
|
||||
ItemsSource="{Binding ShopOptions}"
|
||||
SelectedItem="{Binding SelectedShop, Mode=TwoWay}"
|
||||
Style="{StaticResource BaseComboBoxStyle}" />-->
|
||||
<wpf:TitleContent
|
||||
Title="去除快递费"
|
||||
Margin="10,0,0,0"
|
||||
VerticalContentAlignment="Center"
|
||||
Placement="Left"
|
||||
TitleVerticalAlignment="Center">
|
||||
<CheckBox IsChecked="{Binding StatPackages}" Style="{StaticResource ToggleSwitch}" />
|
||||
</wpf:TitleContent>
|
||||
<Button
|
||||
Height="32"
|
||||
Margin="18,0,0,0"
|
||||
|
||||
@@ -80,6 +80,16 @@
|
||||
</StackPanel>
|
||||
|
||||
</Border>
|
||||
<Button
|
||||
Margin="10"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Top"
|
||||
Command="{Binding ShowOrderListCommand}"
|
||||
CommandParameter="ValidOrderCount"
|
||||
Content="明细"
|
||||
FontSize="12"
|
||||
Foreground="{StaticResource pageColorBrush}"
|
||||
Style="{StaticResource IconButtonStyle}" />
|
||||
</Grid>
|
||||
<!-- 采购金额 -->
|
||||
<Border Style="{StaticResource CardBorderStyle}">
|
||||
@@ -103,37 +113,25 @@
|
||||
</Border>
|
||||
|
||||
<!-- 利润 -->
|
||||
<Grid>
|
||||
<Border Style="{StaticResource CardBorderStyle}">
|
||||
<StackPanel>
|
||||
<TextBlock
|
||||
FontSize="14"
|
||||
Foreground="#888888"
|
||||
Text="利润" />
|
||||
<TextBlock
|
||||
Margin="0,12,0,0"
|
||||
FontSize="30"
|
||||
FontWeight="Bold"
|
||||
Foreground="#333333"
|
||||
Text="{Binding Summary.Profit, StringFormat={}¥{0:N2}}" />
|
||||
<TextBlock
|
||||
Margin="0,10,0,0"
|
||||
FontSize="12"
|
||||
Foreground="#999999"
|
||||
Text="实际利润" />
|
||||
</StackPanel>
|
||||
</Border>
|
||||
<Button
|
||||
Margin="10"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Top"
|
||||
Command="{Binding ShowOrderListCommand}"
|
||||
CommandParameter="ProfitOrder"
|
||||
Content="明细"
|
||||
FontSize="12"
|
||||
Foreground="{StaticResource pageColorBrush}"
|
||||
Style="{StaticResource IconButtonStyle}" />
|
||||
</Grid>
|
||||
<Border Style="{StaticResource CardBorderStyle}">
|
||||
<StackPanel>
|
||||
<TextBlock
|
||||
FontSize="14"
|
||||
Foreground="#888888"
|
||||
Text="利润" />
|
||||
<TextBlock
|
||||
Margin="0,12,0,0"
|
||||
FontSize="30"
|
||||
FontWeight="Bold"
|
||||
Foreground="#333333"
|
||||
Text="{Binding Summary.Profit, StringFormat={}¥{0:N2}}" />
|
||||
<TextBlock
|
||||
Margin="0,10,0,0"
|
||||
FontSize="12"
|
||||
Foreground="#999999"
|
||||
Text="实际利润" />
|
||||
</StackPanel>
|
||||
</Border>
|
||||
<!-- 平均利润率 -->
|
||||
<Border Style="{StaticResource CardBorderStyle}">
|
||||
<StackPanel>
|
||||
@@ -257,7 +255,7 @@
|
||||
<TextBlock
|
||||
FontSize="14"
|
||||
Foreground="#888888"
|
||||
Text="售后采购金额" />
|
||||
Text="总采购金额" />
|
||||
<TextBlock
|
||||
Margin="0,12,0,0"
|
||||
FontSize="30"
|
||||
|
||||
@@ -13,6 +13,5 @@ namespace _29WxOrderWpf.Ctrls.Statistics
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,4 +1,4 @@
|
||||
<Window
|
||||
<UserControl
|
||||
x:Class="_29WxOrderWpf.Ctrls.Statistics.ShopRevenueStatisticsView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
@@ -7,16 +7,16 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:stat="clr-namespace:_29WxOrderWpf.Ctrls.Statistics"
|
||||
xmlns:vm="clr-namespace:_29WxOrderWpf.Ctrls.Statistics.ViewModels"
|
||||
xmlns:wpf="WxOrder.Framework"
|
||||
Width="1600"
|
||||
xmlns:wpf="clr-namespace:_29WxOrderWpf.Common"
|
||||
d:Background="#F5F7FB"
|
||||
d:DataContext="{d:DesignInstance Type=vm:ShopRevenueStatisticsViewModel,
|
||||
IsDesignTimeCreatable=True}"
|
||||
d:DesignHeight="900"
|
||||
d:DesignWidth="1600"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
wpf:DialogWindowProperty.ResizeMode="CanResizeWithGrip"
|
||||
wpf:DialogWindowProperty.ShowMinButton="False"
|
||||
mc:Ignorable="d">
|
||||
<Window.Resources>
|
||||
<UserControl.Resources>
|
||||
<BooleanToVisibilityConverter x:Key="boolToVisibilityConverter" />
|
||||
|
||||
<!-- 卡片样式(白底、圆角、阴影) -->
|
||||
@@ -119,7 +119,7 @@
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</Window.Resources>
|
||||
</UserControl.Resources>
|
||||
|
||||
<Grid Background="#F5F7FB">
|
||||
<TabControl SelectionChanged="TabControl_SelectionChanged" Style="{StaticResource StatisticsTabControlStyle}">
|
||||
@@ -274,32 +274,30 @@
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
<!-- helper -->
|
||||
|
||||
<WrapPanel
|
||||
<Border
|
||||
Margin="0,20,30,0"
|
||||
Padding="10"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Top">
|
||||
<Border
|
||||
Padding="10"
|
||||
Background="{StaticResource pageColorBrush}"
|
||||
BorderThickness="1"
|
||||
Cursor="Hand"
|
||||
MouseLeftButtonDown="help_mouseLeftButtonDown">
|
||||
<WrapPanel>
|
||||
<TextBlock
|
||||
Margin="0,0,10,0"
|
||||
Foreground="White"
|
||||
Style="{StaticResource TextBlockIcon}"
|
||||
Text="{StaticResource txt-chat_help}" />
|
||||
<TextBlock
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
FontWeight="Black"
|
||||
Foreground="White"
|
||||
Text="利润计算逻辑" />
|
||||
</WrapPanel>
|
||||
</Border>
|
||||
</WrapPanel>
|
||||
VerticalAlignment="Top"
|
||||
Background="{StaticResource pageColorBrush}"
|
||||
BorderThickness="1"
|
||||
Cursor="Hand"
|
||||
MouseLeftButtonDown="help_mouseLeftButtonDown">
|
||||
<WrapPanel>
|
||||
<TextBlock
|
||||
Margin="0,0,10,0"
|
||||
Foreground="White"
|
||||
Style="{StaticResource TextBlockIcon}"
|
||||
Text="{StaticResource txt-chat_help}" />
|
||||
<TextBlock
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
FontWeight="Black"
|
||||
Foreground="White"
|
||||
Text="利润计算逻辑" />
|
||||
</WrapPanel>
|
||||
</Border>
|
||||
|
||||
<!-- Popup 弹出层 -->
|
||||
<Popup
|
||||
x:Name="InfoPopup"
|
||||
@@ -350,4 +348,4 @@
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</Grid>
|
||||
</Window>
|
||||
</UserControl>
|
||||
@@ -1,5 +1,4 @@
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Controls;
|
||||
using _29WxOrderWpf.Ctrls.Statistics.ViewModels;
|
||||
|
||||
namespace _29WxOrderWpf.Ctrls.Statistics
|
||||
@@ -10,7 +9,7 @@ namespace _29WxOrderWpf.Ctrls.Statistics
|
||||
/// 如需注入自定义数据服务,请使用
|
||||
/// new ShopRevenueStatisticsView(new ShopRevenueStatisticsViewModel(你的 IShopRevenueStatisticsService 实现))。
|
||||
/// </summary>
|
||||
public partial class ShopRevenueStatisticsView : Window
|
||||
public partial class ShopRevenueStatisticsView : UserControl
|
||||
{
|
||||
public ShopRevenueStatisticsView()
|
||||
: this(new ShopRevenueStatisticsViewModel())
|
||||
@@ -20,9 +19,7 @@ namespace _29WxOrderWpf.Ctrls.Statistics
|
||||
public ShopRevenueStatisticsView(ShopRevenueStatisticsViewModel viewModel)
|
||||
{
|
||||
InitializeComponent();
|
||||
viewModel.GetWindow = () => this;
|
||||
DataContext = viewModel;
|
||||
|
||||
}
|
||||
|
||||
private void help_mouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
|
||||
|
||||
@@ -1,92 +1,32 @@
|
||||
<UserControl
|
||||
<UserControl
|
||||
x:Class="_29WxOrderWpf.Ctrls.Statistics.ShowOrderDialogView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:comn="WxOrder.Framework"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:_29WxOrderWpf.Ctrls.Statistics"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:wpf="WPFCommon"
|
||||
comn:DialogWindowProperty.Height="620"
|
||||
comn:DialogWindowProperty.ResizeMode="CanResizeWithGrip"
|
||||
comn:DialogWindowProperty.Width="1320"
|
||||
d:Background="White"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="1000"
|
||||
Focusable="True"
|
||||
PreviewKeyDown="ShowOrderDialogView_PreviewKeyDown"
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d">
|
||||
<UserControl.Resources>
|
||||
<wpf:BindingProxy x:Key="ViewModel" Data="{Binding}" />
|
||||
<!-- 单元格文字居中 -->
|
||||
<Style x:Key="CenterCellTextStyle" TargetType="TextBlock">
|
||||
<Setter Property="TextAlignment" Value="Center" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
</Style>
|
||||
|
||||
<!--
|
||||
选中行高亮:用主题色填充选中行,并且不区分表格是否拥有焦点
|
||||
(默认样式的选中色在焦点离开表格后会变成浅灰,点了“复制数据”就看不出选中了哪些行)
|
||||
-->
|
||||
<Style x:Key="SelectedCellStyle" TargetType="DataGridCell">
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="BorderThickness" Value="0" />
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsSelected" Value="True">
|
||||
<Setter Property="Background" Value="{StaticResource pageColorBrush}" />
|
||||
<Setter Property="Foreground" Value="White" />
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
</UserControl.Resources>
|
||||
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<Border
|
||||
Grid.Row="0"
|
||||
Padding="10"
|
||||
BorderBrush="Gray"
|
||||
BorderThickness="0,0,0,1">
|
||||
<wpf:SpacingStackPanel HorizontalSpacing="10" Orientation="Horizontal">
|
||||
<wpf:TitleContent
|
||||
Title="订单号:"
|
||||
Width="180"
|
||||
Placement="Left"
|
||||
TitleVerticalAlignment="Center">
|
||||
<TextBox
|
||||
Height="22"
|
||||
Text="{Binding OrderId, UpdateSourceTrigger=PropertyChanged}"
|
||||
ToolTip="按订单号筛选;表格内可用 Ctrl+A 全选、Ctrl+C 复制数据" />
|
||||
</wpf:TitleContent>
|
||||
</wpf:SpacingStackPanel>
|
||||
</Border>
|
||||
<DataGrid
|
||||
x:Name="dgOrders"
|
||||
Grid.Row="1"
|
||||
<DataGrid Margin="5"
|
||||
d:ItemsSource="{d:SampleData ItemCount=10}"
|
||||
AlternatingRowBackground="#FAFAFA"
|
||||
AutoGenerateColumns="False"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
CanUserAddRows="False"
|
||||
CanUserDeleteRows="False"
|
||||
CanUserReorderColumns="False"
|
||||
CanUserResizeRows="False"
|
||||
CellStyle="{StaticResource SelectedCellStyle}"
|
||||
ColumnHeaderStyle="{StaticResource BaseDataGridColumnHeaderStyle}"
|
||||
GridLinesVisibility="Horizontal"
|
||||
HeadersVisibility="Column"
|
||||
HorizontalGridLinesBrush="#EEEEEE"
|
||||
IsReadOnly="True"
|
||||
ItemsSource="{Binding DataView}"
|
||||
RowHeight="44"
|
||||
SelectionMode="Extended"
|
||||
ItemsSource="{Binding Data}"
|
||||
SelectionMode="Single"
|
||||
SelectionUnit="FullRow"
|
||||
VerticalScrollBarVisibility="Auto">
|
||||
Style="{StaticResource DefaultDataGridStyle}"
|
||||
VerticalScrollBarVisibility="Visible">
|
||||
<DataGrid.Columns>
|
||||
<!-- 店名 -->
|
||||
<DataGridTextColumn
|
||||
@@ -110,6 +50,7 @@
|
||||
<Button
|
||||
Margin="5,0,0,0"
|
||||
Click="CopyOrderId_Click"
|
||||
Foreground="{StaticResource pageColorBrush}"
|
||||
ToolTip="复制订单号">
|
||||
<Button.Style>
|
||||
<Style BasedOn="{StaticResource IconButtonStyle}" TargetType="Button">
|
||||
@@ -129,13 +70,6 @@
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
|
||||
<!-- 创建时间 -->
|
||||
<DataGridTextColumn
|
||||
Width="1.4*"
|
||||
Binding="{Binding CreateTime, StringFormat={}{0:yyyy-MM-dd HH:mm}}"
|
||||
ElementStyle="{StaticResource CenterCellTextStyle}"
|
||||
Header="创建时间" />
|
||||
|
||||
<!-- 金额(分转元) -->
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
@@ -144,98 +78,14 @@
|
||||
Header="金额" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding OrderRefundAmount, Converter={StaticResource FenToYuanConverter}, StringFormat={}¥{0:N2}}"
|
||||
Binding="{Binding RefundAmount, Converter={StaticResource FenToYuanConverter}, StringFormat={}¥{0:N2}}"
|
||||
ElementStyle="{StaticResource CenterCellTextStyle}"
|
||||
Header="退款金额" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding PlatformFee, Converter={StaticResource FenToYuanConverter}, StringFormat={}¥{0:N2}}"
|
||||
ElementStyle="{StaticResource CenterCellTextStyle}"
|
||||
Header="平台费用" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding ProfitAmount, Converter={StaticResource FenToYuanConverter}, StringFormat={}¥{0:N2}}"
|
||||
ElementStyle="{StaticResource CenterCellTextStyle}"
|
||||
Header="利润" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding PackageAmount, Converter={StaticResource FenToYuanConverter}, StringFormat={}¥{0:N2}}"
|
||||
ElementStyle="{StaticResource CenterCellTextStyle}"
|
||||
Header="快递费" />
|
||||
<!-- 买手订单:一笔买手订单占一行,不合并 -->
|
||||
<DataGridTextColumn
|
||||
Width="1.6*"
|
||||
Binding="{Binding OutOrderSn}"
|
||||
ElementStyle="{StaticResource CenterCellTextStyle}"
|
||||
Header="买手单号" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding BuyerOutAmount, Converter={StaticResource FenToYuanConverter}, StringFormat={}¥{0:N2}}"
|
||||
Binding="{Binding OutAmount, Converter={StaticResource FenToYuanConverter}, StringFormat={}¥{0:N2}}"
|
||||
ElementStyle="{StaticResource CenterCellTextStyle}"
|
||||
Header="外采金额" />
|
||||
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding BuyerRefundAmount, Converter={StaticResource FenToYuanConverter}, StringFormat={}¥{0:N2}}"
|
||||
ElementStyle="{StaticResource CenterCellTextStyle}"
|
||||
Header="买手退款" />
|
||||
<DataGridTextColumn
|
||||
Width="1.1*"
|
||||
Binding="{Binding BuyerRefundStatusText}"
|
||||
ElementStyle="{StaticResource CenterCellTextStyle}"
|
||||
Header="退款状态" />
|
||||
<DataGridTextColumn
|
||||
Width="1.1*"
|
||||
Binding="{Binding Remark}"
|
||||
Header="备注"
|
||||
Visibility="{Binding Source={StaticResource ViewModel}, Path=Data.IsBuyerUnrefunded, Converter={StaticResource Boolean2VisibilityConverter}}">
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="HorizontalAlignment" Value="Center" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="ToolTip" Value="{Binding Remark}" />
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<!-- 操作:仅“买手未退回金额的订单”弹窗显示(列可见性在构造函数里按订单明细类型设置) -->
|
||||
<DataGridTemplateColumn
|
||||
x:Name="colUpdateRefund"
|
||||
Width="*"
|
||||
d:Visibility="Visible"
|
||||
Header="操作"
|
||||
Visibility="Collapsed">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<Button
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Command="{Binding Source={StaticResource ViewModel}, Path=Data.UpdateBuyerRefundStatusCommand}"
|
||||
CommandParameter="{Binding}"
|
||||
Content="确认成功"
|
||||
Style="{StaticResource BasePageButtonLightStyle}"
|
||||
ToolTip="把该笔买手订单标记为退款成功" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTemplateColumn
|
||||
x:Name="colRemark"
|
||||
Width="*"
|
||||
d:Visibility="Visible"
|
||||
Header="操作"
|
||||
Visibility="{Binding Source={StaticResource ViewModel}, Path=Data.IsBuyerUnrefunded, Converter={StaticResource Boolean2VisibilityConverter}}">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<Button
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Command="{Binding Source={StaticResource ViewModel}, Path=Data.UpdateRemarkCommand}"
|
||||
CommandParameter="{Binding}"
|
||||
Content="备注"
|
||||
Style="{StaticResource BasePageButtonLightStyle}"
|
||||
ToolTip="设置备注" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</Grid>
|
||||
|
||||
@@ -1,20 +1,12 @@
|
||||
using _29WxOrderWpf.BaseWindows;
|
||||
using WxOrder.Framework.Commons;
|
||||
using _29WxOrderWpf.BaseWindows;
|
||||
using _29WxOrderWpf.Ctrls.Statistics.Models;
|
||||
using _29WxOrderWpf.Ctrls.Statistics.Services;
|
||||
using _29WxOrderWpf.ToolCtrls;
|
||||
using AllBase;
|
||||
using NaiBa.Util.Extension;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Controls.Primitives;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
@@ -22,8 +14,6 @@ using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
using Work.BaseForms;
|
||||
using WPFCommon.Models;
|
||||
|
||||
namespace _29WxOrderWpf.Ctrls.Statistics;
|
||||
|
||||
@@ -32,44 +22,10 @@ namespace _29WxOrderWpf.Ctrls.Statistics;
|
||||
/// </summary>
|
||||
public partial class ShowOrderDialogView : UserControl
|
||||
{
|
||||
private readonly KeyEventHandler shortcutKeyHandler;
|
||||
|
||||
public ShowOrderDialogView(List<ShopOrderDetailResponse> list, ShopOrderDetailType detailType, IShopRevenueStatisticsService statisticsService)
|
||||
public ShowOrderDialogView(List<ShopRevenueStatisticsRow> list)
|
||||
{
|
||||
InitializeComponent();
|
||||
this.DataContext = new ShowOrderDialogViewModel(list, detailType, statisticsService);
|
||||
|
||||
// “操作”列(退款成功按钮)只在“买手未退回金额的订单”弹窗里显示
|
||||
if (detailType == ShopOrderDetailType.BuyerUnrefunded)
|
||||
{
|
||||
colUpdateRefund.Visibility = Visibility.Visible;
|
||||
//colRemark.Visibility = Visibility.Visible;
|
||||
}
|
||||
|
||||
shortcutKeyHandler = ShowOrderDialogView_PreviewKeyDown;
|
||||
|
||||
// 快捷键必须挂到弹窗窗口上:弹窗刚打开时键盘焦点在窗口本身(不在本控件的可视树里),
|
||||
// 事件路由中就不会有本控件,只在本控件上挂 PreviewKeyDown 的话,
|
||||
// 必须先用鼠标点一下表格(焦点进到表格里)Ctrl+A/Ctrl+C 才会生效。
|
||||
Loaded += (s, e) => AttachShortcutHandler();
|
||||
Unloaded += (s, e) => DetachShortcutHandler();
|
||||
}
|
||||
|
||||
/// <summary>把快捷键处理器挂到所在窗口(隧道事件,焦点在窗口上的任意位置都能收到)</summary>
|
||||
private void AttachShortcutHandler()
|
||||
{
|
||||
Window window = Window.GetWindow(this);
|
||||
if (window == null)
|
||||
return;
|
||||
|
||||
// 先移除再挂,避免重复挂载后按一次键执行两次
|
||||
window.RemoveHandler(PreviewKeyDownEvent, shortcutKeyHandler);
|
||||
window.AddHandler(PreviewKeyDownEvent, shortcutKeyHandler);
|
||||
}
|
||||
|
||||
private void DetachShortcutHandler()
|
||||
{
|
||||
Window.GetWindow(this)?.RemoveHandler(PreviewKeyDownEvent, shortcutKeyHandler);
|
||||
this.DataContext = new ShowOrderDialogViewModel(list);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -78,385 +34,27 @@ public partial class ShowOrderDialogView : UserControl
|
||||
private void CopyOrderId_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (sender is FrameworkElement element
|
||||
&& element.DataContext is ShopOrderDetailRow row
|
||||
&& element.DataContext is ShopRevenueStatisticsRow row
|
||||
&& !string.IsNullOrEmpty(row.OrderId))
|
||||
{
|
||||
Window window = Window.GetWindow(this);
|
||||
try
|
||||
{
|
||||
Clipboard.SetDataObject(row.OrderId);
|
||||
ToastHelper.Show(window, "复制成功");
|
||||
BaseMsgWindow.ShowAnimateMessage("复制成功");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ToastHelper.Show(window, "复制失败 " + ex.Message, type: ToastType.Error);
|
||||
BaseMsgWindow.ShowError("复制失败 " + ex.Message,window: window);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 弹窗级快捷键:Ctrl+A 全选(筛选后显示的)行,Ctrl+C 复制数据。
|
||||
/// 焦点在文本框里(如订单号搜索框)时不拦截,保留文本自身的 Ctrl+A/Ctrl+C/Ctrl+V 行为。
|
||||
/// </summary>
|
||||
private void ShowOrderDialogView_PreviewKeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (e.Handled || Keyboard.Modifiers != ModifierKeys.Control)
|
||||
return;
|
||||
|
||||
// 文本框(含搜索框)优先,走文本自己的全选/复制/粘贴
|
||||
if (Keyboard.FocusedElement is TextBoxBase)
|
||||
return;
|
||||
|
||||
if (DataContext is not ShowOrderDialogViewModel viewModel)
|
||||
return;
|
||||
|
||||
if (e.Key == Key.A)
|
||||
{
|
||||
SelectAllRows(viewModel);
|
||||
e.Handled = true;
|
||||
}
|
||||
else if (e.Key == Key.C)
|
||||
{
|
||||
// 有选中就复制选中的行,没有选中则复制筛选后的全部数据
|
||||
viewModel.CopyRows(GetSelectedRows());
|
||||
e.Handled = true;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Ctrl+A:全选当前筛选后显示的所有行(被过滤掉的行不会选中)。
|
||||
/// 选中行取自与复制同一份筛选结果,保证“选中的”和“复制的”完全一致。
|
||||
/// </summary>
|
||||
private void SelectAllRows(ShowOrderDialogViewModel viewModel)
|
||||
{
|
||||
// 让键盘焦点回到表格,全选后仍可用键盘继续操作
|
||||
dgOrders.Focus();
|
||||
dgOrders.SelectedItems.Clear();
|
||||
foreach (var row in viewModel.GetFilteredRows())
|
||||
{
|
||||
dgOrders.SelectedItems.Add(row);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>当前选中的行</summary>
|
||||
private List<ShopOrderDetailRow> GetSelectedRows()
|
||||
{
|
||||
return dgOrders.SelectedItems.OfType<ShopOrderDetailRow>().ToList();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 订单明细表格行:把一个商铺订单按买手订单“展平”成多行(有几笔买手订单就几行,
|
||||
/// 没有买手订单时占一行且买手字段为空),不把多笔买手订单合并到同一行。
|
||||
/// 商铺订单级字段(店名/订单号/创建时间/金额等)在多行之间重复,保证每行都是一条完整记录。
|
||||
/// </summary>
|
||||
class ShopOrderDetailRow : BindableBaseEx
|
||||
class ShowOrderDialogViewModel
|
||||
{
|
||||
public string ShopName { get; set; }
|
||||
|
||||
public string OrderId { get; set; }
|
||||
|
||||
public DateTime CreateTime { get; set; }
|
||||
|
||||
public int OrderPrice { get; set; }
|
||||
|
||||
public int OrderRefundAmount { get; set; }
|
||||
/// <summary>
|
||||
/// 利润
|
||||
/// </summary>
|
||||
public long ProfitAmount { get; set; }
|
||||
/// <summary>
|
||||
/// 包裹费用
|
||||
/// </summary>
|
||||
public long PackageAmount { get; set; }
|
||||
/// <summary>
|
||||
/// 平台佣金
|
||||
/// </summary>
|
||||
public long PlatformFee { get; set; }
|
||||
public int OutAmount { get; set; }
|
||||
|
||||
public int UnrefundedAmount { get; set; }
|
||||
|
||||
/// <summary>买手订单表ID</summary>
|
||||
public long BuyerId { get; set; }
|
||||
|
||||
/// <summary>买手(外部)订单号;无买手订单时为空</summary>
|
||||
public string OutOrderSn { get; set; }
|
||||
|
||||
/// <summary>买手订单金额(分)</summary>
|
||||
public int BuyerOutAmount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 买手退款表 id
|
||||
/// </summary>
|
||||
public long BuyerRefundId { get; set; }
|
||||
/// <summary>买手订单退款金额(分)</summary>
|
||||
public int BuyerRefundAmount { get; set; }
|
||||
|
||||
/// <summary>买手订单退款状态(更新成功后就地改为“退款成功”)</summary>
|
||||
public string BuyerRefundStatusText
|
||||
public List<ShopRevenueStatisticsRow> Data { get; set; }
|
||||
public ShowOrderDialogViewModel(List<ShopRevenueStatisticsRow> list)
|
||||
{
|
||||
get => GetValue<string>();
|
||||
set => SetValue(value);
|
||||
}
|
||||
public string Remark
|
||||
{
|
||||
get => GetValue<string>();
|
||||
set => SetValue(value);
|
||||
}
|
||||
/// <summary>把接口返回的订单明细按买手订单展平成表格行</summary>
|
||||
public static List<ShopOrderDetailRow> Flatten(IEnumerable<ShopOrderDetailResponse> list, ShopOrderDetailType detailType)
|
||||
{
|
||||
var rows = new List<ShopOrderDetailRow>();
|
||||
if (list == null)
|
||||
return rows;
|
||||
|
||||
foreach (var item in list)
|
||||
{
|
||||
if (item == null)
|
||||
continue;
|
||||
|
||||
if (item.BuyerOrders == null || item.BuyerOrders.Count == 0)
|
||||
{
|
||||
rows.Add(Create(item, null));
|
||||
continue;
|
||||
}
|
||||
if (detailType == ShopOrderDetailType.Profit)
|
||||
{
|
||||
// 利润订单只取最后一个买手订单
|
||||
rows.Add(Create(item, item.BuyerOrders.LastOrDefault()));
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (var buyerOrder in item.BuyerOrders)
|
||||
{
|
||||
rows.Add(Create(item, buyerOrder));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return rows;
|
||||
}
|
||||
|
||||
private static ShopOrderDetailRow Create(ShopOrderDetailResponse item, BuyerOrderInfo buyerOrder)
|
||||
{
|
||||
return new ShopOrderDetailRow
|
||||
{
|
||||
ShopName = item.ShopName,
|
||||
OrderId = item.OrderId,
|
||||
CreateTime = item.CreateTime,
|
||||
OrderPrice = item.OrderPrice,
|
||||
OrderRefundAmount = item.OrderRefundAmount,
|
||||
ProfitAmount = item.ProfitAmount,
|
||||
PackageAmount = item.PackageAmount,
|
||||
PlatformFee = item.PlatformFee,
|
||||
OutAmount = item.OutAmount,
|
||||
UnrefundedAmount = item.UnrefundedAmount,
|
||||
BuyerId = buyerOrder == null ? 0 : buyerOrder.Id,
|
||||
OutOrderSn = buyerOrder == null ? null : buyerOrder.OutOrderSn,
|
||||
BuyerRefundId = buyerOrder == null ? 0 : buyerOrder.RefundId,
|
||||
BuyerOutAmount = buyerOrder == null ? 0 : buyerOrder.OutAmount,
|
||||
BuyerRefundAmount = buyerOrder == null ? 0 : buyerOrder.RefundAmount,
|
||||
BuyerRefundStatusText = buyerOrder == null ? null : buyerOrder.RefundStatusText,
|
||||
Remark = buyerOrder == null ? null : buyerOrder.Remark,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
class ShowOrderDialogViewModel : BindableBaseEx
|
||||
{
|
||||
private readonly ShopOrderDetailType _detailType;
|
||||
private readonly IShopRevenueStatisticsService _statisticsService;
|
||||
|
||||
public ObservableCollection<ShopOrderDetailRow> Data { get; set; }
|
||||
public ICollectionView DataView { get; private set; }
|
||||
public ShowOrderDialogViewModel(List<ShopOrderDetailResponse> list, ShopOrderDetailType detailType, IShopRevenueStatisticsService statisticsService)
|
||||
{
|
||||
IsBuyerUnrefunded = detailType == ShopOrderDetailType.BuyerUnrefunded;
|
||||
// 按买手订单展平:一笔买手订单一一行, 利润明细合并,只展示一条
|
||||
Data = new ObservableCollection<ShopOrderDetailRow>(ShopOrderDetailRow.Flatten(list, detailType));
|
||||
DataView = CollectionViewSource.GetDefaultView(Data);
|
||||
DataView.Filter = FilterRow;
|
||||
_detailType = detailType;
|
||||
_statisticsService = statisticsService;
|
||||
}
|
||||
|
||||
private bool FilterRow(object obj)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(OrderId))
|
||||
return true;
|
||||
if (obj is ShopOrderDetailRow row)
|
||||
{
|
||||
return (row.OrderId ?? string.Empty).Contains(OrderId);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public string OrderId
|
||||
{
|
||||
get => GetValue<string>();
|
||||
set => SetValue(value, () => DataView.Refresh());
|
||||
}
|
||||
public bool IsBuyerUnrefunded
|
||||
{
|
||||
get => GetValue<bool>();
|
||||
set => SetValue(value);
|
||||
}
|
||||
|
||||
/// <summary>当前筛选后显示的行(按表格显示顺序)</summary>
|
||||
public List<ShopOrderDetailRow> GetFilteredRows()
|
||||
{
|
||||
return DataView.Cast<ShopOrderDetailRow>().ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 复制指定行到剪贴板(带表头,制表符分隔)。
|
||||
/// rows 为空时复制筛选后的全部数据;复制结果用提示条反馈。
|
||||
/// </summary>
|
||||
public void CopyRows(IEnumerable<ShopOrderDetailRow> rows)
|
||||
{
|
||||
List<ShopOrderDetailRow> list = rows?.ToList() ?? new List<ShopOrderDetailRow>();
|
||||
if (list.Count == 0)
|
||||
{
|
||||
// 没有选中行时,复制筛选后的全部数据
|
||||
list = GetFilteredRows();
|
||||
}
|
||||
|
||||
if (list.Count == 0)
|
||||
{
|
||||
ToastHelper.Show("没有可复制的数据", type: ToastType.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
string text = BuildCopyText(list);
|
||||
Application.Current.Dispatcher.Invoke(() => Clipboard.SetText(text));
|
||||
ToastHelper.Show("复制成功");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ToastHelper.Show("复制失败 " + ex.Message, type: ToastType.Error);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public ICommand UpdateBuyerRefundStatusCommand => new AsyncDelegateCommand<ShopOrderDetailRow>(UpdateBuyerRefundStatus);
|
||||
|
||||
private async Task UpdateBuyerRefundStatus(ShopOrderDetailRow row)
|
||||
{
|
||||
if (row.BuyerRefundId == 0)
|
||||
{
|
||||
ToastHelper.Show("该行缺少买手订单ID,无法更新", type: ToastType.Warning);
|
||||
return;
|
||||
}
|
||||
var result = MessageBox.Show($"确定要把订单:{row.OrderId}\n设为已退款成功状态?", "提示",
|
||||
MessageBoxButton.YesNo, MessageBoxImage.Question);
|
||||
|
||||
if (result != MessageBoxResult.Yes)
|
||||
{
|
||||
return;
|
||||
}
|
||||
try
|
||||
{
|
||||
var ret = await _statisticsService.UpdateBuyerRefundStatusAsync(row.BuyerRefundId);
|
||||
if (ret)
|
||||
{
|
||||
row.BuyerRefundStatusText = "退款成功";
|
||||
ToastHelper.Show("操作成功");
|
||||
}
|
||||
else
|
||||
throw new Exception("状态更改失败");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ToastHelper.Show("操作失败 " + ex.Message, type: ToastType.Error);
|
||||
|
||||
}
|
||||
finally
|
||||
{
|
||||
}
|
||||
}
|
||||
public ICommand UpdateRemarkCommand => new AsyncDelegateCommand<ShopOrderDetailRow>(UpdateRemark);
|
||||
|
||||
private async Task UpdateRemark(ShopOrderDetailRow row)
|
||||
{
|
||||
string? remark = InputDialog.ShowText("请输入备注:", "备注", row.Remark, allowEmpty: true);
|
||||
if (remark == null)
|
||||
return;
|
||||
|
||||
try
|
||||
{
|
||||
var ret = await _statisticsService.UpdateBuyerAfterOrderRemark(row.BuyerRefundId, remark);
|
||||
if (ret)
|
||||
{
|
||||
row.Remark = remark;
|
||||
ToastHelper.Show("操作成功");
|
||||
}
|
||||
else
|
||||
throw new Exception("备注更改失败");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ToastHelper.Show("操作失败 " + ex.Message, type: ToastType.Error);
|
||||
|
||||
}
|
||||
finally
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>把行拼成制表符分隔的文本(第一行是表头)</summary>
|
||||
private string BuildCopyText(IEnumerable<ShopOrderDetailRow> rows)
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
bool includeRemark = _detailType == ShopOrderDetailType.BuyerUnrefunded;
|
||||
|
||||
// 表头
|
||||
List<string> headers = ["店名", "订单", "创建时间", "金额", "退款金额", "平台费用", "利润","快递费", "买手单号", "外采金额", "买手退款", "退款状态"];
|
||||
if (includeRemark)
|
||||
headers.Add("备注");
|
||||
sb.AppendLine(string.Join("\t", headers));
|
||||
|
||||
// 数据行
|
||||
foreach (var item in rows)
|
||||
{
|
||||
var cols = new List<string>
|
||||
{
|
||||
CsvEscape(item.ShopName),
|
||||
item.OrderId,
|
||||
item.CreateTime.ToString("yyyy-MM-dd HH:mm"),
|
||||
(item.OrderPrice / 100m).ToString("0.00"),
|
||||
(item.OrderRefundAmount / 100m).ToString("0.00"),
|
||||
(item.PlatformFee / 100m).ToString("0.00"),
|
||||
(item.ProfitAmount / 100m).ToString("0.00"),
|
||||
(item.PackageAmount / 100m).ToString("0.00"),
|
||||
CsvEscape(item.OutOrderSn),
|
||||
(item.BuyerOutAmount / 100m).ToString("0.00"),
|
||||
(item.BuyerRefundAmount / 100m).ToString("0.00"),
|
||||
CsvEscape(item.BuyerRefundStatusText)
|
||||
};
|
||||
if (includeRemark)
|
||||
cols.Add(CsvEscape(item.Remark));
|
||||
sb.AppendLine(string.Join("\t", cols));
|
||||
}
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
private string CsvEscape(string value)
|
||||
{
|
||||
if (string.IsNullOrEmpty(value))
|
||||
return "";
|
||||
|
||||
// 含逗号、引号、换行时,用双引号包起来,内部引号翻倍
|
||||
if (value.Contains(',') || value.Contains('"') || value.Contains('\n') || value.Contains('\r'))
|
||||
{
|
||||
return "\"" + value.Replace("\"", "\"\"") + "\"";
|
||||
}
|
||||
|
||||
return value;
|
||||
Data = list ?? new List<ShopRevenueStatisticsRow>();
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using WxOrder.Framework.Commons;
|
||||
using _29WxOrderWpf.Commands;
|
||||
using _29WxOrderWpf.Common;
|
||||
using _29WxOrderWpf.Ctrls.Statistics.Models;
|
||||
using _29WxOrderWpf.Ctrls.Statistics.Services;
|
||||
using AllBase.Model.MvvmBaseClasses;
|
||||
@@ -9,7 +10,6 @@ using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Input;
|
||||
using WxOrder.Framework.Commons;
|
||||
|
||||
namespace _29WxOrderWpf.Ctrls.Statistics.ViewModels
|
||||
{
|
||||
@@ -39,12 +39,6 @@ namespace _29WxOrderWpf.Ctrls.Statistics.ViewModels
|
||||
private int _totalCount;
|
||||
private string _pagerText = string.Empty;
|
||||
|
||||
/// <summary>是否已完成首次初始化(用于避免页签来回切换时重复初始化、重复查询)</summary>
|
||||
private bool _initialized;
|
||||
|
||||
/// <summary>上一次真正生效(并据此计算过日期)的时间范围选项,避免同一个选项被重复应用</summary>
|
||||
private TimeRangeOption _appliedTimeRange;
|
||||
|
||||
public PeriodRevenueStatisticsViewModel(PeriodStatisticType periodType)
|
||||
: this(periodType, new ShopRevenueStatisticsService())
|
||||
{
|
||||
@@ -71,18 +65,8 @@ namespace _29WxOrderWpf.Ctrls.Statistics.ViewModels
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 页面首次显示时初始化查询条件并加载数据(由外层 TabControl 的选中事件调用)。
|
||||
/// 重复调用(在“综合统计 / 天统计 / 周统计 / 月统计”页签之间来回切换)会被忽略:
|
||||
/// 否则每次切回来都会把时间范围和店铺重置成默认值,并重新发起一次查询。
|
||||
/// 需要刷新数据时点“查询”按钮即可。
|
||||
/// </summary>
|
||||
public void Init()
|
||||
{
|
||||
if (_initialized)
|
||||
return;
|
||||
|
||||
_initialized = true;
|
||||
InitializeAsync();
|
||||
}
|
||||
|
||||
@@ -177,11 +161,7 @@ namespace _29WxOrderWpf.Ctrls.Statistics.ViewModels
|
||||
#endregion
|
||||
|
||||
#region 查询条件
|
||||
public bool StatPackages
|
||||
{
|
||||
get { return this.GetValue(x => x.StatPackages); }
|
||||
set { this.SetValue(x => x.StatPackages, value); }
|
||||
}
|
||||
|
||||
/// <summary>时间范围选项</summary>
|
||||
public ObservableCollection<TimeRangeOption> TimeRangeOptions { get; }
|
||||
|
||||
@@ -192,16 +172,7 @@ namespace _29WxOrderWpf.Ctrls.Statistics.ViewModels
|
||||
set
|
||||
{
|
||||
this.SetValue(x => x.SelectedTimeRange, value);
|
||||
|
||||
// 只有用户真正切换到“另一个”时间范围选项时才重新计算起止日期。
|
||||
// 页签切换时下拉框会把同一个选项(甚至先 null 再回写)重放一遍,
|
||||
// 若照样重算,就会把用户手工调过的日期覆盖掉(例如自定义区间被改回“本周”)。
|
||||
if (value != null && !ReferenceEquals(_appliedTimeRange, value))
|
||||
{
|
||||
_appliedTimeRange = value;
|
||||
ApplyTimeRange();
|
||||
}
|
||||
|
||||
ApplyTimeRange();
|
||||
OnPropertyChanged(nameof(IsCustomDateRange));
|
||||
}
|
||||
}
|
||||
@@ -459,20 +430,20 @@ namespace _29WxOrderWpf.Ctrls.Statistics.ViewModels
|
||||
EndDate = now;
|
||||
break;
|
||||
case "week":
|
||||
{
|
||||
int diff = today.DayOfWeek == DayOfWeek.Sunday ? 6 : (int)today.DayOfWeek - 1;
|
||||
StartDate = today.AddDays(-diff);
|
||||
EndDate = now;
|
||||
}
|
||||
break;
|
||||
{
|
||||
int diff = today.DayOfWeek == DayOfWeek.Sunday ? 6 : (int)today.DayOfWeek - 1;
|
||||
StartDate = today.AddDays(-diff);
|
||||
EndDate = now;
|
||||
}
|
||||
break;
|
||||
case "lastweek":
|
||||
{
|
||||
int diff = today.DayOfWeek == DayOfWeek.Sunday ? 6 : (int)today.DayOfWeek - 1;
|
||||
var thisWeekStart = today.AddDays(-diff);
|
||||
StartDate = thisWeekStart.AddDays(-7);
|
||||
EndDate = thisWeekStart.AddDays(-1).AddHours(23).AddMinutes(59).AddSeconds(59);
|
||||
}
|
||||
break;
|
||||
{
|
||||
int diff = today.DayOfWeek == DayOfWeek.Sunday ? 6 : (int)today.DayOfWeek - 1;
|
||||
var thisWeekStart = today.AddDays(-diff);
|
||||
StartDate = thisWeekStart.AddDays(-7);
|
||||
EndDate = thisWeekStart.AddDays(-1).AddHours(23).AddMinutes(59).AddSeconds(59);
|
||||
}
|
||||
break;
|
||||
case "last2weeks":
|
||||
StartDate = today.AddDays(-13);
|
||||
EndDate = now;
|
||||
@@ -486,12 +457,12 @@ namespace _29WxOrderWpf.Ctrls.Statistics.ViewModels
|
||||
EndDate = now;
|
||||
break;
|
||||
case "lastmonth":
|
||||
{
|
||||
var firstOfThisMonth = new DateTime(today.Year, today.Month, 1);
|
||||
StartDate = firstOfThisMonth.AddMonths(-1);
|
||||
EndDate = firstOfThisMonth.AddDays(-1).AddHours(23).AddMinutes(59).AddSeconds(59);
|
||||
}
|
||||
break;
|
||||
{
|
||||
var firstOfThisMonth = new DateTime(today.Year, today.Month, 1);
|
||||
StartDate = firstOfThisMonth.AddMonths(-1);
|
||||
EndDate = firstOfThisMonth.AddDays(-1).AddHours(23).AddMinutes(59).AddSeconds(59);
|
||||
}
|
||||
break;
|
||||
case "last3months":
|
||||
StartDate = new DateTime(today.Year, today.Month, 1).AddMonths(-2);
|
||||
EndDate = now;
|
||||
@@ -510,28 +481,25 @@ namespace _29WxOrderWpf.Ctrls.Statistics.ViewModels
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据选中店铺生成查询用 ERP 店铺ID 列表(接口 ShopIds 使用 ShopLoginInfo.ErpShopId):
|
||||
/// 未选/全选/选中“全部店铺”时返回空列表(表示全部店铺)。
|
||||
/// </summary>
|
||||
private List<string> BuildSelectedShopIds()
|
||||
/// <summary>根据选中店铺生成查询店铺 key 列表:未选/全选/选中“全部店铺”时返回空列表(表示全部店铺)</summary>
|
||||
private List<string> BuildSelectedShopKeys()
|
||||
{
|
||||
var selected = SelectedShops;
|
||||
if (selected == null || selected.Count == 0)
|
||||
return new List<string>();
|
||||
|
||||
var ids = selected.Select(s => s == null ? string.Empty : s.ErpShopId).ToList();
|
||||
if (ids.Any(string.IsNullOrEmpty))
|
||||
var keys = selected.Select(s => s == null ? string.Empty : s.AppKey).ToList();
|
||||
if (keys.Any(string.IsNullOrEmpty))
|
||||
return new List<string>();
|
||||
|
||||
if (selected.Count >= ShopOptions.Count)
|
||||
return new List<string>();
|
||||
|
||||
return ids;
|
||||
return keys;
|
||||
}
|
||||
|
||||
/// <summary>组装查询参数(起止日期已保证先后顺序)</summary>
|
||||
private ShopRevenueStatisticsQuery BuildQuery()
|
||||
/// <summary>执行查询,刷新周期统计表格并回到第一页</summary>
|
||||
private async Task LoadAsync()
|
||||
{
|
||||
if (StartDate > EndDate)
|
||||
{
|
||||
@@ -540,24 +508,19 @@ namespace _29WxOrderWpf.Ctrls.Statistics.ViewModels
|
||||
EndDate = temp;
|
||||
}
|
||||
|
||||
return new ShopRevenueStatisticsQuery
|
||||
{
|
||||
StartDate = StartDate,
|
||||
EndDate = EndDate,
|
||||
ShopIds = BuildSelectedShopIds(),
|
||||
StatPackages = StatPackages
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>执行查询,刷新周期统计表格并回到第一页</summary>
|
||||
private async Task LoadAsync()
|
||||
{
|
||||
IsLoading = true;
|
||||
try
|
||||
{
|
||||
var result = await _service.QueryPeriodStatisticsAsync(BuildQuery(), _periodType);
|
||||
Summary = result.Summary;
|
||||
_allItems = result.Items ?? new List<ShopPeriodStatisticsItem>();
|
||||
var query = new ShopRevenueStatisticsQuery
|
||||
{
|
||||
StartDate = StartDate,
|
||||
EndDate = EndDate,
|
||||
ShopKeys = BuildSelectedShopKeys(),
|
||||
};
|
||||
|
||||
var table = await _service.GetPeriodStatisticsAsync(query, _periodType);
|
||||
Summary = await _service.GetSummaryAsync(query);
|
||||
_allItems = table ?? new List<ShopPeriodStatisticsItem>();
|
||||
TotalCount = _allItems.Count;
|
||||
TotalPages = TotalCount == 0 ? 1 : (int)Math.Ceiling(TotalCount / (double)PageSize);
|
||||
GoToPage(1);
|
||||
@@ -590,51 +553,35 @@ namespace _29WxOrderWpf.Ctrls.Statistics.ViewModels
|
||||
|
||||
private async Task ShowOrderList(string type)
|
||||
{
|
||||
var detailType = ParseDetailType(type);
|
||||
List<ShopOrderDetailResponse> showList;
|
||||
// 明细接口数据量大、耗时长,期间显示页面统一的加载遮罩,避免点了没反应
|
||||
IsLoading = true;
|
||||
try
|
||||
var query = new ShopRevenueStatisticsQuery
|
||||
{
|
||||
showList = await _service.QueryOrderRowsAsync(BuildQuery(), detailType)
|
||||
?? new List<ShopOrderDetailResponse>();
|
||||
}
|
||||
catch (Exception ex)
|
||||
StartDate = StartDate,
|
||||
EndDate = EndDate,
|
||||
ShopKeys = BuildSelectedShopKeys(),
|
||||
};
|
||||
var rows = await _service.QueryRowsAsync(query);
|
||||
List<ShopRevenueStatisticsRow> showList = new List<ShopRevenueStatisticsRow>();
|
||||
switch (type)
|
||||
{
|
||||
MessageBox.Show("订单明细查询失败:" + ex.Message, "提示", MessageBoxButton.OK, MessageBoxImage.Warning);
|
||||
return;
|
||||
}
|
||||
finally
|
||||
{
|
||||
IsLoading = false;
|
||||
}
|
||||
|
||||
if (showList.Count == 0)
|
||||
{
|
||||
MessageBox.Show("未查询到符合条件的订单明细。", "提示", MessageBoxButton.OK, MessageBoxImage.Information);
|
||||
return;
|
||||
case "ValidOrderCount":
|
||||
showList = RevenueStatisticsAggregator.GetValidOrder(rows);
|
||||
break; //有效订单
|
||||
case "RefundOrderCount":
|
||||
showList = RevenueStatisticsAggregator.GetRefundOrder(rows);
|
||||
break;//退款订单
|
||||
case "BuyerRefundRemainingAmount":
|
||||
showList = RevenueStatisticsAggregator.GetBuyerRefundRemainingOrder(rows);
|
||||
break;//待退回采购金额
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
new DialogWindow()
|
||||
{
|
||||
Title = "订单列表",
|
||||
Content = new ShowOrderDialogView(showList, detailType, _service),
|
||||
DataContext = showList
|
||||
Content = new ShowOrderDialogView(showList),
|
||||
DataContext = rows
|
||||
}.ShowDialog();
|
||||
}
|
||||
|
||||
/// <summary>卡片“明细”按钮参数 → 订单明细类型(对应接口参数 OrderType)</summary>
|
||||
private static ShopOrderDetailType ParseDetailType(string type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case "RefundOrderCount":
|
||||
return ShopOrderDetailType.Refund; //退款订单
|
||||
case "BuyerRefundRemainingAmount":
|
||||
return ShopOrderDetailType.BuyerUnrefunded; //买手未退回金额的订单
|
||||
default:
|
||||
return ShopOrderDetailType.Valid; //有效订单
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
using WxOrder.Framework.Commons;
|
||||
using WxOrder.Framework.Commons;
|
||||
using _29WxOrderWpf.Commands;
|
||||
using _29WxOrderWpf.Common;
|
||||
using _29WxOrderWpf.Ctrls.Statistics.Models;
|
||||
using _29WxOrderWpf.Ctrls.Statistics.Services;
|
||||
using AllBase.Model.MvvmBaseClasses;
|
||||
@@ -10,9 +10,7 @@ using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Input;
|
||||
using Work.BaseForms;
|
||||
|
||||
namespace _29WxOrderWpf.Ctrls.Statistics.ViewModels
|
||||
{
|
||||
@@ -32,9 +30,6 @@ namespace _29WxOrderWpf.Ctrls.Statistics.ViewModels
|
||||
private ObservableCollection<ShopOption> _selectedShops;
|
||||
private string _selectedPlatform;
|
||||
|
||||
/// <summary>上一次真正生效(并据此计算过日期)的时间范围选项,避免同一个选项被重复应用</summary>
|
||||
private TimeRangeOption _appliedTimeRange;
|
||||
|
||||
public ShopRevenueStatisticsViewModel()
|
||||
: this(new ShopRevenueStatisticsService())
|
||||
{
|
||||
@@ -61,11 +56,6 @@ namespace _29WxOrderWpf.Ctrls.Statistics.ViewModels
|
||||
|
||||
InitializeAsync();
|
||||
}
|
||||
public bool StatPackages
|
||||
{
|
||||
get { return this.GetValue(x => x.StatPackages); }
|
||||
set { this.SetValue(x => x.StatPackages, value); }
|
||||
}
|
||||
|
||||
#region 查询条件
|
||||
|
||||
@@ -79,16 +69,7 @@ namespace _29WxOrderWpf.Ctrls.Statistics.ViewModels
|
||||
set
|
||||
{
|
||||
this.SetValue(x => x.SelectedTimeRange, value);
|
||||
|
||||
// 只有用户真正切换到“另一个”时间范围选项时才重新计算起止日期。
|
||||
// 页签切换时下拉框会把同一个选项(甚至先 null 再回写)重放一遍,
|
||||
// 若照样重算,就会把用户手工调过的日期覆盖掉。
|
||||
if (value != null && !ReferenceEquals(_appliedTimeRange, value))
|
||||
{
|
||||
_appliedTimeRange = value;
|
||||
ApplyTimeRange();
|
||||
}
|
||||
|
||||
ApplyTimeRange();
|
||||
OnPropertyChanged(nameof(IsCustomDateRange));
|
||||
}
|
||||
}
|
||||
@@ -253,67 +234,57 @@ namespace _29WxOrderWpf.Ctrls.Statistics.ViewModels
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据选中店铺生成查询用 ERP 店铺ID 列表(接口 ShopIds 使用 ShopLoginInfo.ErpShopId):
|
||||
/// 未选/全选/选中“全部店铺”时返回空列表(表示全部店铺)。
|
||||
/// </summary>
|
||||
private List<string> BuildSelectedShopIds()
|
||||
/// <summary>根据选中店铺生成查询店铺 key 列表:未选/全选/选中“全部店铺”时返回空列表(表示全部店铺)</summary>
|
||||
private List<string> BuildSelectedShopKeys()
|
||||
{
|
||||
var selected = SelectedShops;
|
||||
if (selected == null || selected.Count == 0)
|
||||
return new List<string>();
|
||||
|
||||
var ids = selected.Select(s => s == null ? string.Empty : s.ErpShopId).ToList();
|
||||
if (ids.Any(string.IsNullOrEmpty))
|
||||
var keys = selected.Select(s => s == null ? string.Empty : s.AppKey).ToList();
|
||||
if (keys.Any(string.IsNullOrEmpty))
|
||||
return new List<string>();
|
||||
|
||||
if (selected.Count >= ShopOptions.Count)
|
||||
return new List<string>();
|
||||
|
||||
return ids;
|
||||
return keys;
|
||||
}
|
||||
|
||||
/// <summary>组装查询参数(起止日期已保证先后顺序)</summary>
|
||||
private ShopRevenueStatisticsQuery BuildQuery()
|
||||
/// <summary>执行查询,刷新页面所有统计数据</summary>
|
||||
private async Task LoadAsync()
|
||||
{
|
||||
if (StartDate == EndDate)
|
||||
{
|
||||
EndDate = EndDate.AddDays(1).AddSeconds(-1);
|
||||
}
|
||||
else if (StartDate > EndDate)
|
||||
if (StartDate > EndDate)
|
||||
{
|
||||
var temp = StartDate;
|
||||
StartDate = EndDate;
|
||||
EndDate = temp;
|
||||
}
|
||||
|
||||
|
||||
return new ShopRevenueStatisticsQuery
|
||||
{
|
||||
StartDate = StartDate,
|
||||
EndDate = EndDate,
|
||||
ShopIds = BuildSelectedShopIds(),
|
||||
StatPackages = StatPackages,
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>执行查询,刷新页面所有统计数据</summary>
|
||||
private async Task LoadAsync()
|
||||
{
|
||||
IsLoading = true;
|
||||
try
|
||||
{
|
||||
var result = await _service.QueryAsync(BuildQuery());
|
||||
|
||||
Summary = result.Summary;
|
||||
TrendData = new ObservableCollection<RevenueTrendPoint>(result.Trend ?? new List<RevenueTrendPoint>());
|
||||
ShopProportionData = new ObservableCollection<ShopSalesProportionItem>(result.ShopProportions ?? new List<ShopSalesProportionItem>());
|
||||
ShopStatistics = new ObservableCollection<ShopStatisticsItem>(result.ShopStatistics ?? new List<ShopStatisticsItem>());
|
||||
var query = new ShopRevenueStatisticsQuery
|
||||
{
|
||||
StartDate = StartDate,
|
||||
EndDate = EndDate,
|
||||
ShopKeys = BuildSelectedShopKeys(),
|
||||
};
|
||||
|
||||
Summary = await _service.GetSummaryAsync(query);
|
||||
|
||||
var trend = await _service.GetSalesTrendAsync(query);
|
||||
TrendData = new ObservableCollection<RevenueTrendPoint>(trend);
|
||||
|
||||
var proportion = await _service.GetShopSalesProportionAsync(query);
|
||||
ShopProportionData = new ObservableCollection<ShopSalesProportionItem>(proportion);
|
||||
|
||||
var table = await _service.GetShopStatisticsAsync(query);
|
||||
ShopStatistics = new ObservableCollection<ShopStatisticsItem>(table);
|
||||
}
|
||||
catch (Exception ex)
|
||||
catch (Exception)
|
||||
{
|
||||
// 查询异常:保留上一次数据,并弹框提示
|
||||
BaseMsgForm.ShowError("查询失败:" + ex.Message, "提示");
|
||||
// 查询异常:保留上一次数据,可在此接入日志/错误提示
|
||||
}
|
||||
finally
|
||||
{
|
||||
@@ -337,54 +308,35 @@ namespace _29WxOrderWpf.Ctrls.Statistics.ViewModels
|
||||
|
||||
private async Task ShowOrderList(string type)
|
||||
{
|
||||
var detailType = ParseDetailType(type);
|
||||
List<ShopOrderDetailResponse> showList;
|
||||
IsLoading = true;
|
||||
try
|
||||
var query = new ShopRevenueStatisticsQuery
|
||||
{
|
||||
showList = await _service.QueryOrderRowsAsync(BuildQuery(), detailType)
|
||||
?? new List<ShopOrderDetailResponse>();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
BaseMsgForm.ShowError("订单明细查询失败:" + ex.Message, "提示");
|
||||
return;
|
||||
}
|
||||
finally
|
||||
{
|
||||
IsLoading = false;
|
||||
}
|
||||
|
||||
if (showList.Count == 0)
|
||||
{
|
||||
BaseMsgForm.ShowInfo("未查询到符合条件的订单明细。", "提示");
|
||||
return;
|
||||
}
|
||||
|
||||
new DialogWindow(GetWindow())
|
||||
{
|
||||
Title = "订单列表",
|
||||
Content = new ShowOrderDialogView(showList, detailType, _service),
|
||||
DataContext = showList
|
||||
}.Show();
|
||||
}
|
||||
|
||||
/// <summary>卡片“明细”按钮参数 → 订单明细类型(对应接口参数 OrderType)</summary>
|
||||
private static ShopOrderDetailType ParseDetailType(string type)
|
||||
{
|
||||
StartDate = StartDate,
|
||||
EndDate = EndDate,
|
||||
ShopKeys = BuildSelectedShopKeys(),
|
||||
};
|
||||
var rows = await _service.QueryRowsAsync(query);
|
||||
List<ShopRevenueStatisticsRow> showList = new List<ShopRevenueStatisticsRow>();
|
||||
switch (type)
|
||||
{
|
||||
case "ValidOrderCount":
|
||||
showList = RevenueStatisticsAggregator.GetValidOrder(rows);
|
||||
break; //有效订单
|
||||
case "RefundOrderCount":
|
||||
return ShopOrderDetailType.Refund; //退款订单
|
||||
showList = RevenueStatisticsAggregator.GetRefundOrder(rows);
|
||||
break;//退款订单
|
||||
case "BuyerRefundRemainingAmount":
|
||||
return ShopOrderDetailType.BuyerUnrefunded; //买手未退回金额的订单
|
||||
case "ProfitOrder":
|
||||
return ShopOrderDetailType.Profit; //买手未退回金额的订单
|
||||
showList = RevenueStatisticsAggregator.GetBuyerRefundRemainingOrder(rows);
|
||||
break;//待退回采购金额
|
||||
default:
|
||||
return ShopOrderDetailType.Valid; //有效订单
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public Func<Window> GetWindow;
|
||||
new DialogWindow()
|
||||
{
|
||||
Title="订单列表",
|
||||
Content = new ShowOrderDialogView(showList),
|
||||
DataContext = rows
|
||||
}.ShowDialog();
|
||||
}
|
||||
}
|
||||
}
|
||||
+53
-123
@@ -34,9 +34,8 @@
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto" />
|
||||
<ColumnDefinition Width="auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="auto" />
|
||||
<ColumnDefinition Width="auto" />
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Image
|
||||
Width="50"
|
||||
@@ -57,109 +56,48 @@
|
||||
Foreground="{StaticResource mainColorLightBrush}" />
|
||||
|
||||
<WrapPanel
|
||||
Grid.Column="2"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center">
|
||||
<Button
|
||||
x:Name="btOrderSupport"
|
||||
Click="bt_showOrderSupport"
|
||||
IsEnabled="False"
|
||||
Style="{StaticResource IconButtonStyle}"
|
||||
ToolTip="客户工单">
|
||||
<Grid Width="30" Height="30">
|
||||
<TextBlock
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="22"
|
||||
Foreground="{StaticResource mainColorLightBrush}"
|
||||
Style="{StaticResource TextBlockIcon}"
|
||||
Text="{StaticResource txt-alert}" />
|
||||
<Border
|
||||
x:Name="borderOrderSupportUnread"
|
||||
Height="16"
|
||||
MinWidth="16"
|
||||
Padding="4,0"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Top"
|
||||
d:Visibility="Visible"
|
||||
Background="#E53935"
|
||||
CornerRadius="8"
|
||||
Visibility="Collapsed">
|
||||
<TextBlock
|
||||
x:Name="tbOrderSupportUnread"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="10"
|
||||
FontWeight="Bold"
|
||||
Foreground="White"
|
||||
Text="0" />
|
||||
</Border>
|
||||
</Grid>
|
||||
</Button>
|
||||
<Border
|
||||
Width="1"
|
||||
Height="20"
|
||||
Margin="10,0"
|
||||
Background="#b893b2" />
|
||||
<Button Click="bt_setting" Style="{StaticResource IconButtonStyle}">
|
||||
<TextBlock
|
||||
FontSize="22"
|
||||
Foreground="{StaticResource mainColorLightBrush}"
|
||||
Style="{StaticResource TextBlockIcon}"
|
||||
Text="{StaticResource txt-settings}" />
|
||||
</Button>
|
||||
<Border
|
||||
Width="1"
|
||||
Height="20"
|
||||
Margin="10,0"
|
||||
Background="#b893b2" />
|
||||
</WrapPanel>
|
||||
<WrapPanel
|
||||
Grid.Column="3"
|
||||
Grid.Column="12"
|
||||
Margin="0,4,80,0"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Top">
|
||||
<Label
|
||||
x:Name="lblDebug"
|
||||
Grid.Column="4"
|
||||
Margin="2,4,0,0"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Top"
|
||||
VerticalContentAlignment="Center"
|
||||
Content="[release]"
|
||||
FontSize="12"
|
||||
Foreground="{StaticResource mainColorLightBrush}"
|
||||
Opacity="0.7" />
|
||||
<Label
|
||||
x:Name="lblVersion"
|
||||
Grid.Column="4"
|
||||
Margin="2,4,0,0"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Top"
|
||||
VerticalContentAlignment="Center"
|
||||
Content="版本信息"
|
||||
FontSize="12"
|
||||
Foreground="{StaticResource mainColorLightBrush}"
|
||||
Opacity="0.7" />
|
||||
|
||||
<UniformGrid Rows="2">
|
||||
<WrapPanel>
|
||||
<Label
|
||||
x:Name="lblDebug"
|
||||
Margin="2,4,0,0"
|
||||
Content="[release]"
|
||||
FontSize="12"
|
||||
Foreground="{StaticResource mainColorLightBrush}"
|
||||
Opacity="0.7" />
|
||||
<Label
|
||||
x:Name="lblVersion"
|
||||
Margin="2,4,0,0"
|
||||
Content="版本信息"
|
||||
FontSize="12"
|
||||
Foreground="{StaticResource mainColorLightBrush}"
|
||||
Opacity="0.7" />
|
||||
|
||||
</WrapPanel>
|
||||
<Label
|
||||
x:Name="lblBalance"
|
||||
Grid.Column="4"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Top"
|
||||
VerticalContentAlignment="Center"
|
||||
d:Content="快递余额:999.99"
|
||||
Content="{Binding Balance}"
|
||||
Cursor="Hand"
|
||||
FontSize="12"
|
||||
Foreground="#60ff66"
|
||||
MouseLeftButtonUp="lblBalance_MouseLeftButtonUp"
|
||||
Opacity="0.7" />
|
||||
</UniformGrid>
|
||||
</WrapPanel>
|
||||
|
||||
<userctrls:UcWindowBoxes
|
||||
x:Name="ucWindowBox"
|
||||
<Label
|
||||
x:Name="lblBalance"
|
||||
Grid.Column="4"
|
||||
Margin="4"
|
||||
Margin="0,25,80,0"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Top"
|
||||
MaxBoxVisibility="Visible" />
|
||||
VerticalContentAlignment="Center"
|
||||
Content="{Binding Balance}"
|
||||
Cursor="Hand"
|
||||
FontSize="12"
|
||||
Foreground="#60ff66"
|
||||
MouseLeftButtonUp="lblBalance_MouseLeftButtonUp"
|
||||
Opacity="0.7" />
|
||||
</Grid>
|
||||
<Grid
|
||||
x:Name="gridContainer"
|
||||
@@ -173,12 +111,10 @@
|
||||
<orderctrls:OrderListCtrl
|
||||
x:Name="orderListCtrl"
|
||||
Grid.Column="1"
|
||||
d:Visibility="Visible"
|
||||
Visibility="Collapsed" />
|
||||
<Grid
|
||||
x:Name="gridTbBuyerOrderReadCtrl"
|
||||
x:Name="gridPddBuyerOrderReadCtrl"
|
||||
Grid.ColumnSpan="2"
|
||||
d:Visibility="Visible"
|
||||
Background="#7F000000"
|
||||
MouseLeftButtonUp="gridPddBuyerOrderReadCtrl_MouseLeftButtonUp"
|
||||
Visibility="Hidden">
|
||||
@@ -188,33 +124,22 @@
|
||||
HorizontalAlignment="Right"
|
||||
Background="White"
|
||||
CornerRadius="10">
|
||||
<Grid>
|
||||
<buyerctrls:PDDBuyerOrderReadCtrl
|
||||
x:Name="pddBuyerOrderReadCtrl"
|
||||
Grid.Column="1"
|
||||
Width="1200"
|
||||
HorizontalAlignment="Right"
|
||||
Panel.ZIndex="-1"
|
||||
d:Visibility="Visible"
|
||||
Visibility="Collapsed" />
|
||||
<buyerctrls:TbBuyerOrderReadCtrl
|
||||
x:Name="tbBuyerOrderReadCtrl"
|
||||
Grid.Column="1"
|
||||
Width="1200"
|
||||
HorizontalAlignment="Right"
|
||||
Panel.ZIndex="-1"
|
||||
d:Visibility="Collapsed"
|
||||
Visibility="Collapsed" />
|
||||
</Grid>
|
||||
<buyerctrls:PDDBuyerOrderReadCtrl
|
||||
x:Name="pddBuyerOrderReadCtrl"
|
||||
Grid.Column="1"
|
||||
Width="1200"
|
||||
HorizontalAlignment="Right"
|
||||
Panel.ZIndex="-1"
|
||||
Visibility="Collapsed" />
|
||||
</Border>
|
||||
</Grid>
|
||||
<buyerctrls:PDDBuyerSelectCtrl
|
||||
x:Name="pddBuyerSelectCtrl"
|
||||
Grid.Column="1"
|
||||
Width="280"
|
||||
Margin="8"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Top"
|
||||
d:Visibility="Visible"
|
||||
Visibility="Collapsed" />
|
||||
<Grid
|
||||
x:Name="gridUser"
|
||||
@@ -222,8 +147,8 @@
|
||||
Background="#7F000000"
|
||||
Visibility="Hidden">
|
||||
<Border
|
||||
Width="850"
|
||||
Height="650"
|
||||
Width="500"
|
||||
Height="600"
|
||||
Background="White"
|
||||
CornerRadius="4">
|
||||
<shopctrls:ShopListCtrl
|
||||
@@ -234,7 +159,12 @@
|
||||
</Border>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
<userctrls:UcWindowBoxes
|
||||
x:Name="ucWindowBox"
|
||||
Margin="4"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Top"
|
||||
MaxBoxVisibility="Visible" />
|
||||
|
||||
<Border
|
||||
x:Name="borderMessage"
|
||||
|
||||
+317
-633
File diff suppressed because it is too large.
Load diff
@@ -7,11 +7,11 @@ using System.Windows;
|
||||
// 有关程序集的一般信息由以下
|
||||
// 控制。更改这些特性值可修改
|
||||
// 与程序集关联的信息。
|
||||
[assembly: AssemblyTitle("29供应链-微信小店订单管理")]
|
||||
[assembly: AssemblyTitle("29供应连-微信小店订单管理")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("29供应链-微信小店订单管理")]
|
||||
[assembly: AssemblyProduct("29供应连-微信小店订单管理")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2026")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace _29WxOrderWpf.Services;
|
||||
/// 礼物单服务
|
||||
///
|
||||
/// </summary>
|
||||
public class ShipGiftService : SingleInstance<ShipGiftService>
|
||||
public class ShipGiftService: SingleInstance<ShipGiftService>
|
||||
{
|
||||
public enum GiftType
|
||||
{
|
||||
@@ -42,12 +42,6 @@ public class ShipGiftService : SingleInstance<ShipGiftService>
|
||||
{
|
||||
giftAmount = 1.55m;
|
||||
}
|
||||
|
||||
if (BaseClass.Setting.AutoSwitchGiftType && (item.product_price ?? 0) > 6 * 100)
|
||||
{
|
||||
giftType = GiftType._160;
|
||||
giftAmount = 1.6m;
|
||||
}
|
||||
decimal amount = giftAmount + BaseClass.OemGiftAmount;
|
||||
|
||||
|
||||
@@ -84,6 +78,6 @@ public class ShipGiftService : SingleInstance<ShipGiftService>
|
||||
var ret = await _api.SendShipGift([orderId], (int)giftType, amount, BaseClass.OemGiftAmount);
|
||||
return ret;
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
+2
-21
@@ -1,12 +1,10 @@
|
||||
using _29WxOrderWpf.ViewModels;
|
||||
using AllBase;
|
||||
using AllBase;
|
||||
using AllBase.DouYinModel.Param.ConfigManage;
|
||||
using AllBase.Helper;
|
||||
using AllBase.Model.Config;
|
||||
using AllBase.Model.DBModel;
|
||||
using NaiBa.Util;
|
||||
using NaiBa.Util.Helper;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -23,23 +21,11 @@ namespace _29WxOrderWpf
|
||||
GlobalConfig.BuyConfig = ConfigHelper.LoadConfig<BuyConfig>("buy_config_260708");
|
||||
if (GlobalConfig.BuyConfig == null)
|
||||
GlobalConfig.BuyConfig = new BuyConfig();
|
||||
GlobalConfig.BuyConfig.IsSyncDirectBuyOrderWaybill = false;
|
||||
|
||||
GlobalConfig.lstWXShopTokenInfo = ConfigHelper.LoadConfig<ConcurrentList<WXShopTokenInfo>>("wx_shop_token_list");
|
||||
if (GlobalConfig.lstWXShopTokenInfo == null)
|
||||
GlobalConfig.lstWXShopTokenInfo = new ConcurrentList<WXShopTokenInfo>();
|
||||
|
||||
// 自动拍单支付宝密码
|
||||
var alipayPassword = ConfigHelper.LoadConfig<List<string>>("ali_pay_password")?.FirstOrDefault() ?? "";
|
||||
|
||||
GlobalConfig.AutoBuyConfig = ConfigHelper.LoadConfig<AutoBuyConfig>("auto_buy_config");
|
||||
if (GlobalConfig.AutoBuyConfig == null)
|
||||
GlobalConfig.AutoBuyConfig = new AutoBuyConfig() { AlipayPassword = alipayPassword, IsLimitMinProfit = false, MinProfit = 0 };
|
||||
|
||||
|
||||
BaseClass.Setting = NaiBa.Util.Helper.ConfigHelper.LoadConfig<SettingConfig>(SettingViewModel.SettingFileName);
|
||||
if (BaseClass.Setting == null) BaseClass.Setting = new SettingConfig();
|
||||
BaseClass.Setting.AutoSwitchGiftType = true;
|
||||
|
||||
new WxOrder.Framework.Startup();
|
||||
}
|
||||
@@ -61,12 +47,7 @@ namespace _29WxOrderWpf
|
||||
{
|
||||
BaseClass.Balance = BaseRegex.GetDecimalJson(ref html, "balance");
|
||||
MainWindow.Instance.Balance = BaseClass.Balance.ToString("0.00");
|
||||
|
||||
// 更新下每单扣费金额
|
||||
BaseClass.PostagePerOrder = Math.Max(2.2m, BaseRegex.GetDecimalJson(ref html, "postage_per_order"));
|
||||
BaseClass.RefundPostagePerOrder = Math.Max(2.5m, BaseRegex.GetDecimalJson(ref html, "refund_postage_per_order"));
|
||||
BaseClass.OemGiftAmount = BaseRegex.GetDecimalJson(ref html, "gift_oem_amount_per_order");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,41 +1,41 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<SolidColorBrush x:Key="mainColorBrush" Color="#FF98638f" />
|
||||
<SolidColorBrush x:Key="mainColorLightBrush" Color="#f5ebff" />
|
||||
<SolidColorBrush x:Key="mainColorDarkBrush" Color="#FF6b5393" />
|
||||
<SolidColorBrush x:Key="mainForegroundColorBrush" Color="#FF666666" />
|
||||
<LinearGradientBrush x:Key="mainLinearColorBrush" StartPoint="0,0" EndPoint="1,0">
|
||||
<GradientStop Offset="0.0" Color="#FF98638f" />
|
||||
<GradientStop Offset="1.0" Color="#FF6b5393" />
|
||||
</LinearGradientBrush>
|
||||
<SolidColorBrush x:Key="pageColorBrush" Color="#FF98638f" />
|
||||
<SolidColorBrush x:Key="pageColorLightBrush" Color="#f5ebff" />
|
||||
<SolidColorBrush x:Key="pageColorDarkBrush" Color="#FF6b5393" />
|
||||
<SolidColorBrush x:Key="mainColorBrush" Color="#FF98638f" />
|
||||
<SolidColorBrush x:Key="mainColorLightBrush" Color="#f5ebff" />
|
||||
<SolidColorBrush x:Key="mainColorDarkBrush" Color="#FF6b5393" />
|
||||
<SolidColorBrush x:Key="mainForegroundColorBrush" Color="#FF666666" />
|
||||
<LinearGradientBrush x:Key="mainLinearColorBrush" StartPoint="0,0" EndPoint="1,0">
|
||||
<GradientStop Offset="0.0" Color="#FF98638f" />
|
||||
<GradientStop Offset="1.0" Color="#FF6b5393" />
|
||||
</LinearGradientBrush>
|
||||
<SolidColorBrush x:Key="pageColorBrush" Color="#FF98638f" />
|
||||
<SolidColorBrush x:Key="pageColorLightBrush" Color="#f5ebff" />
|
||||
<SolidColorBrush x:Key="pageColorDarkBrush" Color="#FF6b5393" />
|
||||
|
||||
<SolidColorBrush x:Key="ListCtrlBackColorBrush" Color="#FFFFFFFF" />
|
||||
<SolidColorBrush x:Key="ListHeadBackColorBrush" Color="#FFf8f8f9" />
|
||||
<SolidColorBrush x:Key="ListHeadBorderColorBrush" Color="#FFe9e9ea" />
|
||||
<SolidColorBrush x:Key="ListBackColorBrush" Color="#FFFFFFFF" />
|
||||
<SolidColorBrush x:Key="ListRowTitleBackColorBrush" Color="#FFf5f7fa" />
|
||||
<SolidColorBrush x:Key="ListRowBorderColorBrush" Color="#FFf8f8f9" />
|
||||
<SolidColorBrush x:Key="ListRowHoverBackColorBrush" Color="#FFf5f7fa" />
|
||||
<SolidColorBrush x:Key="ListCtrlBackColorBrush" Color="#FFFFFFFF" />
|
||||
<SolidColorBrush x:Key="ListHeadBackColorBrush" Color="#FFf8f8f9" />
|
||||
<SolidColorBrush x:Key="ListHeadBorderColorBrush" Color="#FFe9e9ea" />
|
||||
<SolidColorBrush x:Key="ListBackColorBrush" Color="#FFFFFFFF" />
|
||||
<SolidColorBrush x:Key="ListRowTitleBackColorBrush" Color="#FFf5f7fa" />
|
||||
<SolidColorBrush x:Key="ListRowBorderColorBrush" Color="#FFf8f8f9" />
|
||||
<SolidColorBrush x:Key="ListRowHoverBackColorBrush" Color="#FFf5f7fa" />
|
||||
|
||||
<SolidColorBrush x:Key="HorizontalGridLinesBrush" Color="#FFf5f7fa" />
|
||||
<SolidColorBrush x:Key="VerticalGridLinesBrush" Color="#FFFFFFFF" />
|
||||
<SolidColorBrush x:Key="HorizontalGridLinesBrush" Color="#FFf5f7fa" />
|
||||
<SolidColorBrush x:Key="VerticalGridLinesBrush" Color="#FFFFFFFF" />
|
||||
|
||||
<SolidColorBrush x:Key="PageOkBrush" Color="#FF67c23a" />
|
||||
<SolidColorBrush x:Key="PageOkBrush50" Color="#5067c23a" />
|
||||
<SolidColorBrush x:Key="PageWarningBrush" Color="#FFfa4733" />
|
||||
<SolidColorBrush x:Key="PageWarningBrushCC" Color="#CCfa4733" />
|
||||
<SolidColorBrush x:Key="PageWarningBrush80" Color="#80fa4733" />
|
||||
<SolidColorBrush x:Key="PageWarningBrush50" Color="#50fa4733" />
|
||||
<SolidColorBrush x:Key="PageWarningBrush20" Color="#20fa4733" />
|
||||
<SolidColorBrush x:Key="PageLinkBrush" Color="#409eff" />
|
||||
<SolidColorBrush x:Key="PageOkBrush" Color="#FF67c23a" />
|
||||
<SolidColorBrush x:Key="PageOkBrush50" Color="#5067c23a" />
|
||||
<SolidColorBrush x:Key="PageWarningBrush" Color="#FFfa4733" />
|
||||
<SolidColorBrush x:Key="PageWarningBrushCC" Color="#CCfa4733" />
|
||||
<SolidColorBrush x:Key="PageWarningBrush80" Color="#80fa4733" />
|
||||
<SolidColorBrush x:Key="PageWarningBrush50" Color="#50fa4733" />
|
||||
<SolidColorBrush x:Key="PageWarningBrush20" Color="#20fa4733" />
|
||||
<SolidColorBrush x:Key="PageLinkBrush" Color="#409eff" />
|
||||
|
||||
|
||||
<SolidColorBrush x:Key="FlagGrayBrush" Color="#ffaaaaaa" />
|
||||
<SolidColorBrush x:Key="FlagRedBrush" Color="#FFfa4733" />
|
||||
<SolidColorBrush x:Key="FlagOrangeBrush" Color="#FFfab533" />
|
||||
<SolidColorBrush x:Key="FlagGreenBrush" Color="#FF67c23a" />
|
||||
<SolidColorBrush x:Key="FlagBlueBrush" Color="#409eff" />
|
||||
<SolidColorBrush x:Key="FlagPurpleBrush" Color="#FFc883bf" />
|
||||
<SolidColorBrush x:Key="FlagGrayBrush" Color="#ffaaaaaa" />
|
||||
<SolidColorBrush x:Key="FlagRedBrush" Color="#FFfa4733" />
|
||||
<SolidColorBrush x:Key="FlagOrangeBrush" Color="#FFfab533" />
|
||||
<SolidColorBrush x:Key="FlagGreenBrush" Color="#FF67c23a" />
|
||||
<SolidColorBrush x:Key="FlagBlueBrush" Color="#409eff" />
|
||||
<SolidColorBrush x:Key="FlagPurpleBrush" Color="#FFc883bf" />
|
||||
</ResourceDictionary>
|
||||
@@ -1,197 +0,0 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<!-- ========== 侧边 TabControl ========== -->
|
||||
<Style x:Key="SideTabControl" TargetType="TabControl">
|
||||
<Setter Property="Background" Value="White" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="TabControl">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="120" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!-- 左侧导航 -->
|
||||
<Border
|
||||
Grid.Column="0"
|
||||
Background="#F7F8FA"
|
||||
BorderBrush="#E8EAED"
|
||||
BorderThickness="0,0,1,0">
|
||||
<ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto">
|
||||
<StackPanel Margin="0,12">
|
||||
<TextBlock
|
||||
Margin="20,8,0,16"
|
||||
FontSize="20"
|
||||
FontWeight="Bold"
|
||||
Foreground="{StaticResource mainColorBrush}"
|
||||
Text="设置" />
|
||||
<TabPanel IsItemsHost="True" />
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
</Border>
|
||||
|
||||
<!-- 右侧内容 -->
|
||||
<ScrollViewer
|
||||
Grid.Column="1"
|
||||
Padding="0"
|
||||
VerticalScrollBarVisibility="Auto">
|
||||
<ContentPresenter ContentSource="SelectedContent" />
|
||||
</ScrollViewer>
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<!-- ========== 侧边 TabItem ========== -->
|
||||
<Style x:Key="SideTabItem" TargetType="TabItem">
|
||||
|
||||
<Setter Property="Cursor" Value="Hand" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="TabItem">
|
||||
<Border
|
||||
x:Name="Bd"
|
||||
Margin="0,2"
|
||||
Padding="12,10"
|
||||
Background="Transparent">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<TextBlock
|
||||
x:Name="Icon"
|
||||
Grid.Column="0"
|
||||
Margin="0,0,12,0"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="22"
|
||||
Foreground="{StaticResource mainColorBrush}"
|
||||
Style="{StaticResource TextBlockIcon}"
|
||||
Text="{TemplateBinding Tag}" />
|
||||
|
||||
|
||||
<!-- 只给 Header 文字设字号/颜色 -->
|
||||
<ContentPresenter
|
||||
x:Name="HeaderHost"
|
||||
Grid.Column="1"
|
||||
VerticalAlignment="Center"
|
||||
ContentSource="Header"
|
||||
TextElement.FontSize="14"
|
||||
TextElement.FontWeight="Normal"
|
||||
TextElement.Foreground="{StaticResource mainColorBrush}" />
|
||||
|
||||
<!-- 选中时的右侧小圆点 -->
|
||||
<Ellipse
|
||||
x:Name="Dot"
|
||||
Grid.Column="2"
|
||||
Width="6"
|
||||
Height="6"
|
||||
VerticalAlignment="Center"
|
||||
Fill="#0078D4"
|
||||
Visibility="Collapsed" />
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter TargetName="Bd" Property="Background" Value="#ECEEF2" />
|
||||
</Trigger>
|
||||
<Trigger Property="IsSelected" Value="True">
|
||||
<Setter TargetName="Bd" Property="Background" Value="#E6F0FB" />
|
||||
<Setter TargetName="Dot" Property="Visibility" Value="Visible" />
|
||||
<Setter TargetName="HeaderHost" Property="TextElement.Foreground" Value="{StaticResource mainColorBrush}" />
|
||||
<Setter TargetName="HeaderHost" Property="TextElement.FontWeight" Value="SemiBold" />
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<!-- ========== 设置卡片 ========== -->
|
||||
<Style x:Key="SettingsCard" TargetType="Border">
|
||||
<Setter Property="Background" Value="White" />
|
||||
<Setter Property="BorderBrush" Value="#E8EAED" />
|
||||
<Setter Property="BorderThickness" Value="1" />
|
||||
<Setter Property="CornerRadius" Value="8" />
|
||||
<Setter Property="Padding" Value="0" />
|
||||
<Setter Property="Margin" Value="0,0,0,16" />
|
||||
</Style>
|
||||
|
||||
<!-- ========== 设置项行 ========== -->
|
||||
<Style x:Key="SettingRow" TargetType="Border">
|
||||
<Setter Property="Padding" Value="16,14" />
|
||||
<Setter Property="BorderBrush" Value="#F0F1F3" />
|
||||
<Setter Property="BorderThickness" Value="0,0,0,1" />
|
||||
</Style>
|
||||
|
||||
<!-- ========== 设置项标题 ========== -->
|
||||
<Style x:Key="SettingTitle" TargetType="TextBlock">
|
||||
<Setter Property="FontSize" Value="14" />
|
||||
<Setter Property="Foreground" Value="#1F2329" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
</Style>
|
||||
|
||||
<!-- ========== 设置项说明 ========== -->
|
||||
<Style x:Key="SettingDesc" TargetType="TextBlock">
|
||||
<Setter Property="FontSize" Value="12" />
|
||||
<Setter Property="Foreground" Value="#8A9099" />
|
||||
<Setter Property="Margin" Value="0,4,0,0" />
|
||||
<Setter Property="TextWrapping" Value="Wrap" />
|
||||
</Style>
|
||||
|
||||
<!-- ========== 页面标题 ========== -->
|
||||
<Style x:Key="PageTitle" TargetType="TextBlock">
|
||||
<Setter Property="FontSize" Value="22" />
|
||||
<Setter Property="FontWeight" Value="Bold" />
|
||||
<Setter Property="Foreground" Value="#1F2329" />
|
||||
<Setter Property="Margin" Value="0,0,0,4" />
|
||||
</Style>
|
||||
|
||||
<Style x:Key="PageSubtitle" TargetType="TextBlock">
|
||||
<Setter Property="FontSize" Value="13" />
|
||||
<Setter Property="Foreground" Value="#8A9099" />
|
||||
<Setter Property="Margin" Value="0,0,0,24" />
|
||||
</Style>
|
||||
|
||||
<!-- ========== 开关样式 ========== -->
|
||||
<Style x:Key="ToggleSwitch" TargetType="CheckBox">
|
||||
<Setter Property="Width" Value="44" />
|
||||
<Setter Property="Height" Value="24" />
|
||||
<Setter Property="Cursor" Value="Hand" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="CheckBox">
|
||||
<Border
|
||||
x:Name="Track"
|
||||
Width="44"
|
||||
Height="24"
|
||||
Background="#D0D3D8"
|
||||
CornerRadius="12">
|
||||
<Ellipse
|
||||
x:Name="Thumb"
|
||||
Width="18"
|
||||
Height="18"
|
||||
Margin="3,0,0,0"
|
||||
HorizontalAlignment="Left"
|
||||
Fill="White" />
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsChecked" Value="True">
|
||||
<Setter TargetName="Track" Property="Background" Value="#0078D4" />
|
||||
<Setter TargetName="Thumb" Property="HorizontalAlignment" Value="Right" />
|
||||
<Setter TargetName="Thumb" Property="Margin" Value="0,0,3,0" />
|
||||
</Trigger>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter TargetName="Track" Property="Opacity" Value="0.9" />
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
||||
@@ -1,37 +1,21 @@
|
||||
<UserControl
|
||||
x:Class="_29WxOrderWpf.UserControls.UcWaterMarkTextBox"
|
||||
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:local="clr-namespace:_29WxOrderWpf.UserControls"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
d:DesignHeight="28"
|
||||
d:DesignWidth="100"
|
||||
mc:Ignorable="d">
|
||||
<UserControl.Resources>
|
||||
<ResourceDictionary>
|
||||
<local:WaterMarkVisibilityConverter x:Key="WaterMarkVisibility" />
|
||||
</ResourceDictionary>
|
||||
</UserControl.Resources>
|
||||
<Grid>
|
||||
<TextBox
|
||||
x:Name="txt"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"
|
||||
VerticalContentAlignment="Center"
|
||||
BorderBrush="{StaticResource pageColorBrush}"
|
||||
BorderThickness="{Binding TextBorderThickness}"
|
||||
Style="{StaticResource BaseRoundCornerTextBoxStyle}"
|
||||
Text="{Binding Text, Mode=TwoWay}"
|
||||
TextChanged="txt_TextChanged"
|
||||
TextWrapping="{Binding TextWrapping}" />
|
||||
<TextBlock
|
||||
x:Name="tbWaterMark"
|
||||
Margin="4,0,4,0"
|
||||
VerticalAlignment="Center"
|
||||
Foreground="DarkGray"
|
||||
IsHitTestVisible="False"
|
||||
Text="{Binding WaterMark}"
|
||||
Visibility="{Binding ElementName=txt, Path=Text, Converter={StaticResource WaterMarkVisibility}}" />
|
||||
</Grid>
|
||||
<UserControl x:Class="_29WxOrderWpf.UserControls.UcWaterMarkTextBox"
|
||||
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:_29WxOrderWpf.UserControls"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="28" d:DesignWidth="100">
|
||||
<UserControl.Resources>
|
||||
<ResourceDictionary>
|
||||
<local:WaterMarkVisibilityConverter x:Key="WaterMarkVisibility"/>
|
||||
</ResourceDictionary>
|
||||
</UserControl.Resources>
|
||||
<Grid>
|
||||
<TextBox x:Name="txt" Text="{Binding Text, Mode=TwoWay}" Style="{StaticResource BaseRoundCornerTextBoxStyle}" BorderBrush="{StaticResource pageColorBrush}"
|
||||
BorderThickness="{Binding TextBorderThickness}"
|
||||
HorizontalAlignment="Stretch" VerticalAlignment="Stretch" VerticalContentAlignment="Center" TextWrapping="{Binding TextWrapping}" TextChanged="txt_TextChanged"/>
|
||||
<TextBlock x:Name="tbWaterMark" Text="{Binding WaterMark}" Margin="4,0,4,0" VerticalAlignment="Center" IsHitTestVisible="False" Foreground="DarkGray"
|
||||
Visibility="{Binding ElementName=txt,Path=Text,Converter={StaticResource WaterMarkVisibility}}"></TextBlock>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -1,99 +1,55 @@
|
||||
<UserControl
|
||||
x:Class="_29WxOrderWpf.UserControls.UcWindowBoxes"
|
||||
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:local="clr-namespace:_29WxOrderWpf.UserControls"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
Width="Auto"
|
||||
Height="Auto"
|
||||
d:DesignHeight="30"
|
||||
d:DesignWidth="60"
|
||||
Background="Transparent"
|
||||
Loaded="WindowBoxes_Loaded"
|
||||
mc:Ignorable="d">
|
||||
<Grid Background="Transparent">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<UserControl x:Class="_29WxOrderWpf.UserControls.UcWindowBoxes"
|
||||
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:_29WxOrderWpf.UserControls"
|
||||
mc:Ignorable="d" Width="Auto" Height="Auto"
|
||||
d:DesignHeight="30" d:DesignWidth="60" Background="Transparent" Loaded="WindowBoxes_Loaded">
|
||||
<Grid Background="Transparent">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"></ColumnDefinition>
|
||||
<ColumnDefinition Width="Auto"></ColumnDefinition>
|
||||
<ColumnDefinition Width="Auto"></ColumnDefinition>
|
||||
<ColumnDefinition Width="Auto"></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!--<Border Background="{StaticResource imgBrushCloseHover}" Width="17" Height="17" Margin="4">
|
||||
<!--<Border Background="{StaticResource imgBrushCloseHover}" Width="17" Height="17" Margin="4">
|
||||
</Border>
|
||||
<Border Grid.Column="1" Width="17" Height="17" Margin="4">
|
||||
<Image Source="{StaticResource imgCloseHover}"/>
|
||||
</Border>-->
|
||||
|
||||
<!-- 不使用静态资源,在用户控件嵌套时,会发生预览错误 -->
|
||||
<local:UcImageButton
|
||||
x:Name="btnMin"
|
||||
Grid.Column="0"
|
||||
Width="17"
|
||||
Height="17"
|
||||
Margin="4"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
ButtonImage="{StaticResource imgMin}"
|
||||
MouseOverButtonImage="{StaticResource imgMinHover}"
|
||||
MousePressButtonImage="{StaticResource imgMinHover}" />
|
||||
<local:UcImageButton
|
||||
x:Name="btnMax"
|
||||
Grid.Column="1"
|
||||
Width="17"
|
||||
Height="17"
|
||||
Margin="4"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
ButtonImage="{StaticResource imgMax}"
|
||||
MouseOverButtonImage="{StaticResource imgMaxHover}"
|
||||
MousePressButtonImage="{StaticResource imgMaxHover}"
|
||||
Visibility="Collapsed" />
|
||||
<local:UcImageButton
|
||||
x:Name="btnNormal"
|
||||
Grid.Column="2"
|
||||
Width="17"
|
||||
Height="17"
|
||||
Margin="4"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
ButtonImage="{StaticResource imgNormal}"
|
||||
MouseOverButtonImage="{StaticResource imgNormalHover}"
|
||||
MousePressButtonImage="{StaticResource imgNormalHover}"
|
||||
Visibility="Collapsed" />
|
||||
<local:UcImageButton
|
||||
x:Name="btnClose"
|
||||
Grid.Column="3"
|
||||
Width="17"
|
||||
Height="17"
|
||||
Margin="4"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
ButtonImage="{StaticResource imgClose}"
|
||||
MouseOverButtonImage="{StaticResource imgCloseHover}"
|
||||
MousePressButtonImage="{StaticResource imgCloseHover}" />
|
||||
<!--不使用静态资源,在用户控件嵌套时,会发生预览错误-->
|
||||
<local:UcImageButton x:Name="btnMin" Grid.Column="0" Width="17" Height="17" Background="Transparent" BorderThickness="0" Margin="4"
|
||||
ButtonImage="{StaticResource imgMin}" MouseOverButtonImage="{StaticResource imgMinHover}" MousePressButtonImage="{StaticResource imgMinHover}"/>
|
||||
<local:UcImageButton x:Name="btnMax" Grid.Column="1" Width="17" Height="17" Background="Transparent" BorderThickness="0" Visibility="Collapsed" Margin="4"
|
||||
ButtonImage="{StaticResource imgMax}" MouseOverButtonImage="{StaticResource imgMaxHover}" MousePressButtonImage="{StaticResource imgMaxHover}"/>
|
||||
<local:UcImageButton x:Name="btnNormal" Grid.Column="2" Width="17" Height="17" Background="Transparent" BorderThickness="0" Visibility="Collapsed" Margin="4"
|
||||
ButtonImage="{StaticResource imgNormal}" MouseOverButtonImage="{StaticResource imgNormalHover}" MousePressButtonImage="{StaticResource imgNormalHover}"/>
|
||||
<local:UcImageButton x:Name="btnClose" Grid.Column="3" Width="17" Height="17" Background="Transparent" BorderThickness="0" Margin="4"
|
||||
ButtonImage="{StaticResource imgClose}" MouseOverButtonImage="{StaticResource imgCloseHover}" MousePressButtonImage="{StaticResource imgCloseHover}"/>
|
||||
|
||||
|
||||
<!--<local:UcImageButton x:Name="btnMin" Grid.Column="0" Width="17" Height="17" Background="Transparent" BorderThickness="0" Margin="4"
|
||||
ButtonImage="/Resources/WindowBoxes/min.png"
|
||||
<!--<local:UcImageButton x:Name="btnMin" Grid.Column="0" Width="17" Height="17" Background="Transparent" BorderThickness="0" Margin="4"
|
||||
ButtonImage="/Resources/WindowBoxes/min.png"
|
||||
MouseOverButtonImage="/Resources/WindowBoxes/min.hover.png"
|
||||
MousePressButtonImage="/Resources/WindowBoxes/min.hover.png" />
|
||||
<local:UcImageButton x:Name="btnMax" Grid.Column="1" Width="17" Height="17" Background="Transparent" BorderThickness="0" Visibility="Collapsed" Margin="4"
|
||||
ButtonImage="/Resources/WindowBoxes/max.png"
|
||||
ButtonImage="/Resources/WindowBoxes/max.png"
|
||||
MouseOverButtonImage="/Resources/WindowBoxes/max.hover.png"
|
||||
MousePressButtonImage="/Resources/WindowBoxes/max.hover.png" />
|
||||
<local:UcImageButton x:Name="btnNormal" Grid.Column="2" Width="17" Height="17" Background="Transparent" BorderThickness="0" Visibility="Collapsed" Margin="4"
|
||||
ButtonImage="/Resources/WindowBoxes/normal.png"
|
||||
ButtonImage="/Resources/WindowBoxes/normal.png"
|
||||
MouseOverButtonImage="/Resources/WindowBoxes/normal.hover.png"
|
||||
MousePressButtonImage="/Resources/WindowBoxes/normal.hover.png" />
|
||||
<local:UcImageButton x:Name="btnClose" Grid.Column="3" Width="17" Height="17" Background="Transparent" BorderThickness="0" Margin="4"
|
||||
ButtonImage="/Resources/WindowBoxes/close.png"
|
||||
ButtonImage="/Resources/WindowBoxes/close.png"
|
||||
MouseOverButtonImage="/Resources/WindowBoxes/close.hover.png"
|
||||
MousePressButtonImage="/Resources/WindowBoxes/close.hover.png" />-->
|
||||
|
||||
|
||||
|
||||
<!--<Button x:Name="btnMin" Grid.Column="0" Width="17" Height="17" Background="Transparent" BorderThickness="0" Margin="4">
|
||||
<!--<Button x:Name="btnMin" Grid.Column="0" Width="17" Height="17" Background="Transparent" BorderThickness="0" Margin="4">
|
||||
<Border>
|
||||
<Grid>
|
||||
<Image Source="/Resources/WindowBoxes/min.png" Stretch="Uniform"/>
|
||||
@@ -125,5 +81,5 @@
|
||||
</Grid>
|
||||
</Border>
|
||||
</Button>-->
|
||||
</Grid>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
Loaded 100 of 378 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user