1自动拍单功能(暂未开放)
This commit is contained in:
1 parent
b42c17c013
commit
5906a1623f
8 files changed
+287
-185
No files matched your search
@@ -49,14 +49,14 @@ namespace _29WxOrderWpf.BaseWindows
|
||||
|
||||
BaseMsgWindow msgBox = null;
|
||||
Window owner = window ?? MainWindow.Instance;
|
||||
|
||||
owner.Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
//owner.Dispatcher.Invoke(() =>
|
||||
Application.Current.Dispatcher.Invoke(() =>
|
||||
{
|
||||
msgBox = CreateMsgForm(msg, title, wl);
|
||||
msgBox.imgTip.Source = Application.Current.Resources["imgBaseMsgInfo"] as ImageSource;
|
||||
msgBox.Owner = owner;
|
||||
//msgBox.Owner = owner;
|
||||
msgBox.ShowDialog();
|
||||
}));
|
||||
});
|
||||
return msgBox;
|
||||
}
|
||||
|
||||
@@ -65,13 +65,14 @@ namespace _29WxOrderWpf.BaseWindows
|
||||
string title = string.IsNullOrEmpty(caption) ? "系统错误" : caption;
|
||||
BaseMsgWindow msgBox = null;
|
||||
Window owner = window ?? MainWindow.Instance;
|
||||
owner.Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
//owner.Dispatcher.Invoke(() =>
|
||||
Application.Current.Dispatcher.Invoke(() =>
|
||||
{
|
||||
msgBox = CreateMsgForm(msg, title, wl);
|
||||
msgBox.imgTip.Source = Application.Current.Resources["imgBaseMsgErr"] as ImageSource;
|
||||
msgBox.Owner = owner;
|
||||
//msgBox.Owner = owner;
|
||||
msgBox.ShowDialog();
|
||||
}));
|
||||
});
|
||||
return msgBox;
|
||||
}
|
||||
|
||||
@@ -81,8 +82,9 @@ namespace _29WxOrderWpf.BaseWindows
|
||||
|
||||
BaseMsgWindow msgBox = null;
|
||||
Window owner = window ?? MainWindow.Instance;
|
||||
owner.Dispatcher.Invoke(() =>
|
||||
{
|
||||
//owner.Dispatcher.Invoke(() =>
|
||||
Application.Current.Dispatcher.Invoke(() =>
|
||||
{
|
||||
msgBox = new BaseMsgWindow
|
||||
{
|
||||
lblTitle = { Content = title },
|
||||
@@ -94,7 +96,7 @@ namespace _29WxOrderWpf.BaseWindows
|
||||
msgBox.Width = (int)MsgWindowLevel.LARGE;
|
||||
msgBox.Height = 500;
|
||||
}
|
||||
msgBox.Owner = owner;
|
||||
//msgBox.Owner = owner;
|
||||
msgBox.ShowDialog();
|
||||
});
|
||||
return msgBox;
|
||||
|
||||
@@ -628,7 +628,7 @@
|
||||
Padding="4,0"
|
||||
c:DebugVisibility.Enable="True"
|
||||
Click="btnAutoBuyIntroduction_Click"
|
||||
Content="自动拍单说明"
|
||||
Content="自动拍单设置说明"
|
||||
FontSize="12"
|
||||
Style="{StaticResource BasePageButtonLightStyle}" />
|
||||
<Polyline
|
||||
|
||||
@@ -5,6 +5,8 @@ using _29WxOrderWpf.Ctrls.BuyerCtrls;
|
||||
using _29WxOrderWpf.Ctrls.Statistics;
|
||||
using _29WxOrderWpf.Services;
|
||||
using _29WxOrderWpf.Utils;
|
||||
using _29WxOrderWpf.ViewModels;
|
||||
using _29WxOrderWpf.Views;
|
||||
using _29WxOrderWpf.Windows.OrderWindows;
|
||||
using AllBase;
|
||||
using AllBase.Extension;
|
||||
@@ -42,7 +44,6 @@ using System.Windows.Media.Imaging;
|
||||
using System.Windows.Shapes;
|
||||
using System.Xml;
|
||||
using System.Xml.Linq;
|
||||
using _29WxOrderWpf.ViewModels;
|
||||
using Work;
|
||||
using Work._29Tools.BLL;
|
||||
using Work.BuyUsers;
|
||||
@@ -2724,7 +2725,12 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
|
||||
private void btnAutoBuyIntroduction_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
AutoBuyIntroductionView autoBuyIntroForm = new AutoBuyIntroductionView();
|
||||
new DialogWindow()
|
||||
{
|
||||
Title = "自动拍单设置说明",
|
||||
Content = autoBuyIntroForm,
|
||||
}.ShowDialog();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ using AllBase.Model.Config;
|
||||
using AllBase.Model.DBModel;
|
||||
using NaiBa.Util;
|
||||
using NaiBa.Util.Helper;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -27,7 +28,9 @@ namespace _29WxOrderWpf
|
||||
GlobalConfig.lstWXShopTokenInfo = new ConcurrentList<WXShopTokenInfo>();
|
||||
|
||||
// 自动拍单支付宝密码
|
||||
GlobalConfig.AlipayPassword = ConfigHelper.LoadConfig<string>("ali_pay_password");
|
||||
GlobalConfig.AlipayPassword = ConfigHelper.LoadConfig<List<string>>("ali_pay_password")?.FirstOrDefault();
|
||||
if (GlobalConfig.AlipayPassword == null)
|
||||
GlobalConfig.AlipayPassword = "";
|
||||
|
||||
new WxOrder.Framework.Startup();
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
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="clr-namespace:_29WxOrderWpf.Common"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:_29WxOrderWpf.Views"
|
||||
@@ -16,47 +17,86 @@
|
||||
Loaded="AutoBuyInstructionView_Loaded"
|
||||
mc:Ignorable="d">
|
||||
<Grid Background="White">
|
||||
<PasswordBox
|
||||
Width="120"
|
||||
Height="24"
|
||||
Margin="198,79,0,0"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Top" />
|
||||
<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="323,80,0,348"
|
||||
Margin="372,80,0,0"
|
||||
Padding="4,0"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Top"
|
||||
Click="btnSaveAliPass_Click"
|
||||
Content="保存密码"
|
||||
FontSize="12"
|
||||
Style="{StaticResource BasePageButtonStyle}" />
|
||||
Style="{StaticResource BasePageButtonStyle}"
|
||||
Visibility="Visible" />
|
||||
|
||||
<Button
|
||||
x:Name="btnClear"
|
||||
Width="Auto"
|
||||
Height="22"
|
||||
MinWidth="48"
|
||||
Margin="384,80,0,348"
|
||||
Margin="433,80,0,0"
|
||||
Padding="4,0"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Top"
|
||||
Click="btnClear_Click"
|
||||
Content="清空密码"
|
||||
FontSize="12"
|
||||
Style="{StaticResource BasePageButtonLightStyle}" />
|
||||
Style="{StaticResource BasePageButtonLightStyle}"
|
||||
Visibility="Visible" />
|
||||
<TextBlock
|
||||
Margin="70,128,0,0"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Top"
|
||||
Text="说明:请输入并保存支付宝支付密码(仅记录在本地),首次自动拍单前请手动拍单一次以缓存支付保Cookie"
|
||||
Margin="70,128,70,128"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"
|
||||
Text="说明:请保存支付宝支付密码(仅记录在本地)供自动拍单支付,首次自动拍单前请手动拍单一次以缓存支付宝Cookie。"
|
||||
TextWrapping="Wrap" />
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -1,4 +1,9 @@
|
||||
using System;
|
||||
using _29WxOrderWpf.BaseWindows;
|
||||
using AllBase.Helper;
|
||||
using AllBase.Model.DBModel;
|
||||
using NaiBa.Util;
|
||||
using NaiBa.Util.Helper;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@@ -12,6 +17,7 @@ using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
using Work.Pinduoduo;
|
||||
|
||||
namespace _29WxOrderWpf.Views
|
||||
{
|
||||
@@ -27,17 +33,42 @@ namespace _29WxOrderWpf.Views
|
||||
|
||||
private void AutoBuyInstructionView_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
this.pbxPassWord.Password = DataOpenSSL.DecryptString(GlobalConfig.AlipayPassword);
|
||||
}
|
||||
|
||||
private void btnSaveAliPass_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
GlobalConfig.AlipayPassword = DataOpenSSL.EncryptString(this.pbxPassWord.Password);
|
||||
ConfigHelper.SaveConfig("ali_pay_password", new List<string>() { GlobalConfig.AlipayPassword });
|
||||
BaseMsgWindow.ShowInfo("密码保存成功!");
|
||||
}
|
||||
|
||||
private void btnClear_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.pbxPassWord.Password = "";
|
||||
GlobalConfig.AlipayPassword = "";
|
||||
ConfigHelper.SaveConfig("ali_pay_password", new List<string>() { GlobalConfig.AlipayPassword });
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user