Compare commits
182
Commits
增加框架
..
fd0ff6771f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fd0ff6771f | ||
|
|
e96871a87a | ||
|
|
e04e4e5108 | ||
|
|
06e6fe89bc | ||
|
|
c868460cd7 | ||
|
|
7eea26cdda | ||
|
|
e4b1a24ddb | ||
|
|
b74e4598a7 | ||
|
|
c999a80048 | ||
|
|
1b0aa81263 | ||
|
|
8e0cc20649 | ||
|
|
7982f7e348 | ||
|
|
17728c074c | ||
|
|
1d4867ebf2 | ||
|
|
eb6b1c5651 | ||
|
|
bbac29ac78 | ||
|
|
cf15ef194f | ||
|
|
a217a74868 | ||
|
|
3d86e986b0 | ||
|
|
aad92e8f8e | ||
|
|
d3488c98f5 | ||
|
|
fe87aece4e | ||
|
|
10bb0803d9 | ||
|
|
4ed7346aa8 | ||
|
|
7df2cc0957 | ||
|
|
a786ba6ce9 | ||
|
|
41b240c066 | ||
|
|
b6b4693c86 | ||
|
|
7c5f083784 | ||
|
|
52b1e9eb90 | ||
|
|
06e45bf587 | ||
|
|
bd3bde553b | ||
|
|
41b12d1284 | ||
|
|
f9dcae4610 | ||
|
|
dc136e449e | ||
|
|
1eb5315261 | ||
|
|
b827c6e118 | ||
|
|
2f9c98b105 | ||
|
|
1509e0a11d | ||
|
|
c83521f36d | ||
|
|
e00cf2d573 | ||
|
|
2465b38e65 | ||
|
|
abca4c996b | ||
|
|
ebccdbc28c | ||
|
|
b2d6d81e07 | ||
|
|
9cca38beff | ||
|
|
75aae91b66 | ||
|
|
e71ef72475 | ||
|
|
a89adafe61 | ||
|
|
9626bc8d8c | ||
|
|
e7d22984df | ||
|
|
912837a84b | ||
|
|
a81ba26de8 | ||
|
|
ea14ad3af4 | ||
|
|
e0dead1b6d | ||
|
|
18a4373918 | ||
|
|
4873b6cdd5 | ||
|
|
79ad130fde | ||
|
|
a27f6cb33c | ||
|
|
89299d3e3a | ||
|
|
84a484a568 | ||
|
|
0f850b8840 | ||
|
|
4a4d9d7dfb | ||
|
|
0244865ace | ||
|
|
c4363d0ac9 | ||
|
|
ade92facab | ||
|
|
41fa98dc2d | ||
|
|
6b36de2494 | ||
|
|
4e122fce6e | ||
|
|
5fb42e4d34 | ||
|
|
60b1088e55 | ||
|
|
064bd1f142 | ||
|
|
dd512a0dcb | ||
|
|
74e59b4892 | ||
|
|
a01e938055 | ||
|
|
66d4d67374 | ||
|
|
28c112794d | ||
|
|
b84ccc4670 | ||
|
|
e3c91177f6 | ||
|
|
77843a54f6 | ||
|
|
cc0904c728 | ||
|
|
10ae4c0cf9 | ||
|
|
eeee1affd3 | ||
|
|
a4802f4ba1 | ||
|
|
92fc8cf5b8 | ||
|
|
890c0a6a11 | ||
|
|
8d4d3157a2 | ||
|
|
87a0d34526 | ||
|
|
88846e401b | ||
|
|
1ed9d72815 | ||
|
|
8431a8f6b0 | ||
|
|
a46d0f6c9a | ||
|
|
9d0646805d | ||
|
|
da4f20ef3b | ||
|
|
03f71a5d64 | ||
|
|
b1e03ddbb1 | ||
|
|
d706384253 | ||
|
|
7dbecfa764 | ||
|
|
26f2fb9fd2 | ||
|
|
c11dda0341 | ||
|
|
f7c1d7967b | ||
|
|
5003ea93f8 | ||
|
|
d18460c83f | ||
|
|
1c005f6021 | ||
|
|
c993e00f15 | ||
|
|
0bd3233fdf | ||
|
|
37cb8e86ae | ||
|
|
0b47a16eb9 | ||
|
|
d109a90302 | ||
|
|
f27ddca730 | ||
|
|
080fc7e4c4 | ||
|
|
d2a91db5e4 | ||
|
|
b5b2693990 | ||
|
|
040fe6ff52 | ||
|
|
2f1de60845 | ||
|
|
259b8027d3 | ||
|
|
abb2759bdf | ||
|
|
d9c0749093 | ||
|
|
e1e118cc61 | ||
|
|
064d360de7 | ||
|
|
661f8c052e | ||
|
|
02294e0ef6 | ||
|
|
e1d940fa8c | ||
|
|
ce8fb3f311 | ||
|
|
78ef8eedf3 | ||
|
|
97278249ae | ||
|
|
59e427fd47 | ||
|
|
fbedea9188 | ||
|
|
86d30e57d1 | ||
|
|
32976d41cd | ||
|
|
d8064b95ef | ||
|
|
a9685e228c | ||
|
|
068ede88e0 | ||
|
|
8e747f8e18 | ||
|
|
ec02e2a0e4 | ||
|
|
107bf82f97 | ||
|
|
9e62672013 | ||
|
|
44b4971861 | ||
|
|
4344c8fd51 | ||
|
|
db6774dbda | ||
|
|
43d5761ce5 | ||
|
|
657786bbe7 | ||
|
|
f3fa093709 | ||
|
|
394f5cbf54 | ||
|
|
cbacc242db | ||
|
|
d8e10993d6 | ||
|
|
f3ec329e77 | ||
|
|
05099584c8 | ||
|
|
010de0c16b | ||
|
|
9ce8c6e6bc | ||
|
|
1b634434c2 | ||
|
|
c25ec3a89a | ||
|
|
e755da09a6 | ||
|
|
5906a1623f | ||
|
|
b42c17c013 | ||
|
|
330ccf3983 | ||
|
|
786697c5a6 | ||
|
|
dd5b526fd2 | ||
|
|
a287994b31 | ||
|
|
b03753e0cf | ||
|
|
b2d91563ed | ||
|
|
3579fac394 | ||
|
|
c0e3b998ac | ||
|
|
580afd1331 | ||
|
|
df340c920a | ||
|
|
a275ac8333 | ||
|
|
7a4dba5cd8 | ||
|
|
599b74a880 | ||
|
|
1d99df85fe | ||
|
|
e521eee8df | ||
|
|
b68a07f03a | ||
|
|
7e8ac20bb1 | ||
|
|
d1bcdc9815 | ||
|
|
8e33d095f3 | ||
|
|
ec4d8073b3 | ||
|
|
99c1fe83ef | ||
|
|
a2aa257c29 | ||
|
|
5528d82d43 | ||
|
|
8d9ed2f451 | ||
|
|
a5d049da81 | ||
|
|
20bfd2c22c | ||
|
|
0eae9f7706 |
No files matched your search
+19
-93
@@ -17,7 +17,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_SolutionItems", "_Solution
|
|||||||
ProjectSection(SolutionItems) = preProject
|
ProjectSection(SolutionItems) = preProject
|
||||||
.editorconfig = .editorconfig
|
.editorconfig = .editorconfig
|
||||||
.gitignore = .gitignore
|
.gitignore = .gitignore
|
||||||
Directory.Build.props = Directory.Build.props
|
|
||||||
EndProjectSection
|
EndProjectSection
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WxOrder.Framework", "WxOrder.Framework\WxOrder.Framework.csproj", "{3123963C-A0EC-4AD5-9916-DC063F73490B}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WxOrder.Framework", "WxOrder.Framework\WxOrder.Framework.csproj", "{3123963C-A0EC-4AD5-9916-DC063F73490B}"
|
||||||
@@ -26,15 +25,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".test", ".test", "{14261B9B
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WXOrder.Test", "test\WXOrder.Test\WXOrder.Test.csproj", "{3790EC79-EA1D-4660-AB0D-EA0DE4FF77B7}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WXOrder.Test", "test\WXOrder.Test\WXOrder.Test.csproj", "{3790EC79-EA1D-4660-AB0D-EA0DE4FF77B7}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Trade.Client", "Source\Trade.Client\Trade.Client.csproj", "{BCABF48D-183D-A66F-33B6-B865CC0AD623}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OrderSupportTicket", "OrderSupportTicket\OrderSupportTicket.csproj", "{22D31944-2087-437A-B374-C0874E9EC53A}"
|
||||||
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
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
@@ -84,8 +75,8 @@ Global
|
|||||||
{5A410EB5-06AD-97BB-2314-9D7A808E12F7}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{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.ActiveCfg = Debug|Any CPU
|
||||||
{5A410EB5-06AD-97BB-2314-9D7A808E12F7}.Debug|Mixed Platforms.Build.0 = 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|Any CPU
|
{5A410EB5-06AD-97BB-2314-9D7A808E12F7}.Debug|x64.ActiveCfg = Debug|x64
|
||||||
{5A410EB5-06AD-97BB-2314-9D7A808E12F7}.Debug|x64.Build.0 = Debug|Any CPU
|
{5A410EB5-06AD-97BB-2314-9D7A808E12F7}.Debug|x64.Build.0 = Debug|x64
|
||||||
{5A410EB5-06AD-97BB-2314-9D7A808E12F7}.Debug|x86.ActiveCfg = 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}.Debug|x86.Build.0 = Debug|Any CPU
|
||||||
{5A410EB5-06AD-97BB-2314-9D7A808E12F7}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{5A410EB5-06AD-97BB-2314-9D7A808E12F7}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
@@ -128,86 +119,22 @@ Global
|
|||||||
{3790EC79-EA1D-4660-AB0D-EA0DE4FF77B7}.Release|x64.Build.0 = Release|Any CPU
|
{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.ActiveCfg = Release|Any CPU
|
||||||
{3790EC79-EA1D-4660-AB0D-EA0DE4FF77B7}.Release|x86.Build.0 = Release|Any CPU
|
{3790EC79-EA1D-4660-AB0D-EA0DE4FF77B7}.Release|x86.Build.0 = Release|Any CPU
|
||||||
{BCABF48D-183D-A66F-33B6-B865CC0AD623}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{22D31944-2087-437A-B374-C0874E9EC53A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{BCABF48D-183D-A66F-33B6-B865CC0AD623}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{22D31944-2087-437A-B374-C0874E9EC53A}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{BCABF48D-183D-A66F-33B6-B865CC0AD623}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
{22D31944-2087-437A-B374-C0874E9EC53A}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||||
{BCABF48D-183D-A66F-33B6-B865CC0AD623}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
{22D31944-2087-437A-B374-C0874E9EC53A}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||||
{BCABF48D-183D-A66F-33B6-B865CC0AD623}.Debug|x64.ActiveCfg = Debug|Any CPU
|
{22D31944-2087-437A-B374-C0874E9EC53A}.Debug|x64.ActiveCfg = Debug|x64
|
||||||
{BCABF48D-183D-A66F-33B6-B865CC0AD623}.Debug|x64.Build.0 = Debug|Any CPU
|
{22D31944-2087-437A-B374-C0874E9EC53A}.Debug|x64.Build.0 = Debug|x64
|
||||||
{BCABF48D-183D-A66F-33B6-B865CC0AD623}.Debug|x86.ActiveCfg = Debug|Any CPU
|
{22D31944-2087-437A-B374-C0874E9EC53A}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||||
{BCABF48D-183D-A66F-33B6-B865CC0AD623}.Debug|x86.Build.0 = Debug|Any CPU
|
{22D31944-2087-437A-B374-C0874E9EC53A}.Debug|x86.Build.0 = Debug|Any CPU
|
||||||
{BCABF48D-183D-A66F-33B6-B865CC0AD623}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{22D31944-2087-437A-B374-C0874E9EC53A}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{BCABF48D-183D-A66F-33B6-B865CC0AD623}.Release|Any CPU.Build.0 = Release|Any CPU
|
{22D31944-2087-437A-B374-C0874E9EC53A}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{BCABF48D-183D-A66F-33B6-B865CC0AD623}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
{22D31944-2087-437A-B374-C0874E9EC53A}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||||
{BCABF48D-183D-A66F-33B6-B865CC0AD623}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
{22D31944-2087-437A-B374-C0874E9EC53A}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||||
{BCABF48D-183D-A66F-33B6-B865CC0AD623}.Release|x64.ActiveCfg = Release|Any CPU
|
{22D31944-2087-437A-B374-C0874E9EC53A}.Release|x64.ActiveCfg = Release|Any CPU
|
||||||
{BCABF48D-183D-A66F-33B6-B865CC0AD623}.Release|x64.Build.0 = Release|Any CPU
|
{22D31944-2087-437A-B374-C0874E9EC53A}.Release|x64.Build.0 = Release|Any CPU
|
||||||
{BCABF48D-183D-A66F-33B6-B865CC0AD623}.Release|x86.ActiveCfg = Release|Any CPU
|
{22D31944-2087-437A-B374-C0874E9EC53A}.Release|x86.ActiveCfg = Release|Any CPU
|
||||||
{BCABF48D-183D-A66F-33B6-B865CC0AD623}.Release|x86.Build.0 = Release|Any CPU
|
{22D31944-2087-437A-B374-C0874E9EC53A}.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
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
@@ -217,7 +144,6 @@ Global
|
|||||||
{1AD45D66-6872-4522-ACF0-04E2C0514048} = {4A54DC2A-B47C-4ED1-A482-EE60161DB2C3}
|
{1AD45D66-6872-4522-ACF0-04E2C0514048} = {4A54DC2A-B47C-4ED1-A482-EE60161DB2C3}
|
||||||
{5A410EB5-06AD-97BB-2314-9D7A808E12F7} = {1A7830FA-AC8F-40FB-A232-F0626812B8BE}
|
{5A410EB5-06AD-97BB-2314-9D7A808E12F7} = {1A7830FA-AC8F-40FB-A232-F0626812B8BE}
|
||||||
{3790EC79-EA1D-4660-AB0D-EA0DE4FF77B7} = {14261B9B-E3EA-4BC0-B08D-4B3591AC13E5}
|
{3790EC79-EA1D-4660-AB0D-EA0DE4FF77B7} = {14261B9B-E3EA-4BC0-B08D-4B3591AC13E5}
|
||||||
{890E871A-F6E7-42DA-85D5-3BF2F8ECAEDF} = {14261B9B-E3EA-4BC0-B08D-4B3591AC13E5}
|
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
SolutionGuid = {38687A61-0347-49AC-98C7-E7F7148C0234}
|
SolutionGuid = {38687A61-0347-49AC-98C7-E7F7148C0234}
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
<OutputPath>..\bin\</OutputPath>
|
<OutputPath>..\bin\</OutputPath>
|
||||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||||
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
|
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
|
||||||
|
<Platforms>AnyCPU;x64</Platforms>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
|
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
|
||||||
@@ -37,6 +38,7 @@
|
|||||||
<Reference Include="System.Data" />
|
<Reference Include="System.Data" />
|
||||||
<Reference Include="System.Data.DataSetExtensions" />
|
<Reference Include="System.Data.DataSetExtensions" />
|
||||||
<Reference Include="System.Drawing" />
|
<Reference Include="System.Drawing" />
|
||||||
|
<Reference Include="System.Management" />
|
||||||
<Reference Include="System.Net.Http" />
|
<Reference Include="System.Net.Http" />
|
||||||
<Reference Include="System.Windows.Forms" />
|
<Reference Include="System.Windows.Forms" />
|
||||||
<Reference Include="System.Xml" />
|
<Reference Include="System.Xml" />
|
||||||
@@ -57,6 +59,7 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\AllBase\29WxOrderAllBase.csproj" />
|
<ProjectReference Include="..\AllBase\29WxOrderAllBase.csproj" />
|
||||||
|
<ProjectReference Include="..\OrderSupportTicket\OrderSupportTicket.csproj" />
|
||||||
<ProjectReference Include="..\Work\29WxOrderWork.csproj" />
|
<ProjectReference Include="..\Work\29WxOrderWork.csproj" />
|
||||||
<ProjectReference Include="..\WxOrder.Framework\WxOrder.Framework.csproj" />
|
<ProjectReference Include="..\WxOrder.Framework\WxOrder.Framework.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
@@ -65,10 +68,24 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Resource Include="Resources\**\*" />
|
<Resource Include="Resources\**\*" />
|
||||||
<None Remove="Ctrls\PDDInvoice\Resources\invoice.js" />
|
<None Remove="Ctrls\PDDInvoice\Resources\invoice.js" />
|
||||||
|
<None Remove="Ctrls\PDDInvoice\Resources\order.js" />
|
||||||
<Resource Include="29wx.ico" />
|
<Resource Include="29wx.ico" />
|
||||||
<Resource Include="29_common_icon.ico" />
|
<Resource Include="29_common_icon.ico" />
|
||||||
|
<Resource Include="Ctrls\OrderCtrls\Resources\tbAutoAddress.js" />
|
||||||
<Resource Include="Ctrls\PDDInvoice\Resources\invoice.js" />
|
<Resource Include="Ctrls\PDDInvoice\Resources\invoice.js" />
|
||||||
|
<Resource Include="Ctrls\PDDInvoice\Resources\order.js" />
|
||||||
<Resource Include="gear.ico" />
|
<Resource Include="gear.ico" />
|
||||||
</ItemGroup>
|
</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>
|
</Project>
|
||||||
+38
-42
@@ -1,45 +1,41 @@
|
|||||||
<Application
|
<Application
|
||||||
x:Class="_29WxOrderWpf.App"
|
x:Class="_29WxOrderWpf.App"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:converters="clr-namespace:_29WxOrderWpf.Converters"
|
xmlns:converters="clr-namespace:_29WxOrderWpf.Converters"
|
||||||
xmlns:local="clr-namespace:_29WxOrderWpf"
|
xmlns:local="clr-namespace:_29WxOrderWpf">
|
||||||
StartupUri="MainWindow.xaml">
|
<Application.Resources>
|
||||||
<Application.Resources>
|
<ResourceDictionary>
|
||||||
<ResourceDictionary>
|
<converters:HasValueToVisibilityConverter x:Key="hasValueToVisibilityConverter" />
|
||||||
<converters:HasValueToVisibilityConverter x:Key="hasValueToVisibilityConverter" />
|
<converters:HasTextToVisibilityConverter x:Key="HasTextVisibility" />
|
||||||
<converters:HasTextToVisibilityConverter x:Key="HasTextVisibility" />
|
<converters:TextEllipsisConverter x:Key="TextEllipsisConverter" />
|
||||||
<converters:TextEllipsisConverter x:Key="TextEllipsisConverter" />
|
<converters:TextEllipsisConverter26 x:Key="TextEllipsisConverter26" />
|
||||||
<converters:TextEllipsisConverter26 x:Key="TextEllipsisConverter26" />
|
<converters:TextEllipsisConverter8 x:Key="TextEllipsisConverter8" />
|
||||||
<converters:NotHasTextToVisibilityConverter x:Key="NotHasTextVisibility" />
|
<converters:NotHasTextToVisibilityConverter x:Key="NotHasTextVisibility" />
|
||||||
<converters:VisibleToVisibilityConverter x:Key="visibleToVisibilityConverter" />
|
<converters:VisibleToVisibilityConverter x:Key="visibleToVisibilityConverter" />
|
||||||
<converters:ImageUrlToBitmapImageConverter x:Key="ImageUrlToBitmapImage" />
|
<converters:ImageUrlToBitmapImageConverter x:Key="ImageUrlToBitmapImage" />
|
||||||
<converters:ValueMinus24Converter x:Key="ValueMinus24Converter" />
|
<converters:ValueMinus24Converter x:Key="ValueMinus24Converter" />
|
||||||
<converters:FenToYuanConverter x:Key="FenToYuanConverter" />
|
<converters:FenToYuanConverter x:Key="FenToYuanConverter" />
|
||||||
<converters:StatusToColorBrushConverter x:Key="statusToColorBrushConverter" />
|
<converters:StatusToColorBrushConverter x:Key="statusToColorBrushConverter" />
|
||||||
<converters:ListBoxIndexConverter x:Key="listBoxIndexConverter" />
|
<converters:ListBoxIndexConverter x:Key="listBoxIndexConverter" />
|
||||||
<converters:FlagColorConverter x:Key="flagColorConverter" />
|
<converters:FlagColorConverter x:Key="flagColorConverter" />
|
||||||
<ResourceDictionary.MergedDictionaries>
|
<ResourceDictionary.MergedDictionaries>
|
||||||
<ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/Basic.xaml" />
|
<ResourceDictionary Source="Styles/BaseWindowStyle.xaml" />
|
||||||
<ResourceDictionary Source="pack://application:,,,/WxOrder.Framework;component/Resources/SkinLocal.xaml" />
|
<ResourceDictionary Source="Styles/BaseDataGridStyle.xaml" />
|
||||||
<ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/Theme.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 Source="Styles/BaseWindowStyle.xaml" />
|
<ResourceDictionary Source="Styles/TabControlStyle.xaml" />
|
||||||
<ResourceDictionary Source="Styles/BaseDataGridStyle.xaml" />
|
</ResourceDictionary.MergedDictionaries>
|
||||||
<ResourceDictionary Source="Styles/BaseButtonStyle.xaml" />
|
</ResourceDictionary>
|
||||||
<ResourceDictionary Source="Styles/BaseTextBoxStyle.xaml" />
|
</Application.Resources>
|
||||||
<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>
|
</Application>
|
||||||
@@ -141,17 +141,19 @@ namespace _29WxOrderWpf
|
|||||||
#endif
|
#endif
|
||||||
Cef.Initialize(settings);
|
Cef.Initialize(settings);
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
}
|
|
||||||
|
|
||||||
//static void Application_ThreadException(object sender, System.Threading.ThreadExceptionEventArgs e)
|
new MainWindow().Show();
|
||||||
//{
|
}
|
||||||
// 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)
|
//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)
|
||||||
{
|
{
|
||||||
string str = GetExceptionMsg(e.Exception, e.ToString());
|
string str = GetExceptionMsg(e.Exception, e.ToString());
|
||||||
NaiBa.Util.Helper.LogHelper.WriteWithTime("SystemError:" + str);
|
NaiBa.Util.Helper.LogHelper.WriteWithTime("SystemError:" + str);
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using AllBase.Helper;
|
using AllBase.Helper;
|
||||||
|
using NaiBa.Util.Extension;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@@ -49,14 +50,14 @@ namespace _29WxOrderWpf.BaseWindows
|
|||||||
|
|
||||||
BaseMsgWindow msgBox = null;
|
BaseMsgWindow msgBox = null;
|
||||||
Window owner = window ?? MainWindow.Instance;
|
Window owner = window ?? MainWindow.Instance;
|
||||||
|
//owner.Dispatcher.Invoke(() =>
|
||||||
owner.Dispatcher.Invoke(new Action(() =>
|
Application.Current.Dispatcher.Invoke(() =>
|
||||||
{
|
{
|
||||||
msgBox = CreateMsgForm(msg, title, wl);
|
msgBox = CreateMsgForm(msg, title, wl);
|
||||||
msgBox.imgTip.Source = Application.Current.Resources["imgBaseMsgInfo"] as ImageSource;
|
msgBox.imgTip.Source = Application.Current.Resources["imgBaseMsgInfo"] as ImageSource;
|
||||||
msgBox.Owner = owner;
|
//msgBox.Owner = owner;
|
||||||
msgBox.ShowDialog();
|
msgBox.ShowDialog();
|
||||||
}));
|
});
|
||||||
return msgBox;
|
return msgBox;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -65,24 +66,26 @@ namespace _29WxOrderWpf.BaseWindows
|
|||||||
string title = string.IsNullOrEmpty(caption) ? "系统错误" : caption;
|
string title = string.IsNullOrEmpty(caption) ? "系统错误" : caption;
|
||||||
BaseMsgWindow msgBox = null;
|
BaseMsgWindow msgBox = null;
|
||||||
Window owner = window ?? MainWindow.Instance;
|
Window owner = window ?? MainWindow.Instance;
|
||||||
owner.Dispatcher.Invoke(new Action(() =>
|
//owner.Dispatcher.Invoke(() =>
|
||||||
{
|
Application.Current.Dispatcher.Invoke(() =>
|
||||||
|
{
|
||||||
msgBox = CreateMsgForm(msg, title, wl);
|
msgBox = CreateMsgForm(msg, title, wl);
|
||||||
msgBox.imgTip.Source = Application.Current.Resources["imgBaseMsgErr"] as ImageSource;
|
msgBox.imgTip.Source = Application.Current.Resources["imgBaseMsgErr"] as ImageSource;
|
||||||
msgBox.Owner = owner;
|
//msgBox.Owner = owner;
|
||||||
msgBox.ShowDialog();
|
msgBox.ShowDialog();
|
||||||
}));
|
});
|
||||||
return msgBox;
|
return msgBox;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static BaseMsgWindow ShowConfirm(string msg, string caption = "", Window window = null, MsgWindowLevel fl = MsgWindowLevel.MEDIUM)
|
public static BaseMsgWindow ShowConfirm(string msg, string caption = "", Window window = null, MsgWindowLevel fl = MsgWindowLevel.MEDIUM, int? boxHeight = null)
|
||||||
{
|
{
|
||||||
string title = string.IsNullOrEmpty(caption) ? "确认系统提示" : caption;
|
string title = string.IsNullOrEmpty(caption) ? "确认系统提示" : caption;
|
||||||
|
|
||||||
BaseMsgWindow msgBox = null;
|
BaseMsgWindow msgBox = null;
|
||||||
Window owner = window ?? MainWindow.Instance;
|
Window owner = window ?? MainWindow.Instance;
|
||||||
owner.Dispatcher.Invoke(() =>
|
//owner.Dispatcher.Invoke(() =>
|
||||||
{
|
Application.Current.Dispatcher.Invoke(() =>
|
||||||
|
{
|
||||||
msgBox = new BaseMsgWindow
|
msgBox = new BaseMsgWindow
|
||||||
{
|
{
|
||||||
lblTitle = { Content = title },
|
lblTitle = { Content = title },
|
||||||
@@ -92,9 +95,11 @@ namespace _29WxOrderWpf.BaseWindows
|
|||||||
if (fl.Equals(MsgWindowLevel.LARGE))
|
if (fl.Equals(MsgWindowLevel.LARGE))
|
||||||
{
|
{
|
||||||
msgBox.Width = (int)MsgWindowLevel.LARGE;
|
msgBox.Width = (int)MsgWindowLevel.LARGE;
|
||||||
msgBox.Height = 500;
|
if (boxHeight == null)
|
||||||
|
boxHeight = 500;
|
||||||
|
msgBox.Height = boxHeight.ParseToInt();
|
||||||
}
|
}
|
||||||
msgBox.Owner = owner;
|
//msgBox.Owner = owner;
|
||||||
msgBox.ShowDialog();
|
msgBox.ShowDialog();
|
||||||
});
|
});
|
||||||
return msgBox;
|
return msgBox;
|
||||||
|
|||||||
@@ -1,285 +0,0 @@
|
|||||||
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,23 +0,0 @@
|
|||||||
<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>
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
using System.Threading;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows.Input;
|
|
||||||
|
|
||||||
namespace _29WxOrderWpf.Common
|
|
||||||
{
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Provides an abstraction layer for custom controls which want to make use of Async Commands
|
|
||||||
/// </summary>
|
|
||||||
public interface IAsyncCommand : ICommand
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Executes the Command with a specified parameter and the Default <see cref="CancellationToken"/>.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="parameter">The Command Parameter</param>
|
|
||||||
/// <returns>An Asynchronous Task</returns>
|
|
||||||
Task ExecuteAsync(object parameter);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Executes the Command with a specified parameter and using a <see cref="CancellationToken"/>
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="parameter">The Command Parameter</param>
|
|
||||||
/// <param name="cancellationToken">The <see cref="CancellationToken"/>.</param>
|
|
||||||
/// <returns>An Asynchronous Task</returns>
|
|
||||||
Task ExecuteAsync(object parameter, CancellationToken cancellationToken);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -5,55 +5,192 @@ using System.Globalization;
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
|
using System.Net.Http;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
using System.Windows.Data;
|
using System.Windows.Data;
|
||||||
using System.Windows.Media.Imaging;
|
using System.Windows.Media.Imaging;
|
||||||
|
using System.Windows.Threading;
|
||||||
using Work;
|
using Work;
|
||||||
|
|
||||||
namespace _29WxOrderWpf.Converters
|
namespace _29WxOrderWpf.Converters
|
||||||
{
|
{
|
||||||
public class ImageUrlToBitmapImageConverter : IValueConverter
|
public class ImageUrlToBitmapImageConverter : IMultiValueConverter
|
||||||
{
|
{
|
||||||
/// <summary> 缓存上限,防止大量缩略图重复下载导致内存膨胀 </summary>
|
/// <summary> 缓存上限,防止大量缩略图重复下载导致内存膨胀 </summary>
|
||||||
private const int MaxCacheCount = 200;
|
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 value, Type targetType, object parameter, CultureInfo culture)
|
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
|
||||||
{
|
{
|
||||||
if (value is string url && Uri.IsWellFormedUriString(url, UriKind.Absolute))
|
if (values.Length == 0 || values[0] == DependencyProperty.UnsetValue)
|
||||||
{
|
return null;
|
||||||
if (_imageCache.TryGetValue(url, out BitmapImage cached))
|
var url = values[0] as string;
|
||||||
{
|
var isLoad = values[1] is bool b && b;
|
||||||
return cached;
|
if (!isLoad || string.IsNullOrEmpty(url))
|
||||||
}
|
return null; // 或返回占位图
|
||||||
|
if (Uri.IsWellFormedUriString(url, UriKind.Absolute))
|
||||||
|
{
|
||||||
|
if (_imageCache.TryGetValue(url, out BitmapImage cached))
|
||||||
|
{
|
||||||
|
return cached;
|
||||||
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// 直接加载绑定如果遇到有问题的网络图片会直接崩溃。
|
// 直接加载绑定如果遇到有问题的网络图片会直接崩溃。
|
||||||
BitmapImage bitMap = AllBase.ImageBuild.LoadBitmipImageFromUrl(url);
|
BitmapImage bitMap = AllBase.ImageBuild.LoadBitmipImageFromUrl(url);
|
||||||
if (bitMap != null)
|
if (bitMap != null)
|
||||||
{
|
{
|
||||||
if (_imageCache.Count >= MaxCacheCount)
|
if (_imageCache.Count >= MaxCacheCount)
|
||||||
{
|
{
|
||||||
_imageCache.Clear();
|
_imageCache.Clear();
|
||||||
}
|
}
|
||||||
_imageCache[url] = bitMap;
|
_imageCache[url] = bitMap;
|
||||||
}
|
}
|
||||||
return bitMap;
|
return bitMap;
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
|
||||||
{
|
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
|
||||||
throw new NotImplementedException(); // 不需要反向转换,所以不实现。
|
{
|
||||||
}
|
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;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -15,6 +15,9 @@ namespace _29WxOrderWpf.Converters
|
|||||||
{
|
{
|
||||||
ListBoxItem item = (ListBoxItem)value;
|
ListBoxItem item = (ListBoxItem)value;
|
||||||
ListBox listView = ItemsControl.ItemsControlFromItemContainer(item) as ListBox;
|
ListBox listView = ItemsControl.ItemsControlFromItemContainer(item) as ListBox;
|
||||||
|
if (listView == null)
|
||||||
|
return 0;
|
||||||
|
|
||||||
return listView.ItemContainerGenerator.IndexFromContainer(item) + 1;
|
return listView.ItemContainerGenerator.IndexFromContainer(item) + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ namespace _29WxOrderWpf.Converters
|
|||||||
{
|
{
|
||||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||||
{
|
{
|
||||||
if ( value == null)
|
if (value == null)
|
||||||
return Visibility.Collapsed;
|
return Visibility.Collapsed;
|
||||||
return !value.ParseToString().Trim().IsNullOrEmpty() ? Visibility.Visible : Visibility.Collapsed;
|
return !value.ParseToString().Trim().IsNullOrEmpty() ? Visibility.Visible : Visibility.Collapsed;
|
||||||
}
|
}
|
||||||
@@ -53,20 +53,36 @@ namespace _29WxOrderWpf.Converters
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 超出26个字的文本显示省略号
|
/// 超出26个字的文本显示省略号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class TextEllipsisConverter26 : IValueConverter
|
public class TextEllipsisConverter26 : IValueConverter
|
||||||
{
|
{
|
||||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||||
{
|
{
|
||||||
if (value.ParseToString().Length > 26)
|
if (value.ParseToString().Length > 26)
|
||||||
return string.Join("", value.ParseToString().Take(26)) + "…";
|
return string.Join("", value.ParseToString().Take(26)) + "…";
|
||||||
return value.ParseToString();
|
return value.ParseToString();
|
||||||
}
|
}
|
||||||
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(); // 单向绑定可不实现
|
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(); // 单向绑定可不实现
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
File diff suppressed because it is too large.
Load diff
@@ -1,6 +1,7 @@
|
|||||||
using _29WxOrderWpf.BaseWindows;
|
using _29WxOrderWpf.BaseWindows;
|
||||||
using _29WxOrderWpf.CefHelper;
|
using _29WxOrderWpf.CefHelper;
|
||||||
using _29WxOrderWpf.Ctrls.OrderCtrls;
|
using _29WxOrderWpf.Ctrls.OrderCtrls;
|
||||||
|
using _29WxOrderWpf.ViewModels;
|
||||||
using AllBase;
|
using AllBase;
|
||||||
using AllBase.Helper;
|
using AllBase.Helper;
|
||||||
using AllBase.Model;
|
using AllBase.Model;
|
||||||
@@ -15,6 +16,7 @@ using CefSharp.Wpf;
|
|||||||
using NaiBa.Util;
|
using NaiBa.Util;
|
||||||
using NaiBa.Util.Extension;
|
using NaiBa.Util.Extension;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
|
using NPOI.OpenXmlFormats.Dml.Chart;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@@ -37,12 +39,12 @@ using System.Windows.Media.Imaging;
|
|||||||
using System.Windows.Navigation;
|
using System.Windows.Navigation;
|
||||||
using System.Windows.Shapes;
|
using System.Windows.Shapes;
|
||||||
using System.Xml.XPath;
|
using System.Xml.XPath;
|
||||||
using _29WxOrderWpf.ViewModels;
|
|
||||||
using Work;
|
using Work;
|
||||||
using Work._29Tools.BLL;
|
using Work._29Tools.BLL;
|
||||||
using Work._29Tools.CefTools;
|
using Work._29Tools.CefTools;
|
||||||
using Work.BaseForms;
|
using Work.BaseForms;
|
||||||
using Work.BuyUsers;
|
using Work.BuyUsers;
|
||||||
|
using WxOrder.Framework.Commons;
|
||||||
using static System.Windows.Forms.VisualStyles.VisualStyleElement.Tab;
|
using static System.Windows.Forms.VisualStyles.VisualStyleElement.Tab;
|
||||||
|
|
||||||
namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
||||||
@@ -51,8 +53,13 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
|||||||
/// PDDBuyerOrderReadCtrl.xaml 的交互逻辑
|
/// PDDBuyerOrderReadCtrl.xaml 的交互逻辑
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class PDDBuyerOrderReadCtrl : UserControl
|
public partial class PDDBuyerOrderReadCtrl : UserControl
|
||||||
{
|
{
|
||||||
ChromiumWebBrowser cefWebBrowser = null;
|
private static readonly object locker = new object();
|
||||||
|
|
||||||
|
Dictionary<BuyerLoginInfo, PddPickInfo> dicPddPickInfo = new Dictionary<BuyerLoginInfo, PddPickInfo>();
|
||||||
|
ConcurrentList<yh_sync_logistics> lstSyncLogistics = new ConcurrentList<yh_sync_logistics>();
|
||||||
|
|
||||||
|
ChromiumWebBrowser cefWebBrowser = null;
|
||||||
public string cefAddress = "";
|
public string cefAddress = "";
|
||||||
public static ConcurrentList<PddBuyerOrderLiteInfo> lstPddBuyerOrderInfoLite { get; set; } = new ConcurrentList<PddBuyerOrderLiteInfo>();
|
public static ConcurrentList<PddBuyerOrderLiteInfo> lstPddBuyerOrderInfoLite { get; set; } = new ConcurrentList<PddBuyerOrderLiteInfo>();
|
||||||
public static ObservableCollection<PddBuyerOrderLiteInfo> lstFilterPddBuyerOrderInfoLite { get; set; } = new ObservableCollection<PddBuyerOrderLiteInfo>();
|
public static ObservableCollection<PddBuyerOrderLiteInfo> lstFilterPddBuyerOrderInfoLite { get; set; } = new ObservableCollection<PddBuyerOrderLiteInfo>();
|
||||||
@@ -72,6 +79,7 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
|||||||
/// 是否已初始化已读的买手单
|
/// 是否已初始化已读的买手单
|
||||||
/// </summary>
|
/// </summary>
|
||||||
bool isInitBuyerOrder = false;
|
bool isInitBuyerOrder = false;
|
||||||
|
bool isSkipNext = false;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否已初始化已读的售后单
|
/// 是否已初始化已读的售后单
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -293,10 +301,36 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
|||||||
private void RequestHandler_ResourceLoadComplete(object sender, string url, string postData, string responseData, IRequest request)
|
private void RequestHandler_ResourceLoadComplete(object sender, string url, string postData, string responseData, IRequest request)
|
||||||
{
|
{
|
||||||
var cookie1 = request.Headers["Cookie"];
|
var cookie1 = request.Headers["Cookie"];
|
||||||
Task.Run(() =>
|
Task.Run(async() =>
|
||||||
{
|
{
|
||||||
var url1 = url;
|
var url1 = url;
|
||||||
var data1 = responseData;
|
var data1 = responseData;
|
||||||
|
var send1 = sender;
|
||||||
|
//https://mobile.yangkeduo.com/psnl_goods_help.html?_t_module_name=assistant_search&refer_scene=no_pickup_package_express&refer_page_name=goods_express&refer_page_id=10007_1790161262817_kcbn4ajosu&refer_page_sn=10007
|
||||||
|
//https://mobile.yangkeduo.com/psnl_goods_help.html?_t_module_name=assistant_search&refer_scene=no_pickup_package_express&refer_page_name=goods_express&refer_page_id=10007_1790161262817_kcbn4ajosu&refer_page_sn=10007&show_no_pickup_package=0&tab_id=400&tab_type=1&list_index=80
|
||||||
|
if (url1.StartsWith ("https://mobile.yangkeduo.com/psnl_goods_help.html?_t_module_name=assistant_search&refer_scene=no_pickup_package_express&refer_page_name=goods_express") ||
|
||||||
|
data1.Contains("\"pick_code\":\"取件码") /*|| data.Contains("21-2110")*/)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var combine_track_list = BaseRegex.GetJsonArrStrJson(ref data1, "combine_track_list");
|
||||||
|
var noPickupPackageData = BaseRegex.GetJsonObjStrJson(ref data1, "noPickupPackageData").FirstOrDefault();
|
||||||
|
if (!noPickupPackageData.IsNullOrEmpty() && send1 is ChromiumWebBrowser cef)
|
||||||
|
{
|
||||||
|
var buyer = GlobalConfig.PDDBuyerLoginList.FirstOrDefault(buy => buy.wpf_browser == cef);
|
||||||
|
if (buyer != null)
|
||||||
|
{
|
||||||
|
dicPddPickInfo[buyer] = JsonHelper.DeserializeJsonToObject<PddPickInfo>(noPickupPackageData);
|
||||||
|
SetPickUpNo(dicPddPickInfo[buyer]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (data1.Contains("214874201671006"))
|
if (data1.Contains("214874201671006"))
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -310,7 +344,7 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
|||||||
// 已发货 第一页
|
// 已发货 第一页
|
||||||
if (url1.StartsWith("https://mobile.yangkeduo.com/orders.html?type=3")) //https://mobile.yangkeduo.com/orders.html?type=3
|
if (url1.StartsWith("https://mobile.yangkeduo.com/orders.html?type=3")) //https://mobile.yangkeduo.com/orders.html?type=3
|
||||||
{
|
{
|
||||||
Task.Run(() =>
|
await Task.Run(() =>
|
||||||
{
|
{
|
||||||
if (data1.Contains("display_amount"))
|
if (data1.Contains("display_amount"))
|
||||||
{
|
{
|
||||||
@@ -335,7 +369,7 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
|||||||
// 待发货 第一页
|
// 待发货 第一页
|
||||||
if (url1.StartsWith("https://mobile.yangkeduo.com/orders.html?type=2"))
|
if (url1.StartsWith("https://mobile.yangkeduo.com/orders.html?type=2"))
|
||||||
{
|
{
|
||||||
Task.Run(() =>
|
await Task.Run(() =>
|
||||||
{
|
{
|
||||||
if (data1.Contains("display_amount"))
|
if (data1.Contains("display_amount"))
|
||||||
{
|
{
|
||||||
@@ -357,11 +391,12 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// 读订单
|
|
||||||
if (/*(cefAddress.Contains("orders.html")) &&*/
|
// 读订单
|
||||||
url1.StartsWith("https://mobile.yangkeduo.com/proxy/api/api/aristotle/order_list_v"))
|
if (/*(cefAddress.Contains("orders.html")) &&*/ url1.StartsWith("https://mobile.yangkeduo.com/proxy/api/api/aristotle/order_list_v"))
|
||||||
|
//https://mobile.yangkeduo.com/proxy/api/api/aristotle/order_list_v4?pdduid=6766109923730
|
||||||
{
|
{
|
||||||
Task.Run(() =>
|
await Task.Run(() =>
|
||||||
{
|
{
|
||||||
CefReadBuyerOrder(url1, data1);
|
CefReadBuyerOrder(url1, data1);
|
||||||
});
|
});
|
||||||
@@ -370,7 +405,7 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
|||||||
// 售后 第一页
|
// 售后 第一页
|
||||||
if (url1.StartsWith("https://mobile.yangkeduo.com/complaint_list.html"))
|
if (url1.StartsWith("https://mobile.yangkeduo.com/complaint_list.html"))
|
||||||
{
|
{
|
||||||
Task.Run(() =>
|
await Task.Run(() =>
|
||||||
{
|
{
|
||||||
if (data1.Contains("listItemStatusVo") && data1.Contains("afterSalesId") && data1.Contains("statusText"))
|
if (data1.Contains("listItemStatusVo") && data1.Contains("afterSalesId") && data1.Contains("statusText"))
|
||||||
{
|
{
|
||||||
@@ -399,7 +434,7 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
|||||||
// 读取售后
|
// 读取售后
|
||||||
if (url1.StartsWith("https://mobile.yangkeduo.com/proxy/api/api/blade/after_sales_list"))
|
if (url1.StartsWith("https://mobile.yangkeduo.com/proxy/api/api/blade/after_sales_list"))
|
||||||
{
|
{
|
||||||
Task.Run(() =>
|
await Task.Run(() =>
|
||||||
{
|
{
|
||||||
CefReadBuyerAfterSale(url1, data1);
|
CefReadBuyerAfterSale(url1, data1);
|
||||||
});
|
});
|
||||||
@@ -554,9 +589,10 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
|||||||
void UpdateOrderStatus(PddBuyerOrderLiteInfo pdd_order, oms_wei_order_info wx_order, oms_wei_order_item_info wx_order_item, oms_wei_external_procurement_log_info wx_transit_order)
|
void UpdateOrderStatus(PddBuyerOrderLiteInfo pdd_order, oms_wei_order_info wx_order, oms_wei_order_item_info wx_order_item, oms_wei_external_procurement_log_info wx_transit_order)
|
||||||
{
|
{
|
||||||
pdd_order.ShopIdStr = (wx_order?.shop_id).ParseToString();
|
pdd_order.ShopIdStr = (wx_order?.shop_id).ParseToString();
|
||||||
|
pdd_order.WxOrderStatus = wx_order?.status;
|
||||||
pdd_order.ShopOrderIdStr = wx_order_item?.order_id ?? wx_transit_order?.order_no;
|
pdd_order.ShopOrderIdStr = wx_order_item?.order_id ?? wx_transit_order?.order_no;
|
||||||
pdd_order.ShopOrderSkuIdStr = wx_order_item?.sku_id ?? wx_transit_order?.order_sku_id;
|
pdd_order.ShopOrderSkuIdStr = wx_order_item?.sku_id ?? wx_transit_order?.order_sku_id;
|
||||||
pdd_order.ShopOrderSkuNameStr = wx_order_item?.sku_attr_str;
|
pdd_order.ShopOrderSkuNameStr = wx_order_item?.SkuAttrStr;
|
||||||
pdd_order.WxOrderCreateTime = wx_order_item?.ItemOrder?.create_time == null ? DateTime.MinValue : BaseClass.StampToDateTime((wx_order_item?.ItemOrder?.create_time).ParseToInt());
|
pdd_order.WxOrderCreateTime = wx_order_item?.ItemOrder?.create_time == null ? DateTime.MinValue : BaseClass.StampToDateTime((wx_order_item?.ItemOrder?.create_time).ParseToInt());
|
||||||
pdd_order.ShopOrderRefundStr = ""; // (/*refund_item?.count > 0 &&*/ wx_order_item.refund_status > 1) ? "店铺售后" : "";
|
pdd_order.ShopOrderRefundStr = ""; // (/*refund_item?.count > 0 &&*/ wx_order_item.refund_status > 1) ? "店铺售后" : "";
|
||||||
if (wx_order_item?.refund_status > 1)
|
if (wx_order_item?.refund_status > 1)
|
||||||
@@ -591,7 +627,7 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
|||||||
pdd_afterSale.ShopIdStr = (wx_order?.shop_id).ParseToString();
|
pdd_afterSale.ShopIdStr = (wx_order?.shop_id).ParseToString();
|
||||||
pdd_afterSale.ShopOrderIdStr = wx_order_item?.order_id ?? wx_transit_order?.order_no;
|
pdd_afterSale.ShopOrderIdStr = wx_order_item?.order_id ?? wx_transit_order?.order_no;
|
||||||
pdd_afterSale.ShopOrderSkuIdStr = wx_order_item?.sku_id ?? wx_transit_order?.order_sku_id;
|
pdd_afterSale.ShopOrderSkuIdStr = wx_order_item?.sku_id ?? wx_transit_order?.order_sku_id;
|
||||||
pdd_afterSale.ShopOrderSkuNameStr = wx_order_item?.sku_attr_str;
|
pdd_afterSale.ShopOrderSkuNameStr = wx_order_item?.SkuAttrStr;
|
||||||
pdd_afterSale.WxOrderCreateTime = wx_order_item?.ItemOrder?.create_time == null ? DateTime.MinValue : BaseClass.StampToDateTime((wx_order_item?.ItemOrder?.create_time).ParseToInt());
|
pdd_afterSale.WxOrderCreateTime = wx_order_item?.ItemOrder?.create_time == null ? DateTime.MinValue : BaseClass.StampToDateTime((wx_order_item?.ItemOrder?.create_time).ParseToInt());
|
||||||
pdd_afterSale.ShopOrderRefundStr = ""; // (/*refund_item?.count > 0 &&*/ wx_order_item?.refund_status > 1) ? "店铺售后" : "";
|
pdd_afterSale.ShopOrderRefundStr = ""; // (/*refund_item?.count > 0 &&*/ wx_order_item?.refund_status > 1) ? "店铺售后" : "";
|
||||||
if (wx_order_item?.refund_status > 1)
|
if (wx_order_item?.refund_status > 1)
|
||||||
@@ -660,8 +696,20 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 根据拼多多外采订单列表查询中转仓订单信息
|
// 装载同步单
|
||||||
var transitOrderList = GetOrderTransitWarehouseInfo(out_order_nos);
|
var syncOrderList = OrderListCtrl.GetSyncLogistics(out_order_nos);
|
||||||
|
foreach (var syncOrder in syncOrderList)
|
||||||
|
{
|
||||||
|
if (!lstSyncLogistics.Contains(syncOrder))
|
||||||
|
lstSyncLogistics.Add(syncOrder);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
lstSyncLogistics.RemoveAll(o => o.order_id == syncOrder.order_id);
|
||||||
|
lstSyncLogistics.Add(syncOrder);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 根据拼多多外采订单列表查询中转仓订单信息
|
||||||
|
var transitOrderList = GetOrderTransitWarehouseInfo(out_order_nos);
|
||||||
// 根据拼多多外采订单列表查询订单扩展信息
|
// 根据拼多多外采订单列表查询订单扩展信息
|
||||||
var orderExtList = GetOrderItemExtInfo(out_order_nos);
|
var orderExtList = GetOrderItemExtInfo(out_order_nos);
|
||||||
|
|
||||||
@@ -692,7 +740,7 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
|||||||
o.buyerId = buyer.buyer_id;
|
o.buyerId = buyer.buyer_id;
|
||||||
o.buyerName = buyer.buyer_name;
|
o.buyerName = buyer.buyer_name;
|
||||||
|
|
||||||
if (o.order_sn == "260817-535832839751006")
|
if (o.order_sn == "260923-573109716621688")
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -712,13 +760,14 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
|||||||
var wxOrderItem = wxOrder.orderItems.FirstOrDefault(oi => oi.sku_id == o.ShopOrderSkuIdStr);
|
var wxOrderItem = wxOrder.orderItems.FirstOrDefault(oi => oi.sku_id == o.ShopOrderSkuIdStr);
|
||||||
if (wxOrderItem != null)
|
if (wxOrderItem != null)
|
||||||
{
|
{
|
||||||
o.ShopOrderSkuNameStr = wxOrderItem.sku_attr_str;
|
o.ShopOrderSkuNameStr = wxOrderItem.SkuAttrStr;
|
||||||
if (wxOrderItem?.refund_status > 1)
|
if (wxOrderItem?.refund_status > 1)
|
||||||
{
|
{
|
||||||
o.ShopOrderRefundStr = "店铺售后";
|
o.ShopOrderRefundStr = "店铺售后";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
o.OutAfterSaleStatusStr = wxOrder.out_after_sale_status;
|
o.WxOrderStatus = wxOrder?.status;
|
||||||
|
o.OutAfterSaleStatusStr = wxOrder.out_after_sale_status;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -752,18 +801,20 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
string orderStr = JsonHelper.SerializeObject(order);
|
||||||
string orderStr = JsonHelper.SerializeObject(order);
|
|
||||||
string oStr = JsonHelper.SerializeObject(o);
|
string oStr = JsonHelper.SerializeObject(o);
|
||||||
if (JsonHelper.SerializeObject(order) != JsonHelper.SerializeObject(o))
|
if (JsonHelper.SerializeObject(order) != JsonHelper.SerializeObject(o))
|
||||||
{
|
{
|
||||||
if (order.order_sn == "260730-501334709841478")
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
order.WxSendTypeStr = o.WxSendTypeStr;
|
order.WxSendTypeStr = o.WxSendTypeStr;
|
||||||
if (order.WxSendTypeStr == "直发")
|
if (!o.tracking_number.IsNullOrEmpty() && o.tracking_number != order.tracking_number)
|
||||||
|
isUpdate = true;
|
||||||
|
if (!o.outExpressCompanyCode.IsNullOrEmpty() && o.outExpressCompanyCode != order.outExpressCompanyCode)
|
||||||
|
isUpdate = true;
|
||||||
|
if (o.order_status_prompt != order.order_status_prompt)
|
||||||
|
isUpdate = true;
|
||||||
|
|
||||||
|
|
||||||
|
if (order.WxSendTypeStr == "直发")
|
||||||
{
|
{
|
||||||
if (order.order_status_prompt.Contains("待发货") && !o.order_status_prompt.Contains("待发货"))
|
if (order.order_status_prompt.Contains("待发货") && !o.order_status_prompt.Contains("待发货"))
|
||||||
order.sendStatus = "";
|
order.sendStatus = "";
|
||||||
@@ -814,6 +865,7 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
|||||||
order.ShopOrderRefundStr = o.ShopOrderRefundStr; // "" 或者 "店铺售后"
|
order.ShopOrderRefundStr = o.ShopOrderRefundStr; // "" 或者 "店铺售后"
|
||||||
order.OutAfterSaleStatusStr = o.OutAfterSaleStatusStr; // 店铺售后状态文本描述
|
order.OutAfterSaleStatusStr = o.OutAfterSaleStatusStr; // 店铺售后状态文本描述
|
||||||
order.wxRefundStatus = o.wxRefundStatus;
|
order.wxRefundStatus = o.wxRefundStatus;
|
||||||
|
order.WxOrderStatus = o.WxOrderStatus;
|
||||||
|
|
||||||
|
|
||||||
var index = lstPddBuyerOrderInfoLite.IndexOf(order);
|
var index = lstPddBuyerOrderInfoLite.IndexOf(order);
|
||||||
@@ -848,10 +900,6 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
|||||||
// 根据订单状态 取号/修改取号
|
// 根据订单状态 取号/修改取号
|
||||||
if (order.WxSendTypeStr == "直发")
|
if (order.WxSendTypeStr == "直发")
|
||||||
{
|
{
|
||||||
if (order.order_sn == "260802-185262415501688")
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
// 微信售后,客户端取消直发买手订单
|
// 微信售后,客户端取消直发买手订单
|
||||||
if (order.ShopOrderRefundStr.ParseToString().Contains("售后"))
|
if (order.ShopOrderRefundStr.ParseToString().Contains("售后"))
|
||||||
{
|
{
|
||||||
@@ -862,7 +910,8 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
|||||||
isUpdate = true;
|
isUpdate = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SendOrderE57(order);
|
if (GlobalConfig.BuyConfig.IsSyncDirectBuyOrderWaybill != true)
|
||||||
|
SendOrderE57(order);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -888,8 +937,21 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
|||||||
SendTransitOrderE57(order);
|
SendTransitOrderE57(order);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isUpdate && !string.IsNullOrEmpty(order.ShopOrderIdStr)/* && order.WxSendTypeStr != "直发"*/)
|
if (order.order_sn == "260924-431226960203223")
|
||||||
|
{
|
||||||
|
}
|
||||||
|
if (order.ShopOrderIdStr == "3739392779260688128")
|
||||||
|
{
|
||||||
|
}
|
||||||
|
if (order.WxSendTypeStr == "直发")
|
||||||
|
{
|
||||||
|
if (GlobalConfig.BuyConfig.IsSyncDirectBuyOrderWaybill && !string.IsNullOrEmpty(order.tracking_number) && order.WxOrderStatus < 30)
|
||||||
|
if (!lstSyncLogistics.Any(o => o.order_id == order.order_sn) || lstSyncLogistics.Any(o => o.order_id == order.order_sn && o.tracking_number.IsNullOrEmpty()))
|
||||||
|
isUpdate = true;
|
||||||
|
}
|
||||||
|
if (isUpdate && !string.IsNullOrEmpty(order.ShopOrderIdStr)/* && order.WxSendTypeStr != "直发"*/)
|
||||||
{
|
{
|
||||||
|
|
||||||
// 买手订单状态记录到数据库
|
// 买手订单状态记录到数据库
|
||||||
order_pdd_buyer_order pddBuyerOrder = new order_pdd_buyer_order()
|
order_pdd_buyer_order pddBuyerOrder = new order_pdd_buyer_order()
|
||||||
{
|
{
|
||||||
@@ -929,8 +991,32 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
|||||||
var html3 = GetHtml.PostUtf8(url3, data3);
|
var html3 = GetHtml.PostUtf8(url3, data3);
|
||||||
if (string.IsNullOrEmpty(html3) || !html3.Contains("\"code\":200"))
|
if (string.IsNullOrEmpty(html3) || !html3.Contains("\"code\":200"))
|
||||||
html3 = GetHtml.PostUtf8(url3, data3);
|
html3 = GetHtml.PostUtf8(url3, data3);
|
||||||
}
|
|
||||||
});
|
//勾选了调用同步单接口,必须直发且库里已有物流单号
|
||||||
|
if (order.WxSendTypeStr == "直发")
|
||||||
|
{
|
||||||
|
if (GlobalConfig.BuyConfig.IsSyncDirectBuyOrderWaybill && !string.IsNullOrEmpty(order.tracking_number) && html3.Contains("\"code\":200"))
|
||||||
|
if (!lstSyncLogistics.Any(o => o.order_id == order.order_sn) || lstSyncLogistics.Any(o => o.order_id == order.order_sn && o.tracking_number.IsNullOrEmpty()))
|
||||||
|
SendAsyncWaybillOrder(order);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (order.order_sn == "260924-431226960203223")
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// 填写取件码
|
||||||
|
if (order.WxSendTypeStr == "直发")
|
||||||
|
{
|
||||||
|
if (GlobalConfig.BuyConfig.IsSyncDirectBuyOrderWaybill && !string.IsNullOrEmpty(order.tracking_number))
|
||||||
|
{
|
||||||
|
if (lstSyncLogistics.Any(o => o.order_id == order.order_sn))
|
||||||
|
if (lstSyncLogistics.Any(o => o.order_id == order.order_sn && (o.upload_pickup_status == 0 || o.pickup_code.IsNullOrEmpty())))
|
||||||
|
SetPickUpNo(order);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
NaiBa.Util.Helper.ConfigHelper.SaveConfig("pdd_buyer_order_list", lstPddBuyerOrderInfoLite);
|
NaiBa.Util.Helper.ConfigHelper.SaveConfig("pdd_buyer_order_list", lstPddBuyerOrderInfoLite);
|
||||||
}
|
}
|
||||||
@@ -1023,8 +1109,9 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
|||||||
var wxOrderItem = wxOrder.orderItems.FirstOrDefault(oi => oi.sku_id == af.ShopOrderSkuIdStr);
|
var wxOrderItem = wxOrder.orderItems.FirstOrDefault(oi => oi.sku_id == af.ShopOrderSkuIdStr);
|
||||||
if (wxOrderItem != null)
|
if (wxOrderItem != null)
|
||||||
{
|
{
|
||||||
af.ShopOrderSkuNameStr = wxOrderItem.sku_attr_str;
|
af.ShopOrderSkuNameStr = wxOrderItem.SkuAttrStr;
|
||||||
}
|
af.ShopOrderOutAfterSaleStatusStr = wxOrder.out_after_sale_status;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -1047,8 +1134,22 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool isUpdate = false;
|
bool isUpdate = false;
|
||||||
PddBuyerAfterSaleLiteInfo afterSale = null;
|
PddBuyerAfterSaleLiteInfo afterSale = null;
|
||||||
if (!lstPddBuyerAfterSaleInfoLite.Any(or => or.afterSalesId == af.afterSalesId))
|
//lock (locker)
|
||||||
|
var success = false;
|
||||||
|
for (int i = 0; i < 10 && success == false; i++)
|
||||||
|
{
|
||||||
|
Thread.Sleep(1);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
afterSale = lstPddBuyerAfterSaleInfoLite.ToList().FirstOrDefault(aft => aft.afterSalesId == af.afterSalesId);
|
||||||
|
success = true;
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (afterSale == null)
|
||||||
{
|
{
|
||||||
isUpdate = true;
|
isUpdate = true;
|
||||||
afterSale = af;
|
afterSale = af;
|
||||||
@@ -1056,7 +1157,6 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
afterSale = lstPddBuyerAfterSaleInfoLite.FirstOrDefault(aft => aft.afterSalesId == af.afterSalesId);
|
|
||||||
var afterSaleTmp = JsonHelper.DeserializeJsonToObject<PddBuyerAfterSaleLiteInfo>(JsonHelper.SerializeObject(afterSale));
|
var afterSaleTmp = JsonHelper.DeserializeJsonToObject<PddBuyerAfterSaleLiteInfo>(JsonHelper.SerializeObject(afterSale));
|
||||||
//afterSaleTmp.sendStatus = ""; // 比较订单变化,如果有变化,才写库或者处理(设置为空强制变化)
|
//afterSaleTmp.sendStatus = ""; // 比较订单变化,如果有变化,才写库或者处理(设置为空强制变化)
|
||||||
afterSaleTmp.AfterSaleStatusOldStr = null; // 设置null,比较订单变化,如果有变化,才写
|
afterSaleTmp.AfterSaleStatusOldStr = null; // 设置null,比较订单变化,如果有变化,才写
|
||||||
@@ -1098,7 +1198,8 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
|||||||
afterSale.ShopOrderIdStr = af.ShopOrderIdStr;
|
afterSale.ShopOrderIdStr = af.ShopOrderIdStr;
|
||||||
afterSale.ShopOrderSkuIdStr = af.ShopOrderSkuIdStr;
|
afterSale.ShopOrderSkuIdStr = af.ShopOrderSkuIdStr;
|
||||||
afterSale.ShopOrderSkuNameStr = af.ShopOrderSkuNameStr;
|
afterSale.ShopOrderSkuNameStr = af.ShopOrderSkuNameStr;
|
||||||
afterSale.TransitBuyerOrderRefundStatus = af.TransitBuyerOrderRefundStatus;
|
afterSale.ShopOrderOutAfterSaleStatusStr = af.ShopOrderOutAfterSaleStatusStr;
|
||||||
|
afterSale.TransitBuyerOrderRefundStatus = af.TransitBuyerOrderRefundStatus;
|
||||||
afterSale.TransitWarehouseIdStr = af.TransitWarehouseIdStr;
|
afterSale.TransitWarehouseIdStr = af.TransitWarehouseIdStr;
|
||||||
afterSale.TransitWarehouseOrderCodeStr = af.TransitWarehouseOrderCodeStr;
|
afterSale.TransitWarehouseOrderCodeStr = af.TransitWarehouseOrderCodeStr;
|
||||||
afterSale.Express1WaybillStr = af.Express1WaybillStr;
|
afterSale.Express1WaybillStr = af.Express1WaybillStr;
|
||||||
@@ -1151,58 +1252,61 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
|||||||
//return;
|
//return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (afterSale?.ShopIdStr == "3738859887048176128")
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
// 记录直发或者中转仓订单买手售后情况
|
// 记录直发或者中转仓订单买手售后情况
|
||||||
if (isUpdate && !string.IsNullOrEmpty(afterSale?.ShopOrderIdStr))
|
if (isUpdate && !string.IsNullOrEmpty(afterSale?.ShopOrderIdStr))
|
||||||
{
|
{
|
||||||
if(afterSale.WxSendTypeStr == "直发")
|
if (afterSale.WxSendTypeStr == "直发")
|
||||||
{
|
{
|
||||||
// 退款状态有变化才发起修改(退款状态不能从退款成功变成未退款)
|
// 退款状态有变化才发起修改(退款状态不能从退款成功变成未退款)
|
||||||
PddBuyerAfterSaleLiteInfo afterSaleRefundSuccessExist = null;
|
PddBuyerAfterSaleLiteInfo afterSaleRefundSuccessExist = null;
|
||||||
Dispatcher.Invoke(new Action(() =>
|
afterSaleRefundSuccessExist = lstPddBuyerAfterSaleInfoLite.ToList().FirstOrDefault(a => a.afterSalesId != afterSale.afterSalesId &&
|
||||||
{
|
a.orderSn == afterSale.orderSn && (a.AfterSaleStatusStr.Contains("退款成功") || a.AfterSaleStatusStr.Contains("交易已取消")));
|
||||||
afterSaleRefundSuccessExist = lstPddBuyerAfterSaleInfoLite
|
|
||||||
.FirstOrDefault(a => a.orderSn == afterSale.orderSn && (a.AfterSaleStatusStr.Contains("退款成功") || a.AfterSaleStatusStr.Contains("交易已取消")));
|
if ((afterSaleRefundSuccessExist == null || afterSale.AfterSaleStatusStr == afterSaleRefundSuccessExist.AfterSaleStatusStr) &&
|
||||||
}));
|
(afterSale.AfterSaleStatusOldStr != afterSale.AfterSaleStatusStr))
|
||||||
if ((afterSaleRefundSuccessExist == null || afterSale.AfterSaleStatusStr == afterSaleRefundSuccessExist.AfterSaleStatusStr) &&
|
{
|
||||||
afterSale.AfterSaleStatusOldStr != afterSale.AfterSaleStatusStr)
|
SendAfterSaleE57(afterSale);
|
||||||
{
|
afterSale.AfterSaleStatusOldStr = afterSale.AfterSaleStatusStr;
|
||||||
SendAfterSaleE57(afterSale);
|
}
|
||||||
afterSale.AfterSaleStatusOldStr = afterSale.AfterSaleStatusStr;
|
}
|
||||||
}
|
else
|
||||||
}
|
{
|
||||||
else
|
// 如果买手退款成功,仓库不是买手退款成功,则修改仓库售后字段为买手退款成功
|
||||||
{
|
if (afterSale.AfterSaleStatusStr.Contains("退款成功") || afterSale.AfterSaleStatusStr.Contains("交易已取消"))
|
||||||
// 如果买手退款成功,仓库不是买手退款成功,则修改仓库售后字段为买手退款成功
|
{
|
||||||
if (afterSale.AfterSaleStatusStr.Contains("退款成功") || afterSale.AfterSaleStatusStr.Contains("交易已取消"))
|
if (afterSale.TransitBuyerOrderRefundStatus != "买手退款成功")
|
||||||
{
|
{
|
||||||
if (afterSale.TransitBuyerOrderRefundStatus != "买手退款成功")
|
var orderTmp = new PddBuyerOrderLiteInfo() { ShopOrderIdStr = afterSale.ShopOrderIdStr, order_sn = afterSale.orderSn };
|
||||||
{
|
var refundRst = SendTransitAfterSaleE57(orderTmp, "买手退款成功");
|
||||||
var orderTmp = new PddBuyerOrderLiteInfo() { ShopOrderIdStr = afterSale.ShopOrderIdStr, order_sn = afterSale.orderSn };
|
if (refundRst.Contains("<code>0</code>") || refundRst.Contains("<code>200</code>"))
|
||||||
var refundRst = SendTransitAfterSaleE57(orderTmp, "买手退款成功");
|
{
|
||||||
if (refundRst.Contains("<code>0</code>") || refundRst.Contains("<code>200</code>"))
|
afterSale.afterSaleSendStatus = "退款成功 买手退款信息更新成功";
|
||||||
{
|
}
|
||||||
afterSale.afterSaleSendStatus = "退款成功 买手退款信息更新成功";
|
else
|
||||||
}
|
{
|
||||||
else
|
var msg = BaseRegex.GetStringXml(ref refundRst, "msg");
|
||||||
{
|
afterSale.afterSaleSendStatus = "退款成功 买手退款信息更新失败,服务端返回 " + msg;
|
||||||
var msg = BaseRegex.GetStringXml(ref refundRst, "msg");
|
}
|
||||||
afterSale.afterSaleSendStatus = "退款成功 买手退款信息更新失败,服务端返回 " + msg;
|
}
|
||||||
}
|
}
|
||||||
}
|
// 如果中转仓表买手售后状态不等于买手售后单售后,更新仓库买手售后状态
|
||||||
}
|
else if (afterSale.TransitBuyerOrderRefundStatus != "买手退款成功" && afterSale.TransitBuyerOrderRefundStatus != afterSale.AfterSaleStatusStr)
|
||||||
// 如果中转仓表买手售后状态不等于买手售后单售后,更新仓库买手售后状态
|
{
|
||||||
else if (afterSale.TransitBuyerOrderRefundStatus != "买手退款成功" && afterSale.TransitBuyerOrderRefundStatus != afterSale.AfterSaleStatusStr)
|
|
||||||
{
|
|
||||||
if (afterSale.ShopOrderIdStr == "3738552208766960384")
|
if (afterSale.ShopOrderIdStr == "3738552208766960384")
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
var afterSaleExistList = lstPddBuyerAfterSaleInfoLite.Where(a => a.orderSn == afterSale.orderSn).ToList();
|
var afterSaleExistList = lstPddBuyerAfterSaleInfoLite.Where(a => a.orderSn == afterSale.orderSn).ToList();
|
||||||
|
|
||||||
if ((afterSale.AfterSaleStatusStr == "退款失败" || afterSale.AfterSaleStatusStr == "申请已撤销") &&
|
if ((afterSale.AfterSaleStatusStr == "退款失败" || afterSale.AfterSaleStatusStr == "申请已撤销") &&
|
||||||
afterSaleExistList.Any(a => a.AfterSaleStatusStr != "退款失败" && a.AfterSaleStatusStr != "申请已撤销"))
|
afterSaleExistList.Any(a => a.AfterSaleStatusStr != "退款失败" && a.AfterSaleStatusStr != "申请已撤销"))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//if (!afterSale.AfterSaleStatusStr.Contains("关闭") && !afterSale.AfterSaleStatusStr.Contains("撤销") && !afterSale.AfterSaleStatusStr.Contains("失败"))
|
//if (!afterSale.AfterSaleStatusStr.Contains("关闭") && !afterSale.AfterSaleStatusStr.Contains("撤销") && !afterSale.AfterSaleStatusStr.Contains("失败"))
|
||||||
@@ -1218,8 +1322,8 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
|||||||
afterSale.afterSaleSendStatus = "买手退款信息更新失败,服务端返回 " + msg;
|
afterSale.afterSaleSendStatus = "买手退款信息更新失败,服务端返回 " + msg;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 买手已退款,尝试作废仓库订单
|
// 买手已退款,尝试作废仓库订单
|
||||||
@@ -1361,7 +1465,20 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
|||||||
|
|
||||||
foreach (var buyer in GlobalConfig.PDDBuyerLoginList)
|
foreach (var buyer in GlobalConfig.PDDBuyerLoginList)
|
||||||
{
|
{
|
||||||
if (tokenSource.IsCancellationRequested)
|
Dispatcher.Invoke(new Action(() =>
|
||||||
|
{
|
||||||
|
Panel.SetZIndex(buyer.wpf_browser, maxZIndex++);
|
||||||
|
if (buyer.IsSelect != true)
|
||||||
|
{
|
||||||
|
foreach (var b in GlobalConfig.PDDBuyerLoginList)
|
||||||
|
{
|
||||||
|
b.IsSelect = false;
|
||||||
|
}
|
||||||
|
buyer.IsSelect = true;
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
|
||||||
|
if (tokenSource.IsCancellationRequested)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
PddMobileLoginViewModel.CheckBuyerLogin(new List<BuyerLoginInfo>() { buyer });
|
PddMobileLoginViewModel.CheckBuyerLogin(new List<BuyerLoginInfo>() { buyer });
|
||||||
@@ -1401,7 +1518,10 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
|||||||
var t = WPFCEFBrowser.SetCookieAsync(JsonHelper.SerializeObject(cookieLst), buyer.wpf_browser.GetCookieManager(null));
|
var t = WPFCEFBrowser.SetCookieAsync(JsonHelper.SerializeObject(cookieLst), buyer.wpf_browser.GetCookieManager(null));
|
||||||
t.Wait();
|
t.Wait();
|
||||||
|
|
||||||
buyer.wpf_browser.Load("https://mobile.yangkeduo.com/personal.html");
|
buyer.wpf_browser.Load("https://mobile.yangkeduo.com/psnl_goods_help.html?_t_module_name=assistant_search&refer_scene=no_pickup_package_express&refer_page_name=goods_express");
|
||||||
|
Thread.Sleep(Randomx.GetId(2000, 3000));
|
||||||
|
|
||||||
|
buyer.wpf_browser.Load("https://mobile.yangkeduo.com/personal.html");
|
||||||
Thread.Sleep(Randomx.GetId(2000, 3000));
|
Thread.Sleep(Randomx.GetId(2000, 3000));
|
||||||
|
|
||||||
string readBuyer = "";
|
string readBuyer = "";
|
||||||
@@ -1438,6 +1558,9 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
|||||||
lastCefReadOrderTime = DateTime.Now;
|
lastCefReadOrderTime = DateTime.Now;
|
||||||
while (currentReadBuyer == readBuyer)
|
while (currentReadBuyer == readBuyer)
|
||||||
{
|
{
|
||||||
|
if (isSkipNext)
|
||||||
|
break;
|
||||||
|
|
||||||
if (tokenSource.IsCancellationRequested)
|
if (tokenSource.IsCancellationRequested)
|
||||||
{
|
{
|
||||||
BindBuyer(buyer, "已取消读取");
|
BindBuyer(buyer, "已取消读取");
|
||||||
@@ -1514,6 +1637,9 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
|||||||
lastCefReadOrderTime = DateTime.Now;
|
lastCefReadOrderTime = DateTime.Now;
|
||||||
while (currentReadBuyer == readBuyer)
|
while (currentReadBuyer == readBuyer)
|
||||||
{
|
{
|
||||||
|
if (isSkipNext)
|
||||||
|
break;
|
||||||
|
|
||||||
if (tokenSource.IsCancellationRequested)
|
if (tokenSource.IsCancellationRequested)
|
||||||
{
|
{
|
||||||
BindBuyer(buyer, "已取消读取");
|
BindBuyer(buyer, "已取消读取");
|
||||||
@@ -1561,8 +1687,13 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
|||||||
var result = client.Runtime.EvaluateAsync(jsStr, null, true, null, null, true, null, true);
|
var result = client.Runtime.EvaluateAsync(jsStr, null, true, null, null, true, null, true);
|
||||||
result.Wait(5000);
|
result.Wait(5000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (tokenSource.IsCancellationRequested)
|
if (isSkipNext)
|
||||||
|
{
|
||||||
|
isSkipNext = false;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (tokenSource.IsCancellationRequested)
|
||||||
{
|
{
|
||||||
BindBuyer(buyer, "已取消读取");
|
BindBuyer(buyer, "已取消读取");
|
||||||
break;
|
break;
|
||||||
@@ -1595,8 +1726,11 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
|||||||
top = 0;
|
top = 0;
|
||||||
lastCefReadOrderTime = DateTime.Now;
|
lastCefReadOrderTime = DateTime.Now;
|
||||||
while (currentReadBuyer == readBuyer)
|
while (currentReadBuyer == readBuyer)
|
||||||
{
|
{
|
||||||
if (tokenSource.IsCancellationRequested)
|
if (isSkipNext)
|
||||||
|
break;
|
||||||
|
|
||||||
|
if (tokenSource.IsCancellationRequested)
|
||||||
{
|
{
|
||||||
BindBuyer(buyer, "已取消读取");
|
BindBuyer(buyer, "已取消读取");
|
||||||
break;
|
break;
|
||||||
@@ -1635,17 +1769,32 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
|||||||
var result = client.Runtime.EvaluateAsync(jsStr, null, true, null, null, true, null, true);
|
var result = client.Runtime.EvaluateAsync(jsStr, null, true, null, null, true, null, true);
|
||||||
result.Wait(5000);
|
result.Wait(5000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//Invoke(new Action(() =>
|
if (isSkipNext)
|
||||||
//{
|
{
|
||||||
// if (row.Cells["colMessage"].Value.ParseToString().StartsWith("正在读取"))
|
isSkipNext = false;
|
||||||
// BindBuyer(buyer, " ");
|
continue;
|
||||||
//}));
|
}
|
||||||
}
|
if (tokenSource.IsCancellationRequested)
|
||||||
|
{
|
||||||
|
BindBuyer(buyer, "已取消读取");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
//Invoke(new Action(() =>
|
||||||
|
//{
|
||||||
|
// if (row.Cells["colMessage"].Value.ParseToString().StartsWith("正在读取"))
|
||||||
|
// BindBuyer(buyer, " ");
|
||||||
|
//}));
|
||||||
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
}
|
if (isSkipNext)
|
||||||
Thread.Sleep(Randomx.GetId(6000, 8000));
|
{
|
||||||
|
isSkipNext = false;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Thread.Sleep(Randomx.GetId(6000, 8000));
|
||||||
}
|
}
|
||||||
isReadBuyerOrder = false;
|
isReadBuyerOrder = false;
|
||||||
|
|
||||||
@@ -1699,7 +1848,12 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (buyerOrder.WxSendTypeStr == "直发")
|
if (buyerOrder.WxSendTypeStr == "直发")
|
||||||
SendOrderE57(buyerOrder);
|
{
|
||||||
|
if (GlobalConfig.BuyConfig.IsSyncDirectBuyOrderWaybill)
|
||||||
|
SendAsyncWaybillOrder(buyerOrder, true);
|
||||||
|
else
|
||||||
|
SendOrderE57(buyerOrder);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
SendTransitOrderE57(buyerOrder, true);
|
SendTransitOrderE57(buyerOrder, true);
|
||||||
|
|
||||||
@@ -1907,10 +2061,15 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
|||||||
order.sendStatus = "";
|
order.sendStatus = "";
|
||||||
Thread.Sleep(100);
|
Thread.Sleep(100);
|
||||||
|
|
||||||
if (order.order_sn == "260730-501334709841478")
|
if (GlobalConfig.BuyConfig.IsSyncDirectBuyOrderWaybill)
|
||||||
{
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
if (order.sendStatus.ParseToString().Contains("同步单已发货"))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (order.sendStatus.ParseToString().Contains("外采订单已发货") || order.sendStatus.ParseToString().Contains("微信发货成功") ||
|
if (order.sendStatus.ParseToString().Contains("外采订单已发货") || order.sendStatus.ParseToString().Contains("微信发货成功") ||
|
||||||
order.sendStatus.ParseToString().Contains("已发送待发货订单") || order.sendStatus.ParseToString().Contains("接收成功") ||
|
order.sendStatus.ParseToString().Contains("已发送待发货订单") || order.sendStatus.ParseToString().Contains("接收成功") ||
|
||||||
@@ -1993,6 +2152,208 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SetPickUpNo(PddPickInfo pddPickInfo)
|
||||||
|
{
|
||||||
|
List<combine_track_info> orderSnTracks = new List<combine_track_info>();
|
||||||
|
foreach (var combine in pddPickInfo.combine_list)
|
||||||
|
{
|
||||||
|
foreach (var combine_track in combine.combine_track_list)
|
||||||
|
{
|
||||||
|
if (!orderSnTracks.Any(o => o.order_sn == combine_track.order_sn))
|
||||||
|
orderSnTracks.Add(combine_track);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (orderSnTracks.Count == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
//var syncOrderAllList = OrderListCtrl.GetSyncLogistics(string.Join(",", orderSnTracks.Select(o => o.order_sn)));
|
||||||
|
var syncOrderList = OrderListCtrl.GetSyncLogistics(string.Join(",", orderSnTracks.Select(o => o.order_sn)), 1);
|
||||||
|
foreach (var sOrder in syncOrderList)
|
||||||
|
{
|
||||||
|
var orderSnTrack = orderSnTracks.FirstOrDefault(o => o.order_sn == sOrder.order_id);
|
||||||
|
var pNull = orderSnTracks.Where(p => p.pick_code.IsNullOrEmpty()).ToList();
|
||||||
|
if (orderSnTrack.pick_code == null)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
if (orderSnTrack != null && !string.IsNullOrEmpty(orderSnTrack.pick_code))
|
||||||
|
{
|
||||||
|
var pickupCode = orderSnTrack.pick_code.Replace("取件码", "").Replace("取件出示快递单号后五位", "").Trim();
|
||||||
|
if (!string.IsNullOrWhiteSpace(pickupCode))
|
||||||
|
{
|
||||||
|
var url4 = BaseClass.Build29WxObjString("vlc/UploadPickup");
|
||||||
|
var data4 = UserLogin.GetSignPostData(new
|
||||||
|
{
|
||||||
|
orderId = orderSnTrack.order_sn,
|
||||||
|
pickupCode = pickupCode,
|
||||||
|
});
|
||||||
|
var html4 = GetHtml.PostJson(url4, data4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetPickUpNo(PddBuyerOrderLiteInfo order)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var syncOrder = lstSyncLogistics.FirstOrDefault(o => o.order_id == order.order_sn);
|
||||||
|
if (syncOrder == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
|
||||||
|
if (lstSyncLogistics.Any(o => o.order_id == order.order_sn && (o.upload_pickup_status > 0 && o.pickup_code.IsNullOrEmpty())))
|
||||||
|
return;
|
||||||
|
|
||||||
|
var pickupCode = ""; // "21-22-2110";
|
||||||
|
//var buyer = GlobalConfig.PDDBuyerLoginList.FirstOrDefault(b => b.buyer_id == order.buyerId);
|
||||||
|
//if (dicPddPickInfo.Keys.Contains(buyer))
|
||||||
|
foreach(var buyer in dicPddPickInfo.Keys)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var pddPickInfo = dicPddPickInfo[buyer];
|
||||||
|
foreach (var combine in pddPickInfo.combine_list)
|
||||||
|
{
|
||||||
|
foreach (var combine_track in combine.combine_track_list)
|
||||||
|
{
|
||||||
|
if (combine_track.order_sn == order.order_sn)
|
||||||
|
{
|
||||||
|
pickupCode = combine_track.pick_code.ParseToString().Replace("取件码", "").Replace("取件出示快递单号后五位", "").Trim();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(pickupCode))
|
||||||
|
{
|
||||||
|
// 填写取件码
|
||||||
|
var url4 = BaseClass.Build29WxObjString("vlc/UploadPickup");
|
||||||
|
var data4 = UserLogin.GetSignPostData(new
|
||||||
|
{
|
||||||
|
orderId = order.order_sn,
|
||||||
|
pickupCode = pickupCode,
|
||||||
|
});
|
||||||
|
var html4 = GetHtml.PostJson(url4, data4);
|
||||||
|
//{"data":true,"code":200,"msg":"操作成功","isSuccess":true}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SendAsyncWaybillOrder(PddBuyerOrderLiteInfo order, bool showErrBox = false)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (order.WxOrderStatus < 30 == false)
|
||||||
|
{
|
||||||
|
if (showErrBox) BaseMsgWindow.ShowError("订单已发货无需重复创建同步单!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 取最新订单状态
|
||||||
|
var wxOrder = GetOrderInfo(order.ShopOrderIdStr).FirstOrDefault();
|
||||||
|
if (wxOrder == null)
|
||||||
|
throw new Exception("买手单对应微信订单不存在!");
|
||||||
|
var shop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ErpShopId == wxOrder.shop_id.ToString());
|
||||||
|
if (shop == null)
|
||||||
|
throw new Exception("买手单对应店铺不存在!");
|
||||||
|
|
||||||
|
if (order.WxOrderStatus < 30 == false)
|
||||||
|
{
|
||||||
|
if (showErrBox) BaseMsgWindow.ShowError("订单已发货无需重复创建同步单!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (order.ShopOrderIdStr == "3739357317247975936")
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//3739354841155797760
|
||||||
|
//3739338593856835840
|
||||||
|
//3739343419162669824
|
||||||
|
//3739334599561594624
|
||||||
|
//3739334374248562688
|
||||||
|
//3739334539482412288
|
||||||
|
var apiSearchDropship = new WxApiBLL().WxApiDropshipSearch(shop, order.ShopOrderIdStr, 100);
|
||||||
|
if (!apiSearchDropship.Contains("\"errcode\":0"))
|
||||||
|
throw new Exception("同步单代发查询失败!" + BaseRegex.GetStringJson(ref apiSearchDropship, "msg"));
|
||||||
|
var dsOrderId = JsonHelper.JObjectParse(apiSearchDropship)["ds_order_id_list"].FirstOrDefault().ParseToString();
|
||||||
|
if (string.IsNullOrEmpty(dsOrderId))
|
||||||
|
throw new Exception("同步单代发单号获取失败!");
|
||||||
|
|
||||||
|
var url3 = BaseClass.Build29WxObjString("vlc/Buy");
|
||||||
|
var data3 = UserLogin.GetSignPostData(new {
|
||||||
|
orderId = order.order_sn,
|
||||||
|
agentOrderId = dsOrderId,
|
||||||
|
});
|
||||||
|
var html3 = GetHtml.PostJson(url3, data3);
|
||||||
|
var test = "{\"data\":[{\"orderId\":\"260923-399088033421688\",\"trackingNumber\":\"37300000114322\",\"sourceTrackingNumber\":\"JT5528345110252\"}],\"code\":200,\"msg\":\"操作成功\",\"isSuccess\":true}";
|
||||||
|
//{"data":[{"orderId":"260923-399088033421688","trackingNumber":"37300000114322","sourceTrackingNumber":"JT5528345110252"}],"code":200,"msg":"操作成功","isSuccess":true}
|
||||||
|
//Result<JObject>
|
||||||
|
|
||||||
|
if (html3.Contains("\"code\":200") || wxOrder.out_express_no != order.tracking_number)
|
||||||
|
{
|
||||||
|
var mainOrder = GlobalConfig.lstOrder.FirstOrDefault(o => o.order_id == order.ShopOrderIdStr);
|
||||||
|
if (mainOrder != null)
|
||||||
|
mainOrder.RealSyncWaybillId = mainOrder.SyncWaybillIdInfo = BaseRegex.GetStringJson(ref html3, "trackingNumber");
|
||||||
|
|
||||||
|
var url = BaseClass.Build29WxObjString("order/wx_update_erp_out_waybill_status");
|
||||||
|
var data = UserLogin.GetSignaturex();
|
||||||
|
data += "&order_id=" + order.ShopOrderIdStr;
|
||||||
|
data += "&out_express_company=" + order.outExpressCompanyCode;
|
||||||
|
data += "&out_express_no=" + order.tracking_number;
|
||||||
|
var html = GetHtml.PostUtf8(url, data);
|
||||||
|
if (!html.Contains("\"code\":200"))
|
||||||
|
html = GetHtml.PostUtf8(url, data);
|
||||||
|
|
||||||
|
// 更新拍单余额
|
||||||
|
StartUp.UpdateBalance();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var err = BaseRegex.GetStringJson(ref html3, "msg");
|
||||||
|
throw new Exception(err);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
var mainOrder = GlobalConfig.lstOrder.FirstOrDefault(o => o.order_id == order.ShopOrderIdStr);
|
||||||
|
if (mainOrder != null)
|
||||||
|
{
|
||||||
|
var orderItem = mainOrder.orderItems?.FirstOrDefault(oi => oi.sku_id == order.ShopOrderSkuIdStr);
|
||||||
|
if (orderItem != null)
|
||||||
|
orderItem.SyncLogisticsMsg = ex.Message;
|
||||||
|
}
|
||||||
|
|
||||||
|
var url3 = BaseClass.Build29WxObjString("order/wx_add_mdy_buyer_order");
|
||||||
|
var data3 = UserLogin.GetSignaturex();
|
||||||
|
data3 += "&sync_logistics_msg=" + ex.Message;
|
||||||
|
data3 += "&pdd_order_sn=" + order.order_sn;
|
||||||
|
data3 += "&wx_order_id=" + order.ShopOrderIdStr;
|
||||||
|
data3 += "&wx_send_type=1";
|
||||||
|
var html3 = GetHtml.PostUtf8(url3, data3);
|
||||||
|
if (string.IsNullOrEmpty(html3) || !html3.Contains("\"code\":200"))
|
||||||
|
html3 = GetHtml.PostUtf8(url3, data3);
|
||||||
|
if (string.IsNullOrEmpty(html3) || !html3.Contains("\"code\":200"))
|
||||||
|
html3 = GetHtml.PostUtf8(url3, data3);
|
||||||
|
|
||||||
|
if (showErrBox)
|
||||||
|
{
|
||||||
|
BaseMsgWindow.ShowError("同步单创建失败:" + ex.Message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 向服务端更新售后退货信息更新状态 直发外采信息
|
// 向服务端更新售后退货信息更新状态 直发外采信息
|
||||||
public void SendAfterSaleE57(PddBuyerAfterSaleLiteInfo afterSale, bool resetSendStatus = false, bool isManualSendNoRecordCancelOrder = false)
|
public void SendAfterSaleE57(PddBuyerAfterSaleLiteInfo afterSale, bool resetSendStatus = false, bool isManualSendNoRecordCancelOrder = false)
|
||||||
{
|
{
|
||||||
@@ -2457,12 +2818,12 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
|||||||
|
|
||||||
private void btnHideAll_Click(object sender, RoutedEventArgs e)
|
private void btnHideAll_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
if (MainWindow.Instance.gridPddBuyerOrderReadCtrl.Visibility != Visibility.Visible)
|
if (MainWindow.Instance.gridTbBuyerOrderReadCtrl.Visibility != Visibility.Visible)
|
||||||
MainWindow.Instance.gridPddBuyerOrderReadCtrl.Visibility = Visibility.Visible;
|
MainWindow.Instance.gridTbBuyerOrderReadCtrl.Visibility = Visibility.Visible;
|
||||||
if (Panel.GetZIndex(MainWindow.Instance.gridPddBuyerOrderReadCtrl) < 1)
|
if (Panel.GetZIndex(MainWindow.Instance.gridTbBuyerOrderReadCtrl) < 1)
|
||||||
Panel.SetZIndex(MainWindow.Instance.gridPddBuyerOrderReadCtrl, 1);
|
Panel.SetZIndex(MainWindow.Instance.gridTbBuyerOrderReadCtrl, 1);
|
||||||
else
|
else
|
||||||
Panel.SetZIndex(MainWindow.Instance.gridPddBuyerOrderReadCtrl, -1);
|
Panel.SetZIndex(MainWindow.Instance.gridTbBuyerOrderReadCtrl, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CheckBox_Click(object sender, RoutedEventArgs e)
|
private void CheckBox_Click(object sender, RoutedEventArgs e)
|
||||||
@@ -2505,9 +2866,19 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
|||||||
if (sender is TextBox txtBuyerNick)
|
if (sender is TextBox txtBuyerNick)
|
||||||
txtBuyerNick.AddHandler(TextBox.MouseUpEvent, new MouseButtonEventHandler(txtBuyerNick_MouseLeftButtonDown), true);
|
txtBuyerNick.AddHandler(TextBox.MouseUpEvent, new MouseButtonEventHandler(txtBuyerNick_MouseLeftButtonDown), true);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public class YkdBuyerOrder
|
private void dgBuyerOrder_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void btnNextBuyer_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
isSkipNext = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class YkdBuyerOrder
|
||||||
{
|
{
|
||||||
public static string GetInitAfterSale(BuyerLoginInfo buyer, string orderSn)
|
public static string GetInitAfterSale(BuyerLoginInfo buyer, string orderSn)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,49 +1,247 @@
|
|||||||
<UserControl x:Class="_29WxOrderWpf.Ctrls.BuyerCtrls.PDDBuyerSelectCtrl"
|
<UserControl
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
x:Class="_29WxOrderWpf.Ctrls.BuyerCtrls.PDDBuyerSelectCtrl"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:c="WxOrder.Framework"
|
||||||
xmlns:local="clr-namespace:_29WxOrderWpf.Ctrls.BuyerCtrls" xmlns:userctrls="clr-namespace:_29WxOrderWpf.UserControls"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
mc:Ignorable="d" Loaded="UserControl_Loaded"
|
xmlns:local="clr-namespace:_29WxOrderWpf.Ctrls.BuyerCtrls"
|
||||||
d:DesignHeight="30" d:DesignWidth="300">
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
<Grid>
|
xmlns:userctrls="clr-namespace:_29WxOrderWpf.UserControls"
|
||||||
<Grid.ColumnDefinitions>
|
xmlns:wpf="WPFCommon"
|
||||||
<ColumnDefinition Width="auto"></ColumnDefinition>
|
d:DesignHeight="30"
|
||||||
<ColumnDefinition Width="*"></ColumnDefinition>
|
d:DesignWidth="320"
|
||||||
<ColumnDefinition Width="auto"></ColumnDefinition>
|
Loaded="UserControl_Loaded"
|
||||||
</Grid.ColumnDefinitions>
|
mc:Ignorable="d">
|
||||||
<Image Margin="4,0,0,0" Width="24" Height="24" Source="{StaticResource imgBuyerOrder}" MouseLeftButtonUp="Image_MouseLeftButtonUp" Cursor="Hand"></Image>
|
<Grid Margin="0,0,0,-26">
|
||||||
<ComboBox Grid.Column="1" x:Name="cmbPddBuyer" Margin="8,0,0,0" VerticalContentAlignment="Center" Style="{StaticResource RoundedComboBox}" Height="24"
|
<Grid.ColumnDefinitions>
|
||||||
MouseLeftButtonUp="cmbPddBuyer_MouseLeftButtonUp" SelectionChanged="cmbPddBuyer_SelectionChanged" SelectedIndex="0">
|
<ColumnDefinition Width="auto" />
|
||||||
<ComboBox.ItemTemplate>
|
<ColumnDefinition Width="auto" />
|
||||||
<DataTemplate>
|
<ColumnDefinition Width="*" />
|
||||||
<!--<Grid HorizontalAlignment="Stretch" MinWidth="{Binding RelativeSource={RelativeSource Self}, Path=ActualWidth}">-->
|
</Grid.ColumnDefinitions>
|
||||||
<Grid HorizontalAlignment="Stretch" MinWidth="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type ComboBox}},
|
|
||||||
Path=ActualWidth, Converter={StaticResource ValueMinus24Converter}}" Height="auto">
|
|
||||||
<Grid.ColumnDefinitions>
|
<wpf:SpacingStackPanel
|
||||||
<ColumnDefinition Width="120*"></ColumnDefinition>
|
Grid.Column="1"
|
||||||
<ColumnDefinition Width="auto"></ColumnDefinition>
|
VerticalAlignment="Center"
|
||||||
<ColumnDefinition Width="auto"></ColumnDefinition>
|
Orientation="Vertical"
|
||||||
</Grid.ColumnDefinitions>
|
VerticalSpacing="2">
|
||||||
<TextBlock x:Name="tbName" Text="{Binding buyer_nick}" VerticalAlignment="Center"/>
|
<WrapPanel x:Name="wpPddBuyer">
|
||||||
<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"
|
<Image
|
||||||
x:Name="btnDeleteItem" Tag="{Binding ElementName=tbName, Path=Text}" HorizontalAlignment="Right" VerticalAlignment="Center"
|
Width="24"
|
||||||
Click="btnDeleteItem_Click"/>
|
Height="24"
|
||||||
<TextBlock x:Name="tbStatus" Text="{Binding status}" Foreground="{Binding status, Converter={StaticResource statusToColorBrushConverter}}" Grid.Column="2"
|
Margin="4,0,0,0"
|
||||||
VerticalAlignment="Center"/>
|
Cursor="Hand"
|
||||||
</Grid>
|
MouseLeftButtonUp="Image_MouseLeftButtonUp"
|
||||||
<DataTemplate.Triggers>
|
Source="{StaticResource imgBuyerOrder}" />
|
||||||
<Trigger Property="IsMouseOver" Value="True">
|
|
||||||
<Setter TargetName="btnDeleteItem" Property="Visibility" Value="Visible"/>
|
<CheckBox
|
||||||
</Trigger>
|
x:Name="chkPddBuyerLogin"
|
||||||
</DataTemplate.Triggers>
|
Margin="2,2,2,2"
|
||||||
</DataTemplate>
|
HorizontalAlignment="Left"
|
||||||
</ComboBox.ItemTemplate>
|
VerticalAlignment="Center"
|
||||||
</ComboBox>
|
VerticalContentAlignment="Center"
|
||||||
<!--<TextBlock Text="选择买手" Grid.Column="12" Margin="12,0,0,0" VerticalAlignment="Center" IsHitTestVisible="False" Foreground="LightGray"
|
d:IsChecked="True"
|
||||||
Visibility="{Binding ElementName=cmbBuyer,Path=Text,Converter={StaticResource NotHasTextVisibility}}"></TextBlock>-->
|
BorderBrush="{StaticResource mainColorBrush}"
|
||||||
<Button Grid.Column="2" x:Name="btnLoginPdd" Style="{StaticResource BasePageButtonStyle}" Margin="4,0,0,0"
|
Click="chkBuyerLogin_Click"
|
||||||
Content="多多登录" Width="56" Height="24" Click="btnLoginPdd_Click"/>
|
FontSize="12"
|
||||||
</Grid>
|
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>
|
</UserControl>
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
using _29WxOrderWpf.BaseWindows;
|
using _29WxOrderWpf.BaseWindows;
|
||||||
using _29WxOrderWpf.Common;
|
using _29WxOrderWpf.Ctrls.OrderCtrls;
|
||||||
using _29WxOrderWpf.ViewModels;
|
using _29WxOrderWpf.ViewModels;
|
||||||
using _29WxOrderWpf.Views;
|
using _29WxOrderWpf.Views;
|
||||||
using AllBase;
|
using AllBase;
|
||||||
@@ -24,6 +24,7 @@ using System.Windows.Shapes;
|
|||||||
using TemuKJD.ToolForms;
|
using TemuKJD.ToolForms;
|
||||||
using Work;
|
using Work;
|
||||||
using Work.BaseForms;
|
using Work.BaseForms;
|
||||||
|
using WxOrder.Framework.Commons;
|
||||||
|
|
||||||
namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
||||||
{
|
{
|
||||||
@@ -40,6 +41,7 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
|||||||
private void UserControl_Loaded(object sender, RoutedEventArgs e)
|
private void UserControl_Loaded(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
cmbPddBuyer.ItemsSource = GlobalConfig.PDDBuyerLoginList;
|
cmbPddBuyer.ItemsSource = GlobalConfig.PDDBuyerLoginList;
|
||||||
|
cmbTaobaoBuyer.ItemsSource = GlobalConfig.TaobaoBuyerLoginList;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void btnLoginPdd_Click(object sender, RoutedEventArgs e)
|
private void btnLoginPdd_Click(object sender, RoutedEventArgs e)
|
||||||
@@ -145,48 +147,249 @@ 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)
|
private void Image_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
|
||||||
{
|
{
|
||||||
if (MainWindow.Instance.gridPddBuyerOrderReadCtrl.Visibility != Visibility.Visible)
|
if (MainWindow.Instance.gridTbBuyerOrderReadCtrl.Visibility != Visibility.Visible)
|
||||||
MainWindow.Instance.gridPddBuyerOrderReadCtrl.Visibility = Visibility.Visible;
|
MainWindow.Instance.gridTbBuyerOrderReadCtrl.Visibility = Visibility.Visible;
|
||||||
if (Panel.GetZIndex(MainWindow.Instance.gridPddBuyerOrderReadCtrl) < 1)
|
if (Panel.GetZIndex(MainWindow.Instance.gridTbBuyerOrderReadCtrl) < 1)
|
||||||
Panel.SetZIndex(MainWindow.Instance.gridPddBuyerOrderReadCtrl, 1);
|
Panel.SetZIndex(MainWindow.Instance.gridTbBuyerOrderReadCtrl, 1);
|
||||||
else
|
else
|
||||||
Panel.SetZIndex(MainWindow.Instance.gridPddBuyerOrderReadCtrl, -1);
|
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();
|
||||||
|
orderItem.SetAbnormalAndDirectBtnVisibility();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
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();
|
||||||
|
orderItem.SetAbnormalAndDirectBtnVisibility();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,598 @@
|
|||||||
|
<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>
|
||||||
@@ -0,0 +1,95 @@
|
|||||||
|
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
@@ -0,0 +1,563 @@
|
|||||||
|
<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>
|
||||||
@@ -0,0 +1,106 @@
|
|||||||
|
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
@@ -0,0 +1,735 @@
|
|||||||
|
<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.Controls;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
using TinyPinyin;
|
using WxOrder.Framework.Commons.pinyin;
|
||||||
|
|
||||||
namespace _29WxOrderWpf.Ctrls.Commons
|
namespace _29WxOrderWpf.Ctrls.Commons
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using _29WxOrderWpf.BaseWindows;
|
using _29WxOrderWpf.BaseWindows;
|
||||||
using _29WxOrderWpf.Commands;
|
using WxOrder.Framework.Commons;
|
||||||
using _29WxOrderWpf.Common;
|
using WxOrder.Framework.Commons;
|
||||||
using _29WxOrderWpf.Ctrls.PDDInvoice;
|
using _29WxOrderWpf.Ctrls.PDDInvoice;
|
||||||
using _29WxOrderWpf.Ctrls.Statistics;
|
using _29WxOrderWpf.Ctrls.Statistics;
|
||||||
using _29WxOrderWpf.Services;
|
using _29WxOrderWpf.Services;
|
||||||
@@ -15,6 +15,7 @@ using System.Threading.Tasks;
|
|||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using Work._29Tools.BLL;
|
using Work._29Tools.BLL;
|
||||||
|
using WxOrder.Framework.Commons.Dialogs;
|
||||||
using static _29WxOrderWpf.Services.ShipGiftService;
|
using static _29WxOrderWpf.Services.ShipGiftService;
|
||||||
|
|
||||||
namespace _29WxOrderWpf.Ctrls.OrderCtrls;
|
namespace _29WxOrderWpf.Ctrls.OrderCtrls;
|
||||||
@@ -22,22 +23,18 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls;
|
|||||||
public partial class OrderListCtrl
|
public partial class OrderListCtrl
|
||||||
{
|
{
|
||||||
#region 统计
|
#region 统计
|
||||||
private DialogWindow _statisticsDialog;
|
private ShopRevenueStatisticsView _statisticsDialog;
|
||||||
public ICommand ShowShopRevenueStatisticsDialogViewCommand => new DelegateCommand(ShowShopRevenueStatisticsDialogView);
|
public ICommand ShowShopRevenueStatisticsDialogViewCommand => new DelegateCommand(ShowShopRevenueStatisticsDialogView);
|
||||||
|
|
||||||
private void ShowShopRevenueStatisticsDialogView()
|
private void ShowShopRevenueStatisticsDialogView()
|
||||||
{
|
{
|
||||||
if (_statisticsDialog == null)
|
if (_statisticsDialog == null)
|
||||||
{
|
{
|
||||||
_statisticsDialog = new DialogWindow()
|
_statisticsDialog = new ShopRevenueStatisticsView();
|
||||||
{
|
|
||||||
Title = "统计",
|
|
||||||
Content = new ShopRevenueStatisticsView(),
|
|
||||||
|
|
||||||
};
|
|
||||||
_statisticsDialog.Closed += (s, e) => _statisticsDialog = null;
|
_statisticsDialog.Closed += (s, e) => _statisticsDialog = null;
|
||||||
}
|
}
|
||||||
_statisticsDialog.Show();
|
_statisticsDialog.Show();
|
||||||
|
_statisticsDialog.Activate();
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
@@ -312,11 +309,8 @@ public partial class OrderListCtrl
|
|||||||
|
|
||||||
private void ShowPDDInvoiceDialog()
|
private void ShowPDDInvoiceDialog()
|
||||||
{
|
{
|
||||||
new DialogWindow
|
var view = new PDDInvoiceView();
|
||||||
{
|
DialogService.ShowOrActivateWindow(view);
|
||||||
Title = "发票助手",
|
|
||||||
Content = new PDDInvoiceView()
|
|
||||||
}.Show();
|
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
x:Class="_29WxOrderWpf.Ctrls.OrderCtrls.OrderListCtrl"
|
x:Class="_29WxOrderWpf.Ctrls.OrderCtrls.OrderListCtrl"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:c="clr-namespace:_29WxOrderWpf.Common"
|
xmlns:c="WxOrder.Framework"
|
||||||
xmlns:converters="clr-namespace:_29WxOrderWpf.Converters"
|
xmlns:converters="clr-namespace:_29WxOrderWpf.Converters"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:local="clr-namespace:_29WxOrderWpf.Ctrls.OrderCtrls"
|
xmlns:local="clr-namespace:_29WxOrderWpf.Ctrls.OrderCtrls"
|
||||||
@@ -10,6 +10,7 @@
|
|||||||
xmlns:usercontrols="clr-namespace:_29WxOrderWpf.UserControls"
|
xmlns:usercontrols="clr-namespace:_29WxOrderWpf.UserControls"
|
||||||
xmlns:utils="clr-namespace:_29WxOrderWpf.Utils"
|
xmlns:utils="clr-namespace:_29WxOrderWpf.Utils"
|
||||||
xmlns:wpf="WPFCommon"
|
xmlns:wpf="WPFCommon"
|
||||||
|
d:DataContext="{d:DesignInstance Type=local:OrderListCtrl}"
|
||||||
d:DesignHeight="450"
|
d:DesignHeight="450"
|
||||||
d:DesignWidth="1560"
|
d:DesignWidth="1560"
|
||||||
Loaded="Window_Loaded"
|
Loaded="Window_Loaded"
|
||||||
@@ -144,6 +145,7 @@
|
|||||||
VerticalContentAlignment="Center"
|
VerticalContentAlignment="Center"
|
||||||
BorderBrush="Transparent"
|
BorderBrush="Transparent"
|
||||||
SelectedIndex="0"
|
SelectedIndex="0"
|
||||||
|
SelectionChanged="cmbTimeType_SelectionChanged"
|
||||||
Style="{StaticResource RoundedComboBox}"
|
Style="{StaticResource RoundedComboBox}"
|
||||||
Text="更新时间">
|
Text="更新时间">
|
||||||
<ComboBoxItem>
|
<ComboBoxItem>
|
||||||
@@ -168,7 +170,8 @@
|
|||||||
Grid.Column="7"
|
Grid.Column="7"
|
||||||
Margin="0,0,14,0"
|
Margin="0,0,14,0"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
BorderThickness="0" />
|
BorderThickness="0"
|
||||||
|
SelectedDate="{Binding DateStart}" />
|
||||||
|
|
||||||
<!-- 结束时间 -->
|
<!-- 结束时间 -->
|
||||||
<Border
|
<Border
|
||||||
@@ -184,7 +187,8 @@
|
|||||||
Grid.Column="8"
|
Grid.Column="8"
|
||||||
Margin="10,0,4,0"
|
Margin="10,0,4,0"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
BorderThickness="0" />
|
BorderThickness="0"
|
||||||
|
SelectedDate="{Binding DateEnd}" />
|
||||||
<CheckBox
|
<CheckBox
|
||||||
x:Name="chkEndDate"
|
x:Name="chkEndDate"
|
||||||
Grid.Column="8"
|
Grid.Column="8"
|
||||||
@@ -192,6 +196,7 @@
|
|||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
BorderBrush="{StaticResource mainColorBrush}"
|
BorderBrush="{StaticResource mainColorBrush}"
|
||||||
|
Click="chkEndDate_Click"
|
||||||
FontSize="12" />
|
FontSize="12" />
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
@@ -260,17 +265,15 @@
|
|||||||
Unchecked="chkAutoReadBuyerOrder_CheckedChanged" />
|
Unchecked="chkAutoReadBuyerOrder_CheckedChanged" />
|
||||||
|
|
||||||
<CheckBox
|
<CheckBox
|
||||||
x:Name="chkHideGreenFlag"
|
x:Name="chkSyncDirectOrderWaybill"
|
||||||
Grid.Column="12"
|
|
||||||
Margin="2,0"
|
Margin="2,0"
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
d:IsChecked="True"
|
|
||||||
BorderBrush="{StaticResource mainColorBrush}"
|
BorderBrush="{StaticResource mainColorBrush}"
|
||||||
Click="chkHideGreenFlag_Click"
|
Click="chkSyncDirectOrderWaybill_Click"
|
||||||
Content="隐藏标记订单"
|
Content="同步物流单"
|
||||||
FontSize="12"
|
FontSize="12"
|
||||||
IsChecked="{Binding orderFilterConfig.chkHideGreenFlagIsChecked}" />
|
IsChecked="False" />
|
||||||
</WrapPanel>
|
</WrapPanel>
|
||||||
|
|
||||||
<wpf:SpacingStackPanel Grid.Column="13" HorizontalSpacing="5">
|
<wpf:SpacingStackPanel Grid.Column="13" HorizontalSpacing="5">
|
||||||
@@ -303,6 +306,26 @@
|
|||||||
Grid.Row="1"
|
Grid.Row="1"
|
||||||
Margin="8,0,0,2">
|
Margin="8,0,0,2">
|
||||||
<WrapPanel x:Name="wpFilter" VerticalAlignment="Top">
|
<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
|
<CheckBox
|
||||||
x:Name="chkOnlyWarehouseOrder"
|
x:Name="chkOnlyWarehouseOrder"
|
||||||
Margin="0,2,3,2"
|
Margin="0,2,3,2"
|
||||||
@@ -329,14 +352,7 @@
|
|||||||
FontSize="12"
|
FontSize="12"
|
||||||
IsChecked="{Binding orderFilterConfig.chkNoMultiOrderIsChecked}"
|
IsChecked="{Binding orderFilterConfig.chkNoMultiOrderIsChecked}"
|
||||||
Unchecked="chkSubFilterSonditions_Checked" />
|
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
|
<CheckBox
|
||||||
x:Name="chkTransitOrder"
|
x:Name="chkTransitOrder"
|
||||||
Margin="0,2,3,2"
|
Margin="0,2,3,2"
|
||||||
@@ -472,8 +488,8 @@
|
|||||||
SelectedIndex="0"
|
SelectedIndex="0"
|
||||||
SelectionChanged="ComboBox_SelectionChanged"
|
SelectionChanged="ComboBox_SelectionChanged"
|
||||||
Style="{StaticResource RoundedComboBox}">
|
Style="{StaticResource RoundedComboBox}">
|
||||||
<ComboBoxItem Content="1.55" />
|
<ComboBoxItem Content="礼品一" />
|
||||||
<ComboBoxItem Content="1.6" />
|
<ComboBoxItem Content="礼品二(实物)" />
|
||||||
</ComboBox>
|
</ComboBox>
|
||||||
</wpf:TitleContent>
|
</wpf:TitleContent>
|
||||||
<Button
|
<Button
|
||||||
@@ -486,6 +502,24 @@
|
|||||||
Content="同步订单"
|
Content="同步订单"
|
||||||
Style="{StaticResource BasePageButtonStyle}"
|
Style="{StaticResource BasePageButtonStyle}"
|
||||||
ToolTip="同步选中的订单或选中的店铺" />
|
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>
|
</WrapPanel>
|
||||||
</Border>
|
</Border>
|
||||||
<Grid
|
<Grid
|
||||||
@@ -570,9 +604,10 @@
|
|||||||
</TabControl.Resources>
|
</TabControl.Resources>
|
||||||
<TabItem
|
<TabItem
|
||||||
MinWidth="60"
|
MinWidth="60"
|
||||||
|
d:Header="待采购"
|
||||||
Background="Transparent"
|
Background="Transparent"
|
||||||
BorderBrush="Transparent"
|
BorderBrush="Transparent"
|
||||||
Header="待采购"
|
Header="{Binding WaitBuyTabTxt}"
|
||||||
SizeChanged="TabItem_SizeChanged">
|
SizeChanged="TabItem_SizeChanged">
|
||||||
<Border
|
<Border
|
||||||
Padding="0,10"
|
Padding="0,10"
|
||||||
@@ -596,7 +631,7 @@
|
|||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
BorderBrush="{StaticResource mainColorBrush}"
|
BorderBrush="{StaticResource mainColorBrush}"
|
||||||
Click="chkMapProd_Click"
|
Click="chkMapProd_Click"
|
||||||
Content="已关联商品"
|
Content="选择SKU"
|
||||||
FontSize="12" />
|
FontSize="12" />
|
||||||
<CheckBox
|
<CheckBox
|
||||||
x:Name="chkMapSku"
|
x:Name="chkMapSku"
|
||||||
@@ -607,7 +642,37 @@
|
|||||||
Click="chkMapProd_Click"
|
Click="chkMapProd_Click"
|
||||||
Content="已关联拍单"
|
Content="已关联拍单"
|
||||||
FontSize="12" />
|
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
|
<Button
|
||||||
Width="Auto"
|
Width="Auto"
|
||||||
Height="22"
|
Height="22"
|
||||||
@@ -623,35 +688,58 @@
|
|||||||
</TabItem>
|
</TabItem>
|
||||||
<TabItem
|
<TabItem
|
||||||
MinWidth="60"
|
MinWidth="60"
|
||||||
|
d:Header="异常需重拍"
|
||||||
Background="Transparent"
|
Background="Transparent"
|
||||||
BorderBrush="Transparent"
|
BorderBrush="Transparent"
|
||||||
Foreground="#FFEE0099"
|
Foreground="#FFEE0099"
|
||||||
Header="异常需重拍"
|
Header="{Binding AbnormalTabTxt}"
|
||||||
SizeChanged="TabItem_SizeChanged" />
|
SizeChanged="TabItem_SizeChanged" />
|
||||||
<TabItem
|
<TabItem
|
||||||
MinWidth="60"
|
MinWidth="60"
|
||||||
Header="待发货"
|
d:Header="待发货"
|
||||||
|
Header="{Binding WaitSendTabTxt}"
|
||||||
SizeChanged="TabItem_SizeChanged">
|
SizeChanged="TabItem_SizeChanged">
|
||||||
<Border
|
<Border
|
||||||
Margin="4,0,4,4"
|
Margin="4,0,4,4"
|
||||||
BorderBrush="#e0e0e0"
|
BorderBrush="#e0e0e0"
|
||||||
BorderThickness="0,0,0,1">
|
BorderThickness="0,0,0,1">
|
||||||
<CheckBox
|
<WrapPanel>
|
||||||
x:Name="chkDirectSendFailed"
|
<CheckBox
|
||||||
Margin="6,8"
|
x:Name="chkDirectSendFailed"
|
||||||
HorizontalAlignment="Left"
|
Margin="6,8"
|
||||||
VerticalAlignment="Center"
|
HorizontalAlignment="Left"
|
||||||
BorderBrush="{StaticResource mainColorBrush}"
|
VerticalAlignment="Center"
|
||||||
Click="chkDirectSendFailed_Click"
|
BorderBrush="{StaticResource mainColorBrush}"
|
||||||
Content="直拍发货失败"
|
Click="chkDirectSendFailed_Click"
|
||||||
FontSize="12" />
|
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>
|
||||||
</Border>
|
</Border>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
<TabItem
|
<TabItem
|
||||||
MinWidth="60"
|
MinWidth="60"
|
||||||
|
d:Header="待收货"
|
||||||
Background="Transparent"
|
Background="Transparent"
|
||||||
BorderBrush="Transparent"
|
BorderBrush="Transparent"
|
||||||
Header="待收货"
|
Header="{Binding WaitReceiveTabTxt}"
|
||||||
SizeChanged="TabItem_SizeChanged">
|
SizeChanged="TabItem_SizeChanged">
|
||||||
<Border
|
<Border
|
||||||
Margin="4,0,4,4"
|
Margin="4,0,4,4"
|
||||||
@@ -670,15 +758,43 @@
|
|||||||
<ColumnDefinition Width="auto" />
|
<ColumnDefinition Width="auto" />
|
||||||
<ColumnDefinition Width="*" />
|
<ColumnDefinition Width="*" />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<CheckBox
|
<WrapPanel>
|
||||||
x:Name="chkNeedCheckExpress"
|
<CheckBox
|
||||||
Margin="6,8"
|
x:Name="chkNeedCheckExpress"
|
||||||
HorizontalAlignment="Left"
|
Margin="6,8"
|
||||||
VerticalAlignment="Center"
|
HorizontalAlignment="Left"
|
||||||
BorderBrush="{StaticResource mainColorBrush}"
|
VerticalAlignment="Center"
|
||||||
Click="chkNeedCheckExpress_Click"
|
BorderBrush="{StaticResource mainColorBrush}"
|
||||||
Content="需核对物流"
|
Click="chkNeedCheckExpress_Click"
|
||||||
FontSize="12" />
|
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>
|
||||||
<WrapPanel
|
<WrapPanel
|
||||||
Grid.Column="2"
|
Grid.Column="2"
|
||||||
d:Opacity="0.2"
|
d:Opacity="0.2"
|
||||||
@@ -759,10 +875,11 @@
|
|||||||
</TabItem>
|
</TabItem>
|
||||||
<TabItem
|
<TabItem
|
||||||
MinWidth="60"
|
MinWidth="60"
|
||||||
|
d:Header="需处理售后单"
|
||||||
Background="#FF6666"
|
Background="#FF6666"
|
||||||
BorderBrush="Transparent"
|
BorderBrush="Transparent"
|
||||||
Foreground="#FF2222"
|
Foreground="#FF2222"
|
||||||
Header="需处理售后单"
|
Header="{Binding EmergencyManualReturnOrderTabTxt}"
|
||||||
SizeChanged="TabItem_SizeChanged">
|
SizeChanged="TabItem_SizeChanged">
|
||||||
<Border
|
<Border
|
||||||
Margin="4,0,4,4"
|
Margin="4,0,4,4"
|
||||||
@@ -981,13 +1098,14 @@
|
|||||||
<ComboBoxItem Content="请选择" />
|
<ComboBoxItem Content="请选择" />
|
||||||
<ComboBoxItem Content="未申请" />
|
<ComboBoxItem Content="未申请" />
|
||||||
<ComboBoxItem Content="申请中" />
|
<ComboBoxItem Content="申请中" />
|
||||||
<ComboBoxItem Content="拒收失败" />
|
<ComboBoxItem Content="申请失败" />
|
||||||
|
<ComboBoxItem Content="申请成功" />
|
||||||
<ComboBoxItem Content="拒收成功" />
|
<ComboBoxItem Content="拒收成功" />
|
||||||
</ComboBox>
|
</ComboBox>
|
||||||
</wpf:TitleContent>
|
</wpf:TitleContent>
|
||||||
<wpf:TitleContent
|
<wpf:TitleContent
|
||||||
Title="拦截退回总店状态"
|
Title="拦截退回总店状态"
|
||||||
Margin="4,0,4,0"
|
Margin="8,0,4,0"
|
||||||
VerticalContentAlignment="Center"
|
VerticalContentAlignment="Center"
|
||||||
FontSize="12"
|
FontSize="12"
|
||||||
Foreground="Black"
|
Foreground="Black"
|
||||||
@@ -1003,7 +1121,7 @@
|
|||||||
<ComboBoxItem Content="请选择" />
|
<ComboBoxItem Content="请选择" />
|
||||||
<ComboBoxItem Content="未拦截" />
|
<ComboBoxItem Content="未拦截" />
|
||||||
<ComboBoxItem Content="拦截中" />
|
<ComboBoxItem Content="拦截中" />
|
||||||
<!--<ComboBoxItem Content="拦截失败" />-->
|
<ComboBoxItem Content="拦截失败" />
|
||||||
<ComboBoxItem Content="拦截成功" />
|
<ComboBoxItem Content="拦截成功" />
|
||||||
</ComboBox>
|
</ComboBox>
|
||||||
</wpf:TitleContent>
|
</wpf:TitleContent>
|
||||||
@@ -1036,10 +1154,11 @@
|
|||||||
</TabItem>
|
</TabItem>
|
||||||
<TabItem
|
<TabItem
|
||||||
MinWidth="60"
|
MinWidth="60"
|
||||||
|
d:Header="退货仓自动售后单"
|
||||||
Background="Transparent"
|
Background="Transparent"
|
||||||
BorderBrush="Transparent"
|
BorderBrush="Transparent"
|
||||||
Foreground="#FF7744"
|
Foreground="#FF7744"
|
||||||
Header="退货仓自动售后单"
|
Header="{Binding EmergencyDistribReturnOrderTabTxt}"
|
||||||
SizeChanged="TabItem_SizeChanged">
|
SizeChanged="TabItem_SizeChanged">
|
||||||
<Border
|
<Border
|
||||||
Margin="4,0,4,4"
|
Margin="4,0,4,4"
|
||||||
@@ -1060,17 +1179,7 @@
|
|||||||
<ColumnDefinition Width="*" />
|
<ColumnDefinition Width="*" />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<WrapPanel>
|
<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
|
<CheckBox
|
||||||
x:Name="chkShopIsRefund"
|
x:Name="chkShopIsRefund"
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
@@ -1109,16 +1218,83 @@
|
|||||||
Click="chkUpShopAddressAnalyseFailed_Click"
|
Click="chkUpShopAddressAnalyseFailed_Click"
|
||||||
Content="总店地址解析失败"
|
Content="总店地址解析失败"
|
||||||
FontSize="12" />
|
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>
|
</WrapPanel>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Border>
|
</Border>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
<TabItem
|
<TabItem
|
||||||
MinWidth="60"
|
MinWidth="60"
|
||||||
|
d:Header="售后完成单"
|
||||||
Background="Transparent"
|
Background="Transparent"
|
||||||
BorderBrush="Transparent"
|
BorderBrush="Transparent"
|
||||||
Foreground="#FFaa77"
|
Foreground="#FFaa77"
|
||||||
Header="售后完成单"
|
Header="{Binding RefundTabTxt}"
|
||||||
SizeChanged="TabItem_SizeChanged">
|
SizeChanged="TabItem_SizeChanged">
|
||||||
<Border
|
<Border
|
||||||
Margin="4,0,4,4"
|
Margin="4,0,4,4"
|
||||||
@@ -1206,9 +1382,10 @@
|
|||||||
</TabItem>
|
</TabItem>
|
||||||
<TabItem
|
<TabItem
|
||||||
MinWidth="60"
|
MinWidth="60"
|
||||||
|
d:Header="全部订单"
|
||||||
Background="Transparent"
|
Background="Transparent"
|
||||||
BorderBrush="Transparent"
|
BorderBrush="Transparent"
|
||||||
Header="全部订单"
|
Header="{Binding AllOrderTabTxt}"
|
||||||
SizeChanged="TabItem_SizeChanged" />
|
SizeChanged="TabItem_SizeChanged" />
|
||||||
<!--<TabItem Header="发货异常">
|
<!--<TabItem Header="发货异常">
|
||||||
<Grid Background="#FFE5E5E5"/>
|
<Grid Background="#FFE5E5E5"/>
|
||||||
@@ -1322,7 +1499,11 @@
|
|||||||
HorizontalContentAlignment="Stretch"
|
HorizontalContentAlignment="Stretch"
|
||||||
BorderThickness="0"
|
BorderThickness="0"
|
||||||
ScrollViewer.CanContentScroll="True"
|
ScrollViewer.CanContentScroll="True"
|
||||||
VirtualizingPanel.ScrollUnit="Pixel">
|
VirtualizingPanel.IsVirtualizingWhenGrouping="True"
|
||||||
|
VirtualizingPanel.ScrollUnit="Pixel"
|
||||||
|
VirtualizingStackPanel.IsVirtualizing="True"
|
||||||
|
VirtualizingStackPanel.VirtualizationMode="Recycling">
|
||||||
|
<!-- VirtualizingStackPanel.VirtualizationMode="Recycling" -->
|
||||||
<!-- 使用自定义属性模板去除ListBox高亮显示框 -->
|
<!-- 使用自定义属性模板去除ListBox高亮显示框 -->
|
||||||
<ListBox.ItemContainerStyle>
|
<ListBox.ItemContainerStyle>
|
||||||
<Style TargetType="ListBoxItem">
|
<Style TargetType="ListBoxItem">
|
||||||
|
|||||||
File diff suppressed because it is too large.
Load diff
@@ -43,8 +43,53 @@
|
|||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="6" />
|
<RowDefinition Height="6" />
|
||||||
<RowDefinition Height="auto" />
|
<RowDefinition Height="auto" />
|
||||||
|
<RowDefinition Height="auto" />
|
||||||
|
<RowDefinition Height="auto" />
|
||||||
|
<RowDefinition Height="auto" />
|
||||||
|
<RowDefinition Height="auto" />
|
||||||
<RowDefinition Height="6" />
|
<RowDefinition Height="6" />
|
||||||
</Grid.RowDefinitions>
|
</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>
|
</Grid>
|
||||||
</Border>
|
</Border>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|||||||
@@ -41,21 +41,23 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
|||||||
|
|
||||||
private async void OrderListRowCtrl_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
|
private async void OrderListRowCtrl_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
|
||||||
{
|
{
|
||||||
if (this.DataContext is oms_wei_order_info order)
|
//await Task.Run(() => { Thread.Sleep(1); });
|
||||||
{
|
|
||||||
int index = 0;
|
//if (this.DataContext is oms_wei_order_info order)
|
||||||
foreach (var orderItem in order.orderItems)
|
//{
|
||||||
{
|
// int index = 0;
|
||||||
gridChildOrder.RowDefinitions.Insert(gridChildOrder.RowDefinitions.Count - 1, new RowDefinition() { Height = GridLength.Auto });
|
// foreach (var orderItem in order.orderItems)
|
||||||
index++;
|
// {
|
||||||
var rowItem = new OrderListRowItemCtrl() { DataContext = orderItem, Name = "rowItem" + index };
|
// gridChildOrder.RowDefinitions.Insert(gridChildOrder.RowDefinitions.Count - 1, new RowDefinition() { Height = GridLength.Auto });
|
||||||
Grid.SetRow(rowItem, index);
|
// index++;
|
||||||
this.gridChildOrder.Children.Add(rowItem);
|
// var rowItem = new OrderListRowItemCtrl() { DataContext = orderItem, Name = "rowItem" + index };
|
||||||
if (index >= 5)
|
// Grid.SetRow(rowItem, index);
|
||||||
break;
|
// this.gridChildOrder.Children.Add(rowItem);
|
||||||
}
|
// if (index >= 5)
|
||||||
}
|
// break;
|
||||||
}
|
// }
|
||||||
|
//}
|
||||||
|
}
|
||||||
|
|
||||||
private void CheckBox_Click(object sender, RoutedEventArgs e)
|
private void CheckBox_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -39,7 +39,7 @@
|
|||||||
Foreground="{Binding OrderBuyTypeColor}"
|
Foreground="{Binding OrderBuyTypeColor}"
|
||||||
IsReadOnly="True"
|
IsReadOnly="True"
|
||||||
Text="{Binding OrderBuyType}"
|
Text="{Binding OrderBuyType}"
|
||||||
Visibility="{Binding OrderBuyType, Converter={StaticResource HasTextVisibility}}" />
|
Visibility="{Binding OrderBuyTypeVisibility}" />
|
||||||
<TextBox
|
<TextBox
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Margin="8,8,-4,8"
|
Margin="8,8,-4,8"
|
||||||
@@ -158,7 +158,7 @@
|
|||||||
BorderThickness="0"
|
BorderThickness="0"
|
||||||
FontSize="7"
|
FontSize="7"
|
||||||
FontWeight="Bold"
|
FontWeight="Bold"
|
||||||
Foreground="{Binding Shop.LoginStatusStr, Converter={StaticResource statusToColorBrushConverter}}"
|
Foreground="{Binding Shop.LoginStatusStrColor}"
|
||||||
IsReadOnly="True"
|
IsReadOnly="True"
|
||||||
Text="{Binding Shop.LoginStatusStr}"
|
Text="{Binding Shop.LoginStatusStr}"
|
||||||
WaterMark="店铺状态" />
|
WaterMark="店铺状态" />
|
||||||
@@ -205,8 +205,9 @@
|
|||||||
Background="Transparent"
|
Background="Transparent"
|
||||||
BorderThickness="0"
|
BorderThickness="0"
|
||||||
FontSize="14"
|
FontSize="14"
|
||||||
Foreground="Gray"
|
Foreground="#FF8888"
|
||||||
IsReadOnly="True"
|
IsReadOnly="True"
|
||||||
|
Text="{Binding OrderDiffItemCountStr}"
|
||||||
WaterMark="该订单共有 1 条不同商品记录" />
|
WaterMark="该订单共有 1 条不同商品记录" />
|
||||||
|
|
||||||
<TextBlock
|
<TextBlock
|
||||||
@@ -221,7 +222,6 @@
|
|||||||
x:Name="borderFlag"
|
x:Name="borderFlag"
|
||||||
Grid.Column="12"
|
Grid.Column="12"
|
||||||
Width="auto"
|
Width="auto"
|
||||||
Height="15"
|
|
||||||
Margin="2"
|
Margin="2"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Background="Transparent"
|
Background="Transparent"
|
||||||
@@ -229,6 +229,13 @@
|
|||||||
MouseLeftButtonDown="borderFlag_MouseLeftButtonDown">
|
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" />-->
|
<!--<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">
|
<WrapPanel VerticalAlignment="Center">
|
||||||
|
<Button
|
||||||
|
Width="60"
|
||||||
|
Height="22"
|
||||||
|
Margin="0,0,10,0"
|
||||||
|
Click="btn_createOrderSupportTicket"
|
||||||
|
Content="创建工单"
|
||||||
|
Style="{StaticResource BasePageButtonStyle}" />
|
||||||
<TextBlock
|
<TextBlock
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
FontSize="12"
|
FontSize="12"
|
||||||
@@ -240,9 +247,10 @@
|
|||||||
Margin="2,0,0,0"
|
Margin="2,0,0,0"
|
||||||
d:Fill="SkyBlue"
|
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"
|
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 colour_flag, Converter={StaticResource flagColorConverter}}"
|
Fill="{Binding ColourFlagBrush}"
|
||||||
Stretch="Uniform" />
|
Stretch="Uniform" />
|
||||||
|
<!-- ColourFlagBrush -->
|
||||||
|
<!-- Fill="{Binding colour_flag, Converter={StaticResource flagColorConverter}}" -->
|
||||||
</WrapPanel>
|
</WrapPanel>
|
||||||
</Border>
|
</Border>
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ using AllBase;
|
|||||||
using AllBase.Helper;
|
using AllBase.Helper;
|
||||||
using AllBase.Model.DBModel;
|
using AllBase.Model.DBModel;
|
||||||
using NaiBa.Util.Extension;
|
using NaiBa.Util.Extension;
|
||||||
|
using OrderSupportTicket.Models;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@@ -25,43 +26,43 @@ using Work._29Tools.Forms.ShopForms;
|
|||||||
|
|
||||||
namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// OrderListRowHeaderCtrl.xaml 的交互逻辑
|
/// OrderListRowHeaderCtrl.xaml 的交互逻辑
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class OrderListRowHeaderCtrl : UserControl
|
public partial class OrderListRowHeaderCtrl : UserControl
|
||||||
{
|
{
|
||||||
public OrderListRowHeaderCtrl()
|
public OrderListRowHeaderCtrl()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
this.DataContextChanged += OrderListRowHeaderCtrl_DataContextChanged;
|
this.DataContextChanged += OrderListRowHeaderCtrl_DataContextChanged;
|
||||||
txtOrderId.AddHandler(TextBox.MouseUpEvent, new MouseButtonEventHandler(txtOrderId_MouseLeftButtonUp), true);
|
txtOrderId.AddHandler(TextBox.MouseUpEvent, new MouseButtonEventHandler(txtOrderId_MouseLeftButtonUp), true);
|
||||||
txtShopName.AddHandler(TextBox.MouseUpEvent, new MouseButtonEventHandler(txtShopName_MouseLeftButtonUp), true);
|
txtShopName.AddHandler(TextBox.MouseUpEvent, new MouseButtonEventHandler(txtShopName_MouseLeftButtonUp), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void txtShopName_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
|
private void txtShopName_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
|
||||||
{
|
{
|
||||||
if (this.DataContext is oms_wei_order_info order)
|
if (this.DataContext is oms_wei_order_info order)
|
||||||
{
|
{
|
||||||
var shop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ErpShopId == order.shop_id.ParseToString());
|
var shop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ErpShopId == order.shop_id.ParseToString());
|
||||||
if (shop != null)
|
if (shop != null)
|
||||||
{
|
{
|
||||||
WXShopLoginForm shopLoginForm = new WXShopLoginForm(shop);
|
WXShopLoginForm shopLoginForm = new WXShopLoginForm(shop);
|
||||||
ShopBLL.CheckShopLogin(shop);
|
ShopBLL.CheckShopLogin(shop);
|
||||||
if (shop.LoginStatus == "登录成功")
|
if (shop.LoginStatus == "登录成功")
|
||||||
{
|
{
|
||||||
// 在线直接进店
|
// 在线直接进店
|
||||||
shopLoginForm.openType = EnumOpenType.manage;
|
shopLoginForm.openType = EnumOpenType.manage;
|
||||||
shopLoginForm.WindowState = System.Windows.Forms.FormWindowState.Maximized;
|
shopLoginForm.WindowState = System.Windows.Forms.FormWindowState.Maximized;
|
||||||
shopLoginForm.InitUrl = "https://store.weixin.qq.com/shop/home";
|
shopLoginForm.InitUrl = "https://store.weixin.qq.com/shop/home";
|
||||||
shopLoginForm.Show();
|
shopLoginForm.Show();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// 掉线登录
|
// 掉线登录
|
||||||
shopLoginForm.openType = EnumOpenType.login;
|
shopLoginForm.openType = EnumOpenType.login;
|
||||||
shopLoginForm.ShowDialog();
|
shopLoginForm.ShowDialog();
|
||||||
|
|
||||||
if (shop.LoginStatus == "登录成功")
|
if (shop.LoginStatus == "登录成功")
|
||||||
{
|
{
|
||||||
shop.Is29Supplier = false;
|
shop.Is29Supplier = false;
|
||||||
for (int i = 0; i < 100; i++)
|
for (int i = 0; i < 100; i++)
|
||||||
@@ -82,87 +83,87 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
|||||||
if (i * 20 >= totalCount)
|
if (i * 20 >= totalCount)
|
||||||
break;
|
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(); }));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void txtOrderId_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
|
foreach (var ord in GlobalConfig.lstFilterOrder.Where(o => o.shop_id.ParseToString() == shop.ErpShopId).ToList())
|
||||||
{
|
{
|
||||||
if (this.DataContext is oms_wei_order_info order)
|
// 更新代发管理情况
|
||||||
{
|
foreach (var orderItem in ord.orderItems)
|
||||||
var shop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ErpShopId == order.shop_id.ParseToString());
|
Dispatcher.Invoke(new Action(() => { orderItem.UpdateOrderItemBuyButton(); }));
|
||||||
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 OrderListRowHeaderCtrl_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
|
private void txtOrderId_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
|
||||||
{
|
{
|
||||||
if (this.DataContext is oms_wei_order_info order)
|
if (this.DataContext is oms_wei_order_info order)
|
||||||
{
|
{
|
||||||
if (order.orderItems.Count > 5)
|
var shop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ErpShopId == order.shop_id.ParseToString());
|
||||||
{
|
if (shop != null)
|
||||||
txtCount.Text = "该订单共计 " + order.orderItems.Count + " 件商品";
|
{
|
||||||
}
|
WXShopLoginForm shopLoginForm = new WXShopLoginForm(shop);
|
||||||
}
|
shopLoginForm.openType = EnumOpenType.manage;
|
||||||
}
|
shopLoginForm.WindowState = System.Windows.Forms.FormWindowState.Maximized;
|
||||||
|
|
||||||
private void Path_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
|
{
|
||||||
{
|
shopLoginForm.InitUrl = "https://store.weixin.qq.com/shop/order/detail?orderid=" + order.order_id;
|
||||||
//var orderId = ((sender as Border)?.Tag).ParseToString();
|
}
|
||||||
if (this.DataContext is oms_wei_order_info order)
|
shopLoginForm.Show();
|
||||||
{
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
try
|
private void OrderListRowHeaderCtrl_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
|
||||||
{
|
{
|
||||||
//Clipboard.SetText(order.order_id); // 复制成功,但会报错,改为SetDataObject
|
if (this.DataContext is oms_wei_order_info order)
|
||||||
Clipboard.SetDataObject(order.order_id);
|
{
|
||||||
BaseMsgWindow.ShowAnimateMessage("复制成功");
|
if (order.orderItems.Count > 5)
|
||||||
}
|
{
|
||||||
catch (Exception ex)
|
//txtCount.Text = "该订单共计 " + order.orderItems.Count + " 件商品";
|
||||||
{
|
}
|
||||||
BaseMsgWindow.ShowError("复制失败 " + ex.Message);
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void pathShop_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
|
private void Path_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
|
||||||
{
|
{
|
||||||
if (this.DataContext is oms_wei_order_info order)
|
//var orderId = ((sender as Border)?.Tag).ParseToString();
|
||||||
{
|
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
|
||||||
try
|
{
|
||||||
{
|
//Clipboard.SetText(order.order_id); // 复制成功,但会报错,改为SetDataObject
|
||||||
Clipboard.SetDataObject(shop.ShopAccount);
|
Clipboard.SetDataObject(order.order_id);
|
||||||
BaseMsgWindow.ShowAnimateMessage("复制成功");
|
BaseMsgWindow.ShowAnimateMessage("复制成功");
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
BaseMsgWindow.ShowError("复制失败 " + ex.Message);
|
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)
|
private void borderFlag_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
|
||||||
{
|
{
|
||||||
@@ -195,9 +196,44 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
|||||||
order.colour_flag = flag;
|
order.colour_flag = flag;
|
||||||
Thread.Sleep(1000);
|
Thread.Sleep(1000);
|
||||||
Dispatcher.Invoke(new Action(() => { MainWindow.Instance.orderListCtrl.FilterOneOrder(order); }));
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -26,11 +26,9 @@
|
|||||||
<Style TargetType="wpf:SpacingStackPanel">
|
<Style TargetType="wpf:SpacingStackPanel">
|
||||||
<Setter Property="Margin" Value="3,0" />
|
<Setter Property="Margin" Value="3,0" />
|
||||||
</Style>
|
</Style>
|
||||||
<Style
|
<!-- BasedOn="{StaticResource ButtonBaseStyle}" -->
|
||||||
x:Key="LinkButton"
|
<Style x:Key="LinkButton" TargetType="Button">
|
||||||
BasedOn="{StaticResource ButtonBaseStyle}"
|
<Setter Property="Height" Value="18" />
|
||||||
TargetType="Button">
|
|
||||||
<Setter Property="Height" Value="20" />
|
|
||||||
<Setter Property="Background" Value="Transparent" />
|
<Setter Property="Background" Value="Transparent" />
|
||||||
<Setter Property="BorderThickness" Value="0" />
|
<Setter Property="BorderThickness" Value="0" />
|
||||||
<Setter Property="Foreground" Value="{StaticResource PageLinkBrush}" />
|
<Setter Property="Foreground" Value="{StaticResource PageLinkBrush}" />
|
||||||
@@ -41,9 +39,9 @@
|
|||||||
|
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="2" />
|
<RowDefinition Height="0" />
|
||||||
<RowDefinition Height="*" />
|
<RowDefinition Height="*" />
|
||||||
<RowDefinition Height="2" />
|
<RowDefinition Height="0" />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<Grid
|
<Grid
|
||||||
x:Name="gridListItem"
|
x:Name="gridListItem"
|
||||||
@@ -53,14 +51,14 @@
|
|||||||
<ColumnDefinition Width="36" />
|
<ColumnDefinition Width="36" />
|
||||||
<ColumnDefinition Width="28" />
|
<ColumnDefinition Width="28" />
|
||||||
<ColumnDefinition Width="200*" />
|
<ColumnDefinition Width="200*" />
|
||||||
<ColumnDefinition Width="100*" MinWidth="200" />
|
<ColumnDefinition Width="100*" MinWidth="180" />
|
||||||
<ColumnDefinition Width="75*" MinWidth="150" />
|
<ColumnDefinition Width="75*" MinWidth="130" />
|
||||||
<ColumnDefinition Width="170*" MinWidth="380" />
|
<ColumnDefinition Width="170*" MinWidth="280" />
|
||||||
<ColumnDefinition Width="120*" />
|
<ColumnDefinition Width="120*" />
|
||||||
<ColumnDefinition Width="120*" />
|
<ColumnDefinition Width="120*" />
|
||||||
<ColumnDefinition Width="72*" />
|
<ColumnDefinition Width="72*" />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<TextBlock
|
<TextBlock d:Text="No.1"
|
||||||
HorizontalAlignment="Center"
|
HorizontalAlignment="Center"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Text="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ListBoxItem}}, Converter={StaticResource listBoxIndexConverter}}" />
|
Text="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ListBoxItem}}, Converter={StaticResource listBoxIndexConverter}}" />
|
||||||
@@ -142,7 +140,7 @@
|
|||||||
Background="Transparent"
|
Background="Transparent"
|
||||||
BorderThickness="0"
|
BorderThickness="0"
|
||||||
IsReadOnly="True"
|
IsReadOnly="True"
|
||||||
Text="{Binding sku_attr_str}"
|
Text="{Binding SkuAttrStr}"
|
||||||
TextWrapping="Wrap"
|
TextWrapping="Wrap"
|
||||||
WaterMark="规格" />
|
WaterMark="规格" />
|
||||||
</wpf:TitleContent>
|
</wpf:TitleContent>
|
||||||
@@ -198,7 +196,7 @@
|
|||||||
VerticalSpacing="2">
|
VerticalSpacing="2">
|
||||||
<wpf:TitleContent Title="成交时间:">
|
<wpf:TitleContent Title="成交时间:">
|
||||||
<uc:UcWaterMarkTextBox1
|
<uc:UcWaterMarkTextBox1
|
||||||
d:Text="2000-01-01 01:01:01"
|
d:Text="00-01-01 01:01:01"
|
||||||
Background="Transparent"
|
Background="Transparent"
|
||||||
BorderThickness="0"
|
BorderThickness="0"
|
||||||
IsReadOnly="True"
|
IsReadOnly="True"
|
||||||
@@ -207,18 +205,20 @@
|
|||||||
WaterMark="成交时间" />
|
WaterMark="成交时间" />
|
||||||
</wpf:TitleContent>
|
</wpf:TitleContent>
|
||||||
|
|
||||||
<wpf:TitleContent Title="发货时间:" Visibility="{Binding ItemOrder.ship_done_time_visibility}">
|
<wpf:TitleContent Title="发货时间:" Visibility="{Binding ItemOrder.ShipDoneTimeVisibility}">
|
||||||
<uc:UcWaterMarkTextBox1
|
<uc:UcWaterMarkTextBox1
|
||||||
|
d:Text="00-01-01 01:01:01"
|
||||||
Background="Transparent"
|
Background="Transparent"
|
||||||
BorderThickness="0"
|
BorderThickness="0"
|
||||||
IsReadOnly="True"
|
IsReadOnly="True"
|
||||||
Text="{Binding ItemOrder.ship_done_time_str}"
|
Text="{Binding ItemOrder.ShipDoneTimeStr}"
|
||||||
TextWrapping="Wrap"
|
TextWrapping="Wrap"
|
||||||
WaterMark="发货时间" />
|
WaterMark="发货时间" />
|
||||||
</wpf:TitleContent>
|
</wpf:TitleContent>
|
||||||
|
|
||||||
<wpf:TitleContent Title="退款时间:" Visibility="{Binding RefundTimeVisibility}">
|
<wpf:TitleContent Title="退款时间:" Visibility="{Binding RefundTimeVisibility}">
|
||||||
<uc:UcWaterMarkTextBox1
|
<uc:UcWaterMarkTextBox1
|
||||||
|
d:Text="00-01-01 01:01:01"
|
||||||
Background="Transparent"
|
Background="Transparent"
|
||||||
BorderThickness="0"
|
BorderThickness="0"
|
||||||
IsReadOnly="True"
|
IsReadOnly="True"
|
||||||
@@ -247,6 +247,16 @@
|
|||||||
WaterMark="售价" />
|
WaterMark="售价" />
|
||||||
</wpf:TitleContent>
|
</wpf:TitleContent>
|
||||||
|
|
||||||
|
<wpf:TitleContent Title="店铺运费:">
|
||||||
|
<uc:UcWaterMarkTextBox1
|
||||||
|
Background="Transparent"
|
||||||
|
BorderThickness="0"
|
||||||
|
IsReadOnly="True"
|
||||||
|
Text="{Binding PostagePriceStr}"
|
||||||
|
TextWrapping="Wrap"
|
||||||
|
WaterMark="店铺运费" />
|
||||||
|
</wpf:TitleContent>
|
||||||
|
|
||||||
<wpf:TitleContent Title="平台优惠:">
|
<wpf:TitleContent Title="平台优惠:">
|
||||||
<uc:UcWaterMarkTextBox1
|
<uc:UcWaterMarkTextBox1
|
||||||
d:Text="¥100.00"
|
d:Text="¥100.00"
|
||||||
@@ -258,24 +268,25 @@
|
|||||||
WaterMark="平台优惠" />
|
WaterMark="平台优惠" />
|
||||||
</wpf:TitleContent>
|
</wpf:TitleContent>
|
||||||
|
|
||||||
<wpf:TitleContent Title="进价:" Visibility="{Binding purchase_price_visibility}">
|
<wpf:TitleContent Title="进价:" Visibility="{Binding PurchasePriceVisibility}">
|
||||||
<uc:UcWaterMarkTextBox1
|
<uc:UcWaterMarkTextBox1
|
||||||
d:Text="¥100.00"
|
d:Text="¥100.00"
|
||||||
Background="Transparent"
|
Background="Transparent"
|
||||||
BorderThickness="0"
|
BorderThickness="0"
|
||||||
IsReadOnly="True"
|
IsReadOnly="True"
|
||||||
Text="{Binding purchase_price_str}"
|
Text="{Binding PurchasePriceStr}"
|
||||||
TextWrapping="Wrap"
|
TextWrapping="Wrap"
|
||||||
Visibility="{Binding purchase_price_visibility}"
|
Visibility="{Binding PurchasePriceVisibility}"
|
||||||
WaterMark="进价" />
|
WaterMark="进价" />
|
||||||
</wpf:TitleContent>
|
</wpf:TitleContent>
|
||||||
|
|
||||||
<wpf:TitleContent Title="运费:" Visibility="{Binding FreightVisibility}">
|
<wpf:TitleContent Title="运费:" Visibility="{Binding FreightVisibility}">
|
||||||
<uc:UcWaterMarkTextBox1
|
<uc:UcWaterMarkTextBox1
|
||||||
|
d:Text="¥100.00"
|
||||||
Background="Transparent"
|
Background="Transparent"
|
||||||
BorderThickness="0"
|
BorderThickness="0"
|
||||||
IsReadOnly="True"
|
IsReadOnly="True"
|
||||||
Text="{Binding freight_str}"
|
Text="{Binding FreightStr}"
|
||||||
TextWrapping="Wrap"
|
TextWrapping="Wrap"
|
||||||
Visibility="{Binding FreightVisibility}"
|
Visibility="{Binding FreightVisibility}"
|
||||||
WaterMark="运费" />
|
WaterMark="运费" />
|
||||||
@@ -287,7 +298,7 @@
|
|||||||
Background="Transparent"
|
Background="Transparent"
|
||||||
BorderThickness="0"
|
BorderThickness="0"
|
||||||
IsReadOnly="True"
|
IsReadOnly="True"
|
||||||
Text="{Binding predict_commission_fee_str}"
|
Text="{Binding PredictCommissionFeeStr}"
|
||||||
TextWrapping="Wrap"
|
TextWrapping="Wrap"
|
||||||
WaterMark="平台服务费" />
|
WaterMark="平台服务费" />
|
||||||
</wpf:TitleContent>
|
</wpf:TitleContent>
|
||||||
@@ -297,7 +308,7 @@
|
|||||||
Background="Transparent"
|
Background="Transparent"
|
||||||
BorderThickness="0"
|
BorderThickness="0"
|
||||||
IsReadOnly="True"
|
IsReadOnly="True"
|
||||||
Text="{Binding commission_amount_str}"
|
Text="{Binding CommissionAmountStr}"
|
||||||
TextWrapping="Wrap"
|
TextWrapping="Wrap"
|
||||||
WaterMark="达人佣金" />
|
WaterMark="达人佣金" />
|
||||||
</wpf:TitleContent>
|
</wpf:TitleContent>
|
||||||
@@ -307,7 +318,7 @@
|
|||||||
Background="Transparent"
|
Background="Transparent"
|
||||||
BorderThickness="0"
|
BorderThickness="0"
|
||||||
IsReadOnly="True"
|
IsReadOnly="True"
|
||||||
Text="{Binding out_amount_str}"
|
Text="{Binding OutAmountStr}"
|
||||||
TextWrapping="Wrap"
|
TextWrapping="Wrap"
|
||||||
WaterMark="外采金额" />
|
WaterMark="外采金额" />
|
||||||
</wpf:TitleContent>
|
</wpf:TitleContent>
|
||||||
@@ -405,7 +416,7 @@
|
|||||||
BorderBrush="{StaticResource PageWarningBrushCC}"
|
BorderBrush="{StaticResource PageWarningBrushCC}"
|
||||||
BorderThickness="1"
|
BorderThickness="1"
|
||||||
CornerRadius="2"
|
CornerRadius="2"
|
||||||
Visibility="{Binding ElementName=txtWaybillException, Path=Text, Converter={StaticResource HasTextVisibility}}">
|
Visibility="{Binding ShopWaybillExceptionStrVisibility}">
|
||||||
<TextBlock
|
<TextBlock
|
||||||
x:Name="txtWaybillException"
|
x:Name="txtWaybillException"
|
||||||
MinWidth="20"
|
MinWidth="20"
|
||||||
@@ -419,15 +430,33 @@
|
|||||||
</WrapPanel>
|
</WrapPanel>
|
||||||
|
|
||||||
<!-- 售后状态 -->
|
<!-- 售后状态 -->
|
||||||
<TextBlock
|
<WrapPanel>
|
||||||
x:Name="txtStatusStr"
|
<TextBlock
|
||||||
HorizontalAlignment="Center"
|
x:Name="txtOrderItemStatusStr"
|
||||||
VerticalAlignment="Top"
|
HorizontalAlignment="Center"
|
||||||
d:Text="售后状态"
|
VerticalAlignment="Top"
|
||||||
Background="Transparent"
|
d:Text="物品售后状态"
|
||||||
Foreground="{Binding ItemRefund.RefundStatusColor}"
|
Background="Transparent"
|
||||||
Text="{Binding ItemRefund.RefundStatusStr}"
|
Foreground="{Binding ItemRefund.RefundStatusColor}"
|
||||||
Visibility="{Binding ElementName=txtStatusStr, Path=Text, Converter={StaticResource HasTextVisibility}}" />
|
Text="{Binding RefundStatusStr}"
|
||||||
|
Visibility="{Binding RefundStatusStrVisibility}" />
|
||||||
|
<TextBlock
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Top"
|
||||||
|
Background="Transparent"
|
||||||
|
Foreground="{Binding ItemRefund.RefundStatusColor}"
|
||||||
|
Text=":"
|
||||||
|
Visibility="{Binding RefundStatusStrVisibility}" />
|
||||||
|
<TextBlock
|
||||||
|
x:Name="txtStatusStr"
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Top"
|
||||||
|
d:Text="售后状态"
|
||||||
|
Background="Transparent"
|
||||||
|
Foreground="{Binding ItemRefund.RefundStatusColor}"
|
||||||
|
Text="{Binding ItemRefund.RefundStatusStr}"
|
||||||
|
Visibility="{Binding ItemRefund.RefundStatusStrVisibility}" />
|
||||||
|
</WrapPanel>
|
||||||
<!-- 售后原因 -->
|
<!-- 售后原因 -->
|
||||||
<TextBlock
|
<TextBlock
|
||||||
x:Name="txtRefundReasonTextStr"
|
x:Name="txtRefundReasonTextStr"
|
||||||
@@ -436,8 +465,8 @@
|
|||||||
d:Text="售后原因"
|
d:Text="售后原因"
|
||||||
Background="Transparent"
|
Background="Transparent"
|
||||||
Foreground="#f56c6c"
|
Foreground="#f56c6c"
|
||||||
Text="{Binding ItemRefund.reasonTextStr}"
|
Text="{Binding ItemRefund.ReasonTextStr}"
|
||||||
Visibility="{Binding ElementName=txtRefundReasonTextStr, Path=Text, Converter={StaticResource HasTextVisibility}}" />
|
Visibility="{Binding RefundReasonTextStrVisibility}" />
|
||||||
|
|
||||||
<!-- 售后结果 -->
|
<!-- 售后结果 -->
|
||||||
<TextBlock
|
<TextBlock
|
||||||
@@ -448,7 +477,7 @@
|
|||||||
Background="Transparent"
|
Background="Transparent"
|
||||||
Foreground="#f56c6c"
|
Foreground="#f56c6c"
|
||||||
Text="{Binding RefundResultStr}"
|
Text="{Binding RefundResultStr}"
|
||||||
Visibility="{Binding ElementName=txtRefundResult, Path=Text, Converter={StaticResource HasTextVisibility}}" />
|
Visibility="{Binding RefundResultStrVisibility}" />
|
||||||
|
|
||||||
<!-- 收货地址 -->
|
<!-- 收货地址 -->
|
||||||
<wpf:TitleContent Title="收货地址:">
|
<wpf:TitleContent Title="收货地址:">
|
||||||
@@ -507,7 +536,7 @@
|
|||||||
IsReadOnly="True"
|
IsReadOnly="True"
|
||||||
Text="{Binding ItemRefund.after_sale_order_id}"
|
Text="{Binding ItemRefund.after_sale_order_id}"
|
||||||
TextWrapping="Wrap"
|
TextWrapping="Wrap"
|
||||||
Visibility="{Binding Text, RelativeSource={RelativeSource Self}, Converter={StaticResource HasTextVisibility}}"
|
Visibility="{Binding RefundAfterSaleOrderIdVisibility}"
|
||||||
WaterMark="退款单号" />
|
WaterMark="退款单号" />
|
||||||
<Border
|
<Border
|
||||||
Width="12"
|
Width="12"
|
||||||
@@ -528,7 +557,7 @@
|
|||||||
</wpf:TitleContent>
|
</wpf:TitleContent>
|
||||||
|
|
||||||
<!-- 退货地址 -->
|
<!-- 退货地址 -->
|
||||||
<wpf:TitleContent Title="退货地址:" Visibility="{Binding RefundAddressStr, Converter={StaticResource HasTextVisibility}}">
|
<wpf:TitleContent Title="退货地址:" Visibility="{Binding RefundAddressShortStrVisibility}">
|
||||||
<WrapPanel Orientation="Horizontal">
|
<WrapPanel Orientation="Horizontal">
|
||||||
<uc:UcWaterMarkTextBox1
|
<uc:UcWaterMarkTextBox1
|
||||||
x:Name="txtRefundAddress"
|
x:Name="txtRefundAddress"
|
||||||
@@ -537,7 +566,7 @@
|
|||||||
Background="Transparent"
|
Background="Transparent"
|
||||||
BorderThickness="0"
|
BorderThickness="0"
|
||||||
IsReadOnly="True"
|
IsReadOnly="True"
|
||||||
Text="{Binding RefundAddressStr, Converter={StaticResource TextEllipsisConverter26}}"
|
Text="{Binding RefundAddressShortStr}"
|
||||||
TextWrapping="Wrap"
|
TextWrapping="Wrap"
|
||||||
ToolTip="{Binding RefundAddressStr}"
|
ToolTip="{Binding RefundAddressStr}"
|
||||||
WaterMark="退货地址" />
|
WaterMark="退货地址" />
|
||||||
@@ -567,15 +596,10 @@
|
|||||||
Orientation="Vertical"
|
Orientation="Vertical"
|
||||||
VerticalSpacing="2">
|
VerticalSpacing="2">
|
||||||
|
|
||||||
<!-- 状态标签行(原 Row 1-2) -->
|
<!-- 状态标签行 -->
|
||||||
<WrapPanel
|
|
||||||
x:Name="wpTransitBuyerRefundStatus"
|
|
||||||
HorizontalAlignment="Center"
|
|
||||||
VerticalAlignment="Center" />
|
|
||||||
|
|
||||||
<WrapPanel
|
<WrapPanel
|
||||||
x:Name="wpTransitWaybillStatus"
|
x:Name="wpTransitWaybillStatus"
|
||||||
Margin="0,0,0,4"
|
Margin="0,0,0,2"
|
||||||
HorizontalAlignment="Center">
|
HorizontalAlignment="Center">
|
||||||
<Border
|
<Border
|
||||||
x:Name="borderBuyStatas"
|
x:Name="borderBuyStatas"
|
||||||
@@ -589,7 +613,7 @@
|
|||||||
BorderBrush="{Binding BuyerTransitWaybillStatusBorderColor}"
|
BorderBrush="{Binding BuyerTransitWaybillStatusBorderColor}"
|
||||||
BorderThickness="1"
|
BorderThickness="1"
|
||||||
CornerRadius="2"
|
CornerRadius="2"
|
||||||
Visibility="{Binding BuyerTransitWaybillStatusStr, Converter={StaticResource HasTextVisibility}}">
|
Visibility="{Binding BuyerTransitWaybillStatusStrVisibility}">
|
||||||
<TextBlock
|
<TextBlock
|
||||||
x:Name="txtBuyStatus"
|
x:Name="txtBuyStatus"
|
||||||
MinWidth="20"
|
MinWidth="20"
|
||||||
@@ -611,7 +635,7 @@
|
|||||||
BorderBrush="{Binding WarehouseWaybillStatusBorderColor}"
|
BorderBrush="{Binding WarehouseWaybillStatusBorderColor}"
|
||||||
BorderThickness="1"
|
BorderThickness="1"
|
||||||
CornerRadius="2"
|
CornerRadius="2"
|
||||||
Visibility="{Binding WarehouseWaybillStatusStr, Converter={StaticResource HasTextVisibility}}">
|
Visibility="{Binding WarehouseWaybillStatusStrVisibility}">
|
||||||
<TextBlock
|
<TextBlock
|
||||||
x:Name="txtWarehouseStatus"
|
x:Name="txtWarehouseStatus"
|
||||||
MinWidth="20"
|
MinWidth="20"
|
||||||
@@ -631,7 +655,7 @@
|
|||||||
BorderBrush="{StaticResource pageColorBrush}"
|
BorderBrush="{StaticResource pageColorBrush}"
|
||||||
BorderThickness="1"
|
BorderThickness="1"
|
||||||
CornerRadius="2"
|
CornerRadius="2"
|
||||||
Visibility="{Binding TransitRefundVoidStatusStr, Converter={StaticResource HasTextVisibility}}">
|
Visibility="{Binding TransitRefundVoidStatusStrVisibility}">
|
||||||
<TextBlock
|
<TextBlock
|
||||||
MinWidth="20"
|
MinWidth="20"
|
||||||
Padding="0"
|
Padding="0"
|
||||||
@@ -649,18 +673,21 @@
|
|||||||
Title="采购账户:"
|
Title="采购账户:"
|
||||||
Cursor="Hand"
|
Cursor="Hand"
|
||||||
Foreground="#0099ff"
|
Foreground="#0099ff"
|
||||||
MouseLeftButtonUp="TransitOrderBuye_Click">
|
MouseLeftButtonUp="TransitOrderBuy_Click"
|
||||||
|
Visibility="{Binding ItemTransitOutOrderBuyerStrVisibility}">
|
||||||
<WrapPanel Orientation="Horizontal">
|
<WrapPanel Orientation="Horizontal">
|
||||||
<uc:UcWaterMarkTextBox1
|
<uc:UcWaterMarkTextBox1
|
||||||
x:Name="txtTransitOrderBuyerStr"
|
x:Name="txtTransitOrderBuyerStr"
|
||||||
Margin="-2,2,4,2"
|
Margin="-2,2,4,2"
|
||||||
Padding="0"
|
Padding="0"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
|
d:Text="AAA采购王者"
|
||||||
Background="Transparent"
|
Background="Transparent"
|
||||||
BorderThickness="0"
|
BorderThickness="0"
|
||||||
Cursor="Hand"
|
Cursor="Hand"
|
||||||
Foreground="#0099ff"
|
Foreground="#0099ff"
|
||||||
IsReadOnly="True"
|
IsReadOnly="True"
|
||||||
|
Tag="{Binding ItemTransitOrderWithVoid.buyer_account}"
|
||||||
Text="{Binding ItemTransitOrderWithVoid.OutOrderBuyerStr}"
|
Text="{Binding ItemTransitOrderWithVoid.OutOrderBuyerStr}"
|
||||||
TextWrapping="Wrap"
|
TextWrapping="Wrap"
|
||||||
WaterMark="采购账户:" />
|
WaterMark="采购账户:" />
|
||||||
@@ -675,7 +702,7 @@
|
|||||||
BorderBrush="{Binding TransitRefundStatusBackColor}"
|
BorderBrush="{Binding TransitRefundStatusBackColor}"
|
||||||
BorderThickness="1"
|
BorderThickness="1"
|
||||||
CornerRadius="2"
|
CornerRadius="2"
|
||||||
Visibility="{Binding TransitRefundStatusStr, Converter={StaticResource HasTextVisibility}}">
|
Visibility="{Binding TransitRefundStatusStrVisibility}">
|
||||||
<TextBlock
|
<TextBlock
|
||||||
x:Name="txtRefundStatus"
|
x:Name="txtRefundStatus"
|
||||||
MinWidth="20"
|
MinWidth="20"
|
||||||
@@ -695,13 +722,14 @@
|
|||||||
Title="采购单号:"
|
Title="采购单号:"
|
||||||
Cursor="Hand"
|
Cursor="Hand"
|
||||||
Foreground="#0099ff"
|
Foreground="#0099ff"
|
||||||
MouseLeftButtonUp="TransitOrderBuye_Click">
|
Visibility="{Binding ItemTransitOutOrderNoStrVisibility}">
|
||||||
<WrapPanel Orientation="Horizontal">
|
<WrapPanel Orientation="Horizontal">
|
||||||
<uc:UcWaterMarkTextBox1
|
<uc:UcWaterMarkTextBox1
|
||||||
x:Name="txtTransitOrderNumStr"
|
x:Name="txtTransitOrderNumStr"
|
||||||
Margin="-2,2"
|
Margin="-2,0"
|
||||||
Padding="0"
|
Padding="0"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
|
d:Text="261009-123456…"
|
||||||
Background="Transparent"
|
Background="Transparent"
|
||||||
BorderThickness="0"
|
BorderThickness="0"
|
||||||
Cursor="Hand"
|
Cursor="Hand"
|
||||||
@@ -718,8 +746,7 @@
|
|||||||
Background="Transparent"
|
Background="Transparent"
|
||||||
Cursor="Hand"
|
Cursor="Hand"
|
||||||
MouseLeftButtonDown="Path_MouseLeftButtonDown"
|
MouseLeftButtonDown="Path_MouseLeftButtonDown"
|
||||||
Tag="{Binding order_id}"
|
Tag="{Binding order_id}">
|
||||||
Visibility="{Binding ElementName=txtTransitOrderBuyerStr, Path=Text, Converter={StaticResource HasTextVisibility}}">
|
|
||||||
<Path
|
<Path
|
||||||
Data="M80 432a128 128 0 0 1 128-128h384a128 128 0 0 1 128 128v384a128 128 0 0 1-128 128h-384a128 128 0 0 1-128-128v-384z m128-64a64 64 0 0 0-64 64v384a64 64 0 0 0 64 64h384a64 64 0 0 0 64-64v-384a64 64 0 0 0-64-64h-384z M816 144h-384a64 64 0 0 0-64 64 32 32 0 0 1-64 0 128 128 0 0 1 128-128h384a128 128 0 0 1 128 128v384a128 128 0 0 1-128 128 32 32 0 0 1 0-64 64 64 0 0 0 64-64v-384a64 64 0 0 0-64-64z"
|
Data="M80 432a128 128 0 0 1 128-128h384a128 128 0 0 1 128 128v384a128 128 0 0 1-128 128h-384a128 128 0 0 1-128-128v-384z m128-64a64 64 0 0 0-64 64v384a64 64 0 0 0 64 64h384a64 64 0 0 0 64-64v-384a64 64 0 0 0-64-64h-384z M816 144h-384a64 64 0 0 0-64 64 32 32 0 0 1-64 0 128 128 0 0 1 128-128h384a128 128 0 0 1 128 128v384a128 128 0 0 1-128 128 32 32 0 0 1 0-64 64 64 0 0 0 64-64v-384a64 64 0 0 0-64-64z"
|
||||||
Fill="{StaticResource PageLinkBrush}"
|
Fill="{StaticResource PageLinkBrush}"
|
||||||
@@ -733,10 +760,11 @@
|
|||||||
<wpf:TitleContent
|
<wpf:TitleContent
|
||||||
x:Name="wpBuyTime"
|
x:Name="wpBuyTime"
|
||||||
Title="采购时间:"
|
Title="采购时间:"
|
||||||
Foreground="{Binding OutOrderTimeQualifiedBrush}">
|
Foreground="{Binding OutOrderTimeQualifiedBrush}"
|
||||||
|
Visibility="{Binding OutOrderTimeQualifiedStrVisibility}">
|
||||||
<uc:UcWaterMarkTextBox1
|
<uc:UcWaterMarkTextBox1
|
||||||
x:Name="txtOutOrderTimeQualifiedStr"
|
x:Name="txtOutOrderTimeQualifiedStr"
|
||||||
Margin="-2,2"
|
Margin="-2,0"
|
||||||
Padding="0"
|
Padding="0"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
Background="Transparent"
|
Background="Transparent"
|
||||||
@@ -752,9 +780,9 @@
|
|||||||
<wpf:TitleContent
|
<wpf:TitleContent
|
||||||
Title="取号物流:"
|
Title="取号物流:"
|
||||||
Foreground="{StaticResource PageOkBrush}"
|
Foreground="{StaticResource PageOkBrush}"
|
||||||
Visibility="{Binding TransitOrderWaybillToWareHouseStr, Converter={StaticResource HasTextVisibility}}">
|
Visibility="{Binding TransitOrderWaybillToWareHouseStrVisibility}">
|
||||||
<uc:UcWaterMarkTextBox1
|
<uc:UcWaterMarkTextBox1
|
||||||
Margin="-2,2"
|
Margin="-2,0"
|
||||||
Padding="0"
|
Padding="0"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
Background="Transparent"
|
Background="Transparent"
|
||||||
@@ -782,27 +810,63 @@
|
|||||||
</wpf:TitleContent>
|
</wpf:TitleContent>
|
||||||
|
|
||||||
<!-- 仓库物流 -->
|
<!-- 仓库物流 -->
|
||||||
<wpf:TitleContent Title="仓库物流:" Visibility="{Binding TransitOrderWaybillFromWareHouseStr, Converter={StaticResource HasTextVisibility}}">
|
<wpf:TitleContent Title="仓库物流:" Visibility="{Binding TransitOrderWaybillFromWareHouseStrVisibility}">
|
||||||
<uc:UcWaterMarkTextBox1
|
<WrapPanel>
|
||||||
Margin="-2,2"
|
<uc:UcWaterMarkTextBox1
|
||||||
Padding="0"
|
Margin="-2,0"
|
||||||
VerticalAlignment="Top"
|
Padding="0"
|
||||||
Background="Transparent"
|
VerticalAlignment="Center"
|
||||||
BorderThickness="0"
|
Background="Transparent"
|
||||||
IsReadOnly="True"
|
BorderThickness="0"
|
||||||
Text="{Binding TransitOrderWaybillFromWareHouseStr}"
|
IsReadOnly="True"
|
||||||
TextWrapping="Wrap"
|
Text="{Binding TransitOrderWaybillFromWareHouseStr}"
|
||||||
WaterMark="仓库物流" />
|
TextWrapping="Wrap"
|
||||||
|
WaterMark="仓库物流" />
|
||||||
|
<Button
|
||||||
|
x:Name="btnGetTransitWaybillDetail"
|
||||||
|
Margin="4,0,0,0"
|
||||||
|
Padding="0,0,0,0"
|
||||||
|
d:Content="查看"
|
||||||
|
Click="btnGetTransitWaybillDetail_Click"
|
||||||
|
Content="{Binding LatestTransitEWaybill.StatusStr}"
|
||||||
|
Style="{StaticResource LinkButton}" />
|
||||||
|
</WrapPanel>
|
||||||
|
</wpf:TitleContent>
|
||||||
|
|
||||||
|
<!-- 仓库物流 -->
|
||||||
|
<wpf:TitleContent Title="补发物流:" Visibility="{Binding TransitExtraPackageWaybillStrVisibility}">
|
||||||
|
<WrapPanel>
|
||||||
|
<uc:UcWaterMarkTextBox1
|
||||||
|
Margin="-2,0"
|
||||||
|
Padding="0"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Background="Transparent"
|
||||||
|
BorderThickness="0"
|
||||||
|
IsReadOnly="True"
|
||||||
|
Text="{Binding TransitExtraPackageWaybillStr}"
|
||||||
|
TextWrapping="Wrap"
|
||||||
|
WaterMark="补发物流" />
|
||||||
|
<Button
|
||||||
|
x:Name="btnVoidTransitExtraOrder"
|
||||||
|
Margin="4,0,0,0"
|
||||||
|
Padding="0,0,0,0"
|
||||||
|
d:Content="作废"
|
||||||
|
Click="btnVoidTransitExtraOrder_Click"
|
||||||
|
Content="{Binding TransitExtraPackageWaybillBtnStr}"
|
||||||
|
Style="{StaticResource LinkButton}"
|
||||||
|
Visibility="{Binding TransitExtraPackageWaybillBtnStrVisibility}" />
|
||||||
|
</WrapPanel>
|
||||||
</wpf:TitleContent>
|
</wpf:TitleContent>
|
||||||
|
|
||||||
<!-- 外采买手 -->
|
<!-- 外采买手 -->
|
||||||
<wpf:TitleContent Title="外采买手:" Visibility="{Binding ItemOrder.out_account, Converter={StaticResource HasTextVisibility}}">
|
<wpf:TitleContent Title="外采买手:" Visibility="{Binding ItemOrder.OutAccountStrVisibility}">
|
||||||
<WrapPanel Orientation="Horizontal">
|
<WrapPanel Orientation="Horizontal">
|
||||||
<uc:UcWaterMarkTextBox1
|
<uc:UcWaterMarkTextBox1
|
||||||
x:Name="txtDirectBuyer"
|
x:Name="txtDirectBuyer"
|
||||||
Margin="-2,2,4,2"
|
Margin="-2,2,4,2"
|
||||||
Padding="0"
|
Padding="0"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
|
d:Text="BBB采购废柴"
|
||||||
Background="Transparent"
|
Background="Transparent"
|
||||||
BorderThickness="0"
|
BorderThickness="0"
|
||||||
Cursor="Hand"
|
Cursor="Hand"
|
||||||
@@ -822,7 +886,7 @@
|
|||||||
BorderBrush="{Binding DirectRefundStatusBackColor}"
|
BorderBrush="{Binding DirectRefundStatusBackColor}"
|
||||||
BorderThickness="1"
|
BorderThickness="1"
|
||||||
CornerRadius="2"
|
CornerRadius="2"
|
||||||
Visibility="{Binding DirectRefundStatusStr, Converter={StaticResource HasTextVisibility}}">
|
Visibility="{Binding DirectRefundStatusStrVisibility}">
|
||||||
<TextBlock
|
<TextBlock
|
||||||
x:Name="txtOutBuyerRefundStatus"
|
x:Name="txtOutBuyerRefundStatus"
|
||||||
MinWidth="20"
|
MinWidth="20"
|
||||||
@@ -847,6 +911,7 @@
|
|||||||
Margin="-2,2"
|
Margin="-2,2"
|
||||||
Padding="0"
|
Padding="0"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
|
d:Text="261009-123456…"
|
||||||
Background="Transparent"
|
Background="Transparent"
|
||||||
BorderThickness="0"
|
BorderThickness="0"
|
||||||
Cursor="Hand"
|
Cursor="Hand"
|
||||||
@@ -872,6 +937,23 @@
|
|||||||
</Border>
|
</Border>
|
||||||
</WrapPanel>
|
</WrapPanel>
|
||||||
</wpf:TitleContent>
|
</wpf:TitleContent>
|
||||||
|
<!-- 采购时间 -->
|
||||||
|
<wpf:TitleContent
|
||||||
|
x:Name="wpDirectBuyTime"
|
||||||
|
Title="外采时间:"
|
||||||
|
Visibility="{Binding DirectOrderBuyTimeStrVisibility}">
|
||||||
|
<uc:UcWaterMarkTextBox1
|
||||||
|
x:Name="txtDirectOrderBuyTimeStr"
|
||||||
|
Margin="-2,2"
|
||||||
|
Padding="0"
|
||||||
|
VerticalAlignment="Top"
|
||||||
|
Background="Transparent"
|
||||||
|
BorderThickness="0"
|
||||||
|
IsReadOnly="True"
|
||||||
|
Text="{Binding DirectOrderBuyTimeStr}"
|
||||||
|
TextWrapping="Wrap"
|
||||||
|
WaterMark="采购时间:" />
|
||||||
|
</wpf:TitleContent>
|
||||||
|
|
||||||
<!-- 外采物流 -->
|
<!-- 外采物流 -->
|
||||||
<wpf:TitleContent Title="外采物流:" Visibility="{Binding ItemOrder.OutExpressNoStr, Converter={StaticResource HasTextVisibility}}">
|
<wpf:TitleContent Title="外采物流:" Visibility="{Binding ItemOrder.OutExpressNoStr, Converter={StaticResource HasTextVisibility}}">
|
||||||
@@ -879,7 +961,7 @@
|
|||||||
<uc:UcWaterMarkTextBox1
|
<uc:UcWaterMarkTextBox1
|
||||||
Margin="-2,2"
|
Margin="-2,2"
|
||||||
Padding="0"
|
Padding="0"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Center"
|
||||||
Background="Transparent"
|
Background="Transparent"
|
||||||
BorderThickness="0"
|
BorderThickness="0"
|
||||||
Foreground="{Binding ItemOrder.OutExpressNoBrush}"
|
Foreground="{Binding ItemOrder.OutExpressNoBrush}"
|
||||||
@@ -890,7 +972,7 @@
|
|||||||
<uc:UcWaterMarkTextBox1
|
<uc:UcWaterMarkTextBox1
|
||||||
Margin="-2,2"
|
Margin="-2,2"
|
||||||
Padding="0"
|
Padding="0"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Center"
|
||||||
Background="Transparent"
|
Background="Transparent"
|
||||||
BorderThickness="0"
|
BorderThickness="0"
|
||||||
Foreground="{Binding ItemOrder.OutExpressNoBrush}"
|
Foreground="{Binding ItemOrder.OutExpressNoBrush}"
|
||||||
@@ -901,14 +983,108 @@
|
|||||||
<uc:UcWaterMarkTextBox1
|
<uc:UcWaterMarkTextBox1
|
||||||
Margin="-2,2,4,2"
|
Margin="-2,2,4,2"
|
||||||
Padding="0"
|
Padding="0"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Center"
|
||||||
|
d:Text="外采物流单号"
|
||||||
Background="Transparent"
|
Background="Transparent"
|
||||||
BorderThickness="0"
|
BorderThickness="0"
|
||||||
Foreground="{Binding ItemOrder.OutExpressNoBrush}"
|
Foreground="{Binding ItemOrder.OutExpressNoBrush}"
|
||||||
IsReadOnly="True"
|
IsReadOnly="True"
|
||||||
Text="{Binding ItemOrder.OutExpressNoStr}"
|
Text="{Binding ItemOrder.OutExpressNoStr}"
|
||||||
TextWrapping="Wrap"
|
TextWrapping="Wrap"
|
||||||
WaterMark="外采物流" />
|
WaterMark="外采物流的那好" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
x:Name="btnGetDirectWaybillDetail"
|
||||||
|
Margin="4,0,0,0"
|
||||||
|
Padding="0,0,0,0"
|
||||||
|
d:Content="查看"
|
||||||
|
Click="btnGetDirectWaybillDetail_Click"
|
||||||
|
Content="{Binding LatestDirectEWaybill.StatusStr}"
|
||||||
|
Style="{StaticResource LinkButton}" />
|
||||||
|
</WrapPanel>
|
||||||
|
</wpf:TitleContent>
|
||||||
|
<wpf:TitleContent Title="同步物流:" Visibility="{Binding ItemOrder.SyncWaybillIdInfo, Converter={StaticResource HasTextVisibility}}">
|
||||||
|
<WrapPanel Orientation="Horizontal">
|
||||||
|
<!--<uc:UcWaterMarkTextBox1
|
||||||
|
Margin="-2,2"
|
||||||
|
Padding="0"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Background="Transparent"
|
||||||
|
BorderThickness="0"
|
||||||
|
Foreground="{Binding ItemOrder.OutExpressNoBrush}"
|
||||||
|
IsReadOnly="True"
|
||||||
|
Text="{Binding ItemOrder.out_express_company}"
|
||||||
|
TextWrapping="Wrap"
|
||||||
|
WaterMark="外采物流" />-->
|
||||||
|
<!--<uc:UcWaterMarkTextBox1
|
||||||
|
Margin="-2,2"
|
||||||
|
Padding="0"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Background="Transparent"
|
||||||
|
BorderThickness="0"
|
||||||
|
Foreground="{Binding ItemOrder.OutExpressNoBrush}"
|
||||||
|
IsReadOnly="True"
|
||||||
|
Text="-"
|
||||||
|
TextWrapping="Wrap"
|
||||||
|
WaterMark="-" />-->
|
||||||
|
<uc:UcWaterMarkTextBox1
|
||||||
|
Margin="-2,2,4,2"
|
||||||
|
Padding="0"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
d:Text="物流单"
|
||||||
|
Background="Transparent"
|
||||||
|
BorderThickness="0"
|
||||||
|
IsReadOnly="True"
|
||||||
|
Text="{Binding ItemOrder.SyncWaybillIdInfo}"
|
||||||
|
TextWrapping="Wrap"
|
||||||
|
WaterMark="同步物流" />
|
||||||
|
|
||||||
|
<uc:UcWaterMarkTextBox1
|
||||||
|
Margin="-2,2,4,2"
|
||||||
|
Padding="0"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
d:Text="取件码"
|
||||||
|
Background="Transparent"
|
||||||
|
BorderThickness="0"
|
||||||
|
IsReadOnly="True"
|
||||||
|
Text="{Binding ItemOrder.SyncWaybillPickNo}"
|
||||||
|
TextWrapping="Wrap"
|
||||||
|
WaterMark="取件码" />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<uc:UcWaterMarkTextBox1
|
||||||
|
Margin="-2,2,4,2"
|
||||||
|
Padding="0"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
d:Text="报错信息"
|
||||||
|
Background="Transparent"
|
||||||
|
BorderThickness="0"
|
||||||
|
IsReadOnly="True"
|
||||||
|
Text="{Binding SyncLogisticsMsg}"
|
||||||
|
TextWrapping="Wrap"
|
||||||
|
WaterMark="同步单信息" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
x:Name="btnTrySendSyncOrder"
|
||||||
|
Margin="4,0,0,0"
|
||||||
|
Padding="0,0,0,0"
|
||||||
|
d:Content="发送"
|
||||||
|
Click="btnTrySendSyncOrder_Click"
|
||||||
|
Content="发送"
|
||||||
|
Style="{StaticResource LinkButton}"
|
||||||
|
Tag="{Binding ItemOrder.OutExpressNoStr}"
|
||||||
|
Visibility="{Binding ItemOrder.RealSyncWaybillId, Converter={StaticResource NotHasTextVisibility}}" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
x:Name="btnEditPickNo"
|
||||||
|
Padding="0,0,0,0"
|
||||||
|
d:Content="填取件码"
|
||||||
|
Click="btnEditPickNo_Click"
|
||||||
|
Content="填取件码"
|
||||||
|
Style="{StaticResource LinkButton}"
|
||||||
|
Tag="{Binding ItemOrder.OutExpressNoStr}"
|
||||||
|
Visibility="{Binding ItemOrder.RealSyncWaybillId, Converter={StaticResource HasTextVisibility}}" />
|
||||||
</WrapPanel>
|
</WrapPanel>
|
||||||
</wpf:TitleContent>
|
</wpf:TitleContent>
|
||||||
|
|
||||||
@@ -959,12 +1135,12 @@
|
|||||||
<!-- 买家留言 -->
|
<!-- 买家留言 -->
|
||||||
<wpf:TitleContent Title="买家留言:">
|
<wpf:TitleContent Title="买家留言:">
|
||||||
<uc:UcWaterMarkTextBox1
|
<uc:UcWaterMarkTextBox1
|
||||||
|
d:Text="留言留言"
|
||||||
Background="Transparent"
|
Background="Transparent"
|
||||||
BorderThickness="1"
|
BorderThickness="1"
|
||||||
IsReadOnly="True"
|
IsReadOnly="True"
|
||||||
Text=""
|
Text=""
|
||||||
TextWrapping="Wrap"
|
TextWrapping="Wrap" />
|
||||||
WaterMark="买家留言" />
|
|
||||||
</wpf:TitleContent>
|
</wpf:TitleContent>
|
||||||
|
|
||||||
<!-- 店铺备注 -->
|
<!-- 店铺备注 -->
|
||||||
@@ -979,7 +1155,7 @@
|
|||||||
IsReadOnly="True"
|
IsReadOnly="True"
|
||||||
Text="{Binding ItemOrder.shop_remark}"
|
Text="{Binding ItemOrder.shop_remark}"
|
||||||
TextWrapping="Wrap"
|
TextWrapping="Wrap"
|
||||||
Visibility="Visible"
|
Visibility="{Binding ItemOrder.shop_remark, Converter={StaticResource HasTextVisibility}}"
|
||||||
WaterMark="店铺备注" />
|
WaterMark="店铺备注" />
|
||||||
<Button
|
<Button
|
||||||
x:Name="btnEditShopRemark"
|
x:Name="btnEditShopRemark"
|
||||||
@@ -1008,6 +1184,7 @@
|
|||||||
IsReadOnly="True"
|
IsReadOnly="True"
|
||||||
Text="{Binding ItemOrder.soft_remark}"
|
Text="{Binding ItemOrder.soft_remark}"
|
||||||
TextWrapping="Wrap"
|
TextWrapping="Wrap"
|
||||||
|
Visibility="{Binding ItemOrder.soft_remark, Converter={StaticResource HasTextVisibility}}"
|
||||||
WaterMark="软件备注" />
|
WaterMark="软件备注" />
|
||||||
<Button
|
<Button
|
||||||
x:Name="btnEditAppRemark"
|
x:Name="btnEditAppRemark"
|
||||||
@@ -1036,6 +1213,7 @@
|
|||||||
IsReadOnly="True"
|
IsReadOnly="True"
|
||||||
Text="{Binding TransitWarehouseRejectSuccessTimeStr}"
|
Text="{Binding TransitWarehouseRejectSuccessTimeStr}"
|
||||||
TextWrapping="Wrap"
|
TextWrapping="Wrap"
|
||||||
|
Visibility="{Binding TransitWarehouseRejectSuccessTimeStr, Converter={StaticResource HasTextVisibility}}"
|
||||||
WaterMark="中转仓拒收" />
|
WaterMark="中转仓拒收" />
|
||||||
<Button
|
<Button
|
||||||
x:Name="btnAddEditTransitWarehouseReject"
|
x:Name="btnAddEditTransitWarehouseReject"
|
||||||
@@ -1047,7 +1225,7 @@
|
|||||||
x:Name="btnPddRefundTransitWarehouseRejectOrder"
|
x:Name="btnPddRefundTransitWarehouseRejectOrder"
|
||||||
d:Visibility="Visible"
|
d:Visibility="Visible"
|
||||||
Click="btnPddRefundTransitWarehouseRejectOrder_Click"
|
Click="btnPddRefundTransitWarehouseRejectOrder_Click"
|
||||||
Content="测试退货"
|
Content="测试拒收"
|
||||||
Style="{StaticResource LinkButton}"
|
Style="{StaticResource LinkButton}"
|
||||||
Visibility="Collapsed" />
|
Visibility="Collapsed" />
|
||||||
</WrapPanel>
|
</WrapPanel>
|
||||||
@@ -1065,6 +1243,7 @@
|
|||||||
IsReadOnly="True"
|
IsReadOnly="True"
|
||||||
Text="{Binding TransitWarehouseAfterSaleWayBillStr}"
|
Text="{Binding TransitWarehouseAfterSaleWayBillStr}"
|
||||||
TextWrapping="Wrap"
|
TextWrapping="Wrap"
|
||||||
|
Visibility="{Binding TransitWarehouseAfterSaleWayBillStr, Converter={StaticResource HasTextVisibility}}"
|
||||||
WaterMark="拦截退回总店" />
|
WaterMark="拦截退回总店" />
|
||||||
<Button
|
<Button
|
||||||
x:Name="btnAddEditTransitWarehouseAfterSale"
|
x:Name="btnAddEditTransitWarehouseAfterSale"
|
||||||
@@ -1072,6 +1251,19 @@
|
|||||||
Click="btnAddEditTransitWarehouseAfterSale_Click"
|
Click="btnAddEditTransitWarehouseAfterSale_Click"
|
||||||
Content="{Binding AddEditTransitWarehouseAfterSaleStr}"
|
Content="{Binding AddEditTransitWarehouseAfterSaleStr}"
|
||||||
Style="{StaticResource LinkButton}" />
|
Style="{StaticResource LinkButton}" />
|
||||||
|
<uc:UcWaterMarkTextBox1
|
||||||
|
x:Name="txtInterceptReturnInfoStr"
|
||||||
|
Margin="0,1,0,1"
|
||||||
|
VerticalAlignment="Top"
|
||||||
|
d:Text="拦截失败原因"
|
||||||
|
d:Visibility="Visible"
|
||||||
|
Background="Transparent"
|
||||||
|
BorderThickness="1"
|
||||||
|
IsReadOnly="True"
|
||||||
|
Text="{Binding InterceptReturnInfoStr, Converter={StaticResource TextEllipsisConverter8}}"
|
||||||
|
TextWrapping="Wrap"
|
||||||
|
ToolTip="{Binding InterceptReturnInfoStr}"
|
||||||
|
Visibility="{Binding InterceptReturnInfoStr, Converter={StaticResource HasTextVisibility}}" />
|
||||||
</WrapPanel>
|
</WrapPanel>
|
||||||
</wpf:TitleContent>
|
</wpf:TitleContent>
|
||||||
|
|
||||||
@@ -1087,18 +1279,20 @@
|
|||||||
IsReadOnly="True"
|
IsReadOnly="True"
|
||||||
Text="{Binding AddEditTransitWarehouseReturnOrderWaybillStr}"
|
Text="{Binding AddEditTransitWarehouseReturnOrderWaybillStr}"
|
||||||
TextWrapping="Wrap"
|
TextWrapping="Wrap"
|
||||||
|
Visibility="{Binding AddEditTransitWarehouseReturnOrderWaybillStr, Converter={StaticResource HasTextVisibility}}"
|
||||||
WaterMark="云仓退货" />
|
WaterMark="云仓退货" />
|
||||||
<Button
|
<Button
|
||||||
x:Name="btnRetrunOrder"
|
x:Name="btnRetrunOrder"
|
||||||
d:Content="添加"
|
d:Content="创建"
|
||||||
Click="btnReturnOrder_Click"
|
Click="btnReturnOrder_Click"
|
||||||
Content="{Binding AddEditTransitWarehouseReturnOrderStr}"
|
Content="{Binding AddEditTransitWarehouseReturnOrderStr}"
|
||||||
Style="{StaticResource LinkButton}" />
|
Style="{StaticResource BasePageButtonLightStyle}" />
|
||||||
|
<!-- Style="{StaticResource LinkButton}" -->
|
||||||
</WrapPanel>
|
</WrapPanel>
|
||||||
</wpf:TitleContent>
|
</wpf:TitleContent>
|
||||||
|
|
||||||
<!-- 总店地址 -->
|
<!-- 总店地址 -->
|
||||||
<wpf:TitleContent Title="总店地址:" Visibility="{Binding PddBuyerAfterSaleAddressStr, Converter={StaticResource HasTextVisibility}}">
|
<wpf:TitleContent Title="总店地址:" Visibility="{Binding PddBuyerAfterSaleAddressStrVisibility}">
|
||||||
<WrapPanel Orientation="Horizontal">
|
<WrapPanel Orientation="Horizontal">
|
||||||
<uc:UcWaterMarkTextBox1
|
<uc:UcWaterMarkTextBox1
|
||||||
x:Name="txtBuyerRefundAddress"
|
x:Name="txtBuyerRefundAddress"
|
||||||
@@ -1108,10 +1302,9 @@
|
|||||||
Background="Transparent"
|
Background="Transparent"
|
||||||
BorderThickness="1"
|
BorderThickness="1"
|
||||||
IsReadOnly="True"
|
IsReadOnly="True"
|
||||||
Text="{Binding PddBuyerAfterSaleAddressStr, Converter={StaticResource TextEllipsisConverter}}"
|
Text="{Binding PddBuyerAfterSaleAddressShortStr}"
|
||||||
TextWrapping="Wrap"
|
TextWrapping="Wrap"
|
||||||
ToolTip="{Binding PddBuyerAfterSaleAddressStr}"
|
ToolTip="{Binding PddBuyerAfterSaleAddressStr}"
|
||||||
Visibility="{Binding Text, RelativeSource={RelativeSource Self}, Converter={StaticResource HasTextVisibility}}"
|
|
||||||
WaterMark="总店退货地址" />
|
WaterMark="总店退货地址" />
|
||||||
<Border
|
<Border
|
||||||
Width="12"
|
Width="12"
|
||||||
@@ -1131,7 +1324,7 @@
|
|||||||
</wpf:TitleContent>
|
</wpf:TitleContent>
|
||||||
|
|
||||||
<!-- 直发总店 -->
|
<!-- 直发总店 -->
|
||||||
<wpf:TitleContent Title="直发总店:" Visibility="{Binding DirectPddBuyerAfterSaleAddressStr, Converter={StaticResource HasTextVisibility}}">
|
<wpf:TitleContent Title="直发总店:" Visibility="{Binding DirectPddBuyerAfterSaleAddressStrVisibility}">
|
||||||
<WrapPanel Orientation="Horizontal">
|
<WrapPanel Orientation="Horizontal">
|
||||||
<uc:UcWaterMarkTextBox1
|
<uc:UcWaterMarkTextBox1
|
||||||
x:Name="txtDirectBuyerRefundAddress"
|
x:Name="txtDirectBuyerRefundAddress"
|
||||||
@@ -1141,10 +1334,9 @@
|
|||||||
Background="Transparent"
|
Background="Transparent"
|
||||||
BorderThickness="1"
|
BorderThickness="1"
|
||||||
IsReadOnly="True"
|
IsReadOnly="True"
|
||||||
Text="{Binding DirectPddBuyerAfterSaleAddressStr, Converter={StaticResource TextEllipsisConverter}}"
|
Text="{Binding DirectPddBuyerAfterSaleAddressShortStr}"
|
||||||
TextWrapping="Wrap"
|
TextWrapping="Wrap"
|
||||||
ToolTip="{Binding DirectPddBuyerAfterSaleAddressStr}"
|
ToolTip="{Binding DirectPddBuyerAfterSaleAddressStr}"
|
||||||
Visibility="{Binding Text, RelativeSource={RelativeSource Self}, Converter={StaticResource HasTextVisibility}}"
|
|
||||||
WaterMark="总店退货地址" />
|
WaterMark="总店退货地址" />
|
||||||
<Border
|
<Border
|
||||||
Width="12"
|
Width="12"
|
||||||
@@ -1153,7 +1345,7 @@
|
|||||||
Background="Transparent"
|
Background="Transparent"
|
||||||
Cursor="Hand"
|
Cursor="Hand"
|
||||||
MouseLeftButtonDown="pathDirectBuyerAfterSaleAddress_MouseLeftButtonDown"
|
MouseLeftButtonDown="pathDirectBuyerAfterSaleAddress_MouseLeftButtonDown"
|
||||||
Visibility="{Binding ElementName=txtBuyerRefundAddress, Path=Visibility}">
|
Visibility="{Binding ElementName=txtDirectBuyerRefundAddress, Path=Visibility}">
|
||||||
<Path
|
<Path
|
||||||
Data="M80 432a128 128 0 0 1 128-128h384a128 128 0 0 1 128 128v384a128 128 0 0 1-128 128h-384a128 128 0 0 1-128-128v-384z m128-64a64 64 0 0 0-64 64v384a64 64 0 0 0 64 64h384a64 64 0 0 0 64-64v-384a64 64 0 0 0-64-64h-384z M816 144h-384a64 64 0 0 0-64 64 32 32 0 0 1-64 0 128 128 0 0 1 128-128h384a128 128 0 0 1 128 128v384a128 128 0 0 1-128 128 32 32 0 0 1 0-64 64 64 0 0 0 64-64v-384a64 64 0 0 0-64-64z"
|
Data="M80 432a128 128 0 0 1 128-128h384a128 128 0 0 1 128 128v384a128 128 0 0 1-128 128h-384a128 128 0 0 1-128-128v-384z m128-64a64 64 0 0 0-64 64v384a64 64 0 0 0 64 64h384a64 64 0 0 0 64-64v-384a64 64 0 0 0-64-64h-384z M816 144h-384a64 64 0 0 0-64 64 32 32 0 0 1-64 0 128 128 0 0 1 128-128h384a128 128 0 0 1 128 128v384a128 128 0 0 1-128 128 32 32 0 0 1 0-64 64 64 0 0 0 64-64v-384a64 64 0 0 0-64-64z"
|
||||||
Fill="{StaticResource PageLinkBrush}"
|
Fill="{StaticResource PageLinkBrush}"
|
||||||
@@ -1165,30 +1357,45 @@
|
|||||||
|
|
||||||
</wpf:SpacingStackPanel>
|
</wpf:SpacingStackPanel>
|
||||||
<!-- 操作 -->
|
<!-- 操作 -->
|
||||||
|
|
||||||
|
|
||||||
<wpf:SpacingStackPanel
|
<wpf:SpacingStackPanel
|
||||||
Grid.Column="8"
|
Grid.Column="8"
|
||||||
|
HorizontalAlignment="Right"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Orientation="Vertical"
|
HorizontalSpacing="1"
|
||||||
VerticalSpacing="5">
|
ItemHorizontalAlignment="Right"
|
||||||
<!-- 操作按钮行(原 Row 1) -->
|
ItemVerticalAlignment="Center"
|
||||||
<wpf:TitleContent>
|
Orientation="Horizontal"
|
||||||
<WrapPanel HorizontalAlignment="Center">
|
VerticalSpacing="6">
|
||||||
|
|
||||||
|
<wpf:SpacingStackPanel
|
||||||
|
Grid.Column="8"
|
||||||
|
HorizontalAlignment="Right"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Orientation="Vertical"
|
||||||
|
VerticalSpacing="6">
|
||||||
|
|
||||||
|
|
||||||
|
<wpf:TitleContent>
|
||||||
<Button
|
<Button
|
||||||
x:Name="btnMapSkus"
|
x:Name="btnMapSkus"
|
||||||
Height="24"
|
Height="22"
|
||||||
MinWidth="38"
|
MinWidth="38"
|
||||||
Margin="4,4,0,4"
|
Margin="0,0,0,0"
|
||||||
HorizontalAlignment="Center"
|
HorizontalAlignment="Center"
|
||||||
Click="btnMapSkus_Click"
|
Click="btnMapSkus_Click"
|
||||||
Content="选择SKU"
|
Content="选择SKU"
|
||||||
Style="{StaticResource BasePageButtonLightStyle}"
|
Style="{StaticResource BasePageButtonLightStyle}"
|
||||||
Visibility="{Binding MapSkusBtnVisibility}" />
|
Visibility="{Binding MapSkusBtnVisibility}" />
|
||||||
|
</wpf:TitleContent>
|
||||||
|
|
||||||
|
<wpf:TitleContent>
|
||||||
<Button
|
<Button
|
||||||
x:Name="btnBuyOrder"
|
x:Name="btnBuyOrder"
|
||||||
Height="24"
|
Height="22"
|
||||||
MinWidth="38"
|
MinWidth="38"
|
||||||
Margin="4,0,0,0"
|
Margin="0,0,0,0"
|
||||||
HorizontalAlignment="Center"
|
HorizontalAlignment="Center"
|
||||||
d:Background="{StaticResource pageColorLightBrush}"
|
d:Background="{StaticResource pageColorLightBrush}"
|
||||||
d:BorderBrush="{StaticResource pageColorBrush}"
|
d:BorderBrush="{StaticResource pageColorBrush}"
|
||||||
@@ -1204,61 +1411,140 @@
|
|||||||
Style="{StaticResource BasePageButtonLightStyle}"
|
Style="{StaticResource BasePageButtonLightStyle}"
|
||||||
Visibility="{Binding ItemOrder.IsWaitBuy, Converter={StaticResource visibleToVisibilityConverter}}" />
|
Visibility="{Binding ItemOrder.IsWaitBuy, Converter={StaticResource visibleToVisibilityConverter}}" />
|
||||||
|
|
||||||
|
</wpf:TitleContent>
|
||||||
|
<wpf:TitleContent>
|
||||||
<Button
|
<Button
|
||||||
x:Name="btnVoidTransitOrder"
|
x:Name="btnVoidTransitOrder"
|
||||||
Height="24"
|
Height="22"
|
||||||
MinWidth="38"
|
MinWidth="38"
|
||||||
Margin="4,0,0,0"
|
Margin="0,0,0,0"
|
||||||
HorizontalAlignment="Center"
|
HorizontalAlignment="Center"
|
||||||
d:Visibility="Visible"
|
d:Visibility="Visible"
|
||||||
Click="btnVoidTransitOrder_Click"
|
Click="btnVoidTransitOrder_Click"
|
||||||
Content="作废重拍"
|
Content="作废重拍"
|
||||||
Style="{StaticResource BasePageButtonLightStyle}"
|
Style="{StaticResource BasePageButtonLightStyle}"
|
||||||
Visibility="Collapsed" />
|
Visibility="{Binding BtnVoidTransitOrderVisibility}" />
|
||||||
|
</wpf:TitleContent>
|
||||||
|
|
||||||
|
<wpf:TitleContent>
|
||||||
<Button
|
<Button
|
||||||
x:Name="btnAbnormalOrderRebuy"
|
x:Name="btnAbnormalOrderRebuy"
|
||||||
Height="24"
|
Height="22"
|
||||||
MinWidth="38"
|
MinWidth="38"
|
||||||
Margin="4,0,0,0"
|
Margin="0,0,0,0"
|
||||||
HorizontalAlignment="Center"
|
HorizontalAlignment="Center"
|
||||||
d:Visibility="Visible"
|
d:Visibility="Visible"
|
||||||
Click="btnAbnormalOrderRebuy_Click"
|
Click="btnAbnormalOrderRebuy_Click"
|
||||||
Content="异常重拍"
|
Content="异常重拍"
|
||||||
Style="{StaticResource BasePageButtonLightStyle}"
|
Style="{StaticResource BasePageButtonLightStyle}"
|
||||||
Visibility="Collapsed" />
|
Visibility="{Binding BtnAbnormalOrderRebuyVisibility}" />
|
||||||
</WrapPanel>
|
</wpf:TitleContent>
|
||||||
</wpf:TitleContent>
|
|
||||||
|
|
||||||
<!-- 直发拍单 -->
|
|
||||||
<wpf:TitleContent>
|
|
||||||
<Button
|
|
||||||
x:Name="btnDirectBuyOrder"
|
|
||||||
Height="24"
|
|
||||||
MinWidth="38"
|
|
||||||
Margin="4,0,0,0"
|
|
||||||
HorizontalAlignment="Center"
|
|
||||||
Click="btnDirectBuyOrder_Click"
|
|
||||||
Content="直发拍单"
|
|
||||||
Style="{StaticResource BasePageButtonLightStyle}"
|
|
||||||
Visibility="{Binding BtnDirectBuyOrderVisibility}" />
|
|
||||||
</wpf:TitleContent>
|
|
||||||
|
|
||||||
<!-- 礼品发货 -->
|
<!-- 直发拍单 -->
|
||||||
<wpf:TitleContent>
|
<wpf:TitleContent>
|
||||||
|
<Button
|
||||||
|
x:Name="btnDirectBuyOrder"
|
||||||
|
Height="22"
|
||||||
|
MinWidth="38"
|
||||||
|
Margin="0,0,0,0"
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
Click="btnDirectBuyOrder_Click"
|
||||||
|
Content="直发拍单"
|
||||||
|
Style="{StaticResource BasePageButtonLightStyle}"
|
||||||
|
Visibility="{Binding BtnDirectBuyOrderVisibility}" />
|
||||||
|
</wpf:TitleContent>
|
||||||
|
|
||||||
|
<!-- 礼品发货 -->
|
||||||
|
<wpf:TitleContent>
|
||||||
|
<Button
|
||||||
|
x:Name="btnShipGift"
|
||||||
|
Height="22"
|
||||||
|
MinWidth="38"
|
||||||
|
Margin="0,0,0,0"
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
d:Visibility="Visible"
|
||||||
|
Click="btn_ShipGiftCommand"
|
||||||
|
Content="礼品发货"
|
||||||
|
Style="{StaticResource BasePageButtonLightStyle}"
|
||||||
|
Visibility="{Binding ItemOrder.IsWaitSend, Converter={StaticResource VisibleToVisibilityConverter}}" />
|
||||||
|
</wpf:TitleContent>
|
||||||
|
</wpf:SpacingStackPanel>
|
||||||
|
|
||||||
|
<wpf:SpacingStackPanel
|
||||||
|
Grid.Column="8"
|
||||||
|
HorizontalAlignment="Right"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Orientation="Vertical"
|
||||||
|
VerticalSpacing="3">
|
||||||
<Button
|
<Button
|
||||||
x:Name="btnShipGift"
|
x:Name="btnChangeWaybill"
|
||||||
Height="24"
|
|
||||||
MinWidth="38"
|
MinWidth="38"
|
||||||
Margin="4,0,0,0"
|
MinHeight="20"
|
||||||
|
Margin="0,0,0,0"
|
||||||
|
Padding="0"
|
||||||
HorizontalAlignment="Center"
|
HorizontalAlignment="Center"
|
||||||
d:Visibility="Visible"
|
d:Visibility="Visible"
|
||||||
Click="btn_ShipGiftCommand"
|
Click="btnChangeWaybill_Click"
|
||||||
Content="礼品发货"
|
Content="补发/修改物流"
|
||||||
|
FontSize="11"
|
||||||
Style="{StaticResource BasePageButtonLightStyle}"
|
Style="{StaticResource BasePageButtonLightStyle}"
|
||||||
Visibility="{Binding ItemOrder.IsWaitSend, Converter={StaticResource VisibleToVisibilityConverter}}" />
|
Visibility="{Binding ItemOrder.IsShowChangeWaybillBtn, Converter={StaticResource VisibleToVisibilityConverter}}" />
|
||||||
</wpf:TitleContent>
|
<Button
|
||||||
|
x:Name="btnAddEditTransitWarehouseReject_New"
|
||||||
|
MinWidth="38"
|
||||||
|
MinHeight="20"
|
||||||
|
Margin="0,0,0,0"
|
||||||
|
Padding="0"
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
d:Visibility="Visible"
|
||||||
|
Click="btnAddEditTransitWarehouseReject_Click"
|
||||||
|
Style="{StaticResource BasePageButtonLightStyle}"
|
||||||
|
Visibility="{Binding RejectOrReturnPackageBtnVisibility}">
|
||||||
|
<TextBlock>
|
||||||
|
云仓拒收<LineBreak />
|
||||||
|
退回总店</TextBlock>
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
x:Name="btnAddEditTransitWarehouseAfterSale_n1"
|
||||||
|
MinWidth="38"
|
||||||
|
MinHeight="20"
|
||||||
|
Margin="0,0,0,0"
|
||||||
|
Padding="0"
|
||||||
|
Click="btnAddEditTransitWarehouseAfterSale_Click"
|
||||||
|
Style="{StaticResource BasePageButtonLightStyle}"
|
||||||
|
Visibility="{Binding RejectOrReturnPackageBtnVisibility}">
|
||||||
|
<TextBlock>
|
||||||
|
拒收失败<LineBreak />
|
||||||
|
转寄总店</TextBlock>
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
x:Name="btnAddEditTransitWarehouseAfterSale_n2"
|
||||||
|
MinWidth="38"
|
||||||
|
MinHeight="20"
|
||||||
|
Margin="0,0,0,0"
|
||||||
|
Padding="0"
|
||||||
|
Click="btnAddEditTransitWarehouseAfterSale_Click"
|
||||||
|
Style="{StaticResource BasePageButtonLightStyle}"
|
||||||
|
Visibility="{Binding RejectOrReturnPackageBtnVisibility}">
|
||||||
|
<TextBlock>
|
||||||
|
出库拦截<LineBreak />
|
||||||
|
退回仓库</TextBlock>
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
x:Name="btnTransitExtraPackages"
|
||||||
|
Height="20"
|
||||||
|
MinWidth="38"
|
||||||
|
Margin="0,0,0,0"
|
||||||
|
Padding="0"
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
d:Visibility="Visible"
|
||||||
|
Click="btnTransitExtraPackages_Click"
|
||||||
|
Content="滞留补发买家"
|
||||||
|
FontSize="11"
|
||||||
|
Style="{StaticResource BasePageButtonLightStyle}"
|
||||||
|
Visibility="{Binding ItemOrder.IsShowTransitExtraPackagesBtn, Converter={StaticResource VisibleToVisibilityConverter}}" />
|
||||||
|
</wpf:SpacingStackPanel>
|
||||||
</wpf:SpacingStackPanel>
|
</wpf:SpacingStackPanel>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|||||||
File diff suppressed because it is too large.
Load diff
@@ -2,7 +2,7 @@
|
|||||||
x:Class="_29WxOrderWpf.Ctrls.OrderCtrls.OrderTaskDialogView"
|
x:Class="_29WxOrderWpf.Ctrls.OrderCtrls.OrderTaskDialogView"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:comn="clr-namespace:_29WxOrderWpf.Common"
|
xmlns:comn="WxOrder.Framework"
|
||||||
xmlns:converters="clr-namespace:_29WxOrderWpf.Converters"
|
xmlns:converters="clr-namespace:_29WxOrderWpf.Converters"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:local="clr-namespace:_29WxOrderWpf.Ctrls.OrderCtrls"
|
xmlns:local="clr-namespace:_29WxOrderWpf.Ctrls.OrderCtrls"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using _29WxOrderWpf.Commands;
|
using WxOrder.Framework.Commons;
|
||||||
using _29WxOrderWpf.Services;
|
using _29WxOrderWpf.Services;
|
||||||
using AllBase.Model.MvvmBaseClasses;
|
using AllBase.Model.MvvmBaseClasses;
|
||||||
using AllBase.Util;
|
using AllBase.Util;
|
||||||
|
|||||||
@@ -0,0 +1,140 @@
|
|||||||
|
// 填写信息
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
})();
|
||||||
@@ -0,0 +1,87 @@
|
|||||||
|
<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>
|
||||||
@@ -0,0 +1,87 @@
|
|||||||
|
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"
|
x:Class="_29WxOrderWpf.Ctrls.PDDInvoice.PDDInvoiceView"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:comm="clr-namespace:_29WxOrderWpf.Common"
|
xmlns:comm="WxOrder.Framework"
|
||||||
xmlns:common="clr-namespace:_29WxOrderWpf.Common"
|
xmlns:common="WxOrder.Framework"
|
||||||
xmlns:converters="clr-namespace:_29WxOrderWpf.Converters"
|
xmlns:converters="clr-namespace:_29WxOrderWpf.Converters"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:vm="clr-namespace:_29WxOrderWpf.Ctrls.PDDInvoice.ViewModels"
|
xmlns:vm="clr-namespace:_29WxOrderWpf.Ctrls.PDDInvoice.ViewModels"
|
||||||
xmlns:wpf="clr-namespace:WPFCommon.Controls;assembly=WPFCommon"
|
xmlns:wpf="clr-namespace:WPFCommon.Controls;assembly=WPFCommon"
|
||||||
comm:DialogWindowProperty.ResizeMode="CanResizeWithGrip"
|
comm:DialogWindowProperty.ResizeMode="CanResizeWithGrip"
|
||||||
comm:DialogWindowProperty.ShowMinButton="False"
|
comm:DialogWindowProperty.ShowMinButton="True"
|
||||||
common:DialogWindowProperty.Height="720"
|
common:DialogWindowProperty.Height="720"
|
||||||
common:DialogWindowProperty.Width="1260"
|
common:DialogWindowProperty.Width="1260"
|
||||||
d:DataContext="{d:DesignInstance Type=vm:PDDInvoiceViewModel,
|
d:DataContext="{d:DesignInstance Type=vm:PDDInvoiceViewModel,
|
||||||
IsDesignTimeCreatable=True}"
|
IsDesignTimeCreatable=True}"
|
||||||
d:DesignHeight="720"
|
d:DesignHeight="720"
|
||||||
d:DesignWidth="1260"
|
d:DesignWidth="1960"
|
||||||
Background="White"
|
Background="White"
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
|
|
||||||
<UserControl.Resources>
|
<UserControl.Resources>
|
||||||
<BooleanToVisibilityConverter x:Key="BooleanToVisibility" />
|
<BooleanToVisibilityConverter x:Key="BooleanToVisibility" />
|
||||||
<converters:ImageUrlToBitmapImageConverter x:Key="ImageUrlToBitmapImage" />
|
<converters:ImageUrlToBitmapImageConverter x:Key="ImageUrlToBitmapImageConverter" />
|
||||||
<converters:InverseVisibleToVisibilityConverter x:Key="InverseBooleanToVisibility" />
|
<converters:InverseVisibleToVisibilityConverter x:Key="InverseBooleanToVisibility" />
|
||||||
|
<converters:ImageLoadRequestConverter x:Key="ImageLoadRequestConverter" />
|
||||||
<!-- 原型配色 -->
|
<!-- 原型配色 -->
|
||||||
<SolidColorBrush x:Key="PageBgBrush" Color="#F5F6F8" />
|
<SolidColorBrush x:Key="PageBgBrush" Color="#F5F6F8" />
|
||||||
<SolidColorBrush x:Key="CardBgBrush" Color="#FFFFFF" />
|
<SolidColorBrush x:Key="CardBgBrush" Color="#FFFFFF" />
|
||||||
@@ -50,7 +50,7 @@
|
|||||||
|
|
||||||
<!-- 搜索 / 表单输入框 -->
|
<!-- 搜索 / 表单输入框 -->
|
||||||
<Style x:Key="SearchTextBoxStyle" TargetType="TextBox">
|
<Style x:Key="SearchTextBoxStyle" TargetType="TextBox">
|
||||||
<Setter Property="Height" Value="36" />
|
<Setter Property="Height" Value="30" />
|
||||||
<Setter Property="Padding" Value="12,0" />
|
<Setter Property="Padding" Value="12,0" />
|
||||||
<Setter Property="VerticalContentAlignment" Value="Center" />
|
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||||
<Setter Property="FontSize" Value="13" />
|
<Setter Property="FontSize" Value="13" />
|
||||||
@@ -81,76 +81,9 @@
|
|||||||
</Setter.Value>
|
</Setter.Value>
|
||||||
</Setter>
|
</Setter>
|
||||||
</Style>
|
</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>
|
||||||
|
|
||||||
<!-- 默认按钮 -->
|
|
||||||
<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">
|
<Style x:Key="LinkButtonStyle" TargetType="Button">
|
||||||
<Setter Property="Background" Value="Transparent" />
|
<Setter Property="Background" Value="Transparent" />
|
||||||
@@ -196,7 +129,7 @@
|
|||||||
<Border Padding="10,10,10,0">
|
<Border Padding="10,10,10,0">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="30" />
|
||||||
<RowDefinition Height="*" />
|
<RowDefinition Height="*" />
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
@@ -205,10 +138,9 @@
|
|||||||
<Border Grid.Row="0">
|
<Border Grid.Row="0">
|
||||||
|
|
||||||
<wpf:SpacingStackPanel Background="{StaticResource CardBgBrush}" HorizontalSpacing="10">
|
<wpf:SpacingStackPanel Background="{StaticResource CardBgBrush}" HorizontalSpacing="10">
|
||||||
<Grid Width="300">
|
<Grid Width="200">
|
||||||
<TextBox
|
<TextBox
|
||||||
x:Name="txtSearch"
|
x:Name="txtSearch"
|
||||||
Height="30"
|
|
||||||
Padding="5,0,0,0"
|
Padding="5,0,0,0"
|
||||||
KeyDown="txtSearch_KeyDown"
|
KeyDown="txtSearch_KeyDown"
|
||||||
Style="{StaticResource SearchTextBoxStyle}"
|
Style="{StaticResource SearchTextBoxStyle}"
|
||||||
@@ -222,17 +154,56 @@
|
|||||||
Text="请输入订单号 / 商品名称"
|
Text="请输入订单号 / 商品名称"
|
||||||
Visibility="{Binding Text, ElementName=txtSearch, Converter={StaticResource NotHasTextVisibility}}" />
|
Visibility="{Binding Text, ElementName=txtSearch, Converter={StaticResource NotHasTextVisibility}}" />
|
||||||
</Grid>
|
</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
|
<Button
|
||||||
Width="50"
|
Width="50"
|
||||||
Height="30"
|
|
||||||
Command="{Binding SearchCommand}"
|
Command="{Binding SearchCommand}"
|
||||||
Content="搜索"
|
Content="搜索" />
|
||||||
Style="{StaticResource BasePageButtonStyle}" />
|
|
||||||
<Button
|
<Button
|
||||||
Height="30"
|
|
||||||
Command="{Binding ResetCommand}"
|
Command="{Binding ResetCommand}"
|
||||||
Content="重置"
|
Content="重置"
|
||||||
Style="{StaticResource DefaultButtonStyle}" />
|
Style="{StaticResource LinkButtonStyle}" />
|
||||||
|
|
||||||
<wpf:TitleContent
|
<wpf:TitleContent
|
||||||
Title="买手号:"
|
Title="买手号:"
|
||||||
@@ -247,11 +218,9 @@
|
|||||||
Style="{StaticResource RoundedComboBox}" />
|
Style="{StaticResource RoundedComboBox}" />
|
||||||
</wpf:TitleContent>
|
</wpf:TitleContent>
|
||||||
<Button
|
<Button
|
||||||
Height="30"
|
|
||||||
Padding="5,0"
|
Padding="5,0"
|
||||||
Command="{Binding ReadOrderCommand}"
|
Command="{Binding ReadOrderCommand}"
|
||||||
Content="读取订单"
|
Content="读取订单"
|
||||||
Style="{StaticResource BasePageButtonStyle}"
|
|
||||||
Visibility="{Binding IsReadOrder, Converter={StaticResource Boolean2VisibilityReConverter}}" />
|
Visibility="{Binding IsReadOrder, Converter={StaticResource Boolean2VisibilityReConverter}}" />
|
||||||
<Button
|
<Button
|
||||||
Height="30"
|
Height="30"
|
||||||
@@ -261,13 +230,22 @@
|
|||||||
Style="{StaticResource BasePageButtonStyle}"
|
Style="{StaticResource BasePageButtonStyle}"
|
||||||
Visibility="{Binding IsReadOrder, Converter={StaticResource Boolean2VisibilityConverter}}" />
|
Visibility="{Binding IsReadOrder, Converter={StaticResource Boolean2VisibilityConverter}}" />
|
||||||
<Button
|
<Button
|
||||||
Height="30"
|
|
||||||
Padding="10,0"
|
Padding="10,0"
|
||||||
Command="{Binding BatchInvoiceCommand}"
|
Command="{Binding BatchInvoiceCommand}"
|
||||||
Content="批量开票"
|
Content="批量开票"
|
||||||
Style="{StaticResource BasePageButtonStyle}" />
|
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}" />
|
||||||
|
|
||||||
<wpf:TitleContent
|
<!--<wpf:TitleContent
|
||||||
Title="公司:"
|
Title="公司:"
|
||||||
Placement="Left"
|
Placement="Left"
|
||||||
TitleVerticalAlignment="Center">
|
TitleVerticalAlignment="Center">
|
||||||
@@ -299,11 +277,12 @@
|
|||||||
Maximum="999999"
|
Maximum="999999"
|
||||||
Minimum="0"
|
Minimum="0"
|
||||||
Value="{Binding MaxAmount}" />
|
Value="{Binding MaxAmount}" />
|
||||||
</wpf:TitleContent>
|
</wpf:TitleContent>-->
|
||||||
<CheckBox
|
<CheckBox
|
||||||
VerticalContentAlignment="Center"
|
VerticalContentAlignment="Center"
|
||||||
Content="显示订单窗口"
|
Content="显示订单窗口"
|
||||||
IsChecked="{Binding IsOrderListDialogOpen}" />
|
IsChecked="{Binding IsOrderListDialogOpen}" />
|
||||||
|
|
||||||
</wpf:SpacingStackPanel>
|
</wpf:SpacingStackPanel>
|
||||||
</Border>
|
</Border>
|
||||||
<!-- 订单列表(已移除分页与订单分组) -->
|
<!-- 订单列表(已移除分页与订单分组) -->
|
||||||
@@ -403,15 +382,18 @@
|
|||||||
<Border Background="White">
|
<Border Background="White">
|
||||||
<!-- 列表(虚拟化滚动加载) -->
|
<!-- 列表(虚拟化滚动加载) -->
|
||||||
<ItemsControl
|
<ItemsControl
|
||||||
|
x:Name="itemsControl"
|
||||||
Margin="0,2,0,-2"
|
Margin="0,2,0,-2"
|
||||||
Padding="0"
|
Padding="0"
|
||||||
HorizontalContentAlignment="Stretch"
|
HorizontalContentAlignment="Stretch"
|
||||||
ItemsSource="{Binding Orders}">
|
ItemsSource="{Binding OrdersView}">
|
||||||
<ItemsControl.Template>
|
<ItemsControl.Template>
|
||||||
<ControlTemplate TargetType="ItemsControl">
|
<ControlTemplate TargetType="ItemsControl">
|
||||||
<ScrollViewer
|
<ScrollViewer
|
||||||
|
x:Name="PART_ScrollViewer"
|
||||||
CanContentScroll="True"
|
CanContentScroll="True"
|
||||||
HorizontalScrollBarVisibility="Disabled"
|
HorizontalScrollBarVisibility="Disabled"
|
||||||
|
ScrollChanged="ScrollViewer_ScrollChanged"
|
||||||
VerticalScrollBarVisibility="Auto">
|
VerticalScrollBarVisibility="Auto">
|
||||||
<ItemsPresenter />
|
<ItemsPresenter />
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
@@ -479,8 +461,7 @@
|
|||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
HorizontalAlignment="Center"
|
HorizontalAlignment="Center"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
IsChecked="{Binding IsSelected}"
|
IsChecked="{Binding IsSelected}" />
|
||||||
IsEnabled="{Binding IsSelected}" />
|
|
||||||
|
|
||||||
<!-- 商品 -->
|
<!-- 商品 -->
|
||||||
<Grid Grid.Column="1" VerticalAlignment="Center">
|
<Grid Grid.Column="1" VerticalAlignment="Center">
|
||||||
@@ -493,7 +474,27 @@
|
|||||||
Height="72"
|
Height="72"
|
||||||
Background="#EEEEEE"
|
Background="#EEEEEE"
|
||||||
CornerRadius="5">
|
CornerRadius="5">
|
||||||
<Image Source="{Binding ThumbUrl, Converter={StaticResource ImageUrlToBitmapImage}, IsAsync=True}" Stretch="UniformToFill" />
|
<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>-->
|
||||||
</Border>
|
</Border>
|
||||||
<StackPanel
|
<StackPanel
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
@@ -653,13 +654,12 @@
|
|||||||
Value="{Binding ProgressValue}" />
|
Value="{Binding ProgressValue}" />
|
||||||
<Grid Margin="10,0">
|
<Grid Margin="10,0">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="Auto" />
|
<ColumnDefinition />
|
||||||
<ColumnDefinition Width="100*" />
|
<ColumnDefinition />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<TextBox
|
<TextBox
|
||||||
Grid.Row="2"
|
Grid.Column="0"
|
||||||
Grid.Column="1"
|
|
||||||
Margin="4,0,0,0"
|
Margin="4,0,0,0"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
d:Text="共计:{}"
|
d:Text="共计:{}"
|
||||||
@@ -668,6 +668,17 @@
|
|||||||
Foreground="White"
|
Foreground="White"
|
||||||
IsReadOnly="True"
|
IsReadOnly="True"
|
||||||
Text="{Binding BottomMsg}" />
|
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>
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using _29WxOrderWpf.Ctrls.PDDInvoice.ViewModels;
|
using _29WxOrderWpf.Ctrls.PDDInvoice.ViewModels;
|
||||||
|
using CefSharp.DevTools.Overlay;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@@ -13,6 +14,7 @@ using System.Windows.Media;
|
|||||||
using System.Windows.Media.Imaging;
|
using System.Windows.Media.Imaging;
|
||||||
using System.Windows.Navigation;
|
using System.Windows.Navigation;
|
||||||
using System.Windows.Shapes;
|
using System.Windows.Shapes;
|
||||||
|
using System.Windows.Threading;
|
||||||
|
|
||||||
namespace _29WxOrderWpf.Ctrls.PDDInvoice;
|
namespace _29WxOrderWpf.Ctrls.PDDInvoice;
|
||||||
|
|
||||||
@@ -21,10 +23,17 @@ namespace _29WxOrderWpf.Ctrls.PDDInvoice;
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class PDDInvoiceView : UserControl
|
public partial class PDDInvoiceView : UserControl
|
||||||
{
|
{
|
||||||
|
private PDDInvoiceViewModel vm = new PDDInvoiceViewModel();
|
||||||
public PDDInvoiceView()
|
public PDDInvoiceView()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
DataContext = new PDDInvoiceViewModel();
|
DataContext = vm;
|
||||||
|
vm.BatchInvoiceChanged += Vm_BatchInvoiceChanged;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Vm_BatchInvoiceChanged(object sender, int e)
|
||||||
|
{
|
||||||
|
ScrollToCurrent(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void txtSearch_KeyDown(object sender, KeyEventArgs e)
|
private void txtSearch_KeyDown(object sender, KeyEventArgs e)
|
||||||
@@ -34,4 +43,60 @@ public partial class PDDInvoiceView : UserControl
|
|||||||
viewModel.SearchCommand.Execute(null);
|
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,134 +1,302 @@
|
|||||||
// 填写信息
|
/*!
|
||||||
function changeReactInputValue(inputDom, newText) {
|
* invoice_hook.js · v1.0.0
|
||||||
let lastValue = inputDom.value;
|
* 发票申请 Hook
|
||||||
inputDom.value = newText;
|
* - 使用 window.InvoiceApply 统一暴露接口
|
||||||
let event = new Event('input', { bubbles: true });
|
* - 支持重复注入,不重复自动执行
|
||||||
event.simulated = true;
|
* - CEF 可通过 window.InvoiceApply.__installed 判断脚本是否已注入
|
||||||
let tracker = inputDom._valueTracker;
|
* - 执行结果保存在 window.__invoiceApplyResult
|
||||||
if (tracker) {
|
*/
|
||||||
tracker.setValue(lastValue);
|
; (function (global) {
|
||||||
}
|
'use strict';
|
||||||
inputDom.dispatchEvent(event);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 异步 sleep
|
// 已注入时不重复创建对象或重复自动执行
|
||||||
function sleep(ms) {
|
if (global.InvoiceApply && global.InvoiceApply.__installed) {
|
||||||
return new Promise(resolve => setTimeout(resolve, ms));
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
// 查找元素(支持选择器或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 fillInvoiceAndApply(data = {}) {
|
|
||||||
const {
|
|
||||||
title = '某某科技有限公司',
|
|
||||||
taxNumber = '91110000123456789X'
|
|
||||||
} = data;
|
|
||||||
|
|
||||||
console.log('📝 开始填充发票信息...');
|
|
||||||
|
|
||||||
// 1. 点击"企业"按钮
|
|
||||||
const invoiceType = findElement('//*[contains(text(), "企业")]');
|
|
||||||
if (!invoiceType) {
|
|
||||||
console.warn('⚠️ 找不到"企业"按钮');
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
invoiceType.click();
|
var VERSION = '1.0.0';
|
||||||
console.log('✅ 已点击"企业"按钮');
|
var state = {
|
||||||
await sleep(500);
|
installed: false,
|
||||||
|
running: false,
|
||||||
|
result: null,
|
||||||
|
error: null,
|
||||||
|
lastRunAt: null
|
||||||
|
};
|
||||||
|
|
||||||
// 2. 查找并填充发票抬头
|
function sleep(ms) {
|
||||||
const invoiceTitle = findElement('//label[contains(text(), "发票抬头")]/following-sibling::textarea[1]') ||
|
return new Promise(function (resolve) {
|
||||||
findElement('//*[contains(text(), "发票抬头")]/following-sibling::textarea[1]');
|
global.setTimeout(resolve, ms);
|
||||||
if (invoiceTitle) {
|
});
|
||||||
changeReactInputValue(invoiceTitle, title);
|
|
||||||
console.log('✅ 发票抬头已填充');
|
|
||||||
} else {
|
|
||||||
console.warn('⚠️ 未找到发票抬头控件');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 3. 查找并填充税号
|
// 支持 XPath 或 CSS 选择器
|
||||||
const taxNumberInput = findElement('//label[contains(text(), "税号")]/following-sibling::input[1]') ||
|
function findElement(selector, isXPath) {
|
||||||
findElement('//*[contains(text(), "税号")]/following-sibling::input[1]');
|
if (isXPath === undefined) isXPath = true;
|
||||||
if (taxNumberInput) {
|
|
||||||
changeReactInputValue(taxNumberInput, taxNumber);
|
try {
|
||||||
console.log('✅ 税号已填充');
|
if (isXPath) {
|
||||||
} else {
|
return global.document.evaluate(
|
||||||
console.warn('⚠️ 未找到税号控件');
|
selector,
|
||||||
|
global.document,
|
||||||
|
null,
|
||||||
|
global.XPathResult.FIRST_ORDERED_NODE_TYPE,
|
||||||
|
null
|
||||||
|
).singleNodeValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
return global.document.querySelector(selector);
|
||||||
|
} catch (e) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
await sleep(300);
|
function changeReactInputValue(inputDom, newText) {
|
||||||
|
if (!inputDom) return false;
|
||||||
|
|
||||||
// 4. 查找并点击"申请发票"按钮
|
var lastValue = inputDom.value;
|
||||||
const applyBtn = findElement('//*[contains(text(), "申请发票")]');
|
var valueSetter = null;
|
||||||
if (!applyBtn) {
|
|
||||||
console.error('❌ 未找到"申请发票"按钮');
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
applyBtn.scrollIntoView({ behavior: 'smooth', block: 'center' });
|
// 优先使用原生 input/textarea value setter,便于 React 感知值变化
|
||||||
await sleep(300);
|
try {
|
||||||
applyBtn.click();
|
var proto = inputDom.tagName === 'TEXTAREA'
|
||||||
console.log('✅ 已点击"申请发票"按钮');
|
? global.HTMLTextAreaElement.prototype
|
||||||
|
: global.HTMLInputElement.prototype;
|
||||||
|
|
||||||
// 5. 等待弹窗/状态出现
|
valueSetter = Object.getOwnPropertyDescriptor(proto, 'value');
|
||||||
await sleep(300);
|
} catch (e) {
|
||||||
|
// ignore
|
||||||
|
}
|
||||||
|
|
||||||
// 6. 判断状态
|
try {
|
||||||
// 检查是否有"已经申请过"的提示
|
if (valueSetter && valueSetter.set) {
|
||||||
const alreadyApplied = findElement('//*[contains(text(), "您已经提交过发票申请了")]')
|
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
|
||||||
|
}
|
||||||
|
|
||||||
if (alreadyApplied) {
|
var event;
|
||||||
console.log('✅ 已经申请过,无需重复操作');
|
|
||||||
return true;
|
try {
|
||||||
}
|
event = new global.Event('input', { bubbles: true });
|
||||||
const successElement = findElement('//*[text()="确认您的发票信息无误后再提交"]');
|
} catch (e) {
|
||||||
if (successElement == null) {
|
event = global.document.createEvent('Event');
|
||||||
return false;
|
event.initEvent('input', true, false);
|
||||||
}
|
}
|
||||||
// 检查是否有"确认开具"按钮或提示
|
|
||||||
const confirmBtn = findElement('//*[text()= "确认"]');
|
event.simulated = true;
|
||||||
|
inputDom.dispatchEvent(event);
|
||||||
|
|
||||||
if (confirmBtn) {
|
|
||||||
console.log('✅ 找到"确认"按钮,准备点击...');
|
|
||||||
await sleep(200);
|
|
||||||
confirmBtn.click();
|
|
||||||
console.log('✅ 已点击"确认"按钮');
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 如果都没有找到
|
async function fillInvoiceAndApply(data) {
|
||||||
console.warn('⚠️ 未找到"已经申请过"或"确认"按钮,请手动检查');
|
data = data || {};
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ========== 调用 ==========
|
var title = data.title === undefined
|
||||||
(async function () {
|
? '某某科技有限公司'
|
||||||
try {
|
: data.title;
|
||||||
const result = await fillInvoiceAndApply({
|
|
||||||
|
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] 未找到“已经申请过”提示或“确认”按钮'
|
||||||
|
);
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
function run(data) {
|
||||||
|
if (state.running) {
|
||||||
|
return Promise.reject(
|
||||||
|
new Error('发票申请脚本正在执行,请勿重复调用')
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
var api = {
|
||||||
|
version: VERSION,
|
||||||
|
run: run,
|
||||||
|
findElement: findElement,
|
||||||
|
changeReactInputValue: changeReactInputValue,
|
||||||
|
|
||||||
|
get state() {
|
||||||
|
return state;
|
||||||
|
},
|
||||||
|
|
||||||
|
get __installed() {
|
||||||
|
return state.installed;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
function install() {
|
||||||
|
if (state.installed) {
|
||||||
|
return api;
|
||||||
|
}
|
||||||
|
|
||||||
|
state.installed = true;
|
||||||
|
|
||||||
|
console.log('[InvoiceApply] v' + VERSION + ' 已注入');
|
||||||
|
|
||||||
|
// 保留原 invoice.js 的行为:脚本注入后自动执行一次
|
||||||
|
run({
|
||||||
title: '{公司}',
|
title: '{公司}',
|
||||||
taxNumber: '{税号}'
|
taxNumber: '{税号}'
|
||||||
});
|
});
|
||||||
console.log('执行结果:', result);
|
|
||||||
// 批量开票时,C# 端轮询该变量获取执行结果
|
return api;
|
||||||
window.__invoiceApplyResult = result;
|
|
||||||
} catch (ex) {
|
|
||||||
console.error('执行异常:', ex);
|
|
||||||
window.__invoiceApplyResult = false;
|
|
||||||
}
|
}
|
||||||
})();
|
|
||||||
|
api.install = install;
|
||||||
|
|
||||||
|
global.InvoiceApply = api;
|
||||||
|
|
||||||
|
install();
|
||||||
|
|
||||||
|
})(typeof window !== 'undefined' ? window : this);
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
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,4 +1,5 @@
|
|||||||
using AllBase.Model.Result;
|
using AllBase.Model.Result;
|
||||||
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@@ -22,7 +23,6 @@ public class PddBrowserOrderInvoiceViewModel : BindableBaseEx
|
|||||||
get => _isSelected;
|
get => _isSelected;
|
||||||
set => SetProperty(ref _isSelected, value, nameof(IsSelected));
|
set => SetProperty(ref _isSelected, value, nameof(IsSelected));
|
||||||
}
|
}
|
||||||
|
|
||||||
public string buyerId { get; set; } // 买手Id
|
public string buyerId { get; set; } // 买手Id
|
||||||
public string buyerName { get; set; } // 买手名称
|
public string buyerName { get; set; } // 买手名称
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -41,7 +41,6 @@ public class PddBrowserOrderInvoiceViewModel : BindableBaseEx
|
|||||||
/// 订单号
|
/// 订单号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string order_sn { get; set; }
|
public string order_sn { get; set; }
|
||||||
|
|
||||||
public int status { get; set; }
|
public int status { get; set; }
|
||||||
public int pay_status { get; set; }
|
public int pay_status { get; set; }
|
||||||
public string order_status_prompt { get; set; }
|
public string order_status_prompt { get; set; }
|
||||||
@@ -51,11 +50,10 @@ public class PddBrowserOrderInvoiceViewModel : BindableBaseEx
|
|||||||
public string order_link_url { get; set; }
|
public string order_link_url { get; set; }
|
||||||
public List<order_good> order_Goods { get; set; }
|
public List<order_good> order_Goods { get; set; }
|
||||||
|
|
||||||
|
|
||||||
public List<OrderButtonItem> order_buttons { get; set; }
|
public List<OrderButtonItem> order_buttons { get; set; }
|
||||||
|
|
||||||
|
private string _goodsName;
|
||||||
public string GoodsName { get => order_Goods?.FirstOrDefault()?.goods_name ?? ""; }
|
public string GoodsName { get => _goodsName ?? order_Goods?.FirstOrDefault()?.goods_name ?? ""; set => _goodsName = value; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否已开票
|
/// 是否已开票
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -78,8 +76,27 @@ public class PddBrowserOrderInvoiceViewModel : BindableBaseEx
|
|||||||
{
|
{
|
||||||
get => DateTimeHelper.ConvertFromUnixTimestampInSeconds(order_time);
|
get => DateTimeHelper.ConvertFromUnixTimestampInSeconds(order_time);
|
||||||
}
|
}
|
||||||
public string ThumbUrl => order_Goods?.FirstOrDefault()?.thumb_url ?? "";
|
private string _thumburl;
|
||||||
|
public string ThumbUrl
|
||||||
|
{
|
||||||
|
get { return _thumburl ?? order_Goods?.FirstOrDefault()?.thumb_url ?? ""; }
|
||||||
|
set { _thumburl = value; }
|
||||||
|
}
|
||||||
public string DisplayAmount => (order_amount / 100.0).ToString("F2");
|
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
|
public class OrderButtonItem
|
||||||
@@ -91,4 +108,31 @@ public class OrderButtonItem
|
|||||||
public class ButtonTypeValue
|
public class ButtonTypeValue
|
||||||
{
|
{
|
||||||
public string Url { get; set; }
|
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 _29WxOrderWpf.CefHelper;
|
||||||
using _29WxOrderWpf.Commands;
|
using WxOrder.Framework.Commons;
|
||||||
using AllBase;
|
using AllBase;
|
||||||
using CefSharp;
|
using CefSharp;
|
||||||
using CefSharp.Handler;
|
using CefSharp.Handler;
|
||||||
@@ -16,6 +16,7 @@ using System.Threading.Tasks;
|
|||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using Work._29Tools.CefTools;
|
using Work._29Tools.CefTools;
|
||||||
|
using Work.BaseForms;
|
||||||
using WxOrder.Framework.Helpers;
|
using WxOrder.Framework.Helpers;
|
||||||
|
|
||||||
namespace _29WxOrderWpf.Ctrls.PDDInvoice.ViewModels;
|
namespace _29WxOrderWpf.Ctrls.PDDInvoice.ViewModels;
|
||||||
@@ -23,22 +24,14 @@ namespace _29WxOrderWpf.Ctrls.PDDInvoice.ViewModels;
|
|||||||
public partial class PDDInvoiceViewModel
|
public partial class PDDInvoiceViewModel
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 订单列表浏览器
|
/// 订单列表浏览器
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public ChromiumWebBrowser Browser { get; private set; }
|
public ChromiumWebBrowser Browser { get; private set; }
|
||||||
/// <summary>
|
private IFrame frame;
|
||||||
/// 内容浏览器
|
|
||||||
/// 订单详情
|
|
||||||
/// 发票详情
|
|
||||||
/// 申请发票
|
|
||||||
/// </summary>
|
|
||||||
public ChromiumWebBrowser BrowserDetail { get; private set; }
|
|
||||||
|
|
||||||
partial void InitBrowser()
|
partial void InitBrowser()
|
||||||
{
|
{
|
||||||
BrowserZIndex = -1;
|
BrowserZIndex = -1;
|
||||||
BrowserDetailZIndex = -1;
|
|
||||||
|
|
||||||
Browser = WPFCEFBrowser.CreateChromiumWebBrowser("about:blank", false);
|
Browser = WPFCEFBrowser.CreateChromiumWebBrowser("about:blank", false);
|
||||||
|
|
||||||
LocalResourceRequestHandler resourceRequestHandler = new LocalResourceRequestHandler();
|
LocalResourceRequestHandler resourceRequestHandler = new LocalResourceRequestHandler();
|
||||||
@@ -49,13 +42,7 @@ public partial class PDDInvoiceViewModel
|
|||||||
Browser.KeyboardHandler = new KeyboardHandler();
|
Browser.KeyboardHandler = new KeyboardHandler();
|
||||||
Browser.LoadingStateChanged += Browser_LoadingStateChanged;
|
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)
|
private void Browser_LoadingStateChanged(object sender, LoadingStateChangedEventArgs e)
|
||||||
@@ -65,75 +52,31 @@ public partial class PDDInvoiceViewModel
|
|||||||
var b = (ChromiumWebBrowser)sender;
|
var b = (ChromiumWebBrowser)sender;
|
||||||
b.Dispatcher.InvokeAsync(async () =>
|
b.Dispatcher.InvokeAsync(async () =>
|
||||||
{
|
{
|
||||||
if (b.Address != null && b.Address.StartsWith("https://mobile.yangkeduo.com/orders.html"))
|
|
||||||
{
|
|
||||||
StartAutoScroll();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void BrowserDetail_LoadingStateChanged(object sender, LoadingStateChangedEventArgs e)
|
if (b.Address != null && b.Address.StartsWith("https://mobile.yangkeduo.com/orders.html"))//加载完成 加载 js
|
||||||
{
|
|
||||||
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();
|
frame = b.GetMainFrame();
|
||||||
if (html.Contains("window.rawData"))
|
|
||||||
|
string content = ResourceHelper.GetResourceText("/Ctrls/PDDInvoice/Resources/order.js", "29WxFindOrder");
|
||||||
|
if (string.IsNullOrEmpty(content)) return;
|
||||||
|
Install(frame, content);
|
||||||
|
if (await IsInstalledAsync(frame))
|
||||||
{
|
{
|
||||||
await ExecuteInvoiceApplyScriptAsync(b);
|
StartAutoScroll();
|
||||||
|
//await b.EvaluateScriptAsync(frame, content);
|
||||||
}
|
}
|
||||||
else
|
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);
|
public ICommand CloseInvoiceDetailCommand => new DelegateCommand(HidenOrderBrowserDetail);
|
||||||
|
|
||||||
@@ -142,35 +85,20 @@ public partial class PDDInvoiceViewModel
|
|||||||
get => GetValue<int>();
|
get => GetValue<int>();
|
||||||
set => SetValue(value);
|
set => SetValue(value);
|
||||||
}
|
}
|
||||||
public int BrowserDetailZIndex
|
|
||||||
{
|
|
||||||
get => GetValue<int>();
|
|
||||||
set => SetValue(value);
|
|
||||||
}
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 显示主浏览器
|
/// 显示主浏览器
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void ShowOrderBrowser()
|
public void ShowOrderBrowser()
|
||||||
{
|
{
|
||||||
BrowserZIndex = 10;
|
BrowserZIndex = 10;
|
||||||
BrowserDetailZIndex = -1;
|
BrowserDetailZIndex = -1;
|
||||||
}
|
}
|
||||||
/// <summary>
|
|
||||||
/// 显示子浏览器
|
|
||||||
/// </summary>
|
|
||||||
public void ShowOrderBrowserDetail()
|
|
||||||
{
|
|
||||||
BrowserZIndex = -1;
|
|
||||||
BrowserDetailZIndex = 10;
|
|
||||||
}
|
|
||||||
public void HidenOrderBrowser()
|
public void HidenOrderBrowser()
|
||||||
{
|
{
|
||||||
BrowserZIndex = -1;
|
BrowserZIndex = -1;
|
||||||
}
|
}
|
||||||
public void HidenOrderBrowserDetail()
|
|
||||||
{
|
|
||||||
BrowserDetailZIndex = -1;
|
|
||||||
}
|
|
||||||
public bool IsReadOrder
|
public bool IsReadOrder
|
||||||
{
|
{
|
||||||
get => GetValue<bool>();
|
get => GetValue<bool>();
|
||||||
@@ -178,73 +106,111 @@ public partial class PDDInvoiceViewModel
|
|||||||
}
|
}
|
||||||
private int top = 0;
|
private int top = 0;
|
||||||
private DateTime lastGetOrderDataTime = DateTime.Now;
|
private DateTime lastGetOrderDataTime = DateTime.Now;
|
||||||
|
private string lastOrderSN = "0";
|
||||||
private void RequestHandler_ResourceLoadComplete(object sender, string url, string postData, string responseData, IRequest request)
|
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"))
|
if (url.StartsWith("https://mobile.yangkeduo.com/proxy/api/api/aristotle/order_list_v"))
|
||||||
{
|
{
|
||||||
lastGetOrderDataTime = DateTime.Now;
|
lastGetOrderDataTime = DateTime.Now;
|
||||||
parserData(responseData);
|
parserData(responseData, out lastOrderSN);
|
||||||
|
Debug.WriteLine($"LastOrder:{lastOrderSN}");
|
||||||
//File.WriteAllText(@$"E:\{Guid.NewGuid().ToString()}.txt", responseData);
|
//File.WriteAllText(@$"E:\{Guid.NewGuid().ToString()}.txt", responseData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public void StartAutoScroll()
|
public void StartAutoScroll()
|
||||||
{
|
{
|
||||||
|
if (frame == null)
|
||||||
|
{
|
||||||
|
StopAutoScroll(); return;
|
||||||
|
}
|
||||||
if (IsReadOrder) return;
|
if (IsReadOrder) return;
|
||||||
|
|
||||||
IsReadOrder = true;
|
IsReadOrder = true;
|
||||||
_ = autoScroll(_cancellationTokenSource.Token);
|
//_ = autoScroll(_cancellationTokenSource.Token);
|
||||||
|
_ = autoLoadOrderData(_cancellationTokenSource.Token);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 停止滚动
|
// 停止滚动
|
||||||
public void StopAutoScroll()
|
public void StopAutoScroll()
|
||||||
{
|
{
|
||||||
IsReadOrder = false;
|
IsReadOrder = false;
|
||||||
_cancellationTokenSource?.Cancel();
|
_cancellationTokenSource?.Cancel();
|
||||||
_cancellationTokenSource?.Dispose();
|
|
||||||
_cancellationTokenSource = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
private async Task autoScroll(CancellationToken token)
|
|
||||||
|
Application.Current?.Dispatcher.BeginInvoke(new Action(() =>
|
||||||
|
{
|
||||||
|
BottomMsg = $"订单读取结束";
|
||||||
|
}));
|
||||||
|
CompleteProgress();
|
||||||
|
|
||||||
|
}
|
||||||
|
private async Task autoLoadOrderData(CancellationToken token)
|
||||||
{
|
{
|
||||||
|
string templastOrderSN = "";
|
||||||
while (IsReadOrder && !token.IsCancellationRequested)
|
while (IsReadOrder && !token.IsCancellationRequested)
|
||||||
{
|
{
|
||||||
if ((DateTime.Now - lastGetOrderDataTime).Seconds > 30) StopAutoScroll();
|
if (lastOrderSN == templastOrderSN)
|
||||||
|
|
||||||
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);
|
await Task.Delay(500);
|
||||||
result.Wait(5000);
|
continue;
|
||||||
}
|
}
|
||||||
await Task.Delay(Randomx.GetId(100, 300));
|
|
||||||
|
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));
|
||||||
//Thread.Sleep();
|
//Thread.Sleep();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void DetailRequestHandler_ResourceLoadComplete(object sender, string url, string postData, string responseData, IRequest request)
|
/// <summary>文档创建时注入(每个 document 注入一次即可,脚本本身幂等)</summary>
|
||||||
|
public void Install(IFrame frame, string hookJs)
|
||||||
{
|
{
|
||||||
if (url.StartsWith("https://mobile.yangkeduo.com/transac_return_compensation.html"))
|
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)
|
||||||
|
{
|
||||||
|
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();
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,159 @@
|
|||||||
|
using _29WxOrderWpf.CefHelper;
|
||||||
|
using CefSharp;
|
||||||
|
using CefSharp.Handler;
|
||||||
|
using CefSharp.Wpf;
|
||||||
|
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.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 resourceRequestHandler = new LocalResourceRequestHandler();
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
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"))
|
||||||
|
{
|
||||||
|
await ExecuteInvoiceApplyScriptAsync(b, orderSN);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// 页面异常(未渲染出发票表单)时直接判定失败,避免批量开票长时间等待
|
||||||
|
_currentInvoiceTcs?.TrySetResult(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 注入发票填写脚本并执行。
|
||||||
|
/// 单张申请模式保持原有行为;批量开票模式下轮询脚本写入的
|
||||||
|
/// <c>window.__invoiceApplyResult</c>,完成后通过 <see cref="_currentInvoiceTcs"/> 回传结果。
|
||||||
|
/// </summary>
|
||||||
|
private async Task ExecuteInvoiceApplyScriptAsync(ChromiumWebBrowser b, string orderSn)
|
||||||
|
{
|
||||||
|
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);
|
||||||
|
|
||||||
|
if (_currentInvoiceTcs == null)
|
||||||
|
{
|
||||||
|
var temp = Orders?.FirstOrDefault(a => a.order_sn == orderSn);
|
||||||
|
if (temp != null) temp.IsInvoiced = true;
|
||||||
|
return; // 单张申请模式:保持原有行为
|
||||||
|
}
|
||||||
|
|
||||||
|
// 捕获当前 TCS,避免批量循环超时进入下一个订单后,迟到的轮询误触发新订单的结果
|
||||||
|
var tcs = _currentInvoiceTcs;
|
||||||
|
|
||||||
|
// 检查是否注入成功
|
||||||
|
if (await IsInstalledDetailAsync(b) == false)
|
||||||
|
{
|
||||||
|
IsBatchInvoicing = false;
|
||||||
|
BaseMsgForm.ShowError("JS错误,开票失败");
|
||||||
|
tcs.TrySetResult(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)
|
||||||
|
{
|
||||||
|
tcs.TrySetResult(Convert.ToBoolean(res.Result));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
tcs.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/transac_return_compensation.html"))
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,7 +1,8 @@
|
|||||||
using _29WxOrderWpf.BaseWindows;
|
using _29WxOrderWpf.BaseWindows;
|
||||||
using _29WxOrderWpf.CefHelper;
|
using _29WxOrderWpf.CefHelper;
|
||||||
using _29WxOrderWpf.Commands;
|
using WxOrder.Framework.Commons;
|
||||||
using _29WxOrderWpf.Common;
|
using WxOrder.Framework.Commons;
|
||||||
|
using _29WxOrderWpf.Ctrls.Statistics;
|
||||||
using AllBase;
|
using AllBase;
|
||||||
using AllBase.Helper;
|
using AllBase.Helper;
|
||||||
using AllBase.Model.DBModel;
|
using AllBase.Model.DBModel;
|
||||||
@@ -10,9 +11,9 @@ using AllBase.Util;
|
|||||||
using CefSharp;
|
using CefSharp;
|
||||||
using CefSharp.Handler;
|
using CefSharp.Handler;
|
||||||
using CefSharp.Wpf;
|
using CefSharp.Wpf;
|
||||||
using MAX.Core.Helpers;
|
|
||||||
using NaiBa.Util.Extension;
|
using NaiBa.Util.Extension;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using NPOI.SS.Formula.Functions;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
@@ -27,11 +28,16 @@ using System.Threading;
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
|
using System.Windows.Data;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using System.Windows.Threading;
|
using System.Windows.Threading;
|
||||||
using Work._29Tools.CefTools;
|
using Work._29Tools.CefTools;
|
||||||
|
using Work.BaseForms;
|
||||||
using WPFCommon.Converters;
|
using WPFCommon.Converters;
|
||||||
|
using WPFCommon.Helpers;
|
||||||
using WPFCommon.Models;
|
using WPFCommon.Models;
|
||||||
|
using WxOrder.Framework.Commons;
|
||||||
|
using WxOrder.Framework.Commons.Dialogs;
|
||||||
using WxOrder.Framework.Helpers;
|
using WxOrder.Framework.Helpers;
|
||||||
|
|
||||||
namespace _29WxOrderWpf.Ctrls.PDDInvoice.ViewModels;
|
namespace _29WxOrderWpf.Ctrls.PDDInvoice.ViewModels;
|
||||||
@@ -39,9 +45,10 @@ namespace _29WxOrderWpf.Ctrls.PDDInvoice.ViewModels;
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 拼多多发票助手 视图模型
|
/// 拼多多发票助手 视图模型
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class PDDInvoiceViewModel : BindableBaseEx
|
public partial class PDDInvoiceViewModel : BindableBaseEx, IDialogAware, IDisposable
|
||||||
{
|
{
|
||||||
private readonly ObservableCollection<PddBrowserOrderInvoiceViewModel> _allOrders = new();
|
private const string ConfigPath = "./invoice.config";
|
||||||
|
private List<OrderInvoiceInfo> OrderInvoiceInfoList = new();
|
||||||
private readonly HashSet<string> _orderSns = new();
|
private readonly HashSet<string> _orderSns = new();
|
||||||
private string _searchText = "";
|
private string _searchText = "";
|
||||||
private PddBrowserOrderInvoiceViewModel _selectedOrder;
|
private PddBrowserOrderInvoiceViewModel _selectedOrder;
|
||||||
@@ -49,28 +56,67 @@ public partial class PDDInvoiceViewModel : BindableBaseEx
|
|||||||
private bool _isInvoiceDetailOpen;
|
private bool _isInvoiceDetailOpen;
|
||||||
private string _invoiceTitle = "";
|
private string _invoiceTitle = "";
|
||||||
private string _taxNo = "";
|
private string _taxNo = "";
|
||||||
private CancellationTokenSource _cancellationTokenSource; public PDDInvoiceViewModel()
|
private CancellationTokenSource _cancellationTokenSource;
|
||||||
|
private InvoiceConfig Config { get; set; }
|
||||||
|
/// <summary> 订单列表 </summary>
|
||||||
|
public ObservableCollection<PddBrowserOrderInvoiceViewModel> Orders { get; }
|
||||||
|
public ICollectionView OrdersView { get; }
|
||||||
|
public PDDInvoiceViewModel()
|
||||||
{
|
{
|
||||||
|
_cancellationTokenSource = new CancellationTokenSource();
|
||||||
|
Config = NaiBa.Util.Helper.ConfigHelper.LoadConfig<InvoiceConfig>(ConfigPath);
|
||||||
Orders = new ObservableCollection<PddBrowserOrderInvoiceViewModel>();
|
Orders = new ObservableCollection<PddBrowserOrderInvoiceViewModel>();
|
||||||
Orders.CollectionChanged += Orders_CollectionChanged;
|
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;
|
BuyerLoginList = GlobalConfig.PDDBuyerLoginList;
|
||||||
//Orders = new ObservableCollection<PDDInvoiceOrderModel>(_allOrders);
|
//Orders = new ObservableCollection<PDDInvoiceOrderModel>(_allOrders);
|
||||||
|
|
||||||
|
|
||||||
InitBrowser();
|
InitBrowser(); InitBrowserDetail();
|
||||||
|
if (Config == null) Config = new InvoiceConfig();
|
||||||
|
|
||||||
|
EndTime = DateTime.Now;
|
||||||
|
StartTime = EndTime.AddMonths(-1);
|
||||||
if (EnvironmentHelper.IsTest)
|
if (EnvironmentHelper.IsTest)
|
||||||
{
|
{
|
||||||
InvoiceTitle = "嵩县雷神商贸有限责任公司";
|
Config.Title = "嵩县雷神商贸有限责任公司";
|
||||||
TaxNo = "91410325MADQERT68E";
|
Config.TaxNo = "91410325MADQERT68E";
|
||||||
MaxAmount = 99;
|
Config.MaxAmount = 99;
|
||||||
_ = InitSampleData();
|
_ = InitSampleData();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
partial void InitBrowser();
|
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>
|
/// <summary> 列表增删时订阅/退订订单勾选状态,用于刷新表头全选状态 </summary>
|
||||||
private void Orders_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
|
private void Orders_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
|
||||||
{
|
{
|
||||||
@@ -105,6 +151,13 @@ public partial class PDDInvoiceViewModel : BindableBaseEx
|
|||||||
|
|
||||||
|
|
||||||
public ObservableCollectionThreadSafe<BuyerLoginInfo> BuyerLoginList { get; set; } = new ObservableCollectionThreadSafe<BuyerLoginInfo>();
|
public ObservableCollectionThreadSafe<BuyerLoginInfo> BuyerLoginList { get; set; } = new ObservableCollectionThreadSafe<BuyerLoginInfo>();
|
||||||
|
|
||||||
|
|
||||||
|
private void InvoiceStatusChanged()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public BuyerLoginInfo SelectedBuyer
|
public BuyerLoginInfo SelectedBuyer
|
||||||
{
|
{
|
||||||
get => GetProperty(() => SelectedBuyer);
|
get => GetProperty(() => SelectedBuyer);
|
||||||
@@ -115,11 +168,8 @@ public partial class PDDInvoiceViewModel : BindableBaseEx
|
|||||||
{
|
{
|
||||||
WPFCEFBrowser.SetCookieAsync(SelectedBuyer.cookie, Browser.GetCookieManager()).GetAwaiter();
|
WPFCEFBrowser.SetCookieAsync(SelectedBuyer.cookie, Browser.GetCookieManager()).GetAwaiter();
|
||||||
WPFCEFBrowser.SetCookieAsync(SelectedBuyer.cookie, BrowserDetail.GetCookieManager()).GetAwaiter();
|
WPFCEFBrowser.SetCookieAsync(SelectedBuyer.cookie, BrowserDetail.GetCookieManager()).GetAwaiter();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary> 订单列表 </summary>
|
|
||||||
public ObservableCollection<PddBrowserOrderInvoiceViewModel> Orders { get; }
|
|
||||||
|
|
||||||
/// <summary> 搜索关键字:订单号 / 商品名称 / 买家 </summary>
|
/// <summary> 搜索关键字:订单号 / 商品名称 / 买家 </summary>
|
||||||
public string SearchText
|
public string SearchText
|
||||||
@@ -127,6 +177,21 @@ public partial class PDDInvoiceViewModel : BindableBaseEx
|
|||||||
get => _searchText;
|
get => _searchText;
|
||||||
set => SetProperty(ref _searchText, value, nameof(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>
|
/// <summary> 开票弹窗是否打开 </summary>
|
||||||
public bool IsOrderListDialogOpen
|
public bool IsOrderListDialogOpen
|
||||||
@@ -160,19 +225,19 @@ public partial class PDDInvoiceViewModel : BindableBaseEx
|
|||||||
set => SetProperty(ref _selectedOrder, value, nameof(SelectedOrder));
|
set => SetProperty(ref _selectedOrder, value, nameof(SelectedOrder));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary> 发票抬头 </summary>
|
///// <summary> 发票抬头 </summary>
|
||||||
public string InvoiceTitle
|
//public string InvoiceTitle
|
||||||
{
|
//{
|
||||||
get => _invoiceTitle;
|
// get => _invoiceTitle;
|
||||||
set => SetProperty(ref _invoiceTitle, value, nameof(InvoiceTitle));
|
// set => SetProperty(ref _invoiceTitle, value, nameof(InvoiceTitle));
|
||||||
}
|
//}
|
||||||
|
|
||||||
/// <summary> 税号 </summary>
|
///// <summary> 税号 </summary>
|
||||||
public string TaxNo
|
//public string TaxNo
|
||||||
{
|
//{
|
||||||
get => _taxNo;
|
// get => _taxNo;
|
||||||
set => SetProperty(ref _taxNo, value, nameof(TaxNo));
|
// set => SetProperty(ref _taxNo, value, nameof(TaxNo));
|
||||||
}
|
//}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 开始开票总金额
|
/// 开始开票总金额
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -181,14 +246,14 @@ public partial class PDDInvoiceViewModel : BindableBaseEx
|
|||||||
get => GetValue<decimal>();
|
get => GetValue<decimal>();
|
||||||
set => SetValue(value);
|
set => SetValue(value);
|
||||||
}
|
}
|
||||||
/// <summary>
|
///// <summary>
|
||||||
/// 最大开票金额
|
///// 最大开票金额
|
||||||
/// </summary>
|
///// </summary>
|
||||||
public decimal MaxAmount
|
//public decimal MaxAmount
|
||||||
{
|
//{
|
||||||
get => GetValue<decimal>();
|
// get => GetValue<decimal>();
|
||||||
set => SetValue(value);
|
// set => SetValue(value);
|
||||||
}
|
//}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 已开票金额
|
/// 已开票金额
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -205,6 +270,16 @@ public partial class PDDInvoiceViewModel : BindableBaseEx
|
|||||||
get => GetValue<decimal>();
|
get => GetValue<decimal>();
|
||||||
set => SetValue(value);
|
set => SetValue(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool IsLoadImage
|
||||||
|
{
|
||||||
|
get => GetValue<bool>();
|
||||||
|
set => SetValue(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public ICommand SearchCommand => new DelegateCommand(Search);
|
public ICommand SearchCommand => new DelegateCommand(Search);
|
||||||
|
|
||||||
public ICommand ResetCommand => new DelegateCommand(ResetSearch);
|
public ICommand ResetCommand => new DelegateCommand(ResetSearch);
|
||||||
@@ -226,7 +301,6 @@ public partial class PDDInvoiceViewModel : BindableBaseEx
|
|||||||
BaseMsgWindow.ShowError("未填选择买手号");
|
BaseMsgWindow.ShowError("未填选择买手号");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
_cancellationTokenSource = new CancellationTokenSource();
|
|
||||||
Debug.WriteLine("开始读单");
|
Debug.WriteLine("开始读单");
|
||||||
BottomMsg = $"开始读取订单";
|
BottomMsg = $"开始读取订单";
|
||||||
StartProgress();
|
StartProgress();
|
||||||
@@ -235,12 +309,34 @@ public partial class PDDInvoiceViewModel : BindableBaseEx
|
|||||||
if (!IsReadOrder)
|
if (!IsReadOrder)
|
||||||
{
|
{
|
||||||
_orderSns.Clear();
|
_orderSns.Clear();
|
||||||
_allOrders.Clear();
|
|
||||||
Orders.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");
|
Browser.Load("https://mobile.yangkeduo.com/orders.html");
|
||||||
|
await Task.Delay(Timeout.Infinite, _cancellationTokenSource.Token);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
await Task.Delay(Timeout.Infinite, _cancellationTokenSource.Token);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (TaskCanceledException)
|
catch (TaskCanceledException)
|
||||||
@@ -279,7 +375,7 @@ public partial class PDDInvoiceViewModel : BindableBaseEx
|
|||||||
if (_isUpdatingSelectAll) return;
|
if (_isUpdatingSelectAll) return;
|
||||||
if (value == true)
|
if (value == true)
|
||||||
{
|
{
|
||||||
foreach (var order in Orders)
|
foreach (var order in GetFilterOrders())
|
||||||
{
|
{
|
||||||
if (order.IsInvoiced == false)
|
if (order.IsInvoiced == false)
|
||||||
{
|
{
|
||||||
@@ -349,31 +445,63 @@ public partial class PDDInvoiceViewModel : BindableBaseEx
|
|||||||
{
|
{
|
||||||
if (IsBatchInvoicing) return;
|
if (IsBatchInvoicing) return;
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(InvoiceTitle) || string.IsNullOrEmpty(TaxNo))
|
if (string.IsNullOrEmpty(Config.Title) || string.IsNullOrEmpty(Config.TaxNo))
|
||||||
{
|
{
|
||||||
BaseMsgWindow.ShowError("未填写公司或税号");
|
BaseMsgWindow.ShowError("未填写公司或税号");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var targets = Orders.Where(o => o.IsSelected && !o.IsInvoiced).ToList();
|
var targets = GetFilterOrders().Where(o => o.IsSelected && !o.IsInvoiced).ToList();
|
||||||
if (targets.Count == 0)
|
if (targets.Count == 0)
|
||||||
{
|
{
|
||||||
BaseMsgWindow.ShowError("请先勾选需要开票的订单");
|
BaseMsgWindow.ShowError("请先勾选需要开票的订单");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (MaxAmount <= 0)
|
if (Config.MaxAmount <= 0)
|
||||||
{
|
{
|
||||||
BaseMsgWindow.ShowError("请填写开票总金额");
|
BaseMsgWindow.ShowError("请填写开票总金额");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var confirm = BaseMsgWindow.ShowConfirm(
|
var confirm = BaseMsgWindow.ShowConfirm(
|
||||||
$"已勾选 {targets.Count} 个待开票订单,确定开始批量开票吗?\n请确认发票抬头与税号无误。\n开票总金额:{MaxAmount}",
|
$"已勾选 {targets.Count} 个待开票订单,确定开始批量开票吗?\n请确认发票抬头与税号无误。\n开票总金额:{Config.MaxAmount}",
|
||||||
"批量开票");
|
"批量开票");
|
||||||
if (confirm.DialogResult != true) return;
|
if (confirm.DialogResult != true) return;
|
||||||
|
|
||||||
|
//Config.Title = InvoiceTitle;
|
||||||
|
//Config.TaxNo = TaxNo;
|
||||||
|
//Config.MaxAmount = MaxAmount;
|
||||||
|
//NaiBa.Util.Helper.ConfigHelper.SaveConfig(ConfigPath, Config);
|
||||||
|
|
||||||
await BatchInvoiceAsync(targets);
|
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>
|
||||||
/// 后台批量开票:逐单加载开票页并自动填写提交,底部进度条实时更新,成功后更新列表状态
|
/// 后台批量开票:逐单加载开票页并自动填写提交,底部进度条实时更新,成功后更新列表状态
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -390,13 +518,21 @@ public partial class PDDInvoiceViewModel : BindableBaseEx
|
|||||||
|
|
||||||
for (int i = 0; i < targets.Count; i++)
|
for (int i = 0; i < targets.Count; i++)
|
||||||
{
|
{
|
||||||
if (AmountTotal >= MaxAmount)
|
if (IsBatchInvoicing == false)
|
||||||
|
{
|
||||||
|
BottomMsg = "已取消批量开票";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (AmountTotal >= Config.MaxAmount)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var order = targets[i];
|
var order = targets[i];
|
||||||
BottomMsg = $"正在批量开票:{i}/{targets.Count},当前订单:{order.order_sn}";
|
BottomMsg = $"正在批量开票:{i}/{targets.Count},当前订单:{order.order_sn}";
|
||||||
ProgressValue = i;
|
ProgressValue = i;
|
||||||
|
SelectedOrder = order;
|
||||||
|
BatchInvoiceChanged?.Invoke(this, GetFilterOrders().ToList().IndexOf(order));
|
||||||
bool ok = false;
|
bool ok = false;
|
||||||
if (EnvironmentHelper.IsTest)
|
if (EnvironmentHelper.IsTest)
|
||||||
{
|
{
|
||||||
@@ -418,6 +554,11 @@ public partial class PDDInvoiceViewModel : BindableBaseEx
|
|||||||
order.IsSelected = false;
|
order.IsSelected = false;
|
||||||
success++;
|
success++;
|
||||||
AmountTotal += order.order_amount / 100m;
|
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
|
else
|
||||||
{
|
{
|
||||||
@@ -425,8 +566,15 @@ public partial class PDDInvoiceViewModel : BindableBaseEx
|
|||||||
}
|
}
|
||||||
ProgressValue = success + fail;
|
ProgressValue = success + fail;
|
||||||
BottomMsg = $"正在批量开票:{i}/{targets.Count},当前订单:{order.order_sn}。总金额:{AmountTotal.ToString("N2")}";
|
BottomMsg = $"正在批量开票:{i}/{targets.Count},当前订单:{order.order_sn}。总金额:{AmountTotal.ToString("N2")}";
|
||||||
|
BottomRMsg = $"批量开票状态:成功 {success} 个,失败 {fail} 个。总金额:{AmountTotal.ToString("N2")}";
|
||||||
StatisticsInvoiceAmount();
|
StatisticsInvoiceAmount();
|
||||||
await Task.Delay(1000);
|
await Task.Delay(200);
|
||||||
|
|
||||||
|
if (Config.IsSaveData)
|
||||||
|
{
|
||||||
|
SaveOrderInvoiceInfo();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
@@ -439,7 +587,6 @@ public partial class PDDInvoiceViewModel : BindableBaseEx
|
|||||||
_currentInvoiceTcs = null;
|
_currentInvoiceTcs = null;
|
||||||
ProgressMaximum = targets.Count;
|
ProgressMaximum = targets.Count;
|
||||||
ProgressValue = targets.Count;
|
ProgressValue = targets.Count;
|
||||||
BottomMsg = $"批量开票完成:成功 {success} 个,失败 {fail} 个。总金额:{AmountTotal.ToString("N2")}";
|
|
||||||
IsBatchInvoicing = false;
|
IsBatchInvoicing = false;
|
||||||
BaseMsgWindow.ShowInfo(BottomMsg);
|
BaseMsgWindow.ShowInfo(BottomMsg);
|
||||||
}
|
}
|
||||||
@@ -449,8 +596,8 @@ public partial class PDDInvoiceViewModel : BindableBaseEx
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private void StatisticsInvoiceAmount()
|
private void StatisticsInvoiceAmount()
|
||||||
{
|
{
|
||||||
InvoicedAmountTotal = Orders.Where(a => a.IsInvoiced).Sum(a => a.order_amount) / 100m;
|
InvoicedAmountTotal = GetFilterOrders().Where(a => a.IsInvoiced).Sum(a => a.order_amount) / 100m;
|
||||||
UninvoicedAmountTotal = Orders.Where(a => a.IsInvoiced == false).Sum(a => a.order_amount) / 100m;
|
UninvoicedAmountTotal = GetFilterOrders().Where(a => a.IsInvoiced == false).Sum(a => a.order_amount) / 100m;
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
@@ -458,12 +605,22 @@ public partial class PDDInvoiceViewModel : BindableBaseEx
|
|||||||
/// <summary> 按 订单号 / 商品名称 过滤订单 </summary>
|
/// <summary> 按 订单号 / 商品名称 过滤订单 </summary>
|
||||||
private void Search()
|
private void Search()
|
||||||
{
|
{
|
||||||
var keyword = SearchText?.Trim();
|
OrdersView.Refresh();
|
||||||
Orders.Clear();
|
StatisticsInvoiceAmount();
|
||||||
foreach (var order in _allOrders.Where(o => IsKeywordMatch(o, keyword)))
|
//var keyword = SearchText?.Trim();
|
||||||
{
|
//bool? _tempIsInvoiced = InvoiceStatus == 0 ? null : InvoiceStatus == 2;
|
||||||
Orders.Add(order);
|
//foreach (var order in Orders)
|
||||||
}
|
//{
|
||||||
|
// if (_tempIsInvoiced.HasValue)
|
||||||
|
// {
|
||||||
|
// if (order.IsInvoiced != _tempIsInvoiced.Value) continue;
|
||||||
|
// }
|
||||||
|
// if (!IsKeywordMatch(order, keyword))
|
||||||
|
// {
|
||||||
|
// continue;
|
||||||
|
// }
|
||||||
|
// Orders.Add(order);
|
||||||
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static bool IsKeywordMatch(PddBrowserOrderInvoiceViewModel order, string keyword)
|
private static bool IsKeywordMatch(PddBrowserOrderInvoiceViewModel order, string keyword)
|
||||||
@@ -476,6 +633,9 @@ public partial class PDDInvoiceViewModel : BindableBaseEx
|
|||||||
private void ResetSearch()
|
private void ResetSearch()
|
||||||
{
|
{
|
||||||
SearchText = "";
|
SearchText = "";
|
||||||
|
InvoiceStatus = 0;
|
||||||
|
EndTime = DateTime.Now;
|
||||||
|
StartTime = EndTime.AddMonths(-1);
|
||||||
Search();
|
Search();
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -485,7 +645,7 @@ public partial class PDDInvoiceViewModel : BindableBaseEx
|
|||||||
private void OpenInvoice(PddBrowserOrderInvoiceViewModel order)
|
private void OpenInvoice(PddBrowserOrderInvoiceViewModel order)
|
||||||
{
|
{
|
||||||
SelectedOrder = order;
|
SelectedOrder = order;
|
||||||
if (string.IsNullOrEmpty(InvoiceTitle) || string.IsNullOrEmpty(TaxNo))
|
if (string.IsNullOrEmpty(Config.Title) || string.IsNullOrEmpty(Config.TaxNo))
|
||||||
{
|
{
|
||||||
BaseMsgWindow.ShowError("未填写公司或税号");
|
BaseMsgWindow.ShowError("未填写公司或税号");
|
||||||
return;
|
return;
|
||||||
@@ -520,36 +680,36 @@ public partial class PDDInvoiceViewModel : BindableBaseEx
|
|||||||
|
|
||||||
|
|
||||||
#region 数据解析
|
#region 数据解析
|
||||||
|
|
||||||
private void parserData(string data)
|
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());
|
List<PddBrowserOrderInvoiceViewModel> list = JsonHelper.DeserializeJsonToList<PddBrowserOrderInvoiceViewModel>(JsonHelper.JObjectParse(data)["orders"].ParseToString());
|
||||||
|
|
||||||
if (list.Count == 0)
|
if (list.Count == 0)
|
||||||
{
|
{
|
||||||
StopAutoScroll();
|
StopAutoScroll();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
lastOrderSN = list.Last().order_sn;
|
||||||
|
var currentLastItem = list.Last();
|
||||||
var matched = list.Where(item => item.status == 4 && item.pay_status == 2).ToList();
|
var matched = list.Where(item => item.status == 4 && item.pay_status == 2).ToList();
|
||||||
if (matched.Count == 0)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// CEF 回调运行在后台线程,ObservableCollection 的更新需要切回 UI 线程
|
Application.Current?.Dispatcher.BeginInvoke(new Action(() =>
|
||||||
var dispatcher = Application.Current?.Dispatcher;
|
|
||||||
if (dispatcher == null || dispatcher.CheckAccess())
|
|
||||||
{
|
{
|
||||||
AddOrders(matched);
|
if (matched.Count > 0)
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
dispatcher.BeginInvoke(new Action(() =>
|
|
||||||
{
|
{
|
||||||
AddOrders(matched);
|
AddOrders(matched);
|
||||||
BottomMsg = $"正在读取订单,读取日期{matched.Last().OrderTime.ToString("yyyy-MM-dd")}";
|
}
|
||||||
}));
|
|
||||||
}
|
BottomMsg = $"正在读取订单,读取日期{currentLastItem.OrderTime.ToString("yyyy-MM-dd")}";
|
||||||
|
|
||||||
|
}));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -563,15 +723,31 @@ public partial class PDDInvoiceViewModel : BindableBaseEx
|
|||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
_allOrders.Add(item);
|
if (item.IsInvoiced == false)
|
||||||
if (IsKeywordMatch(item, keyword))
|
|
||||||
{
|
{
|
||||||
item.IsInvoiced = item.order_buttons?.Any(a => a.brief_prompt == "发票详情") ?? false;
|
item.IsInvoiced = item.order_buttons?.Any(a => a.brief_prompt == "发票详情") ?? false;
|
||||||
Orders.Add(item);
|
}
|
||||||
|
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
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
StatisticsInvoiceAmount();
|
StatisticsInvoiceAmount();
|
||||||
|
if (Config.IsSaveData)
|
||||||
|
{
|
||||||
|
SaveOrderInvoiceInfo();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
@@ -608,10 +784,33 @@ public partial class PDDInvoiceViewModel : BindableBaseEx
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Orders.FirstOrDefault().IsInvoiced = true;
|
||||||
return Task.CompletedTask;
|
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)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -624,6 +823,13 @@ public partial class PDDInvoiceViewModel : BindableBaseEx
|
|||||||
set => SetValue(ref _bottomMsg, value);
|
set => SetValue(ref _bottomMsg, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private string _bottomRMsg = "";
|
||||||
|
public string BottomRMsg
|
||||||
|
{
|
||||||
|
get => _bottomRMsg;
|
||||||
|
set => SetValue(ref _bottomRMsg, value);
|
||||||
|
}
|
||||||
|
|
||||||
private double _progressValue;
|
private double _progressValue;
|
||||||
public double ProgressValue
|
public double ProgressValue
|
||||||
{
|
{
|
||||||
@@ -637,6 +843,9 @@ public partial class PDDInvoiceViewModel : BindableBaseEx
|
|||||||
get => _progressMaximum;
|
get => _progressMaximum;
|
||||||
set => SetValue(ref _progressMaximum, value);
|
set => SetValue(ref _progressMaximum, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public string Title => "发票助手";
|
||||||
|
|
||||||
public void SetProgress(int value, int maxValue)
|
public void SetProgress(int value, int maxValue)
|
||||||
{
|
{
|
||||||
StopUnknownTotalProgressTimer();
|
StopUnknownTotalProgressTimer();
|
||||||
@@ -710,7 +919,44 @@ public partial class PDDInvoiceViewModel : BindableBaseEx
|
|||||||
}
|
}
|
||||||
_unknownTotalProgressTimer = null;
|
_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
|
||||||
#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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,252 @@
|
|||||||
|
<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="[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>
|
||||||
|
<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"
|
||||||
|
IsChecked="{Binding AutoSwitchGiftType}"
|
||||||
|
Style="{StaticResource ToggleSwitch}" />
|
||||||
|
</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>
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
using _29WxOrderWpf.ViewModels;
|
||||||
|
using AllBase;
|
||||||
|
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));
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
BaseMsgForm.ShowError("配置保存错误");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,156 +1,246 @@
|
|||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using WPFCommon.Models;
|
||||||
|
|
||||||
namespace _29WxOrderWpf.Ctrls.Statistics.Models
|
namespace _29WxOrderWpf.Ctrls.Statistics.Models
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 店铺营收统计 - 查询参数
|
/// 店铺营收统计 - 查询参数。
|
||||||
|
/// 对应新接口 shop_revenue_statistics/get_shop_order_amount 与
|
||||||
|
/// shop_revenue_statistics/get_shop_stats_details 的请求体(StartDate / EndDate / ShopIds)。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class ShopRevenueStatisticsQuery
|
public class ShopRevenueStatisticsQuery
|
||||||
{
|
{
|
||||||
/// <summary>开始时间</summary>
|
/// <summary>开始日期</summary>
|
||||||
public DateTime StartDate { get; set; }
|
public DateTime StartDate { get; set; }
|
||||||
|
|
||||||
/// <summary>结束时间</summary>
|
/// <summary>结束日期</summary>
|
||||||
public DateTime EndDate { get; set; }
|
public DateTime EndDate { get; set; }
|
||||||
|
|
||||||
/// <summary>选中的店铺 app_key 列表;空/Null 表示全部店铺</summary>
|
/// <summary>
|
||||||
public List<string> ShopKeys { get; set; }
|
/// 选中的店铺 ERP 店铺ID(ShopLoginInfo.ErpShopId)列表;
|
||||||
|
/// 空/Null 表示全部店铺(服务层会取全部店铺的 ErpShopId)。
|
||||||
|
/// </summary>
|
||||||
|
public List<string> ShopIds { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 店铺营收统计 - 接口返回的原始明细行。
|
/// 店铺统计记录(接口返回)。
|
||||||
/// 与后端 WXOrderAmountInfo 保持一致(camelCase JSON):
|
/// 接口返回结构:
|
||||||
/// shopName, createTime, orderId, status, productPrice, orderPrice, purchasePrice, freight,
|
/// shop_revenue_statistics/GetShopStats -> Result<Dictionary<string, List<ShopStatsResponse>>>
|
||||||
/// predictCommissionFee, commissionAmount, discountedPrice, profit, purchaseStatus,
|
/// Key = 店铺ID,Value = 该店铺按 <see cref="ShopStatsGroupType"/> 聚合后的记录列表
|
||||||
/// outAmount, refundStatus, refundStatusString, refundAmount, externalProcurement
|
/// (汇总=1 条;天/周/月=每个自然日/自然周/自然月各 1 条)。
|
||||||
/// 金额字段单位均为分(显示时需除以 100)。
|
/// 注意:接口只返回按 GroupType 聚合后的记录,不返回“整段汇总”,
|
||||||
|
/// 页面上的汇总卡片由客户端对返回记录自行合计(GroupType=Summary 时每店铺一条,直接相加即可)。
|
||||||
|
/// 金额字段单位均为“分”,显示时需除以 100 转为元。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class ShopRevenueStatisticsRow
|
public class ShopStatsResponse
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 店铺名称
|
/// 店铺ID
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("shop_name")]
|
public string ShopId { get; set; }
|
||||||
public string ShopName { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 下单时间(秒级时间戳)
|
/// 销售订单创建日期
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("create_time")]
|
public DateTime StatDate { get; set; }
|
||||||
[JsonConverter(typeof(UnixDateTimeConverter))]
|
|
||||||
public DateTime CreateTime { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 订单号
|
/// 订单数(有效订单,不含退款订单)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("order_id")]
|
public int OrderCount { get; set; }
|
||||||
public string OrderId { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 订单状态
|
/// 销售总额(分)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("status")]
|
public long SalesAmount { get; set; }
|
||||||
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>
|
|
||||||
/// 采购价(分)
|
|
||||||
/// </summary>
|
|
||||||
[JsonProperty("purchase_price")]
|
|
||||||
public int PurchasePrice { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 运费(分)
|
|
||||||
/// </summary>
|
|
||||||
[JsonProperty("freight")]
|
|
||||||
public int Freight { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 平台服务费(预计技术服务费,分)
|
|
||||||
/// </summary>
|
|
||||||
[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>
|
||||||
/// 利润(分)
|
/// 利润(分)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("profit")]
|
public long ProfitAmount { get; set; }
|
||||||
public int Profit { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 采购状态
|
/// 平台佣金(分)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("purchase_status")]
|
public long PlatformFee { get; set; }
|
||||||
public int PurchaseStatus { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 外采金额(分),out_amount为空或0时从中转仓订单表补全
|
/// 退款订单数
|
||||||
|
/// </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>
|
||||||
|
/// 销售趋势记录(接口返回):跨店铺合计后的按天趋势,供综合统计页的销售趋势折线图使用。
|
||||||
|
/// 接口返回结构:
|
||||||
|
/// 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>
|
||||||
|
public string ShopName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 商铺订单号
|
||||||
|
/// </summary>
|
||||||
|
public string OrderId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 订单创建时间
|
||||||
|
/// </summary>
|
||||||
|
public DateTime CreateTime { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 订单金额(分)
|
||||||
|
/// </summary>
|
||||||
|
public int OrderPrice { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 订单退款金额(分),即商铺订单商品明细的退款金额之和;有效订单为 0
|
||||||
|
/// </summary>
|
||||||
|
public int OrderRefundAmount { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 利润
|
||||||
|
/// </summary>
|
||||||
|
public long ProfitAmount { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 平台佣金
|
||||||
|
/// </summary>
|
||||||
|
public long PlatformFee { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 外采金额(分),即该订单下所有买手订单的购买金额之和
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("out_amount")]
|
|
||||||
public int OutAmount { get; set; }
|
public int OutAmount { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 售后状态(订单明细 refund_status)
|
/// 买手未退回金额(分),即买手订单中退款未成功的退款金额之和;无售后时为 0
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("refund_status")]
|
public int UnrefundedAmount { get; set; }
|
||||||
public int RefundStatus { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 售后状态(退款单 status)
|
/// 买手订单信息(一个订单号对应多个买手订单)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("refund_status_string")]
|
public List<BuyerOrderInfo> BuyerOrders { get; set; } = new List<BuyerOrderInfo>();
|
||||||
public string RefundStatusString { get; set; }
|
}
|
||||||
|
|
||||||
|
/// <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; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 售后退款金额(分)
|
/// 金额(分)
|
||||||
|
/// </summary>
|
||||||
|
public int OutAmount { get; set; }
|
||||||
|
|
||||||
|
public long RefundId { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 退款金额(分)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("refund_amount")]
|
|
||||||
public int RefundAmount { get; set; }
|
public int RefundAmount { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否外采:0=未从中转仓订单表查到,1=查到
|
/// 退款状态
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("external_procurement")]
|
public string RefundStatusText { get; set; }
|
||||||
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>
|
/// <summary>
|
||||||
@@ -166,7 +256,7 @@ namespace _29WxOrderWpf.Ctrls.Statistics.Models
|
|||||||
/// <summary>利润(实际利润)</summary>
|
/// <summary>利润(实际利润)</summary>
|
||||||
public decimal Profit { get; set; }
|
public decimal Profit { get; set; }
|
||||||
|
|
||||||
/// <summary>退款金额(统计期间退款)</summary>
|
/// <summary>退款金额(统计期间店铺端退款:已成功 + 处理中)</summary>
|
||||||
public decimal RefundAmount { get; set; }
|
public decimal RefundAmount { get; set; }
|
||||||
|
|
||||||
/// <summary>退款订单数</summary>
|
/// <summary>退款订单数</summary>
|
||||||
@@ -175,7 +265,10 @@ namespace _29WxOrderWpf.Ctrls.Statistics.Models
|
|||||||
/// <summary>平台服务费总额(元)</summary>
|
/// <summary>平台服务费总额(元)</summary>
|
||||||
public decimal PlatformFeeTotal { get; set; }
|
public decimal PlatformFeeTotal { get; set; }
|
||||||
|
|
||||||
/// <summary>达人佣金(元)</summary>
|
/// <summary>
|
||||||
|
/// 达人佣金(元)。
|
||||||
|
/// 新接口未提供该字段,固定为 0,保留属性与页面展示,待后端补充字段后直接接上。
|
||||||
|
/// </summary>
|
||||||
public decimal Commission { get; set; }
|
public decimal Commission { get; set; }
|
||||||
|
|
||||||
/// <summary>客单价(平均每单金额)</summary>
|
/// <summary>客单价(平均每单金额)</summary>
|
||||||
@@ -238,7 +331,7 @@ namespace _29WxOrderWpf.Ctrls.Statistics.Models
|
|||||||
/// <summary>店铺名称</summary>
|
/// <summary>店铺名称</summary>
|
||||||
public string ShopName { get; set; }
|
public string ShopName { get; set; }
|
||||||
|
|
||||||
/// <summary>订单数</summary>
|
/// <summary>订单数(有效订单,不含退款订单)</summary>
|
||||||
public int OrderCount { get; set; }
|
public int OrderCount { get; set; }
|
||||||
|
|
||||||
/// <summary>销售额(元)</summary>
|
/// <summary>销售额(元)</summary>
|
||||||
@@ -254,7 +347,7 @@ namespace _29WxOrderWpf.Ctrls.Statistics.Models
|
|||||||
/// <summary>平台服务费总额(元)</summary>
|
/// <summary>平台服务费总额(元)</summary>
|
||||||
public decimal PlatformFeeTotal { get; set; }
|
public decimal PlatformFeeTotal { get; set; }
|
||||||
|
|
||||||
/// <summary>达人佣金(元)</summary>
|
/// <summary>达人佣金(元)。新接口未提供该字段,固定为 0。</summary>
|
||||||
public decimal Commission { get; set; }
|
public decimal Commission { get; set; }
|
||||||
|
|
||||||
/// <summary>客单价(元)</summary>
|
/// <summary>客单价(元)</summary>
|
||||||
@@ -279,6 +372,55 @@ namespace _29WxOrderWpf.Ctrls.Statistics.Models
|
|||||||
Month = 2
|
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>
|
/// <summary>
|
||||||
/// 天/周/月周期统计表格行(金额单位:元)。
|
/// 天/周/月周期统计表格行(金额单位:元)。
|
||||||
/// 按所选店铺(或全部店铺)统计:天统计每天一行;周统计每周一行;月统计每月一行。
|
/// 按所选店铺(或全部店铺)统计:天统计每天一行;周统计每周一行;月统计每月一行。
|
||||||
@@ -291,7 +433,7 @@ namespace _29WxOrderWpf.Ctrls.Statistics.Models
|
|||||||
/// <summary>周期显示文本(天:yyyy-MM-dd;周:yyyy-MM-dd ~ yyyy-MM-dd;月:yyyy-MM)</summary>
|
/// <summary>周期显示文本(天:yyyy-MM-dd;周:yyyy-MM-dd ~ yyyy-MM-dd;月:yyyy-MM)</summary>
|
||||||
public string Period { get; set; }
|
public string Period { get; set; }
|
||||||
|
|
||||||
/// <summary>订单数</summary>
|
/// <summary>订单数(有效订单,不含退款订单)</summary>
|
||||||
public int OrderCount { get; set; }
|
public int OrderCount { get; set; }
|
||||||
|
|
||||||
/// <summary>销售额(元)</summary>
|
/// <summary>销售额(元)</summary>
|
||||||
@@ -308,7 +450,7 @@ namespace _29WxOrderWpf.Ctrls.Statistics.Models
|
|||||||
/// <summary>平台服务费总额(元)</summary>
|
/// <summary>平台服务费总额(元)</summary>
|
||||||
public decimal PlatformFeeTotal { get; set; }
|
public decimal PlatformFeeTotal { get; set; }
|
||||||
|
|
||||||
/// <summary>达人佣金(元)</summary>
|
/// <summary>达人佣金(元)。新接口未提供该字段,固定为 0。</summary>
|
||||||
public decimal Commission { get; set; }
|
public decimal Commission { get; set; }
|
||||||
|
|
||||||
/// <summary>平均利润率(利润 / 采购金额,百分数,如 12.34 表示 12.34%)</summary>
|
/// <summary>平均利润率(利润 / 采购金额,百分数,如 12.34 表示 12.34%)</summary>
|
||||||
@@ -321,14 +463,51 @@ namespace _29WxOrderWpf.Ctrls.Statistics.Models
|
|||||||
public decimal AvgOrderAmount { get; set; }
|
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>
|
||||||
/// 店铺下拉选项
|
/// 店铺下拉选项
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class ShopOption
|
public class ShopOption
|
||||||
{
|
{
|
||||||
/// <summary>店铺 app_key(A.app_key)</summary>
|
/// <summary>店铺ID(ShopLoginInfo.ShopId)</summary>
|
||||||
public string AppKey { get; set; }
|
|
||||||
public string ShopId { get; set; }
|
public string ShopId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>ERP 店铺ID(ShopLoginInfo.ErpShopId),统计接口的 ShopIds 使用该字段</summary>
|
||||||
|
public string ErpShopId { get; set; }
|
||||||
|
|
||||||
/// <summary>店铺名称</summary>
|
/// <summary>店铺名称</summary>
|
||||||
public string ShopName { get; set; }
|
public string ShopName { get; set; }
|
||||||
}
|
}
|
||||||
@@ -345,55 +524,4 @@ namespace _29WxOrderWpf.Ctrls.Statistics.Models
|
|||||||
public string Value { get; set; }
|
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"
|
x:Class="_29WxOrderWpf.Ctrls.Statistics.PeriodRevenueStatisticsView"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:common="clr-namespace:_29WxOrderWpf.Common"
|
xmlns:common="WxOrder.Framework"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:stat="clr-namespace:_29WxOrderWpf.Ctrls.Statistics"
|
xmlns:stat="clr-namespace:_29WxOrderWpf.Ctrls.Statistics"
|
||||||
|
|||||||
@@ -80,16 +80,6 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
</Border>
|
</Border>
|
||||||
<Button
|
|
||||||
Margin="10"
|
|
||||||
HorizontalAlignment="Right"
|
|
||||||
VerticalAlignment="Top"
|
|
||||||
Command="{Binding ShowOrderListCommand}"
|
|
||||||
CommandParameter="ValidOrderCount"
|
|
||||||
Content="明细"
|
|
||||||
FontSize="12"
|
|
||||||
Foreground="{StaticResource pageColorBrush}"
|
|
||||||
Style="{StaticResource IconButtonStyle}" />
|
|
||||||
</Grid>
|
</Grid>
|
||||||
<!-- 采购金额 -->
|
<!-- 采购金额 -->
|
||||||
<Border Style="{StaticResource CardBorderStyle}">
|
<Border Style="{StaticResource CardBorderStyle}">
|
||||||
@@ -113,25 +103,37 @@
|
|||||||
</Border>
|
</Border>
|
||||||
|
|
||||||
<!-- 利润 -->
|
<!-- 利润 -->
|
||||||
<Border Style="{StaticResource CardBorderStyle}">
|
<Grid>
|
||||||
<StackPanel>
|
<Border Style="{StaticResource CardBorderStyle}">
|
||||||
<TextBlock
|
<StackPanel>
|
||||||
FontSize="14"
|
<TextBlock
|
||||||
Foreground="#888888"
|
FontSize="14"
|
||||||
Text="利润" />
|
Foreground="#888888"
|
||||||
<TextBlock
|
Text="利润" />
|
||||||
Margin="0,12,0,0"
|
<TextBlock
|
||||||
FontSize="30"
|
Margin="0,12,0,0"
|
||||||
FontWeight="Bold"
|
FontSize="30"
|
||||||
Foreground="#333333"
|
FontWeight="Bold"
|
||||||
Text="{Binding Summary.Profit, StringFormat={}¥{0:N2}}" />
|
Foreground="#333333"
|
||||||
<TextBlock
|
Text="{Binding Summary.Profit, StringFormat={}¥{0:N2}}" />
|
||||||
Margin="0,10,0,0"
|
<TextBlock
|
||||||
FontSize="12"
|
Margin="0,10,0,0"
|
||||||
Foreground="#999999"
|
FontSize="12"
|
||||||
Text="实际利润" />
|
Foreground="#999999"
|
||||||
</StackPanel>
|
Text="实际利润" />
|
||||||
</Border>
|
</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}">
|
<Border Style="{StaticResource CardBorderStyle}">
|
||||||
<StackPanel>
|
<StackPanel>
|
||||||
@@ -255,7 +257,7 @@
|
|||||||
<TextBlock
|
<TextBlock
|
||||||
FontSize="14"
|
FontSize="14"
|
||||||
Foreground="#888888"
|
Foreground="#888888"
|
||||||
Text="总采购金额" />
|
Text="售后采购金额" />
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Margin="0,12,0,0"
|
Margin="0,12,0,0"
|
||||||
FontSize="30"
|
FontSize="30"
|
||||||
|
|||||||
@@ -13,5 +13,6 @@ namespace _29WxOrderWpf.Ctrls.Statistics
|
|||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
File diff suppressed because it is too large.
Load diff
@@ -1,4 +1,4 @@
|
|||||||
<UserControl
|
<Window
|
||||||
x:Class="_29WxOrderWpf.Ctrls.Statistics.ShopRevenueStatisticsView"
|
x:Class="_29WxOrderWpf.Ctrls.Statistics.ShopRevenueStatisticsView"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
@@ -7,16 +7,16 @@
|
|||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:stat="clr-namespace:_29WxOrderWpf.Ctrls.Statistics"
|
xmlns:stat="clr-namespace:_29WxOrderWpf.Ctrls.Statistics"
|
||||||
xmlns:vm="clr-namespace:_29WxOrderWpf.Ctrls.Statistics.ViewModels"
|
xmlns:vm="clr-namespace:_29WxOrderWpf.Ctrls.Statistics.ViewModels"
|
||||||
xmlns:wpf="clr-namespace:_29WxOrderWpf.Common"
|
xmlns:wpf="WxOrder.Framework"
|
||||||
|
Width="1600"
|
||||||
d:Background="#F5F7FB"
|
d:Background="#F5F7FB"
|
||||||
d:DataContext="{d:DesignInstance Type=vm:ShopRevenueStatisticsViewModel,
|
d:DataContext="{d:DesignInstance Type=vm:ShopRevenueStatisticsViewModel,
|
||||||
IsDesignTimeCreatable=True}"
|
IsDesignTimeCreatable=True}"
|
||||||
d:DesignHeight="900"
|
d:DesignHeight="900"
|
||||||
d:DesignWidth="1600"
|
d:DesignWidth="1600"
|
||||||
wpf:DialogWindowProperty.ResizeMode="CanResizeWithGrip"
|
WindowStartupLocation="CenterScreen"
|
||||||
wpf:DialogWindowProperty.ShowMinButton="False"
|
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
<UserControl.Resources>
|
<Window.Resources>
|
||||||
<BooleanToVisibilityConverter x:Key="boolToVisibilityConverter" />
|
<BooleanToVisibilityConverter x:Key="boolToVisibilityConverter" />
|
||||||
|
|
||||||
<!-- 卡片样式(白底、圆角、阴影) -->
|
<!-- 卡片样式(白底、圆角、阴影) -->
|
||||||
@@ -119,7 +119,7 @@
|
|||||||
</Setter.Value>
|
</Setter.Value>
|
||||||
</Setter>
|
</Setter>
|
||||||
</Style>
|
</Style>
|
||||||
</UserControl.Resources>
|
</Window.Resources>
|
||||||
|
|
||||||
<Grid Background="#F5F7FB">
|
<Grid Background="#F5F7FB">
|
||||||
<TabControl SelectionChanged="TabControl_SelectionChanged" Style="{StaticResource StatisticsTabControlStyle}">
|
<TabControl SelectionChanged="TabControl_SelectionChanged" Style="{StaticResource StatisticsTabControlStyle}">
|
||||||
@@ -348,4 +348,4 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Border>
|
</Border>
|
||||||
</Grid>
|
</Grid>
|
||||||
</UserControl>
|
</Window>
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
using System.Windows.Controls;
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
using _29WxOrderWpf.Ctrls.Statistics.ViewModels;
|
using _29WxOrderWpf.Ctrls.Statistics.ViewModels;
|
||||||
|
|
||||||
namespace _29WxOrderWpf.Ctrls.Statistics
|
namespace _29WxOrderWpf.Ctrls.Statistics
|
||||||
@@ -9,7 +10,7 @@ namespace _29WxOrderWpf.Ctrls.Statistics
|
|||||||
/// 如需注入自定义数据服务,请使用
|
/// 如需注入自定义数据服务,请使用
|
||||||
/// new ShopRevenueStatisticsView(new ShopRevenueStatisticsViewModel(你的 IShopRevenueStatisticsService 实现))。
|
/// new ShopRevenueStatisticsView(new ShopRevenueStatisticsViewModel(你的 IShopRevenueStatisticsService 实现))。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class ShopRevenueStatisticsView : UserControl
|
public partial class ShopRevenueStatisticsView : Window
|
||||||
{
|
{
|
||||||
public ShopRevenueStatisticsView()
|
public ShopRevenueStatisticsView()
|
||||||
: this(new ShopRevenueStatisticsViewModel())
|
: this(new ShopRevenueStatisticsViewModel())
|
||||||
@@ -19,7 +20,9 @@ namespace _29WxOrderWpf.Ctrls.Statistics
|
|||||||
public ShopRevenueStatisticsView(ShopRevenueStatisticsViewModel viewModel)
|
public ShopRevenueStatisticsView(ShopRevenueStatisticsViewModel viewModel)
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
viewModel.GetWindow = () => this;
|
||||||
DataContext = viewModel;
|
DataContext = viewModel;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void help_mouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
|
private void help_mouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
|
||||||
|
|||||||
@@ -1,32 +1,92 @@
|
|||||||
<UserControl
|
<UserControl
|
||||||
x:Class="_29WxOrderWpf.Ctrls.Statistics.ShowOrderDialogView"
|
x:Class="_29WxOrderWpf.Ctrls.Statistics.ShowOrderDialogView"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:comn="WxOrder.Framework"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:local="clr-namespace:_29WxOrderWpf.Ctrls.Statistics"
|
xmlns:local="clr-namespace:_29WxOrderWpf.Ctrls.Statistics"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
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:Background="White"
|
||||||
d:DesignHeight="450"
|
d:DesignHeight="450"
|
||||||
d:DesignWidth="800"
|
d:DesignWidth="1000"
|
||||||
|
Focusable="True"
|
||||||
|
PreviewKeyDown="ShowOrderDialogView_PreviewKeyDown"
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
<UserControl.Resources>
|
<UserControl.Resources>
|
||||||
|
<wpf:BindingProxy x:Key="ViewModel" Data="{Binding}" />
|
||||||
<!-- 单元格文字居中 -->
|
<!-- 单元格文字居中 -->
|
||||||
<Style x:Key="CenterCellTextStyle" TargetType="TextBlock">
|
<Style x:Key="CenterCellTextStyle" TargetType="TextBlock">
|
||||||
<Setter Property="TextAlignment" Value="Center" />
|
<Setter Property="TextAlignment" Value="Center" />
|
||||||
<Setter Property="VerticalAlignment" Value="Center" />
|
<Setter Property="VerticalAlignment" Value="Center" />
|
||||||
</Style>
|
</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>
|
</UserControl.Resources>
|
||||||
|
|
||||||
<Grid>
|
<Grid>
|
||||||
<DataGrid Margin="5"
|
<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"
|
||||||
d:ItemsSource="{d:SampleData ItemCount=10}"
|
d:ItemsSource="{d:SampleData ItemCount=10}"
|
||||||
ItemsSource="{Binding Data}"
|
AlternatingRowBackground="#FAFAFA"
|
||||||
SelectionMode="Single"
|
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"
|
||||||
SelectionUnit="FullRow"
|
SelectionUnit="FullRow"
|
||||||
Style="{StaticResource DefaultDataGridStyle}"
|
VerticalScrollBarVisibility="Auto">
|
||||||
VerticalScrollBarVisibility="Visible">
|
|
||||||
<DataGrid.Columns>
|
<DataGrid.Columns>
|
||||||
<!-- 店名 -->
|
<!-- 店名 -->
|
||||||
<DataGridTextColumn
|
<DataGridTextColumn
|
||||||
@@ -50,7 +110,6 @@
|
|||||||
<Button
|
<Button
|
||||||
Margin="5,0,0,0"
|
Margin="5,0,0,0"
|
||||||
Click="CopyOrderId_Click"
|
Click="CopyOrderId_Click"
|
||||||
Foreground="{StaticResource pageColorBrush}"
|
|
||||||
ToolTip="复制订单号">
|
ToolTip="复制订单号">
|
||||||
<Button.Style>
|
<Button.Style>
|
||||||
<Style BasedOn="{StaticResource IconButtonStyle}" TargetType="Button">
|
<Style BasedOn="{StaticResource IconButtonStyle}" TargetType="Button">
|
||||||
@@ -70,6 +129,13 @@
|
|||||||
</DataGridTemplateColumn.CellTemplate>
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
</DataGridTemplateColumn>
|
</DataGridTemplateColumn>
|
||||||
|
|
||||||
|
<!-- 创建时间 -->
|
||||||
|
<DataGridTextColumn
|
||||||
|
Width="1.4*"
|
||||||
|
Binding="{Binding CreateTime, StringFormat={}{0:yyyy-MM-dd HH:mm}}"
|
||||||
|
ElementStyle="{StaticResource CenterCellTextStyle}"
|
||||||
|
Header="创建时间" />
|
||||||
|
|
||||||
<!-- 金额(分转元) -->
|
<!-- 金额(分转元) -->
|
||||||
<DataGridTextColumn
|
<DataGridTextColumn
|
||||||
Width="*"
|
Width="*"
|
||||||
@@ -78,14 +144,94 @@
|
|||||||
Header="金额" />
|
Header="金额" />
|
||||||
<DataGridTextColumn
|
<DataGridTextColumn
|
||||||
Width="*"
|
Width="*"
|
||||||
Binding="{Binding RefundAmount, Converter={StaticResource FenToYuanConverter}, StringFormat={}¥{0:N2}}"
|
Binding="{Binding OrderRefundAmount, Converter={StaticResource FenToYuanConverter}, StringFormat={}¥{0:N2}}"
|
||||||
ElementStyle="{StaticResource CenterCellTextStyle}"
|
ElementStyle="{StaticResource CenterCellTextStyle}"
|
||||||
Header="退款金额" />
|
Header="退款金额" />
|
||||||
<DataGridTextColumn
|
<DataGridTextColumn
|
||||||
Width="*"
|
Width="*"
|
||||||
Binding="{Binding OutAmount, Converter={StaticResource FenToYuanConverter}, StringFormat={}¥{0:N2}}"
|
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="1.6*"
|
||||||
|
Binding="{Binding OutOrderSn}"
|
||||||
|
ElementStyle="{StaticResource CenterCellTextStyle}"
|
||||||
|
Header="买手单号" />
|
||||||
|
<DataGridTextColumn
|
||||||
|
Width="*"
|
||||||
|
Binding="{Binding BuyerOutAmount, Converter={StaticResource FenToYuanConverter}, StringFormat={}¥{0:N2}}"
|
||||||
ElementStyle="{StaticResource CenterCellTextStyle}"
|
ElementStyle="{StaticResource CenterCellTextStyle}"
|
||||||
Header="外采金额" />
|
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.Columns>
|
||||||
</DataGrid>
|
</DataGrid>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|||||||
@@ -1,12 +1,20 @@
|
|||||||
using _29WxOrderWpf.BaseWindows;
|
using _29WxOrderWpf.BaseWindows;
|
||||||
|
using WxOrder.Framework.Commons;
|
||||||
using _29WxOrderWpf.Ctrls.Statistics.Models;
|
using _29WxOrderWpf.Ctrls.Statistics.Models;
|
||||||
|
using _29WxOrderWpf.Ctrls.Statistics.Services;
|
||||||
|
using _29WxOrderWpf.ToolCtrls;
|
||||||
|
using AllBase;
|
||||||
|
using NaiBa.Util.Extension;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.ComponentModel;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
|
using System.Windows.Controls.Primitives;
|
||||||
using System.Windows.Data;
|
using System.Windows.Data;
|
||||||
using System.Windows.Documents;
|
using System.Windows.Documents;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
@@ -14,6 +22,8 @@ using System.Windows.Media;
|
|||||||
using System.Windows.Media.Imaging;
|
using System.Windows.Media.Imaging;
|
||||||
using System.Windows.Navigation;
|
using System.Windows.Navigation;
|
||||||
using System.Windows.Shapes;
|
using System.Windows.Shapes;
|
||||||
|
using Work.BaseForms;
|
||||||
|
using WPFCommon.Models;
|
||||||
|
|
||||||
namespace _29WxOrderWpf.Ctrls.Statistics;
|
namespace _29WxOrderWpf.Ctrls.Statistics;
|
||||||
|
|
||||||
@@ -22,10 +32,44 @@ namespace _29WxOrderWpf.Ctrls.Statistics;
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class ShowOrderDialogView : UserControl
|
public partial class ShowOrderDialogView : UserControl
|
||||||
{
|
{
|
||||||
public ShowOrderDialogView(List<ShopRevenueStatisticsRow> list)
|
private readonly KeyEventHandler shortcutKeyHandler;
|
||||||
|
|
||||||
|
public ShowOrderDialogView(List<ShopOrderDetailResponse> list, ShopOrderDetailType detailType, IShopRevenueStatisticsService statisticsService)
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
this.DataContext = new ShowOrderDialogViewModel(list);
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -34,27 +78,380 @@ public partial class ShowOrderDialogView : UserControl
|
|||||||
private void CopyOrderId_Click(object sender, RoutedEventArgs e)
|
private void CopyOrderId_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
if (sender is FrameworkElement element
|
if (sender is FrameworkElement element
|
||||||
&& element.DataContext is ShopRevenueStatisticsRow row
|
&& element.DataContext is ShopOrderDetailRow row
|
||||||
&& !string.IsNullOrEmpty(row.OrderId))
|
&& !string.IsNullOrEmpty(row.OrderId))
|
||||||
{
|
{
|
||||||
Window window = Window.GetWindow(this);
|
Window window = Window.GetWindow(this);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Clipboard.SetDataObject(row.OrderId);
|
Clipboard.SetDataObject(row.OrderId);
|
||||||
BaseMsgWindow.ShowAnimateMessage("复制成功");
|
ToastHelper.Show(window, "复制成功");
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
BaseMsgWindow.ShowError("复制失败 " + ex.Message,window: window);
|
ToastHelper.Show(window, "复制失败 " + ex.Message, type: ToastType.Error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
class ShowOrderDialogViewModel
|
|
||||||
{
|
/// <summary>
|
||||||
public List<ShopRevenueStatisticsRow> Data { get; set; }
|
/// 弹窗级快捷键:Ctrl+A 全选(筛选后显示的)行,Ctrl+C 复制数据。
|
||||||
public ShowOrderDialogViewModel(List<ShopRevenueStatisticsRow> list)
|
/// 焦点在文本框里(如订单号搜索框)时不拦截,保留文本自身的 Ctrl+A/Ctrl+C/Ctrl+V 行为。
|
||||||
|
/// </summary>
|
||||||
|
private void ShowOrderDialogView_PreviewKeyDown(object sender, KeyEventArgs e)
|
||||||
{
|
{
|
||||||
Data = list ?? new List<ShopRevenueStatisticsRow>();
|
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
|
||||||
|
{
|
||||||
|
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 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
|
||||||
|
{
|
||||||
|
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,
|
||||||
|
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"),
|
||||||
|
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
using _29WxOrderWpf.Commands;
|
using WxOrder.Framework.Commons;
|
||||||
using _29WxOrderWpf.Common;
|
|
||||||
using _29WxOrderWpf.Ctrls.Statistics.Models;
|
using _29WxOrderWpf.Ctrls.Statistics.Models;
|
||||||
using _29WxOrderWpf.Ctrls.Statistics.Services;
|
using _29WxOrderWpf.Ctrls.Statistics.Services;
|
||||||
using AllBase.Model.MvvmBaseClasses;
|
using AllBase.Model.MvvmBaseClasses;
|
||||||
@@ -10,6 +9,7 @@ using System.Linq;
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
|
using WxOrder.Framework.Commons;
|
||||||
|
|
||||||
namespace _29WxOrderWpf.Ctrls.Statistics.ViewModels
|
namespace _29WxOrderWpf.Ctrls.Statistics.ViewModels
|
||||||
{
|
{
|
||||||
@@ -39,6 +39,12 @@ namespace _29WxOrderWpf.Ctrls.Statistics.ViewModels
|
|||||||
private int _totalCount;
|
private int _totalCount;
|
||||||
private string _pagerText = string.Empty;
|
private string _pagerText = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>是否已完成首次初始化(用于避免页签来回切换时重复初始化、重复查询)</summary>
|
||||||
|
private bool _initialized;
|
||||||
|
|
||||||
|
/// <summary>上一次真正生效(并据此计算过日期)的时间范围选项,避免同一个选项被重复应用</summary>
|
||||||
|
private TimeRangeOption _appliedTimeRange;
|
||||||
|
|
||||||
public PeriodRevenueStatisticsViewModel(PeriodStatisticType periodType)
|
public PeriodRevenueStatisticsViewModel(PeriodStatisticType periodType)
|
||||||
: this(periodType, new ShopRevenueStatisticsService())
|
: this(periodType, new ShopRevenueStatisticsService())
|
||||||
{
|
{
|
||||||
@@ -65,8 +71,18 @@ namespace _29WxOrderWpf.Ctrls.Statistics.ViewModels
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 页面首次显示时初始化查询条件并加载数据(由外层 TabControl 的选中事件调用)。
|
||||||
|
/// 重复调用(在“综合统计 / 天统计 / 周统计 / 月统计”页签之间来回切换)会被忽略:
|
||||||
|
/// 否则每次切回来都会把时间范围和店铺重置成默认值,并重新发起一次查询。
|
||||||
|
/// 需要刷新数据时点“查询”按钮即可。
|
||||||
|
/// </summary>
|
||||||
public void Init()
|
public void Init()
|
||||||
{
|
{
|
||||||
|
if (_initialized)
|
||||||
|
return;
|
||||||
|
|
||||||
|
_initialized = true;
|
||||||
InitializeAsync();
|
InitializeAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -172,7 +188,16 @@ namespace _29WxOrderWpf.Ctrls.Statistics.ViewModels
|
|||||||
set
|
set
|
||||||
{
|
{
|
||||||
this.SetValue(x => x.SelectedTimeRange, value);
|
this.SetValue(x => x.SelectedTimeRange, value);
|
||||||
ApplyTimeRange();
|
|
||||||
|
// 只有用户真正切换到“另一个”时间范围选项时才重新计算起止日期。
|
||||||
|
// 页签切换时下拉框会把同一个选项(甚至先 null 再回写)重放一遍,
|
||||||
|
// 若照样重算,就会把用户手工调过的日期覆盖掉(例如自定义区间被改回“本周”)。
|
||||||
|
if (value != null && !ReferenceEquals(_appliedTimeRange, value))
|
||||||
|
{
|
||||||
|
_appliedTimeRange = value;
|
||||||
|
ApplyTimeRange();
|
||||||
|
}
|
||||||
|
|
||||||
OnPropertyChanged(nameof(IsCustomDateRange));
|
OnPropertyChanged(nameof(IsCustomDateRange));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -481,25 +506,28 @@ namespace _29WxOrderWpf.Ctrls.Statistics.ViewModels
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>根据选中店铺生成查询店铺 key 列表:未选/全选/选中“全部店铺”时返回空列表(表示全部店铺)</summary>
|
/// <summary>
|
||||||
private List<string> BuildSelectedShopKeys()
|
/// 根据选中店铺生成查询用 ERP 店铺ID 列表(接口 ShopIds 使用 ShopLoginInfo.ErpShopId):
|
||||||
|
/// 未选/全选/选中“全部店铺”时返回空列表(表示全部店铺)。
|
||||||
|
/// </summary>
|
||||||
|
private List<string> BuildSelectedShopIds()
|
||||||
{
|
{
|
||||||
var selected = SelectedShops;
|
var selected = SelectedShops;
|
||||||
if (selected == null || selected.Count == 0)
|
if (selected == null || selected.Count == 0)
|
||||||
return new List<string>();
|
return new List<string>();
|
||||||
|
|
||||||
var keys = selected.Select(s => s == null ? string.Empty : s.AppKey).ToList();
|
var ids = selected.Select(s => s == null ? string.Empty : s.ErpShopId).ToList();
|
||||||
if (keys.Any(string.IsNullOrEmpty))
|
if (ids.Any(string.IsNullOrEmpty))
|
||||||
return new List<string>();
|
return new List<string>();
|
||||||
|
|
||||||
if (selected.Count >= ShopOptions.Count)
|
if (selected.Count >= ShopOptions.Count)
|
||||||
return new List<string>();
|
return new List<string>();
|
||||||
|
|
||||||
return keys;
|
return ids;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>执行查询,刷新周期统计表格并回到第一页</summary>
|
/// <summary>组装查询参数(起止日期已保证先后顺序)</summary>
|
||||||
private async Task LoadAsync()
|
private ShopRevenueStatisticsQuery BuildQuery()
|
||||||
{
|
{
|
||||||
if (StartDate > EndDate)
|
if (StartDate > EndDate)
|
||||||
{
|
{
|
||||||
@@ -508,19 +536,23 @@ namespace _29WxOrderWpf.Ctrls.Statistics.ViewModels
|
|||||||
EndDate = temp;
|
EndDate = temp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return new ShopRevenueStatisticsQuery
|
||||||
|
{
|
||||||
|
StartDate = StartDate,
|
||||||
|
EndDate = EndDate,
|
||||||
|
ShopIds = BuildSelectedShopIds(),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>执行查询,刷新周期统计表格并回到第一页</summary>
|
||||||
|
private async Task LoadAsync()
|
||||||
|
{
|
||||||
IsLoading = true;
|
IsLoading = true;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var query = new ShopRevenueStatisticsQuery
|
var result = await _service.QueryPeriodStatisticsAsync(BuildQuery(), _periodType);
|
||||||
{
|
Summary = result.Summary;
|
||||||
StartDate = StartDate,
|
_allItems = result.Items ?? new List<ShopPeriodStatisticsItem>();
|
||||||
EndDate = EndDate,
|
|
||||||
ShopKeys = BuildSelectedShopKeys(),
|
|
||||||
};
|
|
||||||
|
|
||||||
var table = await _service.GetPeriodStatisticsAsync(query, _periodType);
|
|
||||||
Summary = await _service.GetSummaryAsync(query);
|
|
||||||
_allItems = table ?? new List<ShopPeriodStatisticsItem>();
|
|
||||||
TotalCount = _allItems.Count;
|
TotalCount = _allItems.Count;
|
||||||
TotalPages = TotalCount == 0 ? 1 : (int)Math.Ceiling(TotalCount / (double)PageSize);
|
TotalPages = TotalCount == 0 ? 1 : (int)Math.Ceiling(TotalCount / (double)PageSize);
|
||||||
GoToPage(1);
|
GoToPage(1);
|
||||||
@@ -553,35 +585,51 @@ namespace _29WxOrderWpf.Ctrls.Statistics.ViewModels
|
|||||||
|
|
||||||
private async Task ShowOrderList(string type)
|
private async Task ShowOrderList(string type)
|
||||||
{
|
{
|
||||||
var query = new ShopRevenueStatisticsQuery
|
var detailType = ParseDetailType(type);
|
||||||
|
List<ShopOrderDetailResponse> showList;
|
||||||
|
// 明细接口数据量大、耗时长,期间显示页面统一的加载遮罩,避免点了没反应
|
||||||
|
IsLoading = true;
|
||||||
|
try
|
||||||
{
|
{
|
||||||
StartDate = StartDate,
|
showList = await _service.QueryOrderRowsAsync(BuildQuery(), detailType)
|
||||||
EndDate = EndDate,
|
?? new List<ShopOrderDetailResponse>();
|
||||||
ShopKeys = BuildSelectedShopKeys(),
|
}
|
||||||
};
|
catch (Exception ex)
|
||||||
var rows = await _service.QueryRowsAsync(query);
|
|
||||||
List<ShopRevenueStatisticsRow> showList = new List<ShopRevenueStatisticsRow>();
|
|
||||||
switch (type)
|
|
||||||
{
|
{
|
||||||
case "ValidOrderCount":
|
MessageBox.Show("订单明细查询失败:" + ex.Message, "提示", MessageBoxButton.OK, MessageBoxImage.Warning);
|
||||||
showList = RevenueStatisticsAggregator.GetValidOrder(rows);
|
return;
|
||||||
break; //有效订单
|
}
|
||||||
case "RefundOrderCount":
|
finally
|
||||||
showList = RevenueStatisticsAggregator.GetRefundOrder(rows);
|
{
|
||||||
break;//退款订单
|
IsLoading = false;
|
||||||
case "BuyerRefundRemainingAmount":
|
}
|
||||||
showList = RevenueStatisticsAggregator.GetBuyerRefundRemainingOrder(rows);
|
|
||||||
break;//待退回采购金额
|
if (showList.Count == 0)
|
||||||
default:
|
{
|
||||||
break;
|
MessageBox.Show("未查询到符合条件的订单明细。", "提示", MessageBoxButton.OK, MessageBoxImage.Information);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
new DialogWindow()
|
new DialogWindow()
|
||||||
{
|
{
|
||||||
Title = "订单列表",
|
Title = "订单列表",
|
||||||
Content = new ShowOrderDialogView(showList),
|
Content = new ShowOrderDialogView(showList, detailType, _service),
|
||||||
DataContext = rows
|
DataContext = showList
|
||||||
}.ShowDialog();
|
}.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 _29WxOrderWpf.Commands;
|
using WxOrder.Framework.Commons;
|
||||||
using _29WxOrderWpf.Common;
|
using WxOrder.Framework.Commons;
|
||||||
using _29WxOrderWpf.Ctrls.Statistics.Models;
|
using _29WxOrderWpf.Ctrls.Statistics.Models;
|
||||||
using _29WxOrderWpf.Ctrls.Statistics.Services;
|
using _29WxOrderWpf.Ctrls.Statistics.Services;
|
||||||
using AllBase.Model.MvvmBaseClasses;
|
using AllBase.Model.MvvmBaseClasses;
|
||||||
@@ -10,7 +10,9 @@ using System.Collections.Generic;
|
|||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
|
using Work.BaseForms;
|
||||||
|
|
||||||
namespace _29WxOrderWpf.Ctrls.Statistics.ViewModels
|
namespace _29WxOrderWpf.Ctrls.Statistics.ViewModels
|
||||||
{
|
{
|
||||||
@@ -30,6 +32,9 @@ namespace _29WxOrderWpf.Ctrls.Statistics.ViewModels
|
|||||||
private ObservableCollection<ShopOption> _selectedShops;
|
private ObservableCollection<ShopOption> _selectedShops;
|
||||||
private string _selectedPlatform;
|
private string _selectedPlatform;
|
||||||
|
|
||||||
|
/// <summary>上一次真正生效(并据此计算过日期)的时间范围选项,避免同一个选项被重复应用</summary>
|
||||||
|
private TimeRangeOption _appliedTimeRange;
|
||||||
|
|
||||||
public ShopRevenueStatisticsViewModel()
|
public ShopRevenueStatisticsViewModel()
|
||||||
: this(new ShopRevenueStatisticsService())
|
: this(new ShopRevenueStatisticsService())
|
||||||
{
|
{
|
||||||
@@ -69,7 +74,16 @@ namespace _29WxOrderWpf.Ctrls.Statistics.ViewModels
|
|||||||
set
|
set
|
||||||
{
|
{
|
||||||
this.SetValue(x => x.SelectedTimeRange, value);
|
this.SetValue(x => x.SelectedTimeRange, value);
|
||||||
ApplyTimeRange();
|
|
||||||
|
// 只有用户真正切换到“另一个”时间范围选项时才重新计算起止日期。
|
||||||
|
// 页签切换时下拉框会把同一个选项(甚至先 null 再回写)重放一遍,
|
||||||
|
// 若照样重算,就会把用户手工调过的日期覆盖掉。
|
||||||
|
if (value != null && !ReferenceEquals(_appliedTimeRange, value))
|
||||||
|
{
|
||||||
|
_appliedTimeRange = value;
|
||||||
|
ApplyTimeRange();
|
||||||
|
}
|
||||||
|
|
||||||
OnPropertyChanged(nameof(IsCustomDateRange));
|
OnPropertyChanged(nameof(IsCustomDateRange));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -234,57 +248,66 @@ namespace _29WxOrderWpf.Ctrls.Statistics.ViewModels
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>根据选中店铺生成查询店铺 key 列表:未选/全选/选中“全部店铺”时返回空列表(表示全部店铺)</summary>
|
/// <summary>
|
||||||
private List<string> BuildSelectedShopKeys()
|
/// 根据选中店铺生成查询用 ERP 店铺ID 列表(接口 ShopIds 使用 ShopLoginInfo.ErpShopId):
|
||||||
|
/// 未选/全选/选中“全部店铺”时返回空列表(表示全部店铺)。
|
||||||
|
/// </summary>
|
||||||
|
private List<string> BuildSelectedShopIds()
|
||||||
{
|
{
|
||||||
var selected = SelectedShops;
|
var selected = SelectedShops;
|
||||||
if (selected == null || selected.Count == 0)
|
if (selected == null || selected.Count == 0)
|
||||||
return new List<string>();
|
return new List<string>();
|
||||||
|
|
||||||
var keys = selected.Select(s => s == null ? string.Empty : s.AppKey).ToList();
|
var ids = selected.Select(s => s == null ? string.Empty : s.ErpShopId).ToList();
|
||||||
if (keys.Any(string.IsNullOrEmpty))
|
if (ids.Any(string.IsNullOrEmpty))
|
||||||
return new List<string>();
|
return new List<string>();
|
||||||
|
|
||||||
if (selected.Count >= ShopOptions.Count)
|
if (selected.Count >= ShopOptions.Count)
|
||||||
return new List<string>();
|
return new List<string>();
|
||||||
|
|
||||||
return keys;
|
return ids;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>执行查询,刷新页面所有统计数据</summary>
|
/// <summary>组装查询参数(起止日期已保证先后顺序)</summary>
|
||||||
private async Task LoadAsync()
|
private ShopRevenueStatisticsQuery BuildQuery()
|
||||||
{
|
{
|
||||||
if (StartDate > EndDate)
|
if (StartDate == EndDate)
|
||||||
|
{
|
||||||
|
EndDate = EndDate.AddDays(1).AddSeconds(-1);
|
||||||
|
}
|
||||||
|
else if (StartDate > EndDate)
|
||||||
{
|
{
|
||||||
var temp = StartDate;
|
var temp = StartDate;
|
||||||
StartDate = EndDate;
|
StartDate = EndDate;
|
||||||
EndDate = temp;
|
EndDate = temp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return new ShopRevenueStatisticsQuery
|
||||||
|
{
|
||||||
|
StartDate = StartDate,
|
||||||
|
EndDate = EndDate,
|
||||||
|
ShopIds = BuildSelectedShopIds(),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>执行查询,刷新页面所有统计数据</summary>
|
||||||
|
private async Task LoadAsync()
|
||||||
|
{
|
||||||
IsLoading = true;
|
IsLoading = true;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var query = new ShopRevenueStatisticsQuery
|
var result = await _service.QueryAsync(BuildQuery());
|
||||||
{
|
|
||||||
StartDate = StartDate,
|
|
||||||
EndDate = EndDate,
|
|
||||||
ShopKeys = BuildSelectedShopKeys(),
|
|
||||||
};
|
|
||||||
|
|
||||||
Summary = await _service.GetSummaryAsync(query);
|
Summary = result.Summary;
|
||||||
|
TrendData = new ObservableCollection<RevenueTrendPoint>(result.Trend ?? new List<RevenueTrendPoint>());
|
||||||
var trend = await _service.GetSalesTrendAsync(query);
|
ShopProportionData = new ObservableCollection<ShopSalesProportionItem>(result.ShopProportions ?? new List<ShopSalesProportionItem>());
|
||||||
TrendData = new ObservableCollection<RevenueTrendPoint>(trend);
|
ShopStatistics = new ObservableCollection<ShopStatisticsItem>(result.ShopStatistics ?? new List<ShopStatisticsItem>());
|
||||||
|
|
||||||
var proportion = await _service.GetShopSalesProportionAsync(query);
|
|
||||||
ShopProportionData = new ObservableCollection<ShopSalesProportionItem>(proportion);
|
|
||||||
|
|
||||||
var table = await _service.GetShopStatisticsAsync(query);
|
|
||||||
ShopStatistics = new ObservableCollection<ShopStatisticsItem>(table);
|
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
// 查询异常:保留上一次数据,可在此接入日志/错误提示
|
// 查询异常:保留上一次数据,并弹框提示
|
||||||
|
BaseMsgForm.ShowError("查询失败:" + ex.Message, "提示");
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
@@ -308,35 +331,54 @@ namespace _29WxOrderWpf.Ctrls.Statistics.ViewModels
|
|||||||
|
|
||||||
private async Task ShowOrderList(string type)
|
private async Task ShowOrderList(string type)
|
||||||
{
|
{
|
||||||
var query = new ShopRevenueStatisticsQuery
|
var detailType = ParseDetailType(type);
|
||||||
|
List<ShopOrderDetailResponse> showList;
|
||||||
|
IsLoading = true;
|
||||||
|
try
|
||||||
{
|
{
|
||||||
StartDate = StartDate,
|
showList = await _service.QueryOrderRowsAsync(BuildQuery(), detailType)
|
||||||
EndDate = EndDate,
|
?? new List<ShopOrderDetailResponse>();
|
||||||
ShopKeys = BuildSelectedShopKeys(),
|
}
|
||||||
};
|
catch (Exception ex)
|
||||||
var rows = await _service.QueryRowsAsync(query);
|
|
||||||
List<ShopRevenueStatisticsRow> showList = new List<ShopRevenueStatisticsRow>();
|
|
||||||
switch (type)
|
|
||||||
{
|
{
|
||||||
case "ValidOrderCount":
|
BaseMsgForm.ShowError("订单明细查询失败:" + ex.Message, "提示");
|
||||||
showList = RevenueStatisticsAggregator.GetValidOrder(rows);
|
return;
|
||||||
break; //有效订单
|
}
|
||||||
case "RefundOrderCount":
|
finally
|
||||||
showList = RevenueStatisticsAggregator.GetRefundOrder(rows);
|
{
|
||||||
break;//退款订单
|
IsLoading = false;
|
||||||
case "BuyerRefundRemainingAmount":
|
|
||||||
showList = RevenueStatisticsAggregator.GetBuyerRefundRemainingOrder(rows);
|
|
||||||
break;//待退回采购金额
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
new DialogWindow()
|
if (showList.Count == 0)
|
||||||
{
|
{
|
||||||
Title="订单列表",
|
BaseMsgForm.ShowInfo("未查询到符合条件的订单明细。", "提示");
|
||||||
Content = new ShowOrderDialogView(showList),
|
return;
|
||||||
DataContext = rows
|
}
|
||||||
}.ShowDialog();
|
|
||||||
|
new DialogWindow(GetWindow())
|
||||||
|
{
|
||||||
|
Title = "订单列表",
|
||||||
|
Content = new ShowOrderDialogView(showList, detailType, _service),
|
||||||
|
DataContext = showList
|
||||||
|
}.Show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>卡片“明细”按钮参数 → 订单明细类型(对应接口参数 OrderType)</summary>
|
||||||
|
private static ShopOrderDetailType ParseDetailType(string type)
|
||||||
|
{
|
||||||
|
switch (type)
|
||||||
|
{
|
||||||
|
case "RefundOrderCount":
|
||||||
|
return ShopOrderDetailType.Refund; //退款订单
|
||||||
|
case "BuyerRefundRemainingAmount":
|
||||||
|
return ShopOrderDetailType.BuyerUnrefunded; //买手未退回金额的订单
|
||||||
|
case "ProfitOrder":
|
||||||
|
return ShopOrderDetailType.Profit; //买手未退回金额的订单
|
||||||
|
default:
|
||||||
|
return ShopOrderDetailType.Valid; //有效订单
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public Func<Window> GetWindow;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+266
-197
@@ -1,204 +1,273 @@
|
|||||||
<basewindows:BaseWindow
|
<basewindows:BaseWindow
|
||||||
x:Class="_29WxOrderWpf.MainWindow"
|
x:Class="_29WxOrderWpf.MainWindow"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:basewindows="clr-namespace:_29WxOrderWpf.BaseWindows"
|
xmlns:basewindows="clr-namespace:_29WxOrderWpf.BaseWindows"
|
||||||
xmlns:buyerctrls="clr-namespace:_29WxOrderWpf.Ctrls.BuyerCtrls"
|
xmlns:buyerctrls="clr-namespace:_29WxOrderWpf.Ctrls.BuyerCtrls"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:local="clr-namespace:_29WxOrderWpf"
|
xmlns:local="clr-namespace:_29WxOrderWpf"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:orderctrls="clr-namespace:_29WxOrderWpf.Ctrls.OrderCtrls"
|
xmlns:orderctrls="clr-namespace:_29WxOrderWpf.Ctrls.OrderCtrls"
|
||||||
xmlns:shopctrls="clr-namespace:_29WxOrderWpf.Ctrls.ShopCtrls"
|
xmlns:shopctrls="clr-namespace:_29WxOrderWpf.Ctrls.ShopCtrls"
|
||||||
xmlns:userctrls="clr-namespace:_29WxOrderWpf.UserControls"
|
xmlns:userctrls="clr-namespace:_29WxOrderWpf.UserControls"
|
||||||
x:Name="mainWindow"
|
x:Name="mainWindow"
|
||||||
Title="MainWindow"
|
Title="MainWindow"
|
||||||
Width="1600"
|
Width="1600"
|
||||||
Height="900"
|
Height="900"
|
||||||
Closing="BaseWindow_Closing"
|
Closing="BaseWindow_Closing"
|
||||||
Loaded="Window_Loaded"
|
Loaded="Window_Loaded"
|
||||||
Style="{StaticResource BaseNoneBorderWindowStyle}"
|
Style="{StaticResource BaseNoneBorderWindowStyle}"
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
|
|
||||||
<Grid
|
<Grid
|
||||||
x:Name="mainGrid"
|
x:Name="mainGrid"
|
||||||
Margin="{Binding ElementName=mainWindow, Path=Padding}"
|
Margin="{Binding ElementName=mainWindow, Path=Padding}"
|
||||||
Background="Transparent">
|
Background="Transparent">
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="60" />
|
<RowDefinition Height="60" />
|
||||||
<RowDefinition Height="*" />
|
<RowDefinition Height="*" />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<Grid
|
<Grid
|
||||||
x:Name="gridTitle"
|
x:Name="gridTitle"
|
||||||
Background="Transparent"
|
Background="Transparent"
|
||||||
MouseLeftButtonDown="gridTitle_MouseLeftButtonDown">
|
MouseLeftButtonDown="gridTitle_MouseLeftButtonDown">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="auto" />
|
<ColumnDefinition Width="auto" />
|
||||||
<ColumnDefinition Width="auto" />
|
<ColumnDefinition Width="auto" />
|
||||||
<ColumnDefinition />
|
<ColumnDefinition Width="*" />
|
||||||
<ColumnDefinition />
|
<ColumnDefinition Width="auto" />
|
||||||
</Grid.ColumnDefinitions>
|
<ColumnDefinition Width="auto" />
|
||||||
<Image
|
</Grid.ColumnDefinitions>
|
||||||
Width="50"
|
<Image
|
||||||
Height="50"
|
Width="50"
|
||||||
Margin="4"
|
Height="50"
|
||||||
HorizontalAlignment="Left"
|
Margin="4"
|
||||||
VerticalAlignment="Center"
|
HorizontalAlignment="Left"
|
||||||
Source="{StaticResource main29WeixinIcon}" />
|
VerticalAlignment="Center"
|
||||||
<Label
|
Source="{StaticResource main29WeixinIcon}" />
|
||||||
x:Name="lblAppName"
|
<Label
|
||||||
Grid.Column="1"
|
x:Name="lblAppName"
|
||||||
Margin="0,0,0,0"
|
Grid.Column="1"
|
||||||
HorizontalAlignment="Center"
|
Margin="0,0,0,0"
|
||||||
VerticalAlignment="Center"
|
HorizontalAlignment="Center"
|
||||||
VerticalContentAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Content="拍单软件"
|
VerticalContentAlignment="Center"
|
||||||
FontSize="20"
|
Content="拍单软件"
|
||||||
Foreground="{StaticResource mainColorLightBrush}" />
|
FontSize="20"
|
||||||
|
Foreground="{StaticResource mainColorLightBrush}" />
|
||||||
|
|
||||||
<WrapPanel
|
<WrapPanel
|
||||||
Grid.Column="12"
|
Grid.Column="2"
|
||||||
Margin="0,4,80,0"
|
HorizontalAlignment="Right"
|
||||||
HorizontalAlignment="Right"
|
VerticalAlignment="Center">
|
||||||
VerticalAlignment="Top">
|
<Button
|
||||||
<Label
|
x:Name="btOrderSupport"
|
||||||
x:Name="lblDebug"
|
Click="bt_showOrderSupport"
|
||||||
Grid.Column="4"
|
Style="{StaticResource IconButtonStyle}"
|
||||||
Margin="2,4,0,0"
|
ToolTip="客户工单">
|
||||||
HorizontalAlignment="Right"
|
<Grid Width="30" Height="30">
|
||||||
VerticalAlignment="Top"
|
<TextBlock
|
||||||
VerticalContentAlignment="Center"
|
HorizontalAlignment="Center"
|
||||||
Content="[release]"
|
VerticalAlignment="Center"
|
||||||
FontSize="12"
|
FontSize="22"
|
||||||
Foreground="{StaticResource mainColorLightBrush}"
|
Foreground="{StaticResource mainColorLightBrush}"
|
||||||
Opacity="0.7" />
|
Style="{StaticResource TextBlockIcon}"
|
||||||
<Label
|
Text="{StaticResource txt-alert}" />
|
||||||
x:Name="lblVersion"
|
<Border
|
||||||
Grid.Column="4"
|
x:Name="borderOrderSupportUnread"
|
||||||
Margin="2,4,0,0"
|
Height="16"
|
||||||
HorizontalAlignment="Right"
|
MinWidth="16"
|
||||||
VerticalAlignment="Top"
|
Padding="4,0"
|
||||||
VerticalContentAlignment="Center"
|
HorizontalAlignment="Right"
|
||||||
Content="版本信息"
|
VerticalAlignment="Top"
|
||||||
FontSize="12"
|
d:Visibility="Visible"
|
||||||
Foreground="{StaticResource mainColorLightBrush}"
|
Background="#E53935"
|
||||||
Opacity="0.7" />
|
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"
|
||||||
|
HorizontalAlignment="Right"
|
||||||
|
VerticalAlignment="Top">
|
||||||
|
|
||||||
</WrapPanel>
|
<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" />
|
||||||
|
|
||||||
<Label
|
</WrapPanel>
|
||||||
x:Name="lblBalance"
|
<Label
|
||||||
Grid.Column="4"
|
x:Name="lblBalance"
|
||||||
Margin="0,25,80,0"
|
Grid.Column="4"
|
||||||
HorizontalAlignment="Right"
|
HorizontalAlignment="Right"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
VerticalContentAlignment="Center"
|
VerticalContentAlignment="Center"
|
||||||
Content="{Binding Balance}"
|
d:Content="快递余额:999.99"
|
||||||
Cursor="Hand"
|
Content="{Binding Balance}"
|
||||||
FontSize="12"
|
Cursor="Hand"
|
||||||
Foreground="#60ff66"
|
FontSize="12"
|
||||||
MouseLeftButtonUp="lblBalance_MouseLeftButtonUp"
|
Foreground="#60ff66"
|
||||||
Opacity="0.7" />
|
MouseLeftButtonUp="lblBalance_MouseLeftButtonUp"
|
||||||
</Grid>
|
Opacity="0.7" />
|
||||||
<Grid
|
</UniformGrid>
|
||||||
x:Name="gridContainer"
|
</WrapPanel>
|
||||||
Grid.Row="1"
|
|
||||||
Margin="2,0,2,2"
|
|
||||||
Background="White">
|
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="auto" />
|
|
||||||
<ColumnDefinition Width="*" />
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
<orderctrls:OrderListCtrl
|
|
||||||
x:Name="orderListCtrl"
|
|
||||||
Grid.Column="1"
|
|
||||||
Visibility="Collapsed" />
|
|
||||||
<Grid
|
|
||||||
x:Name="gridPddBuyerOrderReadCtrl"
|
|
||||||
Grid.ColumnSpan="2"
|
|
||||||
Background="#7F000000"
|
|
||||||
MouseLeftButtonUp="gridPddBuyerOrderReadCtrl_MouseLeftButtonUp"
|
|
||||||
Visibility="Hidden">
|
|
||||||
<Border
|
|
||||||
Height="auto"
|
|
||||||
Margin="0,50,0,0"
|
|
||||||
HorizontalAlignment="Right"
|
|
||||||
Background="White"
|
|
||||||
CornerRadius="10">
|
|
||||||
<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"
|
|
||||||
Visibility="Collapsed" />
|
|
||||||
<Grid
|
|
||||||
x:Name="gridUser"
|
|
||||||
Grid.ColumnSpan="2"
|
|
||||||
Background="#7F000000"
|
|
||||||
Visibility="Hidden">
|
|
||||||
<Border
|
|
||||||
Width="500"
|
|
||||||
Height="600"
|
|
||||||
Background="White"
|
|
||||||
CornerRadius="4">
|
|
||||||
<shopctrls:ShopListCtrl
|
|
||||||
x:Name="shopListCtrl"
|
|
||||||
Grid.ColumnSpan="2"
|
|
||||||
Margin="2"
|
|
||||||
Visibility="{Binding ElementName=gridUser, Mode=TwoWay, Path=Visibility}" />
|
|
||||||
</Border>
|
|
||||||
</Grid>
|
|
||||||
</Grid>
|
|
||||||
<userctrls:UcWindowBoxes
|
|
||||||
x:Name="ucWindowBox"
|
|
||||||
Margin="4"
|
|
||||||
HorizontalAlignment="Right"
|
|
||||||
VerticalAlignment="Top"
|
|
||||||
MaxBoxVisibility="Visible" />
|
|
||||||
|
|
||||||
<Border
|
<userctrls:UcWindowBoxes
|
||||||
x:Name="borderMessage"
|
x:Name="ucWindowBox"
|
||||||
Grid.Row="1"
|
Grid.Column="4"
|
||||||
Width="auto"
|
Margin="4"
|
||||||
Height="auto"
|
HorizontalAlignment="Right"
|
||||||
MinWidth="120"
|
VerticalAlignment="Top"
|
||||||
MinHeight="2"
|
MaxBoxVisibility="Visible" />
|
||||||
MaxWidth="1200"
|
</Grid>
|
||||||
Margin="10,50"
|
<Grid
|
||||||
HorizontalAlignment="Center"
|
x:Name="gridContainer"
|
||||||
VerticalAlignment="Top"
|
Grid.Row="1"
|
||||||
Panel.ZIndex="1000000"
|
Margin="2,0,2,2"
|
||||||
Background="White"
|
Background="White">
|
||||||
BorderBrush="{StaticResource pageColorBrush}"
|
<Grid.ColumnDefinitions>
|
||||||
BorderThickness="1"
|
<ColumnDefinition Width="auto" />
|
||||||
CornerRadius="6"
|
<ColumnDefinition Width="*" />
|
||||||
IsHitTestVisible="False"
|
</Grid.ColumnDefinitions>
|
||||||
Opacity="0">
|
<orderctrls:OrderListCtrl
|
||||||
<Border.Effect>
|
x:Name="orderListCtrl"
|
||||||
<DropShadowEffect
|
Grid.Column="1"
|
||||||
BlurRadius="40"
|
d:Visibility="Visible"
|
||||||
Opacity="0.2"
|
Visibility="Collapsed" />
|
||||||
ShadowDepth="5"
|
<Grid
|
||||||
Color="#FF98638f" />
|
x:Name="gridTbBuyerOrderReadCtrl"
|
||||||
</Border.Effect>
|
Grid.ColumnSpan="2"
|
||||||
<TextBlock
|
d:Visibility="Visible"
|
||||||
x:Name="tbMessage"
|
Background="#7F000000"
|
||||||
Margin="10"
|
MouseLeftButtonUp="gridPddBuyerOrderReadCtrl_MouseLeftButtonUp"
|
||||||
HorizontalAlignment="Center"
|
Visibility="Hidden">
|
||||||
VerticalAlignment="Center"
|
<Border
|
||||||
Text="这里是默认提示信息"
|
Height="auto"
|
||||||
TextWrapping="Wrap" />
|
Margin="0,50,0,0"
|
||||||
</Border>
|
HorizontalAlignment="Right"
|
||||||
<!--<Image x:Name="imageBig" HorizontalAlignment="Left" Height="800" Width="800" VerticalAlignment="Center" Grid.Row="1" Margin="200,0,0,0"/>-->
|
Background="White"
|
||||||
</Grid>
|
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>
|
||||||
|
</Border>
|
||||||
|
</Grid>
|
||||||
|
<buyerctrls:PDDBuyerSelectCtrl
|
||||||
|
x:Name="pddBuyerSelectCtrl"
|
||||||
|
Grid.Column="1"
|
||||||
|
Margin="8"
|
||||||
|
HorizontalAlignment="Right"
|
||||||
|
VerticalAlignment="Top"
|
||||||
|
d:Visibility="Visible"
|
||||||
|
Visibility="Collapsed" />
|
||||||
|
<Grid
|
||||||
|
x:Name="gridUser"
|
||||||
|
Grid.ColumnSpan="2"
|
||||||
|
Background="#7F000000"
|
||||||
|
Visibility="Hidden">
|
||||||
|
<Border
|
||||||
|
Width="500"
|
||||||
|
Height="600"
|
||||||
|
Background="White"
|
||||||
|
CornerRadius="4">
|
||||||
|
<shopctrls:ShopListCtrl
|
||||||
|
x:Name="shopListCtrl"
|
||||||
|
Grid.ColumnSpan="2"
|
||||||
|
Margin="2"
|
||||||
|
Visibility="{Binding ElementName=gridUser, Mode=TwoWay, Path=Visibility}" />
|
||||||
|
</Border>
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
|
||||||
|
<Border
|
||||||
|
x:Name="borderMessage"
|
||||||
|
Grid.Row="1"
|
||||||
|
Width="auto"
|
||||||
|
Height="auto"
|
||||||
|
MinWidth="120"
|
||||||
|
MinHeight="2"
|
||||||
|
MaxWidth="1200"
|
||||||
|
Margin="10,50"
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Top"
|
||||||
|
Panel.ZIndex="1000000"
|
||||||
|
Background="White"
|
||||||
|
BorderBrush="{StaticResource pageColorBrush}"
|
||||||
|
BorderThickness="1"
|
||||||
|
CornerRadius="6"
|
||||||
|
IsHitTestVisible="False"
|
||||||
|
Opacity="0">
|
||||||
|
<Border.Effect>
|
||||||
|
<DropShadowEffect
|
||||||
|
BlurRadius="40"
|
||||||
|
Opacity="0.2"
|
||||||
|
ShadowDepth="5"
|
||||||
|
Color="#FF98638f" />
|
||||||
|
</Border.Effect>
|
||||||
|
<TextBlock
|
||||||
|
x:Name="tbMessage"
|
||||||
|
Margin="10"
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Text="这里是默认提示信息"
|
||||||
|
TextWrapping="Wrap" />
|
||||||
|
</Border>
|
||||||
|
<!--<Image x:Name="imageBig" HorizontalAlignment="Left" Height="800" Width="800" VerticalAlignment="Center" Grid.Row="1" Margin="200,0,0,0"/>-->
|
||||||
|
</Grid>
|
||||||
</basewindows:BaseWindow>
|
</basewindows:BaseWindow>
|
||||||
+609
-312
@@ -1,6 +1,7 @@
|
|||||||
using _29WxOrderWpf.BaseWindows;
|
using _29WxOrderWpf.BaseWindows;
|
||||||
using _29WxOrderWpf.Ctrls.BuyerCtrls;
|
using _29WxOrderWpf.Ctrls.BuyerCtrls;
|
||||||
using _29WxOrderWpf.Ctrls.OrderCtrls;
|
using _29WxOrderWpf.Ctrls.OrderCtrls;
|
||||||
|
using _29WxOrderWpf.Ctrls.Settings;
|
||||||
using _29WxOrderWpf.Windows.LoginWindows;
|
using _29WxOrderWpf.Windows.LoginWindows;
|
||||||
using AllBase;
|
using AllBase;
|
||||||
using AllBase.DouYinModel.Result;
|
using AllBase.DouYinModel.Result;
|
||||||
@@ -13,6 +14,9 @@ using CefSharp;
|
|||||||
using NaiBa.Util;
|
using NaiBa.Util;
|
||||||
using NaiBa.Util.Extension;
|
using NaiBa.Util.Extension;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
|
using OrderSupportTicket.Models;
|
||||||
|
using OrderSupportTicket.Services;
|
||||||
|
using OrderSupportTicket.Views;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@@ -40,245 +44,262 @@ using System.Xml.Linq;
|
|||||||
using Work;
|
using Work;
|
||||||
using Work._29Tools.BLL;
|
using Work._29Tools.BLL;
|
||||||
using Work._29Tools.Forms.UserForms;
|
using Work._29Tools.Forms.UserForms;
|
||||||
|
using WxOrder.Framework.Commons;
|
||||||
|
using WxOrder.Framework.Commons.Dialogs;
|
||||||
|
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
|
||||||
|
using static System.Windows.Forms.VisualStyles.VisualStyleElement.StartPanel;
|
||||||
|
|
||||||
namespace _29WxOrderWpf
|
namespace _29WxOrderWpf
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// MainWindow.xaml 的交互逻辑
|
/// MainWindow.xaml 的交互逻辑
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class MainWindow : BaseWindow, INotifyPropertyChanged
|
public partial class MainWindow : BaseWindow, INotifyPropertyChanged
|
||||||
{
|
{
|
||||||
public static MainWindow Instance { get; private set; }
|
public static MainWindow Instance { get; private set; }
|
||||||
|
|
||||||
public event PropertyChangedEventHandler PropertyChanged;
|
private readonly TicketRealtimeMonitor _ticketMonitor = TicketRealtimeMonitor.Current;
|
||||||
public string Balance { get { return "快递余额:" + BaseClass.Balance.ToString("0.00"); } set { OnPropertyChanged("Balance"); } }
|
private readonly WorkOrderUnreadService _workOrderUnreadService = new WorkOrderUnreadService();
|
||||||
|
private TicketClientOptions _ticketOptions;
|
||||||
|
private OrderSupportTicketView _orderSupportView;
|
||||||
|
|
||||||
public MainWindow()
|
public event PropertyChangedEventHandler PropertyChanged;
|
||||||
{
|
public string Balance { get { return "快递余额:" + BaseClass.Balance.ToString("0.00"); } set { OnPropertyChanged("Balance"); } }
|
||||||
InitializeComponent();
|
|
||||||
this.DataContext = this;
|
|
||||||
Instance = this;
|
|
||||||
|
|
||||||
gridUser.Visibility = Visibility.Collapsed;
|
public MainWindow()
|
||||||
}
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
this.DataContext = this;
|
||||||
|
Instance = this;
|
||||||
|
|
||||||
private void Window_Loaded(object sender, RoutedEventArgs e)
|
gridUser.Visibility = Visibility.Collapsed;
|
||||||
{
|
|
||||||
GlobalConfig.Dispatcher = this.Dispatcher;
|
|
||||||
lblDebug.Visibility = Visibility.Collapsed;
|
|
||||||
|
|
||||||
ucWindowBox.SetWindowMax();
|
_ticketMonitor.NewMessageReceived += OnTicketNewMessageReceived;
|
||||||
this.Title = BaseClass.ToolName;
|
_ticketMonitor.UnreadCountChanged += OnTicketUnreadCountChanged;
|
||||||
|
Closed += MainWindow_Closed;
|
||||||
|
}
|
||||||
|
|
||||||
new Thread(AutoAntiGrabbingMechanism).Start(); // 反抓包
|
private void Window_Loaded(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
GlobalConfig.Dispatcher = this.Dispatcher;
|
||||||
|
lblDebug.Visibility = Visibility.Collapsed;
|
||||||
|
|
||||||
#region 弹出登录窗口
|
ucWindowBox.SetWindowMax();
|
||||||
LoginWindow loginWindow = new LoginWindow(App.args);
|
this.Title = BaseClass.ToolName;
|
||||||
loginWindow.Owner = this;
|
|
||||||
loginWindow.ShowDialog();
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
if (loginWindow.IsLogin)
|
new Thread(AutoAntiGrabbingMechanism).Start(); // 反抓包
|
||||||
{
|
|
||||||
lblVersion.Content = BaseClass.ToolName + " V" + BaseClass.Varsion + " - " + BaseClass.NickName;
|
|
||||||
|
|
||||||
//shopListCtrl.Visibility = Visibility.Visible;
|
#region 弹出登录窗口
|
||||||
orderListCtrl.Visibility = Visibility.Visible;
|
LoginWindow loginWindow = new LoginWindow(App.args);
|
||||||
pddBuyerOrderReadCtrl.Visibility = Visibility.Visible;
|
loginWindow.Owner = this;
|
||||||
pddBuyerSelectCtrl.Visibility = Visibility.Visible;
|
loginWindow.ShowDialog();
|
||||||
Task.Run(() =>
|
#endregion
|
||||||
{
|
|
||||||
GetServerShop();
|
|
||||||
});
|
|
||||||
Task.Run(() =>
|
|
||||||
{
|
|
||||||
GetPddBuyer();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
protected virtual void OnPropertyChanged(string propertyName)
|
|
||||||
{
|
|
||||||
if (this.PropertyChanged != null)//有改变
|
|
||||||
this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
|
|
||||||
}
|
|
||||||
|
|
||||||
#region 反抓包功能
|
if (loginWindow.IsLogin)
|
||||||
private void AutoAntiGrabbingMechanism()
|
{
|
||||||
{
|
lblVersion.Content = BaseClass.ToolName + " V" + BaseClass.Varsion + " - " + BaseClass.NickName;
|
||||||
while (true)
|
|
||||||
{
|
//shopListCtrl.Visibility = Visibility.Visible;
|
||||||
|
orderListCtrl.Visibility = Visibility.Visible;
|
||||||
|
pddBuyerOrderReadCtrl.Visibility = Visibility.Visible;
|
||||||
|
tbBuyerOrderReadCtrl.Visibility = Visibility.Visible;
|
||||||
|
pddBuyerSelectCtrl.Visibility = Visibility.Visible;
|
||||||
|
Task.Run(() =>
|
||||||
|
{
|
||||||
|
GetServerShop();
|
||||||
|
StartTicketRealtimeMonitor();//启动工单监控
|
||||||
|
GetShopSupplier(GlobalConfig.ShopLoginList.ToList());
|
||||||
|
});
|
||||||
|
Task.Run(() =>
|
||||||
|
{
|
||||||
|
GetPddBuyer();
|
||||||
|
GetTaobaoBuyer();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
protected virtual void OnPropertyChanged(string propertyName)
|
||||||
|
{
|
||||||
|
if (this.PropertyChanged != null)//有改变
|
||||||
|
this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
|
||||||
|
}
|
||||||
|
|
||||||
|
#region 反抓包功能
|
||||||
|
private void AutoAntiGrabbingMechanism()
|
||||||
|
{
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
#else
|
#else
|
||||||
AntiGrabbingMechanism();
|
AntiGrabbingMechanism();
|
||||||
#endif
|
#endif
|
||||||
try { Thread.Sleep(3000); } catch { }
|
try { Thread.Sleep(3000); } catch { }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[DllImport("kernel32.dll", SetLastError = true, CallingConvention = CallingConvention.Winapi)]
|
[DllImport("kernel32.dll", SetLastError = true, CallingConvention = CallingConvention.Winapi)]
|
||||||
[return: MarshalAs(UnmanagedType.Bool)]
|
[return: MarshalAs(UnmanagedType.Bool)]
|
||||||
internal static extern bool IsWow64Process([In] IntPtr process, [Out] out bool wow64Process);
|
internal static extern bool IsWow64Process([In] IntPtr process, [Out] out bool wow64Process);
|
||||||
private List<string> _AntiProcesses = "WINRAR,WIRESHARK,FIDDLER,HTTPDEBUGGERPRO,IEHTTPANALYZER,CHARLES,HTTPWATCH,SMARTSNIFF,MINISNIFFER,PROXIFIER,HTTP ANALYZER,SNIFFER,WSOCKEXPERT,IPANALYSE,ANALYZER,HTTP ANALYZER STAND-ALONE EDITION".Split(',').ToList();
|
private List<string> _AntiProcesses = "WINRAR,WIRESHARK,FIDDLER,HTTPDEBUGGERPRO,IEHTTPANALYZER,CHARLES,HTTPWATCH,SMARTSNIFF,MINISNIFFER,PROXIFIER,HTTP ANALYZER,SNIFFER,WSOCKEXPERT,IPANALYSE,ANALYZER,HTTP ANALYZER STAND-ALONE EDITION".Split(',').ToList();
|
||||||
private void AntiGrabbingMechanism()
|
private void AntiGrabbingMechanism()
|
||||||
{
|
{
|
||||||
//Gate 1 - Anti Proxy
|
//Gate 1 - Anti Proxy
|
||||||
if (IsUseSystemProxy())
|
if (IsUseSystemProxy())
|
||||||
{
|
{
|
||||||
LockUserAndKillProcess();
|
LockUserAndKillProcess();
|
||||||
}
|
}
|
||||||
|
|
||||||
//Gate 2 - Anti Special Processes
|
//Gate 2 - Anti Special Processes
|
||||||
System.Diagnostics.Process[] processList = System.Diagnostics.Process.GetProcesses();
|
System.Diagnostics.Process[] processList = System.Diagnostics.Process.GetProcesses();
|
||||||
foreach (System.Diagnostics.Process process in processList)
|
foreach (System.Diagnostics.Process process in processList)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (_AntiProcesses.Contains(process.ProcessName.ToUpper()))
|
if (_AntiProcesses.Contains(process.ProcessName.ToUpper()))
|
||||||
{
|
{
|
||||||
process.Kill();
|
process.Kill();
|
||||||
LockUserAndKillProcess();
|
LockUserAndKillProcess();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (process.MainWindowTitle.Contains("正在捕获"))
|
if (process.MainWindowTitle.Contains("正在捕获"))
|
||||||
{
|
{
|
||||||
process.Kill();
|
process.Kill();
|
||||||
LockUserAndKillProcess();
|
LockUserAndKillProcess();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!IsWin23App(process))
|
if (!IsWin23App(process))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (process.MainModule?.FileVersionInfo.FileDescription != null)
|
if (process.MainModule?.FileVersionInfo.FileDescription != null)
|
||||||
{
|
{
|
||||||
foreach (string antiProcess in _AntiProcesses)
|
foreach (string antiProcess in _AntiProcesses)
|
||||||
{
|
{
|
||||||
if (process.MainModule.FileVersionInfo.FileDescription.ToUpper().Contains(antiProcess))
|
if (process.MainModule.FileVersionInfo.FileDescription.ToUpper().Contains(antiProcess))
|
||||||
{
|
{
|
||||||
process.Kill();
|
process.Kill();
|
||||||
LockUserAndKillProcess();
|
LockUserAndKillProcess();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void LockUserAndKillProcess()
|
private void LockUserAndKillProcess()
|
||||||
{
|
{
|
||||||
string url = BaseClass.BuildObjString("user&act=add_user_lock");
|
string url = BaseClass.BuildObjString("user&act=add_user_lock");
|
||||||
string data = UserLogin.GetSignaturex("", "");
|
string data = UserLogin.GetSignaturex("", "");
|
||||||
string html = GetHtml.PostUtf8(url, data);
|
string html = GetHtml.PostUtf8(url, data);
|
||||||
Process.GetCurrentProcess().Kill();
|
Process.GetCurrentProcess().Kill();
|
||||||
}
|
}
|
||||||
public static bool IsUseSystemProxy()
|
public static bool IsUseSystemProxy()
|
||||||
{
|
{
|
||||||
BindingFlags bindingAttr = BindingFlags.Instance | BindingFlags.NonPublic;
|
BindingFlags bindingAttr = BindingFlags.Instance | BindingFlags.NonPublic;
|
||||||
IWebProxy systemWebProxy = WebRequest.GetSystemWebProxy();
|
IWebProxy systemWebProxy = WebRequest.GetSystemWebProxy();
|
||||||
FieldInfo field1 = systemWebProxy.GetType().GetField("webProxy", bindingAttr);
|
FieldInfo field1 = systemWebProxy.GetType().GetField("webProxy", bindingAttr);
|
||||||
if (field1 != (FieldInfo)null)
|
if (field1 != (FieldInfo)null)
|
||||||
{
|
{
|
||||||
WebProxy webProxy = field1.GetValue((object)systemWebProxy) as WebProxy;
|
WebProxy webProxy = field1.GetValue((object)systemWebProxy) as WebProxy;
|
||||||
FieldInfo field2 = webProxy.GetType().GetField("_ProxyHostAddresses", bindingAttr);
|
FieldInfo field2 = webProxy.GetType().GetField("_ProxyHostAddresses", bindingAttr);
|
||||||
if (field2 != (FieldInfo)null)
|
if (field2 != (FieldInfo)null)
|
||||||
{
|
{
|
||||||
Hashtable hashtable = field2.GetValue((object)webProxy) as Hashtable;
|
Hashtable hashtable = field2.GetValue((object)webProxy) as Hashtable;
|
||||||
if (hashtable != null && hashtable.Count > 0)
|
if (hashtable != null && hashtable.Count > 0)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool IsWin23App(Process process)
|
public bool IsWin23App(Process process)
|
||||||
{
|
{
|
||||||
if (Environment.Is64BitOperatingSystem)
|
if (Environment.Is64BitOperatingSystem)
|
||||||
{
|
{
|
||||||
IntPtr processHandle;
|
IntPtr processHandle;
|
||||||
bool retVal;
|
bool retVal;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
processHandle = Process.GetProcessById(process.Id).Handle;
|
processHandle = Process.GetProcessById(process.Id).Handle;
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return IsWow64Process(processHandle, out retVal) && retVal;
|
return IsWow64Process(processHandle, out retVal) && retVal;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
private void BaseWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e)
|
private void BaseWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e)
|
||||||
{
|
{
|
||||||
if (BaseMsgWindow.ShowConfirm("是否关闭软件?", "退出微信小店订单管理").DialogResult == true)
|
if (BaseMsgWindow.ShowConfirm("是否关闭软件?", "退出微信小店订单管理").DialogResult == true)
|
||||||
Process.GetCurrentProcess().Kill();
|
Process.GetCurrentProcess().Kill();
|
||||||
else
|
else
|
||||||
e.Cancel = true;
|
e.Cancel = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#region 读取微信店铺
|
#region 读取微信店铺
|
||||||
public bool isReadShop { get; set; } = false;
|
public bool isReadShop { get; set; } = false;
|
||||||
public bool hasReadShop { get; set; } = false;
|
public bool hasReadShop { get; set; } = false;
|
||||||
public void GetServerShop()
|
public void GetServerShop()
|
||||||
{
|
{
|
||||||
if (isReadShop)
|
if (isReadShop)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var tList = new ConcurrentList<Task>();
|
var tList = new ConcurrentList<Task>();
|
||||||
List<ShopLoginInfo> list = new List<ShopLoginInfo>();
|
List<ShopLoginInfo> list = new List<ShopLoginInfo>();
|
||||||
Dispatcher.Invoke(new Action(() =>
|
Dispatcher.Invoke(new Action(() =>
|
||||||
{
|
{
|
||||||
}));
|
}));
|
||||||
isReadShop = true;
|
isReadShop = true;
|
||||||
int page = 0;
|
int page = 0;
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
page++;
|
page++;
|
||||||
var url = BaseClass.Build29WxObjString("shop/get_shop_list");
|
var url = BaseClass.Build29WxObjString("shop/get_shop_list");
|
||||||
var data = UserLogin.GetSignaturex() + "&page=" + page;
|
var data = UserLogin.GetSignaturex() + "&page=" + page;
|
||||||
data += "&is_get_erp_shop_id=true";
|
data += "&is_get_erp_shop_id=true";
|
||||||
var html = GetHtml.PostUtf8(url, data);
|
var html = GetHtml.PostUtf8(url, data);
|
||||||
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
||||||
html = GetHtml.PostUtf8(url, data);
|
html = GetHtml.PostUtf8(url, data);
|
||||||
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
||||||
html = GetHtml.PostUtf8(url, data);
|
html = GetHtml.PostUtf8(url, data);
|
||||||
if (string.IsNullOrEmpty(html)
|
if (string.IsNullOrEmpty(html)
|
||||||
|| !html.Contains("shop_id") || !html.Contains("shop_account") || !html.Contains("login_pass"))
|
|| !html.Contains("shop_id") || !html.Contains("shop_account") || !html.Contains("login_pass"))
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
var jArr = JObject.Parse(html)["data"];
|
var jArr = JObject.Parse(html)["data"];
|
||||||
if (jArr.Count() == 0)
|
if (jArr.Count() == 0)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
foreach (JObject jObj in jArr)
|
foreach (JObject jObj in jArr)
|
||||||
{
|
{
|
||||||
var shop = ShopBLL.DeserializationShop(jObj);
|
var shop = ShopBLL.DeserializationShop(jObj);
|
||||||
|
|
||||||
var shopExist = list.LastOrDefault(l => l.ShopId == shop.ShopId);
|
var shopExist = list.LastOrDefault(l => l.ShopId == shop.ShopId);
|
||||||
while (shopExist != null)
|
while (shopExist != null)
|
||||||
{
|
{
|
||||||
shop.Is29Supplier = shopExist.Is29Supplier;
|
shop.Is29Supplier = shopExist.Is29Supplier;
|
||||||
shop.IsSelect = shopExist.IsSelect;
|
shop.IsSelect = shopExist.IsSelect;
|
||||||
shop.IsFilter = shopExist.IsFilter;
|
shop.IsFilter = shopExist.IsFilter;
|
||||||
list.Remove(shopExist);
|
list.Remove(shopExist);
|
||||||
shopExist = list.LastOrDefault(l => l.ShopId == shop.ShopId);
|
shopExist = list.LastOrDefault(l => l.ShopId == shop.ShopId);
|
||||||
}
|
}
|
||||||
list.Add(shop);
|
list.Add(shop);
|
||||||
|
|
||||||
if (!GlobalConfig.ShopLoginList.Any(s => s.ShopId == shop.ShopId && !shop.is_point_shop_expire))
|
if (!GlobalConfig.ShopLoginList.Any(s => s.ShopId == shop.ShopId && !shop.is_point_shop_expire))
|
||||||
{
|
{
|
||||||
Dispatcher.Invoke(new Action(() =>
|
Dispatcher.Invoke(new Action(() =>
|
||||||
{
|
{
|
||||||
GlobalConfig.ShopLoginList.Add(shop);
|
GlobalConfig.ShopLoginList.Add(shop);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
Task.Run(() =>
|
Task.Run(() =>
|
||||||
{
|
{
|
||||||
@@ -327,129 +348,223 @@ namespace _29WxOrderWpf
|
|||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Dispatcher.Invoke(new Action(() =>
|
Dispatcher.Invoke(new Action(() =>
|
||||||
{
|
{
|
||||||
foreach (var shop in GlobalConfig.ShopLoginList.Where(s => !list.Any(ss => ss.ShopId == s.ShopId)).ToList())
|
foreach (var shop in GlobalConfig.ShopLoginList.Where(s => !list.Any(ss => ss.ShopId == s.ShopId)).ToList())
|
||||||
{
|
{
|
||||||
GlobalConfig.ShopLoginList.Remove(shop);
|
GlobalConfig.ShopLoginList.Remove(shop);
|
||||||
}
|
}
|
||||||
foreach (var shop in GlobalConfig.ShopLoginList.Where(s => s.is_point_shop_expire).ToList())
|
foreach (var shop in GlobalConfig.ShopLoginList.Where(s => s.is_point_shop_expire).ToList())
|
||||||
{
|
{
|
||||||
GlobalConfig.ShopLoginList.Remove(shop);
|
GlobalConfig.ShopLoginList.Remove(shop);
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
isReadShop = false;
|
isReadShop = false;
|
||||||
hasReadShop = true;
|
hasReadShop = true;
|
||||||
|
|
||||||
while (tList.Where(ta => !ta.IsFaulted && !ta.IsCompleted).Count() >= 1)
|
while (tList.Where(ta => !ta.IsFaulted && !ta.IsCompleted).Count() >= 1)
|
||||||
{
|
{
|
||||||
tList.RemoveAll(ta => ta.IsFaulted || ta.IsCompleted || ta.IsCanceled); Thread.Sleep(100);
|
tList.RemoveAll(ta => ta.IsFaulted || ta.IsCompleted || ta.IsCanceled); Thread.Sleep(100);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region 读取拼多多买手号
|
public void GetShopSupplier(List<ShopLoginInfo> shops)
|
||||||
public bool isGetPddBuyer = false;
|
{
|
||||||
public bool hasGetPddBuyer = false;
|
// 同步单代发申请,放在拍单时候做
|
||||||
|
while (GlobalConfig.BuyConfig.IsSyncDirectBuyOrderWaybill == false)
|
||||||
|
{
|
||||||
|
Thread.Sleep(500);
|
||||||
|
}
|
||||||
|
foreach (var shop in shops)
|
||||||
|
{
|
||||||
|
var rst = new WxApiBLL().GetShopSupplier(shop);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var jArr = JsonHelper.JObjectParse(rst)["list"] as JArray;
|
||||||
|
// appid "wx7809625286c28f2f" name "百川日用";
|
||||||
|
if (jArr.Any(aa => aa["appid"].ParseToString() == "wx7809625286c28f2f" && aa["status"].ParseToInt() == 1))
|
||||||
|
//if (rst.Contains("wx7809625286c28f2f") || rst.Contains("百川日用"))
|
||||||
|
continue;
|
||||||
|
|
||||||
/// <summary>
|
rst = new WxApiBLL().SetShopSupplier(shop, "wx7809625286c28f2f", "4431685489938137094");
|
||||||
/// 读取拼多多买手
|
if (!rst.Contains("\"errcode\":0"))
|
||||||
/// </summary>
|
{
|
||||||
public void GetPddBuyer()
|
//return;
|
||||||
{
|
}
|
||||||
if (isGetPddBuyer)
|
}
|
||||||
return;
|
catch
|
||||||
|
{ }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
isGetPddBuyer = true;
|
#region 读取拼多多买手号
|
||||||
//var ids = dgvBuyer.Rows.Cast<DataGridViewRow>().Where(r => r.Cells["colSelect"].Value.ParseToBool() == true).Select(s => s.Cells["colBuyerId"].Value.ParseToString()).ToList();
|
public bool isGetPddBuyer = false;
|
||||||
//Invoke(new Action(() => { pbLoading.Visible = true; }));
|
public bool hasGetPddBuyer = false;
|
||||||
|
|
||||||
try
|
/// <summary>
|
||||||
{
|
/// 读取拼多多买手
|
||||||
var url = BaseClass.Build29PDDObjString("user/get_buyer");
|
/// </summary>
|
||||||
var data = UserLogin.GetSignaturex();
|
public void GetPddBuyer()
|
||||||
data += "&page_size=200";
|
{
|
||||||
|
if (isGetPddBuyer)
|
||||||
|
return;
|
||||||
|
|
||||||
var result = GetHtml.PostUtf8(url, data);
|
isGetPddBuyer = true;
|
||||||
if (string.IsNullOrEmpty(result) || !result.Contains("\"code\":200"))
|
//var ids = dgvBuyer.Rows.Cast<DataGridViewRow>().Where(r => r.Cells["colSelect"].Value.ParseToBool() == true).Select(s => s.Cells["colBuyerId"].Value.ParseToString()).ToList();
|
||||||
result = GetHtml.PostUtf8(url, data);
|
//Invoke(new Action(() => { pbLoading.Visible = true; }));
|
||||||
|
|
||||||
if (result.Contains("\"code\":200"))
|
try
|
||||||
{
|
{
|
||||||
List<BuyerLoginInfo> loginInfoLst = JsonHelper.DeserializeJsonToList<BuyerLoginInfo>(JsonHelper.JObjectParse(result)["data"].ParseToString());
|
var url = BaseClass.Build29PDDObjString("user/get_buyer");
|
||||||
|
var data = UserLogin.GetSignaturex();
|
||||||
foreach (var buyer in GlobalConfig.PDDBuyerLoginList.Where(bu => !loginInfoLst.Any(b => b.buyer_id == bu.buyer_id)).ToList())
|
data += "&page_size=200";
|
||||||
{
|
|
||||||
Dispatcher.Invoke(new Action(() => { GlobalConfig.PDDBuyerLoginList.Remove(buyer); }));
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach (var b in loginInfoLst)
|
var result = GetHtml.PostUtf8(url, data);
|
||||||
{
|
if (string.IsNullOrEmpty(result) || !result.Contains("\"code\":200"))
|
||||||
Dispatcher.Invoke(new Action(() =>
|
result = GetHtml.PostUtf8(url, data);
|
||||||
{
|
|
||||||
var buyer = GlobalConfig.PDDBuyerLoginList.FirstOrDefault(bu => bu.buyer_id == b.buyer_id);
|
|
||||||
if (buyer == null)
|
|
||||||
GlobalConfig.PDDBuyerLoginList.Add(b);
|
|
||||||
else
|
|
||||||
{
|
|
||||||
buyer.add_time = b.add_time;
|
|
||||||
buyer.buyer_id = b.buyer_id;
|
|
||||||
buyer.buyer_name = b.buyer_name;
|
|
||||||
buyer.buyer_nick = b.buyer_nick;
|
|
||||||
buyer.cookie = b.cookie;
|
|
||||||
buyer.mdy_time = b.mdy_time;
|
|
||||||
buyer.notes = b.notes;
|
|
||||||
buyer.status = b.status;
|
|
||||||
buyer.user_name = b.user_name;
|
|
||||||
}
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
//Invoke(new Action(() =>
|
if (result.Contains("\"code\":200"))
|
||||||
//{
|
{
|
||||||
//dgvBuyer.Rows.Clear();
|
List<BuyerLoginInfo> loginInfoLst = JsonHelper.DeserializeJsonToList<BuyerLoginInfo>(JsonHelper.JObjectParse(result)["data"].ParseToString());
|
||||||
//cmbBuyer.Items.Clear();
|
|
||||||
//}));
|
|
||||||
|
|
||||||
foreach (var buyer in GlobalConfig.PDDBuyerLoginList)
|
foreach (var buyer in GlobalConfig.PDDBuyerLoginList.Where(bu => !loginInfoLst.Any(b => b.buyer_id == bu.buyer_id)).ToList())
|
||||||
{
|
{
|
||||||
//Invoke(new Action(() =>
|
Dispatcher.Invoke(new Action(() => { GlobalConfig.PDDBuyerLoginList.Remove(buyer); }));
|
||||||
//{
|
}
|
||||||
//BindBuyer(buyer, "", ids);
|
|
||||||
//cmbBuyer.Items.Add(buyer.buyer_nick);
|
|
||||||
//}));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
//Invoke(new Action(() =>
|
foreach (var b in loginInfoLst)
|
||||||
//{
|
{
|
||||||
// pbLoading.Visible = false;
|
Dispatcher.Invoke(new Action(() =>
|
||||||
//}));
|
{
|
||||||
|
var buyer = GlobalConfig.PDDBuyerLoginList.FirstOrDefault(bu => bu.buyer_id == b.buyer_id);
|
||||||
|
if (buyer == null)
|
||||||
|
GlobalConfig.PDDBuyerLoginList.Add(b);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
buyer.add_time = b.add_time;
|
||||||
|
buyer.buyer_id = b.buyer_id;
|
||||||
|
buyer.buyer_name = b.buyer_name;
|
||||||
|
buyer.buyer_nick = b.buyer_nick;
|
||||||
|
buyer.cookie = b.cookie;
|
||||||
|
buyer.mdy_time = b.mdy_time;
|
||||||
|
buyer.notes = b.notes;
|
||||||
|
buyer.status = b.status;
|
||||||
|
buyer.user_name = b.user_name;
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
isGetPddBuyer = false;
|
//Invoke(new Action(() =>
|
||||||
hasGetPddBuyer = true;
|
//{
|
||||||
}
|
//dgvBuyer.Rows.Clear();
|
||||||
#endregion
|
//cmbBuyer.Items.Clear();
|
||||||
|
//}));
|
||||||
|
|
||||||
private void lblBalance_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
|
foreach (var buyer in GlobalConfig.PDDBuyerLoginList)
|
||||||
{
|
{
|
||||||
WXGetBalanceQrCodeForm balanceQrCodeForm = new WXGetBalanceQrCodeForm(StartUp.UpdateBalance);
|
//Invoke(new Action(() =>
|
||||||
balanceQrCodeForm.ShowDialog();
|
//{
|
||||||
}
|
//BindBuyer(buyer, "", ids);
|
||||||
|
//cmbBuyer.Items.Add(buyer.buyer_nick);
|
||||||
|
//}));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
private void gridPddBuyerOrderReadCtrl_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
|
//Invoke(new Action(() =>
|
||||||
{
|
//{
|
||||||
//if (Panel.GetZIndex(MainWindow.Instance.gridPddBuyerOrderReadCtrl) < 1)
|
// pbLoading.Visible = false;
|
||||||
// Panel.SetZIndex(MainWindow.Instance.gridPddBuyerOrderReadCtrl, 1);
|
//}));
|
||||||
//else
|
|
||||||
// Panel.SetZIndex(MainWindow.Instance.gridPddBuyerOrderReadCtrl, -1);
|
isGetPddBuyer = false;
|
||||||
}
|
hasGetPddBuyer = true;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 读取拼多多买手号
|
||||||
|
public bool isGetTaobaoBuyer = false;
|
||||||
|
public bool hasGetTaobaoBuyer = false;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 读取拼多多买手
|
||||||
|
/// </summary>
|
||||||
|
public void GetTaobaoBuyer()
|
||||||
|
{
|
||||||
|
if (isGetTaobaoBuyer)
|
||||||
|
return;
|
||||||
|
|
||||||
|
isGetTaobaoBuyer = true;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var url = BaseClass.Build29WxObjString("user/get_taobao_buyer");
|
||||||
|
var data = UserLogin.GetSignaturex();
|
||||||
|
data += "&page_size=200";
|
||||||
|
|
||||||
|
var result = GetHtml.PostUtf8(url, data);
|
||||||
|
if (string.IsNullOrEmpty(result) || !result.Contains("\"code\":200"))
|
||||||
|
result = GetHtml.PostUtf8(url, data);
|
||||||
|
|
||||||
|
if (result.Contains("\"code\":200"))
|
||||||
|
{
|
||||||
|
List<BuyerLoginInfo> loginInfoLst = JsonHelper.DeserializeJsonToList<BuyerLoginInfo>(JsonHelper.JObjectParse(result)["data"].ParseToString());
|
||||||
|
|
||||||
|
foreach (var buyer in GlobalConfig.TaobaoBuyerLoginList.Where(bu => !loginInfoLst.Any(b => b.buyer_id == bu.buyer_id)).ToList())
|
||||||
|
{
|
||||||
|
Dispatcher.Invoke(new Action(() => { GlobalConfig.TaobaoBuyerLoginList.Remove(buyer); }));
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (var b in loginInfoLst)
|
||||||
|
{
|
||||||
|
Dispatcher.Invoke(new Action(() =>
|
||||||
|
{
|
||||||
|
var buyer = GlobalConfig.TaobaoBuyerLoginList.FirstOrDefault(bu => bu.buyer_id == b.buyer_id);
|
||||||
|
if (buyer == null)
|
||||||
|
GlobalConfig.TaobaoBuyerLoginList.Add(b);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
buyer.add_time = b.add_time;
|
||||||
|
buyer.buyer_id = b.buyer_id;
|
||||||
|
buyer.buyer_name = b.buyer_name;
|
||||||
|
buyer.buyer_nick = b.buyer_nick;
|
||||||
|
buyer.cookie = b.cookie;
|
||||||
|
buyer.mdy_time = b.mdy_time;
|
||||||
|
buyer.notes = b.notes;
|
||||||
|
buyer.status = b.status;
|
||||||
|
buyer.user_name = b.user_name;
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
isGetTaobaoBuyer = false;
|
||||||
|
hasGetTaobaoBuyer = true;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private void lblBalance_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
|
||||||
|
{
|
||||||
|
WXGetBalanceQrCodeForm balanceQrCodeForm = new WXGetBalanceQrCodeForm(StartUp.UpdateBalance);
|
||||||
|
balanceQrCodeForm.ShowDialog();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void gridPddBuyerOrderReadCtrl_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
|
||||||
|
{
|
||||||
|
//if (Panel.GetZIndex(MainWindow.Instance.gridPddBuyerOrderReadCtrl) < 1)
|
||||||
|
// Panel.SetZIndex(MainWindow.Instance.gridPddBuyerOrderReadCtrl, 1);
|
||||||
|
//else
|
||||||
|
// Panel.SetZIndex(MainWindow.Instance.gridPddBuyerOrderReadCtrl, -1);
|
||||||
|
}
|
||||||
|
|
||||||
private void gridTitle_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
|
private void gridTitle_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
|
||||||
{
|
{
|
||||||
@@ -465,5 +580,187 @@ namespace _29WxOrderWpf
|
|||||||
this.DragMove();
|
this.DragMove();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void bt_setting(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
SettingsView view = new SettingsView();
|
||||||
|
view.ShowDialog();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void bt_showOrderSupport(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
OpenOrderSupportTicket(_ticketMonitor.LatestNotification);
|
||||||
|
_ticketMonitor.MarkAllRead();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void StartTicketRealtimeMonitor()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var options = GetTicketOptions().Clone();
|
||||||
|
_ticketMonitor.Start(options);
|
||||||
|
UpdateOrderSupportBadge();
|
||||||
|
_ = LoadHistoricalTicketUnreadAsync(options);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
LogSave.Add("TicketRealtimeStartError:" + ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 启动后根据服务端工单列表和历史缓存补齐未读角标。
|
||||||
|
/// </summary>
|
||||||
|
private async Task LoadHistoricalTicketUnreadAsync(TicketClientOptions options)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var unreadByTicket = await _workOrderUnreadService
|
||||||
|
.GetUnreadByTicketAsync(options);
|
||||||
|
_ticketMonitor.MergeUnread(unreadByTicket);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
LogSave.Add("TicketUnreadLoadError:" + ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private TicketClientOptions GetTicketOptions()
|
||||||
|
{
|
||||||
|
if (_ticketOptions != null)
|
||||||
|
return _ticketOptions;
|
||||||
|
|
||||||
|
_ticketOptions = new TicketClientOptions
|
||||||
|
{
|
||||||
|
UserName = BaseClass.UserName,
|
||||||
|
AppIds = GlobalConfig.ShopLoginList.Select(a => a.ShopId).ToList(),
|
||||||
|
Orders = []
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//OrderSupportTicketView
|
||||||
|
// .CreateDefaultOptions(BaseClass.UserName)
|
||||||
|
// .Clone();
|
||||||
|
return _ticketOptions;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OpenOrderSupportTicket(TicketRealtimeNotification notification)
|
||||||
|
{
|
||||||
|
var view = EnsureOrderSupportView();
|
||||||
|
view.ViewModel.ShowHistory();
|
||||||
|
|
||||||
|
if (notification != null)
|
||||||
|
{
|
||||||
|
view.OpenTicket(
|
||||||
|
notification.AppId,
|
||||||
|
notification.WechatOrderId);
|
||||||
|
}
|
||||||
|
|
||||||
|
// DialogService 会复用同类型的已打开窗口,避免重复创建。
|
||||||
|
DialogService.ShowOrActivateWindow(view);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 从订单行打开工单页面。若左侧列表已有相同订单号的工单,直接定位到该工单;
|
||||||
|
/// 否则在同一个工单页面中进入新建工单状态。
|
||||||
|
/// </summary>
|
||||||
|
public async Task CreateOrderSupportTicketAsync(TicketOrderOption order)
|
||||||
|
{
|
||||||
|
if (order == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
var view = EnsureOrderSupportView();
|
||||||
|
await view.ViewModel.InitializeAsync();
|
||||||
|
|
||||||
|
var existing = view.ViewModel.FindTicketByOrderId(order.OrderId);
|
||||||
|
if (existing != null)
|
||||||
|
{
|
||||||
|
view.ViewModel.ApplyOrderInfo(order);
|
||||||
|
view.OpenTicket(existing.AppId, existing.WechatOrderId);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
view.OpenNewTicket(order);
|
||||||
|
}
|
||||||
|
|
||||||
|
DialogService.ShowOrActivateWindow(view);
|
||||||
|
}
|
||||||
|
|
||||||
|
private OrderSupportTicketView EnsureOrderSupportView()
|
||||||
|
{
|
||||||
|
if (_orderSupportView == null)
|
||||||
|
{
|
||||||
|
_orderSupportView = new OrderSupportTicketView(
|
||||||
|
new TicketService(
|
||||||
|
new TicketApiService(),
|
||||||
|
_ticketMonitor.RealtimeService,
|
||||||
|
ownsRealtime: false),
|
||||||
|
GetTicketOptions().Clone());
|
||||||
|
}
|
||||||
|
|
||||||
|
return _orderSupportView;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnTicketNewMessageReceived(
|
||||||
|
object sender,
|
||||||
|
TicketInboxMessageEventArgs e)
|
||||||
|
{
|
||||||
|
if (!Dispatcher.CheckAccess())
|
||||||
|
{
|
||||||
|
Dispatcher.BeginInvoke(new Action(
|
||||||
|
() => OnTicketNewMessageReceived(sender, e)));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var notification = e?.Notification;
|
||||||
|
if (notification == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
UpdateOrderSupportBadge();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnTicketUnreadCountChanged(
|
||||||
|
object sender,
|
||||||
|
TicketUnreadCountChangedEventArgs e)
|
||||||
|
{
|
||||||
|
if (!Dispatcher.CheckAccess())
|
||||||
|
{
|
||||||
|
Dispatcher.BeginInvoke(new Action(
|
||||||
|
() => OnTicketUnreadCountChanged(sender, e)));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
UpdateOrderSupportBadge(e?.UnreadCount ?? 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void UpdateOrderSupportBadge()
|
||||||
|
{
|
||||||
|
UpdateOrderSupportBadge(_ticketMonitor.UnreadCount);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void UpdateOrderSupportBadge(int unreadCount)
|
||||||
|
{
|
||||||
|
if (borderOrderSupportUnread == null)
|
||||||
|
return;
|
||||||
|
this.Dispatcher.Invoke(() =>
|
||||||
|
{
|
||||||
|
borderOrderSupportUnread.Visibility = unreadCount > 0
|
||||||
|
? Visibility.Visible
|
||||||
|
: Visibility.Collapsed;
|
||||||
|
tbOrderSupportUnread.Text = unreadCount > 99
|
||||||
|
? "99+"
|
||||||
|
: unreadCount.ToString();
|
||||||
|
btOrderSupport.ToolTip = unreadCount > 0
|
||||||
|
? $"客户工单({unreadCount} 条未读消息)"
|
||||||
|
: "客户工单";
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void MainWindow_Closed(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
_ticketMonitor.NewMessageReceived -= OnTicketNewMessageReceived;
|
||||||
|
_ticketMonitor.UnreadCountChanged -= OnTicketUnreadCountChanged;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -20,7 +20,7 @@ namespace _29WxOrderWpf.Services;
|
|||||||
/// 礼物单服务
|
/// 礼物单服务
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class ShipGiftService: SingleInstance<ShipGiftService>
|
public class ShipGiftService : SingleInstance<ShipGiftService>
|
||||||
{
|
{
|
||||||
public enum GiftType
|
public enum GiftType
|
||||||
{
|
{
|
||||||
@@ -42,6 +42,11 @@ public class ShipGiftService: SingleInstance<ShipGiftService>
|
|||||||
{
|
{
|
||||||
giftAmount = 1.55m;
|
giftAmount = 1.55m;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (BaseClass.Setting.AutoSwitchGiftType && (item.product_price ?? 0) > 6 * 1000)
|
||||||
|
{
|
||||||
|
giftAmount = 1.6m;
|
||||||
|
}
|
||||||
decimal amount = giftAmount + BaseClass.OemGiftAmount;
|
decimal amount = giftAmount + BaseClass.OemGiftAmount;
|
||||||
|
|
||||||
|
|
||||||
@@ -78,6 +83,6 @@ public class ShipGiftService: SingleInstance<ShipGiftService>
|
|||||||
var ret = await _api.SendShipGift([orderId], (int)giftType, amount, BaseClass.OemGiftAmount);
|
var ret = await _api.SendShipGift([orderId], (int)giftType, amount, BaseClass.OemGiftAmount);
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+13
-1
@@ -1,10 +1,12 @@
|
|||||||
using AllBase;
|
using _29WxOrderWpf.ViewModels;
|
||||||
|
using AllBase;
|
||||||
using AllBase.DouYinModel.Param.ConfigManage;
|
using AllBase.DouYinModel.Param.ConfigManage;
|
||||||
using AllBase.Helper;
|
using AllBase.Helper;
|
||||||
using AllBase.Model.Config;
|
using AllBase.Model.Config;
|
||||||
using AllBase.Model.DBModel;
|
using AllBase.Model.DBModel;
|
||||||
using NaiBa.Util;
|
using NaiBa.Util;
|
||||||
using NaiBa.Util.Helper;
|
using NaiBa.Util.Helper;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@@ -26,6 +28,16 @@ namespace _29WxOrderWpf
|
|||||||
if (GlobalConfig.lstWXShopTokenInfo == null)
|
if (GlobalConfig.lstWXShopTokenInfo == null)
|
||||||
GlobalConfig.lstWXShopTokenInfo = new ConcurrentList<WXShopTokenInfo>();
|
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();
|
||||||
|
|
||||||
new WxOrder.Framework.Startup();
|
new WxOrder.Framework.Startup();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,41 +1,41 @@
|
|||||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
<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="mainColorBrush" Color="#FF98638f" />
|
||||||
<SolidColorBrush x:Key="mainColorLightBrush" Color="#f5ebff" />
|
<SolidColorBrush x:Key="mainColorLightBrush" Color="#f5ebff" />
|
||||||
<SolidColorBrush x:Key="mainColorDarkBrush" Color="#FF6b5393" />
|
<SolidColorBrush x:Key="mainColorDarkBrush" Color="#FF6b5393" />
|
||||||
<SolidColorBrush x:Key="mainForegroundColorBrush" Color="#FF666666" />
|
<SolidColorBrush x:Key="mainForegroundColorBrush" Color="#FF666666" />
|
||||||
<LinearGradientBrush x:Key="mainLinearColorBrush" StartPoint="0,0" EndPoint="1,0">
|
<LinearGradientBrush x:Key="mainLinearColorBrush" StartPoint="0,0" EndPoint="1,0">
|
||||||
<GradientStop Offset="0.0" Color="#FF98638f" />
|
<GradientStop Offset="0.0" Color="#FF98638f" />
|
||||||
<GradientStop Offset="1.0" Color="#FF6b5393" />
|
<GradientStop Offset="1.0" Color="#FF6b5393" />
|
||||||
</LinearGradientBrush>
|
</LinearGradientBrush>
|
||||||
<SolidColorBrush x:Key="pageColorBrush" Color="#FF98638f" />
|
<SolidColorBrush x:Key="pageColorBrush" Color="#FF98638f" />
|
||||||
<SolidColorBrush x:Key="pageColorLightBrush" Color="#f5ebff" />
|
<SolidColorBrush x:Key="pageColorLightBrush" Color="#f5ebff" />
|
||||||
<SolidColorBrush x:Key="pageColorDarkBrush" Color="#FF6b5393" />
|
<SolidColorBrush x:Key="pageColorDarkBrush" Color="#FF6b5393" />
|
||||||
|
|
||||||
<SolidColorBrush x:Key="ListCtrlBackColorBrush" Color="#FFFFFFFF" />
|
<SolidColorBrush x:Key="ListCtrlBackColorBrush" Color="#FFFFFFFF" />
|
||||||
<SolidColorBrush x:Key="ListHeadBackColorBrush" Color="#FFf8f8f9" />
|
<SolidColorBrush x:Key="ListHeadBackColorBrush" Color="#FFf8f8f9" />
|
||||||
<SolidColorBrush x:Key="ListHeadBorderColorBrush" Color="#FFe9e9ea" />
|
<SolidColorBrush x:Key="ListHeadBorderColorBrush" Color="#FFe9e9ea" />
|
||||||
<SolidColorBrush x:Key="ListBackColorBrush" Color="#FFFFFFFF" />
|
<SolidColorBrush x:Key="ListBackColorBrush" Color="#FFFFFFFF" />
|
||||||
<SolidColorBrush x:Key="ListRowTitleBackColorBrush" Color="#FFf5f7fa" />
|
<SolidColorBrush x:Key="ListRowTitleBackColorBrush" Color="#FFf5f7fa" />
|
||||||
<SolidColorBrush x:Key="ListRowBorderColorBrush" Color="#FFf8f8f9" />
|
<SolidColorBrush x:Key="ListRowBorderColorBrush" Color="#FFf8f8f9" />
|
||||||
<SolidColorBrush x:Key="ListRowHoverBackColorBrush" Color="#FFf5f7fa" />
|
<SolidColorBrush x:Key="ListRowHoverBackColorBrush" Color="#FFf5f7fa" />
|
||||||
|
|
||||||
<SolidColorBrush x:Key="HorizontalGridLinesBrush" Color="#FFf5f7fa" />
|
<SolidColorBrush x:Key="HorizontalGridLinesBrush" Color="#FFf5f7fa" />
|
||||||
<SolidColorBrush x:Key="VerticalGridLinesBrush" Color="#FFFFFFFF" />
|
<SolidColorBrush x:Key="VerticalGridLinesBrush" Color="#FFFFFFFF" />
|
||||||
|
|
||||||
<SolidColorBrush x:Key="PageOkBrush" Color="#FF67c23a" />
|
<SolidColorBrush x:Key="PageOkBrush" Color="#FF67c23a" />
|
||||||
<SolidColorBrush x:Key="PageOkBrush50" Color="#5067c23a" />
|
<SolidColorBrush x:Key="PageOkBrush50" Color="#5067c23a" />
|
||||||
<SolidColorBrush x:Key="PageWarningBrush" Color="#FFfa4733" />
|
<SolidColorBrush x:Key="PageWarningBrush" Color="#FFfa4733" />
|
||||||
<SolidColorBrush x:Key="PageWarningBrushCC" Color="#CCfa4733" />
|
<SolidColorBrush x:Key="PageWarningBrushCC" Color="#CCfa4733" />
|
||||||
<SolidColorBrush x:Key="PageWarningBrush80" Color="#80fa4733" />
|
<SolidColorBrush x:Key="PageWarningBrush80" Color="#80fa4733" />
|
||||||
<SolidColorBrush x:Key="PageWarningBrush50" Color="#50fa4733" />
|
<SolidColorBrush x:Key="PageWarningBrush50" Color="#50fa4733" />
|
||||||
<SolidColorBrush x:Key="PageWarningBrush20" Color="#20fa4733" />
|
<SolidColorBrush x:Key="PageWarningBrush20" Color="#20fa4733" />
|
||||||
<SolidColorBrush x:Key="PageLinkBrush" Color="#409eff" />
|
<SolidColorBrush x:Key="PageLinkBrush" Color="#409eff" />
|
||||||
|
|
||||||
|
|
||||||
<SolidColorBrush x:Key="FlagGrayBrush" Color="#ffaaaaaa" />
|
<SolidColorBrush x:Key="FlagGrayBrush" Color="#ffaaaaaa" />
|
||||||
<SolidColorBrush x:Key="FlagRedBrush" Color="#FFfa4733" />
|
<SolidColorBrush x:Key="FlagRedBrush" Color="#FFfa4733" />
|
||||||
<SolidColorBrush x:Key="FlagOrangeBrush" Color="#FFfab533" />
|
<SolidColorBrush x:Key="FlagOrangeBrush" Color="#FFfab533" />
|
||||||
<SolidColorBrush x:Key="FlagGreenBrush" Color="#FF67c23a" />
|
<SolidColorBrush x:Key="FlagGreenBrush" Color="#FF67c23a" />
|
||||||
<SolidColorBrush x:Key="FlagBlueBrush" Color="#409eff" />
|
<SolidColorBrush x:Key="FlagBlueBrush" Color="#409eff" />
|
||||||
<SolidColorBrush x:Key="FlagPurpleBrush" Color="#FFc883bf" />
|
<SolidColorBrush x:Key="FlagPurpleBrush" Color="#FFc883bf" />
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
@@ -0,0 +1,197 @@
|
|||||||
|
<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,21 +1,37 @@
|
|||||||
<UserControl x:Class="_29WxOrderWpf.UserControls.UcWaterMarkTextBox"
|
<UserControl
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
x:Class="_29WxOrderWpf.UserControls.UcWaterMarkTextBox"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:local="clr-namespace:_29WxOrderWpf.UserControls"
|
xmlns:local="clr-namespace:_29WxOrderWpf.UserControls"
|
||||||
mc:Ignorable="d"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
d:DesignHeight="28" d:DesignWidth="100">
|
d:DesignHeight="28"
|
||||||
<UserControl.Resources>
|
d:DesignWidth="100"
|
||||||
<ResourceDictionary>
|
mc:Ignorable="d">
|
||||||
<local:WaterMarkVisibilityConverter x:Key="WaterMarkVisibility"/>
|
<UserControl.Resources>
|
||||||
</ResourceDictionary>
|
<ResourceDictionary>
|
||||||
</UserControl.Resources>
|
<local:WaterMarkVisibilityConverter x:Key="WaterMarkVisibility" />
|
||||||
<Grid>
|
</ResourceDictionary>
|
||||||
<TextBox x:Name="txt" Text="{Binding Text, Mode=TwoWay}" Style="{StaticResource BaseRoundCornerTextBoxStyle}" BorderBrush="{StaticResource pageColorBrush}"
|
</UserControl.Resources>
|
||||||
BorderThickness="{Binding TextBorderThickness}"
|
<Grid>
|
||||||
HorizontalAlignment="Stretch" VerticalAlignment="Stretch" VerticalContentAlignment="Center" TextWrapping="{Binding TextWrapping}" TextChanged="txt_TextChanged"/>
|
<TextBox
|
||||||
<TextBlock x:Name="tbWaterMark" Text="{Binding WaterMark}" Margin="4,0,4,0" VerticalAlignment="Center" IsHitTestVisible="False" Foreground="DarkGray"
|
x:Name="txt"
|
||||||
Visibility="{Binding ElementName=txt,Path=Text,Converter={StaticResource WaterMarkVisibility}}"></TextBlock>
|
HorizontalAlignment="Stretch"
|
||||||
</Grid>
|
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>
|
</UserControl>
|
||||||
@@ -1,55 +1,99 @@
|
|||||||
<UserControl x:Class="_29WxOrderWpf.UserControls.UcWindowBoxes"
|
<UserControl
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
x:Class="_29WxOrderWpf.UserControls.UcWindowBoxes"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:local="clr-namespace:_29WxOrderWpf.UserControls"
|
xmlns:local="clr-namespace:_29WxOrderWpf.UserControls"
|
||||||
mc:Ignorable="d" Width="Auto" Height="Auto"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
d:DesignHeight="30" d:DesignWidth="60" Background="Transparent" Loaded="WindowBoxes_Loaded">
|
Width="Auto"
|
||||||
<Grid Background="Transparent">
|
Height="Auto"
|
||||||
<Grid.ColumnDefinitions>
|
d:DesignHeight="30"
|
||||||
<ColumnDefinition Width="Auto"></ColumnDefinition>
|
d:DesignWidth="60"
|
||||||
<ColumnDefinition Width="Auto"></ColumnDefinition>
|
Background="Transparent"
|
||||||
<ColumnDefinition Width="Auto"></ColumnDefinition>
|
Loaded="WindowBoxes_Loaded"
|
||||||
<ColumnDefinition Width="Auto"></ColumnDefinition>
|
mc:Ignorable="d">
|
||||||
</Grid.ColumnDefinitions>
|
<Grid Background="Transparent">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<!--<Border Background="{StaticResource imgBrushCloseHover}" Width="17" Height="17" Margin="4">
|
<!--<Border Background="{StaticResource imgBrushCloseHover}" Width="17" Height="17" Margin="4">
|
||||||
</Border>
|
</Border>
|
||||||
<Border Grid.Column="1" Width="17" Height="17" Margin="4">
|
<Border Grid.Column="1" Width="17" Height="17" Margin="4">
|
||||||
<Image Source="{StaticResource imgCloseHover}"/>
|
<Image Source="{StaticResource imgCloseHover}"/>
|
||||||
</Border>-->
|
</Border>-->
|
||||||
|
|
||||||
<!--不使用静态资源,在用户控件嵌套时,会发生预览错误-->
|
<!-- 不使用静态资源,在用户控件嵌套时,会发生预览错误 -->
|
||||||
<local:UcImageButton x:Name="btnMin" Grid.Column="0" Width="17" Height="17" Background="Transparent" BorderThickness="0" Margin="4"
|
<local:UcImageButton
|
||||||
ButtonImage="{StaticResource imgMin}" MouseOverButtonImage="{StaticResource imgMinHover}" MousePressButtonImage="{StaticResource imgMinHover}"/>
|
x:Name="btnMin"
|
||||||
<local:UcImageButton x:Name="btnMax" Grid.Column="1" Width="17" Height="17" Background="Transparent" BorderThickness="0" Visibility="Collapsed" Margin="4"
|
Grid.Column="0"
|
||||||
ButtonImage="{StaticResource imgMax}" MouseOverButtonImage="{StaticResource imgMaxHover}" MousePressButtonImage="{StaticResource imgMaxHover}"/>
|
Width="17"
|
||||||
<local:UcImageButton x:Name="btnNormal" Grid.Column="2" Width="17" Height="17" Background="Transparent" BorderThickness="0" Visibility="Collapsed" Margin="4"
|
Height="17"
|
||||||
ButtonImage="{StaticResource imgNormal}" MouseOverButtonImage="{StaticResource imgNormalHover}" MousePressButtonImage="{StaticResource imgNormalHover}"/>
|
Margin="4"
|
||||||
<local:UcImageButton x:Name="btnClose" Grid.Column="3" Width="17" Height="17" Background="Transparent" BorderThickness="0" Margin="4"
|
Background="Transparent"
|
||||||
ButtonImage="{StaticResource imgClose}" MouseOverButtonImage="{StaticResource imgCloseHover}" MousePressButtonImage="{StaticResource imgCloseHover}"/>
|
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"
|
<!--<local:UcImageButton x:Name="btnMin" Grid.Column="0" Width="17" Height="17" Background="Transparent" BorderThickness="0" Margin="4"
|
||||||
ButtonImage="/Resources/WindowBoxes/min.png"
|
ButtonImage="/Resources/WindowBoxes/min.png"
|
||||||
MouseOverButtonImage="/Resources/WindowBoxes/min.hover.png"
|
MouseOverButtonImage="/Resources/WindowBoxes/min.hover.png"
|
||||||
MousePressButtonImage="/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"
|
<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"
|
MouseOverButtonImage="/Resources/WindowBoxes/max.hover.png"
|
||||||
MousePressButtonImage="/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"
|
<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"
|
MouseOverButtonImage="/Resources/WindowBoxes/normal.hover.png"
|
||||||
MousePressButtonImage="/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"
|
<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"
|
MouseOverButtonImage="/Resources/WindowBoxes/close.hover.png"
|
||||||
MousePressButtonImage="/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>
|
<Border>
|
||||||
<Grid>
|
<Grid>
|
||||||
<Image Source="/Resources/WindowBoxes/min.png" Stretch="Uniform"/>
|
<Image Source="/Resources/WindowBoxes/min.png" Stretch="Uniform"/>
|
||||||
@@ -81,5 +125,5 @@
|
|||||||
</Grid>
|
</Grid>
|
||||||
</Border>
|
</Border>
|
||||||
</Button>-->
|
</Button>-->
|
||||||
</Grid>
|
</Grid>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
@@ -0,0 +1,267 @@
|
|||||||
|
using _29WxOrderWpf.CefHelper;
|
||||||
|
using WxOrder.Framework.Commons;
|
||||||
|
using _29WxOrderWpf.Ctrls.OrderCtrls;
|
||||||
|
using AllBase;
|
||||||
|
using AllBase.Helper;
|
||||||
|
using AllBase.Model.DBModel;
|
||||||
|
using AllBase.Model.MvvmBaseClasses;
|
||||||
|
using CefSharp;
|
||||||
|
using CefSharp.Handler;
|
||||||
|
using CefSharp.Wpf;
|
||||||
|
using NaiBa.Util.Extension;
|
||||||
|
using Org.BouncyCastle.Asn1.Ocsp;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Security.Policy;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Input;
|
||||||
|
using System.Windows.Threading;
|
||||||
|
using TemuKJD.ToolForms;
|
||||||
|
using Work;
|
||||||
|
using Work._29Tools.BLL;
|
||||||
|
using Work._29Tools.CefTools;
|
||||||
|
using static System.Windows.Forms.VisualStyles.VisualStyleElement.StartPanel;
|
||||||
|
|
||||||
|
namespace _29WxOrderWpf.ViewModels
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 拼多多买手移动版登录窗口 视图模型(WPF 版 TaobaoLoginForm)
|
||||||
|
/// </summary>
|
||||||
|
public class BaiduGetWaybillInfoViewModel : PropertyNotifyObject
|
||||||
|
{
|
||||||
|
// 拼多多买手退货退款售后地址
|
||||||
|
// https://mobile.yangkeduo.com/complaint.html?order_sn=260718-101481213440980&after_sales_reason=0&after_sales_type=2&after_sales_code=1002
|
||||||
|
|
||||||
|
public static BaiduGetWaybillInfoViewModel BaiduGetWaybillInfoInstance { get; set; } = null;
|
||||||
|
|
||||||
|
/// <summary>浏览器创建完成后触发(视图在此把浏览器加入可视树)</summary>
|
||||||
|
public event Action<ChromiumWebBrowser> BrowserCreated;
|
||||||
|
|
||||||
|
/// <summary>请求关闭窗口</summary>
|
||||||
|
public event Action RequestClose;
|
||||||
|
|
||||||
|
private string CookieHead { get; set; } = "baidu.com";
|
||||||
|
public string InitUrl { get; set; } = "";
|
||||||
|
private string MainUrl = "https://www.baidu.com/";
|
||||||
|
|
||||||
|
public ChromiumWebBrowser CefWebBrowser { get; private set; }
|
||||||
|
private string currentUrl = "";
|
||||||
|
private volatile bool _isWindowLoaded = false;
|
||||||
|
|
||||||
|
#region 界面绑定属性
|
||||||
|
|
||||||
|
public oms_wei_order_item_info OrderItem
|
||||||
|
{
|
||||||
|
get { return this.GetValue(x => x.OrderItem); }
|
||||||
|
set { this.SetValue(x => x.OrderItem, value); }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>地址栏</summary>
|
||||||
|
public string Address
|
||||||
|
{
|
||||||
|
get { return this.GetValue(x => x.Address); }
|
||||||
|
set { this.SetValue(x => x.Address, value); }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>物流信息</summary>
|
||||||
|
public string LatestWaybillStr
|
||||||
|
{
|
||||||
|
get { return this.GetValue(x => x.LatestWaybillStr); }
|
||||||
|
set { this.SetValue(x => x.LatestWaybillStr, value); }
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool IsLoading
|
||||||
|
{
|
||||||
|
get { return this.GetValue(x => x.IsLoading); }
|
||||||
|
set { this.SetValue(x => x.IsLoading, value); }
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 命令
|
||||||
|
|
||||||
|
public ICommand ReloadCommand { get; }
|
||||||
|
public ICommand SetRejectStatusCommand { get; }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
public BaiduGetWaybillInfoViewModel(oms_wei_order_item_info orderItem)
|
||||||
|
{
|
||||||
|
IsLoading = true;
|
||||||
|
BaiduGetWaybillInfoInstance = this;
|
||||||
|
OrderItem = orderItem;
|
||||||
|
|
||||||
|
ReloadCommand = new DelegateCommand(Reload);
|
||||||
|
SetRejectStatusCommand = new DelegateCommand(SetRejectStatus);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 窗口加载完成时调用
|
||||||
|
/// </summary>
|
||||||
|
public async Task Start()
|
||||||
|
{
|
||||||
|
await AutoLogin();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 窗口关闭时调用,停止后台任务
|
||||||
|
/// </summary>
|
||||||
|
public void Stop()
|
||||||
|
{
|
||||||
|
_isWindowLoaded = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 自动登录店铺后台
|
||||||
|
/// </summary>
|
||||||
|
private async Task AutoLogin()
|
||||||
|
{
|
||||||
|
_ = Application.Current.Dispatcher.InvokeAsync(async () =>
|
||||||
|
{
|
||||||
|
if (CefWebBrowser == null)
|
||||||
|
{
|
||||||
|
if (!string.IsNullOrEmpty(InitUrl))
|
||||||
|
CefWebBrowser = WPFCEFBrowser.CreateChromiumWebBrowser(InitUrl, false);
|
||||||
|
else
|
||||||
|
CefWebBrowser = WPFCEFBrowser.CreateChromiumWebBrowser(MainUrl, false);
|
||||||
|
|
||||||
|
LocalResourceRequestHandler resourceRequestHandler = new LocalResourceRequestHandler();
|
||||||
|
resourceRequestHandler.ResourceLoadCompleteEvent += RequestHandler_ResourceLoadComplete;
|
||||||
|
resourceRequestHandler.BeforeResourceLoadEvent += RequestHandler_BeforeResourceLoad;
|
||||||
|
CefWebBrowser.RequestHandler = new LocalRequestHandler(resourceRequestHandler);
|
||||||
|
var lifeSapnHandler = new LocalLifeSpanHandler(PopWindowType.SelfWindow);
|
||||||
|
CefWebBrowser.LifeSpanHandler = lifeSapnHandler;
|
||||||
|
//CefWebBrowser.KeyboardHandler = new KeyboardHandler();
|
||||||
|
CefWebBrowser.KeyboardHandler = new CefKeyboardHandler();
|
||||||
|
CefWebBrowser.FrameLoadEnd += CefWebBrowser_FrameLoadEnd;
|
||||||
|
CefWebBrowser.AddressChanged += CefWebBrowser_AddressChanged;
|
||||||
|
CefWebBrowser.LoadError += CefWebBrowser_LoadError;
|
||||||
|
|
||||||
|
// 通知视图把浏览器加入可视树(必须在等待浏览器初始化之前完成)
|
||||||
|
BrowserCreated?.Invoke(CefWebBrowser);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
//chat-submit-button
|
||||||
|
while (CefWebBrowser == null || CefWebBrowser.IsLoading)
|
||||||
|
{
|
||||||
|
Thread.Sleep(100);
|
||||||
|
}
|
||||||
|
await Task.Run(() =>
|
||||||
|
{
|
||||||
|
|
||||||
|
Thread.Sleep(4000);
|
||||||
|
IsLoading = false;
|
||||||
|
|
||||||
|
if (string.IsNullOrEmpty(LatestWaybillStr))
|
||||||
|
{
|
||||||
|
var jsStr = "document.getElementById('chat-submit-button').click();";
|
||||||
|
var client = CefWebBrowser.GetDevToolsClient();
|
||||||
|
if (client != null)
|
||||||
|
{
|
||||||
|
client.Runtime.EvaluateAsync(jsStr, null, true, null, null, true, null, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void CefWebBrowser_LoadError(object sender, CefSharp.LoadErrorEventArgs e)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
private void CefWebBrowser_AddressChanged(object sender, DependencyPropertyChangedEventArgs e)
|
||||||
|
{
|
||||||
|
if (Application.Current?.Dispatcher != null)
|
||||||
|
{
|
||||||
|
Application.Current.Dispatcher.Invoke(new Action(() =>
|
||||||
|
{
|
||||||
|
currentUrl = e.NewValue.ParseToString();
|
||||||
|
Address = e.NewValue.ParseToString();
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void CefWebBrowser_FrameLoadEnd(object sender, CefSharp.FrameLoadEndEventArgs e)
|
||||||
|
{
|
||||||
|
//js绑定C#对象 html页面内声明绑定的C#对象
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.Append("(function(){");
|
||||||
|
sb.Append("CefSharp.BindObjectAsync('shopObj');");
|
||||||
|
sb.Append("})();");
|
||||||
|
CefWebBrowser.GetBrowser().MainFrame.EvaluateScriptAsync(sb.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool RequestHandler_BeforeResourceLoad(object sender, string url, string postData, IRequest request)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private async void RequestHandler_ResourceLoadComplete(object sender, string url, string postData, string responseData, IRequest request)
|
||||||
|
{
|
||||||
|
await DoResourceLoadComplete(url, responseData);
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task DoResourceLoadComplete(string url, string responseData)
|
||||||
|
{
|
||||||
|
if (url.Contains("https://alayn.baidu.com/express/appdetail/pc_express"))
|
||||||
|
{
|
||||||
|
await Task.Run(async () =>
|
||||||
|
{
|
||||||
|
if (responseData.Contains("\"status\":0"))
|
||||||
|
{
|
||||||
|
//jsonp_1790501236188_28581({"status":0,"error_code":0,"msg":"","data":{"context":[{"time":1790324628,"desc":"您的快件已退回签收。如有疑问请联系网点,网点电话:95554,投诉电话:95554。感谢使用圆通速递,期待再次为您服务!","zone":""},{"time":1790324332,"desc":"【广东省广州市番禺区火车南站】的周继双(17396260642)正在为您派件(95161和18521号段的上海号码为圆通快递员专属号码,请放心接听。如遇物流问题,请联系快递员为您解决,或联系网点电话:18521191496,或致电专属客服95554)","zone":""},{"time":1790312940,"desc":"您的快件已经到达【广东省广州市番禺区沙湾】【物流问题请致电(专属热线:95554)更快解决】","zone":""},{"time":1790287250,"desc":"您的快件离开【佛山转运中心】,已发往【广东省广州市番禺区沙湾】","zone":""},{"time":1790284964,"desc":"您的快件已经到达【佛山转运中心】【物流问题请致电(专属热线:95554)更快解决】","zone":""},{"time":1790272720,"desc":"您的快件离开【深圳转运中心】,已发往【佛山转运中心】","zone":""},{"time":1790272619,"desc":"您的快件已经到达【深圳转运中心】【物流问题请致电(专属热线:95554)更快解决】","zone":""},{"time":1790263927,"desc":"您的快件离开【广东省东莞市凤岗】,已发往【深圳转运中心】","zone":""},{"time":1790263156,"desc":"您的快件已经到达【广东省东莞市凤岗】【物流问题请致电(专属热线:95554)更快解决】","zone":""},{"time":1790257882,"desc":"您的快件已被【广东省东莞市凤岗】安排退回,退回原因:客户要求退回","zone":""},{"time":1790257874,"desc":"发件人拦截,快件将原路退回或更改派送地址!如有疑问请联系【广东省东莞市凤岗】(专属客服电话:95554)","zone":""},{"time":1790164947,"desc":"您的快件已到达[喵站](浸校塘喵站)兔喜快递超市(浸校塘东良巷店),请及时取件,如有取件码问题或找不到包裹等问题,请联系站点:13556614729,或联系快递员:18521194191,或联系网点电话:18521871340,或致电专属客服95554。感谢使用圆通速递,期待再次为您服务!","zone":""},{"time":1790139598,"desc":"【广东省东莞市凤岗】的黎志威(18521194191)正在为您派件(95161和18521号段的上海号码为圆通快递员专属号码,请放心接听。如遇物流问题,请联系快递员为您解决,或联系网点电话:18521871340,或致电专属客服95554)","zone":""},{"time":1790139558,"desc":"您的快件已经到达【广东省东莞市凤岗】【物流问题请致电(专属热线:95554)更快解决】","zone":""},{"time":1790124801,"desc":"您的快件离开【深圳转运中心】,已发往【广东省东莞市凤岗】","zone":""},{"time":1790124513,"desc":"您的快件已经到达【深圳转运中心】【物流问题请致电(专属热线:95554)更快解决】","zone":""},{"time":1790111473,"desc":"您的快件离开【佛山转运中心】,已发往【深圳转运中心】","zone":""},{"time":1790111393,"desc":"您的快件已经到达【佛山转运中心】【物流问题请致电(专属热线:95554)更快解决】","zone":""},{"time":1790107910,"desc":"您的快件离开【广东省广州市番禺区火车南站】,已发往【佛山转运中心】","zone":""},{"time":1790104565,"desc":"您的快件在【广东省广州市番禺区火车南站】已揽收,揽收人: 董伟咏(18521870969)【物流问题请致电(专属热线:95554)更快解决】","zone":""}],"status":"1","state":"3","officalService":{"comCode":"yuantong","com":"圆通","comName":"圆通速递","urlDesc":"官网地址:","url":"https://www.yto.net.cn/","logo":"https://cityservice-hb.cdn.bcebos.com/amis/img/b5f54f0b2d6b.png","servicePhoneDesc":"官方电话:","servicePhone":"95554","service":[{"url":"https://www.yto.net.cn/ytoExpress/subCreatePages/create","name":"我要寄件"},{"url":"https://www.yto.net.cn/ytoExpress/querySupport/standardPrice","name":"运价查询"},{"url":"https://online.yto.net.cn/#/","name":"在线客服"}]}}})
|
||||||
|
LatestWaybillStr = BaseRegex.GetStringJson(ref responseData, "desc");
|
||||||
|
|
||||||
|
if (LatestWaybillStr.Contains("退回") || LatestWaybillStr.Contains("拒收") || LatestWaybillStr.Contains("拦截"))
|
||||||
|
{
|
||||||
|
if (!LatestWaybillStr.Contains("√"))
|
||||||
|
LatestWaybillStr = "√ " + LatestWaybillStr;
|
||||||
|
|
||||||
|
var transitOrder = OrderItem.ItemTransitOrderWithVoid;
|
||||||
|
if (transitOrder.has_reject != 99)
|
||||||
|
{
|
||||||
|
var url = BaseClass.Build29WxObjString("order/wx_update_transit_order_reject_status");
|
||||||
|
var data = UserLogin.GetSignaturex();
|
||||||
|
data += "&order_no=" + OrderItem.order_id;
|
||||||
|
data += "&order_sku_id=" + OrderItem.sku_id;
|
||||||
|
data += "&has_reject=" + 99;
|
||||||
|
var html = GetHtml.PostUtf8(url, data);
|
||||||
|
|
||||||
|
transitOrder.has_reject = 99;
|
||||||
|
OrderListCtrl.InitOrderItemObservableProp(OrderItem);
|
||||||
|
MainWindow.Instance.Dispatcher.Invoke(() => { MainWindow.Instance.orderListCtrl.FilterOneOrder(OrderItem.ItemOrder); });
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SetRejectStatus()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Reload()
|
||||||
|
{
|
||||||
|
if (CefWebBrowser != null)
|
||||||
|
{
|
||||||
|
if (Address != "about:blank")
|
||||||
|
CefWebBrowser.Load(Address);
|
||||||
|
else
|
||||||
|
CefWebBrowser.Load(MainUrl);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
using _29WxOrderWpf.BaseWindows;
|
using _29WxOrderWpf.BaseWindows;
|
||||||
using _29WxOrderWpf.Commands;
|
using WxOrder.Framework.Commons;
|
||||||
using AllBase;
|
using AllBase;
|
||||||
using AllBase.Helper;
|
using AllBase.Helper;
|
||||||
using AllBase.Model.DBModel;
|
using AllBase.Model.DBModel;
|
||||||
@@ -8,6 +8,7 @@ using AllBase.Model.Result;
|
|||||||
using NaiBa.Util.Extension;
|
using NaiBa.Util.Extension;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using NPOI.HSSF.Record;
|
using NPOI.HSSF.Record;
|
||||||
|
using Org.BouncyCastle.Crypto.Paddings;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
@@ -73,13 +74,24 @@ public class BuyMapSkuViewModel : PropertyNotifyObject
|
|||||||
if (orderItem != null)
|
if (orderItem != null)
|
||||||
{
|
{
|
||||||
this.ShopGoodsName = orderItem.title;
|
this.ShopGoodsName = orderItem.title;
|
||||||
this.ShopSkuName = orderItem.sku_attr_str;
|
this.ShopSkuName = orderItem.SkuAttrStr;
|
||||||
this.ShopSkuPrice = (orderItem.real_price * 0.01m).ParseToString();
|
this.ShopSkuPrice = (orderItem.real_price * 0.01m).ParseToString();
|
||||||
}
|
}
|
||||||
if (orderItem?.BuyMapSkus != null && orderItem?.BuyMapSkus.Count > 0)
|
if (GlobalConfig.CurrentBuyPlatform == "pdd")
|
||||||
{
|
{
|
||||||
BuyMapSkus = new ObservableCollection<WXBuyMapSkusInfo>(orderItem.BuyMapSkus);
|
if (orderItem?.PddBuyMapSkus != null && orderItem?.PddBuyMapSkus.Count > 0)
|
||||||
SetCurrentFrontSkuInfo3(BuyMapSkus?.FirstOrDefault());
|
{
|
||||||
|
BuyMapSkus = new ObservableCollection<WXBuyMapSkusInfo>(orderItem.PddBuyMapSkus);
|
||||||
|
SetCurrentFrontSkuInfo3(BuyMapSkus?.FirstOrDefault());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (GlobalConfig.CurrentBuyPlatform == "tb")
|
||||||
|
{
|
||||||
|
if (orderItem?.TbBuyMapSkus != null && orderItem?.TbBuyMapSkus.Count > 0)
|
||||||
|
{
|
||||||
|
BuyMapSkus = new ObservableCollection<WXBuyMapSkusInfo>(orderItem.TbBuyMapSkus);
|
||||||
|
SetCurrentFrontSkuInfo3(BuyMapSkus?.FirstOrDefault());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -91,6 +103,12 @@ public class BuyMapSkuViewModel : PropertyNotifyObject
|
|||||||
}
|
}
|
||||||
skuInfo.IsChecked = true;
|
skuInfo.IsChecked = true;
|
||||||
FrontSkuInfos = new ObservableCollection<frontSkuInfo3>(skuInfo?.pdd_front_goods3_Lite.skus);
|
FrontSkuInfos = new ObservableCollection<frontSkuInfo3>(skuInfo?.pdd_front_goods3_Lite.skus);
|
||||||
|
|
||||||
|
// 把名称给附上
|
||||||
|
foreach (var sku in FrontSkuInfos)
|
||||||
|
{
|
||||||
|
sku.GoodsNameStr = skuInfo?.pdd_front_goods3_Lite.goodsName;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -116,7 +134,11 @@ public class BuyMapSkuViewModel : PropertyNotifyObject
|
|||||||
|
|
||||||
public async Task SetOrderMapSku(frontSkuInfo3 upSku)
|
public async Task SetOrderMapSku(frontSkuInfo3 upSku)
|
||||||
{
|
{
|
||||||
var mapSkuProd = OrderItem.BuyMapSkus.FirstOrDefault(s => s.map_goods_id == upSku.goodsId.ParseToString());
|
WXBuyMapSkusInfo mapSkuProd = null;
|
||||||
|
if (GlobalConfig.CurrentBuyPlatform == "pdd")
|
||||||
|
mapSkuProd = OrderItem.PddBuyMapSkus.FirstOrDefault(s => s.map_goods_id == upSku.goodsId.ParseToString());
|
||||||
|
if (GlobalConfig.CurrentBuyPlatform == "tb")
|
||||||
|
mapSkuProd = OrderItem.TbBuyMapSkus.FirstOrDefault(s => s.map_goods_id == upSku.goodsId.ParseToString());
|
||||||
if (mapSkuProd == null)
|
if (mapSkuProd == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -129,26 +151,27 @@ public class BuyMapSkuViewModel : PropertyNotifyObject
|
|||||||
var mapGoodsId = mapSkuProd.map_goods_id;
|
var mapGoodsId = mapSkuProd.map_goods_id;
|
||||||
var mapSkuId = mapSku.skuId.ParseToString();
|
var mapSkuId = mapSku.skuId.ParseToString();
|
||||||
var sendProvince = mapSkuProd.map_send_address;
|
var sendProvince = mapSkuProd.map_send_address;
|
||||||
|
var platform = mapSkuProd.platform;
|
||||||
|
|
||||||
string cmbTransitWarehouse = "";
|
string cmbTransitWarehouse = "";
|
||||||
string txtBuyTransitWarehouse = "";
|
string txtBuyTransitWarehouse = "";
|
||||||
var transitWarehouse = TransitWarehouseData.TransitWarehouseList.FirstOrDefault(t => t.TransId == mapSkuProd.transit_warehouse_id);
|
var transitWarehouse = TransitWarehouseData.TransitWarehouseList.FirstOrDefault(t => t.TransId == mapSkuProd.transit_warehouse_id);
|
||||||
if (transitWarehouse != null)
|
if (transitWarehouse != null)
|
||||||
{
|
{
|
||||||
cmbTransitWarehouse = transitWarehouse?.TransName + " " + transitWarehouse?.TransDetailAddress;
|
cmbTransitWarehouse = transitWarehouse?.TransName + " " + transitWarehouse?.TransFullAddress;
|
||||||
txtBuyTransitWarehouse = transitWarehouse?.TransDetailAddress;
|
txtBuyTransitWarehouse = transitWarehouse?.TransFullAddress;
|
||||||
}
|
}
|
||||||
|
|
||||||
var spuCode = OrderItem.out_product_id.IsNullOrEmpty() ? OrderItem.product_id : OrderItem.out_product_id;
|
var spuCode = OrderItem.out_product_id.IsNullOrEmpty() ? OrderItem.product_id : OrderItem.out_product_id;
|
||||||
var skuCode = OrderItem.out_sku_id.IsNullOrEmpty() ? OrderItem.sku_attr_str : OrderItem.out_sku_id;
|
var skuCode = OrderItem.out_sku_id.IsNullOrEmpty() ? OrderItem.SkuAttrStr : OrderItem.out_sku_id;
|
||||||
if (spuCode.IsNullOrEmpty())
|
if (spuCode.IsNullOrEmpty())
|
||||||
spuCode = OrderItem.product_id;
|
spuCode = OrderItem.product_id;
|
||||||
if (await SaveSkuMap(spuCode, skuCode, mapGoodsName, mapSkuName, mapGoodsId, mapSkuId, transitWarehouse, sendProvince))
|
if (await SaveSkuMap(spuCode, skuCode, mapGoodsName, mapSkuName, mapGoodsId, mapSkuId, transitWarehouse, sendProvince, platform))
|
||||||
RequestClose?.Invoke();
|
RequestClose?.Invoke();
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<bool> SaveSkuMap(string spuCode, string skuCode, string mapGoodsName,
|
public async Task<bool> SaveSkuMap(string spuCode, string skuCode, string mapGoodsName,
|
||||||
string mapSkuName, string mapGoodsId, string mapSkuId, TransitWarehouseParam transitWarehouse, string sendProvince)
|
string mapSkuName, string mapGoodsId, string mapSkuId, TransitWarehouseParam transitWarehouse, string sendProvince, string platform)
|
||||||
{
|
{
|
||||||
if (transitWarehouse == null)
|
if (transitWarehouse == null)
|
||||||
{
|
{
|
||||||
@@ -169,6 +192,7 @@ public class BuyMapSkuViewModel : PropertyNotifyObject
|
|||||||
+ "&map_sku_id=" + mapSkuId
|
+ "&map_sku_id=" + mapSkuId
|
||||||
+ "&map_send_address=" + sendProvince
|
+ "&map_send_address=" + sendProvince
|
||||||
+ "&transit_warehouse_id=" + transitWarehouse?.TransId;
|
+ "&transit_warehouse_id=" + transitWarehouse?.TransId;
|
||||||
|
data += "&platform=" + platform;
|
||||||
|
|
||||||
url = BaseClass.Build29WxObjString("order/wx_add_mdy_buy_prod_map");
|
url = BaseClass.Build29WxObjString("order/wx_add_mdy_buy_prod_map");
|
||||||
var result = await GetHtml.PostUtf8Async(url, data);
|
var result = await GetHtml.PostUtf8Async(url, data);
|
||||||
@@ -215,11 +239,11 @@ public class BuyMapSkuViewModel : PropertyNotifyObject
|
|||||||
foreach (var item in order.orderItems)
|
foreach (var item in order.orderItems)
|
||||||
{
|
{
|
||||||
if ((item.out_product_id == map.spu_code && item.out_sku_id == map.sku_code) ||
|
if ((item.out_product_id == map.spu_code && item.out_sku_id == map.sku_code) ||
|
||||||
(item.out_product_id == map.spu_code && item.sku_attr_str == map.sku_code) ||
|
(item.out_product_id == map.spu_code && item.SkuAttrStr == map.sku_code) ||
|
||||||
(item.product_id == map.spu_code && item.out_sku_id == map.sku_code) ||
|
(item.product_id == map.spu_code && item.out_sku_id == map.sku_code) ||
|
||||||
(item.product_id == map.spu_code && item.sku_attr_str == map.sku_code))
|
(item.product_id == map.spu_code && item.SkuAttrStr == map.sku_code))
|
||||||
{
|
{
|
||||||
item.BuyMap = map;
|
item.PddBuyMap = map;
|
||||||
|
|
||||||
item.SetOrderItemTextProperty();
|
item.SetOrderItemTextProperty();
|
||||||
// todo 此处刷新一条可能不够
|
// todo 此处刷新一条可能不够
|
||||||
|
|||||||
@@ -0,0 +1,117 @@
|
|||||||
|
using _29WxOrderWpf.BaseWindows;
|
||||||
|
using WxOrder.Framework.Commons;
|
||||||
|
using AllBase;
|
||||||
|
using AllBase.Model.DBModel;
|
||||||
|
using AllBase.Model.MvvmBaseClasses;
|
||||||
|
using AllBase.Model.Result;
|
||||||
|
using NaiBa.Util.Extension;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Input;
|
||||||
|
using System.Windows.Threading;
|
||||||
|
using Work;
|
||||||
|
using Work._29Tools.BLL;
|
||||||
|
using Work._29Tools.Forms.ShopForms;
|
||||||
|
|
||||||
|
namespace _29WxOrderWpf.ViewModels
|
||||||
|
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 更改运单号ViewModel
|
||||||
|
/// </summary>
|
||||||
|
public class ChangePickNoViewModel : PropertyNotifyObject
|
||||||
|
{
|
||||||
|
public oms_wei_order_item_info OrderItem
|
||||||
|
{
|
||||||
|
get { return this.GetValue(x => x.OrderItem); }
|
||||||
|
set { this.SetValue(x => x.OrderItem, value); }
|
||||||
|
}
|
||||||
|
public string PickNo
|
||||||
|
{
|
||||||
|
get { return this.GetValue(x => x.PickNo); }
|
||||||
|
set { this.SetValue(x => x.PickNo, value); }
|
||||||
|
}
|
||||||
|
public bool IsChangeingPickNo
|
||||||
|
{
|
||||||
|
get { return this.GetValue(x => x.IsChangeingPickNo); }
|
||||||
|
set { this.SetValue(x => x.IsChangeingPickNo, value); }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 请求关闭窗口
|
||||||
|
/// </summary>
|
||||||
|
public event Action RequestClose;
|
||||||
|
|
||||||
|
#region 命令
|
||||||
|
|
||||||
|
public ICommand ChangePickNoCommand { get; }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
private volatile bool _isWindowLoaded = false;
|
||||||
|
|
||||||
|
public ChangePickNoViewModel(oms_wei_order_item_info _orderItem)
|
||||||
|
{
|
||||||
|
OrderItem = _orderItem;
|
||||||
|
IsChangeingPickNo = false;
|
||||||
|
PickNo = (_orderItem?.ItemOrder?.SyncWaybillPickNo).ParseToString();
|
||||||
|
ChangePickNoCommand = new DelegateCommand(ChangePickNo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 窗口加载完成时调用
|
||||||
|
/// </summary>
|
||||||
|
public void Start()
|
||||||
|
{
|
||||||
|
_isWindowLoaded = true;
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 窗口关闭时调用,停止后台任务
|
||||||
|
/// </summary>
|
||||||
|
public void Stop()
|
||||||
|
{
|
||||||
|
_isWindowLoaded = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ChangePickNo()
|
||||||
|
{
|
||||||
|
IsChangeingPickNo = false;
|
||||||
|
string orderId = OrderItem.order_id;
|
||||||
|
ShopLoginInfo shop = OrderItem.Shop;
|
||||||
|
if (string.IsNullOrEmpty(PickNo))
|
||||||
|
{
|
||||||
|
BaseMsgWindow.ShowInfo("取件码不能为空");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Task.Run(async () =>
|
||||||
|
{
|
||||||
|
var url4 = BaseClass.Build29WxObjString("vlc/UploadPickup");
|
||||||
|
var data4 = UserLogin.GetSignPostData(new
|
||||||
|
{
|
||||||
|
orderId = OrderItem.DirectPddBuyerOrder.order_sn,
|
||||||
|
pickupCode = PickNo,
|
||||||
|
});
|
||||||
|
var html4 = GetHtml.PostJson(url4, data4);
|
||||||
|
if (html4.Contains("\"code\":200"))
|
||||||
|
{
|
||||||
|
Application.Current?.Dispatcher.Invoke(new Action(() =>
|
||||||
|
{
|
||||||
|
OrderItem.ItemOrder.SyncWaybillPickNo = PickNo;
|
||||||
|
IsChangeingPickNo = false;
|
||||||
|
BaseMsgWindow.ShowInfo("修改取件码成功");
|
||||||
|
RequestClose?.Invoke();
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
BaseMsgWindow.ShowInfo("修改取件码失败" + BaseRegex.GetStringJson(ref html4, "msg"));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,265 @@
|
|||||||
|
using _29WxOrderWpf.BaseWindows;
|
||||||
|
using WxOrder.Framework.Commons;
|
||||||
|
using AllBase;
|
||||||
|
using AllBase.Model.DBModel;
|
||||||
|
using AllBase.Model.MvvmBaseClasses;
|
||||||
|
using AllBase.Model.Result;
|
||||||
|
using NaiBa.Util.Extension;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Security.Cryptography;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Input;
|
||||||
|
using System.Windows.Threading;
|
||||||
|
using Work;
|
||||||
|
using Work._29Tools.BLL;
|
||||||
|
using Work._29Tools.Forms.ShopForms;
|
||||||
|
|
||||||
|
namespace _29WxOrderWpf.ViewModels
|
||||||
|
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 更改运单号ViewModel
|
||||||
|
/// </summary>
|
||||||
|
public class ChangeWaybillViewModel : PropertyNotifyObject
|
||||||
|
{
|
||||||
|
public oms_wei_order_item_info OrderItem
|
||||||
|
{
|
||||||
|
get { return this.GetValue(x => x.OrderItem); }
|
||||||
|
set { this.SetValue(x => x.OrderItem, value); }
|
||||||
|
}
|
||||||
|
public string WaybillId
|
||||||
|
{
|
||||||
|
get { return this.GetValue(x => x.WaybillId); }
|
||||||
|
set { this.SetValue(x => x.WaybillId, value); }
|
||||||
|
}
|
||||||
|
|
||||||
|
public string CompensationWaybillId
|
||||||
|
{
|
||||||
|
get { return this.GetValue(x => x.CompensationWaybillId); }
|
||||||
|
set { this.SetValue(x => x.CompensationWaybillId, value); }
|
||||||
|
}
|
||||||
|
public bool IsChangeingWaybill
|
||||||
|
{
|
||||||
|
get { return this.GetValue(x => x.IsChangeingWaybill); }
|
||||||
|
set { this.SetValue(x => x.IsChangeingWaybill, value); }
|
||||||
|
}
|
||||||
|
public bool ChangeWaybillSuccess
|
||||||
|
{
|
||||||
|
get { return this.GetValue(x => x.ChangeWaybillSuccess); }
|
||||||
|
set { this.SetValue(x => x.ChangeWaybillSuccess, value); }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 请求关闭窗口
|
||||||
|
/// </summary>
|
||||||
|
public event Action RequestClose;
|
||||||
|
|
||||||
|
#region 命令
|
||||||
|
|
||||||
|
public ICommand ChangeWaybillCommand { get; }
|
||||||
|
public ICommand SendCompensationDeliveryCommand { get; }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
private volatile bool _isWindowLoaded = false;
|
||||||
|
|
||||||
|
public ChangeWaybillViewModel(oms_wei_order_item_info _orderItem)
|
||||||
|
{
|
||||||
|
OrderItem = _orderItem;
|
||||||
|
//IsChangeingWaybill = true;
|
||||||
|
|
||||||
|
ChangeWaybillCommand = new DelegateCommand(ChangeWaybill);
|
||||||
|
SendCompensationDeliveryCommand = new DelegateCommand(SendCompensationDelivery);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 窗口加载完成时调用
|
||||||
|
/// </summary>
|
||||||
|
public void Start()
|
||||||
|
{
|
||||||
|
_isWindowLoaded = true;
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 窗口关闭时调用,停止后台任务
|
||||||
|
/// </summary>
|
||||||
|
public void Stop()
|
||||||
|
{
|
||||||
|
_isWindowLoaded = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ChangeWaybill()
|
||||||
|
{
|
||||||
|
ChangeWaybillSuccess = false;
|
||||||
|
string orderId = OrderItem.order_id;
|
||||||
|
ShopLoginInfo shop = OrderItem?.ItemOrder?.Shop;
|
||||||
|
Task.Run(async () =>
|
||||||
|
{
|
||||||
|
// 查询订单是否在代发货中,如果代发需要取消代发
|
||||||
|
var apiSearchDropship = new WxApiBLL().WxApiDropshipSearch(shop, orderId, 100);
|
||||||
|
if (!apiSearchDropship.Contains("\"errcode\":0"))
|
||||||
|
{
|
||||||
|
BaseMsgWindow.ShowError("代发查询失败," + BaseRegex.GetStringJsonByRegs(ref apiSearchDropship, apiSearchDropship, "errmsg"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (apiSearchDropship.Contains("ds_order_id_list") && !apiSearchDropship.Contains("\"ds_order_id_list\":[]"))
|
||||||
|
{
|
||||||
|
var dsOrderId = JsonHelper.JObjectParse(apiSearchDropship)["ds_order_id_list"].FirstOrDefault().ParseToString();
|
||||||
|
var apiCancelDropship = await new WxApiBLL().WxApiDropshipCancel(shop, OrderItem?.ItemOrder, dsOrderId);
|
||||||
|
|
||||||
|
if (!apiCancelDropship.Contains("\"errcode\":0"))
|
||||||
|
{
|
||||||
|
IsChangeingWaybill = false;
|
||||||
|
BaseMsgWindow.ShowError("取消代发失败!请确商品未加入代发!" + BaseRegex.GetStringJsonByRegs(ref apiSearchDropship, apiSearchDropship, "errmsg"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
IsChangeingWaybill = true;
|
||||||
|
var rst = WxSimOrderSendBLL.initDeliveryInfo(shop, orderId);
|
||||||
|
// {"code":0,"orderDetail":{"commonInfo":{"orderId":"3736582386601580032","orderType":0,"statusStr":"待发货","status":20,"originalStatus":11,"openid":"ow5ty7Kyik_dSqtrivr5hY2t4cwY","createTime":1779540820,"createTimeStr":"2026-05-23 20:53","isPayScoreOrder":false,"isPayDone":true,"isVirtualOrder":false,"isAuthorizedAccount":false,"giftOrderType":"","isInspectOrder":false,"isCommissionOrderDone":false,"isRechargeOrder":false,"isExpediteOrder":false,"isOverTimeOrder":2,"isMultiPackage":false,"inspectType":0,"isGiftOrder":false,"isBuyTogetherOrder":false,"isLotteryOrder":false,"isEducationOrder":false,"hideGiftOrderAddressInfo":false,"cosignmentFlag":1,"isNationalSubsidy":0,"isSameCityOrder":false,"isNationalSubsidyMerchant":false,"isSupplyOrder":false},"orderProducts":{"orderProductInfo":[{"productId":"10000863142394","thumbImg":"https://wst.wxapp.tc.qq.com/161/20304/snscosdownload/SH/reserved/6a092e3a000107862152a36aa881bc1e000000a100004f50","title":"脂砚斋评石头记(全三册) 烫金珍藏版 彩绘绣像 双色印刷","skuId":"15274875174","saleParam":["默认"],"productType":1,"productCnt":1,"salePrice":"3400","spuCode":"9787555418979","skuCode":"BSEC12302592708637555055A","isPreSale":false,"isIflashbuy":false,"isFreeGift":false,"canAfterSale":true,"realPrice":3350,"perRealPrice":3350,"tags":[{"class":"black","desc":"7天无理由","iconUrl":"","mainUrl":"","tagType":4},{"class":"black","desc":"运费险","iconUrl":"","mainUrl":"","tagType":5}],"icons":[],"perExchangeScore":"","productSource":{"show":false},"afterSaleInfo":{"afterId":"","canAfterSale":true,"canNotAfterSaleReason":"","jumpUrl":"","title":"","content":"","afterSaleDoneStr":"","afterSaleDoneAmountStr":"","afterSaleDoneAmount":0,"afterSaleDoneProductCnt":0,"afterSaleIngProductCnt":0,"isGuaranteeIng":false,"hasFakeOnePayFourDoneGuarantee":false},"changeProduct":0,"afterSaleDoneProductCnt":0,"afterSaleIngProductCnt":0,"supplyProductId":"","supplyNickName":"","supplyOrderId":"","supplyAppid":""}],"priceInfo":{"productPrice":"3400","orderPrice":"3350","freight":0,"originalOrderPrice":"3400","estimateProductPrice":"3350","handingFee":"0","maxUnsplitAmount":"3350","totalDiscountedPrice":"50","merchantReceievePrice":"3350","platformActivityMerchantDiscountedPrice":"50"},"activityInfo":{},"presentFee":{}},"acceptInfo":{"decodeSensitiveTime":0,"editAddrInfo":{"applyEditAddrStatus":0,"applyEditAddrAuditStaff":"","applyEditAddrAuditTimeText":"","negotiationEditTextForB":"","negotiationEditTextForA":"","negotiationEditStatus":0,"negotiationEditHistory":[],"canNegotiation":true,"hasUnResolvedRequest":0,"hasHistoryMerchantEditAddr":0,"editHistory":[]},"customerNotes":"","merchantNotes":"","presentNotes":"","addressInfo":{"cityName":"宝鸡市","countyName":"眉县","provinceName":"陕西省","userName":"刘**","telNumber":"187****9569","detailInfo":"****","virtualOrderTelNumber":""},"virtualNumberInfo":{},"quota":{"code":0,"limit":10,"used":10,"hideSensitiveInfo":true},"rechargeData":{"label":"","content":"","deliverMethod":0},"addressErrType":0},"expressInfo":{"phone":"9569","deliveryProductInfo":[],"orderProductCnt":1,"deliveryCnt":0,"isIntracityOrder":false,"intracityTracking":null,"formatUnshippedProductList":[{"productId":"10000863142394","thumbImg":"https://wst.wxapp.tc.qq.com/161/20304/snscosdownload/SH/reserved/6a092e3a000107862152a36aa881bc1e000000a100004f50","title":"脂砚斋评石头记(全三册) 烫金珍藏版 彩绘绣像 双色印刷","skuId":"15274875174","saleParam":["默认"],"productType":1,"productCnt":1,"salePrice":"3400","spuCode":"9787555418979","skuCode":"BSEC12302592708637555055A","isPreSale":false,"isIflashbuy":false,"isFreeGift":false,"canAfterSale":true,"realPrice":3350,"perRealPrice":3350,"tags":[{"class":"black","desc":"7天无理由","iconUrl":"","mainUrl":"","tagType":4},{"class":"black","desc":"运费险","iconUrl":"","mainUrl":"","tagType":5}],"icons":[],"perExchangeScore":"","productSource":1,"afterSaleInfo":{"afterId":"","canAfterSale":true,"canNotAfterSaleReason":"","jumpUrl":"","title":"","content":"","afterSaleDoneStr":"","afterSaleDoneAmountStr":"","afterSaleDoneAmount":0,"afterSaleDoneProductCnt":0,"afterSaleIngProductCnt":0,"isGuaranteeIng":false,"hasFakeOnePayFourDoneGuarantee":false},"changeProduct":0,"afterSaleDoneProductCnt":0,"afterSaleIngProductCnt":0,"supplyProductId":"","supplyNickName":"","supplyOrderId":"","supplyAppid":""}],"product2Img":{"15274875174":"https://wst.wxapp.tc.qq.com/161/20304/snscosdownload/SH/reserved/6a092e3a000107862152a36aa881bc1e000000a100004f50"}},"ewaybillInfo":{"isAllPrintOne":false,"isOpen":false,"deliveryId":"","deliveryName":"","waybillId":""}},"sendAddressInfo":{"userName":"陈图书","postalCode":"","provinceName":"安徽省","cityName":"合肥市","countyName":"肥西县","detailInfo":"上派镇中盟电子产业园8栋一单元(东电梯3楼快递指定存放点)","telNumber":"13023098035","lat":0,"lng":0},"deliveryCompanyOptions":[{"label":"极兔Line truncated
|
||||||
|
if (!rst.Contains("\"code\":0"))
|
||||||
|
{
|
||||||
|
var error = BaseRegex.GetStringJsonByRegs(ref rst, rst, "err_msg", "error_msg", "errMsg", "errorMsg", "msg");
|
||||||
|
IsChangeingWaybill = false;
|
||||||
|
BaseMsgWindow.ShowInfo("修改订单物流失败 " + error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var statusStr = BaseRegex.GetStringJson(ref rst, "statusStr");
|
||||||
|
if (statusStr == "待发货")
|
||||||
|
{
|
||||||
|
// 待发货暂不处理
|
||||||
|
//{"orderId":"3736580679658008320","deliveryProduct":{"deliveryId":"YUNDA","waybillId":"313023381086999","isAllProduct":true,"deliverType":1}}
|
||||||
|
//{"code":0,"errcode":0,"errmsg":"ok"}
|
||||||
|
|
||||||
|
rst = WxSimOrderSendBLL.orderSendOut(shop, orderId, WaybillId);
|
||||||
|
if (!rst.Contains("\"code\":0"))
|
||||||
|
{
|
||||||
|
var error = BaseRegex.GetStringJsonByRegs(ref rst, rst, "err_msg", "error_msg", "errMsg", "errorMsg", "msg");
|
||||||
|
IsChangeingWaybill = false;
|
||||||
|
BaseMsgWindow.ShowInfo("修改订单物流失败 " + error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var url = BaseClass.Build29WxObjString("order/wx_update_erp_soft_remark");
|
||||||
|
var data = UserLogin.GetSignaturex();
|
||||||
|
if (OrderItem?.ItemOrder != null && !(OrderItem?.ItemOrder?.soft_remark).ParseToString().Contains("已修改物流"))
|
||||||
|
OrderItem.ItemOrder.soft_remark = ("已修改物流 " + OrderItem.ItemOrder.soft_remark).Trim();
|
||||||
|
data += "&order_id=" + OrderItem?.ItemOrder?.order_id;
|
||||||
|
data += "&soft_remark=" + OrderItem?.ItemOrder?.soft_remark;
|
||||||
|
var html = GetHtml.PostUtf8(url, data);
|
||||||
|
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
||||||
|
html = GetHtml.PostUtf8(url, data);
|
||||||
|
|
||||||
|
Application.Current?.Dispatcher.Invoke(new Action(() =>
|
||||||
|
{
|
||||||
|
ChangeWaybillSuccess = true;
|
||||||
|
IsChangeingWaybill = false;
|
||||||
|
BaseMsgWindow.ShowInfo("修改订单物流成功");
|
||||||
|
RequestClose?.Invoke();
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
|
//{"orderId":"3736580679658008320","changeInfo":[{"old":{"deliveryId":"YUNDA","waybillId":"313023381086999","productInfos":[{"productId":"10000875072190","skuId":"15516018429","productCnt":1}]},"new":{"deliveryId":"OTHER","waybillId":"772064082455686","productInfos":[{"productId":"10000875072190","skuId":"15516018429","productCnt":1}]}}]}
|
||||||
|
//{"code":0,"errcode":0,"errmsg":""}
|
||||||
|
var orderExpressInfoObj = JsonHelper.JObjectParse(rst)["orderDetail"]["expressInfo"];
|
||||||
|
var orderExpressInfo = JsonHelper.DeserializeJsonToObject<WxOrderExpressInfo>(JsonHelper.SerializeObject(orderExpressInfoObj));
|
||||||
|
UpdateDeliverInfoParam param = new UpdateDeliverInfoParam();
|
||||||
|
param.orderId = orderId;
|
||||||
|
param.changeInfo = new List<Dictionary<string, UpdateDeliverChangeInfo>>();
|
||||||
|
|
||||||
|
foreach (var deliveryProductInfo in orderExpressInfo.deliveryProductInfo)
|
||||||
|
{
|
||||||
|
Dictionary<string, UpdateDeliverChangeInfo> dicChange = new Dictionary<string, UpdateDeliverChangeInfo>();
|
||||||
|
dicChange["old"] = new UpdateDeliverChangeInfo
|
||||||
|
{
|
||||||
|
deliveryId = deliveryProductInfo.deliveryId,
|
||||||
|
waybillId = deliveryProductInfo.waybillId,
|
||||||
|
productInfos = new List<UpdateDeliverProductInfo>()
|
||||||
|
};
|
||||||
|
dicChange["new"] = new UpdateDeliverChangeInfo
|
||||||
|
{
|
||||||
|
deliveryId = "OTHER",
|
||||||
|
waybillId = WaybillId,
|
||||||
|
productInfos = new List<UpdateDeliverProductInfo>()
|
||||||
|
};
|
||||||
|
foreach (var prod in deliveryProductInfo.productInfos)
|
||||||
|
{
|
||||||
|
dicChange["old"].productInfos.Add(new UpdateDeliverProductInfo() { productCnt = prod.productCnt, productId = prod.productId, skuId = prod.skuId });
|
||||||
|
dicChange["new"].productInfos.Add(new UpdateDeliverProductInfo() { productCnt = prod.productCnt, productId = prod.productId, skuId = prod.skuId });
|
||||||
|
}
|
||||||
|
param.changeInfo.Add(dicChange);
|
||||||
|
}
|
||||||
|
rst = WxSimOrderSendBLL.updateDeliveryInfo(shop, param);
|
||||||
|
var str = JsonHelper.SerializeObject(param);
|
||||||
|
if (!rst.Contains("\"code\":0"))
|
||||||
|
{
|
||||||
|
var error = BaseRegex.GetStringJsonByRegs(ref rst, rst, "err_msg", "error_msg", "errMsg", "errorMsg", "msg");
|
||||||
|
IsChangeingWaybill = false;
|
||||||
|
BaseMsgWindow.ShowInfo("修改订单物流失败 " + error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var url = BaseClass.Build29WxObjString("order/wx_update_erp_soft_remark");
|
||||||
|
var data = UserLogin.GetSignaturex();
|
||||||
|
if (OrderItem?.ItemOrder != null && !OrderItem.ItemOrder.soft_remark.ParseToString().Contains("已修改物流"))
|
||||||
|
OrderItem.ItemOrder.soft_remark = ("已修改物流 " + OrderItem.ItemOrder.soft_remark).Trim();
|
||||||
|
data += "&order_id=" + OrderItem?.ItemOrder?.order_id;
|
||||||
|
data += "&soft_remark=" + OrderItem?.ItemOrder?.soft_remark;
|
||||||
|
var html = GetHtml.PostUtf8(url, data);
|
||||||
|
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
||||||
|
html = GetHtml.PostUtf8(url, data);
|
||||||
|
|
||||||
|
Application.Current?.Dispatcher.Invoke(new Action(() =>
|
||||||
|
{
|
||||||
|
ChangeWaybillSuccess = true;
|
||||||
|
IsChangeingWaybill = false;
|
||||||
|
BaseMsgWindow.ShowInfo("修改订单物流成功");
|
||||||
|
RequestClose?.Invoke();
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SendCompensationDelivery()
|
||||||
|
{
|
||||||
|
var orderId = OrderItem.order_id;
|
||||||
|
var shop = OrderItem?.ItemOrder?.Shop;
|
||||||
|
// 模拟接口补发
|
||||||
|
//rst = WxSimOrderSendBLL.orderCompensationDelivery(shop, orderId, "ZTO", WaybillId, OrderItem.product_id, OrderItem.sku_id, OrderItem.sku_cnt.ParseToInt());
|
||||||
|
var rst = WxSimOrderSendBLL.orderCompensationDelivery(shop, orderId, "OTHER", CompensationWaybillId, OrderItem.product_id, OrderItem.sku_id, OrderItem.sku_cnt.ParseToInt());
|
||||||
|
|
||||||
|
var url = BaseClass.Build29WxObjString("order/wx_update_erp_soft_remark");
|
||||||
|
var data = UserLogin.GetSignaturex();
|
||||||
|
if (OrderItem?.ItemOrder != null && !OrderItem.ItemOrder.soft_remark.ParseToString().Contains("已补发包裹"))
|
||||||
|
OrderItem.ItemOrder.soft_remark = ("已补发包裹 " + OrderItem.ItemOrder.soft_remark).Trim();
|
||||||
|
data += "&order_id=" + OrderItem?.ItemOrder?.order_id;
|
||||||
|
data += "&soft_remark=" + OrderItem?.ItemOrder?.soft_remark;
|
||||||
|
var html = GetHtml.PostUtf8(url, data);
|
||||||
|
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
||||||
|
html = GetHtml.PostUtf8(url, data);
|
||||||
|
|
||||||
|
if (!rst.Contains("\"code\":0"))
|
||||||
|
{
|
||||||
|
var error = BaseRegex.GetStringJsonByRegs(ref rst, rst, "err_msg", "error_msg", "errMsg", "errorMsg", "msg");
|
||||||
|
IsChangeingWaybill = false;
|
||||||
|
BaseMsgWindow.ShowError("订单补发失败 " + error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Application.Current?.Dispatcher.Invoke(new Action(() =>
|
||||||
|
{
|
||||||
|
ChangeWaybillSuccess = true;
|
||||||
|
IsChangeingWaybill = false;
|
||||||
|
BaseMsgWindow.ShowInfo("订单补发成功");
|
||||||
|
RequestClose?.Invoke();
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,134 @@
|
|||||||
|
using _29WxOrderWpf.BaseWindows;
|
||||||
|
using WxOrder.Framework.Commons;
|
||||||
|
using AllBase;
|
||||||
|
using AllBase.Model.DBModel;
|
||||||
|
using AllBase.Model.MvvmBaseClasses;
|
||||||
|
using AllBase.Model.Result;
|
||||||
|
using NaiBa.Util.Extension;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Input;
|
||||||
|
using System.Windows.Threading;
|
||||||
|
using Work;
|
||||||
|
using Work._29Tools.BLL;
|
||||||
|
using Work._29Tools.Forms.ShopForms;
|
||||||
|
using Work.BaseForms;
|
||||||
|
|
||||||
|
namespace _29WxOrderWpf.ViewModels
|
||||||
|
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 更改运单号ViewModel
|
||||||
|
/// </summary>
|
||||||
|
public class EWaybillPathViewModel : PropertyNotifyObject
|
||||||
|
{
|
||||||
|
public oms_wei_order_info Order
|
||||||
|
{
|
||||||
|
get { return this.GetValue(x => x.Order); }
|
||||||
|
set { this.SetValue(x => x.Order, value); }
|
||||||
|
}
|
||||||
|
public string OrderId
|
||||||
|
{
|
||||||
|
get { return this.GetValue(x => x.OrderId); }
|
||||||
|
set { this.SetValue(x => x.OrderId, value); }
|
||||||
|
}
|
||||||
|
public string ExpressName
|
||||||
|
{
|
||||||
|
get { return this.GetValue(x => x.ExpressName); }
|
||||||
|
set { this.SetValue(x => x.ExpressName, value); }
|
||||||
|
}
|
||||||
|
public string WaybillId
|
||||||
|
{
|
||||||
|
get { return this.GetValue(x => x.WaybillId); }
|
||||||
|
set { this.SetValue(x => x.WaybillId, value); }
|
||||||
|
}
|
||||||
|
public bool IsGetWaybillPath
|
||||||
|
{
|
||||||
|
get { return this.GetValue(x => x.IsGetWaybillPath); }
|
||||||
|
set { this.SetValue(x => x.IsGetWaybillPath, value); }
|
||||||
|
}
|
||||||
|
|
||||||
|
public ObservableCollection<oms_wei_ewaybill_path> WaybillPathInfos
|
||||||
|
{
|
||||||
|
get { return this.GetValue(x => x.WaybillPathInfos); }
|
||||||
|
set { this.SetValue(x => x.WaybillPathInfos, value); }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 请求关闭窗口
|
||||||
|
/// </summary>
|
||||||
|
public event Action RequestClose;
|
||||||
|
|
||||||
|
#region 命令
|
||||||
|
|
||||||
|
public ICommand GetEWaybillPathCommand { get; }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
private volatile bool _isWindowLoaded = false;
|
||||||
|
|
||||||
|
public EWaybillPathViewModel(oms_wei_order_info _order, string _waybillId, string _expressName)
|
||||||
|
{
|
||||||
|
Order = _order;
|
||||||
|
OrderId = Order?.order_id;
|
||||||
|
ExpressName = _expressName;
|
||||||
|
WaybillId = _waybillId;
|
||||||
|
IsGetWaybillPath = false;
|
||||||
|
|
||||||
|
GetEWaybillPathCommand = new DelegateCommand(GetEWaybillPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 窗口加载完成时调用
|
||||||
|
/// </summary>
|
||||||
|
public void Start()
|
||||||
|
{
|
||||||
|
_isWindowLoaded = true;
|
||||||
|
|
||||||
|
GetEWaybillPath();
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 窗口关闭时调用,停止后台任务
|
||||||
|
/// </summary>
|
||||||
|
public void Stop()
|
||||||
|
{
|
||||||
|
_isWindowLoaded = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void GetEWaybillPath()
|
||||||
|
{
|
||||||
|
string orderId = Order.order_id;
|
||||||
|
ShopLoginInfo shop = Order.Shop;
|
||||||
|
Task.Run(async () =>
|
||||||
|
{
|
||||||
|
IsGetWaybillPath = true;
|
||||||
|
|
||||||
|
var url = BaseClass.Build29WxObjString("order/wx_get_erp_ewaybill_path_list");
|
||||||
|
//var url = BaseClass.Build29WxObjString("order/wx_get_erp_ewaybill_path_latest_list");
|
||||||
|
var data = UserLogin.GetSignaturex();
|
||||||
|
//data += "&erp_order_id_in=" + order_id;
|
||||||
|
data += "&waybill_id_in=" + WaybillId;
|
||||||
|
var html = GetHtml.PostUtf8(url, data);
|
||||||
|
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
||||||
|
html = GetHtml.PostUtf8(url, data);
|
||||||
|
|
||||||
|
if (!html.Contains("\"code\":200"))
|
||||||
|
{
|
||||||
|
BaseMsgWindow.ShowError("查询失败请重试");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.WaybillPathInfos = new ObservableCollection<oms_wei_ewaybill_path>(
|
||||||
|
JsonHelper.DeserializeJsonToList<oms_wei_ewaybill_path>(JObject.Parse(html)["data"].ParseToString()).OrderByDescending(p => p.update_time).ToList());
|
||||||
|
|
||||||
|
IsGetWaybillPath = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,13 +1,15 @@
|
|||||||
using _29WxOrderWpf.CefHelper;
|
using _29WxOrderWpf.CefHelper;
|
||||||
using _29WxOrderWpf.Commands;
|
using WxOrder.Framework.Commons;
|
||||||
using AllBase;
|
using AllBase;
|
||||||
using AllBase.Helper;
|
using AllBase.Helper;
|
||||||
using AllBase.Model.DBModel;
|
using AllBase.Model.DBModel;
|
||||||
using AllBase.Model.MvvmBaseClasses;
|
using AllBase.Model.MvvmBaseClasses;
|
||||||
|
using AllBase.Model.Result;
|
||||||
using CefSharp;
|
using CefSharp;
|
||||||
using CefSharp.Handler;
|
using CefSharp.Handler;
|
||||||
using CefSharp.Wpf;
|
using CefSharp.Wpf;
|
||||||
using NaiBa.Util.Extension;
|
using NaiBa.Util.Extension;
|
||||||
|
using NPOI.SS.Formula.Functions;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@@ -32,7 +34,7 @@ namespace _29WxOrderWpf.ViewModels
|
|||||||
{
|
{
|
||||||
// 拼多多买手退货退款售后地址
|
// 拼多多买手退货退款售后地址
|
||||||
// https://mobile.yangkeduo.com/complaint.html?order_sn=260718-101481213440980&after_sales_reason=0&after_sales_type=2&after_sales_code=1002
|
// https://mobile.yangkeduo.com/complaint.html?order_sn=260718-101481213440980&after_sales_reason=0&after_sales_type=2&after_sales_code=1002
|
||||||
|
Dictionary<BuyerLoginInfo, PddPickInfo> dicPddPickInfo = new Dictionary<BuyerLoginInfo, PddPickInfo>();
|
||||||
public static PddMobileLoginViewModel PddMobileLoginInstance { get; set; } = null;
|
public static PddMobileLoginViewModel PddMobileLoginInstance { get; set; } = null;
|
||||||
|
|
||||||
/// <summary>浏览器创建完成后触发(视图在此把浏览器加入可视树)</summary>
|
/// <summary>浏览器创建完成后触发(视图在此把浏览器加入可视树)</summary>
|
||||||
@@ -202,7 +204,7 @@ namespace _29WxOrderWpf.ViewModels
|
|||||||
CefWebBrowser.RequestHandler = new LocalRequestHandler(resourceRequestHandler);
|
CefWebBrowser.RequestHandler = new LocalRequestHandler(resourceRequestHandler);
|
||||||
var lifeSapnHandler = new LocalLifeSpanHandler(PopWindowType.SelfWindow);
|
var lifeSapnHandler = new LocalLifeSpanHandler(PopWindowType.SelfWindow);
|
||||||
CefWebBrowser.LifeSpanHandler = lifeSapnHandler;
|
CefWebBrowser.LifeSpanHandler = lifeSapnHandler;
|
||||||
CefWebBrowser.KeyboardHandler = new KeyboardHandler();
|
CefWebBrowser.KeyboardHandler = new CefKeyboardHandler();
|
||||||
CefWebBrowser.FrameLoadEnd += CefWebBrowser_FrameLoadEnd;
|
CefWebBrowser.FrameLoadEnd += CefWebBrowser_FrameLoadEnd;
|
||||||
CefWebBrowser.AddressChanged += CefWebBrowser_AddressChanged;
|
CefWebBrowser.AddressChanged += CefWebBrowser_AddressChanged;
|
||||||
CefWebBrowser.LoadError += CefWebBrowser_LoadError;
|
CefWebBrowser.LoadError += CefWebBrowser_LoadError;
|
||||||
@@ -317,6 +319,28 @@ namespace _29WxOrderWpf.ViewModels
|
|||||||
|
|
||||||
private void RequestHandler_ResourceLoadComplete(object sender, string url, string postData, string responseData, IRequest request)
|
private void RequestHandler_ResourceLoadComplete(object sender, string url, string postData, string responseData, IRequest request)
|
||||||
{
|
{
|
||||||
|
var data = responseData;
|
||||||
|
var send = sender;
|
||||||
|
if (data.Contains("\"pick_code\":\"取件码") /*|| data.Contains("21-2110")*/)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var combine_track_list = BaseRegex.GetJsonArrStrJson(ref data, "combine_track_list");
|
||||||
|
var noPickupPackageData = BaseRegex.GetJsonObjStrJson(ref data, "noPickupPackageData").FirstOrDefault();
|
||||||
|
if (!noPickupPackageData.IsNullOrEmpty() && send is ChromiumWebBrowser cef)
|
||||||
|
{
|
||||||
|
var buyer = GlobalConfig.PDDBuyerLoginList.FirstOrDefault(buy => buy.wpf_browser == cef);
|
||||||
|
if (buyer != null)
|
||||||
|
{
|
||||||
|
dicPddPickInfo[buyer] = JsonHelper.DeserializeJsonToObject<PddPickInfo>(noPickupPackageData);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (url.Contains("https://mobile.yangkeduo.com/index.html") && OpenType == EnumOpenType.login)
|
if (url.Contains("https://mobile.yangkeduo.com/index.html") && OpenType == EnumOpenType.login)
|
||||||
{
|
{
|
||||||
Task.Run(() => { CefWebBrowser.Load("https://mobile.yangkeduo.com/personal.html"); });
|
Task.Run(() => { CefWebBrowser.Load("https://mobile.yangkeduo.com/personal.html"); });
|
||||||
|
|||||||
@@ -0,0 +1,40 @@
|
|||||||
|
using AllBase.Model.Config;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using WPFCommon.Models;
|
||||||
|
|
||||||
|
namespace _29WxOrderWpf.ViewModels;
|
||||||
|
|
||||||
|
public class SettingViewModel : BindableBaseEx
|
||||||
|
{
|
||||||
|
public const string SettingFileName = "setting";
|
||||||
|
public SettingViewModel()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
/// <summary>版本号</summary>
|
||||||
|
public string Version
|
||||||
|
{
|
||||||
|
get => GetValue<string>();
|
||||||
|
private set => SetValue(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool AutoSwitchGiftType
|
||||||
|
{
|
||||||
|
get => GetValue<bool>();
|
||||||
|
set => SetValue(value);
|
||||||
|
}
|
||||||
|
public void Assign(SettingConfig config)
|
||||||
|
{
|
||||||
|
AutoSwitchGiftType = config.AutoSwitchGiftType;
|
||||||
|
}
|
||||||
|
public SettingConfig ToConfig()
|
||||||
|
{
|
||||||
|
return new SettingConfig
|
||||||
|
{
|
||||||
|
AutoSwitchGiftType = AutoSwitchGiftType
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,711 @@
|
|||||||
|
using _29WxOrderWpf.CefHelper;
|
||||||
|
using WxOrder.Framework.Commons;
|
||||||
|
using AllBase;
|
||||||
|
using AllBase.Helper;
|
||||||
|
using AllBase.Model.DBModel;
|
||||||
|
using AllBase.Model.MvvmBaseClasses;
|
||||||
|
using CefSharp;
|
||||||
|
using CefSharp.Handler;
|
||||||
|
using CefSharp.Wpf;
|
||||||
|
using NaiBa.Util.Extension;
|
||||||
|
using Org.BouncyCastle.Asn1.Ocsp;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Security.Policy;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Input;
|
||||||
|
using TemuKJD.ToolForms;
|
||||||
|
using Work;
|
||||||
|
using Work._29Tools.BLL;
|
||||||
|
using Work._29Tools.CefTools;
|
||||||
|
|
||||||
|
namespace _29WxOrderWpf.ViewModels
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 拼多多买手移动版登录窗口 视图模型(WPF 版 TaobaoLoginForm)
|
||||||
|
/// </summary>
|
||||||
|
public class TaobaoLoginViewModel : PropertyNotifyObject
|
||||||
|
{
|
||||||
|
// 拼多多买手退货退款售后地址
|
||||||
|
// https://mobile.yangkeduo.com/complaint.html?order_sn=260718-101481213440980&after_sales_reason=0&after_sales_type=2&after_sales_code=1002
|
||||||
|
|
||||||
|
List<Process> cefSubProcesses = new List<Process>();
|
||||||
|
|
||||||
|
public static TaobaoLoginViewModel TaobaoLoginInstance { get; set; } = null;
|
||||||
|
|
||||||
|
/// <summary>浏览器创建完成后触发(视图在此把浏览器加入可视树)</summary>
|
||||||
|
public event Action<ChromiumWebBrowser> BrowserCreated;
|
||||||
|
|
||||||
|
/// <summary>请求关闭窗口</summary>
|
||||||
|
public event Action RequestClose;
|
||||||
|
|
||||||
|
public int CloseAfterSecond { get; set; }
|
||||||
|
|
||||||
|
private EnumOpenType _openType = EnumOpenType.manage;
|
||||||
|
public EnumOpenType OpenType
|
||||||
|
{
|
||||||
|
get { return _openType; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_openType = value;
|
||||||
|
OnPropertyChanged(nameof(OpenType));
|
||||||
|
OnPropertyChanged(nameof(IsLoginMode));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public string InitUrl { get; set; } = "";
|
||||||
|
|
||||||
|
private string shopCookieHead = "taobao.com";
|
||||||
|
private string buyerLoginUrl = "https://login.taobao.com/havanaone/login/login.htm";
|
||||||
|
private string buyerMainUrl = "https://i.taobao.com/my_itaobao"; //"https://buyertrade.taobao.com/trade/itemlist/list_bought_items.htm?";
|
||||||
|
|
||||||
|
public ChromiumWebBrowser CefWebBrowser { get; private set; }
|
||||||
|
private BuyerLoginInfo buyer = null;
|
||||||
|
private List<ShopCompany> lstShopCompany = new List<ShopCompany>();
|
||||||
|
private string currentUrl = "";
|
||||||
|
private volatile bool _isWindowLoaded = false;
|
||||||
|
|
||||||
|
#region 界面绑定属性
|
||||||
|
|
||||||
|
/// <summary>用户名</summary>
|
||||||
|
public string UserName
|
||||||
|
{
|
||||||
|
get { return this.GetValue(x => x.UserName); }
|
||||||
|
set { this.SetValue(x => x.UserName, value); }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>密码</summary>
|
||||||
|
public string PassWord
|
||||||
|
{
|
||||||
|
get { return this.GetValue(x => x.PassWord); }
|
||||||
|
set { this.SetValue(x => x.PassWord, value); }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>地址栏</summary>
|
||||||
|
public string Address
|
||||||
|
{
|
||||||
|
get { return this.GetValue(x => x.Address); }
|
||||||
|
set { this.SetValue(x => x.Address, value); }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>登录成功后关闭窗口</summary>
|
||||||
|
public bool IsCloseAfterLogin
|
||||||
|
{
|
||||||
|
get { return this.GetValue(x => x.IsCloseAfterLogin); }
|
||||||
|
set { this.SetValue(x => x.IsCloseAfterLogin, value); }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>登录模式</summary>
|
||||||
|
public bool IsLoginMode
|
||||||
|
{
|
||||||
|
get { return this.GetValue(x => x.IsLoginMode); }
|
||||||
|
set { this.SetValue(x => x.IsLoginMode, value); }
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 命令
|
||||||
|
|
||||||
|
public ICommand ReloadCommand { get; }
|
||||||
|
public ICommand LoginAgainCommand { get; }
|
||||||
|
public ICommand StopCommand { get; }
|
||||||
|
public ICommand CopyUserNameCommand { get; }
|
||||||
|
public ICommand CopyPasswordCommand { get; }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
public TaobaoLoginViewModel(BuyerLoginInfo buyerInfo)
|
||||||
|
{
|
||||||
|
TaobaoLoginInstance = this;
|
||||||
|
|
||||||
|
buyer = buyerInfo;
|
||||||
|
UserName = buyerInfo?.buyer_name;
|
||||||
|
PassWord = ""; //DataOpenSSL.DecryptString(buyerInfo.Password);
|
||||||
|
IsCloseAfterLogin = true;
|
||||||
|
IsLoginMode = OpenType == EnumOpenType.login;
|
||||||
|
|
||||||
|
ReloadCommand = new DelegateCommand(Reload);
|
||||||
|
LoginAgainCommand = new DelegateCommand(LoginAgain);
|
||||||
|
StopCommand = new DelegateCommand(StopButton);
|
||||||
|
CopyUserNameCommand = new DelegateCommand(CopyUserName);
|
||||||
|
CopyPasswordCommand = new DelegateCommand(CopyPassword);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 窗口加载完成时调用
|
||||||
|
/// </summary>
|
||||||
|
public void Start()
|
||||||
|
{
|
||||||
|
IsLoginMode = OpenType == EnumOpenType.login;
|
||||||
|
_isWindowLoaded = true;
|
||||||
|
|
||||||
|
if (CloseAfterSecond > 0)
|
||||||
|
{
|
||||||
|
Task.Run(() =>
|
||||||
|
{
|
||||||
|
Thread.Sleep(1000 * CloseAfterSecond);
|
||||||
|
if (_isWindowLoaded)
|
||||||
|
{
|
||||||
|
Application.Current?.Dispatcher.Invoke(new Action(() =>
|
||||||
|
{
|
||||||
|
if (_isWindowLoaded)
|
||||||
|
RequestClose?.Invoke();
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
Task.Run(() =>
|
||||||
|
{
|
||||||
|
AutoLogin();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 窗口关闭时调用,停止后台任务
|
||||||
|
/// </summary>
|
||||||
|
public void Stop()
|
||||||
|
{
|
||||||
|
_isWindowLoaded = false;
|
||||||
|
|
||||||
|
// 1. 解除 JS 绑定
|
||||||
|
CefWebBrowser?.JavascriptObjectRepository?.UnRegisterAll();
|
||||||
|
CefWebBrowser?.CloseDevTools();
|
||||||
|
|
||||||
|
// 2. 优雅关闭浏览器
|
||||||
|
CefWebBrowser?.GetBrowser()?.CloseBrowser(false);
|
||||||
|
|
||||||
|
// 3. 清理残留子进程(按路径判断,避免误杀)
|
||||||
|
CleanupBrowserSubprocesses(this.cefSubProcesses);
|
||||||
|
|
||||||
|
// 4. 释放控件
|
||||||
|
CefWebBrowser?.Dispose();
|
||||||
|
CefWebBrowser = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int GetRenderProcessId()
|
||||||
|
{
|
||||||
|
int parentPid = Process.GetCurrentProcess().Id;
|
||||||
|
// 查找所有名为 CefSharp.BrowserSubprocess 且父进程为当前应用的进程
|
||||||
|
var subprocesses = Process.GetProcessesByName("CefSharp.BrowserSubprocess")
|
||||||
|
.Where(p =>
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
return p.SessionId == Process.GetCurrentProcess().SessionId && GetParentProcessId(p.Id) == parentPid;
|
||||||
|
}
|
||||||
|
catch { return false; }
|
||||||
|
});
|
||||||
|
|
||||||
|
// 返回第一个匹配的 Render 进程 ID,实际可能有多个
|
||||||
|
return subprocesses.FirstOrDefault()?.Id ?? -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 辅助方法:获取父进程 ID (需引用 System.Management 或使用 P/Invoke)
|
||||||
|
private static int GetParentProcessId(int processId)
|
||||||
|
{
|
||||||
|
using (var query = new System.Management.ManagementObjectSearcher(
|
||||||
|
$"SELECT ParentProcessId FROM Win32_Process WHERE ProcessId = {processId}"))
|
||||||
|
{
|
||||||
|
using (var results = query.Get())
|
||||||
|
{
|
||||||
|
foreach (System.Management.ManagementObject obj in results)
|
||||||
|
{
|
||||||
|
return Convert.ToInt32(obj["ParentProcessId"]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void CleanupBrowserSubprocesses(List<Process> processes = null)
|
||||||
|
{
|
||||||
|
// 有可能释放错误导致程序崩溃,废弃
|
||||||
|
return;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (processes == null)
|
||||||
|
processes = new List<Process>();
|
||||||
|
|
||||||
|
string appBasePath = AppDomain.CurrentDomain.BaseDirectory.TrimEnd('\\', '/');
|
||||||
|
Process[] subprocesses = Process.GetProcessesByName("CefSharp.BrowserSubprocess");
|
||||||
|
|
||||||
|
foreach (Process process in subprocesses)
|
||||||
|
{
|
||||||
|
bool shouldKill = false;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// 安全地获取进程模块信息,进程可能在我们检查时已退出
|
||||||
|
if (process != null && !process.HasExited)
|
||||||
|
{
|
||||||
|
string moduleFileName = process.MainModule?.FileName;
|
||||||
|
if (!string.IsNullOrEmpty(moduleFileName))
|
||||||
|
{
|
||||||
|
// 判断进程是否从当前应用目录启动
|
||||||
|
string processDir = System.IO.Path.GetDirectoryName(moduleFileName);
|
||||||
|
if (!string.IsNullOrEmpty(processDir) &&
|
||||||
|
(processDir.Equals(appBasePath, StringComparison.OrdinalIgnoreCase)
|
||||||
|
|| appBasePath.Contains(processDir) // 处理子目录情况
|
||||||
|
|| moduleFileName.Contains(appBasePath)))
|
||||||
|
{
|
||||||
|
if (!processes.Any(p => p.Handle.ParseToInt() == process.Handle.ParseToInt()))
|
||||||
|
shouldKill = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (InvalidOperationException)
|
||||||
|
{
|
||||||
|
// 进程可能在检查过程中已退出,忽略
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
catch (Win32Exception ex) when (ex.NativeErrorCode == 5) // 访问被拒绝
|
||||||
|
{
|
||||||
|
// 可能是权限问题或其他应用的进程,跳过
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (shouldKill)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
process.Kill();
|
||||||
|
process.WaitForExit(500); // 等待最多500毫秒,确保进程终止
|
||||||
|
}
|
||||||
|
catch (Exception killEx)
|
||||||
|
{
|
||||||
|
// 记录日志,但通常进程已死
|
||||||
|
//System.Diagnostics.Debug.WriteLine($"终止进程时出错: {killEx.Message}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
// 这里最好不要用MessageBox,尤其是在关闭流程中,可能引发线程问题
|
||||||
|
// 建议记录到日志文件
|
||||||
|
//System.Diagnostics.Debug.WriteLine($"清理子进程时发生异常: {ex}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 自动登录店铺后台
|
||||||
|
/// </summary>
|
||||||
|
private async void AutoLogin()
|
||||||
|
{
|
||||||
|
if (OpenType != EnumOpenType.login && buyer == null)
|
||||||
|
return;
|
||||||
|
_ = Application.Current.Dispatcher.InvokeAsync(async () =>
|
||||||
|
{
|
||||||
|
if (CefWebBrowser == null)
|
||||||
|
{
|
||||||
|
this.cefSubProcesses = Process.GetProcessesByName("CefSharp.BrowserSubprocess").ToList();
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(InitUrl))
|
||||||
|
CefWebBrowser = WPFCEFBrowser.CreateChromiumWebBrowser(InitUrl, false);
|
||||||
|
else
|
||||||
|
CefWebBrowser = WPFCEFBrowser.CreateChromiumWebBrowser(buyerMainUrl, false);
|
||||||
|
|
||||||
|
LocalResourceRequestHandler resourceRequestHandler = new LocalResourceRequestHandler();
|
||||||
|
resourceRequestHandler.ResourceLoadCompleteEvent += RequestHandler_ResourceLoadComplete;
|
||||||
|
resourceRequestHandler.BeforeResourceLoadEvent += RequestHandler_BeforeResourceLoad;
|
||||||
|
CefWebBrowser.RequestHandler = new LocalRequestHandler(resourceRequestHandler);
|
||||||
|
var lifeSapnHandler = new LocalLifeSpanHandler(PopWindowType.SelfWindow);
|
||||||
|
CefWebBrowser.LifeSpanHandler = lifeSapnHandler;
|
||||||
|
//CefWebBrowser.KeyboardHandler = new KeyboardHandler();
|
||||||
|
CefWebBrowser.KeyboardHandler = new CefKeyboardHandler();
|
||||||
|
CefWebBrowser.FrameLoadEnd += CefWebBrowser_FrameLoadEnd;
|
||||||
|
CefWebBrowser.AddressChanged += CefWebBrowser_AddressChanged;
|
||||||
|
CefWebBrowser.LoadError += CefWebBrowser_LoadError;
|
||||||
|
|
||||||
|
// 通知视图把浏览器加入可视树(必须在等待浏览器初始化之前完成)
|
||||||
|
BrowserCreated?.Invoke(CefWebBrowser);
|
||||||
|
|
||||||
|
List<Cookie> cookieLst = new List<Cookie>();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (buyer != null)
|
||||||
|
{
|
||||||
|
cookieLst = JsonHelper.DeserializeJsonToList<CefSharp.Cookie>(buyer?.cookie);
|
||||||
|
if (cookieLst == null)
|
||||||
|
cookieLst = new List<Cookie>();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// cef138必须init后方可设置或删除cookie
|
||||||
|
|
||||||
|
while (!CefWebBrowser.IsBrowserInitialized || !CefWebBrowser.GetBrowser().MainFrame.IsValid)
|
||||||
|
await Task.Delay(20);
|
||||||
|
//await WPFCEFBrowser.DeleteCookieAsync(CefWebBrowser.GetCookieManager(null));
|
||||||
|
|
||||||
|
//cef 138 如果没有设置RequestContext 可能为空,直接getCookieManager
|
||||||
|
//await WPFCEFBrowser.SetCookieAsync(JsonHelper.SerializeObject(cookieLst), CefWebBrowser.GetCookieManager(null));
|
||||||
|
if (OpenType != EnumOpenType.login)
|
||||||
|
foreach (var cook in cookieLst)
|
||||||
|
{
|
||||||
|
await WPFCEFBrowser.SetCookieAsync(cook.Domain.Trim('.'), cook.Name + "=" + cook.Value + ";", CefWebBrowser.GetCookieManager(null));
|
||||||
|
//t.Wait(5000);
|
||||||
|
}
|
||||||
|
|
||||||
|
//根据登录的具体店铺设置local storage
|
||||||
|
if (!string.IsNullOrEmpty(buyer?.buyer_id))
|
||||||
|
{
|
||||||
|
//var storageJsCode = "window.localStorage.setItem('" + "mall-info-id" + "', '" + shop.ShopId + "');\r\n";
|
||||||
|
//storageJsCode += "window.localStorage.setItem('" + "agentseller-mall-info-id" + "', '" + shop.ShopId + "');\r\n";
|
||||||
|
//while (!CefWebBrowser.IsBrowserInitialized || !CefWebBrowser.GetBrowser().MainFrame.IsValid)
|
||||||
|
// Thread.Sleep(20);
|
||||||
|
//CefWebBrowser.GetBrowser().MainFrame.ExecuteJavaScriptAsync(storageJsCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(InitUrl))
|
||||||
|
CefWebBrowser.Load(InitUrl);
|
||||||
|
else
|
||||||
|
CefWebBrowser.Load(buyerMainUrl);
|
||||||
|
|
||||||
|
//不是登录的话就此返回
|
||||||
|
if (OpenType != EnumOpenType.login)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < 50; i++)
|
||||||
|
{
|
||||||
|
if (CefWebBrowser.IsLoading)
|
||||||
|
await Task.Delay(100);
|
||||||
|
}
|
||||||
|
await Task.Delay(Randomx.GetId(1500, 2000));
|
||||||
|
if (!_isWindowLoaded)
|
||||||
|
return;
|
||||||
|
|
||||||
|
while (!CefWebBrowser.Address?.StartsWith(buyerLoginUrl) ?? false)
|
||||||
|
{
|
||||||
|
await Task.Delay(1000);
|
||||||
|
if (!_isWindowLoaded)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private void CefWebBrowser_LoadError(object sender, CefSharp.LoadErrorEventArgs e)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
private void CefWebBrowser_AddressChanged(object sender, DependencyPropertyChangedEventArgs e)
|
||||||
|
{
|
||||||
|
if (Application.Current?.Dispatcher != null)
|
||||||
|
{
|
||||||
|
Application.Current.Dispatcher.Invoke(new Action(() =>
|
||||||
|
{
|
||||||
|
currentUrl = e.NewValue.ParseToString();
|
||||||
|
Address = e.NewValue.ParseToString();
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void CefWebBrowser_FrameLoadEnd(object sender, CefSharp.FrameLoadEndEventArgs e)
|
||||||
|
{
|
||||||
|
//js绑定C#对象 html页面内声明绑定的C#对象
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.Append("(function(){");
|
||||||
|
sb.Append("CefSharp.BindObjectAsync('shopObj');");
|
||||||
|
sb.Append("})();");
|
||||||
|
CefWebBrowser.GetBrowser().MainFrame.EvaluateScriptAsync(sb.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool RequestHandler_BeforeResourceLoad(object sender, string url, string postData, IRequest request)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private async void RequestHandler_ResourceLoadComplete(object sender, string url, string postData, string responseData, IRequest request)
|
||||||
|
{
|
||||||
|
await DoResourceLoadComplete(url, responseData);
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task DoResourceLoadComplete(string url, string responseData)
|
||||||
|
{
|
||||||
|
//if (url.Contains(buyerLoginUrl) && OpenType == EnumOpenType.login)
|
||||||
|
//{
|
||||||
|
// Task.Run(() => { CefWebBrowser.Load(buyerLoginUrl); });
|
||||||
|
//}
|
||||||
|
var data = responseData;
|
||||||
|
//if (data.Contains("karl_malone_32") || data.Contains("jtt_fan"))
|
||||||
|
{
|
||||||
|
|
||||||
|
//https://h5api.m.taobao.com/h5/mtop.user.getusersimple/1.0/?jsv=2.7.2&appKey=12574478&t=1789984970076&sign=6bb7d3b5cd8bd3ab32bd97c1a0df1c0f&jsonpIncPrefix=tbnavnew&api=mtop.user.getUserSimple&v=1.0&dataType=json&type=originaljson&data=%7B%7D
|
||||||
|
//{"api":"mtop.user.getUserSimple","v":"1.0","ret":["SUCCESS::调用成功"],"data":{"nick":"jtt_fan","userNumId":440631048,"displayNick":"jtt_fan"}}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (url.Contains(buyerMainUrl) || (data.Contains("\"displayNick\"") && data.Contains("\"nick\"") && data.Contains("\"userNumId\"")))
|
||||||
|
{
|
||||||
|
if (OpenType == EnumOpenType.login)
|
||||||
|
{
|
||||||
|
await Task.Run(async () =>
|
||||||
|
{
|
||||||
|
if (data.Contains("\"ret\":[\"SUCCESS::调用成功\"]"))
|
||||||
|
{
|
||||||
|
var uid = BaseRegex.GetStringJson(ref data, "userNumId");
|
||||||
|
var nickname = BaseRegex.GetStringJson(ref data, "displayNick");
|
||||||
|
var username = nickname;
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(nickname) && !string.IsNullOrEmpty(uid) && !isAddOrUpdateBuyer)
|
||||||
|
{
|
||||||
|
isAddOrUpdateBuyer = true;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
AddOrUpdateBuyer(uid, username, nickname);
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
}
|
||||||
|
isAddOrUpdateBuyer = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool isAddOrUpdateBuyer = false;
|
||||||
|
|
||||||
|
void AddOrUpdateBuyer(string uid, string username, string nickname)
|
||||||
|
{
|
||||||
|
Thread.Sleep(2000);
|
||||||
|
|
||||||
|
//List<Cookie> cookieList = WPFCEFBrowser.GetCookieList(shopCookieHead, CefWebBrowser.GetCookieManager(null));
|
||||||
|
List<Cookie> cookieList = WPFCEFBrowser.GetCookieList("", CefWebBrowser.GetCookieManager(null));
|
||||||
|
|
||||||
|
var buyerUrl = BaseClass.Build29WxObjString("user/add_taobao_buyer");
|
||||||
|
|
||||||
|
if (this.buyer == null || this.buyer.buyer_id != uid)
|
||||||
|
this.buyer = GlobalConfig.TaobaoBuyerLoginList.FirstOrDefault(b => b.buyer_id == uid);
|
||||||
|
if (this.buyer != null)
|
||||||
|
{
|
||||||
|
this.buyer.status = "在线";
|
||||||
|
this.buyer.user_name = username;
|
||||||
|
this.buyer.buyer_nick = nickname;
|
||||||
|
this.buyer.cookie = JsonHelper.SerializeObject(cookieList);
|
||||||
|
buyerUrl = BaseClass.Build29WxObjString("user/mdy_taobao_buyer");
|
||||||
|
}
|
||||||
|
|
||||||
|
var buyerData = UserLogin.GetSignaturex()
|
||||||
|
+ "&buyer_id=" + uid
|
||||||
|
+ "&buyer_name=" + username
|
||||||
|
+ "&buyer_nick=" + nickname;
|
||||||
|
var result = GetHtml.PostUtf8(buyerUrl, buyerData);
|
||||||
|
if (string.IsNullOrEmpty(result) || !result.Contains("\"code\":200"))
|
||||||
|
result = GetHtml.PostUtf8(buyerUrl, buyerData);
|
||||||
|
|
||||||
|
buyerUrl = BaseClass.Build29WxObjString("user/mdy_taobao_buyer_cookie");
|
||||||
|
buyerData = UserLogin.GetSignaturex()
|
||||||
|
+ "&buyer_id=" + uid
|
||||||
|
+ "&status=" + "在线"
|
||||||
|
+ "&cookie=" + GetHtml.UrlEncodeUtf8(JsonHelper.SerializeObject(cookieList));
|
||||||
|
result = GetHtml.PostUtf8(buyerUrl, buyerData);
|
||||||
|
if (string.IsNullOrEmpty(result) || !result.Contains("\"code\":200"))
|
||||||
|
result = GetHtml.PostUtf8(buyerUrl, buyerData);
|
||||||
|
|
||||||
|
Application.Current?.Dispatcher.Invoke(new Action(() =>
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (IsCloseAfterLogin)
|
||||||
|
RequestClose?.Invoke();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{ }
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void StopButton()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
private void CopyUserName()
|
||||||
|
{
|
||||||
|
if (!string.IsNullOrEmpty(UserName))
|
||||||
|
Clipboard.SetDataObject(UserName);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void CopyPassword()
|
||||||
|
{
|
||||||
|
if (!string.IsNullOrEmpty(PassWord))
|
||||||
|
Clipboard.SetDataObject(PassWord);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Reload()
|
||||||
|
{
|
||||||
|
if (CefWebBrowser != null)
|
||||||
|
{
|
||||||
|
if (Address != "about:blank")
|
||||||
|
CefWebBrowser.Load(Address);
|
||||||
|
else
|
||||||
|
CefWebBrowser.Load(buyerMainUrl);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void LoginAgain()
|
||||||
|
{
|
||||||
|
if (this.currentUrl != buyerLoginUrl)
|
||||||
|
this.CefWebBrowser?.Load(buyerLoginUrl);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region 静态方法(检测/更新买手登录状态)
|
||||||
|
|
||||||
|
public static void CheckBuyerLogin(List<BuyerLoginInfo> checkBuyers, bool isShowProgress = true)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < checkBuyers.Count; i++)
|
||||||
|
{
|
||||||
|
var buyer = GlobalConfig.TaobaoBuyerLoginList.FirstOrDefault(v => v.buyer_id == checkBuyers[i].buyer_id);
|
||||||
|
var buys = GlobalConfig.TaobaoBuyerLoginList.Where(v => v.buyer_id == checkBuyers[i].buyer_id).ToList();
|
||||||
|
if (buyer == null)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
// 先从服务端取最新cookie
|
||||||
|
var url = BaseClass.Build29WxObjString("user/get_taobao_buyer");
|
||||||
|
var data = UserLogin.GetSignaturex();
|
||||||
|
data += "&buyer_ids=" + buyer.buyer_id;
|
||||||
|
data += "&page_size=1";
|
||||||
|
var result = GetHtml.PostUtf8(url, data);
|
||||||
|
if (string.IsNullOrEmpty(result) || !result.Contains("\"code\":200"))
|
||||||
|
result = GetHtml.PostUtf8(url, data);
|
||||||
|
if (!result.Contains("\"code\":200"))
|
||||||
|
continue;
|
||||||
|
List<BuyerLoginInfo> loginInfoLst = JsonHelper.DeserializeJsonToList<BuyerLoginInfo>(JsonHelper.JObjectParse(result)["data"].ParseToString());
|
||||||
|
|
||||||
|
var serverBuyer = loginInfoLst.FirstOrDefault();
|
||||||
|
if (buyer != null && serverBuyer != null)
|
||||||
|
{
|
||||||
|
buyer.cookie = serverBuyer.cookie;
|
||||||
|
foreach (var buy in buys)
|
||||||
|
{
|
||||||
|
buy.cookie = serverBuyer.cookie;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (buyer != null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
|
||||||
|
var loginResult = CheckBuyerLogin(buyer);
|
||||||
|
if (!loginResult.Contains("\"success\":true") && !loginResult.Contains("\"login\":true") && !loginResult.Contains("\"nickname\""))
|
||||||
|
{
|
||||||
|
buyer.cookie = "[]";
|
||||||
|
foreach (var buy in buys)
|
||||||
|
{
|
||||||
|
buy.status = "掉线";
|
||||||
|
buy.cookie = "[]";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
foreach (var buy in buys)
|
||||||
|
{
|
||||||
|
buy.status = "在线";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
UpdateServerBuyerCookies(buyer); // 店铺cookie和状态写入服务端
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string CheckBuyerLogin(BuyerLoginInfo buyer, string refere = "https://mobile.yangkeduo.com/goods.html")
|
||||||
|
{
|
||||||
|
string url = "https://mobile.yangkeduo.com/proxy/api/api/apollo/v3/user/me?pdduid=" + buyer.buyer_id;
|
||||||
|
return HttpResponseYkdBLL.YangkeduoGetResponse(buyer, url, refere);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string UpdateServerBuyerCookies(BuyerLoginInfo buyer, string fromTool = null)
|
||||||
|
{
|
||||||
|
var url = BaseClass.Build29WxObjString("user/mdy_taobao_buyer_cookie");
|
||||||
|
var data = UserLogin.GetSignaturex()
|
||||||
|
+ "&status=" + buyer.status
|
||||||
|
+ "&cookie=" + GetHtml.UrlEncodeUtf8(buyer.cookie)
|
||||||
|
+ "&buyer_id=" + buyer.buyer_id;
|
||||||
|
var result = GetHtml.PostUtf8(url, data);
|
||||||
|
if (!result.Contains("\"code\":200"))
|
||||||
|
result = GetHtml.PostUtf8(url, data);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 设置淘宝店铺掉线
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="buyer"></param>
|
||||||
|
/// <param name="fromTool"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static string UpdateServerBuyerDisconnect(BuyerLoginInfo buyer, string fromTool = null)
|
||||||
|
{
|
||||||
|
//buyer.status = "掉线";
|
||||||
|
//buyer.cookie = "[]";
|
||||||
|
//var url = BaseClass.Build29WxObjString("user/mdy_taobao_buyer_cookie");
|
||||||
|
//var data = UserLogin.GetSignaturex()
|
||||||
|
// + "&status=" + "掉线"
|
||||||
|
// + "&cookie=" + "[]"
|
||||||
|
// + "&buyer_id=" + buyer.buyer_id;
|
||||||
|
//var result = GetHtml.PostUtf8(url, data);
|
||||||
|
//if (!result.Contains("\"code\":200"))
|
||||||
|
// result = GetHtml.PostUtf8(url, data);
|
||||||
|
//return result;
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
internal class CefKeyboardHandler : IKeyboardHandler
|
||||||
|
{
|
||||||
|
public bool OnKeyEvent(IWebBrowser browserControl, IBrowser browser, KeyType type, int windowsKeyCode, int nativeKeyCode, CefEventFlags modifiers, bool isSystemKey)
|
||||||
|
{
|
||||||
|
if (type == KeyType.KeyUp && Enum.IsDefined(typeof(System.Windows.Forms.Keys), windowsKeyCode))
|
||||||
|
{
|
||||||
|
var key = (System.Windows.Forms.Keys)windowsKeyCode;
|
||||||
|
switch (key)
|
||||||
|
{
|
||||||
|
case System.Windows.Forms.Keys.F12:
|
||||||
|
browser.ShowDevTools();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case System.Windows.Forms.Keys.F5:
|
||||||
|
|
||||||
|
if (modifiers == CefEventFlags.ControlDown)
|
||||||
|
{
|
||||||
|
//MessageBox.Show("ctrl+f5");
|
||||||
|
browser.Reload(true); //强制忽略缓存
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//MessageBox.Show("f5");
|
||||||
|
browser.Reload();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool OnPreKeyEvent(IWebBrowser browserControl, IBrowser browser, KeyType type, int windowsKeyCode, int nativeKeyCode, CefEventFlags modifiers, bool isSystemKey, ref bool isKeyboardShortcut)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,171 @@
|
|||||||
|
using _29WxOrderWpf.BaseWindows;
|
||||||
|
using WxOrder.Framework.Commons;
|
||||||
|
using _29WxOrderWpf.Ctrls.OrderCtrls;
|
||||||
|
using AllBase;
|
||||||
|
using AllBase.Helper;
|
||||||
|
using AllBase.Model.Config;
|
||||||
|
using AllBase.Model.DBModel;
|
||||||
|
using AllBase.Model.MvvmBaseClasses;
|
||||||
|
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;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Input;
|
||||||
|
using System.Windows.Threading;
|
||||||
|
using Work;
|
||||||
|
using Work._29Tools.BLL;
|
||||||
|
using Work._29Tools.Forms.ShopForms;
|
||||||
|
|
||||||
|
namespace _29WxOrderWpf.ViewModels
|
||||||
|
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 更改运单号ViewModel
|
||||||
|
/// </summary>
|
||||||
|
public class TransitExtraPackagesViewModel : PropertyNotifyObject
|
||||||
|
{
|
||||||
|
public oms_wei_order_info Order
|
||||||
|
{
|
||||||
|
get { return this.GetValue(x => x.Order); }
|
||||||
|
set { this.SetValue(x => x.Order, value); }
|
||||||
|
}
|
||||||
|
public oms_wei_order_item_info OrderItem
|
||||||
|
{
|
||||||
|
get { return this.GetValue(x => x.OrderItem); }
|
||||||
|
set { this.SetValue(x => x.OrderItem, value); }
|
||||||
|
}
|
||||||
|
public string purchaserNote
|
||||||
|
{
|
||||||
|
get { return this.GetValue(x => x.purchaserNote); }
|
||||||
|
set { this.SetValue(x => x.purchaserNote, value); }
|
||||||
|
}
|
||||||
|
public string WaybillId
|
||||||
|
{
|
||||||
|
get { return this.GetValue(x => x.WaybillId); }
|
||||||
|
set { this.SetValue(x => x.WaybillId, value); }
|
||||||
|
}
|
||||||
|
public bool IsChangeingWaybill
|
||||||
|
{
|
||||||
|
get { return this.GetValue(x => x.IsChangeingWaybill); }
|
||||||
|
set { this.SetValue(x => x.IsChangeingWaybill, value); }
|
||||||
|
}
|
||||||
|
public bool ChangeWaybillSuccess
|
||||||
|
{
|
||||||
|
get { return this.GetValue(x => x.ChangeWaybillSuccess); }
|
||||||
|
set { this.SetValue(x => x.ChangeWaybillSuccess, value); }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 请求关闭窗口
|
||||||
|
/// </summary>
|
||||||
|
public event Action RequestClose;
|
||||||
|
|
||||||
|
#region 命令
|
||||||
|
|
||||||
|
public ICommand AddExtraPackagesCommand { get; }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
private volatile bool _isWindowLoaded = false;
|
||||||
|
|
||||||
|
public TransitExtraPackagesViewModel(oms_wei_order_info _order, oms_wei_order_item_info _orderItem)
|
||||||
|
{
|
||||||
|
Order = _order;
|
||||||
|
OrderItem = _orderItem;
|
||||||
|
|
||||||
|
AddExtraPackagesCommand = new DelegateCommand(AddExtraPackages);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 窗口加载完成时调用
|
||||||
|
/// </summary>
|
||||||
|
public void Start()
|
||||||
|
{
|
||||||
|
_isWindowLoaded = true;
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 窗口关闭时调用,停止后台任务
|
||||||
|
/// </summary>
|
||||||
|
public void Stop()
|
||||||
|
{
|
||||||
|
_isWindowLoaded = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void AddExtraPackages()
|
||||||
|
{
|
||||||
|
var transitOrder = OrderItem.ItemTransitOrder ?? OrderItem.ItemTransitOrderWithVoid;
|
||||||
|
var transitExtraOrder = OrderItem.ItemTransitExtraOrders.FirstOrDefault(t => t.order_void_status != 1);
|
||||||
|
if (transitExtraOrder != null)
|
||||||
|
{
|
||||||
|
BaseMsgWindow.ShowError("有尚未作废的补发订单,请作废后再创建");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
string basePostageKey = WarehousePostageInfo.DicWarehousePostage.Keys.FirstOrDefault(pk => (OrderItem.ItemOrder?.province_name).ParseToString().Contains(pk));
|
||||||
|
decimal basePostage = basePostageKey.IsNullOrEmpty() ? WarehousePostageInfo.DicWarehousePostage.Values.Min() : WarehousePostageInfo.DicWarehousePostage[basePostageKey];
|
||||||
|
JObject body = new JObject();
|
||||||
|
body["oemAmount"] = (BaseClass.PostagePerOrderDiff * 100).ParseToInt().ParseToString();
|
||||||
|
body["postage"] = ((basePostage + BaseClass.PostagePerOrderDiff) * 100).ParseToInt().ParseToString();
|
||||||
|
|
||||||
|
body["packType"] = "2";
|
||||||
|
body["batchId"] = transitOrder.order_code + "-" + ((OrderItem.ItemTransitExtraOrders?.Count).ParseToInt() + 1);
|
||||||
|
body["orderNo"] = OrderItem.order_id;
|
||||||
|
body["orderCode"] = transitOrder.order_code;
|
||||||
|
|
||||||
|
// 未出库填上游物流,已出库填下游物流
|
||||||
|
if (transitOrder.warehouse_status != 2)
|
||||||
|
{
|
||||||
|
body["logisticsCode"] = transitOrder.express_1_company;
|
||||||
|
body["logisticsExpressCode"] = transitOrder.express_1_waybill;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
body["logisticsCode"] = transitOrder.express_2_company;
|
||||||
|
body["logisticsExpressCode"] = transitOrder.express_2_waybill;
|
||||||
|
}
|
||||||
|
|
||||||
|
body["accountUser"] = BaseClass.UserName;
|
||||||
|
body["purchaserNote"] = purchaserNote.ParseToString(); // 采购人备注
|
||||||
|
body["orderPlatformCode"] = "WEISHOP";
|
||||||
|
|
||||||
|
var url = "https://po.e57.cn/prod-api/api/oms-api/external_procurement/extra-packages/save";
|
||||||
|
var dataStr = JsonHelper.SerializeObject(body);
|
||||||
|
//<AjaxResult><msg>parentOrderCode不能为空</msg><code>2</code></AjaxResult>
|
||||||
|
//<AjaxResult><msg>创建额外包裹异常: Cannot invoke "cn.qihangerp.oms.domain.SecondUser.getBalance()" because "secondUser" is null</msg><code>2</code></AjaxResult>
|
||||||
|
var rst = HttpResponseWXBLL.e57PostResponse(url, dataStr, "");
|
||||||
|
//3739278903964250368
|
||||||
|
// <AjaxResult><msg>创建额外包裹异常: 用户账户余额不足,需至少 2.20 元用于中转仓取号, userId:17333276316, balance:0.85</msg><code>2</code></AjaxResult>
|
||||||
|
if (BaseRegex.GetStringXml(ref rst, "code") != "0" && BaseRegex.GetStringXml(ref rst, "code") != "200")
|
||||||
|
{
|
||||||
|
BaseMsgWindow.ShowError(BaseRegex.GetStringXml(ref rst, "msg"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var data = new JObject();
|
||||||
|
data["batchId"] = body["batchId"];
|
||||||
|
data["orderCode"] = body["orderCode"];
|
||||||
|
dataStr = JsonHelper.SerializeObject(data);
|
||||||
|
url = "https://po.e57.cn/prod-api/api/oms-api/external_procurement/thirdparty/extraPackages";
|
||||||
|
rst = HttpResponseWXBLL.e57PostResponse(url, dataStr, "");
|
||||||
|
// <AjaxResult><msg>额外信息已保存</msg><code>200</code></AjaxResult>
|
||||||
|
if (BaseRegex.GetStringXml(ref rst, "code") != "0" && BaseRegex.GetStringXml(ref rst, "code") != "200")
|
||||||
|
{
|
||||||
|
BaseMsgWindow.ShowError(BaseRegex.GetStringXml(ref rst, "msg"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Task.Run(() =>
|
||||||
|
{
|
||||||
|
StartUp.UpdateBalance();
|
||||||
|
MainWindow.Instance.orderListCtrl.GetOrder(OrderItem.order_id);
|
||||||
|
});
|
||||||
|
RequestClose?.Invoke();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,136 @@
|
|||||||
|
<UserControl
|
||||||
|
x:Class="_29WxOrderWpf.Views.AutoBuyIntroductionView"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:UserControls="clr-namespace:_29WxOrderWpf.UserControls"
|
||||||
|
xmlns:comn="WxOrder.Framework"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:local="clr-namespace:_29WxOrderWpf.Views"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
x:Name="AutoBuyInstructionView"
|
||||||
|
Width="800"
|
||||||
|
Height="450"
|
||||||
|
comn:DialogWindowProperty.ResizeMode="CanResizeWithGrip"
|
||||||
|
comn:DialogWindowProperty.ShowMinButton="False"
|
||||||
|
d:DesignHeight="450"
|
||||||
|
d:DesignWidth="800"
|
||||||
|
Loaded="AutoBuyInstructionView_Loaded"
|
||||||
|
mc:Ignorable="d">
|
||||||
|
<Grid Background="White">
|
||||||
|
<TextBlock
|
||||||
|
Margin="70,83,0,0"
|
||||||
|
HorizontalAlignment="Left"
|
||||||
|
VerticalAlignment="Top"
|
||||||
|
Text="请输入支付宝支付密码:"
|
||||||
|
TextWrapping="Wrap" />
|
||||||
|
|
||||||
|
<PasswordBox
|
||||||
|
x:Name="pbxPassWord"
|
||||||
|
Width="169"
|
||||||
|
Height="24"
|
||||||
|
Margin="198,79,0,0"
|
||||||
|
HorizontalAlignment="Left"
|
||||||
|
VerticalAlignment="Top"
|
||||||
|
VerticalContentAlignment="Center"
|
||||||
|
PasswordChanged="pbxPassWord_PasswordChanged" />
|
||||||
|
<TextBox
|
||||||
|
x:Name="txtPassWord"
|
||||||
|
Width="149"
|
||||||
|
Height="24"
|
||||||
|
Margin="198,79,0,0"
|
||||||
|
HorizontalAlignment="Left"
|
||||||
|
VerticalAlignment="Top"
|
||||||
|
VerticalContentAlignment="Center"
|
||||||
|
d:IsHitTestVisible="True"
|
||||||
|
d:Opacity="0.3"
|
||||||
|
d:Text="明文密码"
|
||||||
|
d:Visibility="Visible"
|
||||||
|
BorderBrush="Transparent"
|
||||||
|
IsHitTestVisible="True"
|
||||||
|
TextChanged="txtPassWord_TextChanged"
|
||||||
|
Visibility="Collapsed" />
|
||||||
|
<Button
|
||||||
|
x:Name="btnSee"
|
||||||
|
Width="18"
|
||||||
|
Height="18"
|
||||||
|
Margin="347,82,0,0"
|
||||||
|
Padding="0"
|
||||||
|
HorizontalAlignment="Left"
|
||||||
|
VerticalAlignment="Top"
|
||||||
|
Background="Transparent"
|
||||||
|
BorderBrush="Transparent"
|
||||||
|
Click="btnSee_Click"
|
||||||
|
Content="👁"
|
||||||
|
Cursor="Hand"
|
||||||
|
Foreground="{StaticResource PageLinkBrush}" />
|
||||||
|
<Button
|
||||||
|
x:Name="btnSaveAliPass"
|
||||||
|
Width="Auto"
|
||||||
|
Height="22"
|
||||||
|
MinWidth="48"
|
||||||
|
Margin="372,80,0,0"
|
||||||
|
Padding="4,0"
|
||||||
|
HorizontalAlignment="Left"
|
||||||
|
VerticalAlignment="Top"
|
||||||
|
Click="btnSaveAliPass_Click"
|
||||||
|
Content="保存密码"
|
||||||
|
FontSize="12"
|
||||||
|
Style="{StaticResource BasePageButtonStyle}"
|
||||||
|
Visibility="Visible" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
x:Name="btnClear"
|
||||||
|
Width="Auto"
|
||||||
|
Height="22"
|
||||||
|
MinWidth="48"
|
||||||
|
Margin="433,80,0,0"
|
||||||
|
Padding="4,0"
|
||||||
|
HorizontalAlignment="Left"
|
||||||
|
VerticalAlignment="Top"
|
||||||
|
Click="btnClear_Click"
|
||||||
|
Content="清空密码"
|
||||||
|
FontSize="12"
|
||||||
|
Style="{StaticResource BasePageButtonLightStyle}"
|
||||||
|
Visibility="Visible" />
|
||||||
|
<WrapPanel Margin="70,120,70,70" VerticalAlignment="Top">
|
||||||
|
<CheckBox
|
||||||
|
x:Name="chkMinProfitAutoBuy"
|
||||||
|
Margin="2,0"
|
||||||
|
HorizontalAlignment="Left"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
BorderBrush="{StaticResource mainColorBrush}"
|
||||||
|
Click="chkMinProfitAutoBuy_Click"
|
||||||
|
Content="当利润低于如下金额时跳过自动拍单:"
|
||||||
|
FontSize="12" />
|
||||||
|
<TextBox
|
||||||
|
x:Name="txtMinProfitAutoBuy"
|
||||||
|
Width="54"
|
||||||
|
Height="22"
|
||||||
|
HorizontalAlignment="Left"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
VerticalContentAlignment="Center"
|
||||||
|
d:Text="0.0"
|
||||||
|
d:Visibility="Visible"
|
||||||
|
TextChanged="txtMinProfitAutoBuy_TextChanged" />
|
||||||
|
<TextBlock Margin="3,0,0,0" VerticalAlignment="Center">
|
||||||
|
元
|
||||||
|
</TextBlock>
|
||||||
|
<Button
|
||||||
|
x:Name="btnSaveMinProfitAutoBuy"
|
||||||
|
Width="Auto"
|
||||||
|
Height="22"
|
||||||
|
MinWidth="48"
|
||||||
|
Margin="5,0"
|
||||||
|
Padding="4,0"
|
||||||
|
HorizontalAlignment="Left"
|
||||||
|
VerticalAlignment="Top"
|
||||||
|
Click="btnSaveMinProfitAutoBuy_Click"
|
||||||
|
Content="确定修改"
|
||||||
|
FontSize="12"
|
||||||
|
Style="{StaticResource BasePageButtonStyle}"
|
||||||
|
Visibility="Visible" />
|
||||||
|
|
||||||
|
</WrapPanel>
|
||||||
|
<TextBlock Margin="70,160,70,70" TextWrapping="Wrap"><Run Text="说明:" /><Run Text="自动拍单支持已创建sku关联的商品" /><Run Language="zh-cn" Text="。" /><LineBreak /><Run Text=" " /><Run Text="请保存支付宝支付密码(仅记录在本地)供自动拍单支付,首次自动拍单前请手动拍单一次以缓存支付宝Cookie。" /></TextBlock>
|
||||||
|
</Grid>
|
||||||
|
</UserControl>
|
||||||
@@ -0,0 +1,95 @@
|
|||||||
|
using _29WxOrderWpf.BaseWindows;
|
||||||
|
using AllBase.Helper;
|
||||||
|
using AllBase.Model.DBModel;
|
||||||
|
using NaiBa.Util;
|
||||||
|
using NaiBa.Util.Extension;
|
||||||
|
using NaiBa.Util.Helper;
|
||||||
|
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.Pinduoduo;
|
||||||
|
|
||||||
|
namespace _29WxOrderWpf.Views
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// AutoBuyInstructionView_.xaml 的交互逻辑
|
||||||
|
/// </summary>
|
||||||
|
public partial class AutoBuyIntroductionView : UserControl
|
||||||
|
{
|
||||||
|
public AutoBuyIntroductionView()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void AutoBuyInstructionView_Loaded(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
this.pbxPassWord.Password = DataOpenSSL.DecryptString(GlobalConfig.AutoBuyConfig.AlipayPassword);
|
||||||
|
this.chkMinProfitAutoBuy.IsChecked = GlobalConfig.AutoBuyConfig.IsLimitMinProfit;
|
||||||
|
this.txtMinProfitAutoBuy.Text = "" + GlobalConfig.AutoBuyConfig.MinProfit * 0.01m;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void btnSaveAliPass_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
GlobalConfig.AutoBuyConfig.AlipayPassword = DataOpenSSL.EncryptString(this.pbxPassWord.Password);
|
||||||
|
ConfigHelper.SaveConfig("auto_buy_config", GlobalConfig.AutoBuyConfig);
|
||||||
|
BaseMsgWindow.ShowInfo("密码保存成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void btnClear_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
this.pbxPassWord.Password = "";
|
||||||
|
GlobalConfig.AutoBuyConfig.AlipayPassword = "";
|
||||||
|
ConfigHelper.SaveConfig("auto_buy_config", GlobalConfig.AutoBuyConfig);
|
||||||
|
BaseMsgWindow.ShowInfo("密码已清除!");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void btnSee_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
if (txtPassWord.Visibility == Visibility.Visible)
|
||||||
|
txtPassWord.Visibility = Visibility.Collapsed;
|
||||||
|
else
|
||||||
|
txtPassWord.Visibility = Visibility.Visible;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void pbxPassWord_PasswordChanged(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
if (txtPassWord.Text != pbxPassWord.Password)
|
||||||
|
txtPassWord.Text = pbxPassWord.Password;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void txtPassWord_TextChanged(object sender, TextChangedEventArgs e)
|
||||||
|
{
|
||||||
|
if (txtPassWord.Text != pbxPassWord.Password)
|
||||||
|
pbxPassWord.Password = txtPassWord.Text;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void txtMinProfitAutoBuy_TextChanged(object sender, TextChangedEventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void chkMinProfitAutoBuy_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void btnSaveMinProfitAutoBuy_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
GlobalConfig.AutoBuyConfig.IsLimitMinProfit = chkMinProfitAutoBuy.IsChecked ?? false;
|
||||||
|
GlobalConfig.AutoBuyConfig.MinProfit = (txtMinProfitAutoBuy.Text.ParseToDecimal() * 100).ParseToInt();
|
||||||
|
ConfigHelper.SaveConfig("auto_buy_config", GlobalConfig.AutoBuyConfig);
|
||||||
|
BaseMsgWindow.ShowInfo("自动拍单最低利润配置成功!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,110 @@
|
|||||||
|
<UserControl
|
||||||
|
x:Class="_29WxOrderWpf.Views.BaiduGetWaybillInfoView"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:basewindows="clr-namespace:_29WxOrderWpf.BaseWindows"
|
||||||
|
xmlns:comn="WxOrder.Framework"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:wpf="WPFCommon"
|
||||||
|
x:Name="baiduGetWaybillInfoView"
|
||||||
|
Width="1200"
|
||||||
|
Height="600"
|
||||||
|
MinWidth="800"
|
||||||
|
MinHeight="600"
|
||||||
|
comn:DialogWindowProperty.ResizeMode="CanResizeWithGrip"
|
||||||
|
comn:DialogWindowProperty.ShowMinButton="False"
|
||||||
|
comn:DialogWindowProperty.Width="1200"
|
||||||
|
Loaded="BaiduGetWaybillInfoView_Loaded"
|
||||||
|
mc:Ignorable="d">
|
||||||
|
<UserControl.Resources>
|
||||||
|
<BooleanToVisibilityConverter x:Key="BoolToVis" />
|
||||||
|
</UserControl.Resources>
|
||||||
|
<Grid Background="White">
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="*" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<Grid Height="420" VerticalAlignment="Center">
|
||||||
|
<Image
|
||||||
|
x:Name="imgLoading"
|
||||||
|
Width="20"
|
||||||
|
Height="20"
|
||||||
|
Margin="10"
|
||||||
|
HorizontalAlignment="Left"
|
||||||
|
IsEnabled="False"
|
||||||
|
Source="{StaticResource imgLoadingPic}"
|
||||||
|
Visibility="{Binding IsLoading, Converter={StaticResource visibleToVisibilityConverter}}">
|
||||||
|
<Image.RenderTransform>
|
||||||
|
<RotateTransform Angle="45" CenterX="10" CenterY="10" />
|
||||||
|
</Image.RenderTransform>
|
||||||
|
<Image.Triggers>
|
||||||
|
<EventTrigger RoutedEvent="Image.Loaded">
|
||||||
|
<BeginStoryboard>
|
||||||
|
<Storyboard>
|
||||||
|
<DoubleAnimation
|
||||||
|
RepeatBehavior="Forever"
|
||||||
|
Storyboard.TargetName="imgLoading"
|
||||||
|
Storyboard.TargetProperty="(UIElement.RenderTransform).(RotateTransform.Angle)"
|
||||||
|
From="0"
|
||||||
|
To="360"
|
||||||
|
Duration="0:0:3" />
|
||||||
|
</Storyboard>
|
||||||
|
</BeginStoryboard>
|
||||||
|
</EventTrigger>
|
||||||
|
</Image.Triggers>
|
||||||
|
</Image>
|
||||||
|
<TextBlock
|
||||||
|
Margin="50,0"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
FontSize="18"
|
||||||
|
Text="{Binding LatestWaybillStr}"
|
||||||
|
TextWrapping="Wrap" />
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
<GridSplitter
|
||||||
|
Grid.Row="1"
|
||||||
|
Height="5"
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
|
VerticalAlignment="Stretch"
|
||||||
|
Background="#d0d0d0"
|
||||||
|
ResizeBehavior="PreviousAndNext"
|
||||||
|
ShowsPreview="True" />
|
||||||
|
|
||||||
|
<!-- 地址栏 -->
|
||||||
|
<Border
|
||||||
|
Grid.Row="2"
|
||||||
|
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="3">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="*" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<!-- 浏览器容器 -->
|
||||||
|
<Grid
|
||||||
|
x:Name="BrowserHost"
|
||||||
|
Grid.Column="0"
|
||||||
|
Background="White"
|
||||||
|
ClipToBounds="True" />
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
</UserControl>
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
using _29WxOrderWpf.BaseWindows;
|
||||||
|
using _29WxOrderWpf.ViewModels;
|
||||||
|
using AllBase.Model.DBModel;
|
||||||
|
using CefSharp.Wpf;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
using System.Windows.Input;
|
||||||
|
using System.Windows.Media;
|
||||||
|
|
||||||
|
namespace _29WxOrderWpf.Views
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 百度获取物流信息窗口
|
||||||
|
/// </summary>
|
||||||
|
public partial class BaiduGetWaybillInfoView : UserControl
|
||||||
|
{
|
||||||
|
/// <summary>视图模型</summary>
|
||||||
|
public BaiduGetWaybillInfoViewModel ViewModel { get; }
|
||||||
|
|
||||||
|
public BaiduGetWaybillInfoView(oms_wei_order_item_info orderItem)
|
||||||
|
{
|
||||||
|
|
||||||
|
InitializeComponent();
|
||||||
|
|
||||||
|
ViewModel = new BaiduGetWaybillInfoViewModel(orderItem);
|
||||||
|
ViewModel.BrowserCreated += ViewModel_BrowserCreated;
|
||||||
|
ViewModel.RequestClose += ViewModel_RequestClose;
|
||||||
|
DataContext = ViewModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
private async void BaiduGetWaybillInfoView_Loaded(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
ViewModel.Start();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void BaiduGetWaybillInfoView_Closed(object sender, System.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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,84 @@
|
|||||||
|
<UserControl
|
||||||
|
x:Class="_29WxOrderWpf.Views.ChangePickNoView"
|
||||||
|
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.Views"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
x:Name="changePickNoView"
|
||||||
|
Width="450"
|
||||||
|
Height="300"
|
||||||
|
d:DesignHeight="300"
|
||||||
|
d:DesignWidth="450"
|
||||||
|
Loaded="ChangeWaybillView_Loaded"
|
||||||
|
mc:Ignorable="d">
|
||||||
|
<Grid Background="White">
|
||||||
|
<StackPanel Margin="24,24,24,0">
|
||||||
|
<TextBlock
|
||||||
|
Margin="0,0,0,20"
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
FontSize="15"
|
||||||
|
Foreground="#333333"
|
||||||
|
Text="添加/更改取件码" />
|
||||||
|
|
||||||
|
<StackPanel>
|
||||||
|
<TextBlock
|
||||||
|
Margin="0,0,0,8"
|
||||||
|
Foreground="#555555"
|
||||||
|
Text="填写取件码:" />
|
||||||
|
<TextBox
|
||||||
|
x:Name="txtPickNo"
|
||||||
|
Height="38"
|
||||||
|
VerticalContentAlignment="Center"
|
||||||
|
d:Text="1111"
|
||||||
|
BorderBrush="#D0D0D0"
|
||||||
|
BorderThickness="1"
|
||||||
|
FontSize="18"
|
||||||
|
Text="{Binding PickNo, UpdateSourceTrigger=PropertyChanged}"
|
||||||
|
VerticalScrollBarVisibility="Auto" />
|
||||||
|
<WrapPanel Margin="0,10,0,0" FlowDirection="RightToLeft">
|
||||||
|
<Button
|
||||||
|
Width="72"
|
||||||
|
Height="26"
|
||||||
|
Margin="0,0,10,0"
|
||||||
|
HorizontalAlignment="Right"
|
||||||
|
Click="Button_Click_1"
|
||||||
|
Command="{Binding ChangePickNoCommand}"
|
||||||
|
Content="修改取件码"
|
||||||
|
Style="{StaticResource BasePageButtonStyle}" />
|
||||||
|
<Image
|
||||||
|
x:Name="imgLoading"
|
||||||
|
Width="20"
|
||||||
|
Height="20"
|
||||||
|
IsEnabled="False"
|
||||||
|
Source="{StaticResource imgLoadingPic}"
|
||||||
|
Visibility="{Binding IsChangeingPickNo, Converter={StaticResource visibleToVisibilityConverter}}">
|
||||||
|
<Image.RenderTransform>
|
||||||
|
<RotateTransform Angle="45" CenterX="10" CenterY="10" />
|
||||||
|
</Image.RenderTransform>
|
||||||
|
<Image.Triggers>
|
||||||
|
<EventTrigger RoutedEvent="Image.Loaded">
|
||||||
|
<BeginStoryboard>
|
||||||
|
<Storyboard>
|
||||||
|
<DoubleAnimation
|
||||||
|
RepeatBehavior="Forever"
|
||||||
|
Storyboard.TargetName="imgLoading"
|
||||||
|
Storyboard.TargetProperty="(UIElement.RenderTransform).(RotateTransform.Angle)"
|
||||||
|
From="360"
|
||||||
|
To="0"
|
||||||
|
Duration="0:0:3" />
|
||||||
|
</Storyboard>
|
||||||
|
</BeginStoryboard>
|
||||||
|
</EventTrigger>
|
||||||
|
</Image.Triggers>
|
||||||
|
</Image>
|
||||||
|
</WrapPanel>
|
||||||
|
|
||||||
|
<TextBlock
|
||||||
|
d:Text="如有需要,显示消息"
|
||||||
|
Text=""
|
||||||
|
TextWrapping="Wrap" />
|
||||||
|
</StackPanel>
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
</UserControl>
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
using _29WxOrderWpf.ViewModels;
|
||||||
|
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 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.Views;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ChangeWaybillView.xaml 的交互逻辑
|
||||||
|
/// </summary>
|
||||||
|
public partial class ChangePickNoView : UserControl
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 视图模型
|
||||||
|
/// </summary>
|
||||||
|
public ChangePickNoViewModel ViewModel { get; }
|
||||||
|
|
||||||
|
public ChangePickNoView(oms_wei_order_item_info _orderItem)
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
|
||||||
|
ViewModel = new ChangePickNoViewModel(_orderItem);
|
||||||
|
ViewModel.RequestClose += ViewModel_RequestClose;
|
||||||
|
DataContext = ViewModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ChangeWaybillView_Loaded(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
ViewModel.Start();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ChangeWaybillView_Closed(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
ViewModel.Stop();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ViewModel_RequestClose()
|
||||||
|
{
|
||||||
|
Window parentWindow = Window.GetWindow(this);
|
||||||
|
if (this.IsLoaded && parentWindow != null)
|
||||||
|
parentWindow.Close();
|
||||||
|
|
||||||
|
MainWindow.Instance.orderListCtrl.FilterOneOrder(ViewModel.OrderItem.ItemOrder);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Button_Click_1(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,132 @@
|
|||||||
|
<UserControl
|
||||||
|
x:Class="_29WxOrderWpf.Views.ChangeWaybillView"
|
||||||
|
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.Views"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
x:Name="ChangeWaybillCtrl"
|
||||||
|
Width="450"
|
||||||
|
Height="350"
|
||||||
|
d:DesignHeight="350"
|
||||||
|
d:DesignWidth="450"
|
||||||
|
Loaded="ChangeWaybillView_Loaded"
|
||||||
|
mc:Ignorable="d">
|
||||||
|
<Grid Background="White">
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
|
||||||
|
<Image
|
||||||
|
x:Name="imgLoading"
|
||||||
|
Width="20"
|
||||||
|
Height="20"
|
||||||
|
Margin="0,30,30,0"
|
||||||
|
HorizontalAlignment="Right"
|
||||||
|
VerticalAlignment="Top"
|
||||||
|
IsEnabled="False"
|
||||||
|
Source="{StaticResource imgLoadingPic}"
|
||||||
|
Visibility="{Binding IsChangeingWaybill, Converter={StaticResource visibleToVisibilityConverter}}">
|
||||||
|
<Image.RenderTransform>
|
||||||
|
<RotateTransform Angle="45" CenterX="10" CenterY="10" />
|
||||||
|
</Image.RenderTransform>
|
||||||
|
<Image.Triggers>
|
||||||
|
<EventTrigger RoutedEvent="FrameworkElement.Loaded">
|
||||||
|
<BeginStoryboard>
|
||||||
|
<Storyboard>
|
||||||
|
<DoubleAnimation
|
||||||
|
RepeatBehavior="Forever"
|
||||||
|
Storyboard.TargetName="imgLoading"
|
||||||
|
Storyboard.TargetProperty="(UIElement.RenderTransform).(RotateTransform.Angle)"
|
||||||
|
From="360"
|
||||||
|
To="0"
|
||||||
|
Duration="0:0:3" />
|
||||||
|
</Storyboard>
|
||||||
|
</BeginStoryboard>
|
||||||
|
</EventTrigger>
|
||||||
|
</Image.Triggers>
|
||||||
|
</Image>
|
||||||
|
|
||||||
|
<StackPanel Margin="24,24,24,0">
|
||||||
|
<TextBlock
|
||||||
|
Margin="0,0,0,10"
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
FontSize="15"
|
||||||
|
Foreground="#333333"
|
||||||
|
Text="更改运单号" />
|
||||||
|
|
||||||
|
<StackPanel>
|
||||||
|
<TextBlock
|
||||||
|
Margin="0,0,0,8"
|
||||||
|
Foreground="#555555"
|
||||||
|
Text="填写运单号:" />
|
||||||
|
<TextBox
|
||||||
|
x:Name="txtWaybillId"
|
||||||
|
Height="38"
|
||||||
|
VerticalContentAlignment="Center"
|
||||||
|
d:Text="1111"
|
||||||
|
BorderBrush="#D0D0D0"
|
||||||
|
BorderThickness="1"
|
||||||
|
FontSize="18"
|
||||||
|
Text="{Binding WaybillId, UpdateSourceTrigger=PropertyChanged}"
|
||||||
|
VerticalScrollBarVisibility="Auto" />
|
||||||
|
<WrapPanel Margin="0,10,0,0" FlowDirection="RightToLeft">
|
||||||
|
<Button
|
||||||
|
Width="64"
|
||||||
|
Height="26"
|
||||||
|
Margin="0,0,10,0"
|
||||||
|
HorizontalAlignment="Right"
|
||||||
|
Command="{Binding ChangeWaybillCommand}"
|
||||||
|
Content="确定更改"
|
||||||
|
Style="{StaticResource BasePageButtonStyle}" />
|
||||||
|
</WrapPanel>
|
||||||
|
</StackPanel>
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
<StackPanel Grid.Row="1" Margin="24,24,24,0">
|
||||||
|
<TextBlock
|
||||||
|
Margin="0,0,0,10"
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
FontSize="15"
|
||||||
|
Foreground="#333333"
|
||||||
|
Text="订单补寄" />
|
||||||
|
|
||||||
|
<StackPanel>
|
||||||
|
<TextBlock
|
||||||
|
Margin="0,0,0,8"
|
||||||
|
Foreground="#555555"
|
||||||
|
Text="填写补寄运单号:" />
|
||||||
|
<TextBox
|
||||||
|
x:Name="txtCompensationWaybillId"
|
||||||
|
Height="38"
|
||||||
|
VerticalContentAlignment="Center"
|
||||||
|
d:Text="1111"
|
||||||
|
BorderBrush="#D0D0D0"
|
||||||
|
BorderThickness="1"
|
||||||
|
FontSize="18"
|
||||||
|
Text="{Binding CompensationWaybillId, UpdateSourceTrigger=PropertyChanged}"
|
||||||
|
VerticalScrollBarVisibility="Auto" />
|
||||||
|
<WrapPanel Margin="0,10,0,0" FlowDirection="RightToLeft">
|
||||||
|
<Button
|
||||||
|
Width="64"
|
||||||
|
Height="26"
|
||||||
|
Margin="0,0,10,0"
|
||||||
|
HorizontalAlignment="Right"
|
||||||
|
Command="{Binding SendCompensationDeliveryCommand}"
|
||||||
|
Content="确定补寄"
|
||||||
|
Style="{StaticResource BasePageButtonStyle}" />
|
||||||
|
|
||||||
|
</WrapPanel>
|
||||||
|
|
||||||
|
<TextBlock
|
||||||
|
d:Text="textBlock"
|
||||||
|
Foreground="Red"
|
||||||
|
Text=""
|
||||||
|
TextWrapping="Wrap" />
|
||||||
|
</StackPanel>
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
</UserControl>
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
using _29WxOrderWpf.ViewModels;
|
||||||
|
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 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.Views;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ChangeWaybillView.xaml 的交互逻辑
|
||||||
|
/// </summary>
|
||||||
|
public partial class ChangeWaybillView : UserControl
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 视图模型
|
||||||
|
/// </summary>
|
||||||
|
public ChangeWaybillViewModel ViewModel { get; }
|
||||||
|
|
||||||
|
public ChangeWaybillView(oms_wei_order_item_info _orderItem)
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
|
||||||
|
ViewModel = new ChangeWaybillViewModel(_orderItem);
|
||||||
|
ViewModel.RequestClose += ViewModel_RequestClose;
|
||||||
|
DataContext = ViewModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ChangeWaybillView_Loaded(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
ViewModel.Start();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ChangeWaybillView_Closed(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
ViewModel.Stop();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ViewModel_RequestClose()
|
||||||
|
{
|
||||||
|
Window parentWindow = Window.GetWindow(this);
|
||||||
|
if (this.IsLoaded && parentWindow != null)
|
||||||
|
parentWindow.Close();
|
||||||
|
|
||||||
|
MainWindow.Instance.orderListCtrl.FilterOneOrder(ViewModel.OrderItem?.ItemOrder);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Button_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,115 @@
|
|||||||
|
<UserControl
|
||||||
|
x:Class="_29WxOrderWpf.Views.EWaybillPathListView"
|
||||||
|
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.Views"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
Height="auto"
|
||||||
|
d:DesignHeight="80"
|
||||||
|
d:DesignWidth="600"
|
||||||
|
mc:Ignorable="d">
|
||||||
|
<Grid>
|
||||||
|
<Border
|
||||||
|
Margin="4"
|
||||||
|
BorderBrush="LightGray"
|
||||||
|
BorderThickness="0,0,0,1"
|
||||||
|
CornerRadius="0">
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="auto" />
|
||||||
|
<ColumnDefinition />
|
||||||
|
<ColumnDefinition Width="auto" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Image
|
||||||
|
x:Name="imgSku"
|
||||||
|
Grid.Row="0"
|
||||||
|
Grid.Column="0"
|
||||||
|
Width="20"
|
||||||
|
Height="20"
|
||||||
|
Margin="8"
|
||||||
|
Cursor="Hand"
|
||||||
|
MouseDown="imgSku_MouseDown"
|
||||||
|
MouseEnter="imgSku_MouseEnter"
|
||||||
|
MouseLeave="imgSku_MouseLeave" />
|
||||||
|
<Grid
|
||||||
|
Grid.Column="1"
|
||||||
|
Margin="0,8"
|
||||||
|
VerticalAlignment="Center">
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="auto" />
|
||||||
|
<RowDefinition Height="auto" />
|
||||||
|
<RowDefinition Height="auto" />
|
||||||
|
<RowDefinition Height="auto" />
|
||||||
|
<RowDefinition Height="auto" />
|
||||||
|
<RowDefinition Height="auto" />
|
||||||
|
<RowDefinition Height="auto" />
|
||||||
|
<RowDefinition Height="auto" />
|
||||||
|
<RowDefinition Height="auto" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<WrapPanel Grid.Row="0" Visibility="{Binding node_desc, Converter={StaticResource HasTextVisibility}}">
|
||||||
|
<TextBox
|
||||||
|
VerticalAlignment="Top"
|
||||||
|
d:Opacity="0.5"
|
||||||
|
d:Visibility="Visible"
|
||||||
|
Background="Transparent"
|
||||||
|
BorderThickness="0"
|
||||||
|
FontWeight="Bold"
|
||||||
|
IsReadOnly="True"
|
||||||
|
Text="物流信息:"
|
||||||
|
TextWrapping="Wrap"
|
||||||
|
Visibility="Collapsed" />
|
||||||
|
<TextBox
|
||||||
|
Grid.Row="0"
|
||||||
|
VerticalAlignment="Top"
|
||||||
|
d:Opacity="0.5"
|
||||||
|
d:Text="已送达"
|
||||||
|
Background="Transparent"
|
||||||
|
BorderThickness="0"
|
||||||
|
FontWeight="Bold"
|
||||||
|
IsReadOnly="True"
|
||||||
|
Text="{Binding node_desc}"
|
||||||
|
TextWrapping="Wrap" />
|
||||||
|
</WrapPanel>
|
||||||
|
|
||||||
|
<WrapPanel Grid.Row="1" Visibility="{Binding UpdateTimeStr, Converter={StaticResource HasTextVisibility}}" Margin="4">
|
||||||
|
<TextBox
|
||||||
|
VerticalAlignment="Top"
|
||||||
|
d:Opacity="0.5"
|
||||||
|
d:Visibility="Visible"
|
||||||
|
Background="Transparent"
|
||||||
|
BorderThickness="0"
|
||||||
|
IsReadOnly="True"
|
||||||
|
Text="更新时间:"
|
||||||
|
TextWrapping="Wrap"
|
||||||
|
Visibility="Collapsed" />
|
||||||
|
<TextBox
|
||||||
|
Grid.Row="0"
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
d:Opacity="0.5"
|
||||||
|
d:Text="2000/1/1 0:0:0"
|
||||||
|
Background="Transparent"
|
||||||
|
BorderThickness="0"
|
||||||
|
IsReadOnly="True"
|
||||||
|
Text="{Binding UpdateTimeStr}"
|
||||||
|
TextWrapping="Wrap" />
|
||||||
|
</WrapPanel>
|
||||||
|
</Grid>
|
||||||
|
<Button
|
||||||
|
x:Name="btnAdd"
|
||||||
|
Grid.Column="100"
|
||||||
|
MinWidth="18"
|
||||||
|
MinHeight="28"
|
||||||
|
Margin="8"
|
||||||
|
Padding="4"
|
||||||
|
HorizontalAlignment="Left"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Content=""
|
||||||
|
Style="{StaticResource BasePageButtonStyle}"
|
||||||
|
Visibility="Hidden" />
|
||||||
|
</Grid>
|
||||||
|
</Border>
|
||||||
|
</Grid>
|
||||||
|
</UserControl>
|
||||||
+19
-4
@@ -13,15 +13,30 @@ using System.Windows.Media.Imaging;
|
|||||||
using System.Windows.Navigation;
|
using System.Windows.Navigation;
|
||||||
using System.Windows.Shapes;
|
using System.Windows.Shapes;
|
||||||
|
|
||||||
namespace Main.Test.Views;
|
namespace _29WxOrderWpf.Views;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// HeaderView.xaml 的交互逻辑
|
/// EWaybillPathListView.xaml 的交互逻辑
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class HeaderView : UserControl
|
public partial class EWaybillPathListView : UserControl
|
||||||
{
|
{
|
||||||
public HeaderView()
|
public EWaybillPathListView()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void imgSku_MouseDown(object sender, MouseButtonEventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void imgSku_MouseEnter(object sender, MouseEventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void imgSku_MouseLeave(object sender, MouseEventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,138 @@
|
|||||||
|
<UserControl
|
||||||
|
x:Class="_29WxOrderWpf.Views.EWaybillPathView"
|
||||||
|
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.Views"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
x:Name="EWaybillPathCtrl"
|
||||||
|
d:DesignHeight="450"
|
||||||
|
d:DesignWidth="800" Loaded="EWaybillPathCtrl_Loaded"
|
||||||
|
Background="White"
|
||||||
|
mc:Ignorable="d">
|
||||||
|
<Grid Margin="24,24,24,24">
|
||||||
|
<WrapPanel
|
||||||
|
Margin="0,0,0,20"
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="top">
|
||||||
|
<TextBlock
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Top"
|
||||||
|
FontSize="15"
|
||||||
|
Foreground="#333333"
|
||||||
|
Text="订单 " />
|
||||||
|
<TextBox
|
||||||
|
x:Name="txtOrderId"
|
||||||
|
VerticalContentAlignment="Center"
|
||||||
|
d:Text="1111111"
|
||||||
|
BorderBrush="#D0D0D0"
|
||||||
|
BorderThickness="0"
|
||||||
|
FontSize="14"
|
||||||
|
Text="{Binding OrderId, UpdateSourceTrigger=PropertyChanged}"
|
||||||
|
VerticalScrollBarVisibility="Auto" />
|
||||||
|
<TextBlock
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Top"
|
||||||
|
FontSize="15"
|
||||||
|
Foreground="#333333"
|
||||||
|
Text=" 物流明细" />
|
||||||
|
</WrapPanel>
|
||||||
|
|
||||||
|
<Grid Margin="24,24,24,24">
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="auto" />
|
||||||
|
<RowDefinition />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<StackPanel Margin="24,24,24,24">
|
||||||
|
<Grid>
|
||||||
|
<WrapPanel>
|
||||||
|
<TextBlock FontSize="14" Text="物流公司:" />
|
||||||
|
<TextBox
|
||||||
|
x:Name="txtExpressName"
|
||||||
|
VerticalContentAlignment="Center"
|
||||||
|
d:Text="物流公司:"
|
||||||
|
BorderBrush="#D0D0D0"
|
||||||
|
BorderThickness="0"
|
||||||
|
FontSize="14"
|
||||||
|
Text="{Binding ExpressName, UpdateSourceTrigger=PropertyChanged}"
|
||||||
|
VerticalScrollBarVisibility="Auto" />
|
||||||
|
</WrapPanel>
|
||||||
|
<Image
|
||||||
|
x:Name="imgLoading"
|
||||||
|
Width="20"
|
||||||
|
Height="20"
|
||||||
|
HorizontalAlignment="Right"
|
||||||
|
IsEnabled="False"
|
||||||
|
Source="{StaticResource imgLoadingPic}"
|
||||||
|
Visibility="{Binding IsGetWaybillPath, Converter={StaticResource visibleToVisibilityConverter}}">
|
||||||
|
<Image.RenderTransform>
|
||||||
|
<RotateTransform Angle="45" CenterX="10" CenterY="10" />
|
||||||
|
</Image.RenderTransform>
|
||||||
|
<Image.Triggers>
|
||||||
|
<EventTrigger RoutedEvent="Image.Loaded">
|
||||||
|
<BeginStoryboard>
|
||||||
|
<Storyboard>
|
||||||
|
<DoubleAnimation
|
||||||
|
RepeatBehavior="Forever"
|
||||||
|
Storyboard.TargetName="imgLoading"
|
||||||
|
Storyboard.TargetProperty="(UIElement.RenderTransform).(RotateTransform.Angle)"
|
||||||
|
From="0"
|
||||||
|
To="360"
|
||||||
|
Duration="0:0:3" />
|
||||||
|
</Storyboard>
|
||||||
|
</BeginStoryboard>
|
||||||
|
</EventTrigger>
|
||||||
|
</Image.Triggers>
|
||||||
|
</Image>
|
||||||
|
</Grid>
|
||||||
|
<WrapPanel>
|
||||||
|
<TextBlock FontSize="14" Text="物流编码:" />
|
||||||
|
<TextBox
|
||||||
|
x:Name="txtWaybillId"
|
||||||
|
VerticalContentAlignment="Center"
|
||||||
|
d:Text="物流编码:"
|
||||||
|
BorderBrush="#D0D0D0"
|
||||||
|
BorderThickness="0"
|
||||||
|
FontSize="14"
|
||||||
|
Text="{Binding WaybillId, UpdateSourceTrigger=PropertyChanged}"
|
||||||
|
VerticalScrollBarVisibility="Auto" />
|
||||||
|
</WrapPanel>
|
||||||
|
</StackPanel>
|
||||||
|
<ListBox
|
||||||
|
x:Name="lbxSku"
|
||||||
|
Grid.Row="1"
|
||||||
|
Grid.Column="1"
|
||||||
|
Margin="7,0,7,0"
|
||||||
|
HorizontalContentAlignment="Stretch"
|
||||||
|
BorderThickness="0"
|
||||||
|
ItemsSource="{Binding WaybillPathInfos}"
|
||||||
|
ScrollViewer.CanContentScroll="True"
|
||||||
|
VirtualizingPanel.ScrollUnit="Pixel">
|
||||||
|
<!-- 使用自定义属性模板去除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>
|
||||||
|
<!-- 此处绑定将数据源传递给子自定义控件OrderListRowCtrl -->
|
||||||
|
<local:EWaybillPathListView
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
VerticalContentAlignment="Center"
|
||||||
|
DataContext="{Binding}" />
|
||||||
|
</DataTemplate>
|
||||||
|
</ListBox.ItemTemplate>
|
||||||
|
</ListBox>
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
</UserControl>
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
using _29WxOrderWpf.ViewModels;
|
||||||
|
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.Views;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// EWaybillPathView.xaml 的交互逻辑
|
||||||
|
/// </summary>
|
||||||
|
public partial class EWaybillPathView : UserControl
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 视图模型
|
||||||
|
/// </summary>
|
||||||
|
public EWaybillPathViewModel ViewModel { get; }
|
||||||
|
|
||||||
|
public EWaybillPathView(oms_wei_order_info _order, string _waybillId, string _expressName)
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
|
||||||
|
ViewModel = new EWaybillPathViewModel(_order, _waybillId, _expressName);
|
||||||
|
DataContext = ViewModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void EWaybillPathCtrl_Loaded(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
ViewModel.Start();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:basewindows="clr-namespace:_29WxOrderWpf.BaseWindows"
|
xmlns:basewindows="clr-namespace:_29WxOrderWpf.BaseWindows"
|
||||||
xmlns:comn="clr-namespace:_29WxOrderWpf.Common"
|
xmlns:comn="WxOrder.Framework"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:wpf="WPFCommon"
|
xmlns:wpf="WPFCommon"
|
||||||
@@ -104,6 +104,7 @@
|
|||||||
Command="{Binding SaveCookieCommand}"
|
Command="{Binding SaveCookieCommand}"
|
||||||
Content="保存"
|
Content="保存"
|
||||||
Style="{StaticResource BasePageButtonStyle}" />
|
Style="{StaticResource BasePageButtonStyle}" />
|
||||||
|
<TextBlock Text="TextBlock" TextWrapping="Wrap" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Border>
|
</Border>
|
||||||
|
|||||||
@@ -5,57 +5,59 @@ using CefSharp.Wpf;
|
|||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
|
using System.Windows.Media;
|
||||||
|
|
||||||
namespace _29WxOrderWpf.Views
|
namespace _29WxOrderWpf.Views
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 拼多多买手移动版登录窗口(WPF 版 PddMobileLoginForm)
|
/// 拼多多买手移动版登录窗口(WPF 版 PddMobileLoginForm)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class PddMobileLoginView : UserControl
|
public partial class PddMobileLoginView : UserControl
|
||||||
{
|
{
|
||||||
/// <summary>视图模型</summary>
|
/// <summary>视图模型</summary>
|
||||||
public PddMobileLoginViewModel ViewModel { get; }
|
public PddMobileLoginViewModel ViewModel { get; }
|
||||||
|
|
||||||
public PddMobileLoginView(BuyerLoginInfo buyerInfo)
|
public PddMobileLoginView(BuyerLoginInfo buyerInfo)
|
||||||
{
|
{
|
||||||
|
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
ViewModel = new PddMobileLoginViewModel(buyerInfo);
|
ViewModel = new PddMobileLoginViewModel(buyerInfo);
|
||||||
ViewModel.BrowserCreated += ViewModel_BrowserCreated;
|
ViewModel.BrowserCreated += ViewModel_BrowserCreated;
|
||||||
//ViewModel.RequestClose += ViewModel_RequestClose;
|
ViewModel.RequestClose += ViewModel_RequestClose;
|
||||||
DataContext = ViewModel;
|
DataContext = ViewModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void PddMobileLoginView_Loaded(object sender, RoutedEventArgs e)
|
private void PddMobileLoginView_Loaded(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
ViewModel.Start();
|
ViewModel.Start();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void PddMobileLoginView_Closed(object sender, System.EventArgs e)
|
private void PddMobileLoginView_Closed(object sender, System.EventArgs e)
|
||||||
{
|
{
|
||||||
ViewModel.Stop();
|
ViewModel.Stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ViewModel_BrowserCreated(ChromiumWebBrowser browser)
|
private void ViewModel_BrowserCreated(ChromiumWebBrowser browser)
|
||||||
{
|
{
|
||||||
Grid.SetRow(browser, 0);
|
Grid.SetRow(browser, 0);
|
||||||
Grid.SetColumn(browser, 0);
|
Grid.SetColumn(browser, 0);
|
||||||
BrowserHost.Children.Add(browser);
|
BrowserHost.Children.Add(browser);
|
||||||
}
|
}
|
||||||
|
|
||||||
//private void ViewModel_RequestClose()
|
private void ViewModel_RequestClose()
|
||||||
//{
|
{
|
||||||
// if (this.IsLoaded)
|
Window parentWindow = Window.GetWindow(this);
|
||||||
// this.Close();
|
if (this.IsLoaded && parentWindow != null)
|
||||||
//}
|
parentWindow.Close();
|
||||||
|
}
|
||||||
|
|
||||||
private void txtAddress_KeyDown(object sender, KeyEventArgs e)
|
private void txtAddress_KeyDown(object sender, KeyEventArgs e)
|
||||||
{
|
{
|
||||||
if (e.Key == Key.Enter)
|
if (e.Key == Key.Enter)
|
||||||
{
|
{
|
||||||
ViewModel.ReloadCommand.Execute(null);
|
ViewModel.ReloadCommand.Execute(null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,67 @@
|
|||||||
|
<UserControl
|
||||||
|
x:Class="_29WxOrderWpf.Views.TaobaoLoginView"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:basewindows="clr-namespace:_29WxOrderWpf.BaseWindows"
|
||||||
|
xmlns:comn="WxOrder.Framework"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:wpf="WPFCommon"
|
||||||
|
x:Name="taobaoLoginView"
|
||||||
|
Width="1300"
|
||||||
|
Height="768"
|
||||||
|
MinWidth="800"
|
||||||
|
MinHeight="600"
|
||||||
|
comn:DialogWindowProperty.ResizeMode="CanResizeWithGrip"
|
||||||
|
comn:DialogWindowProperty.ShowMinButton="False"
|
||||||
|
comn:DialogWindowProperty.Width="1300"
|
||||||
|
Loaded="TaobaoLoginView_Loaded"
|
||||||
|
mc:Ignorable="d">
|
||||||
|
<UserControl.Resources>
|
||||||
|
<BooleanToVisibilityConverter x:Key="BoolToVis" />
|
||||||
|
</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="*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="*" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<!-- 浏览器容器 -->
|
||||||
|
<Grid
|
||||||
|
x:Name="BrowserHost"
|
||||||
|
Grid.Column="0"
|
||||||
|
Background="White"
|
||||||
|
ClipToBounds="True" />
|
||||||
|
|
||||||
|
<Grid Grid.Row="1" Height="5">
|
||||||
|
<!--<TextBlock Text="{Binding}" />-->
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
</UserControl>
|
||||||
@@ -0,0 +1,69 @@
|
|||||||
|
using _29WxOrderWpf.BaseWindows;
|
||||||
|
using _29WxOrderWpf.ViewModels;
|
||||||
|
using AllBase.Model.DBModel;
|
||||||
|
using CefSharp.Wpf;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
using System.Windows.Input;
|
||||||
|
using System.Windows.Media;
|
||||||
|
|
||||||
|
namespace _29WxOrderWpf.Views
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 淘宝买手登录窗口(WPF 版 TaobaoLoginView)
|
||||||
|
/// </summary>
|
||||||
|
public partial class TaobaoLoginView : UserControl
|
||||||
|
{
|
||||||
|
/// <summary>视图模型</summary>
|
||||||
|
public TaobaoLoginViewModel ViewModel { get; }
|
||||||
|
|
||||||
|
public TaobaoLoginView(BuyerLoginInfo buyerInfo)
|
||||||
|
{
|
||||||
|
|
||||||
|
InitializeComponent();
|
||||||
|
|
||||||
|
ViewModel = new TaobaoLoginViewModel(buyerInfo);
|
||||||
|
ViewModel.BrowserCreated += ViewModel_BrowserCreated;
|
||||||
|
ViewModel.RequestClose += ViewModel_RequestClose;
|
||||||
|
DataContext = ViewModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void TaobaoLoginView_Loaded(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
ViewModel.Start();
|
||||||
|
|
||||||
|
Window parentWindow = Window.GetWindow(this);
|
||||||
|
if (this.IsLoaded && parentWindow != null)
|
||||||
|
{
|
||||||
|
parentWindow.Closed += TaobaoLoginView_ParentWindow_Closed;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void TaobaoLoginView_ParentWindow_Closed(object sender, System.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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,89 @@
|
|||||||
|
<UserControl
|
||||||
|
x:Class="_29WxOrderWpf.Views.TransitExtraPackagesView"
|
||||||
|
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.Views"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
x:Name="TransitExtraPackagesCtrl"
|
||||||
|
Width="450"
|
||||||
|
Height="300"
|
||||||
|
d:DesignHeight="300"
|
||||||
|
d:DesignWidth="450"
|
||||||
|
Loaded="View_Loaded"
|
||||||
|
mc:Ignorable="d">
|
||||||
|
<Grid Background="White">
|
||||||
|
<StackPanel Margin="24,24,24,0">
|
||||||
|
<TextBlock
|
||||||
|
Margin="0,0,0,20"
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
FontSize="15"
|
||||||
|
Foreground="#333333"
|
||||||
|
Text="滞留补发买家" />
|
||||||
|
|
||||||
|
<StackPanel>
|
||||||
|
<TextBlock Margin="0,0,0,20">
|
||||||
|
<Run Text=" 说 明:总店未在90小时到仓导致快递停滞退回, 货物" />
|
||||||
|
<LineBreak /><Run Text=" 滞留云仓,可用补发继续发给买家。" />
|
||||||
|
<LineBreak /><Run Text=" 收 费:(与云仓发货价格一样)" /><LineBreak />
|
||||||
|
</TextBlock>
|
||||||
|
<TextBlock
|
||||||
|
Margin="0,0,0,8"
|
||||||
|
d:Opacity="0.3"
|
||||||
|
d:Visibility="Visible"
|
||||||
|
Foreground="#555555"
|
||||||
|
Text="如需备注请在下面填写:"
|
||||||
|
Visibility="Hidden" />
|
||||||
|
<TextBox
|
||||||
|
x:Name="txtPurchaserNote"
|
||||||
|
Height="38"
|
||||||
|
VerticalContentAlignment="Center"
|
||||||
|
d:Opacity="0.3"
|
||||||
|
d:Text="测试订单13017678999"
|
||||||
|
d:Visibility="Visible"
|
||||||
|
BorderBrush="#D0D0D0"
|
||||||
|
BorderThickness="1"
|
||||||
|
FontSize="18"
|
||||||
|
Text="{Binding purchaserNote, UpdateSourceTrigger=PropertyChanged}"
|
||||||
|
VerticalScrollBarVisibility="Auto"
|
||||||
|
Visibility="Collapsed" />
|
||||||
|
<WrapPanel Margin="0,10,0,0" FlowDirection="RightToLeft">
|
||||||
|
<Button
|
||||||
|
Width="64"
|
||||||
|
Height="26"
|
||||||
|
Margin="0,0,10,0"
|
||||||
|
HorizontalAlignment="Right"
|
||||||
|
Command="{Binding AddExtraPackagesCommand}"
|
||||||
|
Content="确定补发"
|
||||||
|
Style="{StaticResource BasePageButtonStyle}" />
|
||||||
|
<Image
|
||||||
|
x:Name="imgLoading"
|
||||||
|
Width="20"
|
||||||
|
Height="20"
|
||||||
|
IsEnabled="False"
|
||||||
|
Source="{StaticResource imgLoadingPic}"
|
||||||
|
Visibility="{Binding IsChangeingWaybill, Converter={StaticResource visibleToVisibilityConverter}}">
|
||||||
|
<Image.RenderTransform>
|
||||||
|
<RotateTransform Angle="45" CenterX="10" CenterY="10" />
|
||||||
|
</Image.RenderTransform>
|
||||||
|
<Image.Triggers>
|
||||||
|
<EventTrigger RoutedEvent="Image.Loaded">
|
||||||
|
<BeginStoryboard>
|
||||||
|
<Storyboard>
|
||||||
|
<DoubleAnimation
|
||||||
|
RepeatBehavior="Forever"
|
||||||
|
Storyboard.TargetName="imgLoading"
|
||||||
|
Storyboard.TargetProperty="(UIElement.RenderTransform).(RotateTransform.Angle)"
|
||||||
|
From="360"
|
||||||
|
To="0"
|
||||||
|
Duration="0:0:3" />
|
||||||
|
</Storyboard>
|
||||||
|
</BeginStoryboard>
|
||||||
|
</EventTrigger>
|
||||||
|
</Image.Triggers>
|
||||||
|
</Image>
|
||||||
|
</WrapPanel>
|
||||||
|
</StackPanel>
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
</UserControl>
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
using _29WxOrderWpf.ViewModels;
|
||||||
|
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 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.Views;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// TransitExtraPackagesView.xaml 的交互逻辑
|
||||||
|
/// </summary>
|
||||||
|
public partial class TransitExtraPackagesView : UserControl
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 视图模型
|
||||||
|
/// </summary>
|
||||||
|
public TransitExtraPackagesViewModel ViewModel { get; }
|
||||||
|
|
||||||
|
public TransitExtraPackagesView(oms_wei_order_info _order, oms_wei_order_item_info _orderItem)
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
|
||||||
|
ViewModel = new TransitExtraPackagesViewModel(_order, _orderItem);
|
||||||
|
ViewModel.RequestClose += ViewModel_RequestClose;
|
||||||
|
DataContext = ViewModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void View_Loaded(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
ViewModel.Start();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void View_Closed(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
ViewModel.Stop();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ViewModel_RequestClose()
|
||||||
|
{
|
||||||
|
Window parentWindow = Window.GetWindow(this);
|
||||||
|
if (this.IsLoaded && parentWindow != null)
|
||||||
|
parentWindow.Close();
|
||||||
|
|
||||||
|
MainWindow.Instance.orderListCtrl.FilterOneOrder(ViewModel.Order);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,163 +1,71 @@
|
|||||||
<basewindows:BaseWindow
|
<basewindows:BaseWindow x:Class="_29WxOrderWpf.Windows.LoginWindows.LoginWindow" xmlns:basewindows="clr-namespace:_29WxOrderWpf.BaseWindows"
|
||||||
x:Class="_29WxOrderWpf.Windows.LoginWindows.LoginWindow"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:basewindows="clr-namespace:_29WxOrderWpf.BaseWindows"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:local="clr-namespace:_29WxOrderWpf.Windows.LoginWindows"
|
||||||
xmlns:local="clr-namespace:_29WxOrderWpf.Windows.LoginWindows"
|
xmlns:userctrls="clr-namespace:_29WxOrderWpf.UserControls"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
mc:Ignorable="d" Style="{StaticResource BaseNoneBorderWindowStyle}"
|
||||||
xmlns:userctrls="clr-namespace:_29WxOrderWpf.UserControls"
|
x:Name="loginWindow" Title="登录" Height="300" Width="400" ResizeMode="NoResize" Loaded="loginWindow_Loaded" Closing="BaseWindow_Closing">
|
||||||
x:Name="loginWindow"
|
<Grid Background="Transparent">
|
||||||
Title="登录"
|
<Grid.RowDefinitions>
|
||||||
Width="400"
|
<RowDefinition Height="120"></RowDefinition>
|
||||||
Height="300"
|
<RowDefinition Height="*"></RowDefinition>
|
||||||
Closing="BaseWindow_Closing"
|
</Grid.RowDefinitions>
|
||||||
Loaded="loginWindow_Loaded"
|
<Border Background="{StaticResource mainLinearColorBrush}"></Border>
|
||||||
ResizeMode="NoResize"
|
<Grid Grid.Row="1" Margin="2,0,2,2" Background="White">
|
||||||
Style="{StaticResource BaseNoneBorderWindowStyle}"
|
<Grid.ColumnDefinitions>
|
||||||
mc:Ignorable="d">
|
<ColumnDefinition></ColumnDefinition>
|
||||||
<Grid Background="Transparent">
|
<ColumnDefinition Width="180"></ColumnDefinition>
|
||||||
<Grid.RowDefinitions>
|
<ColumnDefinition></ColumnDefinition>
|
||||||
<RowDefinition Height="120" />
|
</Grid.ColumnDefinitions>
|
||||||
<RowDefinition Height="*" />
|
<Grid Grid.Column="1">
|
||||||
</Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<Border Background="{StaticResource mainLinearColorBrush}" />
|
<RowDefinition Height="20"></RowDefinition>
|
||||||
<Grid
|
<RowDefinition></RowDefinition>
|
||||||
Grid.Row="1"
|
<RowDefinition></RowDefinition>
|
||||||
Margin="2,0,2,2"
|
<RowDefinition></RowDefinition>
|
||||||
Background="White">
|
<RowDefinition></RowDefinition>
|
||||||
<Grid.ColumnDefinitions>
|
<RowDefinition Height="auto"></RowDefinition>
|
||||||
<ColumnDefinition />
|
<RowDefinition Height="20"></RowDefinition>
|
||||||
<ColumnDefinition Width="180" />
|
</Grid.RowDefinitions>
|
||||||
<ColumnDefinition />
|
<Border Grid.Row="1" BorderBrush="{StaticResource mainColorBrush}" BorderThickness="1" CornerRadius="4" Height="26">
|
||||||
</Grid.ColumnDefinitions>
|
<Grid>
|
||||||
<Grid Grid.Column="1">
|
<ComboBox x:Name="cmbUserNameMobile" Margin="3,0" VerticalContentAlignment="Center" Style="{StaticResource BaseComboBoxStyle}"
|
||||||
<Grid.RowDefinitions>
|
SelectionChanged="cmbUserNameMobile_SelectionChanged">
|
||||||
<RowDefinition Height="20" />
|
<ComboBox.ItemTemplate>
|
||||||
<RowDefinition />
|
<DataTemplate>
|
||||||
<RowDefinition />
|
<!--<Grid HorizontalAlignment="Stretch" Width="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ComboBox}, Path=Width}">
|
||||||
<RowDefinition />
|
|
||||||
<RowDefinition />
|
|
||||||
<RowDefinition Height="auto" />
|
|
||||||
<RowDefinition Height="20" />
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
<Border
|
|
||||||
Grid.Row="1"
|
|
||||||
Height="26"
|
|
||||||
BorderBrush="{StaticResource mainColorBrush}"
|
|
||||||
BorderThickness="1"
|
|
||||||
CornerRadius="4">
|
|
||||||
<Grid>
|
|
||||||
<ComboBox
|
|
||||||
x:Name="cmbUserNameMobile"
|
|
||||||
Margin="3,0"
|
|
||||||
VerticalContentAlignment="Center"
|
|
||||||
SelectionChanged="cmbUserNameMobile_SelectionChanged"
|
|
||||||
Style="{StaticResource BaseComboBoxStyle}">
|
|
||||||
<ComboBox.ItemTemplate>
|
|
||||||
<DataTemplate>
|
|
||||||
<!--<Grid HorizontalAlignment="Stretch" Width="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ComboBox}, Path=Width}">
|
|
||||||
<TextBlock Text="{Binding}"/>
|
<TextBlock Text="{Binding}"/>
|
||||||
<Button x:Name="btnDeleteItem" HorizontalAlignment="Right" Content="X" Click="btnDeleteItem_Click"/>
|
<Button x:Name="btnDeleteItem" HorizontalAlignment="Right" Content="X" Click="btnDeleteItem_Click"/>
|
||||||
</Grid>-->
|
</Grid>-->
|
||||||
<Grid Width="140" HorizontalAlignment="Stretch">
|
<Grid HorizontalAlignment="Stretch" Width="140">
|
||||||
<TextBlock
|
<TextBlock x:Name="txtName" Text="{Binding}" Padding="0" VerticalAlignment="Center"/>
|
||||||
x:Name="txtName"
|
<userctrls:UcImageButton Width="17" Height="17" ButtonImage="{StaticResource imgCloseGray}" BorderThickness="0" Cursor="Hand"
|
||||||
Padding="0"
|
MouseOverButtonImage="{StaticResource imgCloseGray}" MousePressButtonImage="{StaticResource imgCloseGray}" Background="Transparent"
|
||||||
VerticalAlignment="Center"
|
x:Name="btnDeleteItem" Tag="{Binding ElementName=txtName, Path=Text}" HorizontalAlignment="Right" Click="btnDeleteItem_Click"/>
|
||||||
Text="{Binding}" />
|
</Grid>
|
||||||
<userctrls:UcImageButton
|
</DataTemplate>
|
||||||
x:Name="btnDeleteItem"
|
</ComboBox.ItemTemplate>
|
||||||
Width="17"
|
</ComboBox>
|
||||||
Height="17"
|
</Grid>
|
||||||
HorizontalAlignment="Right"
|
</Border>
|
||||||
Background="Transparent"
|
<Border Grid.Row="2" BorderBrush="{StaticResource mainColorBrush}" BorderThickness="1" CornerRadius="4" Height="26">
|
||||||
BorderThickness="0"
|
<PasswordBox x:Name="txtPassword" Margin="6,0" VerticalContentAlignment="Center" Style="{StaticResource BasePasswordBoxStyle}"></PasswordBox>
|
||||||
ButtonImage="{StaticResource imgCloseGray}"
|
</Border>
|
||||||
Click="btnDeleteItem_Click"
|
<CheckBox Content="记住密码" x:Name="chkRemember" BorderBrush="{StaticResource mainColorBrush}" FontSize="12" HorizontalAlignment="Left" Grid.Row="3" VerticalAlignment="Center" Checked="chkRemember_Checked"/>
|
||||||
Cursor="Hand"
|
<Button x:Name="btnLogin" Style="{StaticResource BaseButtonStyle}" Grid.Row="4" Content="安 全 登 录" Height="26" Click="btnLogin_Click"></Button>
|
||||||
MouseOverButtonImage="{StaticResource imgCloseGray}"
|
<CheckBox Content="调试模式" Height="24" Visibility="Collapsed" x:Name="chkDebug" BorderBrush="{StaticResource mainColorBrush}"
|
||||||
MousePressButtonImage="{StaticResource imgCloseGray}"
|
FontSize="12" VerticalContentAlignment="Center" HorizontalAlignment="Left" Grid.Row="5" VerticalAlignment="Center" Checked="chkDebug_Checked" Unchecked="chkDebug_Checked"/>
|
||||||
Tag="{Binding ElementName=txtName, Path=Text}" />
|
|
||||||
</Grid>
|
|
||||||
</DataTemplate>
|
|
||||||
</ComboBox.ItemTemplate>
|
|
||||||
</ComboBox>
|
|
||||||
</Grid>
|
|
||||||
</Border>
|
|
||||||
<Border
|
|
||||||
Grid.Row="2"
|
|
||||||
Height="26"
|
|
||||||
BorderBrush="{StaticResource mainColorBrush}"
|
|
||||||
BorderThickness="1"
|
|
||||||
CornerRadius="4">
|
|
||||||
<PasswordBox
|
|
||||||
x:Name="txtPassword"
|
|
||||||
Margin="6,0"
|
|
||||||
VerticalContentAlignment="Center"
|
|
||||||
Style="{StaticResource BasePasswordBoxStyle}" />
|
|
||||||
</Border>
|
|
||||||
<CheckBox
|
|
||||||
x:Name="chkRemember"
|
|
||||||
Grid.Row="3"
|
|
||||||
HorizontalAlignment="Left"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
BorderBrush="{StaticResource mainColorBrush}"
|
|
||||||
Checked="chkRemember_Checked"
|
|
||||||
Content="记住密码"
|
|
||||||
FontSize="12" />
|
|
||||||
<Button
|
|
||||||
x:Name="btnLogin"
|
|
||||||
Grid.Row="4"
|
|
||||||
Height="26"
|
|
||||||
Click="btnLogin_Click"
|
|
||||||
Content="安 全 登 录"
|
|
||||||
Style="{StaticResource BaseButtonStyle}" />
|
|
||||||
<CheckBox
|
|
||||||
x:Name="chkDebug"
|
|
||||||
Grid.Row="5"
|
|
||||||
Height="24"
|
|
||||||
HorizontalAlignment="Left"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
VerticalContentAlignment="Center"
|
|
||||||
BorderBrush="{StaticResource mainColorBrush}"
|
|
||||||
Checked="chkDebug_Checked"
|
|
||||||
Content="调试模式"
|
|
||||||
FontSize="12"
|
|
||||||
Unchecked="chkDebug_Checked"
|
|
||||||
Visibility="Collapsed" />
|
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<Image
|
<Image Source="{StaticResource main29WeixinIcon}" Height="24" Width="24" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="4"></Image>
|
||||||
Width="24"
|
<Label x:Name="lblAppName" FontSize="28" Margin="0,14,0,0" Foreground="{StaticResource mainColorLightBrush}" HorizontalAlignment="Center"
|
||||||
Height="24"
|
VerticalAlignment="Center" Content="拍单软件"></Label>
|
||||||
Margin="4"
|
<Label x:Name="lblTitle" Margin="30,2" Foreground="White" Content="{Binding ElementName=loginWindow, Path=Title}"></Label>
|
||||||
HorizontalAlignment="Left"
|
<userctrls:UcWindowBoxes VerticalAlignment="Top" HorizontalAlignment="Right" Margin="4" MaxBoxVisibility="Collapsed" MinBoxVisibility="Collapsed"/>
|
||||||
VerticalAlignment="Top"
|
|
||||||
Source="{StaticResource main29WeixinIcon}" />
|
</Grid>
|
||||||
<Label
|
|
||||||
x:Name="lblAppName"
|
|
||||||
Margin="0,14,0,0"
|
|
||||||
HorizontalAlignment="Center"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
Background="Transparent"
|
|
||||||
Content="拍单软件"
|
|
||||||
FontSize="28"
|
|
||||||
Foreground="{StaticResource mainColorLightBrush}"
|
|
||||||
Style="{x:Null}" />
|
|
||||||
<Label
|
|
||||||
x:Name="lblTitle"
|
|
||||||
Margin="30,2"
|
|
||||||
Content="{Binding ElementName=loginWindow, Path=Title}"
|
|
||||||
Foreground="White" />
|
|
||||||
<userctrls:UcWindowBoxes
|
|
||||||
Margin="4"
|
|
||||||
HorizontalAlignment="Right"
|
|
||||||
VerticalAlignment="Top"
|
|
||||||
MaxBoxVisibility="Collapsed"
|
|
||||||
MinBoxVisibility="Collapsed" />
|
|
||||||
|
|
||||||
</Grid>
|
|
||||||
</basewindows:BaseWindow>
|
</basewindows:BaseWindow>
|
||||||
@@ -2,7 +2,6 @@
|
|||||||
using _29WxOrderWpf.UserControls;
|
using _29WxOrderWpf.UserControls;
|
||||||
using AllBase;
|
using AllBase;
|
||||||
using AllBase.DouYinModel.Param.LoginManage;
|
using AllBase.DouYinModel.Param.LoginManage;
|
||||||
using MAX.Core.Helpers;
|
|
||||||
using NaiBa.Util;
|
using NaiBa.Util;
|
||||||
using NaiBa.Util.Extension;
|
using NaiBa.Util.Extension;
|
||||||
using NaiBa.Util.Helper;
|
using NaiBa.Util.Helper;
|
||||||
@@ -23,6 +22,7 @@ using System.Windows.Media.Imaging;
|
|||||||
using System.Windows.Shapes;
|
using System.Windows.Shapes;
|
||||||
using Work;
|
using Work;
|
||||||
using Work.BaseForms;
|
using Work.BaseForms;
|
||||||
|
using WxOrder.Framework.Commons;
|
||||||
|
|
||||||
namespace _29WxOrderWpf.Windows.LoginWindows
|
namespace _29WxOrderWpf.Windows.LoginWindows
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -54,9 +54,9 @@ namespace _29WxOrderWpf.Windows.OrderWindows
|
|||||||
|
|
||||||
if (OrderItem != null)
|
if (OrderItem != null)
|
||||||
{
|
{
|
||||||
this.cmbWareHouse.Text = TransitWarehouseData.TransitWarehouseList.FirstOrDefault(t => t.TransId == OrderItem.ItemTransitOrder?.platform)?.TransName;
|
this.cmbWareHouse.Text = TransitWarehouseData.TransitWarehouseList.FirstOrDefault(t => t.TransId == OrderItem.ItemTransitOrderWithVoid?.platform)?.TransName;
|
||||||
this.txtExpressName.Text = OrderItem.ItemTransitOrder?.express_2_company;
|
this.txtExpressName.Text = OrderItem.ItemTransitOrder?.express_2_company ?? OrderItem.ItemTransitOrderWithVoid?.express_2_company;
|
||||||
this.txtWarehouseWaybill.Text = OrderItem.ItemTransitOrder?.express_2_waybill;
|
this.txtWarehouseWaybill.Text = OrderItem.ItemTransitOrder?.express_2_waybill ?? OrderItem.ItemTransitOrderWithVoid?.express_2_waybill;
|
||||||
|
|
||||||
if (OrderItem.ItemTransitOrderAfterSale != null)
|
if (OrderItem.ItemTransitOrderAfterSale != null)
|
||||||
{
|
{
|
||||||
@@ -72,6 +72,7 @@ namespace _29WxOrderWpf.Windows.OrderWindows
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
// 需要手动申请售后的,先去申请售后再提交拦截退回总店
|
||||||
if (!string.IsNullOrEmpty(OrderItem.ItemTransitOrderWithVoid?.out_order_no) && OrderItem.PddBuyerAfterSaleAddressStr.IsNullOrEmpty() &&
|
if (!string.IsNullOrEmpty(OrderItem.ItemTransitOrderWithVoid?.out_order_no) && OrderItem.PddBuyerAfterSaleAddressStr.IsNullOrEmpty() &&
|
||||||
OrderItem.TransitRefundStatusStr.Contains("需手动申请售后") || OrderItem.TransitRefundStatusStr.Contains("待用户发货"))
|
OrderItem.TransitRefundStatusStr.Contains("需手动申请售后") || OrderItem.TransitRefundStatusStr.Contains("待用户发货"))
|
||||||
{
|
{
|
||||||
@@ -96,6 +97,7 @@ namespace _29WxOrderWpf.Windows.OrderWindows
|
|||||||
}
|
}
|
||||||
imgLoading.Visibility = Visibility.Collapsed;
|
imgLoading.Visibility = Visibility.Collapsed;
|
||||||
|
|
||||||
|
// 如果提交过工单,则显示已提交工单及提交时间。
|
||||||
var workOrderInfo = await GetWorkOrder();
|
var workOrderInfo = await GetWorkOrder();
|
||||||
var issueType = BaseRegex.GetStringJson(ref workOrderInfo, "issueType");
|
var issueType = BaseRegex.GetStringJson(ref workOrderInfo, "issueType");
|
||||||
var createTime = BaseRegex.GetStringJson(ref workOrderInfo, "createdAt").ParseToString().ParseToDateTime();
|
var createTime = BaseRegex.GetStringJson(ref workOrderInfo, "createdAt").ParseToString().ParseToDateTime();
|
||||||
@@ -116,18 +118,13 @@ namespace _29WxOrderWpf.Windows.OrderWindows
|
|||||||
|
|
||||||
if ((OrderItem?.ItemTransitOrder?.warehouse_status).ParseToInt() < 1)
|
if ((OrderItem?.ItemTransitOrder?.warehouse_status).ParseToInt() < 1)
|
||||||
{
|
{
|
||||||
lblMsg.Content = "当前订单仓库状态不支持售后!";
|
//btnAdd.IsEnabled = false;
|
||||||
|
//lblMsg.Content = "当前订单仓库状态不支持拦截退回总店,建议联系买家直接退回总店!";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void btnAdd_Click(object sender, RoutedEventArgs e)
|
private void btnAdd_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
if ((OrderItem?.ItemTransitOrder?.warehouse_status).ParseToInt() < 1)
|
|
||||||
{
|
|
||||||
BaseMsgWindow.ShowError("当前订单仓库状态不支持售后,请联系买家直接退回总店!");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(lblWorkOrderMsg.Content.ParseToString()))
|
if (string.IsNullOrEmpty(lblWorkOrderMsg.Content.ParseToString()))
|
||||||
{
|
{
|
||||||
var workOrder = AddWorkOrder();
|
var workOrder = AddWorkOrder();
|
||||||
@@ -154,7 +151,7 @@ namespace _29WxOrderWpf.Windows.OrderWindows
|
|||||||
|
|
||||||
JObject data = new JObject();
|
JObject data = new JObject();
|
||||||
data["orderNo"] = OrderItem.order_id;
|
data["orderNo"] = OrderItem.order_id;
|
||||||
data["orderCode"] = OrderItem.ItemTransitOrder?.order_code;
|
data["orderCode"] = OrderItem.ItemTransitOrderWithVoid?.order_code;
|
||||||
data["refundProvince"] = txtProvince.Text.Trim();
|
data["refundProvince"] = txtProvince.Text.Trim();
|
||||||
data["refundCity"] = txtCity.Text.Trim();
|
data["refundCity"] = txtCity.Text.Trim();
|
||||||
data["refundCounty"] = txtCounty.Text.Trim();
|
data["refundCounty"] = txtCounty.Text.Trim();
|
||||||
@@ -254,12 +251,15 @@ namespace _29WxOrderWpf.Windows.OrderWindows
|
|||||||
{
|
{
|
||||||
if (OrderItem.ItemTransitOrder?.warehouse_status == 3)
|
if (OrderItem.ItemTransitOrder?.warehouse_status == 3)
|
||||||
return "\"success\":true,\"message\":\"已到仓,无需拦截工单\"";
|
return "\"success\":true,\"message\":\"已到仓,无需拦截工单\"";
|
||||||
|
if (OrderItem.ItemTransitOrderWithVoid?.warehouse_status == 3)
|
||||||
|
return "\"success\":true,\"message\":\"已到仓,无需拦截工单\"";
|
||||||
|
|
||||||
string url = HttpResponseTransitWorkOrderBLL.WorkOrderUrl + "/api/open/v1/customer-work-orders/intercept-return-cloud-warehouse-after-outbound";
|
string url = HttpResponseTransitWorkOrderBLL.WorkOrderUrl + "/api/open/v1/customer-work-orders/intercept-return-cloud-warehouse-after-outbound";
|
||||||
JObject obj = new JObject();
|
JObject obj = new JObject();
|
||||||
obj["appId"] = this.OrderItem.Shop.ShopId;
|
obj["appId"] = this.OrderItem.Shop?.ShopId;
|
||||||
obj["wechatOrderNo"] = this.OrderItem.order_id;
|
obj["wechatOrderNo"] = this.OrderItem.order_id;
|
||||||
obj["purchaseOrderNo"] = this.OrderItem.PddBuyerAfterSale?.orderSn;
|
//obj["purchaseOrderNo"] = this.OrderItem.PddBuyerAfterSale?.orderSn;
|
||||||
|
obj["purchaseOrderNo"] = OrderItem.ItemTransitOrderWithVoid?.order_code;
|
||||||
obj["creator"] = BaseClass.UserName;
|
obj["creator"] = BaseClass.UserName;
|
||||||
obj["remark"] = "客户要求拦截并退回云仓";
|
obj["remark"] = "客户要求拦截并退回云仓";
|
||||||
|
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ namespace _29WxOrderWpf.Windows.OrderWindows
|
|||||||
txtShopName.Text = OrderItem.ItemOrder?.shop_name;
|
txtShopName.Text = OrderItem.ItemOrder?.shop_name;
|
||||||
txtGoodsName.Text = OrderItem.title;
|
txtGoodsName.Text = OrderItem.title;
|
||||||
txtSpuId.Text = OrderItem.product_id.ParseToString();
|
txtSpuId.Text = OrderItem.product_id.ParseToString();
|
||||||
txtSpecName.Text = OrderItem.sku_attr_str;
|
txtSpecName.Text = OrderItem.SkuAttrStr;
|
||||||
|
|
||||||
txtWaybillId.Text = OrderItem.ItemRefund?.return_waybill_id;
|
txtWaybillId.Text = OrderItem.ItemRefund?.return_waybill_id;
|
||||||
foreach (var cmbItem in cmbExpressName.Items)
|
foreach (var cmbItem in cmbExpressName.Items)
|
||||||
@@ -102,16 +102,31 @@ namespace _29WxOrderWpf.Windows.OrderWindows
|
|||||||
{
|
{
|
||||||
// 回填库内信息
|
// 回填库内信息
|
||||||
btnAdd.Content = "创 建";
|
btnAdd.Content = "创 建";
|
||||||
txtProvince.Text = OrderItem.DistribReturnOrderInfo.receiver_province;
|
if (OrderItem.DistribReturnOrderInfo != null)
|
||||||
txtCity.Text = OrderItem.DistribReturnOrderInfo.receiver_city;
|
{
|
||||||
txtCounty.Text = OrderItem.DistribReturnOrderInfo.receiver_area;
|
txtProvince.Text = OrderItem.DistribReturnOrderInfo.receiver_province;
|
||||||
txtDetailAddress.Text = OrderItem.DistribReturnOrderInfo.receiver_address;
|
txtCity.Text = OrderItem.DistribReturnOrderInfo.receiver_city;
|
||||||
txtUser.Text = OrderItem.DistribReturnOrderInfo.receiver_name;
|
txtCounty.Text = OrderItem.DistribReturnOrderInfo.receiver_area;
|
||||||
txtMobile.Text = OrderItem.DistribReturnOrderInfo.receiver_phone;
|
txtDetailAddress.Text = OrderItem.DistribReturnOrderInfo.receiver_address;
|
||||||
|
txtUser.Text = OrderItem.DistribReturnOrderInfo.receiver_name;
|
||||||
|
txtMobile.Text = OrderItem.DistribReturnOrderInfo.receiver_phone;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (OrderItem.AddEditTransitWarehouseReturnOrderStr == "已创建" || OrderItem.AddEditTransitWarehouseReturnOrderStr == "处理中")
|
if (OrderItem.AddEditTransitWarehouseReturnOrderStr == "已创建未到仓" || OrderItem.AddEditTransitWarehouseReturnOrderStr == "已到仓" ||
|
||||||
btnAdd.IsEnabled = false;
|
OrderItem.AddEditTransitWarehouseReturnOrderStr == "已发回")
|
||||||
|
{
|
||||||
|
btnAdd.IsEnabled = btnAddressAnalysis.IsEnabled = false;
|
||||||
|
if (OrderItem.DistribReturnOrderInfo != null)
|
||||||
|
{
|
||||||
|
txtProvince.Text = OrderItem.DistribReturnOrderInfo.receiver_province;
|
||||||
|
txtCity.Text = OrderItem.DistribReturnOrderInfo.receiver_city;
|
||||||
|
txtCounty.Text = OrderItem.DistribReturnOrderInfo.receiver_area;
|
||||||
|
txtDetailAddress.Text = OrderItem.DistribReturnOrderInfo.receiver_address;
|
||||||
|
txtUser.Text = OrderItem.DistribReturnOrderInfo.receiver_name;
|
||||||
|
txtMobile.Text = OrderItem.DistribReturnOrderInfo.receiver_phone;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -119,8 +134,8 @@ namespace _29WxOrderWpf.Windows.OrderWindows
|
|||||||
{
|
{
|
||||||
if (OrderItem?.ItemOrder?.OrderBuyType == "云仓" && (OrderItem?.ItemTransitOrder?.warehouse_status).ParseToInt() < 1)
|
if (OrderItem?.ItemOrder?.OrderBuyType == "云仓" && (OrderItem?.ItemTransitOrder?.warehouse_status).ParseToInt() < 1)
|
||||||
{
|
{
|
||||||
BaseMsgWindow.ShowError("当前订单仓库状态不支持创建退货订单!");
|
//BaseMsgWindow.ShowError("当前订单仓库状态不支持创建退货订单!");
|
||||||
return;
|
//return;
|
||||||
}
|
}
|
||||||
if (txtWaybillId.Text.Trim().IsNullOrEmpty() || PddBuyerOrderLiteInfo.GetPddToTransitWarehouseExpressCompanyCode(cmbExpressName.SelectedItem.ParseToString()).IsNullOrEmpty())
|
if (txtWaybillId.Text.Trim().IsNullOrEmpty() || PddBuyerOrderLiteInfo.GetPddToTransitWarehouseExpressCompanyCode(cmbExpressName.SelectedItem.ParseToString()).IsNullOrEmpty())
|
||||||
{
|
{
|
||||||
@@ -133,6 +148,11 @@ namespace _29WxOrderWpf.Windows.OrderWindows
|
|||||||
BaseMsgWindow.ShowError("缺少收货人信息!");
|
BaseMsgWindow.ShowError("缺少收货人信息!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (txtUser.Text.Trim().Length > 15)
|
||||||
|
{
|
||||||
|
BaseMsgWindow.ShowError("收货人姓名长度不能超过15!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
JObject jObj = new JObject();
|
JObject jObj = new JObject();
|
||||||
@@ -171,7 +191,7 @@ namespace _29WxOrderWpf.Windows.OrderWindows
|
|||||||
jItemObj["spuCode"] = OrderItem.product_id.ParseToString();
|
jItemObj["spuCode"] = OrderItem.product_id.ParseToString();
|
||||||
jItemObj["spuName"] = OrderItem.title;
|
jItemObj["spuName"] = OrderItem.title;
|
||||||
jItemObj["skuCode"] = OrderItem.sku_id.ParseToString();
|
jItemObj["skuCode"] = OrderItem.sku_id.ParseToString();
|
||||||
jItemObj["specInfo"] = OrderItem.sku_attr_str;
|
jItemObj["specInfo"] = OrderItem.SkuAttrStr;
|
||||||
jItemObj["skuUrl"] = OrderItem.thumb_img;
|
jItemObj["skuUrl"] = OrderItem.thumb_img;
|
||||||
jItemObj["picUrl"] = OrderItem.thumb_img;
|
jItemObj["picUrl"] = OrderItem.thumb_img;
|
||||||
jItemObj["returnQuantity"] = OrderItem.sku_cnt;
|
jItemObj["returnQuantity"] = OrderItem.sku_cnt;
|
||||||
@@ -254,7 +274,7 @@ namespace _29WxOrderWpf.Windows.OrderWindows
|
|||||||
if (wxExpressName.IsNullOrEmpty() || OrderItem.ItemRefund.return_waybill_id.IsNullOrEmpty() || receiver.receiver_name.IsNullOrEmpty() || receiver.receiver_phone.IsNullOrEmpty() ||
|
if (wxExpressName.IsNullOrEmpty() || OrderItem.ItemRefund.return_waybill_id.IsNullOrEmpty() || receiver.receiver_name.IsNullOrEmpty() || receiver.receiver_phone.IsNullOrEmpty() ||
|
||||||
receiver.receiver_province.IsNullOrEmpty() || receiver.receiver_city.IsNullOrEmpty() || receiver.receiver_area.IsNullOrEmpty() || receiver.receiver_address.IsNullOrEmpty())
|
receiver.receiver_province.IsNullOrEmpty() || receiver.receiver_city.IsNullOrEmpty() || receiver.receiver_area.IsNullOrEmpty() || receiver.receiver_address.IsNullOrEmpty())
|
||||||
{
|
{
|
||||||
if (!string.IsNullOrWhiteSpace(aftersaleAddress))
|
if (!string.IsNullOrWhiteSpace(aftersaleAddress) || receiver.receiver_name?.Length > 15)
|
||||||
{
|
{
|
||||||
// todo 提示地址解析失败请手动提交
|
// todo 提示地址解析失败请手动提交
|
||||||
OrderItem.AddEditTransitWarehouseReturnOrderStr = "解析失败请手动添加";
|
OrderItem.AddEditTransitWarehouseReturnOrderStr = "解析失败请手动添加";
|
||||||
@@ -297,7 +317,7 @@ namespace _29WxOrderWpf.Windows.OrderWindows
|
|||||||
jItemObj["spuCode"] = OrderItem.product_id.ParseToString();
|
jItemObj["spuCode"] = OrderItem.product_id.ParseToString();
|
||||||
jItemObj["spuName"] = OrderItem.title;
|
jItemObj["spuName"] = OrderItem.title;
|
||||||
jItemObj["skuCode"] = OrderItem.sku_id.ParseToString();
|
jItemObj["skuCode"] = OrderItem.sku_id.ParseToString();
|
||||||
jItemObj["specInfo"] = OrderItem.sku_attr_str;
|
jItemObj["specInfo"] = OrderItem.SkuAttrStr;
|
||||||
jItemObj["skuUrl"] = OrderItem.thumb_img;
|
jItemObj["skuUrl"] = OrderItem.thumb_img;
|
||||||
jItemObj["picUrl"] = OrderItem.thumb_img;
|
jItemObj["picUrl"] = OrderItem.thumb_img;
|
||||||
jItemObj["returnQuantity"] = OrderItem.sku_cnt;
|
jItemObj["returnQuantity"] = OrderItem.sku_cnt;
|
||||||
|
|||||||
@@ -46,6 +46,7 @@
|
|||||||
<!-- Framework assemblies not already implied by UseWindowsForms/UseWPF -->
|
<!-- Framework assemblies not already implied by UseWindowsForms/UseWPF -->
|
||||||
<Reference Include="System.Data" />
|
<Reference Include="System.Data" />
|
||||||
<Reference Include="System.Management" />
|
<Reference Include="System.Management" />
|
||||||
|
<Reference Include="System.Net.Http" />
|
||||||
<Reference Include="System.Web.Services" />
|
<Reference Include="System.Web.Services" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
* 2012-5-9
|
* 2012-5-9
|
||||||
*/
|
*/
|
||||||
using AllBase.DouYinModel.Result;
|
using AllBase.DouYinModel.Result;
|
||||||
|
using AllBase.Model.Config;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
@@ -36,7 +37,7 @@ namespace AllBase
|
|||||||
/// 版本ID
|
/// 版本ID
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
||||||
public static int VersionCount = 276;
|
public static int VersionCount = 335;
|
||||||
|
|
||||||
public static string ServerUrl { get; set; } = "http://1.13.195.131:9000";
|
public static string ServerUrl { get; set; } = "http://1.13.195.131:9000";
|
||||||
public static string DebugUrl { get; set; } = "http://localhost:9000";
|
public static string DebugUrl { get; set; } = "http://localhost:9000";
|
||||||
@@ -600,7 +601,7 @@ namespace AllBase
|
|||||||
public static string MainUserName { get { return string.IsNullOrEmpty(ParentUserName) ? UserName : ParentUserName; } }
|
public static string MainUserName { get { return string.IsNullOrEmpty(ParentUserName) ? UserName : ParentUserName; } }
|
||||||
public static int SaLevel { get; set; }
|
public static int SaLevel { get; set; }
|
||||||
public static bool IsLoginSuccess { get; set; }
|
public static bool IsLoginSuccess { get; set; }
|
||||||
|
public static SettingConfig Setting { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// CPU使用率更新线程
|
/// CPU使用率更新线程
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
Loaded 100 of 345 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user