shanji 3 years ago
parent
commit
39f274b96e
  1. 10
      BBWY.Client/APIServices/ShopService.cs
  2. 5
      BBWY.Client/Models/Enums.cs
  3. 23
      BBWY.Client/ViewModels/Setting/ShopSettingViewModel.cs
  4. 78
      BBWY.Client/Views/Setting/ShopSetting.xaml

10
BBWY.Client/APIServices/ShopService.cs

@ -18,7 +18,10 @@ namespace BBWY.Client.APIServices
PurchaseAccount purchaseAccount,
string dingDingWebHook,
string dingDingKey,
int skuSafeTurnoverDays)
int skuSafeTurnoverDays,
string siNanDingDingWebHook,
string siNanDingDingKey,
int siNanPolicyLevel)
{
if (skuSafeTurnoverDays == 0)
{
@ -37,7 +40,10 @@ namespace BBWY.Client.APIServices
purchaseAccount.PurchasePlatformId,
dingDingWebHook,
dingDingKey,
skuSafeTurnoverDays
skuSafeTurnoverDays,
siNanDingDingWebHook,
siNanDingDingKey,
siNanPolicyLevel
}, null, HttpMethod.Post);
}

5
BBWY.Client/Models/Enums.cs

@ -201,4 +201,9 @@
退 = 3,
= 4
}
public enum SiNanPolicyLevel
{
, ,
}
}

23
BBWY.Client/ViewModels/Setting/ShopSettingViewModel.cs

@ -21,11 +21,14 @@ namespace BBWY.Client.ViewModels
private string managePwd;
private decimal platformCommissionRatio;
private int panelIndex;
private int skuSafeTurnoverDays;
private string dingDingWebHook;
private string dingDingKey;
private KVModel selectedSkuSafeTurnoverDay;
private string siNanDingDingWebHook;
private string siNanDingDingKey;
private SiNanPolicyLevel selectedSiNanPolicyLevel;
public ICommand SaveCommand { get; set; }
public ICommand SetPanelIndexCommand { get; set; }
@ -40,12 +43,15 @@ namespace BBWY.Client.ViewModels
public int PanelIndex { get => panelIndex; set { Set(ref panelIndex, value); } }
public IList<KVModel> SafeDayList { get; set; }
public int SkuSafeTurnoverDays { get => skuSafeTurnoverDays; set { Set(ref skuSafeTurnoverDays, value); } }
public string DingDingWebHook { get => dingDingWebHook; set { Set(ref dingDingWebHook, value); } }
public string DingDingKey { get => dingDingKey; set { Set(ref dingDingKey, value); } }
public KVModel SelectedSkuSafeTurnoverDay { get => selectedSkuSafeTurnoverDay; set { Set(ref selectedSkuSafeTurnoverDay, value); } }
public string SiNanDingDingWebHook { get => siNanDingDingWebHook; set { Set(ref siNanDingDingWebHook, value); } }
public string SiNanDingDingKey { get => siNanDingDingKey; set { Set(ref siNanDingDingKey, value); } }
public SiNanPolicyLevel SelectedSiNanPolicyLevel { get => selectedSiNanPolicyLevel; set { Set(ref selectedSiNanPolicyLevel, value); } }
public ShopSettingViewModel(GlobalContext globalContext, ShopService shopService)
{
PanelIndex = 0;
@ -99,6 +105,10 @@ namespace BBWY.Client.ViewModels
DingDingKey = globalContext.User.Shop.DingDingKey;
DingDingWebHook = globalContext.User.Shop.DingDingWebHook;
SelectedSkuSafeTurnoverDay = SafeDayList.FirstOrDefault(s => s.Value == globalContext.User.Shop.SkuSafeTurnoverDays.ToString());
SelectedSiNanPolicyLevel = (SiNanPolicyLevel)globalContext.User.Shop.SiNanPolicyLevel;
SiNanDingDingKey = globalContext.User.Shop.SiNanDingDingKey;
SiNanDingDingWebHook = globalContext.User.Shop.SiNanDingDingWebHook;
}
protected override void Unload()
@ -140,7 +150,10 @@ namespace BBWY.Client.ViewModels
PurchaseAccount,
DingDingWebHook,
DingDingKey,
int.Parse(SelectedSkuSafeTurnoverDay.Value))).ContinueWith(r =>
int.Parse(SelectedSkuSafeTurnoverDay.Value),
SiNanDingDingWebHook,
SiNanDingDingKey,
(int)SelectedSiNanPolicyLevel)).ContinueWith(r =>
{
IsLoading = false;
var response = r.Result;
@ -160,6 +173,10 @@ namespace BBWY.Client.ViewModels
globalContext.User.Shop.DingDingKey = this.DingDingKey;
globalContext.User.Shop.DingDingWebHook = this.DingDingWebHook;
globalContext.User.Shop.SkuSafeTurnoverDays = int.Parse(SelectedSkuSafeTurnoverDay.Value);
globalContext.User.Shop.SiNanDingDingKey = this.DingDingKey;
globalContext.User.Shop.SiNanDingDingWebHook = this.DingDingWebHook;
globalContext.User.Shop.SiNanPolicyLevel = (int)this.SelectedSiNanPolicyLevel;
});
}
}

78
BBWY.Client/Views/Setting/ShopSetting.xaml

@ -16,12 +16,16 @@
<sys:Int32 x:Key="p0">0</sys:Int32>
<sys:Int32 x:Key="p1">1</sys:Int32>
<sys:Int32 x:Key="p2">2</sys:Int32>
<ObjectDataProvider x:Key="PlatformProvider" MethodName="GetValues" ObjectType="{x:Type sys:Enum}">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="cmodel:Platform"/>
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
<ObjectDataProvider x:Key="SiNanPolicyLevelProvider" MethodName="GetValues" ObjectType="{x:Type sys:Enum}">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="cmodel:SiNanPolicyLevel"/>
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
<Style x:Key="textblockPropertyStyle" TargetType="TextBlock">
<Setter Property="HorizontalAlignment" Value="Right"/>
<Setter Property="VerticalAlignment" Value="Center"/>
@ -199,6 +203,78 @@
</StackPanel>
</Grid>
</Grid>
<Grid Grid.Row="2" Margin="20,0" Visibility="{Binding PanelIndex,Converter={StaticResource objConverter},ConverterParameter=2:Visible:Collapsed}">
<Grid.RowDefinitions>
<RowDefinition Height="40"/>
<RowDefinition Height="40"/>
<RowDefinition Height="40"/>
<RowDefinition Height="40"/>
<RowDefinition Height="40"/>
<RowDefinition Height="40"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="80"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<TextBlock Text="通知设置" Style="{StaticResource textblockPropertyStyle}"/>
<TextBlock Text="密钥" Style="{StaticResource textblockPropertyStyle}" Grid.Row="1"/>
<c:BTextBox Grid.Column="1" Style="{StaticResource textboxValueStyle}" Grid.Row="1" Width="500"
Text="{Binding SiNanDingDingKey,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
<TextBlock Text="WebHook" Style="{StaticResource textblockPropertyStyle}" Grid.Row="2"/>
<c:BTextBox Grid.Column="1" Style="{StaticResource textboxValueStyle}" Grid.Row="2" Width="500"
Text="{Binding SiNanDingDingWebHook,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
<Border Height="1" SnapsToDevicePixels="True" UseLayoutRounding="True" Background="{StaticResource Border.Brush}" Grid.ColumnSpan="2" Grid.Row="3"
VerticalAlignment="Center"/>
<TextBlock Text="策略设置" Style="{StaticResource textblockPropertyStyle}" Grid.Row="4"/>
<TextBlock Text="策略等级" Style="{StaticResource textblockPropertyStyle}" Grid.Row="5"/>
<ComboBox ItemsSource="{Binding Source={StaticResource SiNanPolicyLevelProvider}}"
SelectedItem="{Binding SelectedSiNanPolicyLevel,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
Grid.Column="1" Grid.Row="5" HorizontalAlignment="Left" Height="30" Width="100"
VerticalContentAlignment="Center"/>
<Grid Grid.ColumnSpan="2" Grid.Row="6" Margin="4.5,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.32*"/>
<ColumnDefinition Width="0.32*"/>
<ColumnDefinition Width="0.36*"/>
</Grid.ColumnDefinitions>
<StackPanel>
<TextBlock Text="初级策略" FontWeight="Bold" Margin="0,10,0,5" FontSize="16"/>
<TextBlock Text="成长加速期定义" Margin="0,0,0,5" FontWeight="Bold"/>
<TextBlock Text="维度下SKU累计推广花费低于300" Margin="0,0,0,5"/>
<TextBlock Text="提醒规则" Margin="0,0,0,5" FontWeight="Bold"/>
<TextBlock Text="SKU累计推广花费低于100元,不建议调整" Margin="0,0,0,5"/>
<TextBlock Text="SKU累计推广花费达到100元,单元、创意、SkuGOI低于0.5,高于1.1提醒" Margin="0,0,0,5"/>
<TextBlock Text="SKU累计推广花费达到200元,单元、创意、SkuGOI低于0.7,高于1.1提醒" Margin="0,0,0,5"/>
<TextBlock Text="SKU累计推广花费达到300元,单元、创意、SkuGOI低于0.9,高于1.1提醒" Margin="0,0,0,5"/>
</StackPanel>
<StackPanel Grid.Column="1">
<TextBlock Text="" FontWeight="Bold" Margin="0,10,0,5" FontSize="16"/>
<TextBlock Text="成熟利润期定义" Margin="0,0,0,5" FontWeight="Bold"/>
<TextBlock Text="维度下SKU累计推广花费大于300,且近7天大于150" Margin="0,0,0,5"/>
<TextBlock Text="提醒规则" Margin="0,0,0,5" FontWeight="Bold"/>
<TextBlock Text="单元、创意、SkuGOI低于0.9提醒,高于1.2提醒" Margin="0,0,0,5"/>
</StackPanel>
<StackPanel Grid.Column="2">
<TextBlock Text="" FontWeight="Bold" Margin="0,10,0,5" FontSize="16"/>
<TextBlock Text="稳定日销期定义" Margin="0,0,0,5" FontWeight="Bold"/>
<TextBlock Text="维度下SKU累计推广花费大于300且,近7天低于150" Margin="0,0,0,5"/>
<TextBlock Text="提醒规则" Margin="0,0,0,5" FontWeight="Bold"/>
<TextBlock Text="单元、创意、SkuGOI低于1.0提醒,高于2" Margin="0,0,0,5"/>
</StackPanel>
</Grid>
</Grid>
<c:BButton Content="保存" Grid.Row="3" Width="80" HorizontalAlignment="Left"
Command="{Binding SaveCommand}" Margin="20,0,0,0"/>
</Grid>

Loading…
Cancel
Save