Merge branch 'masterpiece' of ssh://forthrd.ddns.net:2222/1TBHDD/ikong/taobin_project into masterpiece
This commit is contained in:
commit
70586c95cb
79 changed files with 14251 additions and 9627 deletions
32
inter/tha/xml/multi/v3/event/dummy_layout_promotion.py
Normal file
32
inter/tha/xml/multi/v3/event/dummy_layout_promotion.py
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
|
||||
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')
|
||||
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")]
|
||||
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\t"
|
||||
|
||||
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()
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"start": "2025-04-01T00:00:00",
|
||||
"end": "2025-04-30T00:00:00",
|
||||
"state": "KingdomThaiTeaProState",
|
||||
"type": "IMAGE",
|
||||
"media_thai": "ROOT/taobin_project/image/event/kingdom_thai_tea/kingdom_thai_tea.png",
|
||||
"media_eng": "ROOT/taobin_project/image/event/kingdom_thai_tea/kingdom_thai_tea.png",
|
||||
"event_click": "Open \"ROOT/taobin_project/xml/v3/page_catalog_group_pro_kingdom_thai_tea.xml\""
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"start": "2025-04-07T00:00:00",
|
||||
"end": "2025-04-27T00:00:00",
|
||||
"state": "PepsiXTaobinProState",
|
||||
"type": "VIDEO",
|
||||
"media_thai": "ROOT/taobin_project/image/event/pepsi_x_taobin/pepsi_x_taobin.mp4",
|
||||
"media_eng": "ROOT/taobin_project/image/event/pepsi_x_taobin/pepsi_x_taobin.mp4",
|
||||
"event_click": "Open \"ROOT/taobin_project/xml/v3/page_catalog_group_pro_pepsi_x_taobin.xml\""
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"start": "2025-03-10T00:00:00",
|
||||
"end": "2025-03-31T00:00:00",
|
||||
"state": "MatchaEveryDayProState",
|
||||
"type": "IMAGE",
|
||||
"media_thai": "ROOT/taobin_project/image/event/matcha_every_day/matcha_every_day.png",
|
||||
"media_eng": "ROOT/taobin_project/image/event/matcha_every_day/matcha_every_day.png",
|
||||
"event_click": "Open \"ROOT/taobin_project/xml/v3/page_catalog_group_pro_matcha_every_day.xml\""
|
||||
}
|
||||
14220
inter/tha/xml/multi/v3/event/event_v3/active_promotions.xml
Normal file
14220
inter/tha/xml/multi/v3/event/event_v3/active_promotions.xml
Normal file
File diff suppressed because it is too large
Load diff
16
inter/tha/xml/multi/v3/event/event_v3/promotion_template.inc
Normal file
16
inter/tha/xml/multi/v3/event/event_v3/promotion_template.inc
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
<Banner>
|
||||
<State> #State </State>
|
||||
<Type> #Type </Type>
|
||||
<Media>
|
||||
eval(
|
||||
If show_eng = "true" Then
|
||||
Var return = "#MediaEng"
|
||||
Else
|
||||
Var return = "#MediaThai"
|
||||
EndIf
|
||||
)
|
||||
</Media>
|
||||
<EventOnClick>
|
||||
#EventClick
|
||||
</EventOnClick>
|
||||
</Banner>
|
||||
20
inter/tha/xml/multi/v3/event/script_open_promotion_v3.ev
Normal file
20
inter/tha/xml/multi/v3/event/script_open_promotion_v3.ev
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
|
||||
|
||||
|
||||
Var FileRecommendToOpen = "ROOT/taobin_project/inter/tha/xml/multi/v3/event/event_v3/active_promotions.lxml"
|
||||
|
||||
Var MatchaEveryDayProState = "Invisible"
|
||||
Var KingdomThaiTeaProState = "Invisible"
|
||||
Var PepsiXTaobinProState = "Invisible"
|
||||
|
||||
If MatchaEveryDayPro = 1 Then
|
||||
Var MatchaEveryDayProState = "Enable"
|
||||
EndIf
|
||||
|
||||
If KingdomThaiTeaPro = 1 Then
|
||||
Var KingdomThaiTeaProState = "Enable"
|
||||
EndIf
|
||||
|
||||
If PepsiXTaobinPro = 1 Then
|
||||
Var PepsiXTaobinProState = "Enable"
|
||||
EndIf
|
||||
|
|
@ -17,7 +17,7 @@
|
|||
</EventOpen>
|
||||
|
||||
<EventOnShow>
|
||||
;include="ROOT/taobin_project/inter/tha/xml/multi/menu_catalog_default_init.lxml"
|
||||
;include="ROOT/taobin_project/inter/tha/xml/multi/menu_catalog_default_init.lxml"
|
||||
Var Menu4Selected = "PressForever"
|
||||
|
||||
RootLayoutVisible 12 "show"
|
||||
|
|
@ -49,14 +49,14 @@
|
|||
EndIf
|
||||
|
||||
|
||||
|
||||
|
||||
GetVisible inst_show_milk_cupe
|
||||
|
||||
|
||||
|
||||
If inst_show_milk_cupe = 1 Then
|
||||
If inst_show_milk_cupe_counter > 0 Then
|
||||
DEBUGVAR inst_show_milk_cupe_counter
|
||||
|
||||
|
||||
Var inst_show_milk_cupe_counter = inst_show_milk_cupe_counter - 1
|
||||
|
||||
If inst_show_milk_cupe_counter = 0 Then
|
||||
|
|
@ -12435,6 +12435,7 @@
|
|||
|
||||
|
||||
|
||||
|
||||
<EventUnitTest4>
|
||||
RefreshAll
|
||||
</EventUnitTest4>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<?hurr
|
||||
#include=menu_head.py
|
||||
<?hurr
|
||||
#include=menu_head.py
|
||||
?>
|
||||
|
||||
<Popup>
|
||||
|
|
@ -19,7 +19,7 @@
|
|||
</EventOpen>
|
||||
|
||||
<EventOnShow>
|
||||
;include="ROOT/taobin_project/inter/tha/xml/multi/menu_catalog_default_init.lxml"
|
||||
;include="ROOT/taobin_project/inter/tha/xml/multi/menu_catalog_default_init.lxml"
|
||||
Var Menu4Selected = "PressForever"
|
||||
|
||||
RootLayoutVisible 12 "show"
|
||||
|
|
@ -51,14 +51,14 @@
|
|||
EndIf
|
||||
|
||||
|
||||
|
||||
|
||||
GetVisible inst_show_milk_cupe
|
||||
|
||||
|
||||
|
||||
If inst_show_milk_cupe = 1 Then
|
||||
If inst_show_milk_cupe_counter > 0 Then
|
||||
DEBUGVAR inst_show_milk_cupe_counter
|
||||
|
||||
|
||||
Var inst_show_milk_cupe_counter = inst_show_milk_cupe_counter - 1
|
||||
|
||||
If inst_show_milk_cupe_counter = 0 Then
|
||||
|
|
@ -76,10 +76,13 @@
|
|||
|
||||
|
||||
|
||||
<?hurr
|
||||
<?hurr
|
||||
#include=menu_new_layout_gen_v3.py
|
||||
?>
|
||||
|
||||
<?hurr
|
||||
#include=./event/dummy_layout_promotion.py
|
||||
?>
|
||||
|
||||
<EventUnitTest4>
|
||||
RefreshAll
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue