Files
kami_itunes_june/AppleBatch_June.Domain/SelectShippingOptionNullData.cs
2024-07-22 00:43:14 +08:00

56 lines
3.3 KiB
C#

using System.Net;
using DotNet.Utilities;
namespace AppleBatch_June.Domain
{
public class SelectShippingOptionNullData
{
private static string SelectShippingOptionNullJson = string.Empty;
private static string SelectShippingOptionAdditionaFieldsJson = string.Empty;
public string getSelectShippingOption()
{
if (SelectShippingOptionNullJson == string.Empty)
{
HttpResult html = new HttpHelper().GetHtml(new HttpItem
{
URL = ApiNetReq.host + "/js/selectShippingOptionNull.Json",
Timeout = 8000
});
if (html.StatusCode == HttpStatusCode.OK)
{
SelectShippingOptionNullJson = html.Html;
getSelectShippingAdditionaFieldsn();
}
if (string.IsNullOrEmpty(SelectShippingOptionNullJson))
{
SelectShippingOptionNullJson = "#st\r\nkey!checkout-fulfillment-deliveryTab-delivery-location-address-postalCode;\r\nurl!/shop/checkoutx?_a=calculate&_m=checkout.fulfillment.deliveryTab.delivery.deliveryLocation.address;\r\npost!checkout.fulfillment.deliveryTab.delivery.deliveryLocation.address.postalCode={postalCode};\r\nparam!postalCode;\r\nvalue!p.postalCode;\r\n#end\r\n\r\n#st\r\nkey!checkout.fulfillment.deliveryTab.delivery.deliveryLocation;\r\nurl!/shop/checkoutx?_a=Apply&_m=checkout.fulfillment.deliveryTab.delivery.deliveryLocation;\r\npost!checkout.fulfillment.deliveryTab.delivery.deliveryLocation.address.deliveryLocationSelection.state={state}&checkout.fulfillment.deliveryTab.delivery.deliveryLocation.address.deliveryLocationSelection.postalCode={postalCode}&checkout.fulfillment.deliveryTab.delivery.deliveryLocation.address.deliveryLocationSelection.cityTypeAhead.city={city};\r\nparam!state,postalCode,city;\r\nvalue!r.0,p.postalCode,p.city;\r\nr!abs.DeliveryLocationSelection([\\s\\S]*?)abstract-\"value\":\"([\\s\\S]*?)\"|;\r\n#end\r\n\r\n#st\r\nkey!checkout.fulfillment.deliveryTab.delivery.deliveryLocation.address.deliveryWarmingSubLayout;\r\nurl!/shop/checkoutx?_a=state-warm-up&_m=checkout.fulfillment.deliveryTab.delivery.deliveryLocation.address.deliveryWarmingSubLayout;\r\npost!checkout.fulfillment.deliveryTab.delivery.deliveryLocation.address.deliveryWarmingSubLayout.postalCode={postalCode}&checkout.fulfillment.deliveryTab.delivery.deliveryLocation.address.deliveryWarmingSubLayout.state={state};\r\nparam!state,postalCode;\r\nvalue!r.0,p.postalCode;\r\nr!abs.DeliveryWarmingSubLayout([\\s\\S]*?)layout-\"value\":\"([\\s\\S]*?)\"|;\r\n#end";
}
}
return SelectShippingOptionNullJson;
}
public string getSelectShippingAdditionaFieldsn()
{
if (SelectShippingOptionAdditionaFieldsJson == string.Empty)
{
HttpResult html = new HttpHelper().GetHtml(new HttpItem
{
URL = ApiNetReq.host + "/js/SelectShippingOptionAdditionaFieldsJson.Json",
Timeout = 8000
});
if (html.StatusCode == HttpStatusCode.OK)
{
SelectShippingOptionAdditionaFieldsJson = html.Html;
}
if (string.IsNullOrEmpty(SelectShippingOptionAdditionaFieldsJson))
{
SelectShippingOptionAdditionaFieldsJson = "BRA:checkout.shipping.addressSelector.newAddress.address.zipLookup.state=Amazonas&checkout.shipping.addressSelector.newAddress.address.zipLookup.district=aaaa&checkout.shipping.taxInformation.taxIdType=CPF&checkout.shipping.taxInformation.cpf.cpf=007.408.869-67";
}
}
return SelectShippingOptionAdditionaFieldsJson;
}
}
}