Merged by xmlgen

This commit is contained in:
wanlop run 2025-04-23 14:32:30 +07:00
commit 4ed0820d09
98 changed files with 79664 additions and 13974 deletions

View file

@ -1,7 +1,5 @@
if "v3" in param and "promotion" in param:
print("Kenta", directory_to_process)
file_template = open(directory_to_process + "/page_catalog_group_recommend.lxml", 'r')
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()
@ -11,10 +9,10 @@ if "v3" in param and "promotion" in param:
all_active_pro = ""
files = os.listdir(directory_to_process + "/event/event_v3")
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/"+ filename)
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")
@ -27,6 +25,38 @@ if "v3" in param and "promotion" in param:
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()
if "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()
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")
files = [f for f in files if f.endswith(".json")]
files.sort()
for filename in files:
pro_json_file = open(directory_to_process + "/event/event_v3/"+ 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"
pro_output_file = open(directory_to_process + "/event/event_v3/active_promotions.lxml", 'w')
pro_output_file.write(template_content.replace(";banners", all_active_pro))
pro_output_file.close()

View file

@ -1,6 +1,6 @@
{
"start": "2025-03-10T00:00:00",
"end": "2025-03-31T00:00:00",
"start": "2025-05-01T00:00:00",
"end": "2025-05-31T00:00:00",
"state": "MatchaEveryDayProState",
"type": "IMAGE",
"media_thai": "ROOT/taobin_project/image/event/matcha_every_day/matcha_every_day.png",

View file

@ -0,0 +1,9 @@
{
"start": "2025-05-01T00:00:00",
"end": "2025-05-31T00:00:00",
"state": "OreoVolcanoProState",
"type": "IMAGE",
"media_thai": "ROOT/taobin_project/image/event/oreo_volcano/oreo_volcano_banner.png",
"media_eng": "ROOT/taobin_project/image/event/oreo_volcano/oreo_volcano_banner.png",
"event_click": "Open \"ROOT/taobin_project/xml/v3/page_catalog_group_pro_oreo_volcano.xml\""
}

File diff suppressed because it is too large Load diff

View file

@ -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

View file

@ -3,6 +3,7 @@
Var FileRecommendToOpen = "ROOT/taobin_project/inter/tha/xml/multi/v3/event/event_v3/active_promotions.lxml"
Var MatchaEveryDayProState = "Invisible"
Var OreoVolcanoProState = "Invisible"
Var KingdomThaiTeaProState = "Invisible"
Var PepsiXTaobinProState = "Invisible"
@ -10,6 +11,10 @@ If MatchaEveryDayPro = 1 Then
Var MatchaEveryDayProState = "Enable"
EndIf
If OreoVolcanoPro = 1 Then
Var OreoVolcanoProState = "Enable"
EndIf
If KingdomThaiTeaPro = 1 Then
Var KingdomThaiTeaProState = "Enable"
EndIf

View file

@ -0,0 +1,96 @@
<?hurr
#include=menu_head.py
echo param
?>
<Popup>
<Cache> "Enable" </Cache>
<Width> 1080 </Width>
<Height> 1920 </Height>
;<Background> "0xeae6e1" </Background>
<Volume> SoundVolume </Volume>
<EventOpen>
DEBUGVAR SlientRefreshIndex
If SlientRefreshIndex = 7 Then
Var SlientRefreshIndex = 8
EndIf
Var OtherOtherRefreshTimeOut = 1
Var inst_show_other_other_counter = 10
</EventOpen>
<EventOnShow>
;include="ROOT/taobin_project/inter/tha/xml/multi/menu_catalog_default_init.lxml"
; soda and other
Var Menu62Selected = "PressForever"
RootLayoutVisible 12 "show"
Var Timeout = 0
;include="ROOT/taobin_project/inter/tha/xml/multi/tab_menu_show_and_refresh.lxml"
SetInstanceIgnoreTouch
;include="ROOT/taobin_project/inter/tha/xml/multi/menu_catalog_new_menu.lxml"
Var OtherOtherRefreshTimeOut = 14
DEBUGVAR SlientRefreshIndex
RefreshAll
</EventOnShow>
<Timeout> 1000 </Timeout>
<EventTimeout>
;DEBUGVAR ICE_PROCESS_STATUS
;include="ROOT/taobin_project/inter/tha/xml/multi/InstanceGetSetString.inc"
; setvarint RefreshOtherOther 1
If RefreshOtherOther = 1 Then
Var RefreshOtherOther = 0
SAVELOG "OPEN FROM 8"
Open "ROOT/taobin_project/inter/tha/xml/multi/v3/page_catalog_group_other_other.lxml"
EndIf
GetVisible inst_show_other_other
;DEBUGVAR inst_show_other_other
Var OtherOtherRefreshTimeOut = OtherOtherRefreshTimeOut + 1
;DEBUGVAR OtherOtherRefreshTimeOut
If OtherOtherRefreshTimeOut > 15 Then
Var OtherOtherRefreshTimeOut = 0
Script "-" "-"
If inst_show_other_other = 1 Then
;RefreshAll
EndIf
EndIf
TimerReset
</EventTimeout>
;include="ROOT/taobin_project/inter/tha/xml/multi/menu_catalog_new.lxml"
<?hurr
#include=menu_new_layout_gen_v3.py
?>
</Popup>

View file

@ -0,0 +1,42 @@
<?hurr
#include=menu_head.py
?>
<Popup>
<Cache> "Enable" </Cache>
<Width> 1080 </Width>
<Height> 1920 </Height>
;<Background> "0xeae6e1" </Background>
<Volume> SoundVolume </Volume>
<EventOpen>
; On open
;include="ROOT/taobin_project/inter/tha/xml/multi/menu_catalog_default_init.lxml"
Var Timeout = 0
;include="ROOT/taobin_project/inter/tha/xml/multi/menu_catalog_new_menu.lxml"
SetInstanceIgnoreTouch
</EventOpen>
<Timeout> 1000 </Timeout>
<EventTimeout>
;include="ROOT/taobin_project/inter/tha/xml/multi/ForProGroup.inc"
TimerReset
</EventTimeout>
;include="ROOT/taobin_project/inter/tha/xml/multi/menu_catalog_new.lxml"
<?hurr
#include=menu_new_layout_gen_v3.py
?>
</Popup>