diff --git a/assets/favicon.png b/assets/favicon.png index 6ded62f..419309a 100644 Binary files a/assets/favicon.png and b/assets/favicon.png differ diff --git a/assets/icon.png b/assets/icon.png index 6ded62f..419309a 100644 Binary files a/assets/icon.png and b/assets/icon.png differ diff --git a/assets/icons/icon.png b/assets/icons/icon.png index 6ded62f..419309a 100644 Binary files a/assets/icons/icon.png and b/assets/icons/icon.png differ diff --git a/assets/icons/loading-animation.png b/assets/icons/loading-animation.png index 6ded62f..419309a 100644 Binary files a/assets/icons/loading-animation.png and b/assets/icons/loading-animation.png differ diff --git a/assets/icons/splash.png b/assets/icons/splash.png new file mode 100644 index 0000000..419309a Binary files /dev/null and b/assets/icons/splash.png differ diff --git a/assets/icons/splash_dark_android.png b/assets/icons/splash_dark_android.png new file mode 100644 index 0000000..419309a Binary files /dev/null and b/assets/icons/splash_dark_android.png differ diff --git a/assets/icons/splash_dark_ios.png b/assets/icons/splash_dark_ios.png new file mode 100644 index 0000000..419309a Binary files /dev/null and b/assets/icons/splash_dark_ios.png differ diff --git a/assets/icons/splash_ios.png b/assets/icons/splash_ios.png new file mode 100644 index 0000000..419309a Binary files /dev/null and b/assets/icons/splash_ios.png differ diff --git a/components/widgets.py b/components/widgets.py index 2abedbe..8cbacc6 100644 --- a/components/widgets.py +++ b/components/widgets.py @@ -16,10 +16,14 @@ def update_total(self): self.total_final.update() if total > 0: self.clear_all_button.visible = True + self.send_button.visible = True self.clear_all_button.update() + self.send_button.update() else: self.clear_all_button.visible = False + self.send_button.visible = False self.clear_all_button.update() + self.send_button.update() def on_change_billete(self, e): valor = int(e.control.data) @@ -48,13 +52,37 @@ def clear_tf(self, e): self.totales[int(e.control.data)].update() self.update_total() + + def send_total(self, e): + total = 0 + for billete in self.billetes: + if self.text_fields[billete].value: + total += int(self.text_fields[billete].value) * billete + self.page.launch_url(f"whatsapp://send?phone=2994516661&text=Total en efectivo: ${total}") + + + def close_keyboard(self, e): + for billete in self.billetes: + self.text_fields[billete].disabled = True + self.update() + for billete in self.billetes: + self.text_fields[billete].disabled = False + self.update() + + def __init__(self): super().__init__() + self.padding = 20 + self.border_radius = 10 + self.margin = 20 + self.bgcolor = ft.colors.SURFACE_VARIANT + # self.bgcolor = ft.colors.PRIMARY_CONTAINER self.totales = { billete: ft.Text("= $0", width=100, size=16) for billete in self.billetes } self.total_final = ft.Text("Total: $0", size=24, weight=ft.FontWeight.BOLD) + self.text_fields = { billete: ft.TextField(label=f"", height=40, content_padding=3, input_filter=ft.NumbersOnlyInputFilter(), on_change=self.on_change_billete, @@ -77,69 +105,78 @@ def __init__(self): ) for billete in self.billetes } + self.send_button = ft.IconButton( + ft.icons.SEND, + on_click=self.send_total, + visible=False + ) self.clear_all_button = ft.IconButton( ft.icons.CLEAR_ALL, on_click=self.clear_all_tf, visible=False ) - self.content = ft.Column( - [ - ft.Stack( - [ - ft.Row( - [ - self.total_final, - ], - alignment=ft.MainAxisAlignment.CENTER, - ), - ft.Row( - [ - self.clear_all_button - ], - alignment=ft.MainAxisAlignment.END, - ) - ], - ), - ft.Column( - [ - ft.ListView( - [ - ft.ListTile( - leading=ft.Row( - [ - ft.Row( - [ - ft.Icon(ft.icons.ATTACH_MONEY), - ft.Text(f"{billete}", size=20, weight=ft.FontWeight.BOLD) - ], - width=120 - ), - ft.Row( - [ - ft.Text("x", size=20, weight=ft.FontWeight.BOLD), - ft.Container( - self.text_fields[billete], - padding=ft.padding.only(left=10, right=10) - ), - self.totales[billete] - ], - expand=True, - alignment=ft.MainAxisAlignment.SPACE_BETWEEN - ) - ], - spacing=0, - vertical_alignment=ft.CrossAxisAlignment.CENTER, - ), - content_padding=0, - ) - for billete in self.billetes - ] - ) - ], - expand=True, - scroll="auto" - ) - ] + self.content = ft.GestureDetector( + on_tap=self.close_keyboard, + content=ft.Column( + [ + ft.Stack( + [ + ft.Row( + [ + self.total_final, + ], + alignment=ft.MainAxisAlignment.CENTER, + ), + ft.Row( + [ + self.clear_all_button, + self.send_button + ], + alignment=ft.MainAxisAlignment.END, + ) + ], + ), + ft.Column( + [ + ft.ListView( + [ + ft.ListTile( + leading=ft.Row( + [ + ft.Row( + [ + ft.Icon(ft.icons.ATTACH_MONEY), + ft.Text(f"{billete}", size=20, weight=ft.FontWeight.BOLD) + ], + width=120 + ), + ft.Row( + [ + ft.Text("x", size=20, weight=ft.FontWeight.BOLD), + ft.Container( + self.text_fields[billete], + padding=ft.padding.only(left=10, right=10) + ), + self.totales[billete] + ], + expand=True, + alignment=ft.MainAxisAlignment.SPACE_BETWEEN + ) + ], + spacing=0, + vertical_alignment=ft.CrossAxisAlignment.CENTER, + ), + content_padding=0, + ) + for billete in self.billetes + ] + ) + ], + expand=True, + scroll="auto" + ) + ] + ), ) class Widget(ft.Container): @@ -340,6 +377,17 @@ def __init__(self): duration=800 ) + + + self.border_radius=10 + self.border=ft.border.all(1, ft.colors.BLACK12) + self.bgcolor=ft.colors.PRIMARY_CONTAINER + self.width=400 + self.margin = ft.margin.all(10) + self.padding=ft.padding.all(10) + self.bgcolor=ft.colors.SURFACE_VARIANT + self.border_radius=10 + self.descuento = 15 self.copy_value = 0 @@ -461,11 +509,6 @@ def __init__(self): pointer ] ) - self.border_radius=10 - self.border=ft.border.all(1, ft.colors.BLACK12) - self.bgcolor=ft.colors.PRIMARY_CONTAINER - self.width=400 - self.padding=10 class ColorButton(ft.IconButton): diff --git a/main.py b/main.py index d39f632..416ceee 100644 --- a/main.py +++ b/main.py @@ -65,11 +65,11 @@ class RusContactos(ft.Tabs): "Vehículos": { "TOTALES": { "Descripción": "Este equipo gestionará integralmente el 100% de los siniestros de Robo Total, Daños Total e Incendio Total Bolsa CRM: Siniestros Automotores - Totales", - "Correo": ["siniestrostotales@riouruguay.com"], + "Correo": ["siniestrostotales@riouruguay.com.ar"], }, "DAÑOS PARCIALES": { "Descripción": "Este equipo gestionará los casos de, Daños Parciales de Todo Riesgo, Robos, Parciales (no ruedas y baterías), Daños, de Granizo e Incendio Parcial.", - "Correo": ["siniestrosparciales@riouruguay.com"], + "Correo": ["siniestrosparciales@riouruguay.com.ar"], }, "FAST TRACKAUTOMOTORES": { "Descripción": "Este equipo gestionará reclamos de Daños de Cristales, Cerraduras y Robo de Ruedas y Batería. Bolsa CRM: Siniestros Automotores - Fast Track", @@ -79,7 +79,7 @@ class RusContactos(ft.Tabs): "CLEAS": { "TRAMITACIONES": { "Descripción": "Este equipo definira la responsabilidad del 100% de casos ue ingresen a la plataforma CLEAS. Bolsa CRM: Siniestros Automotores - Cleas - Tramitación", - "Correo": ["siniestroscleas@riouruguay.com"], + "Correo": ["siniestroscleas@riouruguay.com.ar"], }, "CIERRES": { "Descripción": "Este equipo definira la responsabilidad del 100% de casos CLEAS y gestionará los cierres de aquellos trámites definidos a favor de RUS donde la antguedad de los vehículos sea mayor a 15 años. Bolsa CRM: Siniestros Automotores - Cleas - Cierres", @@ -142,8 +142,8 @@ class RusContactos(ft.Tabs): def call_phone(self, phone_number): def handle_click(e): # whatsapp://send?phone=214324234 - self.page.launch_url(f"whatsapp://send?phone={phone_number}") - # self.page.launch_url(f"tel:{phone_number}") + # self.page.launch_url(f"whatsapp://send?phone={phone_number}") + self.page.launch_url(f"tel:{phone_number}") return handle_click @@ -245,7 +245,7 @@ def create_emails_section(self): height=30, icon_size=20, ), - bgcolor=ft.colors.BACKGROUND, + bgcolor=ft.colors.PRIMARY_CONTAINER, border_radius=100, ), ], @@ -283,9 +283,6 @@ def create_emails_section(self): margin=ft.margin.only(bottom=10), bgcolor=ft.colors.SURFACE_VARIANT, border_radius=10, - shadow=ft.BoxShadow( - spread_radius=1, blur_radius=5, color=ft.colors.SHADOW - ), ) sections.append(section) @@ -385,7 +382,10 @@ def __init__(self): # Configurar las pestañas self.tabs = [ - ft.Tab(text="Premio", content=CalculadoraPremio()), + ft.Tab( + text="Premio", + icon=ft.icons.ATTACH_MONEY, + content=CalculadoraPremio()), ft.Tab( text="Teléfonos", icon=ft.icons.PHONE,