|
|
@@ -60,6 +60,7 @@ class CustomerTemplateService:
|
|
|
template_json_data = self.parse_template_json(template_json)
|
|
|
# print("config_data",config_data)
|
|
|
handler_config_data,model_image,scene_image = self.__handler_config_data(config_data,save_path)
|
|
|
+ print("handler_config_data",handler_config_data)
|
|
|
self.goods_no_value = handler_config_data
|
|
|
headers = {"Content-Type": "application/json"}
|
|
|
json_data = {"goodsList":[{self.goods_no:handler_config_data}],"canvasList":template_json_data}
|
|
|
@@ -296,17 +297,21 @@ class CustomerTemplateService:
|
|
|
base64_data = self.crop_image_and_convert_to_base64(pic_path)
|
|
|
# 新增字段(去除 -抠图)
|
|
|
new_key = pic_key.replace("-抠图", "")
|
|
|
- new_key = goods_art_no_rename_list[index].get("action_name")
|
|
|
+ try:
|
|
|
+ new_key = goods_art_no_rename_list[index].get("action_name")
|
|
|
+ except:
|
|
|
+ print("没有找到对应的action_name",index)
|
|
|
+ # print("goods_art_no_rename_list",goods_art_no_rename_list)
|
|
|
new_pics[new_key] = base64_data
|
|
|
except Exception as e:
|
|
|
print(f"读取图片失败: {pic_path}, 错误: {e}")
|
|
|
+ index += 1
|
|
|
else:
|
|
|
# 非 -抠图 字段保持不变
|
|
|
# new_pics[pic_key] = pic_path
|
|
|
pass
|
|
|
# 更新 pics 字段
|
|
|
product["pics"] = new_pics
|
|
|
- index += 1
|
|
|
|
|
|
# 构建目标结构
|
|
|
# result.append({key: item})
|