THAI: Promotion: Boost Energy Drink
This commit is contained in:
parent
db1be33ec9
commit
5d29666002
79 changed files with 45159 additions and 12211 deletions
|
|
@ -1,6 +1,34 @@
|
|||
if "v3" in param and "promotion" in param and "other_catalog" in param:
|
||||
file_template = open(directory_to_process + "/page_catalog_group_other_other.lxml", 'r')
|
||||
template_content = file_template.read()
|
||||
file_template.close()
|
||||
|
||||
if "v3" in param and "promotion" in param:
|
||||
print("Kenta", directory_to_process)
|
||||
pro_template = open(directory_to_process + "/event/event_v3/promotion_template.inc")
|
||||
pro_template_content = pro_template.read()
|
||||
pro_template.close()
|
||||
|
||||
all_active_pro = ""
|
||||
|
||||
files = os.listdir(directory_to_process + "/event/event_v3/catalog_other")
|
||||
files = [f for f in files if f.endswith(".json")]
|
||||
for filename in files:
|
||||
pro_json_file = open(directory_to_process + "/event/event_v3/catalog_other/"+ filename)
|
||||
pro_json = json.load(pro_json_file)
|
||||
start_time = datetime.datetime.strptime(pro_json["start"], "%Y-%m-%dT%H:%M:%S")
|
||||
end_time = datetime.datetime.strptime(pro_json["end"], "%Y-%m-%dT%H:%M:%S")
|
||||
if start_time > datetime.datetime.now() or datetime.datetime.now() < end_time:
|
||||
pro_content = str(pro_template_content)
|
||||
pro_content = pro_content.replace("#State", pro_json["state"])
|
||||
pro_content = pro_content.replace("#Type", pro_json["type"])
|
||||
pro_content = pro_content.replace("#MediaThai", pro_json["media_thai"])
|
||||
pro_content = pro_content.replace("#MediaEng", pro_json["media_eng"])
|
||||
pro_content = pro_content.replace("#EventClick", pro_json["event_click"])
|
||||
all_active_pro += pro_content + "\n\t"
|
||||
|
||||
pro_output_file = open(directory_to_process + "/event/event_v3/catalog_other/active_promotions.lxml", 'w')
|
||||
pro_output_file.write(template_content.replace(";banners", all_active_pro))
|
||||
pro_output_file.close()
|
||||
elif "v3" in param and "promotion" in param:
|
||||
file_template = open(directory_to_process + "/page_catalog_group_recommend.lxml", 'r')
|
||||
template_content = file_template.read()
|
||||
file_template.close()
|
||||
|
|
|
|||
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"start": "2025-05-01T00:00:00",
|
||||
"end": "2025-05-11T00:00:00",
|
||||
"state": "BoostEnergyProState",
|
||||
"type": "IMAGE",
|
||||
"media_thai": "ROOT/taobin_project/image/event/boost_energy/boost_energy.png",
|
||||
"media_eng": "ROOT/taobin_project/image/event/boost_energy/boost_energy.png",
|
||||
"event_click": "Open \"ROOT/taobin_project/xml/v3/page_catalog_group_pro_boost_energy.xml\""
|
||||
}
|
||||
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue