Skip to content

Commit

Permalink
final
Browse files Browse the repository at this point in the history
  • Loading branch information
ositoMalvado committed Oct 30, 2024
1 parent 5fab232 commit 513dfa2
Show file tree
Hide file tree
Showing 10 changed files with 116 additions and 73 deletions.
Binary file modified assets/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/icons/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/icons/loading-animation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/splash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/splash_dark_android.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/splash_dark_ios.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/splash_ios.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
169 changes: 106 additions & 63 deletions components/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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,
Expand All @@ -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):
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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):
Expand Down
20 changes: 10 additions & 10 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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": ["[email protected]"],
"Correo": ["[email protected].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": ["[email protected]"],
"Correo": ["[email protected].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",
Expand All @@ -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": ["[email protected]"],
"Correo": ["[email protected].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",
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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,
),
],
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 513dfa2

Please sign in to comment.