192 lines
7.7 KiB
C#
192 lines
7.7 KiB
C#
using AllBase;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Work
|
|
{
|
|
public class PayGroupOrder
|
|
{
|
|
#region 获取买家在本店购买商品的sku图
|
|
public static string SignWordBase = ".`~^*_| -#$%&?+";
|
|
public static string GetSkuImg(string proId, string sku, string detailHtml = "")
|
|
{
|
|
string SkuImg = "";
|
|
string htmlx = "";
|
|
if (string.IsNullOrEmpty(htmlx))
|
|
{
|
|
//return "";
|
|
string urlx = BaseClass.PddMobileUrlx + "goods.html?goods_id=" + proId;
|
|
htmlx = GetPostTaobaoHtml.UploadTaobao(urlx, urlx, true);
|
|
}
|
|
|
|
string strx = "\"skus\":\\[\\{\"skuID\":[\\s\\S]+?,\"hdThumbUrl\"";
|
|
var Skux = BaseRegex.GetMatchRegex(ref htmlx, strx);
|
|
string skustr = "";
|
|
if (Skux.Count > 0)
|
|
{
|
|
skustr = Skux[0].Value;
|
|
}
|
|
var m = BaseRegex.GetMatchRegex(ref skustr, "\"skuID\"([\\s\\S]+?),\"unselectGroupPrice\":");
|
|
if (m.Count == 0)
|
|
{
|
|
m = BaseRegex.GetMatchRegex(ref skustr, "\"skuID\":([\\s\\S]+?),\"staticLimitQuantity\":");
|
|
}
|
|
for (int k = 0; k < m.Count; k++)
|
|
{
|
|
var item = m[k].Value.ToString();
|
|
string spec_value = BaseRegex.GetStringJson(ref item, "spec_value");
|
|
if (!string.IsNullOrEmpty(spec_value) && !string.IsNullOrEmpty(sku))
|
|
{
|
|
for (int i = 0; !string.IsNullOrEmpty(spec_value) && i < SignWordBase.Length; i++)
|
|
{
|
|
spec_value = spec_value.Replace(SignWordBase[i].ToString(), "");
|
|
}
|
|
if (sku.Contains(spec_value))
|
|
{
|
|
SkuImg = BaseRegex.GetStringJson(ref item, "thumbUrl");
|
|
break;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
SkuImg = BaseRegex.GetStringJson(ref item, "thumbUrl");
|
|
}
|
|
}
|
|
return SkuImg;
|
|
}
|
|
#endregion
|
|
|
|
|
|
#region 根据上家id获取商品url
|
|
public static string GetJumpUrl(int siteId, long pid)
|
|
{
|
|
string url = "";
|
|
if (siteId == 1)
|
|
{
|
|
if (!BaseClass.PhonePay)
|
|
{
|
|
url = "https://item.taobao.com/item.htm?id=" + pid;//电脑详情
|
|
//url = "http://taoke.qixiaoker.com/first.php?product_id=" + pid;
|
|
|
|
string data = UserLogin.GetSignaturex() + "";
|
|
string urlx = BaseClass.BuildObjString("taobaoke&tid=" + pid);
|
|
string html = GetHtml.PostUtf8(urlx, data);
|
|
if (string.IsNullOrEmpty(html))
|
|
{
|
|
//Thread.Sleep(3000);
|
|
//data = UserLogin.GetSignaturex();
|
|
//urlx = BaseClass.BuildObjString("taobaoke&tid=" + pid);
|
|
//html = GetHtml.PostUtf8(urlx, data);
|
|
}
|
|
long id = BaseRegex.GetLongJson(ref html, "id");
|
|
if (id == pid)
|
|
{
|
|
string coupon_url = BaseRegex.GetStringJson(ref html, "coupon_url");
|
|
if (!string.IsNullOrEmpty(coupon_url))
|
|
{
|
|
url = coupon_url;
|
|
}
|
|
if (string.IsNullOrEmpty(coupon_url))
|
|
{
|
|
string urltemp = BaseRegex.GetStringJson(ref html, "url");
|
|
if (!string.IsNullOrEmpty(urltemp))
|
|
{
|
|
url = urltemp.Replace("\\", "");
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
|
|
}
|
|
else
|
|
{
|
|
url = "https://h5.m.taobao.com/awp/core/detail.htm?id=" + pid;//手机详情
|
|
}
|
|
}
|
|
if (siteId == 2)
|
|
{
|
|
url = BaseClass.LoginApiUrl + "?obj=upshopid/pinduoduo_click&act=jump&id=" + pid;
|
|
if (!string.IsNullOrEmpty(BaseClass.JinBaoJump))
|
|
url = BaseClass.LoginApiUrl + "?obj=upshopid/jump_to&act=" + BaseClass.JinBaoJump + "&id=" + pid;
|
|
}
|
|
if (siteId == 3)
|
|
url = "https://detail.1688.com/offer/" + pid + ".html";
|
|
return url;
|
|
}
|
|
#endregion
|
|
|
|
public class PayGroupOrderBase
|
|
{
|
|
public string order_id = "";
|
|
public string order_id_buy = "";
|
|
public string name = "";
|
|
public string shopRealname = "";
|
|
public string mobile = "";
|
|
public string address = "";
|
|
public string note = "";
|
|
public string sku = "";
|
|
public string skuImg = "";
|
|
public string group_id = "";
|
|
public decimal price = 0;
|
|
public string product_id = "";
|
|
public string title = "";
|
|
public string shop_id = "";
|
|
public string shop_name = "";
|
|
public string service_id = "";
|
|
public string service_name = "";
|
|
public string status = "";
|
|
public string lose_time = "";
|
|
public string create_time = "";//订单确认时间
|
|
public string promise_time = "";//承诺发货时间
|
|
public bool can_pay = false;
|
|
public string get_up_express_time = "";
|
|
public string express_name = "";
|
|
public string express_id = "";
|
|
public string express_no = "";
|
|
public string up_product_id = "";
|
|
public string up_product_idTemp = "";//编辑时的总店Id1
|
|
public string up_product_idTemp_two = "";//编辑时的总店Id2
|
|
public string up_product_idTemp_three = "";//编辑时的总店Id3
|
|
public string up_product_idTemp_four = "";//编辑时的总店Id4
|
|
public string up_product_idTemp_five = "";//编辑时的总店Id5
|
|
public int chooseUpPro = 0;//选择的上家Id
|
|
public string extensionUrl = "";//推广的url
|
|
public string buy_sku = "";
|
|
|
|
//买手号拍单时的姓名,地址,电话
|
|
public string buy_nickname = "";
|
|
public string buy_address = "";
|
|
public string buy_mobile = "";
|
|
|
|
public string pay_mobile = "";//付款账户
|
|
public decimal buy_price = 0;
|
|
public int buy_type = 1;
|
|
public int buy_count = 1;
|
|
|
|
public string express_id_false = "";//假物流Id
|
|
public string express_name_false = "";//假物流公司
|
|
public string express_no_false = "";//假物流单号
|
|
|
|
public string service_Remark = "";//客服备注
|
|
|
|
public string isRedColorBack = "";//是否红色背景标识
|
|
public string isDelete = "";//是否删除标识
|
|
public string buy_time = "";//拼单|拍单时间
|
|
public string logistics = "";//空包物流公司名称
|
|
public string empty_id = "";//空包物流单号
|
|
public string message_status = "";//空包留言状态
|
|
public string tracking_number_realtime = "";//订单实时物流
|
|
public string shipping_time = "";//发货时间
|
|
|
|
public decimal commission;//多多进宝拥挤
|
|
public bool packovertime = false;//是否揽件超时
|
|
public bool sendovertime = false;//是否发货超时
|
|
public int is_decode_status = 0;//是否已解密 1已解密
|
|
}
|
|
}
|
|
}
|