Merge branch 'master' of github.com:KJD2025/KJD
This commit is contained in:
commit
1d8ad2c412
7 files changed
+330
-193
No files matched your search
+8
-1
@@ -1166,7 +1166,14 @@ Mozilla/5.0+(Windows+NT+6.3;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+
|
|||||||
Mozilla/5.0+(Windows+NT+6.1;+WOW64)+AppleWebKit/537.1+(KHTML,+like+Gecko)+Chrome/21.0.1180.89+Safari/537.1
|
Mozilla/5.0+(Windows+NT+6.1;+WOW64)+AppleWebKit/537.1+(KHTML,+like+Gecko)+Chrome/21.0.1180.89+Safari/537.1
|
||||||
Mozilla/5.0+(Windows+NT+6.1;+WOW64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/45.0.2454.101+Safari/537.36
|
Mozilla/5.0+(Windows+NT+6.1;+WOW64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/45.0.2454.101+Safari/537.36
|
||||||
Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.104 Safari/537.36 Core/1.53.2372.400 QQBrowser/9.5.10548.400";
|
Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.104 Safari/537.36 Core/1.53.2372.400 QQBrowser/9.5.10548.400";
|
||||||
|
public static async Task<string> PostJsonAsync(string url, object postData, int? timeOut = null)
|
||||||
|
{
|
||||||
|
return await PostUtf8Async(url, JsonHelper.SerializeObject(postData), contentType: "application/json", timeOut: timeOut);
|
||||||
|
}
|
||||||
|
public static async Task<string> PostJsonAsync(string url, string postData, int? timeOut = null)
|
||||||
|
{
|
||||||
|
return await PostUtf8Async(url, postData, contentType: "application/json", timeOut: timeOut);
|
||||||
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// post 数据
|
/// post 数据
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
|
using System.Diagnostics;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@@ -1605,6 +1606,9 @@ namespace TemuKJD.WXForms.ProductForms
|
|||||||
|
|
||||||
string UploadProduct(ShopLoginInfo shop, KJDDBProduct dbProd, TemuDBProductSelect selectProd, DataGridViewCell cell, DateTime startTime)
|
string UploadProduct(ShopLoginInfo shop, KJDDBProduct dbProd, TemuDBProductSelect selectProd, DataGridViewCell cell, DateTime startTime)
|
||||||
{
|
{
|
||||||
|
PlatformType Platform = (dbProd.product_get_type_text == "多多" ? PlatformType.PDD : PlatformType.None);
|
||||||
|
|
||||||
|
|
||||||
#region 初始化上传商品对象
|
#region 初始化上传商品对象
|
||||||
// 生成初始化上传商品对象
|
// 生成初始化上传商品对象
|
||||||
var upProdInitParam = new WXUploadProductInitParam();
|
var upProdInitParam = new WXUploadProductInitParam();
|
||||||
@@ -2053,7 +2057,7 @@ namespace TemuKJD.WXForms.ProductForms
|
|||||||
// 同颜色规格向上浮动同价格
|
// 同颜色规格向上浮动同价格
|
||||||
if (chkSameSpecPriceUp.Checked)
|
if (chkSameSpecPriceUp.Checked)
|
||||||
{
|
{
|
||||||
var priceTextLst = dbProd.price_text.Split('-');
|
var priceTextLst = dbProd.price_text.ParseToString().Split('-');
|
||||||
if (priceTextLst.Length != 2 || priceTextLst[0] != priceTextLst[1])
|
if (priceTextLst.Length != 2 || priceTextLst[0] != priceTextLst[1])
|
||||||
{
|
{
|
||||||
Dictionary<string, int> specPriceDic = new Dictionary<string, int>();
|
Dictionary<string, int> specPriceDic = new Dictionary<string, int>();
|
||||||
@@ -2091,7 +2095,7 @@ namespace TemuKJD.WXForms.ProductForms
|
|||||||
// 同颜色规格向下浮动同价格
|
// 同颜色规格向下浮动同价格
|
||||||
if (chkSameSpecPriceDown.Checked)
|
if (chkSameSpecPriceDown.Checked)
|
||||||
{
|
{
|
||||||
var priceTextLst = dbProd.price_text.Split('-');
|
var priceTextLst = dbProd.price_text.ParseToString().Split('-');
|
||||||
if (priceTextLst.Length != 2 || priceTextLst[0] != priceTextLst[1])
|
if (priceTextLst.Length != 2 || priceTextLst[0] != priceTextLst[1])
|
||||||
{
|
{
|
||||||
Dictionary<string, int> specPriceDic = new Dictionary<string, int>();
|
Dictionary<string, int> specPriceDic = new Dictionary<string, int>();
|
||||||
@@ -2261,26 +2265,31 @@ namespace TemuKJD.WXForms.ProductForms
|
|||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
var prodInfo = JsonHelper.DeserializeJsonToObject<PDDProductInfo>(dbProd.product_json);
|
||||||
|
|
||||||
#region 图片盗链映射生成字典(如果有)
|
#region 图片盗链映射生成字典(如果有)
|
||||||
|
Dictionary<string, ImageCache> wxImgMapDic = new Dictionary<string, ImageCache>(StringComparer.OrdinalIgnoreCase);
|
||||||
bool isChangeImgDic = false;
|
bool isChangeImgDic = false;
|
||||||
Dictionary<string, string> wxImgMapDic = new Dictionary<string, string>();
|
wxImgMapDic = GetImageCaches(prodInfo);
|
||||||
if (!string.IsNullOrEmpty(dbProd.wx_img_map_json))
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
//Dictionary<string, string> wxImgMapDic = new Dictionary<string, string>();
|
||||||
wxImgMapDic = JsonHelper.DeserializeJsonToObject<Dictionary<string, string>>(dbProd.wx_img_map_json);
|
//if (!string.IsNullOrEmpty(dbProd.wx_img_map_json))
|
||||||
}
|
//{
|
||||||
catch
|
// try
|
||||||
{
|
// {
|
||||||
isChangeImgDic = true;
|
// wxImgMapDic = JsonHelper.DeserializeJsonToObject<Dictionary<string, string>>(dbProd.wx_img_map_json);
|
||||||
wxImgMapDic = new Dictionary<string, string>();
|
// }
|
||||||
}
|
// catch
|
||||||
}
|
// {
|
||||||
|
// isChangeImgDic = true;
|
||||||
|
// wxImgMapDic = new Dictionary<string, string>();
|
||||||
|
// }
|
||||||
|
//}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 提取源商品详情,根据需要生成sku货号
|
#region 提取源商品详情,根据需要生成sku货号
|
||||||
var prodInfo = JsonHelper.DeserializeJsonToObject<PDDProductInfo>(dbProd.product_json);
|
|
||||||
|
|
||||||
// 如果没有货号或有相同货号无法区分sku,自定义货号
|
// 如果没有货号或有相同货号无法区分sku,自定义货号
|
||||||
if (dbProd.db_type == "云端数据")
|
if (dbProd.db_type == "云端数据")
|
||||||
{
|
{
|
||||||
@@ -2522,8 +2531,10 @@ namespace TemuKJD.WXForms.ProductForms
|
|||||||
// 获取缓存盗链 主图
|
// 获取缓存盗链 主图
|
||||||
if (wxImgMapDic.ContainsKey(BaseClass.GetMd5(gallery_item.url)))
|
if (wxImgMapDic.ContainsKey(BaseClass.GetMd5(gallery_item.url)))
|
||||||
{
|
{
|
||||||
upProdInitParam.product.info.headImg.Add(wxImgMapDic[BaseClass.GetMd5(gallery_item.url)]);
|
Debug.WriteLine("主图:缓存");
|
||||||
upProdParam.product.info.headImg.Add(wxImgMapDic[BaseClass.GetMd5(gallery_item.url)]);
|
var image = wxImgMapDic[BaseClass.GetMd5(gallery_item.url)];
|
||||||
|
upProdInitParam.product.info.headImg.Add(image.PlatformUrl);
|
||||||
|
upProdParam.product.info.headImg.Add(image.PlatformUrl);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2533,6 +2544,7 @@ namespace TemuKJD.WXForms.ProductForms
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Debug.WriteLine("主图:上传");
|
||||||
// 使用接口链接传主图
|
// 使用接口链接传主图
|
||||||
var urlImg = BaseClass.BuildWXImgObjString("product/wx_api_upload_image");
|
var urlImg = BaseClass.BuildWXImgObjString("product/wx_api_upload_image");
|
||||||
var upDate = UserLogin.GetSignaturex();
|
var upDate = UserLogin.GetSignaturex();
|
||||||
@@ -2560,7 +2572,11 @@ namespace TemuKJD.WXForms.ProductForms
|
|||||||
{
|
{
|
||||||
upProdInitParam.product.info.headImg.Add(upImgUrl);
|
upProdInitParam.product.info.headImg.Add(upImgUrl);
|
||||||
upProdParam.product.info.headImg.Add(upImgUrl);
|
upProdParam.product.info.headImg.Add(upImgUrl);
|
||||||
wxImgMapDic[BaseClass.GetMd5(gallery_item.url)] = upImgUrl;
|
wxImgMapDic[BaseClass.GetMd5(gallery_item.url)] = new ImageCache
|
||||||
|
{
|
||||||
|
Md5 = BaseClass.GetMd5(gallery_item.url),
|
||||||
|
PlatformUrl = upImgUrl,
|
||||||
|
};
|
||||||
isChangeImgDic = true;
|
isChangeImgDic = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -2615,7 +2631,12 @@ namespace TemuKJD.WXForms.ProductForms
|
|||||||
{
|
{
|
||||||
upProdInitParam.product.info.headImg.Add(upImgUrl);
|
upProdInitParam.product.info.headImg.Add(upImgUrl);
|
||||||
upProdParam.product.info.headImg.Add(upImgUrl);
|
upProdParam.product.info.headImg.Add(upImgUrl);
|
||||||
wxImgMapDic[BaseClass.GetMd5(gallery_item.url)] = upImgUrl;
|
wxImgMapDic[BaseClass.GetMd5(gallery_item.url)] = new ImageCache
|
||||||
|
{
|
||||||
|
Md5 = BaseClass.GetMd5(gallery_item.url),
|
||||||
|
PlatformUrl = upImgUrl,
|
||||||
|
};
|
||||||
|
|
||||||
isChangeImgDic = true;
|
isChangeImgDic = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -2706,24 +2727,14 @@ namespace TemuKJD.WXForms.ProductForms
|
|||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#region 保存缓存盗链图片
|
#region 保存缓存盗链图片
|
||||||
if (isChangeImgDic && dbProd.db_type != "云端数据")
|
|
||||||
{
|
{
|
||||||
var url = BaseClass.BuildObjString("product/mdy_pdd_product");
|
SaveImageCaches(Platform, wxImgMapDic.Values);
|
||||||
var data = "";
|
|
||||||
Invoke(new Action(() =>
|
|
||||||
{
|
|
||||||
data = UserLogin.GetSignaturex();
|
|
||||||
data += "&spu_id=" + dbProd.spu_id;
|
|
||||||
data += "&wx_img_map_json=" + JsonHelper.SerializeObject(wxImgMapDic);
|
|
||||||
}));
|
|
||||||
var html = GetHtml.PostUtf8(url, data);
|
|
||||||
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
|
||||||
html = GetHtml.PostUtf8(url, data);
|
|
||||||
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
|
||||||
html = GetHtml.PostUtf8(url, data);
|
|
||||||
isChangeImgDic = false;
|
isChangeImgDic = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 识别类目
|
#region 识别类目
|
||||||
@@ -3464,7 +3475,9 @@ namespace TemuKJD.WXForms.ProductForms
|
|||||||
// 获取缓存盗链 详情图
|
// 获取缓存盗链 详情图
|
||||||
if (wxImgMapDic.ContainsKey(BaseClass.GetMd5(gallery_item.url)))
|
if (wxImgMapDic.ContainsKey(BaseClass.GetMd5(gallery_item.url)))
|
||||||
{
|
{
|
||||||
upProdParam.product.info.detail.detailImg.Add(wxImgMapDic[BaseClass.GetMd5(gallery_item.url)]);
|
Debug.WriteLine("详情图:缓存");
|
||||||
|
var image = wxImgMapDic[BaseClass.GetMd5(gallery_item.url)];
|
||||||
|
upProdParam.product.info.detail.detailImg.Add(image.PlatformUrl);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3474,6 +3487,7 @@ namespace TemuKJD.WXForms.ProductForms
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Debug.WriteLine("详情图:上传");
|
||||||
// 使用接口链接传详情图
|
// 使用接口链接传详情图
|
||||||
var urlImg = BaseClass.BuildWXImgObjString("product/wx_api_upload_image");
|
var urlImg = BaseClass.BuildWXImgObjString("product/wx_api_upload_image");
|
||||||
var upDate = UserLogin.GetSignaturex();
|
var upDate = UserLogin.GetSignaturex();
|
||||||
@@ -3500,7 +3514,11 @@ namespace TemuKJD.WXForms.ProductForms
|
|||||||
if (upDateRst.Contains("\"errcode\":0") && !string.IsNullOrEmpty(upImgUrl))
|
if (upDateRst.Contains("\"errcode\":0") && !string.IsNullOrEmpty(upImgUrl))
|
||||||
{
|
{
|
||||||
upProdParam.product.info.detail.detailImg.Add(upImgUrl);
|
upProdParam.product.info.detail.detailImg.Add(upImgUrl);
|
||||||
wxImgMapDic[BaseClass.GetMd5(gallery_item.url)] = upImgUrl;
|
wxImgMapDic[BaseClass.GetMd5(gallery_item.url)] = new ImageCache
|
||||||
|
{
|
||||||
|
Md5 = BaseClass.GetMd5(gallery_item.url),
|
||||||
|
PlatformUrl = upImgUrl,
|
||||||
|
};
|
||||||
isChangeImgDic = true;
|
isChangeImgDic = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -3554,7 +3572,11 @@ namespace TemuKJD.WXForms.ProductForms
|
|||||||
if (apiUpImgFileRst.Contains("\"errcode\":0") && !string.IsNullOrEmpty(upImgUrl))
|
if (apiUpImgFileRst.Contains("\"errcode\":0") && !string.IsNullOrEmpty(upImgUrl))
|
||||||
{
|
{
|
||||||
upProdParam.product.info.detail.detailImg.Add(upImgUrl);
|
upProdParam.product.info.detail.detailImg.Add(upImgUrl);
|
||||||
wxImgMapDic[BaseClass.GetMd5(gallery_item.url)] = upImgUrl;
|
wxImgMapDic[BaseClass.GetMd5(gallery_item.url)] = new ImageCache
|
||||||
|
{
|
||||||
|
Md5 = BaseClass.GetMd5(gallery_item.url),
|
||||||
|
PlatformUrl = upImgUrl,
|
||||||
|
};
|
||||||
isChangeImgDic = true;
|
isChangeImgDic = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -3584,21 +3606,8 @@ namespace TemuKJD.WXForms.ProductForms
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 保存缓存盗链图片
|
#region 保存缓存盗链图片
|
||||||
if (isChangeImgDic && dbProd.db_type != "云端数据")
|
|
||||||
{
|
{
|
||||||
var url = BaseClass.BuildObjString("product/mdy_pdd_product");
|
SaveImageCaches(Platform, wxImgMapDic.Values);
|
||||||
var data = "";
|
|
||||||
Invoke(new Action(() =>
|
|
||||||
{
|
|
||||||
data = UserLogin.GetSignaturex();
|
|
||||||
data += "&spu_id=" + dbProd.spu_id;
|
|
||||||
data += "&wx_img_map_json=" + JsonHelper.SerializeObject(wxImgMapDic);
|
|
||||||
}));
|
|
||||||
var html = GetHtml.PostUtf8(url, data);
|
|
||||||
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
|
||||||
html = GetHtml.PostUtf8(url, data);
|
|
||||||
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
|
||||||
html = GetHtml.PostUtf8(url, data);
|
|
||||||
isChangeImgDic = false;
|
isChangeImgDic = false;
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
@@ -4531,12 +4540,15 @@ namespace TemuKJD.WXForms.ProductForms
|
|||||||
// 获取缓存盗链 sku图
|
// 获取缓存盗链 sku图
|
||||||
if (wxImgMapDic.ContainsKey(BaseClass.GetMd5(sku.thumb_url)))
|
if (wxImgMapDic.ContainsKey(BaseClass.GetMd5(sku.thumb_url)))
|
||||||
{
|
{
|
||||||
attrParam.items.Add(new productSaleAttrItemParam() { value = spec.spec_name, imgUrl = wxImgMapDic[BaseClass.GetMd5(sku.thumb_url)], });
|
Debug.WriteLine("SKU图:缓存");
|
||||||
|
var image = wxImgMapDic[BaseClass.GetMd5(sku.thumb_url)];
|
||||||
|
attrParam.items.Add(new productSaleAttrItemParam() { value = spec.spec_name, imgUrl = image.PlatformUrl, });
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// 使用接口链接传sku图
|
// 使用接口链接传sku图
|
||||||
if (1 == 1 && !sku.thumb_url.Contains("wst.wxapp.tc.qq.com"))
|
if (1 == 1 && !sku.thumb_url.Contains("wst.wxapp.tc.qq.com"))
|
||||||
{
|
{
|
||||||
|
Debug.WriteLine("SKU图:上传");
|
||||||
var urlImg = BaseClass.BuildWXImgObjString("product/wx_api_upload_image");
|
var urlImg = BaseClass.BuildWXImgObjString("product/wx_api_upload_image");
|
||||||
var upDate = UserLogin.GetSignaturex();
|
var upDate = UserLogin.GetSignaturex();
|
||||||
upDate += "&token=" + token.accessToken;
|
upDate += "&token=" + token.accessToken;
|
||||||
@@ -4562,7 +4574,11 @@ namespace TemuKJD.WXForms.ProductForms
|
|||||||
if (upDateRst.Contains("\"errcode\":0") && !string.IsNullOrEmpty(upImgUrl))
|
if (upDateRst.Contains("\"errcode\":0") && !string.IsNullOrEmpty(upImgUrl))
|
||||||
{
|
{
|
||||||
attrParam.items.Add(new productSaleAttrItemParam() { value = spec.spec_name, imgUrl = upImgUrl, });
|
attrParam.items.Add(new productSaleAttrItemParam() { value = spec.spec_name, imgUrl = upImgUrl, });
|
||||||
wxImgMapDic[BaseClass.GetMd5(sku.thumb_url)] = upImgUrl;
|
wxImgMapDic[BaseClass.GetMd5(sku.thumb_url)] = new ImageCache
|
||||||
|
{
|
||||||
|
Md5 = BaseClass.GetMd5(sku.thumb_url),
|
||||||
|
PlatformUrl = upImgUrl,
|
||||||
|
};
|
||||||
isChangeImgDic = true;
|
isChangeImgDic = true;
|
||||||
continue; // 传图成功跳过模拟上传
|
continue; // 传图成功跳过模拟上传
|
||||||
}
|
}
|
||||||
@@ -4612,7 +4628,11 @@ namespace TemuKJD.WXForms.ProductForms
|
|||||||
if (apiUpImgFileRst.Contains("\"errcode\":0") && !string.IsNullOrEmpty(upImgUrl))
|
if (apiUpImgFileRst.Contains("\"errcode\":0") && !string.IsNullOrEmpty(upImgUrl))
|
||||||
{
|
{
|
||||||
attrParam.items.Add(new productSaleAttrItemParam() { value = spec.spec_name, imgUrl = upImgUrl, });
|
attrParam.items.Add(new productSaleAttrItemParam() { value = spec.spec_name, imgUrl = upImgUrl, });
|
||||||
wxImgMapDic[BaseClass.GetMd5(sku.thumb_url)] = upImgUrl;
|
wxImgMapDic[BaseClass.GetMd5(sku.thumb_url)] = new ImageCache
|
||||||
|
{
|
||||||
|
Md5 = BaseClass.GetMd5(sku.thumb_url),
|
||||||
|
PlatformUrl = upImgUrl,
|
||||||
|
};
|
||||||
isChangeImgDic = true;
|
isChangeImgDic = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -4658,21 +4678,8 @@ namespace TemuKJD.WXForms.ProductForms
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 保存缓存盗链图片
|
#region 保存缓存盗链图片
|
||||||
if (isChangeImgDic && dbProd.db_type != "云端数据")
|
|
||||||
{
|
{
|
||||||
var url = BaseClass.BuildObjString("product/mdy_pdd_product");
|
SaveImageCaches(Platform, wxImgMapDic.Values);
|
||||||
var data = "";
|
|
||||||
Invoke(new Action(() =>
|
|
||||||
{
|
|
||||||
data = UserLogin.GetSignaturex();
|
|
||||||
data += "&spu_id=" + dbProd.spu_id;
|
|
||||||
data += "&wx_img_map_json=" + JsonHelper.SerializeObject(wxImgMapDic);
|
|
||||||
}));
|
|
||||||
var html = GetHtml.PostUtf8(url, data);
|
|
||||||
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
|
||||||
html = GetHtml.PostUtf8(url, data);
|
|
||||||
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
|
||||||
html = GetHtml.PostUtf8(url, data);
|
|
||||||
isChangeImgDic = false;
|
isChangeImgDic = false;
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
@@ -5798,21 +5805,8 @@ namespace TemuKJD.WXForms.ProductForms
|
|||||||
}
|
}
|
||||||
|
|
||||||
#region 保存缓存盗链图片
|
#region 保存缓存盗链图片
|
||||||
if (isChangeImgDic && dbProd.db_type != "云端数据")
|
|
||||||
{
|
{
|
||||||
var url = BaseClass.BuildObjString("product/mdy_pdd_product");
|
SaveImageCaches(Platform, wxImgMapDic.Values);
|
||||||
var data = "";
|
|
||||||
Invoke(new Action(() =>
|
|
||||||
{
|
|
||||||
data = UserLogin.GetSignaturex();
|
|
||||||
data += "&spu_id=" + dbProd.spu_id;
|
|
||||||
data += "&wx_img_map_json=" + JsonHelper.SerializeObject(wxImgMapDic);
|
|
||||||
}));
|
|
||||||
var html = GetHtml.PostUtf8(url, data);
|
|
||||||
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
|
||||||
html = GetHtml.PostUtf8(url, data);
|
|
||||||
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
|
||||||
html = GetHtml.PostUtf8(url, data);
|
|
||||||
isChangeImgDic = false;
|
isChangeImgDic = false;
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
@@ -7363,6 +7357,101 @@ namespace TemuKJD.WXForms.ProductForms
|
|||||||
{
|
{
|
||||||
globalShopUploadCntLimitRetryTimes = numJumpCnt.Value.ParseToInt();
|
globalShopUploadCntLimitRetryTimes = numJumpCnt.Value.ParseToInt();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取图片缓存
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="product"></param>
|
||||||
|
private Dictionary<string, ImageCache> GetImageCaches(PDDProductInfo product)
|
||||||
|
{
|
||||||
|
Dictionary<string, ImageCache> wxImgMapDic = new Dictionary<string, ImageCache>(StringComparer.OrdinalIgnoreCase);
|
||||||
|
if (EnvironmentHelper.IsProduction)
|
||||||
|
{
|
||||||
|
return wxImgMapDic;
|
||||||
|
}
|
||||||
|
List<string> imageUrls = new List<string>();
|
||||||
|
imageUrls.AddRange(product.detail.galleries.Where(g => g.type == 1).Take(9).Select(a => a.url));
|
||||||
|
var temp_detailGalleries = product.detail.galleries.Where(g => g.type == 2).ToList();
|
||||||
|
if (temp_detailGalleries.Count == 0)
|
||||||
|
temp_detailGalleries.Add(new gallery_item() { type = 2, url = product.detail.galleries.FirstOrDefault(g => g.type == 1)?.url });
|
||||||
|
imageUrls.AddRange(temp_detailGalleries.Select(a => a.url));
|
||||||
|
|
||||||
|
|
||||||
|
if (product.detail.sku.FirstOrDefault()?.spec?.Count > 0)
|
||||||
|
{
|
||||||
|
imageUrls.AddRange(product.detail.sku.Select(a => a.thumb_url));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
List<string> imageUrlMd5s = imageUrls.Select(a => BaseClass.GetMd5(a)).ToList();
|
||||||
|
|
||||||
|
var url = BaseClass.BuildObjString("ImageCache/GetImageCache");//获取缓存
|
||||||
|
var data = JsonConvert.SerializeObject(new
|
||||||
|
{
|
||||||
|
md5s = imageUrlMd5s
|
||||||
|
});
|
||||||
|
|
||||||
|
var html = GetHtml.PostUtf8(url, data, contentType: "application/json");
|
||||||
|
if (string.IsNullOrEmpty(html))
|
||||||
|
html = GetHtml.PostUtf8(url, data);
|
||||||
|
var ret = JsonConvert.DeserializeObject<Result<List<ImageCache>>>(html);
|
||||||
|
if (ret.Code == 200)
|
||||||
|
{
|
||||||
|
foreach (var item in ret.Data)
|
||||||
|
{
|
||||||
|
item.IsCache = true;
|
||||||
|
wxImgMapDic[item.Md5] = item;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return wxImgMapDic;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 保存缓存图片
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="platform"></param>
|
||||||
|
/// <param name="images"></param>
|
||||||
|
private void SaveImageCaches(PlatformType platform, IEnumerable<ImageCache> images)
|
||||||
|
{
|
||||||
|
if (EnvironmentHelper.IsProduction)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var url = BaseClass.BuildObjString("ImageCache/AddOrUpdate");
|
||||||
|
var data = "";
|
||||||
|
data = JsonHelper.SerializeObject(images.Where(a => a.IsCache == false).Select(a =>
|
||||||
|
new
|
||||||
|
{
|
||||||
|
md5 = a.Md5,
|
||||||
|
Platform = platform,
|
||||||
|
PlatformUrl = a.PlatformUrl
|
||||||
|
}
|
||||||
|
));
|
||||||
|
|
||||||
|
var html = GetHtml.PostUtf8(url, data, contentType: "application/json");
|
||||||
|
if (string.IsNullOrEmpty(html))
|
||||||
|
html = GetHtml.PostUtf8(url, data);
|
||||||
|
var ret = JsonConvert.DeserializeObject<Result<JToken>>(html);
|
||||||
|
List<string> failed = new List<string>();
|
||||||
|
if (ret.Code == 500)
|
||||||
|
{
|
||||||
|
if (ret.Data is JArray jArray)
|
||||||
|
{
|
||||||
|
failed = jArray.ToObject<List<string>>() ?? new List<string>();
|
||||||
|
}
|
||||||
|
else if (ret.Data is JValue jValue && jValue.Value is string str)
|
||||||
|
{
|
||||||
|
failed.Add(str);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
foreach (ImageCache item in images)
|
||||||
|
{
|
||||||
|
item.IsCache = !failed.Contains(item.Md5, StringComparer.OrdinalIgnoreCase);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class WXUpload
|
public class WXUpload
|
||||||
@@ -7868,4 +7957,13 @@ Content-Type: application/octet-stream
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsUseShanghaiReturnOrderAddress { get; set; } = false;
|
public bool IsUseShanghaiReturnOrderAddress { get; set; } = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class ImageCache
|
||||||
|
{
|
||||||
|
public string Md5 { get; set; }
|
||||||
|
public int Platform { get; set; }
|
||||||
|
[JsonProperty("platform_url")]
|
||||||
|
public string PlatformUrl { get; set; }
|
||||||
|
public bool IsCache { get; set; }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
+57
-56
@@ -29,14 +29,14 @@ namespace TemuKJD.WXForms.ShopForms
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private void InitializeComponent()
|
private void InitializeComponent()
|
||||||
{
|
{
|
||||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle();
|
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle();
|
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle11 = new System.Windows.Forms.DataGridViewCellStyle();
|
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle12 = new System.Windows.Forms.DataGridViewCellStyle();
|
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle13 = new System.Windows.Forms.DataGridViewCellStyle();
|
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle14 = new System.Windows.Forms.DataGridViewCellStyle();
|
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle15 = new System.Windows.Forms.DataGridViewCellStyle();
|
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle16 = new System.Windows.Forms.DataGridViewCellStyle();
|
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||||
this.splitContainer5 = new System.Windows.Forms.SplitContainer();
|
this.splitContainer5 = new System.Windows.Forms.SplitContainer();
|
||||||
this.pnlSuperManage = new System.Windows.Forms.Panel();
|
this.pnlSuperManage = new System.Windows.Forms.Panel();
|
||||||
this.label10 = new System.Windows.Forms.Label();
|
this.label10 = new System.Windows.Forms.Label();
|
||||||
@@ -115,6 +115,7 @@ namespace TemuKJD.WXForms.ShopForms
|
|||||||
this.btnTopUpCancel = new DevComponents.DotNetBar.PanelEx();
|
this.btnTopUpCancel = new DevComponents.DotNetBar.PanelEx();
|
||||||
this.btnTopUpOK = new DevComponents.DotNetBar.PanelEx();
|
this.btnTopUpOK = new DevComponents.DotNetBar.PanelEx();
|
||||||
this.dgvUser = new TemuKJD.UserComponent.DataGridViewEx();
|
this.dgvUser = new TemuKJD.UserComponent.DataGridViewEx();
|
||||||
|
this.btnExportShopErp = new DevComponents.DotNetBar.PanelEx();
|
||||||
this.colCheck = new System.Windows.Forms.DataGridViewCheckBoxColumn();
|
this.colCheck = new System.Windows.Forms.DataGridViewCheckBoxColumn();
|
||||||
this.UserIdColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
this.UserIdColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||||
this.UserNickNameColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
this.UserNickNameColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||||
@@ -143,7 +144,6 @@ namespace TemuKJD.WXForms.ShopForms
|
|||||||
this.colChangeGiftOemAmountPerOrder = new System.Windows.Forms.DataGridViewLinkColumn();
|
this.colChangeGiftOemAmountPerOrder = new System.Windows.Forms.DataGridViewLinkColumn();
|
||||||
this.editColumn = new System.Windows.Forms.DataGridViewLinkColumn();
|
this.editColumn = new System.Windows.Forms.DataGridViewLinkColumn();
|
||||||
this.deleteColumn = new System.Windows.Forms.DataGridViewLinkColumn();
|
this.deleteColumn = new System.Windows.Forms.DataGridViewLinkColumn();
|
||||||
this.btnExportShopErp = new DevComponents.DotNetBar.PanelEx();
|
|
||||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer5)).BeginInit();
|
((System.ComponentModel.ISupportInitialize)(this.splitContainer5)).BeginInit();
|
||||||
this.splitContainer5.Panel1.SuspendLayout();
|
this.splitContainer5.Panel1.SuspendLayout();
|
||||||
this.splitContainer5.Panel2.SuspendLayout();
|
this.splitContainer5.Panel2.SuspendLayout();
|
||||||
@@ -1249,20 +1249,20 @@ namespace TemuKJD.WXForms.ShopForms
|
|||||||
//
|
//
|
||||||
this.dgvUser.AllowUserToAddRows = false;
|
this.dgvUser.AllowUserToAddRows = false;
|
||||||
this.dgvUser.AllowUserToDeleteRows = false;
|
this.dgvUser.AllowUserToDeleteRows = false;
|
||||||
dataGridViewCellStyle9.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(249)))), ((int)(((byte)(249)))), ((int)(((byte)(249)))));
|
dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(249)))), ((int)(((byte)(249)))), ((int)(((byte)(249)))));
|
||||||
this.dgvUser.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle9;
|
this.dgvUser.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1;
|
||||||
this.dgvUser.AutoRowNumber = true;
|
this.dgvUser.AutoRowNumber = true;
|
||||||
this.dgvUser.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
|
this.dgvUser.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
|
||||||
this.dgvUser.BackgroundColor = System.Drawing.Color.White;
|
this.dgvUser.BackgroundColor = System.Drawing.Color.White;
|
||||||
this.dgvUser.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
|
this.dgvUser.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
|
||||||
dataGridViewCellStyle10.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
|
dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
|
||||||
dataGridViewCellStyle10.BackColor = System.Drawing.SystemColors.Control;
|
dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Control;
|
||||||
dataGridViewCellStyle10.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
dataGridViewCellStyle2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||||
dataGridViewCellStyle10.ForeColor = System.Drawing.SystemColors.WindowText;
|
dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.WindowText;
|
||||||
dataGridViewCellStyle10.SelectionBackColor = System.Drawing.SystemColors.Highlight;
|
dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight;
|
||||||
dataGridViewCellStyle10.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
|
dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
|
||||||
dataGridViewCellStyle10.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
|
dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
|
||||||
this.dgvUser.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle10;
|
this.dgvUser.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2;
|
||||||
this.dgvUser.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
this.dgvUser.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||||
this.dgvUser.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
|
this.dgvUser.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
|
||||||
this.colCheck,
|
this.colCheck,
|
||||||
@@ -1304,6 +1304,31 @@ namespace TemuKJD.WXForms.ShopForms
|
|||||||
this.dgvUser.TabIndex = 1;
|
this.dgvUser.TabIndex = 1;
|
||||||
this.dgvUser.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvUser_CellContentClick);
|
this.dgvUser.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvUser_CellContentClick);
|
||||||
//
|
//
|
||||||
|
// btnExportShopErp
|
||||||
|
//
|
||||||
|
this.btnExportShopErp.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
|
||||||
|
this.btnExportShopErp.Cursor = System.Windows.Forms.Cursors.Hand;
|
||||||
|
this.btnExportShopErp.DisabledBackColor = System.Drawing.Color.Empty;
|
||||||
|
this.btnExportShopErp.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||||
|
this.btnExportShopErp.Location = new System.Drawing.Point(0, 1);
|
||||||
|
this.btnExportShopErp.Name = "btnExportShopErp";
|
||||||
|
this.btnExportShopErp.Size = new System.Drawing.Size(140, 25);
|
||||||
|
this.btnExportShopErp.Style.Alignment = System.Drawing.StringAlignment.Center;
|
||||||
|
this.btnExportShopErp.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
|
||||||
|
this.btnExportShopErp.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
|
||||||
|
this.btnExportShopErp.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;
|
||||||
|
this.btnExportShopErp.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
|
||||||
|
this.btnExportShopErp.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None;
|
||||||
|
this.btnExportShopErp.Style.ForeColor.Color = System.Drawing.Color.White;
|
||||||
|
this.btnExportShopErp.Style.GradientAngle = 90;
|
||||||
|
this.btnExportShopErp.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
|
||||||
|
this.btnExportShopErp.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
|
||||||
|
this.btnExportShopErp.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
|
||||||
|
this.btnExportShopErp.TabIndex = 439;
|
||||||
|
this.btnExportShopErp.Text = "导出用户到后台系统";
|
||||||
|
this.btnExportShopErp.Visible = false;
|
||||||
|
this.btnExportShopErp.Click += new System.EventHandler(this.btnExportShopErp_Click);
|
||||||
|
//
|
||||||
// colCheck
|
// colCheck
|
||||||
//
|
//
|
||||||
this.colCheck.FillWeight = 30F;
|
this.colCheck.FillWeight = 30F;
|
||||||
@@ -1417,12 +1442,13 @@ namespace TemuKJD.WXForms.ShopForms
|
|||||||
//
|
//
|
||||||
// colPlus
|
// colPlus
|
||||||
//
|
//
|
||||||
dataGridViewCellStyle11.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
|
dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
|
||||||
this.colPlus.DefaultCellStyle = dataGridViewCellStyle11;
|
this.colPlus.DefaultCellStyle = dataGridViewCellStyle3;
|
||||||
this.colPlus.FillWeight = 22F;
|
this.colPlus.FillWeight = 22F;
|
||||||
this.colPlus.HeaderText = "+";
|
this.colPlus.HeaderText = "+";
|
||||||
this.colPlus.Name = "colPlus";
|
this.colPlus.Name = "colPlus";
|
||||||
this.colPlus.ReadOnly = true;
|
this.colPlus.ReadOnly = true;
|
||||||
|
this.colPlus.Visible = false;
|
||||||
//
|
//
|
||||||
// colShopPointsPerMonth
|
// colShopPointsPerMonth
|
||||||
//
|
//
|
||||||
@@ -1433,8 +1459,8 @@ namespace TemuKJD.WXForms.ShopForms
|
|||||||
//
|
//
|
||||||
// colChangePointsPerMonth
|
// colChangePointsPerMonth
|
||||||
//
|
//
|
||||||
dataGridViewCellStyle12.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
|
dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
|
||||||
this.colChangePointsPerMonth.DefaultCellStyle = dataGridViewCellStyle12;
|
this.colChangePointsPerMonth.DefaultCellStyle = dataGridViewCellStyle4;
|
||||||
this.colChangePointsPerMonth.FillWeight = 25F;
|
this.colChangePointsPerMonth.FillWeight = 25F;
|
||||||
this.colChangePointsPerMonth.HeaderText = "改";
|
this.colChangePointsPerMonth.HeaderText = "改";
|
||||||
this.colChangePointsPerMonth.Name = "colChangePointsPerMonth";
|
this.colChangePointsPerMonth.Name = "colChangePointsPerMonth";
|
||||||
@@ -1450,8 +1476,8 @@ namespace TemuKJD.WXForms.ShopForms
|
|||||||
//
|
//
|
||||||
// colBalancePlus
|
// colBalancePlus
|
||||||
//
|
//
|
||||||
dataGridViewCellStyle13.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
|
dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
|
||||||
this.colBalancePlus.DefaultCellStyle = dataGridViewCellStyle13;
|
this.colBalancePlus.DefaultCellStyle = dataGridViewCellStyle5;
|
||||||
this.colBalancePlus.FillWeight = 22F;
|
this.colBalancePlus.FillWeight = 22F;
|
||||||
this.colBalancePlus.HeaderText = "+";
|
this.colBalancePlus.HeaderText = "+";
|
||||||
this.colBalancePlus.Name = "colBalancePlus";
|
this.colBalancePlus.Name = "colBalancePlus";
|
||||||
@@ -1467,8 +1493,8 @@ namespace TemuKJD.WXForms.ShopForms
|
|||||||
//
|
//
|
||||||
// colChangePostagePerOrder
|
// colChangePostagePerOrder
|
||||||
//
|
//
|
||||||
dataGridViewCellStyle14.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
|
dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
|
||||||
this.colChangePostagePerOrder.DefaultCellStyle = dataGridViewCellStyle14;
|
this.colChangePostagePerOrder.DefaultCellStyle = dataGridViewCellStyle6;
|
||||||
this.colChangePostagePerOrder.FillWeight = 25F;
|
this.colChangePostagePerOrder.FillWeight = 25F;
|
||||||
this.colChangePostagePerOrder.HeaderText = "改";
|
this.colChangePostagePerOrder.HeaderText = "改";
|
||||||
this.colChangePostagePerOrder.Name = "colChangePostagePerOrder";
|
this.colChangePostagePerOrder.Name = "colChangePostagePerOrder";
|
||||||
@@ -1483,8 +1509,8 @@ namespace TemuKJD.WXForms.ShopForms
|
|||||||
//
|
//
|
||||||
// colChangeRefundPostagePerOrder
|
// colChangeRefundPostagePerOrder
|
||||||
//
|
//
|
||||||
dataGridViewCellStyle15.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
|
dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
|
||||||
this.colChangeRefundPostagePerOrder.DefaultCellStyle = dataGridViewCellStyle15;
|
this.colChangeRefundPostagePerOrder.DefaultCellStyle = dataGridViewCellStyle7;
|
||||||
this.colChangeRefundPostagePerOrder.FillWeight = 25F;
|
this.colChangeRefundPostagePerOrder.FillWeight = 25F;
|
||||||
this.colChangeRefundPostagePerOrder.HeaderText = "改";
|
this.colChangeRefundPostagePerOrder.HeaderText = "改";
|
||||||
this.colChangeRefundPostagePerOrder.Name = "colChangeRefundPostagePerOrder";
|
this.colChangeRefundPostagePerOrder.Name = "colChangeRefundPostagePerOrder";
|
||||||
@@ -1501,8 +1527,8 @@ namespace TemuKJD.WXForms.ShopForms
|
|||||||
//
|
//
|
||||||
// colChangeGiftOemAmountPerOrder
|
// colChangeGiftOemAmountPerOrder
|
||||||
//
|
//
|
||||||
dataGridViewCellStyle16.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
|
dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
|
||||||
this.colChangeGiftOemAmountPerOrder.DefaultCellStyle = dataGridViewCellStyle16;
|
this.colChangeGiftOemAmountPerOrder.DefaultCellStyle = dataGridViewCellStyle8;
|
||||||
this.colChangeGiftOemAmountPerOrder.FillWeight = 25F;
|
this.colChangeGiftOemAmountPerOrder.FillWeight = 25F;
|
||||||
this.colChangeGiftOemAmountPerOrder.HeaderText = "改";
|
this.colChangeGiftOemAmountPerOrder.HeaderText = "改";
|
||||||
this.colChangeGiftOemAmountPerOrder.Name = "colChangeGiftOemAmountPerOrder";
|
this.colChangeGiftOemAmountPerOrder.Name = "colChangeGiftOemAmountPerOrder";
|
||||||
@@ -1528,31 +1554,6 @@ namespace TemuKJD.WXForms.ShopForms
|
|||||||
this.deleteColumn.ReadOnly = true;
|
this.deleteColumn.ReadOnly = true;
|
||||||
this.deleteColumn.Visible = false;
|
this.deleteColumn.Visible = false;
|
||||||
//
|
//
|
||||||
// btnExportShopErp
|
|
||||||
//
|
|
||||||
this.btnExportShopErp.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
|
|
||||||
this.btnExportShopErp.Cursor = System.Windows.Forms.Cursors.Hand;
|
|
||||||
this.btnExportShopErp.DisabledBackColor = System.Drawing.Color.Empty;
|
|
||||||
this.btnExportShopErp.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
|
||||||
this.btnExportShopErp.Location = new System.Drawing.Point(0, 1);
|
|
||||||
this.btnExportShopErp.Name = "btnExportShopErp";
|
|
||||||
this.btnExportShopErp.Size = new System.Drawing.Size(140, 25);
|
|
||||||
this.btnExportShopErp.Style.Alignment = System.Drawing.StringAlignment.Center;
|
|
||||||
this.btnExportShopErp.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
|
|
||||||
this.btnExportShopErp.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
|
|
||||||
this.btnExportShopErp.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;
|
|
||||||
this.btnExportShopErp.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
|
|
||||||
this.btnExportShopErp.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None;
|
|
||||||
this.btnExportShopErp.Style.ForeColor.Color = System.Drawing.Color.White;
|
|
||||||
this.btnExportShopErp.Style.GradientAngle = 90;
|
|
||||||
this.btnExportShopErp.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
|
|
||||||
this.btnExportShopErp.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
|
|
||||||
this.btnExportShopErp.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
|
|
||||||
this.btnExportShopErp.TabIndex = 439;
|
|
||||||
this.btnExportShopErp.Text = "导出用户到后台系统";
|
|
||||||
this.btnExportShopErp.Visible = false;
|
|
||||||
this.btnExportShopErp.Click += new System.EventHandler(this.btnExportShopErp_Click);
|
|
||||||
//
|
|
||||||
// WXOemAccountForm
|
// WXOemAccountForm
|
||||||
//
|
//
|
||||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
|
||||||
|
|||||||
@@ -332,8 +332,11 @@ namespace TemuKJD.WXForms.ShopForms
|
|||||||
this.txtSearch.GotFocus += TxtSearch_GotFocus;
|
this.txtSearch.GotFocus += TxtSearch_GotFocus;
|
||||||
this.txtSearch.LostFocus += TxtSearch_LostFocus;
|
this.txtSearch.LostFocus += TxtSearch_LostFocus;
|
||||||
|
|
||||||
|
if (colPoints.Visible == true && colPlus.Visible == true)
|
||||||
|
{
|
||||||
this.dgvUser.AddMergeColumn(new List<string> { "colPoints", "colPlus" });
|
this.dgvUser.AddMergeColumn(new List<string> { "colPoints", "colPlus" });
|
||||||
this.dgvUser.AddMergeColumnHeader(new List<string> { "colPoints", "colPlus" }, "积分点数");
|
this.dgvUser.AddMergeColumnHeader(new List<string> { "colPoints", "colPlus" }, "积分点数");
|
||||||
|
}
|
||||||
this.dgvUser.AddMergeColumn(new List<string> { "colShopPointsPerMonth", "colChangePointsPerMonth" });
|
this.dgvUser.AddMergeColumn(new List<string> { "colShopPointsPerMonth", "colChangePointsPerMonth" });
|
||||||
this.dgvUser.AddMergeColumnHeader(new List<string> { "colShopPointsPerMonth", "colChangePointsPerMonth" }, "月费耗点");
|
this.dgvUser.AddMergeColumnHeader(new List<string> { "colShopPointsPerMonth", "colChangePointsPerMonth" }, "月费耗点");
|
||||||
this.dgvUser.AddMergeColumn(new List<string> { "colBalance", "colBalancePlus" });
|
this.dgvUser.AddMergeColumn(new List<string> { "colBalance", "colBalancePlus" });
|
||||||
|
|||||||
@@ -77,9 +77,10 @@ namespace TemuKJD.WXForms.ShopForms
|
|||||||
{
|
{
|
||||||
hideNames.Remove("评分考核");
|
hideNames.Remove("评分考核");
|
||||||
}
|
}
|
||||||
if (BaseClass.UserAuthority.Contains("充值用户") && BaseClass.GroupId == 3 && BaseClass.AgentCode.IsNullOrEmpty() && BaseClass.OemId.IsNullOrEmpty())
|
//if (BaseClass.UserAuthority.Contains("充值用户") && BaseClass.GroupId == 3 && BaseClass.AgentCode.IsNullOrEmpty() && BaseClass.OemId.IsNullOrEmpty())
|
||||||
|
if (BaseClass.UserAuthority.Contains("充值用户") && BaseClass.GroupId == 3)
|
||||||
{
|
{
|
||||||
//hideNames.Remove("积分充值");
|
hideNames.Remove("积分充值");
|
||||||
}
|
}
|
||||||
if (!BaseClass.OemId.IsNullOrEmpty() && BaseClass.IsOemOwner)
|
if (!BaseClass.OemId.IsNullOrEmpty() && BaseClass.IsOemOwner)
|
||||||
{
|
{
|
||||||
|
|||||||
+26
-15
@@ -28,8 +28,8 @@
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private void InitializeComponent()
|
private void InitializeComponent()
|
||||||
{
|
{
|
||||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
|
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
|
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||||
this.label1 = new System.Windows.Forms.Label();
|
this.label1 = new System.Windows.Forms.Label();
|
||||||
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
|
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
|
||||||
this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
|
this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
|
||||||
@@ -358,7 +358,7 @@
|
|||||||
this.cmbGroup.DropDownWidth = 1;
|
this.cmbGroup.DropDownWidth = 1;
|
||||||
this.cmbGroup.FormattingEnabled = true;
|
this.cmbGroup.FormattingEnabled = true;
|
||||||
this.cmbGroup.IntegralHeight = false;
|
this.cmbGroup.IntegralHeight = false;
|
||||||
this.cmbGroup.Location = new System.Drawing.Point(385, 8);
|
this.cmbGroup.Location = new System.Drawing.Point(385, 5);
|
||||||
this.cmbGroup.Margin = new System.Windows.Forms.Padding(0, 0, 0, 4);
|
this.cmbGroup.Margin = new System.Windows.Forms.Padding(0, 0, 0, 4);
|
||||||
this.cmbGroup.Name = "cmbGroup";
|
this.cmbGroup.Name = "cmbGroup";
|
||||||
this.cmbGroup.Size = new System.Drawing.Size(74, 25);
|
this.cmbGroup.Size = new System.Drawing.Size(74, 25);
|
||||||
@@ -384,7 +384,7 @@
|
|||||||
this.cmbNotes.DropDownWidth = 1;
|
this.cmbNotes.DropDownWidth = 1;
|
||||||
this.cmbNotes.FormattingEnabled = true;
|
this.cmbNotes.FormattingEnabled = true;
|
||||||
this.cmbNotes.IntegralHeight = false;
|
this.cmbNotes.IntegralHeight = false;
|
||||||
this.cmbNotes.Location = new System.Drawing.Point(276, 8);
|
this.cmbNotes.Location = new System.Drawing.Point(276, 5);
|
||||||
this.cmbNotes.Margin = new System.Windows.Forms.Padding(0, 0, 0, 4);
|
this.cmbNotes.Margin = new System.Windows.Forms.Padding(0, 0, 0, 4);
|
||||||
this.cmbNotes.Name = "cmbNotes";
|
this.cmbNotes.Name = "cmbNotes";
|
||||||
this.cmbNotes.Size = new System.Drawing.Size(74, 25);
|
this.cmbNotes.Size = new System.Drawing.Size(74, 25);
|
||||||
@@ -517,7 +517,7 @@
|
|||||||
this.cmbSubAccount.DropDownWidth = 1;
|
this.cmbSubAccount.DropDownWidth = 1;
|
||||||
this.cmbSubAccount.FormattingEnabled = true;
|
this.cmbSubAccount.FormattingEnabled = true;
|
||||||
this.cmbSubAccount.IntegralHeight = false;
|
this.cmbSubAccount.IntegralHeight = false;
|
||||||
this.cmbSubAccount.Location = new System.Drawing.Point(506, 8);
|
this.cmbSubAccount.Location = new System.Drawing.Point(506, 5);
|
||||||
this.cmbSubAccount.Margin = new System.Windows.Forms.Padding(0, 0, 0, 4);
|
this.cmbSubAccount.Margin = new System.Windows.Forms.Padding(0, 0, 0, 4);
|
||||||
this.cmbSubAccount.Name = "cmbSubAccount";
|
this.cmbSubAccount.Name = "cmbSubAccount";
|
||||||
this.cmbSubAccount.Size = new System.Drawing.Size(74, 25);
|
this.cmbSubAccount.Size = new System.Drawing.Size(74, 25);
|
||||||
@@ -659,10 +659,21 @@
|
|||||||
10000,
|
10000,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
|
0});
|
||||||
|
this.numAddTopUp.Minimum = new decimal(new int[] {
|
||||||
|
1,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
0});
|
0});
|
||||||
this.numAddTopUp.Name = "numAddTopUp";
|
this.numAddTopUp.Name = "numAddTopUp";
|
||||||
|
this.numAddTopUp.ReadOnly = true;
|
||||||
this.numAddTopUp.Size = new System.Drawing.Size(36, 23);
|
this.numAddTopUp.Size = new System.Drawing.Size(36, 23);
|
||||||
this.numAddTopUp.TabIndex = 1;
|
this.numAddTopUp.TabIndex = 1;
|
||||||
|
this.numAddTopUp.Value = new decimal(new int[] {
|
||||||
|
1,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0});
|
||||||
this.numAddTopUp.ValueChanged += new System.EventHandler(this.numAddTopUp_ValueChanged);
|
this.numAddTopUp.ValueChanged += new System.EventHandler(this.numAddTopUp_ValueChanged);
|
||||||
//
|
//
|
||||||
// label8
|
// label8
|
||||||
@@ -771,20 +782,20 @@
|
|||||||
//
|
//
|
||||||
this.dgvShop.AllowUserToAddRows = false;
|
this.dgvShop.AllowUserToAddRows = false;
|
||||||
this.dgvShop.AllowUserToDeleteRows = false;
|
this.dgvShop.AllowUserToDeleteRows = false;
|
||||||
dataGridViewCellStyle1.BackColor = System.Drawing.Color.WhiteSmoke;
|
dataGridViewCellStyle3.BackColor = System.Drawing.Color.WhiteSmoke;
|
||||||
this.dgvShop.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1;
|
this.dgvShop.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle3;
|
||||||
this.dgvShop.AutoRowNumber = true;
|
this.dgvShop.AutoRowNumber = true;
|
||||||
this.dgvShop.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
|
this.dgvShop.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
|
||||||
this.dgvShop.BackgroundColor = System.Drawing.Color.White;
|
this.dgvShop.BackgroundColor = System.Drawing.Color.White;
|
||||||
this.dgvShop.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
|
this.dgvShop.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
|
||||||
dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
|
dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
|
||||||
dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Control;
|
dataGridViewCellStyle4.BackColor = System.Drawing.SystemColors.Control;
|
||||||
dataGridViewCellStyle2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
dataGridViewCellStyle4.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||||
dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.WindowText;
|
dataGridViewCellStyle4.ForeColor = System.Drawing.SystemColors.WindowText;
|
||||||
dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight;
|
dataGridViewCellStyle4.SelectionBackColor = System.Drawing.SystemColors.Highlight;
|
||||||
dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
|
dataGridViewCellStyle4.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
|
||||||
dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
|
dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
|
||||||
this.dgvShop.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2;
|
this.dgvShop.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle4;
|
||||||
this.dgvShop.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
this.dgvShop.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||||
this.dgvShop.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
|
this.dgvShop.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
|
||||||
this.colSelect,
|
this.colSelect,
|
||||||
|
|||||||
@@ -3,14 +3,17 @@ using AllBase.Helper;
|
|||||||
using AllBase.Model.Result;
|
using AllBase.Model.Result;
|
||||||
using NaiBa.Util;
|
using NaiBa.Util;
|
||||||
using NaiBa.Util.Extension;
|
using NaiBa.Util.Extension;
|
||||||
|
using Newtonsoft.Json;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
|
using System.Drawing.Printing;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Runtime.Remoting.Metadata.W3cXsd2001;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
@@ -18,6 +21,8 @@ using TemuKJD.BaseForms;
|
|||||||
using TemuKJD.BLL;
|
using TemuKJD.BLL;
|
||||||
using TemuKJD.Extension;
|
using TemuKJD.Extension;
|
||||||
using Work;
|
using Work;
|
||||||
|
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
|
||||||
|
using static System.Windows.Forms.VisualStyles.VisualStyleElement.StartPanel;
|
||||||
//using TemuKJD.PDDForms.AdminForms;
|
//using TemuKJD.PDDForms.AdminForms;
|
||||||
|
|
||||||
namespace TemuKJD.WXForms.ShopForms
|
namespace TemuKJD.WXForms.ShopForms
|
||||||
@@ -283,7 +288,8 @@ namespace TemuKJD.WXForms.ShopForms
|
|||||||
int i = 1;
|
int i = 1;
|
||||||
foreach (var shopInfo in shopInfoLst)
|
foreach (var shopInfo in shopInfoLst)
|
||||||
{
|
{
|
||||||
Invoke(new Action(() => {
|
Invoke(new Action(() =>
|
||||||
|
{
|
||||||
this.statusBar.pgbTaskProgress.Value = i;
|
this.statusBar.pgbTaskProgress.Value = i;
|
||||||
this.statusBar.pgbTaskProgress.Text = i + "/" + shopInfoLst.Count;
|
this.statusBar.pgbTaskProgress.Text = i + "/" + shopInfoLst.Count;
|
||||||
i++;
|
i++;
|
||||||
@@ -305,7 +311,8 @@ namespace TemuKJD.WXForms.ShopForms
|
|||||||
int i = 1;
|
int i = 1;
|
||||||
foreach (var shopInfo in shopInfoLst)
|
foreach (var shopInfo in shopInfoLst)
|
||||||
{
|
{
|
||||||
Invoke(new Action(() => {
|
Invoke(new Action(() =>
|
||||||
|
{
|
||||||
this.statusBar.pgbTaskProgress.Value = i;
|
this.statusBar.pgbTaskProgress.Value = i;
|
||||||
this.statusBar.pgbTaskProgress.Text = i + "/" + shopInfoLst.Count;
|
this.statusBar.pgbTaskProgress.Text = i + "/" + shopInfoLst.Count;
|
||||||
this.statusBar.pgbTaskProgress.Maximum = shopInfoLst.Count;
|
this.statusBar.pgbTaskProgress.Maximum = shopInfoLst.Count;
|
||||||
@@ -927,7 +934,7 @@ namespace TemuKJD.WXForms.ShopForms
|
|||||||
case "续期":
|
case "续期":
|
||||||
lblShopId.Text = shop.ShopId;
|
lblShopId.Text = shop.ShopId;
|
||||||
lblShopInfo.Text = shop.ShopAccount;
|
lblShopInfo.Text = shop.ShopAccount;
|
||||||
numAddTopUp.Value = 0;
|
numAddTopUp.Value = 1;
|
||||||
pnlTopUp.Visible = true;
|
pnlTopUp.Visible = true;
|
||||||
break;
|
break;
|
||||||
//case "多重登录":
|
//case "多重登录":
|
||||||
@@ -1222,52 +1229,47 @@ namespace TemuKJD.WXForms.ShopForms
|
|||||||
pnlTopUp.Visible = false;
|
pnlTopUp.Visible = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void btnTopUpOK_Click(object sender, EventArgs e)
|
private async void btnTopUpOK_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
//var row = pnlTopUp.Tag as DataGridViewRow;
|
|
||||||
//if (row == null)
|
|
||||||
// return;
|
|
||||||
//var shopId = row.Cells["colShopId"].Value.ParseToString();
|
|
||||||
//if (shopId == null)
|
|
||||||
// return;
|
|
||||||
//var shop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ShopId == shopId);
|
|
||||||
//if (shop == null)
|
|
||||||
// return;
|
|
||||||
var shopIds = lblShopId.Text.Split(';');
|
var shopIds = lblShopId.Text.Split(';');
|
||||||
|
string errMsg = "";
|
||||||
|
int renew_months = (int)numAddTopUp.Value;//续费月数
|
||||||
|
renew_months = Math.Max(1, renew_months);
|
||||||
|
|
||||||
|
if (BaseMsgForm.ShowConfirm($"[{lblShopInfo.Text}] 店铺续费:{renew_months}个月", "提示").DialogResult == DialogResult.Cancel)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
pbLoading.Visible = true;
|
pbLoading.Visible = true;
|
||||||
pbLoading.BringToFront();
|
pbLoading.BringToFront();
|
||||||
string errMsg = "";
|
|
||||||
Task.Run(() =>
|
|
||||||
{
|
|
||||||
foreach (var shopId in shopIds)
|
foreach (var shopId in shopIds)
|
||||||
{
|
{
|
||||||
var shop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ShopId == shopId);
|
var shop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ShopId == shopId);
|
||||||
if (shop == null)
|
if (shop == null)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
string url = BaseClass.BuildObjString("user/update_user_points");
|
string url = BaseClass.BuildObjString("user/shop_renew");
|
||||||
string data = UserLogin.GetSignaturex();
|
var data = UserLogin.GetSignPostData(new
|
||||||
data += "&update_user_name=" + BaseClass.UserName;
|
|
||||||
data += "&update_user_nick=" + BaseClass.NickName;
|
|
||||||
data += "&option_type=" + "续费";
|
|
||||||
data += "&operator_type=" + "用户";
|
|
||||||
data += "&operator_name=" + BaseClass.UserName;
|
|
||||||
data += "&delta_points=" + (numAddTopUp.Value * BaseClass.ShopPointsPerMonth).ParseToInt();
|
|
||||||
data += "&shop_id=" + shopId;
|
|
||||||
data += "&shop_account=" + shop.ShopAccount;
|
|
||||||
|
|
||||||
string html = GetHtml.PostUtf8(url, data.ToString()).Trim();
|
|
||||||
Thread.Sleep(100);
|
|
||||||
if (!html.Contains("\"code\":200"))
|
|
||||||
{
|
{
|
||||||
var msg = BaseRegex.GetStringJsonByRegs(ref html, html, "msg");
|
UserName = BaseClass.UserName,
|
||||||
errMsg += shop.ShopAccount + ":" + msg + " ";
|
ShopId = shopId,
|
||||||
|
RenewDuration = renew_months,
|
||||||
|
});
|
||||||
|
string html = await GetHtml.PostJsonAsync(url, data);
|
||||||
|
var ret = JsonConvert.DeserializeObject<Result<ShopRenewResponse>>(html);
|
||||||
|
|
||||||
|
if (ret.Code != 200)
|
||||||
|
{
|
||||||
|
errMsg += $"shop.ShopAccount:{ret.Msg}";
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
shop.expire_time = BaseRegex.GetIntJson(ref html, "newExpireTime");
|
shop.expire_time = ret.Data.ExpireTime;
|
||||||
shop.is_point_shop_expire = false;
|
shop.is_point_shop_expire = false;
|
||||||
BaseClass.Points = BaseRegex.GetIntJson(ref html, "newUserPoints");
|
BaseClass.Points = ret.Data.UserPoints;
|
||||||
Invoke(new Action(() =>
|
Invoke(new Action(() =>
|
||||||
{
|
{
|
||||||
MainForm.instance.lblPoints.Text = "账户积分:" + BaseClass.Points;
|
MainForm.instance.lblPoints.Text = "账户积分:" + BaseClass.Points;
|
||||||
@@ -1287,7 +1289,15 @@ namespace TemuKJD.WXForms.ShopForms
|
|||||||
BaseMsgForm.ShowInfo("充值完成 发生以下错误:\r\n" + errMsg);
|
BaseMsgForm.ShowInfo("充值完成 发生以下错误:\r\n" + errMsg);
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
});
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
pbLoading.Visible = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void numAddTopUp_ValueChanged(object sender, EventArgs e)
|
private void numAddTopUp_ValueChanged(object sender, EventArgs e)
|
||||||
@@ -1302,8 +1312,14 @@ namespace TemuKJD.WXForms.ShopForms
|
|||||||
|
|
||||||
lblShopId.Text = string.Join(";", shops.Select(s => s.ShopId));
|
lblShopId.Text = string.Join(";", shops.Select(s => s.ShopId));
|
||||||
lblShopInfo.Text = string.Join(" ", shops.Select(s => s.ShopAccount));
|
lblShopInfo.Text = string.Join(" ", shops.Select(s => s.ShopAccount));
|
||||||
numAddTopUp.Value = 0;
|
numAddTopUp.Value = 1;
|
||||||
pnlTopUp.Visible = true;
|
pnlTopUp.Visible = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public class ShopRenewResponse
|
||||||
|
{
|
||||||
|
public string ShopId { get; set; }
|
||||||
|
public int ExpireTime { get; set; }
|
||||||
|
public int UserPoints { get; set; }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user