订单功能服务端新增 商品编辑功能优化等

This commit is contained in:
wule committed 2026-06-19 16:53:34 +08:00
1 parent 33eafd6781
commit f2534535f7
22 files changed
+911 -98

No files matched your search

+1 -1
View File
@@ -27,7 +27,7 @@ namespace AllBase
/// <summary>
/// 版本ID
/// </summary>
public static int VersionCount = 1187;
public static int VersionCount = 1189;
public static string MainPath = "29wx";
//public static string MainPath = "29wx";
//public static string MainPath = "29pdd";
+1 -1
View File
@@ -368,7 +368,7 @@ namespace AllBase
return ms.ToArray();
}
/// <summary>
/// 根据路劲得出图片编码信息
/// 根据路径得出图片编码信息
/// </summary>
/// <param name="path"></param>
/// <returns></returns>
@@ -0,0 +1,172 @@
using KJD_Web.Model.WxModel;
using KJD_Web.Utils;
using NaiBa.Util.Extension;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI.WebControls;
namespace KJD_Web.BLL.WXXD
{
public class WXOrderManage
{
public string WXGetErpOrderList(string inputData, bool isDetail = false)
{
if (!string.IsNullOrEmpty(inputData))
{
var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt();
string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
if (time1 != EncrypUtil.Encryption(time))
return "{\"code\":50000,\"msg\":\"校验失败\"}";
var erp_shop_id_in = RegexUtils.GetStringQuery(ref inputData, "erp_shop_id_in")?.Replace("'", "\\'");
if (erp_shop_id_in.IsNullOrEmpty())
{
return "{\"code\":500,\"msg\":\"未指定店铺\"}";
}
var query_status = RegexUtils.GetStringQuery(ref inputData, "query_status")?.Replace("'", "\\'");
var purchase_status = RegexUtils.GetStringQuery(ref inputData, "purchase_status")?.Replace("'", "\\'");
var sort_type = RegexUtils.GetStringQuery(ref inputData, "sort_type")?.Replace("'", "\\'");
int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt();
int page_size = RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(50);
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "SELECT COUNT(id) FROM erp.oms_wei_order o WHERE 1=1 ";
string where = "";
if (!string.IsNullOrWhiteSpace(erp_shop_id_in))
where += " and o.shop_id in (" + erp_shop_id_in + ")";
if (!string.IsNullOrWhiteSpace(query_status))
where += " and o.status = " + query_status;
if (!string.IsNullOrWhiteSpace(purchase_status))
where += " and o.purchase_status = " + purchase_status;
sql += where;
var count = mySql.ExecuteRowCount(sql);
DataTable dt;
if (count == 0)
{
dt = new DataTable();
}
else
{
sql = "SELECT o.* FROM" +
" erp.oms_wei_order o " +
" WHERE 1=1";
//where子句
sql += where;
if (sort_type == "asc")
//sql += " ORDER BY o.create_time ASC, o.id desc";
sql += " ORDER BY o.create_time ASC";
else
sql += " ORDER BY o.create_time DESC";
sql += " LIMIT " + Math.Max(page - 1, 0) * page_size + "," + page_size;
dt = mySql.ExecuteDataTable(sql);
}
mySql.Close();
if (dt != null)
{
try
{
List<oms_wei_order> orderList = new List<oms_wei_order>();
foreach (DataRow row in dt.Rows)
{
oms_wei_order order = new oms_wei_order
{
id = row["id"].ParseToLong(),
aftersale_detail = row["aftersale_detail"].ParseToString(),
audit_status = row["audit_status"].ParseToNullableInt(),
audit_time = row["audit_time"].ParseToString().ParseToDateTime(),
city_name = row["city_name"].ParseToString(),
colour_flag = row["colour_flag"].ParseToNullableInt(),
colour_flag_update_time = row["colour_flag_update_time"].ParseToString().ParseToDateTime(),
commission_amount = row["commission_amount"].ParseToNullableInt(),
county_name = row["county_name"].ParseToString(),
create_time = row["create_time"].ParseToInt(),
delivery_deadline = row["delivery_deadline"].ParseToNullableInt(),
delivery_product_info = row["delivery_product_info"].ParseToString(),
delivery_time = row["delivery_time"].ParseToNullableInt(),
detail_info = row["detail_info"].ParseToString(),
discounted_price = row["discounted_price"].ParseToNullableInt(),
erp_send_code = row["erp_send_code"].ParseToString(),
erp_send_company = row["erp_send_company"].ParseToString(),
erp_send_status = row["erp_send_status"].ParseToNullableInt(),
erp_send_time = row["erp_send_time"].ParseToString().ParseToDateTime(),
ewaybill_order_code = row["ewaybill_order_code"].ParseToString(),
external_gift = row["external_gift"].ParseToNullableInt(),
ext_info = row["ext_info"].ParseToString(),
freight = row["freight"].ParseToNullableInt(),
freight_insurance_amount = row["freight_insurance_amount"].ParseToNullableInt(),
gift_order_status = row["gift_order_status"].ParseToNullableInt(),
hash_code = row["hash_code"].ParseToString(),
has_freight_insurance = row["has_freight_insurance"].ParseToNullableInt(),
house_number = row["house_number"].ParseToString(),
is_express_no_used = row["is_express_no_used"].ParseToNullableInt(),
is_shipment_optimized = row["is_shipment_optimized"].ParseToNullableInt(),
merchant_id = row["merchant_id"].ParseToString(),
openid = row["openid"].ParseToString(),
order_id = row["order_id"].ParseToString(),
order_price = row["order_price"].ParseToNullableInt(),
out_account = row["out_account"].ParseToString(),
out_after_sale_status = row["out_after_sale_status"].ParseToString(),
out_amount = row["out_amount"].ParseToNullableInt(),
out_express_company = row["out_express_company"].ParseToString(),
out_express_no = row["out_express_no"].ParseToString(),
out_order_no = row["out_order_no"].ParseToString(),
out_shipped = row["out_shipped"].ParseToNullableInt(),
pay_info = row["pay_info"].ParseToString(),
postal_code = row["postal_code"].ParseToString(),
predict_commission_fee = row["predict_commission_fee"].ParseToNullableInt(),
product_price = row["product_price"].ParseToNullableInt(),
province_name = row["province_name"].ParseToString(),
purchase_price = row["purchase_price"].ParseToNullableInt(),
purchase_status = row["purchase_status"].ParseToNullableInt(),
purchase_time = row["purchase_time"].ParseToNullableInt(),
settle_info = row["settle_info"].ParseToString(),
ship_done_time = row["ship_done_time"].ParseToNullableInt(),
shop_id = row["shop_id"].ParseToLong(),
shop_name = row["shop_name"].ParseToString(),
shop_remark = row["shop_remark"].ParseToString(),
soft_remark = row["soft_remark"].ParseToString(),
status = row["status"].ParseToNullableInt(),
supplier_remark_exception = row["supplier_remark_exception"].ParseToString(),
tel_number = row["tel_number"].ParseToString(),
tel_number_ext_info = row["tel_number_ext_info"].ParseToString(),
transfer_warehouse_status = row["transfer_warehouse_status"].ParseToNullableInt(),
unionid = row["unionid"].ParseToString(),
update_time = row["update_time"].ParseToInt(),
user_name = row["user_name"].ParseToString(),
use_tel_number = row["use_tel_number"].ParseToNullableInt(),
virtual_order_tel_number = row["virtual_order_tel_number"].ParseToString(),
};
orderList.Add(order);
}
JsonSerializerSettings jsonSetting = new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore };
var data = JsonUtils.SerializeObjectToString(orderList, jsonSetting);
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + "}";
}
catch (Exception ex)
{
return "{\"code\":500,\"msg\":\"" + ex.Message + "\",\"data\":[],\"count\":" + 0 + "}";
}
}
else
{
return "{\"code\":500,\"msg\":\"" + mySql.Message + "\",\"data\":[],\"count\":" + 0 + "}";
}
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
}
}
@@ -39,6 +39,7 @@ namespace KJD_Web.BLL.WXXD
var operate_sub_sa_name = RegexUtils.GetStringQuery(ref inputData, "operate_sub_sa_name")?.Replace("'", "\\'");
var shop_ids = RegexUtils.GetStringQuery(ref inputData, "shop_ids")?.Replace("'", "");
var is_show_expire = RegexUtils.GetStringQuery(ref inputData, "is_show_expire")?.ParseToBool();
var is_get_erp_shop_id = RegexUtils.GetStringQuery(ref inputData, "is_get_erp_shop_id")?.ParseToBool();
if (!string.IsNullOrWhiteSpace(shop_ids))
{
@@ -144,7 +145,6 @@ namespace KJD_Web.BLL.WXXD
if (dt != null)
{
List<ShopParam> shopList = new List<ShopParam>();
List<ShopParam> allShopList = new List<ShopParam>();
foreach (DataRow row in dt.Rows)
{
ShopParam shop = new ShopParam
@@ -182,11 +182,38 @@ namespace KJD_Web.BLL.WXXD
shopList.Add(shop);
}
var valid_data = JsonUtils.SerializeObjectToString(shopList);
var all_data = JsonUtils.SerializeObjectToString(allShopList);
if (is_get_erp_shop_id == true)
{
conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
mySql = new MysqlUtils(conn);
sql = " SELECT app_key,id " +
" FROM erp.o_shop" +
" WHERE app_key in ('" + string.Join ("','", shopList.Select(s=>s.shop_id)) + "');";
dt = mySql.ExecuteDataTable(sql);
mySql.Close();
if (!string.IsNullOrEmpty(mySql.Message))
{
return "{\"code\":501,\"msg\":\"" + mySql.Message + "\",\"data\":null}";
}
if (dt != null)
{
foreach (DataRow row in dt.Rows)
{
var erpDbId = row["id"].ParseToNullableLong();
var appKey = row["app_key"].ParseToString();
var shop = shopList.FirstOrDefault(s => s.shop_id == appKey && !s.shop_id.IsNullOrEmpty());
if (shop != null)
shop.erp_shop_id = erpDbId;
}
}
}
var data = JsonUtils.SerializeObjectToString(shopList);
var seconds = (DateTime.Now - timeCalc).TotalSeconds.ToString("0.000");
return "{\"code\":200,\"msg\":\"success\",\"data\":" + valid_data + ",\"count\":" + count + ",\"seconds\":" + seconds + "}";
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + ",\"seconds\":" + seconds + "}";
}
}
return "{\"code\":19999,\"msg\":\"未知错误\"}";
+5
View File
@@ -155,6 +155,11 @@ namespace KJD_Web
hPath = hPath.Replace("/wxxd_price/", "/WXPriceService.asmx/");
Context.RewritePath(hPath);
}
else if (!hPath.Contains(".asmx") && hPath.Contains("/wxxd_order/"))
{
hPath = hPath.Replace("/wxxd_order/", "/WXOrderService.asmx/");
Context.RewritePath(hPath);
}
}
protected void Application_AuthenticateRequest(object sender, EventArgs e)
@@ -75,6 +75,7 @@
<Reference Include="System.Xml.Linq" />
</ItemGroup>
<ItemGroup>
<Content Include="WXOrderService.asmx" />
<Content Include="Upload\Prod\WXProdHot.aspx" />
<Content Include="Upload\Prod\WXProd.aspx" />
<Content Include="WXProductService.asmx" />
@@ -115,6 +116,7 @@
<Compile Include="BLL\KJD\UpdateManage.cs" />
<Compile Include="BLL\KJD\UserManage.cs" />
<Compile Include="BLL\WXXD\WXExpressOptimizeManage.cs" />
<Compile Include="BLL\WXXD\WXOrderManage.cs" />
<Compile Include="BLL\WXXD\WXProductManage.cs" />
<Compile Include="BLL\WXXD\WXShopManage.cs" />
<Compile Include="BLL\WXXD\WXUserManage.cs" />
@@ -128,6 +130,7 @@
<Compile Include="Model\PddModel\PDDProductPropertyInfo.cs" />
<Compile Include="Model\ShopModel\JSTListProductSkuInfo.cs" />
<Compile Include="Model\WXAddressInfo.cs" />
<Compile Include="Model\WxModel\oms_wei_order.cs" />
<Compile Include="Model\WxModel\WXBuyUrlNotesInfo.cs" />
<Compile Include="Model\WxModel\WXClientProductInfoLite.cs" />
<Compile Include="Model\WxModel\WXGetEditProductInfoLite.cs" />
@@ -135,6 +138,10 @@
<Compile Include="Model\WxModel\WXOrderDecryptAddressInfo.cs" />
<Compile Include="Model\WxProdSecretSpuIdShopIdMapParam.cs" />
<Compile Include="Model\WXShopDefaultAddressInfo.cs" />
<Compile Include="WXOrderService.asmx.cs">
<DependentUpon>WXOrderService.asmx</DependentUpon>
<SubType>Component</SubType>
</Compile>
<Compile Include="Upload\Prod\BaseClass.cs" />
<Compile Include="Upload\Prod\BaseWxProd.cs" />
<Compile Include="Upload\Prod\WXProdHot.aspx.cs">
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<UseIISExpress>true</UseIISExpress>
@@ -8,7 +8,7 @@
<IISExpressWindowsAuthentication />
<IISExpressUseClassicPipelineMode />
<UseGlobalApplicationHostFile />
<LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig>
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
<ProjectView>ShowAllFiles</ProjectView>
</PropertyGroup>
<ProjectExtensions>
@@ -71,6 +71,7 @@ namespace KJD_Web.Model.ShopModel
public DateTime add_time { get; set; }
//public DateTime mdy_time { get; set; }
public bool? is_point_shop_expire { get; set; } = false;
public long? erp_shop_id { get; internal set; }
}
public class AuthInfo
@@ -0,0 +1,241 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace KJD_Web.Model.WxModel
{
public class oms_wei_order
{
public long id { get; set; }
public long shop_id { get; set; }
public string shop_name { get; set; }
/// <summary>
/// 商户ID
/// </summary>
public string merchant_id { get; set; }
public string order_id { get; set; }
/// <summary>
/// 买家身份标识
/// </summary>
public string openid { get; set; }
public int create_time { get; set; }
public int update_time { get; set; }
public string unionid { get; set; }
/// <summary>
/// 状态10 待付款;20 待发货;21 部分发货;30 待收货;100 完成;200 全部商品售后之后,订单取消;250 未付款用户主动取消或超时未付款订单自动取消;
/// </summary>
public int? status { get; set; }
/// <summary>
/// 售后信息json
/// </summary>
public string aftersale_detail { get; set; }
/// <summary>
/// 支付信息
/// </summary>
public string pay_info { get; set; }
/// <summary>
/// 额外信息
/// </summary>
public string ext_info { get; set; }
/// <summary>
/// 商品总价
/// </summary>
public int? product_price { get; set; }
/// <summary>
/// 订单金额,单位为分,order_price=original_order_price-discounted_price-deduction_price-change_down_price
/// </summary>
public int? order_price { get; set; }
/// <summary>
/// 采购价,单位为分
/// </summary>
public int? purchase_price { get; set; }
/// <summary>
/// 采购时间
/// </summary>
public int? purchase_time { get; set; }
/// <summary>
/// 运费,单位为分
/// </summary>
public int? freight { get; set; }
/// <summary>
/// 平台服务费(微信小店:预计技术服务费),单位为分
/// </summary>
public int? predict_commission_fee { get; set; }
/// <summary>
/// 达人佣金(微信小店:分账金额),单位为分
/// </summary>
public int? commission_amount { get; set; }
/// <summary>
/// 优惠券优惠金额,单位为分
/// </summary>
public int? discounted_price { get; set; }
/// <summary>
/// 采购状态,默认值为:0未采购,推送仓库时修改为1采购
/// </summary>
public int? purchase_status { get; set; }
/// <summary>
/// 延迟发货时间(微信小店:商品发货时效,超时此时间未发货即为发货超时)
/// </summary>
public int? delivery_deadline { get; set; }
/// <summary>
/// 发货时间
/// </summary>
public int? delivery_time { get; set; }
/// <summary>
/// 收货人姓名
/// </summary>
public string user_name { get; set; }
/// <summary>
/// 邮编
/// </summary>
public string postal_code { get; set; }
public string province_name { get; set; }
public string city_name { get; set; }
/// <summary>
/// 区
/// </summary>
public string county_name { get; set; }
/// <summary>
/// 详细地址
/// </summary>
public string detail_info { get; set; }
public string tel_number { get; set; }
/// <summary>
/// 门牌号码
/// </summary>
public string house_number { get; set; }
/// <summary>
/// 虚拟发货订单联系方式(deliver_method=1时返回)
/// </summary>
public string virtual_order_tel_number { get; set; }
/// <summary>
/// 额外的联系方式信息(虚拟号码相关)
/// </summary>
public string tel_number_ext_info { get; set; }
/// <summary>
/// 0:不使用虚拟号码,1:使用虚拟号码
/// </summary>
public int? use_tel_number { get; set; }
/// <summary>
/// 标识当前店铺下一个唯一的用户收货地址
/// </summary>
public string hash_code { get; set; }
/// <summary>
/// 发货物流信息JSON
/// </summary>
public string delivery_product_info { get; set; }
/// <summary>
/// 发货完成时间,秒级时间戳
/// </summary>
public int? ship_done_time { get; set; }
/// <summary>
/// 电子面单代发时的订单密文
/// </summary>
public string ewaybill_order_code { get; set; }
/// <summary>
/// 结算信息json
/// </summary>
public string settle_info { get; set; }
/// <summary>
/// 订单审核状态(0待审核1已审核)
/// </summary>
public int? audit_status { get; set; }
/// <summary>
/// 订单审核时间
/// </summary>
public DateTime audit_time { get; set; }
/// <summary>
/// erp发货快递公司
/// </summary>
public string erp_send_company { get; set; }
/// <summary>
/// erp发货快递单号
/// </summary>
public string erp_send_code { get; set; }
/// <summary>
/// erp发货状态
/// </summary>
public int? erp_send_status { get; set; }
/// <summary>
/// erp发货时间
/// </summary>
public DateTime erp_send_time { get; set; }
/// <summary>
/// 旗帜颜色备注,1:灰旗,2:红旗,3:橙旗,4:绿旗,5:天蓝旗,6:紫旗
/// </summary>
public int? colour_flag { get; set; }
/// <summary>
/// 旗帜备注时间
/// </summary>
public DateTime colour_flag_update_time { get; set; }
/// <summary>
/// 供应商备注异常单
/// </summary>
public string supplier_remark_exception { get; set; }
/// <summary>
/// 礼物单状态,默认值0:不存在礼物单,1:礼物单已发货,2:礼物单信息已更正
/// </summary>
public int? gift_order_status { get; set; }
/// <summary>
/// 店铺备注:取微信ext_info.merchant_notes
/// </summary>
public string shop_remark { get; set; }
/// <summary>
/// 软件备注
/// </summary>
public string soft_remark { get; set; }
/// <summary>
/// 外采金额(单位:分,整数存储)
/// </summary>
public int? out_amount { get; set; }
/// <summary>
/// 外采账户
/// </summary>
public string out_account { get; set; }
/// <summary>
/// 外采订单号
/// </summary>
public string out_order_no { get; set; }
/// <summary>
/// 外采快递公司
/// </summary>
public string out_express_company { get; set; }
/// <summary>
/// 外采快递单号
/// </summary>
public string out_express_no { get; set; }
/// <summary>
/// 外采是否发货(0 未发货,1 已发货)
/// </summary>
public int? out_shipped { get; set; }
/// <summary>
/// 判断是否优化过发货0 未优化, 1已优化
/// </summary>
public int? is_shipment_optimized { get; set; }
/// <summary>
/// 判断是否优随机使用快递单号0 未使用, 1已使用
/// </summary>
public int? is_express_no_used { get; set; }
/// <summary>
/// 外采订单售后状态
/// </summary>
public string out_after_sale_status { get; set; }
/// <summary>
/// 是否支持运费险:0-不支持,1-支持
/// </summary>
public int? has_freight_insurance { get; set; }
/// <summary>
/// 运费险金额(单位:元)
/// </summary>
public decimal? freight_insurance_amount { get; set; }
/// <summary>
/// 是否外采礼物单:0-否,1-是(外采订单)
/// </summary>
public int? external_gift { get; set; }
/// <summary>
/// 中转仓的状态 0未使用,1已创建,2创建失败(购买失败),3已创建未有上游快递单号,4已创建有上游快递单号
/// </summary>
public decimal? transfer_warehouse_status { get; set; }
}
}
@@ -0,0 +1 @@
<%@ WebService Language="C#" CodeBehind="WXOrderService.asmx.cs" Class="KJD_Web.WXOrderService" %>
@@ -0,0 +1,64 @@
using KJD_Web.BLL;
using KJD_Web.BLL.WXXD;
using KJD_Web.Utils;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.Services;
namespace KJD_Web
{
/// <summary>
/// OrderService 的摘要说明
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
// 若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务,请取消注释以下行。
// [System.Web.Script.Services.ScriptService]
public class WXOrderService : System.Web.Services.WebService
{
private string GetRequestJsonString()
{
Context.Response.ContentType = "text/html;charset=utf-8";
Context.Response.ContentEncoding = System.Text.Encoding.GetEncoding("utf-8");
using (Stream s = HttpContext.Current.Request.InputStream) // 获得json 字符流
{
// 还原数据流
byte[] b = new byte[s.Length];
s.Read(b, 0, (int)s.Length);
string jsonText = Encoding.UTF8.GetString(b); // JSON字符串
if (string.IsNullOrEmpty(jsonText))
{
var qs = HttpContext.Current.Request.QueryString;
if (qs != null && qs.Keys.Count > 0)
{
jsonText = "{";
foreach (var key in qs.Keys)
{
jsonText += "\"" + key + "\":" + "\"" + qs[key.ToString()] + "\";";
}
jsonText = jsonText.TrimEnd(';') + "}";
}
}
return jsonText;
}
}
[WebMethod]
public void get_order_list()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new WXOrderManage().WXGetErpOrderList(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
}
}
+33 -4
View File
@@ -332,8 +332,8 @@ namespace TemuKJD.BLL
collectAuthorityTag = "-" + BaseClass.UserName;
bool isExist = false;
var existUrl = BaseClass.BuildPDDObjString("product/get_product_list");
string existData = UserLogin.GetSignaturex() + "&search_spu=" + prodInfo.detail.goods_id + collectAuthorityTag;
var existUrl = BaseClass.BuildPDDObjString("product/get_product_spu_id_list");
string existData = UserLogin.GetSignaturex() + "&search_spu_ids=" + prodInfo.detail.goods_id + collectAuthorityTag;
string html = GetHtml.PostUtf8(existUrl, existData);
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
html = GetHtml.PostUtf8(existUrl, existData);
@@ -469,6 +469,32 @@ namespace TemuKJD.BLL
prodInfo.detail.extend_warranty_dto = new extend_warranty_dto_item() { extend_warranty = 0 };
//prodInfo.detail.fabric = null;
//prodInfo.detail.fabric_content = null;
if (!frontProdInfo.goods.gallery.Any(g => g.type == 1) && frontProdInfo.goods.gallery.Any(g => g.type == 13))
{
foreach (var g in frontProdInfo.goods.gallery)
{
if (g.type == 13)
g.type = 1;
}
}
if (!frontProdInfo.goods.gallery.Any(g => g.type == 1) && frontProdInfo.goods.gallery.Any(g => g.type == 2))
{
foreach (var g in frontProdInfo.goods.gallery.Where(g => g.type == 2)
.OrderBy(g => Math.Abs(100m - 100m * g.width.ParseToDecimal() / g.height.ParseToDecimal(1))).Take(3).ToList())
{
frontProdInfo.goods.gallery.Add(new PDDFrontProductInfo2_gallery()
{
enable_share = g.enable_share,
goods_id = g.goods_id,
height = g.height,
id = g.id,
priority = g.priority,
type = 1,
url = g.url,
width = g.width,
});
}
}
prodInfo.detail.galleries = new List<gallery_item>();
int galleryIndex = 0;
foreach (var frontGallery in frontProdInfo.goods.gallery)
@@ -655,6 +681,9 @@ namespace TemuKJD.BLL
shipment_limit_second_list = null,
sku69_code = "",
};
if ((int)frontSku.sku_price.ParseToDecimal() > 0)
skuInfo.multi_price = Math.Min(skuInfo.multi_price.ParseToInt(), (int)frontSku.group_price.ParseToDecimal());
//List<string> specIds = frontSku.spec.Split(',').ToList();
//List<string> specKeys = frontSku.spec_keys.Split(';').ToList();
//List<string> specValues = frontSku.spec_values.Split(';').ToList();
@@ -723,8 +752,8 @@ namespace TemuKJD.BLL
collectAuthorityTag = "-" + BaseClass.UserName;
bool isExist = false;
var existUrl = BaseClass.BuildPDDObjString("product/get_product_list");
string existData = UserLogin.GetSignaturex() + "&search_spu=" + prodInfo.detail.goods_id + collectAuthorityTag;
var existUrl = BaseClass.BuildPDDObjString("product/get_product_spu_id_list");
string existData = UserLogin.GetSignaturex() + "&search_spu_ids=" + prodInfo.detail.goods_id + collectAuthorityTag;
string html = GetHtml.PostUtf8(existUrl, existData);
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
html = GetHtml.PostUtf8(existUrl, existData);
@@ -38,6 +38,15 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.pbLoading = new System.Windows.Forms.PictureBox();
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.flowLayoutPanel3 = new System.Windows.Forms.FlowLayoutPanel();
this.flowLayoutPanel5 = new System.Windows.Forms.FlowLayoutPanel();
this.label10 = new System.Windows.Forms.Label();
this.flpMainImage = new System.Windows.Forms.FlowLayoutPanel();
this.flowLayoutPanel6 = new System.Windows.Forms.FlowLayoutPanel();
this.label11 = new System.Windows.Forms.Label();
this.flpDetailImage = new System.Windows.Forms.FlowLayoutPanel();
this.flowLayoutPanel7 = new System.Windows.Forms.FlowLayoutPanel();
this.label12 = new System.Windows.Forms.Label();
this.flpProp = new System.Windows.Forms.FlowLayoutPanel();
this.pnlSpec1 = new System.Windows.Forms.Panel();
this.btnAddSpec1 = new DevComponents.DotNetBar.PanelEx();
this.label1 = new System.Windows.Forms.Label();
@@ -87,6 +96,9 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
this.flowLayoutPanel3.SuspendLayout();
this.flowLayoutPanel5.SuspendLayout();
this.flowLayoutPanel6.SuspendLayout();
this.flowLayoutPanel7.SuspendLayout();
this.pnlSpec1.SuspendLayout();
this.flowLayoutPanel1.SuspendLayout();
this.pnlSpec2.SuspendLayout();
@@ -155,6 +167,12 @@ namespace TemuKJD.PDDForms.ProductSelectForms
// flowLayoutPanel3
//
this.flowLayoutPanel3.AutoScroll = true;
this.flowLayoutPanel3.Controls.Add(this.flowLayoutPanel5);
this.flowLayoutPanel3.Controls.Add(this.flpMainImage);
this.flowLayoutPanel3.Controls.Add(this.flowLayoutPanel6);
this.flowLayoutPanel3.Controls.Add(this.flpDetailImage);
this.flowLayoutPanel3.Controls.Add(this.flowLayoutPanel7);
this.flowLayoutPanel3.Controls.Add(this.flpProp);
this.flowLayoutPanel3.Controls.Add(this.pnlSpec1);
this.flowLayoutPanel3.Controls.Add(this.flowLayoutPanel1);
this.flowLayoutPanel3.Controls.Add(this.pnlSpec2);
@@ -171,11 +189,129 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.flowLayoutPanel3.TabIndex = 1;
this.flowLayoutPanel3.WrapContents = false;
//
// flowLayoutPanel5
//
this.flowLayoutPanel5.Anchor = System.Windows.Forms.AnchorStyles.Top;
this.flowLayoutPanel5.AutoSize = true;
this.flowLayoutPanel5.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.flowLayoutPanel5.Controls.Add(this.label10);
this.flowLayoutPanel5.Location = new System.Drawing.Point(3, 0);
this.flowLayoutPanel5.Margin = new System.Windows.Forms.Padding(3, 0, 3, 3);
this.flowLayoutPanel5.MaximumSize = new System.Drawing.Size(1240, 9999);
this.flowLayoutPanel5.MinimumSize = new System.Drawing.Size(1250, 10);
this.flowLayoutPanel5.Name = "flowLayoutPanel5";
this.flowLayoutPanel5.Size = new System.Drawing.Size(1250, 22);
this.flowLayoutPanel5.TabIndex = 20;
this.flowLayoutPanel5.Tag = "";
//
// label10
//
this.label10.AutoSize = true;
this.label10.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label10.Location = new System.Drawing.Point(3, 5);
this.label10.Margin = new System.Windows.Forms.Padding(3, 5, 3, 0);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(44, 17);
this.label10.TabIndex = 0;
this.label10.Text = "主图:";
//
// flpMainImage
//
this.flpMainImage.Anchor = System.Windows.Forms.AnchorStyles.Top;
this.flpMainImage.AutoSize = true;
this.flpMainImage.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.flpMainImage.Location = new System.Drawing.Point(3, 25);
this.flpMainImage.Margin = new System.Windows.Forms.Padding(3, 0, 3, 3);
this.flpMainImage.MaximumSize = new System.Drawing.Size(1240, 9999);
this.flpMainImage.MinimumSize = new System.Drawing.Size(1250, 10);
this.flpMainImage.Name = "flpMainImage";
this.flpMainImage.Size = new System.Drawing.Size(1250, 10);
this.flpMainImage.TabIndex = 16;
this.flpMainImage.Tag = "";
//
// flowLayoutPanel6
//
this.flowLayoutPanel6.Anchor = System.Windows.Forms.AnchorStyles.Top;
this.flowLayoutPanel6.AutoSize = true;
this.flowLayoutPanel6.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.flowLayoutPanel6.Controls.Add(this.label11);
this.flowLayoutPanel6.Location = new System.Drawing.Point(3, 38);
this.flowLayoutPanel6.Margin = new System.Windows.Forms.Padding(3, 0, 3, 3);
this.flowLayoutPanel6.MaximumSize = new System.Drawing.Size(1240, 9999);
this.flowLayoutPanel6.MinimumSize = new System.Drawing.Size(1250, 10);
this.flowLayoutPanel6.Name = "flowLayoutPanel6";
this.flowLayoutPanel6.Size = new System.Drawing.Size(1250, 17);
this.flowLayoutPanel6.TabIndex = 21;
this.flowLayoutPanel6.Tag = "";
//
// label11
//
this.label11.AutoSize = true;
this.label11.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label11.Location = new System.Drawing.Point(3, 0);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(56, 17);
this.label11.TabIndex = 0;
this.label11.Text = "详情图:";
//
// flpDetailImage
//
this.flpDetailImage.Anchor = System.Windows.Forms.AnchorStyles.Top;
this.flpDetailImage.AutoSize = true;
this.flpDetailImage.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.flpDetailImage.Location = new System.Drawing.Point(3, 58);
this.flpDetailImage.Margin = new System.Windows.Forms.Padding(3, 0, 3, 3);
this.flpDetailImage.MaximumSize = new System.Drawing.Size(1240, 9999);
this.flpDetailImage.MinimumSize = new System.Drawing.Size(1250, 10);
this.flpDetailImage.Name = "flpDetailImage";
this.flpDetailImage.Size = new System.Drawing.Size(1250, 10);
this.flpDetailImage.TabIndex = 18;
this.flpDetailImage.Tag = "";
//
// flowLayoutPanel7
//
this.flowLayoutPanel7.Anchor = System.Windows.Forms.AnchorStyles.Top;
this.flowLayoutPanel7.AutoSize = true;
this.flowLayoutPanel7.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.flowLayoutPanel7.Controls.Add(this.label12);
this.flowLayoutPanel7.Location = new System.Drawing.Point(3, 71);
this.flowLayoutPanel7.Margin = new System.Windows.Forms.Padding(3, 0, 3, 3);
this.flowLayoutPanel7.MaximumSize = new System.Drawing.Size(1240, 9999);
this.flowLayoutPanel7.MinimumSize = new System.Drawing.Size(1250, 10);
this.flowLayoutPanel7.Name = "flowLayoutPanel7";
this.flowLayoutPanel7.Size = new System.Drawing.Size(1250, 17);
this.flowLayoutPanel7.TabIndex = 22;
this.flowLayoutPanel7.Tag = "";
//
// label12
//
this.label12.AutoSize = true;
this.label12.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label12.Location = new System.Drawing.Point(3, 0);
this.label12.Name = "label12";
this.label12.Size = new System.Drawing.Size(68, 17);
this.label12.TabIndex = 0;
this.label12.Text = "商品属性:";
//
// flpProp
//
this.flpProp.Anchor = System.Windows.Forms.AnchorStyles.Top;
this.flpProp.AutoSize = true;
this.flpProp.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.flpProp.Location = new System.Drawing.Point(3, 91);
this.flpProp.Margin = new System.Windows.Forms.Padding(3, 0, 3, 3);
this.flpProp.MaximumSize = new System.Drawing.Size(1240, 9999);
this.flpProp.MinimumSize = new System.Drawing.Size(1250, 10);
this.flpProp.Name = "flpProp";
this.flpProp.Size = new System.Drawing.Size(1250, 10);
this.flpProp.TabIndex = 19;
this.flpProp.Tag = "";
//
// pnlSpec1
//
this.pnlSpec1.Controls.Add(this.btnAddSpec1);
this.pnlSpec1.Controls.Add(this.label1);
this.pnlSpec1.Location = new System.Drawing.Point(3, 3);
this.pnlSpec1.Location = new System.Drawing.Point(3, 107);
this.pnlSpec1.MinimumSize = new System.Drawing.Size(1250, 10);
this.pnlSpec1.Name = "pnlSpec1";
this.pnlSpec1.Size = new System.Drawing.Size(1250, 23);
@@ -209,12 +345,13 @@ namespace TemuKJD.PDDForms.ProductSelectForms
// label1
//
this.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label1.Location = new System.Drawing.Point(3, 3);
this.label1.Margin = new System.Windows.Forms.Padding(5, 5, 3, 3);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(51, 17);
this.label1.TabIndex = 0;
this.label1.Text = "属性1:";
this.label1.Text = "规格1:";
//
// flowLayoutPanel1
//
@@ -222,7 +359,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.flowLayoutPanel1.AutoSize = true;
this.flowLayoutPanel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.flowLayoutPanel1.Controls.Add(this.ucPddSpecEdit1);
this.flowLayoutPanel1.Location = new System.Drawing.Point(3, 29);
this.flowLayoutPanel1.Location = new System.Drawing.Point(3, 133);
this.flowLayoutPanel1.Margin = new System.Windows.Forms.Padding(3, 0, 3, 3);
this.flowLayoutPanel1.MaximumSize = new System.Drawing.Size(1240, 9999);
this.flowLayoutPanel1.MinimumSize = new System.Drawing.Size(1250, 10);
@@ -245,7 +382,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
//
this.pnlSpec2.Controls.Add(this.btnAddSpec2);
this.pnlSpec2.Controls.Add(this.label2);
this.pnlSpec2.Location = new System.Drawing.Point(3, 90);
this.pnlSpec2.Location = new System.Drawing.Point(3, 194);
this.pnlSpec2.MinimumSize = new System.Drawing.Size(1250, 10);
this.pnlSpec2.Name = "pnlSpec2";
this.pnlSpec2.Size = new System.Drawing.Size(1250, 23);
@@ -279,12 +416,13 @@ namespace TemuKJD.PDDForms.ProductSelectForms
// label2
//
this.label2.AutoSize = true;
this.label2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label2.Location = new System.Drawing.Point(3, 3);
this.label2.Margin = new System.Windows.Forms.Padding(5, 5, 3, 3);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(51, 17);
this.label2.TabIndex = 1;
this.label2.Text = "属性2:";
this.label2.Text = "规格2:";
//
// flowLayoutPanel2
//
@@ -292,7 +430,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.flowLayoutPanel2.AutoSize = true;
this.flowLayoutPanel2.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.flowLayoutPanel2.Controls.Add(this.ucPddSpecEdit2);
this.flowLayoutPanel2.Location = new System.Drawing.Point(3, 116);
this.flowLayoutPanel2.Location = new System.Drawing.Point(3, 220);
this.flowLayoutPanel2.Margin = new System.Windows.Forms.Padding(3, 0, 3, 3);
this.flowLayoutPanel2.MaximumSize = new System.Drawing.Size(1240, 9999);
this.flowLayoutPanel2.MinimumSize = new System.Drawing.Size(1250, 10);
@@ -313,7 +451,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
// panel4
//
this.panel4.Controls.Add(this.label3);
this.panel4.Location = new System.Drawing.Point(3, 177);
this.panel4.Location = new System.Drawing.Point(3, 281);
this.panel4.MinimumSize = new System.Drawing.Size(1250, 10);
this.panel4.Name = "panel4";
this.panel4.Size = new System.Drawing.Size(1250, 23);
@@ -322,6 +460,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
// label3
//
this.label3.AutoSize = true;
this.label3.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label3.Location = new System.Drawing.Point(1, 3);
this.label3.Margin = new System.Windows.Forms.Padding(5, 5, 3, 3);
this.label3.Name = "label3";
@@ -332,7 +471,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
// panel6
//
this.panel6.Controls.Add(this.flowLayoutPanel4);
this.panel6.Location = new System.Drawing.Point(3, 203);
this.panel6.Location = new System.Drawing.Point(3, 307);
this.panel6.Margin = new System.Windows.Forms.Padding(3, 0, 3, 3);
this.panel6.MinimumSize = new System.Drawing.Size(1250, 10);
this.panel6.Name = "panel6";
@@ -528,7 +667,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.colEditSkuImg,
this.colSkuSn});
this.dgvDbProduct.EditMode = System.Windows.Forms.DataGridViewEditMode.EditOnEnter;
this.dgvDbProduct.Location = new System.Drawing.Point(5, 236);
this.dgvDbProduct.Location = new System.Drawing.Point(5, 340);
this.dgvDbProduct.Margin = new System.Windows.Forms.Padding(5, 0, 3, 3);
this.dgvDbProduct.MultiSelectCheckBox = true;
this.dgvDbProduct.Name = "dgvDbProduct";
@@ -555,13 +694,13 @@ namespace TemuKJD.PDDForms.ProductSelectForms
//
// colSpec1
//
this.colSpec1.HeaderText = "属性1";
this.colSpec1.HeaderText = "规格1";
this.colSpec1.Name = "colSpec1";
this.colSpec1.ReadOnly = true;
//
// colSpec2
//
this.colSpec2.HeaderText = "属性2";
this.colSpec2.HeaderText = "规格2";
this.colSpec2.Name = "colSpec2";
this.colSpec2.ReadOnly = true;
//
@@ -619,7 +758,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
//
// panel5
//
this.panel5.Location = new System.Drawing.Point(3, 842);
this.panel5.Location = new System.Drawing.Point(3, 946);
this.panel5.MinimumSize = new System.Drawing.Size(1250, 10);
this.panel5.Name = "panel5";
this.panel5.Size = new System.Drawing.Size(1250, 10);
@@ -720,6 +859,12 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.splitContainer1.ResumeLayout(false);
this.flowLayoutPanel3.ResumeLayout(false);
this.flowLayoutPanel3.PerformLayout();
this.flowLayoutPanel5.ResumeLayout(false);
this.flowLayoutPanel5.PerformLayout();
this.flowLayoutPanel6.ResumeLayout(false);
this.flowLayoutPanel6.PerformLayout();
this.flowLayoutPanel7.ResumeLayout(false);
this.flowLayoutPanel7.PerformLayout();
this.pnlSpec1.ResumeLayout(false);
this.pnlSpec1.PerformLayout();
this.flowLayoutPanel1.ResumeLayout(false);
@@ -780,6 +925,10 @@ namespace TemuKJD.PDDForms.ProductSelectForms
public DevComponents.DotNetBar.PanelEx btnSaveSkuLst;
public DevComponents.DotNetBar.PanelEx btnRestoreAll;
private System.Windows.Forms.Panel panel6;
private System.Windows.Forms.Panel panel7;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.FlowLayoutPanel flpMainImage;
private System.Windows.Forms.FlowLayoutPanel flpDetailImage;
private System.Windows.Forms.DataGridViewCheckBoxColumn colSelect;
private System.Windows.Forms.DataGridViewTextBoxColumn colSkuId;
private System.Windows.Forms.DataGridViewTextBoxColumn colSpec1;
@@ -791,7 +940,12 @@ namespace TemuKJD.PDDForms.ProductSelectForms
private System.Windows.Forms.DataGridViewImageColumn colSkuImg;
private System.Windows.Forms.DataGridViewLinkColumn colEditSkuImg;
private System.Windows.Forms.DataGridViewTextBoxColumn colSkuSn;
private System.Windows.Forms.Panel panel7;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.FlowLayoutPanel flpProp;
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel5;
private System.Windows.Forms.Label label10;
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel6;
private System.Windows.Forms.Label label11;
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel7;
private System.Windows.Forms.Label label12;
}
}
@@ -28,6 +28,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
{
public KJDDBProduct DbProd { get; set; }
public KJDDBProduct DbProdDetail { get; set; }
Dictionary<string, string> imgDic { get; set; } = new Dictionary<string, string>();
List<sku_edit_item> lstSkuEditItem { get; set; } = new List<sku_edit_item>();
sku_edit_item defaultSkuEditItem { get; set; }
int addSpecIndex1 = 1;
@@ -66,6 +67,42 @@ namespace TemuKJD.PDDForms.ProductSelectForms
Invoke(new Action(() =>
{
label5.Text = "单价";
var prodInfo = JsonHelper.DeserializeJsonToObject<PDDProductInfo>(DbProdDetail.product_json);
// 加载主图和详情图
foreach (var image in prodInfo.detail.galleries)
{
var imgUrl = image.url.ParseToString().Replace("https", "http") + "?" + Randomx.GetId(10000000, 99999999);
imgDic[imgUrl] = imgUrl;
var pb = new PictureBox()
{
Size = new Size(128, 128),
SizeMode = PictureBoxSizeMode.Zoom,
Tag = imgUrl,
ImageLocation = imgUrl,
BorderStyle = BorderStyle.FixedSingle,
};
pb.Click += Pb_Click;
if (image.type == 1)
{
this.flpMainImage.Controls.Add(pb);
}
else
this.flpDetailImage.Controls.Add(pb);
}
//加载商品属性
foreach (var prop in prodInfo.property.goods_properties)
{
var panel = new FlowLayoutPanel() { AutoSize = true };
panel.Controls.Add(new Label() { AutoSize = true, Text = prop.name });
panel.Controls.Add(new Label() { AutoSize= true, BorderStyle = BorderStyle.FixedSingle, Text = string.Join(";", prop.values.Select(v => v.value)), BackColor = Color.White, /*ReadOnly = true*/ });
this.flpProp.Controls.Add(panel);
}
//加载规格
if (!string.IsNullOrWhiteSpace(DbProdDetail.sku_edit_json))
{
// 如果有编辑过的sku使用编辑过的sku
@@ -74,7 +111,6 @@ namespace TemuKJD.PDDForms.ProductSelectForms
else
{
// 否则使用原版sku
var prodInfo = JsonHelper.DeserializeJsonToObject<PDDProductInfo>(DbProdDetail.product_json);
lstSkuEditItem = JsonHelper.DeserializeJsonToList<sku_edit_item>(JsonHelper.SerializeObject(prodInfo.detail.sku));
}
DisplaySkuData(lstSkuEditItem);
@@ -83,6 +119,16 @@ namespace TemuKJD.PDDForms.ProductSelectForms
});
}
private void Pb_Click(object sender, EventArgs e)
{
var pb = sender as PictureBox;
if (pb == null)
return;
ShowImgForm imgFrom = new ShowImgForm(pb.ImageLocation, imgDic);
imgFrom.ShowDialog();
}
void DisplaySkuData(List<sku_edit_item> lstSkuEditItem)
{
defaultSkuEditItem = lstSkuEditItem.FirstOrDefault();
@@ -293,7 +339,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
if (spec == null)
return;
if (edit.pictureBox1.Visible == true) // 第一组属性
if (edit.pictureBox1.Visible == true) // 第一组规格
{
if (lstSkuEditItem.All(s => s.spec.Count > 0))
{
@@ -308,7 +354,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
}
else
{
if (lstSkuEditItem.All(s => s.spec.Count > 1)) // 第二组属性
if (lstSkuEditItem.All(s => s.spec.Count > 1)) // 第二组规格
{
var rows = this.dgvDbProduct.Rows.Cast<DataGridViewRow>().Where(r => r.Cells["colSpec2"].Value.ParseToString() == spec.spec_name).ToList();
foreach (var row in rows)
@@ -470,7 +516,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
skuEditItem.spec.Count > 1 ? skuEditItem.spec[1].spec_name : "",
skuEditItem.multi_price * 0.01m,
skuEditItem.price * 0.01m,
skuEditItem.quantity,
skuEditItem.quantity.IsNullOrZero() ? skuEditItem.quantity_delta : skuEditItem.quantity,
skuEditItem.thumb_url,
DataGridViewExtension.defaultBitmap,
"编辑",
@@ -51,6 +51,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.ucTabControlMetro1 = new TemuKJD.UserControls.UcTabControlMetro();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.btnAddUserProd = new DevComponents.DotNetBar.PanelEx();
this.btnTitleFission = new DevComponents.DotNetBar.PanelEx();
this.btnSetGroup = new DevComponents.DotNetBar.PanelEx();
this.btnDelSelect = new DevComponents.DotNetBar.PanelEx();
@@ -179,7 +180,6 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.col_select_product = new System.Windows.Forms.DataGridViewLinkColumn();
this.ucSplitPage1 = new TemuKJD.UserControls.UcSplitPage();
this.statusBar = new TemuKJD.UserControls.StatusBarUserControl();
this.btnAddUserProd = new DevComponents.DotNetBar.PanelEx();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
@@ -265,6 +265,32 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.tabPage1.Text = "数据操作";
this.tabPage1.UseVisualStyleBackColor = true;
//
// btnAddUserProd
//
this.btnAddUserProd.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnAddUserProd.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnAddUserProd.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnAddUserProd.DisabledBackColor = System.Drawing.Color.Empty;
this.btnAddUserProd.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnAddUserProd.Location = new System.Drawing.Point(6, 41);
this.btnAddUserProd.Name = "btnAddUserProd";
this.btnAddUserProd.Size = new System.Drawing.Size(96, 25);
this.btnAddUserProd.Style.Alignment = System.Drawing.StringAlignment.Center;
this.btnAddUserProd.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnAddUserProd.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnAddUserProd.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;
this.btnAddUserProd.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
this.btnAddUserProd.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None;
this.btnAddUserProd.Style.ForeColor.Color = System.Drawing.Color.White;
this.btnAddUserProd.Style.GradientAngle = 90;
this.btnAddUserProd.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
this.btnAddUserProd.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnAddUserProd.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnAddUserProd.TabIndex = 800;
this.btnAddUserProd.Text = "添加到用户商品";
this.btnAddUserProd.Visible = false;
this.btnAddUserProd.Click += new System.EventHandler(this.btnAddUserProd_Click);
//
// btnTitleFission
//
this.btnTitleFission.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
@@ -424,7 +450,6 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.btnOutProdSaveDb.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnOutProdSaveDb.TabIndex = 1154;
this.btnOutProdSaveDb.Text = "导入已采集数据";
this.btnOutProdSaveDb.Visible = false;
this.btnOutProdSaveDb.Click += new System.EventHandler(this.btnOutProdSaveDb_Click);
//
// btnImport
@@ -2032,32 +2057,6 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.statusBar.Size = new System.Drawing.Size(1438, 25);
this.statusBar.TabIndex = 5;
//
// btnAddUserProd
//
this.btnAddUserProd.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnAddUserProd.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnAddUserProd.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnAddUserProd.DisabledBackColor = System.Drawing.Color.Empty;
this.btnAddUserProd.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnAddUserProd.Location = new System.Drawing.Point(6, 41);
this.btnAddUserProd.Name = "btnAddUserProd";
this.btnAddUserProd.Size = new System.Drawing.Size(96, 25);
this.btnAddUserProd.Style.Alignment = System.Drawing.StringAlignment.Center;
this.btnAddUserProd.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnAddUserProd.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnAddUserProd.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;
this.btnAddUserProd.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
this.btnAddUserProd.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None;
this.btnAddUserProd.Style.ForeColor.Color = System.Drawing.Color.White;
this.btnAddUserProd.Style.GradientAngle = 90;
this.btnAddUserProd.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
this.btnAddUserProd.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnAddUserProd.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnAddUserProd.TabIndex = 800;
this.btnAddUserProd.Text = "添加到用户商品";
this.btnAddUserProd.Visible = false;
this.btnAddUserProd.Click += new System.EventHandler(this.btnAddUserProd_Click);
//
// PDDDBProdListForm
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
@@ -1150,14 +1150,31 @@ namespace TemuKJD.PDDForms.ProductSelectForms
string rst = "";
try
{
using (StreamReader sr = new StreamReader(path))
using (StreamReader sr = new StreamReader(path, Work.Api.UploadPinduoduoMain.GetFileEncoding(path)))
{
content = sr.ReadToEnd();
content = sr.ReadToEnd();
}
if (content.Contains("\"spec_keys\"") && content.Contains("\"spec_values\"") && content.Contains("\"is_sku_pre_sale\""))
rst = new PDDProdFormConverter().PddFrontToPddBackConvert(content);
else if (content.Contains("\"destination_url\"") && content.Contains("\"destination_type\"") && content.Contains("\"pre_render_url\""))
//else if (content.Contains("\"destination_url\"") && content.Contains("\"destination_type\"") && content.Contains("\"pre_render_url\""))
//{
// rst = new PDDProdFormConverter().PddFrontToPddBackConvert2(content);
//}
//else if (content.Contains("\"goods_id\"") && content.Contains("\"goods_name\"") && content.Contains("\"gallery\"") &&
// content.Contains("\"priority\"") && content.Contains("\"enable_share\"") && content.Contains("\"decoration\"") &&
// content.Contains("\"goods_property\"") && content.Contains("\"ref_pid\"") && content.Contains("\"sku_id\"") &&
// content.Contains("\"quantity\"") && content.Contains("\"specs\"") && content.Contains("\"spec_key\"") &&
// content.Contains("\"spec_value\"") && content.Contains("\"group_price\"") && content.Contains("\"sku_price\"") &&
// content.Contains("img.pddpic.com") )
//{
// rst = new PDDProdFormConverter().PddFrontToPddBackConvert2(content);
//}
else if (content.Contains("\"goods_id\"") && content.Contains("\"goods_name\"") && content.Contains("\"gallery\"") &&
content.Contains("\"priority\"") && content.Contains("\"enable_share\"") && content.Contains("\"goods_property\"") &&
(content.Contains("\"ref_pid\"") || content.Contains("\"goods_property\":[]")) && content.Contains("\"sku_id\"") && content.Contains("\"quantity\"") &&
content.Contains("\"specs\"") && content.Contains("\"spec_key\"") && content.Contains("\"spec_value\"") &&
content.Contains("\"group_price\"") && content.Contains("img.pddpic.com"))
{
rst = new PDDProdFormConverter().PddFrontToPddBackConvert2(content);
}
@@ -1173,13 +1190,13 @@ namespace TemuKJD.PDDForms.ProductSelectForms
Invoke(new Action(() =>
{
this.statusBar.UpdateProgressBar(this.statusBar.pgbTaskProgress.Value + 1);
this.statusBar.lblTaskStatus.Text = "正在导入";
this.statusBar.lblTaskStatus.Text = "正在导入,尝试导入" + (successNum + failedNum) + ",成功" + successNum + ",失败" + failedNum;
}));
}
Invoke(new Action(() =>
{
pbLoading.Visible = false;
this.statusBar.lblTaskStatus.Text = "导入完成";
this.statusBar.lblTaskStatus.Text = "导入完成,尝试导入" + (successNum + failedNum) + ",成功" + successNum + ",失败" + failedNum;
BaseMsgForm.ShowInfo("导入完成!");
}));
});
+14 -14
View File
@@ -32,11 +32,11 @@ namespace TemuKJD.ToolForms
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ShowImgForm));
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.label1 = new System.Windows.Forms.Label();
this.btnSave = new DevComponents.DotNetBar.PanelEx();
this.btnCopy = new DevComponents.DotNetBar.PanelEx();
this.btnCopyUrl = new DevComponents.DotNetBar.PanelEx();
this.btnClose = new DevComponents.DotNetBar.PanelEx();
this.label1 = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
@@ -80,9 +80,19 @@ namespace TemuKJD.ToolForms
this.pictureBox1.TabStop = false;
this.pictureBox1.Click += new System.EventHandler(this.pictureBox1_Click);
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(265, 9);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(188, 17);
this.label1.TabIndex = 518;
this.label1.Text = "点击图片或按空格键切换列表图片";
this.label1.Visible = false;
//
// btnSave
//
this.btnSave.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnSave.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnSave.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnSave.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnSave.DisabledBackColor = System.Drawing.Color.Empty;
@@ -107,7 +117,7 @@ namespace TemuKJD.ToolForms
//
// btnCopy
//
this.btnCopy.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnCopy.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnCopy.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnCopy.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnCopy.DisabledBackColor = System.Drawing.Color.Empty;
@@ -132,7 +142,7 @@ namespace TemuKJD.ToolForms
//
// btnCopyUrl
//
this.btnCopyUrl.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnCopyUrl.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnCopyUrl.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnCopyUrl.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnCopyUrl.DisabledBackColor = System.Drawing.Color.Empty;
@@ -180,16 +190,6 @@ namespace TemuKJD.ToolForms
this.btnClose.Text = "关闭";
this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(265, 9);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(188, 17);
this.label1.TabIndex = 518;
this.label1.Text = "点击图片或按空格键切换列表图片";
this.label1.Visible = false;
//
// ShowImgForm
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
+15 -3
View File
@@ -17,12 +17,10 @@ namespace TemuKJD.ToolForms
string currentImgUrl = null;
Dictionary<string, string> imgDic = new Dictionary<string, string>();
public ShowImgForm(string picUrl, Dictionary<string, string> picDic = null)
public ShowImgForm(string picUrl)
{
InitializeComponent();
currentImgUrl = picUrl;
if (picDic != null)
imgDic = picDic;
if (!string.IsNullOrEmpty(currentImgUrl))
{
@@ -37,6 +35,20 @@ namespace TemuKJD.ToolForms
}
}
public ShowImgForm(string picUrl, Dictionary<string, string> picDic)
{
InitializeComponent();
currentImgUrl = picUrl;
if (picDic != null)
imgDic = picDic;
if (!string.IsNullOrEmpty(currentImgUrl))
{
if (picDic != null)
this.pictureBox1.ImageLocation = currentImgUrl.Replace("https", "http");
}
}
public ShowImgForm(Image img)
{
InitializeComponent();
@@ -466,9 +466,24 @@ namespace TemuKJD.WXForms.ProductForms
if (itemObj["serviceName"].ParseToString() == "店统领供应链-商品管理")
{
var expiresTick = itemObj["expireTime"].ParseToLong();
GlobalConfig.lstWxShopAuthInfo.Add(new AuthInfo() { ShopId = shop.ShopId, UpdateTime = DateTime.Now, ExpiresTime = BaseClass.StampToDateTime(expiresTick.ParseToInt()) });
Invoke(new Action(() => { BindShop(shop, selectIds, "已查询"); }));
return;
var WxShopAuthInfo = new AuthInfo() { ShopId = shop.ShopId, UpdateTime = DateTime.Now, ExpiresTime = BaseClass.StampToDateTime(expiresTick.ParseToInt()) };
if (WxShopAuthInfo.ExpiresTime > DateTime.Now)
{
GlobalConfig.lstWxShopAuthInfo.Add(WxShopAuthInfo);
Invoke(new Action(() => { BindShop(shop, selectIds, "已查询"); }));
return;
}
}
if (itemObj["serviceName"].ParseToString() == "东内部")
{
var expiresTick = itemObj["expireTime"].ParseToLong();
var WxShopAuthInfo = new AuthInfo() { ShopId = shop.ShopId, UpdateTime = DateTime.Now, ExpiresTime = BaseClass.StampToDateTime(expiresTick.ParseToInt()) };
if (WxShopAuthInfo.ExpiresTime > DateTime.Now)
{
GlobalConfig.lstWxShopAuthInfo.Add(WxShopAuthInfo);
Invoke(new Action(() => { BindShop(shop, selectIds, "已查询"); }));
return;
}
}
}
// 没找到指定服务
@@ -493,12 +493,12 @@ namespace TemuKJD.WXForms.ProductForms
{
var prodObjs = JsonHelper.JObjectParse(getProdOnSaleRst);
// 按商品id查询不需要
//if (page == 1 || 1 == 1)
//{
// var totalNum = prodObjs["totalNum"].ParseToInt();
// totalPage = Math.Ceiling(1m * totalNum / pageSize).ParseToInt();
//}
//nextKey = prodObjs["nextKey"].ParseToString();
if (page == 1 || 1 == 1)
{
var totalNum = prodObjs["totalNum"].ParseToInt();
totalPage = Math.Ceiling(1m * totalNum / pageSize).ParseToInt();
}
nextKey = prodObjs["nextKey"].ParseToString();
Invoke(new Action(() =>
{
this.pbLoading.Visible = true;
@@ -152,7 +152,7 @@ namespace TemuKJD.WXForms.ProductForms
SearchDbProd(1);
}
public void SearchDbProd(int page)
public void SearchDbProd(int page, string needKeepStatusText = "")
{
if (InvokeRequired)
{
@@ -256,6 +256,7 @@ namespace TemuKJD.WXForms.ProductForms
#if DEBUG
this.statusBar.lblTaskStatus.Text += ",耗时:" + seconds;
#endif
this.statusBar.lblTaskStatus.Text += needKeepStatusText;
}));
});
}
@@ -1093,19 +1094,37 @@ namespace TemuKJD.WXForms.ProductForms
foreach (var path in filePathLst)
{
string content = "";
string rst = "";
string rst = "商品未识别";
try
{
using (StreamReader sr = new StreamReader(path))
using (StreamReader sr = new StreamReader(path, Work.Api.UploadPinduoduoMain.GetFileEncoding(path)))
{
content = sr.ReadToEnd();
}
content = JsonHelper.SerializeObject(JsonHelper.JObjectParse(content));
if (content.Contains("\"spec_keys\"") && content.Contains("\"spec_values\"") && content.Contains("\"is_sku_pre_sale\""))
{
rst = new PDDProdFormConverter().PddFrontToPddBackConvert(content, true, null, true);
}
else if (content.Contains("\"destination_url\"") && content.Contains("\"destination_type\"") && content.Contains("\"pre_render_url\""))
//else if (content.Contains("\"destination_url\"") && content.Contains("\"destination_type\"") && content.Contains("\"pre_render_url\""))
//{
// rst = new PDDProdFormConverter().PddFrontToPddBackConvert2(content, true, null, true);
//}
//else if (content.Contains("\"goods_id\"") && content.Contains("\"goods_name\"") && content.Contains("\"gallery\"") &&
// content.Contains("\"priority\"") && content.Contains("\"enable_share\"") && content.Contains("\"decoration\"") &&
// content.Contains("\"goods_property\"") && content.Contains("\"ref_pid\"") && content.Contains("\"sku_id\"") &&
// content.Contains("\"quantity\"") && content.Contains("\"specs\"") && content.Contains("\"spec_key\"") &&
// content.Contains("\"spec_value\"") && content.Contains("\"group_price\"") && content.Contains("\"sku_price\"") &&
// content.Contains("img.pddpic.com") )
//{
// rst = new PDDProdFormConverter().PddFrontToPddBackConvert2(content, true, null, true);
//}
else if (content.Contains("\"goods_id\"") && content.Contains("\"goods_name\"") && content.Contains("\"gallery\"") &&
content.Contains("\"priority\"") && content.Contains("\"enable_share\"") && content.Contains("\"goods_property\"") &&
(content.Contains("\"ref_pid\"") || content.Contains("\"goods_property\":[]")) && content.Contains("\"sku_id\"") && content.Contains("\"quantity\"") &&
content.Contains("\"specs\"") && content.Contains("\"spec_key\"") && content.Contains("\"spec_value\"") &&
content.Contains("\"group_price\"") && content.Contains("img.pddpic.com"))
{
rst = new PDDProdFormConverter().PddFrontToPddBackConvert2(content, true, null, true);
}
@@ -1121,14 +1140,14 @@ namespace TemuKJD.WXForms.ProductForms
Invoke(new Action(() =>
{
this.statusBar.UpdateProgressBar(this.statusBar.pgbTaskProgress.Value + 1);
this.statusBar.lblTaskStatus.Text = "正在导入";
this.statusBar.lblTaskStatus.Text = "正在导入,尝试导入" + (successNum + failedNum) + ",成功" + successNum + ",失败" + failedNum;
}));
}
SearchDbProd(1);
SearchDbProd(1, " 导入完成,尝试导入" + (successNum + failedNum) + ",成功" + successNum + ",失败" + failedNum);
Invoke(new Action(() =>
{
pbLoading.Visible = false;
this.statusBar.lblTaskStatus.Text = "导入完成";
this.statusBar.lblTaskStatus.Text = "导入完成,尝试导入" + (successNum + failedNum) + ",成功" + successNum + ",失败" + failedNum;
BaseMsgForm.ShowInfo("导入完成!");
}));
});
@@ -116,7 +116,8 @@ namespace TemuKJD.WXForms.ShopForms
if (!this.Created)
break;
if (this.shop != null && currentUrl.TrimEnd('/') == shopMainUrl)
//if (this.shop != null && currentUrl.TrimEnd('/') == shopMainUrl)
if (this.shop != null && currentUrl.StartsWith( shopMainUrl))
{
if (!cefWebBrowser.GetBrowser().MainFrame.IsValid)
continue;
@@ -678,6 +679,7 @@ namespace TemuKJD.WXForms.ShopForms
{
var username = BaseRegex.GetStringJson(ref data, "username");
var maskMobile = BaseRegex.GetStringJson(ref data, "mobile");
var mall_name = BaseRegex.GetStringJson(ref data, "mall_name");
if (!string.IsNullOrEmpty(username) && !string.IsNullOrEmpty(maskMobile))
{
@@ -685,7 +687,7 @@ namespace TemuKJD.WXForms.ShopForms
if (string.IsNullOrWhiteSpace(maskMobile) || string.IsNullOrWhiteSpace(username))
return;
if (shop.LoginName.EndsWith(maskMobile) || shop.LoginName == username)
if (shop.LoginName.EndsWith(maskMobile) || shop.LoginName == username || shop.LoginName == mall_name)
{
lstShopCompany.Clear();
//var jObj = JObject.Parse(data);
@@ -709,6 +711,8 @@ namespace TemuKJD.WXForms.ShopForms
}
}
if (openType == EnumOpenType.manage && string.IsNullOrWhiteSpace(shop.MallId))
{
shop.MallId = BaseRegex.GetStringJson(ref data, "mall_id");