diff --git a/platformapi/jdapi/promotion_sku_test.go b/platformapi/jdapi/promotion_sku_test.go index 44eb1135..6130f431 100644 --- a/platformapi/jdapi/promotion_sku_test.go +++ b/platformapi/jdapi/promotion_sku_test.go @@ -78,68 +78,8 @@ func TestCreatePromotionSkuLimitTime(t *testing.T) { } func TestCancelPromotion(t *testing.T) { - promotionIDs := []int64{ - 24636389, - 24753178, - 24754087, - 24970355, - 24970383, - 24970389, - 25439508, - 25444342, - 25869363, - 25871946, - 26291079, - 27036663, - 27407558, - 27407649, - 27424152, - 27424181, - 27424247, - 27424568, - 27508490, - 27555133, - 27674289, - 30969372, - 41809699, - 41810076, - 41810296, - 41811111, - 44179379, - 54080816, - 54080829, - 54080842, - 55346987, - 55347123, - 55347340, - 55348499, - 55348706, - 55348999, - 55349177, - 56723852, - 56724283, - 56725840, - 56725955, - 56726053, - 60713479, - 60714768, - 60719242, - 68818338, - } - - for _, v := range promotionIDs { - promotionInfo, err := api.QueryPromotionInfo(v) - if err != nil { - t.Fatal(err) - } - // t.Log(promotionInfo.PromotionType) - if promotionInfo.PromotionType == PromotionTypeLimitedTime { - err = api.CancelPromotionLimitTime(v, "", utils.GetUUID()) - } else { - err = api.CancelPromotionSingle(v, "", utils.GetUUID()) - } - if err != nil { - t.Fatal(err) - } + err := api.CancelPromotionSingle(334831149, "", utils.GetUUID()) + if err != nil { + t.Fatal(err) } } diff --git a/platformapi/jdshopapi/jxshopapi_test.go b/platformapi/jdshopapi/jxshopapi_test.go index d417110c..d4dfbcd9 100644 --- a/platformapi/jdshopapi/jxshopapi_test.go +++ b/platformapi/jdshopapi/jxshopapi_test.go @@ -16,6 +16,6 @@ func init() { baseapi.Init(sugarLogger) api = New("de8157b447584885910f429011e49cb93yjq", "E1D746D42474D5F1F1A10CECE75D99F6", "efa7e1d1a22640fa990e6cf164b28608") api.SetCookieWithStr(` - thor=80FAF09E9A09B6E618A68057BDFCFCB81E6C186883AB46A9F4A4D44F89DF482B3B39F419A8731615D5DBB85B9F4595752D431AE9A98EF1EF640306D0A749B9CFECCD1AB4A086A54D885995E5B44BF3C8810880D168DFCF087B93ADC23F163D84CCEE1B79D0FF55AD9197DB0AAACB1DDFFE656ECA7BED9E1CD2720A0501358F4A2E7DC0D494E2F7347697EF19125EF3A3; + thor=80FAF09E9A09B6E618A68057BDFCFCB82CCFD5645F40A144C6CA92A0B84FE8EFE9869C996F2E8961897A27841241639DB35880508820C0CA9E10513471C69F54E4AB811C98D045B848501CAE165D62FEC731B43499E9A86C821179ED3A0B2D683E5472D06BF5D30DC8D029682A30858FC22FC228246002C368B0A689F25113A240E0B8EDB9D8C99915526D3E34C84A82; `) } diff --git a/platformapi/jdshopapi/store_page.go b/platformapi/jdshopapi/store_page.go index ecebde85..28b5af61 100644 --- a/platformapi/jdshopapi/store_page.go +++ b/platformapi/jdshopapi/store_page.go @@ -422,12 +422,11 @@ func (a *API) OrderDetail(orderId string) (orderDetailResult *OrderDetailResult, } if len(expectedDeliveredTime) > 0 { orderDetailResult.ExpectedDeliveredTime = expectedDeliveredTime[1][:strings.LastIndex(expectedDeliveredTime[1], "-")] + ":00" - if orderDetailResult.ExpectedDeliveredTime == "" { - expectedDeliveredTime2 := regexpOrderDetailDay2.FindStringSubmatch(body) - if len(expectedDeliveredTime2) > 0 { - times := strings.Split(expectedDeliveredTime2[1], ",") - orderDetailResult.ExpectedDeliveredTime = times[0] + " " + times[1][:strings.Index(times[1], ":")] + ":00:00" - } + } else { + expectedDeliveredTime2 := regexpOrderDetailDay2.FindStringSubmatch(body) + if len(expectedDeliveredTime2) > 0 { + times := strings.Split(expectedDeliveredTime2[1], ",") + orderDetailResult.ExpectedDeliveredTime = times[0] + " " + times[1][:strings.Index(times[1], ":")] + ":00:00" } } if len(actualPayPrice) > 0 { diff --git a/platformapi/jdshopapi/store_page_test.go b/platformapi/jdshopapi/store_page_test.go index 9d303b66..91c9d23e 100644 --- a/platformapi/jdshopapi/store_page_test.go +++ b/platformapi/jdshopapi/store_page_test.go @@ -70,7 +70,7 @@ func TestAllOrders(t *testing.T) { } func TestOrderDetail(t *testing.T) { - result, err := api.OrderDetail("117078663807") + result, err := api.OrderDetail("124350112427") if err != nil { t.Fatal(err) } @@ -102,8 +102,15 @@ func TestTryGetCookie(t *testing.T) { } func TestAAADS(t *testing.T) { - var s float64 = 200 - fmt.Println(strings.TrimRight(fmt.Sprintf("%.2f", s), "0.")) + var s = `