using AllBase; using AllBase.Model.DBModel; using Newtonsoft.Json.Linq; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Work._29Tools.BLL { public class WxSimProductBLL { /// /// 获取商品列表 /// /// /// /// /// /// /// /// public static string searchProduct(ShopLoginInfo shop, int pageNum, int pageSize = 50, string prodIds = null, int status = 5, int? sortType = null) { //https://store.weixin.qq.com/shop-faas/mmchannelstradeproductcore/cgi/goods/searchProduct?token=&lang=zh_CN&pageSize=20&productStatus[]=-1&productSource=[1,16,32]&searchSource=1&useNew=true&pageNum=44&status[]=5&presaleType[]=1 //https://store.weixin.qq.com/shop-faas/mmchannelstradeproductcore/cgi/goods/searchProduct?token=&lang=zh_CN&pageSize=20&productStatus[]=-1&productSource=[1,16,32]&searchSource=1&useNew=true&pageNum=1&status[]=-1&spuId=1000080961530,10000802736449 string url = "https://store.weixin.qq.com/shop-faas/mmchannelstradeproductcore/cgi/goods/searchProduct?token=&lang=zh_CN&" + "pageSize=" + pageSize + "&productStatus[]=-1&productSource=[1,16,32]&searchSource=1&useNew=true&pageNum=" + pageNum + "&status[]=" + status; if (prodIds != null) url += "&spuId=" + prodIds; if (sortType != null) url += "&sortType=" + sortType; string refere = "https://store.weixin.qq.com/shop/goods/list"; var result = HttpResponseWXBLL.WeiXinGetResponse(shop, url, refere); return result; } public static string getSkuBySpu(ShopLoginInfo shop, string spuIds) { string url = "https://store.weixin.qq.com/shop-faas/mmecnodeproductlist/cgi/goods/getStockBySpu?token=&lang=zh_CN"; string body = @"{""productIdList"":[" + spuIds + @"]}"; string refere = "https://store.weixin.qq.com/shop/goods/list"; var result = HttpResponseWXBLL.WeiXinPostResponse(shop, url, body, refere); return result; } /// /// 下架商品 /// /// /// /// public static string DownProd(ShopLoginInfo shop, string prodIds) { string url = "https://store.weixin.qq.com/shop-faas/mmecnodeproductlist/cgi/goods/BatchUnListing?token=&lang=zh_CN"; string referer = "https://store.weixin.qq.com/shop/goods/list"; string body = @"{""ids"":[" + prodIds + @"],""uploadSource"":6}"; var result = HttpResponseWXBLL.WeiXinPostResponse(shop, url, body, referer); return result; } public static string batchUpdateStockAdd(ShopLoginInfo shop, string spuId, string skuId, string num) { string url = "https://store.weixin.qq.com/shop-faas/mmecnodeproductlist/cgi/goods/batchUpdateStock?token=&lang=zh_CN"; string body = @"{""skuList"":[{""spuId"":""" + spuId + @""",""skuId"":""" + skuId + @""",""diffType"":1,""num"":" + num + "}]}"; string refere = "https://store.weixin.qq.com/shop/goods/list"; var result = HttpResponseWXBLL.WeiXinPostResponse(shop, url, body, refere); return result; } public static string batchUpdateStockReduce(ShopLoginInfo shop, string spuId, string skuId, string num) { string url = "https://store.weixin.qq.com/shop-faas/mmecnodeproductlist/cgi/goods/batchUpdateStock?token=&lang=zh_CN"; string body = @"{""skuList"":[{""spuId"":""" + spuId + @""",""skuId"":""" + skuId + @""",""diffType"":2,""num"":" + num + "}]}"; string refere = "https://store.weixin.qq.com/shop/goods/list"; var result = HttpResponseWXBLL.WeiXinPostResponse(shop, url, body, refere); return result; } /// /// 编辑商品价格 /// /// /// @"{""skuList"":[{""spuId"":" + spuId + @",""skuId"":""" + skuId + @""",""salePrice"":" + newPrice + @"}],""uploadSource"":6}"; /// public static string EditPrice(ShopLoginInfo shop, JObject priceData) { string url = "https://store.weixin.qq.com/shop-faas/mmecnodeproductlist/cgi/goods/listingUpdatePrice?token=&lang=zh_CN"; //string body = @"{""skuList"":[{""spuId"":" + spuId + @",""skuId"":""" + skuId + @""",""salePrice"":" + newPrice + @"}],""uploadSource"":6}"; string body = JsonHelper.SerializeObject(priceData); string refere = "https://store.weixin.qq.com/shop/goods/list"; var result = HttpResponseWXBLL.WeiXinPostResponse(shop, url, body, refere); return result; } public static string cancelActivity(ShopLoginInfo shop, JObject activityData) { string url = "https://store.weixin.qq.com/shop-faas/mmeckolmarketingnode/activity/cgi/updateRequestProductList?token=&lang=zh_CN"; string body = JsonHelper.SerializeObject(activityData); string refere = "https://store.weixin.qq.com/shop/marketingkol/activity/detail?id=1016&curTab=2"; var result = HttpResponseWXBLL.WeiXinPostResponse(shop, url, body, refere); return result; } } }