old_flsystem/应用/Weixin.PDDCirclePromotion/Config.cs

274 lines
9.6 KiB
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using Api.Framework.Enums;
using Api.Framework.SDK;
using PDDCircleFriends.Controls;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UI.Framework.Entitys;
using static Api.Framework.ApiClient;
using static PDDCircleFriends.Enums;
namespace PDDCircleFriends
{
[Config(Name = "插件-拼多多发单-配置")]
public class Config
{
#region
#region
/// <summary>
/// 发单条件 - 商品最低售价
/// </summary>
[
Category("1、自动采集"), DisplayName("01.采集开关"), DefaultValue(SwitchType.开启)
]
public SwitchType Switch { get; set; }
/// <summary>
/// 采集数据触发数量
/// </summary>
[
Category("1、自动采集"), DisplayName("02.采集触发量"), DefaultValue(10),
Description(@"当采集开关为开启时,该值为一个采集点,当采集剩余的商品数量少于等于采集触发量,将自动进行采集操作")
]
public int GatherTouchNum { get; set; }
/// <summary>
/// 发单条件 - 商品最低售价
/// </summary>
[
Category("1、自动采集"), DisplayName("03.商品最低售价"), DefaultValue(null),
Description(@"采集的产品最低价格,不填写表示不限制最低价!")
]
public double? FloorPrice { get; set; }
/// <summary>
/// 发单条件 - 商品最高售价
/// </summary>
[
Category("1、自动采集"), DisplayName("04.商品最高售价"), DefaultValue(null),
Description(@"采集的产品最高价格,不填写表示不限制最高价!")
]
public double? CeilingPrice { get; set; }
/// <summary>
/// 发单条件 - 佣金比例
/// </summary>
[
Category("1、自动采集"), DisplayName("05.佣金比例"), DefaultValue(null),
Description(@"采集的产品佣金比例条件,选中的比例包含选中的值.不填写表示不限制佣金比例!")
]
public double? PromotionRate { get; set; }
/// <summary>
/// 发单条件 - 类目
/// </summary>
[
Category("1、自动采集"), DisplayName("06.类目"), DefaultValue(@"精选"),
Description(@"筛选类目:精选、百货、母婴、服饰、美食、美妆、内衣、鞋包、男装、手机、文具、电器、家纺、运动、家装、汽车、水果"),
Editor(typeof(CategoryControl), typeof(System.Drawing.Design.UITypeEditor))
]
public string Category { get; set; }
/// <summary>
/// 发单条件 - 店铺评分
/// </summary>
[
Category("1、自动采集"), DisplayName("07.店铺评分"), DefaultValue(ShopScoreType.不限),
Description(@"采集的产品对店铺的条件,选中的评分包含高于选中评分")
]
public ShopScoreType ShopScore { get; set; }
#endregion
#region
/// <summary>
/// 朋友圈发单二维码模板
/// </summary>
[
Category("2、朋友圈设置"), DisplayName("01.发单二维码模板"), DefaultValue(QrImageType.模板B),
Description(@"朋友圈发单二维码模板")
]
public QrImageType Model { get; set; }
private string[] _sendTaskTimes;
/// <summary>
/// 发送任务时间段
/// </summary>
[
Category("2、朋友圈设置"), DisplayName("02.发送任务时间段"),
Description(@"每一行为一个发送时间段
格式时间1-时间2
时间1 必须大于 时间2")
]
public string[] SendTaskTimes //{ get; set; }
{
get { return _sendTaskTimes; }
set
{
var sendTaskTimes = value as string[];
if (sendTaskTimes != null && sendTaskTimes.Length != 0)
{
for (int i = 0; i < sendTaskTimes.Length; i++)
{
var times = sendTaskTimes[i].Trim().Split('-');
if (times.Length == 2)
{
var begin = DateTime.Parse(times[0]);
var end = DateTime.Parse(times[1]);
if (begin >= end)
throw new Exception($"开始时间必须小于结束时间:[{sendTaskTimes[i]}]");
}
}
}
_sendTaskTimes = value;
}
}
private int _sendGoodsImageNum;
/// <summary>
/// 发送商品图片数量
/// </summary>
[
Category("2、朋友圈设置"), DisplayName("03.发送推广图片数量"), DefaultValue(9),
Description(@"发送朋友圈推广图片数量,最多9张图片")
]
public int SendGoodsImageNum
{
get { return _sendGoodsImageNum; }
set
{
if (9 < value || value < 1) throw new Exception("发送推广图片数量应该大于等于1,小于等于9");
_sendGoodsImageNum = value;
}
}
/// <summary>
/// 朋友圈发送间隔,单位 分
/// </summary>
[
Category("2、朋友圈设置"), DisplayName("04.朋友圈发送间隔"), DefaultValue(120),
Description(@"朋友圈推广商品间隔,单位 分")
]
public double Interval_Circle { get; set; }
/// <summary>
/// 发送的文字内容
/// </summary>
[
Category("2、朋友圈设置"), DisplayName("05.发送的文字内容"), DefaultValue(@"╭┈┈┈┄┈┈┈┈┈╮
爆款榜单
╰┈┈┈┈┈┈┈┈┈╯
补贴奖励和帮助渠道
手机拼多多分享宝贝给我
可以查询优惠券款下单
还有网购红包领哦"),
Description(@"发送朋友圈时的文本内容"),
Editor(typeof(PropertyGridRichText), typeof(System.Drawing.Design.UITypeEditor))
]
public string Content_Circle { get; set; }
/// <summary>
/// 宝贝描述语
/// </summary>
[
Category("2、朋友圈设置"), DisplayName("06.宝贝描述语"), DefaultValue(@""),
Description(@"图片中宝贝描述信息,为空时以采集到的数据为准.
支持变量:[商品标题][][][][][][][][][][][][]"),
Editor(typeof(PropertyGridRichText), typeof(System.Drawing.Design.UITypeEditor))
]
public string Goods_Desc { get; set; }
/// <summary>
/// 朋友圈追加评语
/// </summary>
[
Category("2、朋友圈设置"), DisplayName("07.朋友圈追加评语"), DefaultValue(@""),
Description(@"朋友圈商品推广之后,追加评语"),
Editor(typeof(PropertyGridRichText), typeof(System.Drawing.Design.UITypeEditor))
]
public string AdditionalComment { get; set; }
/// <summary>
/// 记录发送的时间
/// </summary>
[Browsable(false)]
public DateTime RecordSendTime { get; set; }
#endregion
/// <summary>
/// 自动清理
/// </summary>
[
Category("3、定时清理"), DisplayName("01.定时清理"), DefaultValue(SwitchType.开启),
Description(@"功能开启时,将在设置的时间进行采集数据的清空操作")
]
public SwitchType Auto_IsClear { get; set; }
private string _autoClearTaskTimes;
[
Category("3、定时清理"), DisplayName("02.定时清理时间"), DefaultValue(@"23:59"),
Description(@"定时清理时间
格式HH:mm
23:59
时间为24小时制")
]
public string AutoClearTaskTimes //{ get; set; }
{
get { return _autoClearTaskTimes; }
set
{
try
{
var time = value as string;
var _time = DateTime.Parse(time);
}
catch (Exception)
{
throw new Exception($"时间格式不正确");
}
_autoClearTaskTimes = value;
}
}
#endregion
public Config()
{
this.Auto_IsClear = SwitchType.;
this.Switch = SwitchType.;
this.GatherTouchNum = 10;
this.FloorPrice = null;
this.CeilingPrice = null;
this.PromotionRate = null;
this.Category = @"精选";
this.ShopScore = ShopScoreType.;
this.Content_Circle = @"╭┈┈┈┄┈┈┈┈┈╮
爆款榜单
╰┈┈┈┈┈┈┈┈┈╯
补贴奖励和帮助渠道
手机拼多多分享宝贝给我
可以查询优惠券款下单
还有网购红包领哦";
this.SendGoodsImageNum = 9;
this._sendGoodsImageNum = 9;
this.Interval_Circle = 120;
this.SendTaskTimes = new string[] { };
this._sendTaskTimes = new string[] { "09:00-22:00" };
this._autoClearTaskTimes = "23:59";
this.Model = QrImageType.B;
this.AdditionalComment = string.Empty;
this.Goods_Desc = string.Empty;
}
}
}