142 lines
5.5 KiB
C#
142 lines
5.5 KiB
C#
using AllBase;
|
|
using AllBase.Helper;
|
|
using Newtonsoft.Json.Linq;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Data;
|
|
using System.Drawing;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Forms;
|
|
using Work;
|
|
using Work.BaseForms;
|
|
|
|
namespace _29WxOrder
|
|
{
|
|
public partial class SetForm : BaseGeneralForm
|
|
{
|
|
public SetForm()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
private void SetForm_Load(object sender, EventArgs e)
|
|
{
|
|
this.chkAutoSendOrder.Visible = true;
|
|
#if DEBUG
|
|
this.cbcommission.Visible = this.chkAutoSendOrder.Visible = this.pnlLoginBuyin.Visible = true;
|
|
#endif
|
|
|
|
this.Text = this.TitleText = "设置";
|
|
|
|
GetJinBaoLink();
|
|
|
|
string url = BaseClass.Build29WxObjString("setting&act=get");
|
|
string html = GetHtml.PostUtf8(url, UserLogin.GetSignaturex());
|
|
if (html != "")
|
|
{
|
|
if (JObject.Parse(html)["code"].ToString() == "200")
|
|
{
|
|
var jArr = JObject.Parse(html)["data"];
|
|
if (jArr.Count() > 0)
|
|
{
|
|
foreach (JObject jObj in jArr)
|
|
{
|
|
string jbStr = jObj.ToString();
|
|
switch (JObject.Parse(jbStr)["type"].ToString())
|
|
{
|
|
case "is_read_commission":
|
|
string status = JObject.Parse(jbStr)["status"].ToString();
|
|
if (!string.IsNullOrEmpty(status))
|
|
{
|
|
BaseClass.is_read_commission = Convert.ToInt32(status);
|
|
}
|
|
|
|
if (status == "1")
|
|
{
|
|
cbcommission.Checked = true;
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
this.chkAutoSendOrder.Checked = GlobalConfig.SystemSettings.IsAutoSendOrder;
|
|
this.txtJinBao.Text = GlobalConfig.SystemSettings.JinBaoLink;
|
|
this.txtLianMeng.Text = GlobalConfig.SystemSettings.LianMengLink;
|
|
}
|
|
|
|
private void pnlSave_Click(object sender, EventArgs e)
|
|
{
|
|
string is_read_commission = "0";
|
|
if (cbcommission.Checked==true)
|
|
{
|
|
is_read_commission = "1";
|
|
}
|
|
BaseClass.is_read_commission = Convert.ToInt32(is_read_commission);
|
|
string url = BaseClass.Build29WxObjString("setting&act=update");
|
|
string html = GetHtml.PostUtf8(url, UserLogin.GetSignaturex() + "¶ms={\"is_read_commission\":\""+ is_read_commission + "\"}");
|
|
|
|
GlobalConfig.SystemSettings.IsAutoSendOrder = chkAutoSendOrder.Checked;
|
|
GlobalConfig.SystemSettings.JinBaoLink = txtJinBao.Text.Trim();
|
|
GlobalConfig.SystemSettings.LianMengLink = txtLianMeng.Text.Trim();
|
|
StartUp.SaveSystemSettings();
|
|
|
|
ChangeCustomJinBaoLianMengLink();
|
|
|
|
BaseMsgForm.ShowInfo("保存完成");
|
|
}
|
|
|
|
/// <summary>
|
|
/// 如果有自定义进宝和联盟链接,使用自定义链接拍单
|
|
/// </summary>
|
|
public static void ChangeCustomJinBaoLianMengLink()
|
|
{
|
|
if (!string.IsNullOrWhiteSpace(GlobalConfig.SystemSettings.LianMengLink))
|
|
BaseClass.taobaolianmengURL = GlobalConfig.SystemSettings.LianMengLink;
|
|
if (!string.IsNullOrWhiteSpace(GlobalConfig.SystemSettings.JinBaoLink))
|
|
BaseClass.duoduojinbaoURL = GlobalConfig.SystemSettings.JinBaoLink;
|
|
}
|
|
|
|
public BuyForms.BuyBrower buyBrower = new BuyForms.BuyBrower();
|
|
private void pnlLoginBuyin_Click(object sender, EventArgs e)
|
|
{
|
|
buyBrower.webtype = 99;
|
|
buyBrower.Width = 1280;
|
|
buyBrower.Height = 768;
|
|
buyBrower.webUrl = "https://buyin.jinritemai.com/dashboard/merch-picking-hall";
|
|
//buyBrower.webUrl = "https://buyin.jinritemai.com/mpa/account/login?log_out=1&type=24&target_url=/dashboard/merch-picking-hall";
|
|
buyBrower.Show();
|
|
buyBrower.BuyBrower_Load(null, null);
|
|
}
|
|
|
|
private void chkAutoSendOrder_CheckedChanged(object sender, EventArgs e)
|
|
{
|
|
}
|
|
|
|
void GetJinBaoLink()
|
|
{
|
|
string url = BaseClass.Build29WxObjString("jinbao_link&act=get");
|
|
string htmlsss = GetHtml.PostUtf8(url, UserLogin.GetSignaturex());
|
|
this.Text = this.TitleText = "设置";
|
|
|
|
if (JObject.Parse(htmlsss)["code"].ToString() == "200")
|
|
{
|
|
var p = JObject.Parse(htmlsss)["data"]["duoduojinbao"].ToString();
|
|
var t = JObject.Parse(htmlsss)["data"]["taobaolianmeng"].ToString();
|
|
}
|
|
else
|
|
{
|
|
MessageBox.Show("读取配置失败,请重试。");
|
|
this.Close();
|
|
}
|
|
|
|
//string nowStr = BaseClass.GetServerTimeString().ToString("yyMMdd");
|
|
//web_url = BaseClass.PddMobileUrl + "duo_coupon_landing.html?goods_id=" + Id + "&pid=" + BaseClass.DuoduoJinbaoUrl + "&goods_sign=c9f2qBW2ChFCibxhwvfZT2hYTyNc_JhlWhnbl3&cpsSign=CC_" + nowStr + "_" + BaseClass.DuoduoJinbaoUrl + "_120404ba8ada33a853f76a531000fa0f&duoduo_type=2";
|
|
}
|
|
}
|
|
}
|