From 8fa9cea816f5ed49a44f40659a337f17bf95f802 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com>
Date: Thu, 4 Jun 2020 17:27:50 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BA=AC=E4=B8=9C=E5=95=86=E5=9F=8E=E8=AE=A2?=
=?UTF-8?q?=E5=8D=95=20=E6=97=A5=E6=9C=9F=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
platformapi/jdshopapi/store_page.go | 7 ++++---
platformapi/jdshopapi/store_page_test.go | 6 ++++++
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/platformapi/jdshopapi/store_page.go b/platformapi/jdshopapi/store_page.go
index d39cda8f..bddebfd1 100644
--- a/platformapi/jdshopapi/store_page.go
+++ b/platformapi/jdshopapi/store_page.go
@@ -16,7 +16,7 @@ var (
regexpOrderDetailTable = regexp.MustCompile(`
`)
regexpOrderDetailTd = regexp.MustCompile(`(.*?) | `)
regexpOrderDetailMobile = regexp.MustCompile(`(.*?)`)
- regexpOrderDetailDay = regexp.MustCompile(`配送日期: | [\s\S]*?(.*?) | `)
+ regexpOrderDetailDay = regexp.MustCompile(`期望送货日期: | [\s\S]*?(.*?) | `)
regexpOrderDetailPay = regexp.MustCompile(`应支付金额: | [\s\S]*?[\s\S]*?¥(.*?[\s\S]*?) | `)
regexpOrderDetailMobileKey = regexp.MustCompile(`accesskey="(.*?)"`)
)
@@ -420,8 +420,9 @@ func (a *API) OrderDetail(orderId string) (orderDetailResult *OrderDetailResult,
}
}
if len(expectedDeliveredTime) > 0 {
- times := strings.Split(expectedDeliveredTime[1], ",")
- orderDetailResult.ExpectedDeliveredTime = times[0] + " " + times[1][:strings.Index(times[1], ":")] + ":00:00"
+ // times := strings.Split(expectedDeliveredTime[1], ",")
+ // orderDetailResult.ExpectedDeliveredTime = times[0] + " " + times[1][:strings.Index(times[1], ":")] + ":00:00"
+ orderDetailResult.ExpectedDeliveredTime = expectedDeliveredTime[1][:strings.LastIndex(expectedDeliveredTime[1], "-")] + ":00"
}
if len(actualPayPrice) > 0 {
orderDetailResult.ActualPayPrice = utils.Float64TwoInt64(utils.Str2Float64(strings.TrimSpace(actualPayPrice[1])) * 100)
diff --git a/platformapi/jdshopapi/store_page_test.go b/platformapi/jdshopapi/store_page_test.go
index ba7a3c6b..6cce12c4 100644
--- a/platformapi/jdshopapi/store_page_test.go
+++ b/platformapi/jdshopapi/store_page_test.go
@@ -4,6 +4,7 @@ import (
"fmt"
"io/ioutil"
"net/http"
+ "strings"
"testing"
"git.rosy.net.cn/baseapi/utils"
@@ -89,3 +90,8 @@ func TestUpdateWaybill(t *testing.T) {
}
// t.Log(utils.Format4Output(result, false))
}
+
+func TestAAAAAA(t *testing.T) {
+ str := "2020-06-02 16:00-17:00"
+ fmt.Println(str[:strings.LastIndex(str, "-")])
+}