1拼多多接口上传及相关功能(不含部分功能) 2拼多多选品
This commit is contained in:
1 parent
ff42506091
commit
07b912e9eb
37 files changed
+21117
-206
No files matched your search
@@ -0,0 +1,47 @@
|
||||
using AllBase;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Work.Api;
|
||||
|
||||
namespace Work.Business
|
||||
{
|
||||
public class CpsApiBLL
|
||||
{
|
||||
public string Name = "";
|
||||
|
||||
public CpsApiBLL(string name = "")
|
||||
{
|
||||
Name = name;
|
||||
}
|
||||
|
||||
public void GetCpsMall(List<ShopChatBase> shops)
|
||||
{
|
||||
foreach (var shop in shops)
|
||||
{
|
||||
Thread.Sleep(250 + Randomx.GetId(500));
|
||||
GetCpsMallRate(shop);
|
||||
}
|
||||
}
|
||||
|
||||
public void GetCpsMallRate(ShopChatBase shop)
|
||||
{
|
||||
PinduoduoApiGetProduct api = new PinduoduoApiGetProduct(shop);
|
||||
string html = api.GetCpsShopSet();
|
||||
if (html.Contains("goods_cps_mall_unit_query_response"))
|
||||
{
|
||||
int rate = BaseRegex.GetIntJson(ref html, "rate");
|
||||
int status = BaseRegex.GetIntJson(ref html, "status");
|
||||
shop.CpsShop.Percent = (rate / 10m) + "%";
|
||||
shop.CpsShop.Message = status == 1 ? "全店推广中" + shop.CpsShop.Percent : "未开启全店推广";
|
||||
}
|
||||
else
|
||||
{
|
||||
LogSave.Add(Name, "店铺" + shop.ShopName + "(" + shop.Name + ")" + "读取推广数据失败。");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user