THAI: Promotion: Boost Energy Drink

This commit is contained in:
Kenta420 2025-04-23 09:48:14 +07:00
parent db1be33ec9
commit 5d29666002
79 changed files with 45159 additions and 12211 deletions

View file

@ -0,0 +1,158 @@
<Popup>
<Width> 1080 </Width>
<Height> 1920 </Height>
<Volume> SoundVolume </Volume>
<EventOpen>
Var Timeout = 0
Var ImageDir = "ROOT/taobin_project/image/event/boost_energy/"
If show_eng = "true" Then
Var GotDiscountImg = ImageDir + "got_discount_code_en.png"
Var ButtonIdleImg = "ROOT/taobin_project/image/collectiing/bn_confirm.png"
Var ButtonPressedImg = "ROOT/taobin_project/image/collectiing/bp_confirm.png"
Else
Var GotDiscountImg = ImageDir + "got_discount_code_th.png"
Var ButtonIdleImg = "ROOT/taobin_project/image/collectiing_en/bn_confirm.png"
Var ButtonPressedImg = "ROOT/taobin_project/image/collectiing_en/bp_confirm.png"
EndIf
Var CloseButtonState = "Invisible"
DEBUGVAR GotDiscountImg
DEBUGVAR TelephoneNumber
SAVELOG "[BOOST_ENERGY] Sending code"
Var Param1 = "157"
Var Param2 = ""
Var Param3 = ""
AddData 43 TelephoneNumber Param1 Param2 Param3
</EventOpen>
<Timeout> 1000 </Timeout>
<EventTimeout>
Var CountDownBrewing = BREW_CNT
Var ShowCountDownBrewing = CountDownBrewing
Var Timeout = Timeout + 1
If Timeout > 5 Then
SAVELOG "[BOOST_ENERGY] Timeout"
Open "ROOT/taobin_project/xml/page_lid_straw.xml"
EndIf
TimerReset
Refresh
</EventTimeout>
<EventMachine>
If MachineStage = "drink-success" Then
Var MachineState_Result = 1
EndIf
If MachineStage = "drink-failed" Then
Var MachineState_Result = 2
EndIf
</EventMachine>
<EventSecurity>
Open "/media/bt/xml/security_alarm.xml"
</EventSecurity>
<EventActionOk>
If Ext1a = "ok" Then
Else
SAVELOG "[BOOST_ENERGY] EventActionOk: Ext1a != ok send code fail"
DEBUGVAR ParamCP
DEBUGVAR TelephoneNumberX
DEBUGVAR TelephoneNumber
Var Seeker.TaobinErrorNetwork = 1
Var Seeker.PointTaobinStr = ParamCP
Var TelephoneNumber = TelephoneNumberX
Var Seeker.TNumberTaobinMember= TelephoneNumber
If show_eng = "true" Then
Var GotDiscountImg = ImageDir + "send_code_fail_en.png"
Else
Var GotDiscountImg = ImageDir + "send_code_fail_th.png"
EndIf
Var CloseButtonState = "Enable"
Var Timeout = 0
Refresh
EndIf
</EventActionOk>
<EventActionError>
SAVELOG "[BOOST_ENERGY] EventActionError: send code fail"
DEBUGVAR ParamCP
DEBUGVAR TelephoneNumberX
DEBUGVAR TelephoneNumber
Var Seeker.TaobinErrorNetwork = 1
Var Seeker.PointTaobinStr = ParamCP
Var TelephoneNumber = TelephoneNumberX
Var Seeker.TNumberTaobinMember= TelephoneNumber
If show_eng = "true" Then
Var GotDiscountImg = ImageDir + "send_code_fail_en.png"
Else
Var GotDiscountImg = ImageDir + "send_code_fail_th.png"
EndIf
Var CloseButtonState = "Enable"
Var Timeout = 0
Refresh
</EventActionError>
;include="ROOT/taobin_project/inc/video.inc"
<Image>
<X> 0 </X>
<Y> 380 </Y>
<Filename> GotDiscountImg </Filename>
</Image>
<Button>
<X> 397 </X>
<Y> 1783 </Y>
<State> CloseButtonState </State>
<Filename> ButtonIdleImg </Filename>
<FilenamePress> ButtonPressedImg </FilenamePress>
<EventClick>
Open "ROOT/taobin_project/xml/page_lid_straw.xml"
</EventClck>
</Button>
;
<Image>
<X> 751 </X>
<Y> 413 </Y>
<Filename> IMG_CNT </Filename>
</Image>
;
<Text>
<X> XPosiShowCountDownBrew </X>
<Y> 470 </Y>
<Align> End </Align>
<Width> 153 </Width>
<Size> 88 </Size>
<Font> RobotoBold </Font>
<Color> 0x513C2F </Color>
<Value> ShowCountDownBrewing </Value>
</Text>
</Popup>

View file

@ -281,6 +281,38 @@ else:
file_xml4.write( content_data)
file_xml4.close()
if "catalog_other_pro" in param:
with open(directory_to_process + "/page_catalog_group_other_other.xml", 'r') as otherCatalogFile:
otherCatalogConent = otherCatalogFile.read()
file_inc2 = open(directory_to_process + "/event/promotion_template_other_catalog.inc", 'r')
file_inc2_content = file_inc2.read()
file_inc2.close()
content_data = otherCatalogConent.replace(";BigLogoLayout", file_inc2_content)
content_data = content_data.replace("<Max> 16 </Max>", '<Max> 12 </Max>')
content_data = content_data.replace(";layout_mode", '<Mode> "EnableAdjust" </Mode>')
content_data = content_data.replace(";banner_shifting",
'''Var ColumnOverride[0] = 2
Var ColumnOverride[1] = 2
Var ColumnOverride[2] = 4
Var ColumnOverride[3] = 4
Var ColumnOverride[4] = 4
Var ColumnGravity[0] = 3
Var ColumnGravity[1] = 3
''')
file_xml3_out = open(directory_to_process + "/event/out_put_file_other_catalog.txt", 'r')
file_xml3_out_content = file_xml3_out.read()
file_xml3_out_content = file_xml3_out_content.strip()
file_xml3_out_content = file_xml3_out_content.replace("\r", "")
file_xml3_out_content = file_xml3_out_content.replace("\n", "")
with open(directory_to_process + file_xml3_out_content, 'w') as outputFile:
outputFile.write(content_data)
if "multi_promotion" in param:
files = os.listdir(directory_to_process + "/event/")
files = [f for f in files if f.startswith("multi_promotion_config")]

View file

@ -0,0 +1 @@
/event/promotion_boost_energy.xml

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,15 @@
<Button>
<X> 42 </X>
<Y> 518 </Y>
<State> BigButtonEnable </State>
<Filename> "ROOT/taobin_project/image/event/boost_energy/boost_energy.png" </Filename>
<FilenamePress> "ROOT/taobin_project/image/event/boost_energy/boost_energy.png" </FilenamePress>
<FilenameDisable> "ROOT/taobin_project/image/event/boost_energy/boost_energy.png" </FilenameDisable>
<EventOnClick>
Open "ROOT/taobin_project/xml/page_catalog_group_pro_boost_energy.xml"
</EventOnClick>
</Button>

View file

@ -80,6 +80,9 @@ Var PepsiXTaobinPro = 0
; 3 dialects sound campaign, 1 Apr - 30 Apr
Var SongkranSoundCampaign = 0
; Boost Energy drink, 1 - 11 May
Var BoostEnergyPro = 0
Var NewCollectPoint = 1
Var PaymentCodeShouldCollectPromotionPoint = 0
@ -128,6 +131,11 @@ If SystemDateMonthInt = 3 Then
EndIf
EndIf
If SystemDateMonthInt = 5 Then
If SystemDateDayInt <= 11 Then
Var BoostEnergyPro = 1
EndIf
EndIf
Var JemilaToppingFlag = 1