add feature SMS,SGP: WIP fullscreen

This commit is contained in:
Pakin 2025-03-20 11:01:33 +07:00
parent ddcb4273c5
commit b2da614560
11 changed files with 748 additions and 6 deletions

View file

@ -578,6 +578,47 @@
out_xml( '</Text>\r\n')
# feature: alert sms
out_xml('\t<Button>\r\n')
out_xml( '\t<X> TextPriceMenuBlendX </X>\r\n')
out_xml( '\t<Y> 0 </Y>\r\n')
out_xml('\t<State> eval(\r\n')
out_xml(f'\t\tIf $Sum{str_con_var} = "Disable" Then\r\n')
out_xml('\t\t\tIf EnableSMSDrinkReady = "true" Then\r\n')
out_xml('\t\t\t\tVar return = "Enable"\r\n')
out_xml('\t\t\tElse\r\n')
out_xml('\t\t\t\tVar return = "Invisible"\r\n')
out_xml('\t\t\tEndIf\r\n')
out_xml('\t\tElse\"\r\n')
out_xml('\t\t\tVar return = "Invisible"\r\n')
out_xml('\t\tEndIf\r\n')
out_xml('\t) </State>\r\n')
out_xml( '\t<Filename> "ROOT/taobin_project/image/feature/alert_sms/bn_alert_customer.png" </Filename>\r\n')
out_xml( '\t<FilenamePress> "ROOT/taobin_project/image/feature/alert_sms/bn_alert_customer.png" </FilenamePress>\r\n')
out_xml('\t<EventOnClick>\r\n')
alert_names = '\r\n'.join(
f'\t\tVar AlertProductName[{x}] = "{spl[ idx_name][ x + 1]}"'
for x in range(max_can_have_lang)
if x < len( spl[ idx_name])
)
# alert script part
out_xml(f"""{alert_names}
\t\t\tVar AlertProductCode[0] = "{str_hot_product_code}"
\t\t\tVar AlertProductCode[1] = "{str_cold_product_code}"
\t\t\tVar AlertProductCode[2] = "{str_blend_product_code}"
\t\t\tDEBUGVAR "alert!!!"
\t\t\tTabMenuVisibleInst 99
\t\t\tRootLayoutVisible 13 "hide"
\t\t\tOpenInst 2 "ROOT/taobin_project/xml/features/alert_sms/page_enter_num.lxml"\r\n""")
out_xml('\t</EventOnClick>\r\n')
out_xml('\t</Button>\r\n')
out_xml( '</Block>\r\n')
@ -706,13 +747,19 @@
print( '==>\t; '+ spl[ idx_name][ idx_hot_product_code] + ' ' + spl[ idx_name][ idx_cold_product_code] + ' ' + spl[ idx_name][ idx_blend_product_code] + ' \r\n')
if "," in spl[ idx_name][ idx_hot_product_code] and "," in spl[ idx_name][ idx_cold_product_code] and "," in spl[ idx_name][ idx_blend_product_code]:
#print(" hot = " + spl[ idx_name][ idx_hot_product_code])
print(" hot = " + spl[ idx_name][ idx_hot_product_code])
hot_pd = spl[ idx_name][ idx_hot_product_code].split(',')
print("ok hot")
cold_pd = spl[ idx_name][ idx_cold_product_code].split(',')
print("ok cold")
blend_pd = spl[ idx_name][ idx_blend_product_code].split(',')
date_time_start = spl[idx_name][idx_date_time_start]
date_time_end = spl[idx_name][idx_date_time_end]
product_var = spl[idx_name][idx_product_var]
print("ok blend")
date_time_start = spl[idx_name][idx_date_time_start] if len(spl[idx_name]) > 17 else "-"
print("ok datetime")
date_time_end = spl[idx_name][idx_date_time_end] if len(spl[idx_name]) > 17 else "-"
print("ok datetime end")
product_var = spl[idx_name][idx_product_var] if len(spl[idx_name]) > 17 else "-"
print("ok pd")
# if len(spl) > idx_name and len(spl[idx_name]) > max(idx_date_time_start, idx_date_time_end, idx_product_var):
# date_time_start = spl[idx_name][idx_date_time_start]
# date_time_end = spl[idx_name][idx_date_time_end]