Commit d27cec5e authored by liguangyu06's avatar liguangyu06
Browse files

优化

parent d73a721c
...@@ -28,7 +28,7 @@ request_body = commonFuc().get_business_data(module, "payload34") ...@@ -28,7 +28,7 @@ request_body = commonFuc().get_business_data(module, "payload34")
# 发送请求 # 发送请求
result = requests.get(url, params=request_body, headers=headers) result = requests.get(url, params=request_body, headers=headers)
result = json.loads(result.content) result = json.loads(result.content)
# print(result)
# 生成一个随机数 # 生成一个随机数
delivery_time_random = random.randint(0, len(result["data"]["list"]) - 1) delivery_time_random = random.randint(0, len(result["data"]["list"]) - 1)
# delivery_time_random = 0 # delivery_time_random = 0
...@@ -40,17 +40,19 @@ if result["data"]["list"][delivery_time_random]["productRangeType"]: ...@@ -40,17 +40,19 @@ if result["data"]["list"][delivery_time_random]["productRangeType"]:
# 通过查看发货时间详情获取商品信息 # 通过查看发货时间详情获取商品信息
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url36") url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url36")
request_body = commonFuc().get_business_data(module, "payload36", delivery_time_id) request_body = commonFuc().get_business_data(module, "payload36", delivery_time_id)
# print(request_body)
# 发送请求 # 发送请求
result1 = requests.get(url, params=request_body, headers=headers) result1 = requests.get(url, params=request_body, headers=headers)
result1 = json.loads(result1.content) result1 = json.loads(result1.content)
# print(result1)
# 获取商品信息 # 获取商品信息
line_codes = "" line_codes = ""
name = result1["data"]["name"] name = result1["data"]["name"]
status = result1["data"]["status"] status = result1["data"]["status"]
product_code = result1["data"]["productList"][0]["productCode"] product_code = (
product_name = result1["data"]["productList"][0]["productName"] result1["data"]["productList"][0]["productCode"] if result1["data"]["productList"][0]["productCode"] else "")
product_name = (
result1["data"]["productList"][0]["productName"] if result1["data"]["productList"][0]["productName"] else "")
# 进行查询条件验证 # 进行查询条件验证
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url35") url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url35")
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment