Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
node_crisp
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
web
node_crisp
Commits
4a787372
Commit
4a787372
authored
Jun 04, 2021
by
Gabriel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Agrega pregunta de confirmacion luego de seleccionar fecha y hora
parent
83e0c84b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
0 deletions
+27
-0
handlers.js
handlers.js
+25
-0
pasos.js
pasos.js
+2
-0
No files found.
handlers.js
View file @
4a787372
...
...
@@ -282,8 +282,30 @@ module.exports =
}
}
userData
[
TURNO_ELEGIDO
]
=
turno
;
await
this
.
ask_confirmar_fecha_hora
(
message
,
userData
,
website_id
,
session_id
);
}
},
ask_confirmar_fecha_hora
:
async
function
(
message
,
userData
,
website_id
,
session_id
){
await
crisp
.
sendTextMessage
(
website_id
,
session_id
,
'Perfecto, confirmemos los datos'
);
let
fechaArg
=
userData
[
FECHA_TURNO
];
let
horaArg
=
fechaHoraUsaToFechaHoraArg
(
userData
[
TURNO_ELEGIDO
].
fechaHora
).
split
(
" "
)[
1
];
await
crisp
.
sendTextMessage
(
website_id
,
session_id
,
`El turno sera programado con
${
userData
[
NOMBRE_MEDICO
]}
, el
${
fechaArg
}
a las
${
horaArg
}
`
);
let
choices
=
[];
choices
.
push
(
utils
.
armarChoice
(
'Confirmar'
,
'Confirmar'
));
choices
.
push
(
utils
.
armarChoice
(
'Modificar'
,
'Modificar'
));
await
crisp
.
setSiguientePaso
(
website_id
,
session_id
,
pasos
.
RESP_CONFIRMAR_FECHA_HORA
,
userData
);
await
crisp
.
sendPickerMessage
(
website_id
,
session_id
,
pasos
.
RESP_CONFIRMAR_FECHA_HORA
,
'Es correcto?'
,
choices
);
},
resp_confirmar_fecha_hora
:
async
function
(
message
,
userData
,
website_id
,
session_id
){
let
choice
=
getChoiceElegida
(
message
);
if
(
choice
.
value
===
'Confirmar'
){
await
this
.
ask_tipo_documento
(
message
,
userData
,
website_id
,
session_id
);
}
else
{
userData
[
MOSTRANDO_TURNOS_HASTA_KEY
]
=
null
;
userData
[
TURNOS_DISPONIBLES
]
=
null
;
await
this
.
ask_fecha_turno
(
message
,
userData
,
website_id
,
session_id
);
}
},
ask_tipo_documento
:
async
function
(
message
,
userData
,
website_id
,
session_id
){
await
crisp
.
sendTextMessage
(
website_id
,
session_id
,
'Perfecto, ahora vamos a asociar tu datos. Selecciona tu tipo de documento'
);
...
...
@@ -380,6 +402,9 @@ module.exports =
userData
[
MOSTRANDO_PROVINCIAS_HASTA_KEY
]
=
null
;
userData
[
MOSTRANDO_MEDICOS_ESPECIALIDAD_HASTA_KEY
]
=
null
;
userData
[
MOSTRANDO_TURNOS_HASTA_KEY
]
=
null
;
userData
[
MEDICOS_ESPECIALIDAD
]
=
null
;
userData
[
MEDICOS
]
=
null
;
userData
[
TURNOS_DISPONIBLES
]
=
null
;
await
crisp
.
updateUserData
(
website_id
,
session_id
,
userData
);
await
this
.
ask_nombre_medico
(
message
,
userData
,
website_id
,
session_id
);
}
...
...
pasos.js
View file @
4a787372
...
...
@@ -10,6 +10,8 @@ module.exports = Object.freeze({
RESP_FECHA_TURNO
:
'resp_fecha_turno'
,
ASK_HORA_TURNO
:
'ask_hora_turno'
,
RESP_HORA_TURNO
:
'resp_hora_turno'
,
ASK_CONFIRMAR_FECHA_HORA
:
'ask_confirmar_fecha_hora'
,
RESP_CONFIRMAR_FECHA_HORA
:
'resp_confirmar_fecha_hora'
,
ASK_TIPO_DOCUMENTO
:
'ask_tipo_documento'
,
RESP_TIPO_DOCUMENTO
:
'resp_tipo_documento'
,
ASK_NUMERO_DOCUMENTO
:
'ask_numero_documento'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment